diff --git a/.gitignore b/.gitignore index 06372650dfa1d9a298a34e606cd30843b7739377..6b5600acbf67fc1c35c6af86c4a84f421a3b11d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .idea .DS_Store -target \ No newline at end of file +target +first schema.json +out/ \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 8be82c2cfc51f4ce596b6bb3e47db6af66e0c41e..0000000000000000000000000000000000000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Datasource local storage ignored files -/../../../../../../:\study\master\group project\AmazingProject\.idea/dataSources/ -/dataSources.local.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/.idea/AmazingProject.iml b/.idea/AmazingProject.iml deleted file mode 100644 index cdb52b2555d15be9b8f41abbdf7e8d8aa77963f4..0000000000000000000000000000000000000000 --- a/.idea/AmazingProject.iml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> - <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_11"> - <output url="file://$MODULE_DIR$/target/classes" /> - <output-test url="file://$MODULE_DIR$/target/test-classes" /> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> - <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> - <excludeFolder url="file://$MODULE_DIR$/target" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" scope="RUNTIME" name="Maven: com.h2database:h2:2.1.214" level="project" /> - <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.2" level="project" /> - <orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.16" level="project" /> - <orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" /> - <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" /> - <orderEntry type="library" name="Maven: junit:junit:4.12" level="project" /> - <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" /> - <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.24" level="project" /> - </component> -</module> \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 6837eaab034d0322febb8b44a0fc3376606ecdf7..0000000000000000000000000000000000000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="CompilerConfiguration"> - <annotationProcessing> - <profile name="Maven default annotation processors profile" enabled="true"> - <sourceOutputDir name="target/generated-sources/annotations" /> - <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> - <outputRelativeToContentRoot value="true" /> - <module name="AmazingProject" /> - </profile> - </annotationProcessing> - <bytecodeTargetLevel> - <module name="AmazingProject" target="11" /> - </bytecodeTargetLevel> - </component> - <component name="JavacSettings"> - <option name="ADDITIONAL_OPTIONS_OVERRIDE"> - <module name="AmazingProject" options="" /> - </option> - </component> -</project> \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 63e900193296f8ed911a1b9f5b051cf908099431..0000000000000000000000000000000000000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="Encoding"> - <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 6560a98983ec708cf9d8b5c5c3776d7bd39c475b..0000000000000000000000000000000000000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,36 +0,0 @@ -<component name="InspectionProjectProfileManager"> - <profile version="1.0"> - <option name="myName" value="Project Default" /> - <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true"> - <option name="TOP_LEVEL_CLASS_OPTIONS"> - <value> - <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> - <option name="REQUIRED_TAGS" value="" /> - </value> - </option> - <option name="INNER_CLASS_OPTIONS"> - <value> - <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> - <option name="REQUIRED_TAGS" value="" /> - </value> - </option> - <option name="METHOD_OPTIONS"> - <value> - <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> - <option name="REQUIRED_TAGS" value="@return@param@throws or @exception" /> - </value> - </option> - <option name="FIELD_OPTIONS"> - <value> - <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> - <option name="REQUIRED_TAGS" value="" /> - </value> - </option> - <option name="IGNORE_DEPRECATED" value="false" /> - <option name="IGNORE_JAVADOC_PERIOD" value="true" /> - <option name="IGNORE_DUPLICATED_THROWS" value="false" /> - <option name="IGNORE_POINT_TO_ITSELF" value="false" /> - <option name="myAdditionalJavadocTags" value="date" /> - </inspection_tool> - </profile> -</component> \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml deleted file mode 100644 index 712ab9d985c20018a0c97b93d2148ac1ffe588a5..0000000000000000000000000000000000000000 --- a/.idea/jarRepositories.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="RemoteRepositoriesConfiguration"> - <remote-repository> - <option name="id" value="central" /> - <option name="name" value="Central Repository" /> - <option name="url" value="https://repo.maven.apache.org/maven2" /> - </remote-repository> - <remote-repository> - <option name="id" value="central" /> - <option name="name" value="Maven Central repository" /> - <option name="url" value="https://repo1.maven.org/maven2" /> - </remote-repository> - <remote-repository> - <option name="id" value="jboss.community" /> - <option name="name" value="JBoss Community repository" /> - <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> - </remote-repository> - </component> -</project> \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_6_1.xml b/.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_6_1.xml deleted file mode 100644 index 233670ddcfabe66de8b6ab0c0a09a8e25b21a99e..0000000000000000000000000000000000000000 --- a/.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_6_1.xml +++ /dev/null @@ -1,13 +0,0 @@ -<component name="libraryTable"> - <library name="Maven: com.google.protobuf:protobuf-java:3.6.1"> - <CLASSES> - <root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/3.6.1/protobuf-java-3.6.1.jar!/" /> - </CLASSES> - <JAVADOC> - <root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/3.6.1/protobuf-java-3.6.1-javadoc.jar!/" /> - </JAVADOC> - <SOURCES> - <root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/3.6.1/protobuf-java-3.6.1-sources.jar!/" /> - </SOURCES> - </library> -</component> \ No newline at end of file diff --git a/.idea/libraries/Maven__com_h2database_h2_2_1_214.xml b/.idea/libraries/Maven__com_h2database_h2_2_1_214.xml deleted file mode 100644 index c3365cc665f3395c84c2ac172852ab5fe08ae616..0000000000000000000000000000000000000000 --- a/.idea/libraries/Maven__com_h2database_h2_2_1_214.xml +++ /dev/null @@ -1,13 +0,0 @@ -<component name="libraryTable"> - <library name="Maven: com.h2database:h2:2.1.214"> - <CLASSES> - <root url="jar://$MAVEN_REPOSITORY$/com/h2database/h2/2.1.214/h2-2.1.214.jar!/" /> - </CLASSES> - <JAVADOC> - <root url="jar://$MAVEN_REPOSITORY$/com/h2database/h2/2.1.214/h2-2.1.214-javadoc.jar!/" /> - </JAVADOC> - <SOURCES> - <root url="jar://$MAVEN_REPOSITORY$/com/h2database/h2/2.1.214/h2-2.1.214-sources.jar!/" /> - </SOURCES> - </library> -</component> \ No newline at end of file diff --git a/.idea/libraries/Maven__junit_junit_4_12.xml b/.idea/libraries/Maven__junit_junit_4_12.xml deleted file mode 100644 index d411041745b6e44356035cdd44538daca09388f6..0000000000000000000000000000000000000000 --- a/.idea/libraries/Maven__junit_junit_4_12.xml +++ /dev/null @@ -1,13 +0,0 @@ -<component name="libraryTable"> - <library name="Maven: junit:junit:4.12"> - <CLASSES> - <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" /> - </CLASSES> - <JAVADOC> - <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-javadoc.jar!/" /> - </JAVADOC> - <SOURCES> - <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/" /> - </SOURCES> - </library> -</component> \ No newline at end of file diff --git a/.idea/libraries/Maven__log4j_log4j_1_2_17.xml b/.idea/libraries/Maven__log4j_log4j_1_2_17.xml deleted file mode 100644 index e383c1bf1e55f2de28db071054723041d116b00c..0000000000000000000000000000000000000000 --- a/.idea/libraries/Maven__log4j_log4j_1_2_17.xml +++ /dev/null @@ -1,13 +0,0 @@ -<component name="libraryTable"> - <library name="Maven: log4j:log4j:1.2.17"> - <CLASSES> - <root url="jar://$MAVEN_REPOSITORY$/log4j/log4j/1.2.17/log4j-1.2.17.jar!/" /> - </CLASSES> - <JAVADOC> - <root url="jar://$MAVEN_REPOSITORY$/log4j/log4j/1.2.17/log4j-1.2.17-javadoc.jar!/" /> - </JAVADOC> - <SOURCES> - <root url="jar://$MAVEN_REPOSITORY$/log4j/log4j/1.2.17/log4j-1.2.17-sources.jar!/" /> - </SOURCES> - </library> -</component> \ No newline at end of file diff --git a/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_16.xml b/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_16.xml deleted file mode 100644 index b969cc3098d54326b8e69338d9c71ee4874d60e9..0000000000000000000000000000000000000000 --- a/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_16.xml +++ /dev/null @@ -1,13 +0,0 @@ -<component name="libraryTable"> - <library name="Maven: mysql:mysql-connector-java:8.0.16"> - <CLASSES> - <root url="jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16.jar!/" /> - </CLASSES> - <JAVADOC> - <root url="jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16-javadoc.jar!/" /> - </JAVADOC> - <SOURCES> - <root url="jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16-sources.jar!/" /> - </SOURCES> - </library> -</component> \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml deleted file mode 100644 index f58bbc11276f98bea2b6c82f21664c5a9f424fe3..0000000000000000000000000000000000000000 --- a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ -<component name="libraryTable"> - <library name="Maven: org.hamcrest:hamcrest-core:1.3"> - <CLASSES> - <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" /> - </CLASSES> - <JAVADOC> - <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar!/" /> - </JAVADOC> - <SOURCES> - <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" /> - </SOURCES> - </library> -</component> \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mybatis_mybatis_3_5_2.xml b/.idea/libraries/Maven__org_mybatis_mybatis_3_5_2.xml deleted file mode 100644 index 5a8050c3c698e1f21e6f783fe8de0fdcde56de24..0000000000000000000000000000000000000000 --- a/.idea/libraries/Maven__org_mybatis_mybatis_3_5_2.xml +++ /dev/null @@ -1,13 +0,0 @@ -<component name="libraryTable"> - <library name="Maven: org.mybatis:mybatis:3.5.2"> - <CLASSES> - <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/mybatis/3.5.2/mybatis-3.5.2.jar!/" /> - </CLASSES> - <JAVADOC> - <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/mybatis/3.5.2/mybatis-3.5.2-javadoc.jar!/" /> - </JAVADOC> - <SOURCES> - <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/mybatis/3.5.2/mybatis-3.5.2-sources.jar!/" /> - </SOURCES> - </library> -</component> \ No newline at end of file diff --git a/.idea/libraries/Maven__org_projectlombok_lombok_1_18_24.xml b/.idea/libraries/Maven__org_projectlombok_lombok_1_18_24.xml deleted file mode 100644 index d43fa188af467e6eaf749e78ef384fd48217270d..0000000000000000000000000000000000000000 --- a/.idea/libraries/Maven__org_projectlombok_lombok_1_18_24.xml +++ /dev/null @@ -1,13 +0,0 @@ -<component name="libraryTable"> - <library name="Maven: org.projectlombok:lombok:1.18.24"> - <CLASSES> - <root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.24/lombok-1.18.24.jar!/" /> - </CLASSES> - <JAVADOC> - <root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.24/lombok-1.18.24-javadoc.jar!/" /> - </JAVADOC> - <SOURCES> - <root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.24/lombok-1.18.24-sources.jar!/" /> - </SOURCES> - </library> -</component> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 3210399fc3cedd6663a9ebda8f384b81c06d3c09..0000000000000000000000000000000000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="MavenProjectsManager"> - <option name="originalFiles"> - <list> - <option value="$PROJECT_DIR$/pom.xml" /> - </list> - </option> - </component> - <component name="ProjectRootManager" version="2" languageLevel="JDK_14" project-jdk-name="14" project-jdk-type="JavaSDK"> - <output url="file://$PROJECT_DIR$/out" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 8a649375f127668f55a85eb3636af2bc904557e0..0000000000000000000000000000000000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="ProjectModuleManager"> - <modules> - <module fileurl="file://$PROJECT_DIR$/.idea/AmazingProject.iml" filepath="$PROJECT_DIR$/.idea/AmazingProject.iml" /> - </modules> - </component> -</project> \ No newline at end of file diff --git a/.idea/sqldialects.xml b/.idea/sqldialects.xml deleted file mode 100644 index f2dfab6b089d5343c7d7758283ee98b6b23a5ccc..0000000000000000000000000000000000000000 --- a/.idea/sqldialects.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="SqlDialectMappings"> - <file url="file://$PROJECT_DIR$/src/main/sql/schema-v1.sql" dialect="GenericSQL" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml deleted file mode 100644 index e96534fb27b68192f27f985d3879e173ec77adb8..0000000000000000000000000000000000000000 --- a/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="Palette2"> - <group name="Swing"> - <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> - </item> - <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> - </item> - <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> - </item> - <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true"> - <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> - </item> - <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> - <initial-values> - <property name="text" value="Button" /> - </initial-values> - </item> - <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> - <initial-values> - <property name="text" value="RadioButton" /> - </initial-values> - </item> - <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> - <initial-values> - <property name="text" value="CheckBox" /> - </initial-values> - </item> - <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> - <initial-values> - <property name="text" value="Label" /> - </initial-values> - </item> - <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> - <preferred-size width="150" height="-1" /> - </default-constraints> - </item> - <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> - <preferred-size width="150" height="-1" /> - </default-constraints> - </item> - <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> - <preferred-size width="150" height="-1" /> - </default-constraints> - </item> - <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> - <preferred-size width="150" height="50" /> - </default-constraints> - </item> - <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> - <preferred-size width="150" height="50" /> - </default-constraints> - </item> - <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> - <preferred-size width="150" height="50" /> - </default-constraints> - </item> - <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> - </item> - <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> - <preferred-size width="150" height="50" /> - </default-constraints> - </item> - <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> - <preferred-size width="150" height="50" /> - </default-constraints> - </item> - <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> - <preferred-size width="150" height="50" /> - </default-constraints> - </item> - <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> - <preferred-size width="200" height="200" /> - </default-constraints> - </item> - <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> - <preferred-size width="200" height="200" /> - </default-constraints> - </item> - <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> - </item> - <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> - </item> - <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> - </item> - <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> - </item> - <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> - <preferred-size width="-1" height="20" /> - </default-constraints> - </item> - <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> - </item> - <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> - </item> - </group> - </component> -</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1ddfbbc029bcab630581847471d7f238ec53..0000000000000000000000000000000000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="VcsDirectoryMappings"> - <mapping directory="" vcs="Git" /> - </component> -</project> \ No newline at end of file diff --git a/BranchAccountMovement.json b/BranchAccountMovement.json new file mode 100644 index 0000000000000000000000000000000000000000..db77f737e0ecb2dbc75e329060a3f6d6a0cf9880 --- /dev/null +++ b/BranchAccountMovement.json @@ -0,0 +1,136 @@ +{ + "name" : "BranchAccountMovement", + "entityList" : [ { + "name" : "branch", + "attributeList" : [ { + "name" : "sortcode", + "dataType" : "INT", + "isPrimary" : true, + "nullable" : false, + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + }, { + "name" : "bname", + "dataType" : "VARCHAR", + "isPrimary" : false, + "nullable" : false, + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + }, { + "name" : "cash", + "dataType" : "DOUBLE", + "isPrimary" : false, + "nullable" : false, + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + } ], + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + }, { + "name" : "account", + "attributeList" : [ { + "name" : "no", + "dataType" : "INT", + "isPrimary" : true, + "nullable" : false, + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + }, { + "name" : "type", + "dataType" : "CHAR", + "isPrimary" : false, + "nullable" : false, + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + }, { + "name" : "cname", + "dataType" : "VARCHAR", + "isPrimary" : false, + "nullable" : false, + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + }, { + "name" : "rate", + "dataType" : "DOUBLE", + "isPrimary" : false, + "nullable" : true, + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + } ], + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + }, { + "name" : "movement", + "attributeList" : [ { + "name" : "mid", + "dataType" : "INT", + "isPrimary" : true, + "nullable" : false, + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + }, { + "name" : "amount", + "dataType" : "DOUBLE", + "isPrimary" : false, + "nullable" : false, + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + }, { + "name" : "tdate", + "dataType" : "DATETIME", + "isPrimary" : false, + "nullable" : false, + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + } ], + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + } ], + "relationshipList" : [ { + "name" : "holds", + "firstEntity" : "account", + "firstCardinality" : "1:1", + "secondEntity" : "branch", + "secondCardinality" : "0:N", + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + }, { + "name" : "has", + "firstEntity" : "account", + "firstCardinality" : "0:N", + "secondEntity" : "movement", + "secondCardinality" : "1:1", + "layoutInfo" : { + "layoutX" : 0.0, + "layoutY" : 0.0 + } + } ] +} \ No newline at end of file diff --git a/Web/Web.iml b/Web/Web.iml new file mode 100644 index 0000000000000000000000000000000000000000..80cc7391bd4016c056199da0676d25067b0807d1 --- /dev/null +++ b/Web/Web.iml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="WEB_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> \ No newline at end of file diff --git a/Web/addRelation.html b/Web/addRelation.html new file mode 100644 index 0000000000000000000000000000000000000000..83eabd886cf0b20121c427c62572902aebea8bf7 --- /dev/null +++ b/Web/addRelation.html @@ -0,0 +1,91 @@ +<!doctype html> +<html lang="en"> + +<head> + <title>Add or Remove Input Fields Dynamically</title> + <script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> + <script type = "text/javascript" src="js/jquery-3.2.1.js"></script> + <style> + body { + display: flex; + flex-direction: column; + margin-top: 1%; + justify-content: center; + align-items: center; + } + #rowAdder { + margin-left: 17px; + } + label{ + cursor: pointer; + display: inline-block; + padding: 3px 6px; + text-align: right; + width: 150px; + vertical-align: top; + } + + </style> +</head> + +<body> +<form> + <p>relationship</p> + <div id="relationInput" class = "relationInput"></div> + <button id="relationAdder" type="button" class="btn btn-dark"><span></span>ADD</button> + <button id="addRelation" type="button" class="btn btn-dark"><span></span>CREATE</button> +</form> + +<script type="text/javascript"> + + + $("#relationAdder").click(function () { + newRowAdd = + '<div class="relationInput"><div class="relation" id = "relation">' + + '<input type="text" class="from"></input><br>'+ + '<input type="text" class="to"></input><br>'+ + '<input type="text" class="fromtext"></input><br>'+ + '<input type="text" class="toText"></input><br>'+ + '<button class="btn btn-danger" id="DeleteRow" type="button">Delete</button></div></div>'; + $('#relationInput').append(newRowAdd); + }); + + $("body").on("click", "#DeleteRow", function () { + $(this).parents("#relation").remove(); + }); + + $("body").on("click", "#addRelation", function () { + let linkDataArray = [{from: "Products", to:"Suppliers",text: "0..N",toText: "1" }]; + linkDataArray = []; + + $(".relation").each(function (){ + /* + initialize the attribute dict + */ + let relation_dict = {}; + let from = ""; + let to = ""; + let fromtext= ""; + let toText="" + + from = $(this).children(".from").val(); + to = $(this).children(".to").val(); + fromtext = $(this).children(".fromtext").val(); + toText = $(this).children(".toText").val(); + + if ((from !== undefined)) { + relation_dict.from = from; + relation_dict.to = to; + relation_dict.fromtext = fromtext; + relation_dict.toText = toText; + + linkDataArray.push(relation_dict); + } + }); + console.log(linkDataArray); + + }); +</script> +</body> + +</html> \ No newline at end of file diff --git a/Web/addentity.html b/Web/addentity.html new file mode 100644 index 0000000000000000000000000000000000000000..e5e005a0618967ab57c30269522c4e2b170587db --- /dev/null +++ b/Web/addentity.html @@ -0,0 +1,99 @@ + +<!doctype html> +<html lang="en"> + +<head> + <title>Add or Remove Input Fields Dynamically</title> + <script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> + <script type = "text/javascript" src="js/jquery-3.2.1.js"></script> + <style> + body { + display: flex; + flex-direction: column; + margin-top: 1%; + justify-content: center; + align-items: center; + } + #rowAdder { + margin-left: 17px; + } + </style> +</head> + +<body> +<div style="width:40%;top:200px"> + <form> + <div id="entity" class = "entity"> + <div class="entityName"><p>entity name</p><input id = "ename" type="text" class="attribute"></div> + <p>attributes</p> + <div id="newInput" class = "newInput"></div> + <button id="rowAdder" type="button" class="btn btn-dark"><span></span>ADD</button> + <button id="addEntity" type="button" class="btn btn-dark"><span></span>CREATE</button> + </div> + </form> +</div> + +<script type="text/javascript"> + + + $("#rowAdder").click(function () { + newRowAdd = + '<div class="newInput"><div class="attribute" id = "attribute">' + + '<input type="text" class="attribute_input"></input>'+ + '<button class="btn btn-danger" id="DeleteRow" type="button">Delete</button>'+ + '<input type="radio" class = "r" name = "primaryKey" id="key">is_key</input></div>'+'</div></div>'; + $('#newInput').append(newRowAdd); + }); + + $("body").on("click", "#DeleteRow", function () { + $(this).parents("#attribute").remove(); + }); + + $("body").on("click", "#addEntity", function () { + + const entity = {}; + const key = document.getElementById("ename").value; + let items = [{ name: "ProductID", iskey: true, figure: "Decision", color:"red"}]; + items = []; + entity.key = key; + + $(".attribute").each(function (){ + + /* + initialize the attribute dict + */ + let attribute_dict = {}; + let attribute_name = ""; + //TODO:not allow if entity is empty + attribute_name = $(this).children(".attribute_input").val(); + + if (attribute_name !== undefined) { + //TODO:not allow if attribute is empty + console.log(attribute_name); //test. TODO:delete + attribute_dict.name = attribute_name; + let is_primaryKey = true; + is_primaryKey = $('#r').is(':checked') ? true : false; + console.log(is_primaryKey); + + if (is_primaryKey==1){ + attribute_dict.iskey = true; + attribute_dict.figure = "TriangleUp"; + attribute_dict.color = "red"; + }else{ + attribute_dict.iskey = false; + attribute_dict.figure = "Decision"; + attribute_dict.color = "blue" + } + items.push(attribute_dict); + } + entity.items = items; + console.log(entity); + + + }); + + }); +</script> +</body> + +</html> \ No newline at end of file diff --git a/Web/clicktext.html b/Web/clicktext.html new file mode 100644 index 0000000000000000000000000000000000000000..7bb39a8555cd6be7e1c39c9d93da08f882a5f5f1 --- /dev/null +++ b/Web/clicktext.html @@ -0,0 +1,152 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Title</title> + <script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> + <script type = "text/javascript" src="js/jquery-3.2.1.js"></script> +</head> +<body> +<a onclick="showEntityForm()">Show the entity form</a><br> +<a onclick="showRelationForm()">Show the relation form</a> +<form id="formRelation" style="display: none;"> + <div class = board_form style="border: 1px solid black; + height: fit-content; + width:500px; + text-align: center; + position:absolute; + left: 50%; + top: 50%; + transform: translate(-50%,-50%);"> + <p>relationship</p> + <div id="relationInput" class = "relationInput"></div> + <button id="relationAdder" type="button" class="btn btn-dark"><span></span>ADD</button> + <button id="addRelation" type="button" class="btn btn-dark"><span></span>CREATE</button> + </div> +</form> +<form id="formEntity" style="display: none;"> + <div class = board_form style="border: 1px solid black; min-height:100%; width:500px;text-align: center;"> + <div id="entity" class = "entity"> + <div class="entityName"><p>entity name</p><input id = "ename" type="text" class="attribute"></div> + <p>attributes</p> + <div id="newInput" class = "newInput"></div> + <button id="rowAdder" type="button" class="btn btn-dark"><span></span>ADD</button> + <button id="addEntity" type="button" class="btn btn-dark"><span></span>CREATE</button> + </div> + </div> +</form> +</body> +<script type="text/javascript"> + function showEntityForm() { + document.getElementById('formEntity').style.display = 'block'; + } + function showRelationForm() { + document.getElementById('formRelation').style.display = 'block'; + } + + /* + entity form + */ + $("#rowAdder").click(function () { + newRowAdd = + '<div class="newInput"><div class="attribute" id = "attribute">' + + '<button class="btn btn-danger" id="DeleteRow" type="button">Delete</button>'+ + '<input type="text" class="attribute_input"></input>'+ + '<input type="radio" class = "r" name = "primaryKey" id="key">is_key</input></div>'+'</div></div>'; + $('#newInput').append(newRowAdd); + }); + + $("body").on("click", "#DeleteRow", function () { + $(this).parents("#attribute").remove(); + }); + + $("body").on("click", "#addEntity", function () { + const entity = {}; + const key = document.getElementById("ename").value; + let items = [{ name: "ProductID", iskey: true, figure: "Decision", color:"red"}]; + items = []; + entity.key = key; + + $(".attribute").each(function (){ + let attribute_dict = {}; + let attribute_name = ""; + //TODO:not allow if entity is empty + attribute_name = $(this).children(".attribute_input").val(); + + if (attribute_name !== undefined) { + //TODO:not allow if attribute is empty + console.log(attribute_name); //test. TODO:delete + attribute_dict.name = attribute_name; + let is_primaryKey = true; + is_primaryKey = $('#r').is(':checked') ? true : false; + console.log(is_primaryKey); + + if (is_primaryKey==1){ + attribute_dict.iskey = true; + attribute_dict.figure = "TriangleUp"; + attribute_dict.color = "red"; + }else{ + attribute_dict.iskey = false; + attribute_dict.figure = "Decision"; + attribute_dict.color = "blue" + } + items.push(attribute_dict); + } + entity.items = items; + }); + console.log(entity); + + }); + + /* + relationship form + */ + + $("#relationAdder").click(function () { + newRowAdd = + '<div class="relationInput"><div class="relation" id = "relation">' + + '<input type="text" class="from"></input><br>'+ + '<input type="text" class="to"></input><br>'+ + '<input type="text" class="fromtext"></input><br>'+ + '<input type="text" class="toText"></input><br>'+ + '<button class="btn btn-danger" id="DeleteRow" type="button">Delete</button></div></div>'; + $('#relationInput').append(newRowAdd); + }); + + $("body").on("click", "#DeleteRow", function () { + $(this).parents("#relation").remove(); + }); + + $("body").on("click", "#addRelation", function () { + let linkDataArray = [{from: "Products", to:"Suppliers",text: "0..N",toText: "1" }]; + linkDataArray = []; + + $(".relation").each(function (){ + /* + initialize the attribute dict + */ + let relation_dict = {}; + let from = ""; + let to = ""; + let fromtext= ""; + let toText="" + + from = $(this).children(".from").val(); + to = $(this).children(".to").val(); + fromtext = $(this).children(".fromtext").val(); + toText = $(this).children(".toText").val(); + + if ((from !== undefined)) { + relation_dict.from = from; + relation_dict.to = to; + relation_dict.fromtext = fromtext; + relation_dict.toText = toText; + + linkDataArray.push(relation_dict); + } + }); + console.log(linkDataArray); + }); + +</script> +</html> \ No newline at end of file diff --git a/Web/css/dashboard.css b/Web/css/dashboard.css new file mode 100755 index 0000000000000000000000000000000000000000..9a655a8b580ccabdadea37f874c8bca4f79f377b --- /dev/null +++ b/Web/css/dashboard.css @@ -0,0 +1,224 @@ +/*æ ·å¼é‡ç½®*/ +* { + margin: 0; + padding: 0 +} +em,i { + font-style: normal +} + +li { + list-style: none +} + +img { + border: 0; + vertical-align: middle +} + +button { + cursor: pointer +} + + +a:hover { + color: #c81623; +} + +.header { + line-height: 50px; +} + nav{ + height: 80px; + background-color:rgba(0,47,167,0.8); + position:relative +} + +nav ul li{ + float: right; + margin-right: 70px; + opacity:10; +} +nav ul { + padding-right: 66px; + opacity:10; + +} +.one{ + float: left; + font-size: 20px; + margin-left: 40px; +} +.nav_ul a{ + color: #ffffff; + text-decoration:none; + /*opacity:10;*/ + font-size: 20px; + position:relative; + top:40px; +} +.nav_ul a:hover { + color: #c81623; +} + +.banner{ + height: 1000px; + padding-top: 90px; +} +.banner .inner{ + color: #FFFFFF; + text-align: center; + margin: 0 auto; + max-width: 600px; + position: relative; + top: 160px; +} + +.line{ + width: 75%; + height: 2px; + background: #1c322f; + margin: 0 auto; + margin-bottom: 10px; +} + +.diagram{ + position: absolute; + top: 200px; + left:250px; + border: 1px solid black; + z-index: 2; + user-select: none; + touch-action: none; + width: 80%; + height: 700px; +} +.welcome{ + position: absolute; + top: 200px; + left:250px; + border: 1px solid black; + z-index: 2; + user-select: none; + touch-action: none; + min-width: 80%; + height: 700px; + text-align: center; + line-height: 700px; + + font-size: 100px; +} + +.leftNv{ + position: absolute; + width:220px; + height: 825px; + background-color: #1c322f; + +} +.leftNv .left_container{ + margin-top: 200px; + +} +.leftNv .left_container .nav_menu{ + margin-top: 40px; +} +.leftNv .left_container .nav_menu .nav_title{ + height: 40px; + width: 100%; + color:white; + font-size: 20px; + text-align: center; + line-height: 40px; + text-decoration: none; + cursor:pointer; +} +.leftNv .left_container .nav_menu .nav_content{ + height: 100%; + width: 100%; + background-color: #0c1119; + text-align: center; + font-size: 20px; + +} +.leftNv .left_container .nav_menu .nav_content>a{ + display: block; + height: 30px; + width:100%; + color: #cccccc; + text-align: center; + line-height: 30px; + text-decoration: none; + +} +.leftNv .left_container .nav_menu .nav_content>a:hover{ + display: block; + height: 30px; + width:100%; + color: #ffffff; + background-color: #12040c; + text-align: center; + line-height: 30px; + text-decoration: none; +} + +.platte { + position: absolute; + width:220px; + height: 825px; + background-color: #ffffff; + border: 1px solid black; + +} + +.searchView{ + position: relative; + top: 80px; + left: 300px; + width:800px; + height: 100px; + font-size: 20px; + +} + + + +html{ + font-family: sans-serif; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} +body { + color: #333; + font-size: 12px; + font-family: "Helvetica Neue",Tahoma,Arial,PingFangSC-Regular,"Hiragino Sans GB","Microsoft Yahei",sans-serif; +} +div { + display: block; + margin:0; + padding:0; +} + +.btn { + display: inline-block; + width: 78px; + height: 34px; + line-height: 34px; + text-align: center; + border: 1px solid transparent; + border-radius: 4px; + font-size: 14px; +} + +/* + * footer + */ +footer{ + color:#FFFFFF; + position: relative; + bottom: 0; + width: 100%; + background: #333; + height: 50px; + text-align: center; +} diff --git a/Web/drawingView.html b/Web/drawingView.html new file mode 100644 index 0000000000000000000000000000000000000000..63ed6801fb977ef476a0c02f2258f748c83d5b69 --- /dev/null +++ b/Web/drawingView.html @@ -0,0 +1,294 @@ +<!DOCTYPE html> +<html lang="en" xmlns="http://www.w3.org/1999/html"> +<head> + <meta charset="UTF-8"> + <title>Create View</title> + <link rel="stylesheet" type="text/css" href="css/dashboard.css"> + <script type="text/javascript" src="js/go-debug.js"></script> + <script type="text/javascript" src="js/jquery-3.2.1.js"></script> + <script src="https://unpkg.com/gojs@2.2.16/release/go.js"></script> + <script src="https://unpkg.com/gojs@2.2.16/extensions/Figures.js"></script> + +</head> +<body> +<nav> + <!-- <img src="img/imageu.jpg" width="258" height="82" style = "float:left;">--> + <ul class="nav_ul clear_fix"> + <li class="one"></li> + <b> + <li><a href="xx.html"><span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span>Delete View</a> + </li> + <li><a href="createView.html"><span class="glyphicon glyphicon-cutlery" aria-hidden="true"></span>Save new + sub-schema</a></li> + <li><a href="xx.html"><span class="glyphicon glyphicon-camera" aria-hidden="true"></span>Rename</a></li> + </b> + </ul> +</nav> + +<div id="myDiagramDiv" class="diagram"></div> + +<div class="platte" id="myPaletteDiv"> +</div> + + +<div class="banner"> + <div class="inner"></div> +</div> + +<div id="buttons"> + <button id="loadButton" onclick="load()">Load</button> + + <button id="SaveButton" onclick="save()" disabled="">Save</button> +</div> + +<textarea id="mySavedModel" style="width:100%;height:240px"> +{ "class": "GraphLinksModel", + "copiesArrays": true, + "copiesArrayObjects": true, + "nodeDataArray": [ +{"key":"Products","items":[{"name":"ProductID","iskey":true,"figure":"Decision","color":"#be4b15"},{"name":"ProductName","iskey":false,"figure":"Hexagon","color":"#6ea5f8"},{"name":"SupplierID","iskey":false,"figure":"Decision","color":"purple"},{"name":"CategoryID","iskey":false,"figure":"Decision","color":"purple"}],"location":{"class":"go.Point","x":-905.441681610523,"y":-29.922811407391464}}, +{"key":"Suppliers","items":[{"name":"SupplierID","iskey":true,"figure":"Decision","color":"#be4b15"},{"name":"CompanyName","iskey":false,"figure":"Hexagon","color":"#6ea5f8"},{"name":"ContactName","iskey":false,"figure":"Hexagon","color":"#6ea5f8"},{"name":"Address","iskey":false,"figure":"Hexagon","color":"#6ea5f8"}],"location":{"class":"go.Point","x":-1472.350018298561,"y":-105.79224133183979}}, +{"key":"Categories","items":[{"name":"CategoryID","iskey":true,"figure":"Decision","color":"#be4b15"},{"name":"CategoryName","iskey":false,"figure":"Hexagon","color":"#6ea5f8"},{"name":"Description","iskey":false,"figure":"Hexagon","color":"#6ea5f8"},{"name":"Picture","iskey":false,"figure":"TriangleUp","color":"#faadc1"}],"location":{"class":"go.Point","x":-987.4442912524521,"y":-381.1624322383951}} +], + "linkDataArray": [ +{"from":"Products","to":"Suppliers","text":"0..N","toText":"1"}, +{"from":"Products","to":"Categories","text":"0..N","toText":"1"} +]} +</textarea> + +<footer>ERAPI.Copyright ©2021 | Imperial college london-Group projecy</footer> + +</body> +<script type="text/javascript"> + $(function (){ + //hide all subtitle + $(".nav_menu").each(function (){ + $(this).children(".nav_content").hide(); + + }); + //add the click event of all the content + $(".nav_title").each(function (){ + $(this).click(function (){ + var nav = $(this).parent(".nav_menu").children(".nav_content"); + if (nav.css("display")!="none"){ + nav.slideUp(); + }else{ + nav.slideDown(); + } + }); + }); + }); + +</script> +<script id="code"> + + function init() { + const $ = go.GraphObject.make; // for conciseness in defining templates + myDiagram = $(go.Diagram, "myDiagramDiv", // must name or refer to the DIV HTML element + { + allowDelete: true, + allowCopy: false, + initialAutoScale: go.Diagram.Uniform, + layout: $(go.ForceDirectedLayout, { isInitial: false, isOngoing: false}), + "undoManager.isEnabled": true, + "draggingTool.dragsLink": true, + }); + + var colors = { + 'red': '#be4b15', + 'green': '#52ce60', + 'blue': '#6ea5f8', + 'lightred': '#fd8852', + 'lightblue': '#afd4fe', + 'lightgreen': '#b9e986', + 'pink': '#faadc1', + 'purple': '#d689ff', + 'orange': '#fdb400', + } + + myDiagram.addDiagramListener("Modified", e => { + var button = document.getElementById("SaveButton"); + if (button) button.disabled = !myDiagram.isModified; + var idx = document.title.indexOf("*"); + if (myDiagram.isModified) { + if (idx < 0) document.title += "*"; + } else { + if (idx >= 0) document.title = document.title.slice(0, idx); + } + }); + + // Common text styling + function textStyle() { + return { + margin: 6, + wrap: go.TextBlock.WrapFit, + textAlign: "center", + editable: true, + } + } + + // the template for each attribute in a node's array of item data + var itemTempl = + $(go.Panel, "Horizontal", + $(go.Shape, + { desiredSize: new go.Size(15, 15), strokeJoin: "round", strokeWidth: 3, stroke: null, margin: 2 }, + new go.Binding("figure", "figure"), + new go.Binding("fill", "color"), + new go.Binding("stroke", "color")), + $(go.TextBlock, textStyle(), + { + stroke: "#333333", + font: "bold 14px sans-serif" + }, + new go.Binding("text", "name").makeTwoWay()) + ); + + // define the Node template, representing an entity + myDiagram.nodeTemplate = + $(go.Node, "Auto", // the whole node panel + { + selectionAdorned: true, + resizable: true, + layoutConditions: go.Part.LayoutStandard & ~go.Part.LayoutNodeSized, + fromSpot: go.Spot.AllSides, + toSpot: go.Spot.AllSides, + isShadowed: true, + shadowOffset: new go.Point(3, 3), + shadowColor: "#C5C1AA" + }, + new go.Binding("location", "location").makeTwoWay(), + // whenever the PanelExpanderButton changes the visible property of the "LIST" panel, + // clear out any desiredSize set by the ResizingTool. + new go.Binding("desiredSize", "visible", v => new go.Size(NaN, NaN)).ofObject("LIST"), + // define the node's outer shape, which will surround the Table + $(go.Shape, "RoundedRectangle", + { fill: 'white', stroke: "#eeeeee", strokeWidth: 3 }), + // $("Button", + // { + // alignment: go.Spot.BottomRight, + // click: addAttribute + // }, // this function is defined below + // new go.Binding("visible", "", a => !a.diagram.isReadOnly).ofObject(), + // $(go.Shape, "PlusLine", { desiredSize: new go.Size(10, 10)}) + // ), + // the table header + $(go.Panel, "Table", + { margin: 8, stretch: go.GraphObject.Fill }, + $(go.RowColumnDefinition, { row: 0, sizing: go.RowColumnDefinition.None }), + $(go.TextBlock,textStyle(), + { + row: 0, alignment: go.Spot.Center, + margin: new go.Margin(0, 24, 0, 2), // leave room for Button + font: "bold 16px sans-serif" + }, + new go.Binding("text", "key").makeTwoWay()), + // the collapse/expand button + $("PanelExpanderButton", "LIST", // the name of the element whose visibility this button toggles + { row: 0, alignment: go.Spot.TopLeft }), + // the list of Panels, each showing an attribute + $(go.Panel, "Vertical", + { + name: "LIST", + row: 1, + padding: 3, + alignment: go.Spot.TopLeft, + defaultAlignment: go.Spot.Left, + stretch: go.GraphObject.Horizontal, + itemTemplate: itemTempl + }, + new go.Binding("itemArray", "items").makeTwoWay()) + ) // end Table Panel + ); + + + // define the Link template, representing a relationship + myDiagram.linkTemplate = $(go.Link, // the whole link panel + { + selectionAdorned: true, + layerName: "Foreground", + reshapable: true, + routing: go.Link.AvoidsNodes, + corner: 5, + curve: go.Link.JumpOver + }, + $(go.Shape, // the link shape + {stroke: "#303B45", strokeWidth: 2.5 }), + $(go.TextBlock, textStyle(), // the "from" label + { + textAlign: "center", + font: "bold 14px sans-serif", + stroke: "#1967B3", + segmentIndex: 0, + segmentOffset: new go.Point(NaN, NaN), + segmentOrientation: go.Link.OrientUpright + }, + new go.Binding("text", "text").makeTwoWay()), + $(go.TextBlock, textStyle(), // the "to" label + { + textAlign: "center", + font: "bold 14px sans-serif", + stroke: "#1967B3", + segmentIndex: -1, + segmentOffset: new go.Point(NaN, NaN), + segmentOrientation: go.Link.OrientUpright + }, + new go.Binding("text", "toText").makeTwoWay()) + ); + + myDiagram.model = new go.GraphLinksModel( + { + copiesArrays: true, + copiesArrayObjects: true, + nodeDataArray: [], + linkDataArray: [] + }); + + function addRelationship(){ + + } + + function addAttribute(e, obj) { + var adorn = obj.part; + if (adorn === null) return; + e.handled = true; + var arr = adorn.adornedPart.data.items; + myDiagram.startTransaction("add item"); + myDiagram.model.addArrayItem(arr, {}); + myDiagram.commitTransaction("add item"); + } + + //palette + myDiagram.nodeTemplateMap.add("Entity",myDiagram.nodeTemplate); + + var palette = + $(go.Palette, "myPaletteDiv", // create a new Palette in the HTML DIV element + { + // share the template map with the Palette + nodeTemplateMap: myDiagram.nodeTemplateMap, + autoScale: go.Diagram.Uniform // everything always fits in viewport + }); + // bind node and relation to the left + palette.model.nodeDataArray = [ + //entity + {key: "Entity", items: [{"name":"template","isKey":true,"figure":"Decision","color":"#be4b15"}]} + //relation + + ]; + + load() + + } + + function load() { + myDiagram.model = go.Model.fromJson(document.getElementById("mySavedModel").value); + } + + function save() { + document.getElementById("mySavedModel").value = myDiagram.model.toJson(); + myDiagram.isModified = false; + } + + window.addEventListener('DOMContentLoaded', init); + +</script> +</html> \ No newline at end of file diff --git a/Web/index.html b/Web/index.html new file mode 100644 index 0000000000000000000000000000000000000000..6103677f6a07424e055e0fc451c884bed23020dc --- /dev/null +++ b/Web/index.html @@ -0,0 +1,86 @@ +<!DOCTYPE html> +<html lang="en" xmlns="http://www.w3.org/1999/html"> +<head><meta charset="UTF-8"> + <title>index</title> + <link rel="stylesheet" type="text/css" href="css/dashboard.css"> + <script type = "text/javascript" src="js/jquery-3.2.1.js"></script> +</head> + +<body> +<nav> + <!-- <img src="img/imageu.jpg" width="258" height="82" style = "float:left;">--> + <ul class="nav_ul clear_fix"> + <li class="one"></li> + <b> + <li><a href="xx.html"><span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span>TBD</a></li> + <li><a href="xx.html"><span class="glyphicon glyphicon-camera" aria-hidden="true"></span>TBD</a></li> + <li><a href="xx.html"><span class="glyphicon glyphicon-camera" aria-hidden="true"></span>TBD</a></li> + </b> + </ul> +</nav> + +<div class = "welcome"> welcome to ER API </div> + +<div class="leftNv" > + <div class="left_container"> + <div class = "nav_menu"> + <div class = "nav_title">View</div> + <div class = "nav_content"> + <a href = "#" onclick="searchView()">Search View</a> + <a href="drawingView.html" onclick="viewName()">Draw new View</a> + <script> + function searchView() { + var person=prompt("Please enter View name","Harry Potter"); + if (person!=null && person!="") + { + // x="ä½ å¥½ " + person + "! 今天感觉如何?"; + // document.getElementById("demo").innerHTML=x; + }} + function viewName() { + var person=prompt("Please enter View name","Draco Malfoy"); + if (person!=null && person!="") + { + // x="ä½ å¥½ " + person + "! 今天感觉如何?"; + // document.getElementById("demo").innerHTML=x; + }} + </script> + </div> + </div> + </div> +</div> + +<div class="banner"><div class="inner"></div></div> + + +<div class="searchView" style="display: none;"><input id = "searchViewName" type="text" class="attribute"></div> + +<footer>ERAPI.Copyright ©2021 | Imperial college london-Group projecy</footer> + +</body> +<script type = "text/javascript"> + + $("body").on("click", "#search", function () { + window.prompt(); + }); + + $(function (){ + //hide all subtitle + $(".nav_menu").each(function (){ + $(this).children(".nav_content").hide(); + + }); + //add the click event of all the content + $(".nav_title").each(function (){ + $(this).click(function (){ + var nav = $(this).parent(".nav_menu").children(".nav_content"); + if (nav.css("display")!="none"){ + nav.slideUp(); + }else{ + nav.slideDown(); + } + }); + }); + + }); +</script> +</html> \ No newline at end of file diff --git a/Web/js/go-debug.js b/Web/js/go-debug.js new file mode 100644 index 0000000000000000000000000000000000000000..e73257b79494518153c72e44dafbc7bcc4c2f88a --- /dev/null +++ b/Web/js/go-debug.js @@ -0,0 +1,2381 @@ +/* + * GoJS v2.2.16 JavaScript Library for HTML Diagrams, https://gojs.net + * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://www.nwoods.com. + * Copyright (C) 1998-2022 by Northwoods Software Corporation. All Rights Reserved. + * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.2.16/license.html. + * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE. + */ +(function() { var t;function ba(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function ca(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:ba(a)}}function da(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}var ea="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ha; +if("function"==typeof Object.setPrototypeOf)ha=Object.setPrototypeOf;else{var ia;a:{var ja={a:!0},ka={};try{ka.__proto__=ja;ia=ka.a;break a}catch(a){}ia=!1}ha=ia?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ma=ha; +function na(a,b){a.prototype=ea(b.prototype);a.prototype.constructor=a;if(ma)ma(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.OA=b.prototype} +var oa="undefined"!=typeof global&&null!=global?global:self,pa="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)Object.prototype.hasOwnProperty.call(d,e)&&(a[e]=d[e])}return a},qa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)}; +function ra(a,b){if(b){var c=oa;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&qa(c,a,{configurable:!0,writable:!0,value:b})}}ra("Object.assign",function(a){return a||pa}); +ra("String.prototype.startsWith",function(a){return a?a:function(a,c){if(null==this)throw new TypeError("The 'this' value for String.prototype.startsWith must not be null or undefined");if(a instanceof RegExp)throw new TypeError("First argument to String.prototype.startsWith must not be a regular expression");var b=this.length,e=a.length;c=Math.max(0,Math.min(c|0,this.length));for(var f=0;f<e&&c<b;)if(this[c++]!=a[f++])return!1;return f>=e}}); +ra("Array.prototype.fill",function(a){return a?a:function(a,c,d){var b=this.length||0;0>c&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c<d;c++)this[c]=a;return this}});var sa="object"===typeof globalThis&&globalThis||"object"===typeof global&&global.global===global&&global||"object"===typeof self&&self.self===self&&self||{};void 0===sa.requestAnimationFrame&&(void 0===sa.setImmediate?sa.requestAnimationFrame=function(a){sa.setTimeout(a,0)}:sa.requestAnimationFrame=sa.setImmediate);function ta(){}function ua(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&sa.clearTimeout(c);c=va(function(){c=-1;a.apply(d,e)},b)}} +function va(a,b){return sa.setTimeout(a,b)}function wa(a){return sa.document.createElement(a)}function v(a){throw Error(a);}function xa(a,b){a="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(a+=" to value: "+b);v(a)}function w(a,b,c,d){a instanceof b||(c=ya(c),void 0!==d&&(c+="."+d),Aa(a,b,c))}function A(a,b,c,d){typeof a!==b&&(c=ya(c),void 0!==d&&(c+="."+d),Aa(a,b,c))} +function E(a,b,c){"number"===typeof a&&isFinite(a)||(b=ya(b),void 0!==c&&(b+="."+c),v(b+" must be a real number type, and not NaN or Infinity: "+a))}function Aa(a,b,c,d){b=" value is not an instance of "+ya(b)+": ";c=ya(c);void 0!==d&&(c+="."+d);"string"===typeof a&&(a='"'+a+'"');v(c+b+a)}function Ba(a,b,c,d){c=ya(c);void 0!==d&&(c+="."+d);v(c+" is not in the range "+b+": "+a)}function Ca(a){v(("string"===typeof a.className?a.className:"")+" constructor cannot take any arguments.")} +function Da(a){v("Collection was modified during iteration: "+a.toString()+"\n Perhaps you should iterate over a copy of the collection,\n or you could collect items to be removed from the collection after the iteration.")}function Ea(a,b){v("No property to set for this enum value: "+b+" on "+a.toString())}function Fa(a){sa.console&&sa.console.log(a)}function Ga(a){return"object"===typeof a&&null!==a} +function Ha(a){return Array.isArray(a)||sa.NodeList&&a instanceof sa.NodeList||sa.HTMLCollection&&a instanceof sa.HTMLCollection}function Ia(a,b,c){Ha(a)||Aa(a,"Array or NodeList or HTMLCollection",b,c)}function Ja(a){return Array.prototype.slice.call(a)}function Ka(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):v("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)} +function La(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):v("Cannot remove an object from an HTMLCollection or NodeList at "+b)}function Na(){var a=Oa.pop();return void 0===a?[]:a}function Pa(a){a.length=0;Oa.push(a)}function ya(a){return null===a?"*":"string"===typeof a?a:"function"===typeof a&&"string"===typeof a.className?a.className:""} +function Qa(a){if("function"===typeof a){if(a.className)return a.className;if(a.name)return a.name;var b=a.toString();b=b.substring(9,b.indexOf("(")).trim();if(""!==b)return a._className=b}else if(Ga(a)&&a.constructor)return Qa(a.constructor);return typeof a} +function Ra(a){var b=a;Ga(a)&&(a.text?b=a.text:a.name?b=a.name:void 0!==a.key?b=a.key:void 0!==a.id?b=a.id:a.constructor===Object&&(a.Text?b=a.Text:a.Name?b=a.Name:void 0!==a.Key?b=a.Key:void 0!==a.Id?b=a.Id:void 0!==a.ID&&(b=a.ID)));return void 0===b?"undefined":null===b?"null":b.toString()}function Sa(a,b){if(a.hasOwnProperty(b))return!0;for(a=Object.getPrototypeOf(a);a&&a!==Function;){if(a.hasOwnProperty(b))return!0;var c=a.EA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} +function Ta(a,b,c){Object.defineProperty(Ua.prototype,a,{get:b,set:c})} +function Va(a){for(var b=[],c=0;256>c;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);c=[];for(var d=0,e=0;e<a.length;e+=2)c[d++]=b[a.substr(e,2)];a=c.join("");a=""===a?"0":a;b=[];for(c=0;256>c;c++)b[c]=c;for(c=d=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;d=c=0;for(var f="",g=0;g<a.length;g++)c=(c+1)%256,d=(d+b[c])%256,e=b[c],b[c]=b[d],b[d]=e,f+=String.fromCharCode(a.charCodeAt(g)^b[(b[c]+b[d])%256]);return f} +var Wa=void 0!==sa.navigator&&0<sa.navigator.userAgent.indexOf("Trident/7"),Xa=void 0!==sa.navigator&&0<sa.navigator.userAgent.indexOf("Edge/"),Ya=void 0!==sa.navigator&&void 0!==sa.navigator.platform&&null!==sa.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i),Oa=[];Object.freeze([]);ta.className="Util";ta.Dx="32ab5ff3b26f42dc0ed90f21462913b5";ta.adym="gojs.net";ta.vfo="28e644fdb260";ta.className="Util";function F(a,b,c){Za(this);this.j=a;this.Ca=b;this.m=c} +F.prototype.toString=function(){return"EnumValue."+this.Ca};function $a(a,b){return void 0===b||null===b||""===b?null:a[b]}function ab(a,b,c,d){a.classType!==b&&(c=ya(c),void 0!==d&&(c+="."+d),Aa(a,"function"==="a constant of class "+typeof b.className?b.className:"",c))}oa.Object.defineProperties(F.prototype,{classType:{configurable:!0,get:function(){return this.j}},name:{configurable:!0,get:function(){return this.Ca}},value:{configurable:!0,get:function(){return this.m}}}); +F.className="EnumValue";function bb(){this.Xv=[]}bb.prototype.toString=function(){return this.Xv.join("")};bb.prototype.add=function(a){""!==a&&this.Xv.push(a)};bb.className="StringBuilder";function db(){}db.className="PropertyCollection"; +var G={El:!1,ix:!1,GA:!1,IA:!1,MA:!1,yx:!1,hx:!1,FA:null,trace:function(a){sa.console&&sa.console.log(a)},HA:function(a,b,c,d){a.strokeStyle="red";a.fillStyle="red";a.font="8px sans-serif";a.beginPath();a.moveTo(-10,0);a.lineTo(10,0);a.moveTo(0,-10);a.lineTo(0,10);a.stroke();a.setTransform(1,0,0,1,0,0);a.scale(c,c);a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy);a.lineWidth=2;a.beginPath();a.moveTo(d.left,d.top+20);a.lineTo(d.left,d.top);a.lineTo(d.left+20,d.top);a.moveTo(d.right,d.bottom-20);a.lineTo(d.right, +d.bottom);a.lineTo(d.right-20,d.bottom);a.stroke();a.fillText("DB: "+Math.round(d.x)+", "+Math.round(d.y)+", "+Math.round(d.width)+", "+Math.round(d.height),d.left,d.top-5)},Jy:function(a){var b={},c;for(c in a){b.x=c;if("licenseKey"!==b.x){var d=a[b.x];if(void 0!==d.prototype){b.Ul=Object.getOwnPropertyNames(d.prototype);for(var e={Yj:0};e.Yj<b.Ul.length;e={Yj:e.Yj},e.Yj++){var f=Object.getOwnPropertyDescriptor(d.prototype,b.Ul[e.Yj]);void 0!==f.get&&void 0===f.set&&Object.defineProperty(d.prototype, +b.Ul[e.Yj],{set:function(a,b){return function(){throw Error("Property "+a.Ul[b.Yj]+" of "+a.x+" is read-only.");}}(b,e)})}}}b={Ul:b.Ul,x:b.x}}}};function eb(){}eb.prototype.reset=function(){};eb.prototype.next=function(){return!1};eb.prototype.Ad=function(){return!1};eb.prototype.first=function(){return null};eb.prototype.any=function(){return!1};eb.prototype.all=function(){return!0};eb.prototype.each=function(){return this};eb.prototype.map=function(){return this};eb.prototype.filter=function(){return this}; +eb.prototype.ce=function(){};eb.prototype.toString=function(){return"EmptyIterator"};oa.Object.defineProperties(eb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return 0}}});eb.prototype.first=eb.prototype.first;eb.prototype.hasNext=eb.prototype.Ad;eb.prototype.next=eb.prototype.next;eb.prototype.reset=eb.prototype.reset;var fb=null;eb.className="EmptyIterator";fb=new eb;function gb(a){this.key=-1;this.value=a} +gb.prototype.reset=function(){this.key=-1};gb.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};gb.prototype.Ad=function(){return this.next()};gb.prototype.first=function(){this.key=0;return this.value};gb.prototype.any=function(a){this.key=-1;return a(this.value)};gb.prototype.all=function(a){this.key=-1;return a(this.value)};gb.prototype.each=function(a){this.key=-1;a(this.value);return this};gb.prototype.map=function(a){return new gb(a(this.value))}; +gb.prototype.filter=function(a){return a(this.value)?new gb(this.value):fb};gb.prototype.ce=function(){this.value=null};gb.prototype.toString=function(){return"SingletonIterator("+this.value+")"};oa.Object.defineProperties(gb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return 1}}});gb.prototype.first=gb.prototype.first;gb.prototype.hasNext=gb.prototype.Ad;gb.prototype.next=gb.prototype.next; +gb.prototype.reset=gb.prototype.reset;gb.className="SingletonIterator";function hb(a){this.Cb=a;this.qf=null;a.Ua=null;this.ta=a.A;this.bb=-1}hb.prototype.reset=function(){var a=this.Cb;a.Ua=null;this.ta=a.A;this.bb=-1};hb.prototype.next=function(){var a=this.Cb;if(a.A!==this.ta){if(0>this.key)return!1;Da(a)}a=a.s;var b=a.length,c=++this.bb,d=this.qf;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.bb=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.ce()}return!1}; +hb.prototype.Ad=function(){return this.next()};hb.prototype.first=function(){var a=this.Cb;this.ta=a.A;this.bb=0;a=a.s;var b=a.length,c=this.qf;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.bb=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};hb.prototype.any=function(a){var b=this.Cb;b.Ua=null;var c=b.A;this.bb=-1;for(var d=b.s,e=d.length,f=this.qf,g=0;g<e;g++){var h=d[g];if(null===f||f(h)){if(a(h))return!0;b.A!==c&&Da(b)}}return!1}; +hb.prototype.all=function(a){var b=this.Cb;b.Ua=null;var c=b.A;this.bb=-1;for(var d=b.s,e=d.length,f=this.qf,g=0;g<e;g++){var h=d[g];if(null===f||f(h)){if(!a(h))return!1;b.A!==c&&Da(b)}}return!0};hb.prototype.each=function(a){var b=this.Cb;b.Ua=null;var c=b.A;this.bb=-1;for(var d=b.s,e=d.length,f=this.qf,g=0;g<e;g++){var h=d[g];if(null===f||f(h))a(h),b.A!==c&&Da(b)}return this}; +hb.prototype.map=function(a){var b=this.Cb;b.Ua=null;var c=b.A;this.bb=-1;for(var d=[],e=b.s,f=e.length,g=this.qf,h=0;h<f;h++){var k=e[h];if(null===g||g(k))d.push(a(k)),b.A!==c&&Da(b)}a=new H;a.s=d;a.xb();return a.iterator};hb.prototype.filter=function(a){var b=this.Cb;b.Ua=null;var c=b.A;this.bb=-1;for(var d=[],e=b.s,f=e.length,g=this.qf,h=0;h<f;h++){var k=e[h];if(null===g||g(k))a(k)&&d.push(k),b.A!==c&&Da(b)}a=new H;a.s=d;a.xb();return a.iterator}; +hb.prototype.ce=function(){this.key=-1;this.value=null;this.ta=-1;this.qf=null;this.Cb.Ua=this};hb.prototype.toString=function(){return"ListIterator@"+this.bb+"/"+this.Cb.count}; +oa.Object.defineProperties(hb.prototype,{iterator:{configurable:!0,get:function(){return this}},predicate:{configurable:!0,get:function(){return this.qf},set:function(a){this.qf=a}},count:{configurable:!0,get:function(){var a=this.qf;if(null!==a){for(var b=0,c=this.Cb.s,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.Cb.s.length}}});hb.prototype.first=hb.prototype.first;hb.prototype.hasNext=hb.prototype.Ad;hb.prototype.next=hb.prototype.next; +hb.prototype.reset=hb.prototype.reset;hb.className="ListIterator";function ib(a){this.Cb=a;a.Kg=null;this.ta=a.A;this.bb=a.s.length}ib.prototype.reset=function(){var a=this.Cb;a.Kg=null;this.ta=a.A;this.bb=a.s.length};ib.prototype.next=function(){var a=this.Cb;if(a.A!==this.ta){if(0>this.key)return!1;Da(a)}var b=--this.bb;if(0<=b)return this.key=b,this.value=a.s[b],!0;this.ce();return!1};ib.prototype.Ad=function(){return this.next()}; +ib.prototype.first=function(){var a=this.Cb;this.ta=a.A;var b=a.s;this.bb=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};ib.prototype.any=function(a){var b=this.Cb;b.Kg=null;var c=b.A,d=b.s,e=d.length;this.bb=e;for(--e;0<=e;e--){if(a(d[e]))return!0;b.A!==c&&Da(b)}return!1};ib.prototype.all=function(a){var b=this.Cb;b.Kg=null;var c=b.A,d=b.s,e=d.length;this.bb=e;for(--e;0<=e;e--){if(!a(d[e]))return!1;b.A!==c&&Da(b)}return!0}; +ib.prototype.each=function(a){var b=this.Cb;b.Kg=null;var c=b.A,d=b.s,e=d.length;this.bb=e;for(--e;0<=e;e--)a(d[e]),b.A!==c&&Da(b);return this};ib.prototype.map=function(a){var b=this.Cb;b.Kg=null;var c=b.A,d=[],e=b.s,f=e.length;this.bb=f;for(--f;0<=f;f--)d.push(a(e[f])),b.A!==c&&Da(b);a=new H;a.s=d;a.xb();return a.iterator}; +ib.prototype.filter=function(a){var b=this.Cb;b.Kg=null;var c=b.A,d=[],e=b.s,f=e.length;this.bb=f;for(--f;0<=f;f--){var g=e[f];a(g)&&d.push(g);b.A!==c&&Da(b)}a=new H;a.s=d;a.xb();return a.iterator};ib.prototype.ce=function(){this.key=-1;this.value=null;this.ta=-1;this.Cb.Kg=this};ib.prototype.toString=function(){return"ListIteratorBackwards("+this.bb+"/"+this.Cb.count+")"}; +oa.Object.defineProperties(ib.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.Cb.s.length}}});ib.prototype.first=ib.prototype.first;ib.prototype.hasNext=ib.prototype.Ad;ib.prototype.next=ib.prototype.next;ib.prototype.reset=ib.prototype.reset;ib.className="ListIteratorBackwards"; +function H(a){Za(this);this._isFrozen=!1;this.s=[];this.A=0;this.Kg=this.Ua=null;(G&&"function"===typeof a||"string"===typeof a)&&v("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=H.prototype;t.xb=function(){var a=this.A;a++;999999999<a&&(a=0);this.A=a};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){this._isFrozen=!1;return this};t.toString=function(){return"List()#"+lb(this)}; +t.add=function(a){if(null===a)return this;this._isFrozen&&xa(this,a);this.s.push(a);this.xb();return this};t.push=function(a){this.add(a)};t.addAll=function(a){if(null===a)return this;this._isFrozen&&xa(this);var b=this.s;if(Ha(a))for(var c=a.length,d=0;d<c;d++)b.push(a[d]);else for(a=a.iterator;a.next();)b.push(a.value);this.xb();return this};t.clear=function(){this._isFrozen&&xa(this);this.s.length=0;this.xb()};t.contains=function(a){return null===a?!1:-1!==this.s.indexOf(a)};t.has=function(a){return this.contains(a)}; +t.indexOf=function(a){return null===a?-1:this.s.indexOf(a)};t.N=function(a){G&&E(a,H,"elt:i");var b=this.s;(0>a||a>=b.length)&&Ba(a,"0 <= i < length",H,"elt:i");return b[a]};t.get=function(a){return this.N(a)};t.ad=function(a,b){G&&E(a,H,"setElt:i");var c=this.s;(0>a||a>=c.length)&&Ba(a,"0 <= i < length",H,"setElt:i");this._isFrozen&&xa(this,a);c[a]=b};t.set=function(a,b){this.ad(a,b)};t.first=function(){var a=this.s;return 0===a.length?null:a[0]}; +t.lc=function(){var a=this.s,b=a.length;return 0<b?a[b-1]:null};t.pop=function(){this._isFrozen&&xa(this);var a=this.s;return 0<a.length?a.pop():null};H.prototype.any=function(a){for(var b=this.s,c=this.A,d=b.length,e=0;e<d;e++){if(a(b[e]))return!0;this.A!==c&&Da(this)}return!1};H.prototype.all=function(a){for(var b=this.s,c=this.A,d=b.length,e=0;e<d;e++){if(!a(b[e]))return!1;this.A!==c&&Da(this)}return!0}; +H.prototype.each=function(a){for(var b=this.s,c=this.A,d=b.length,e=0;e<d;e++)a(b[e]),this.A!==c&&Da(this);return this};H.prototype.map=function(a){for(var b=new H,c=[],d=this.s,e=this.A,f=d.length,g=0;g<f;g++)c.push(a(d[g])),this.A!==e&&Da(this);b.s=c;b.xb();return b};H.prototype.filter=function(a){for(var b=new H,c=[],d=this.s,e=this.A,f=d.length,g=0;g<f;g++){var h=d[g];a(h)&&c.push(h);this.A!==e&&Da(this)}b.s=c;b.xb();return b};t=H.prototype; +t.Hb=function(a,b){G&&E(a,H,"insertAt:i");0>a&&Ba(a,">= 0",H,"insertAt:i");this._isFrozen&&xa(this,a);var c=this.s;a>=c.length?c.push(b):c.splice(a,0,b);this.xb()};t.remove=function(a){if(null===a)return!1;this._isFrozen&&xa(this,a);var b=this.s;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.xb();return!0};t.delete=function(a){return this.remove(a)}; +t.sb=function(a){G&&E(a,H,"removeAt:i");var b=this.s;(0>a||a>=b.length)&&Ba(a,"0 <= i < length",H,"removeAt:i");this._isFrozen&&xa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.xb()};t.removeRange=function(a,b){G&&(E(a,H,"removeRange:from"),E(b,H,"removeRange:to"));var c=this.s,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this._isFrozen&&xa(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.xb();return this}; +H.prototype.copy=function(){var a=new H,b=this.s;0<b.length&&(a.s=Array.prototype.slice.call(b));return a};t=H.prototype;t.Ka=function(){for(var a=this.s,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};t.zv=function(){for(var a=new I,b=this.s,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};t.sort=function(a){G&&A(a,"function",H,"sort:sortfunc");this._isFrozen&&xa(this);this.s.sort(a);this.xb();return this}; +t.Ei=function(a,b,c){var d=this.s,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);G&&(A(a,"function",H,"sortRange:sortfunc"),E(b,H,"sortRange:from"),E(c,H,"sortRange:to"));this._isFrozen&&xa(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&Ba(b,"0 <= from < length",H,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.xb()),this;if(0===b)if(c>=e)d.sort(a);else for(b=d.slice(0,c),b.sort(a),a=0;a<c;a++)d[a]=b[a];else if(c>=e)for(c=d.slice(b),c.sort(a),a=b;a<e;a++)d[a]= +c[a-b];else for(e=d.slice(b,c),e.sort(a),a=b;a<c;a++)d[a]=e[a-b];this.xb();return this};t.reverse=function(){this._isFrozen&&xa(this);this.s.reverse();this.xb();return this}; +oa.Object.defineProperties(H.prototype,{_dataArray:{configurable:!0,get:function(){return this.s}},count:{configurable:!0,get:function(){return this.s.length}},size:{configurable:!0,get:function(){return this.s.length}},length:{configurable:!0,get:function(){return this.s.length}},iterator:{configurable:!0,get:function(){if(0>=this.s.length)return fb;var a=this.Ua;return null!==a?(a.reset(),a):new hb(this)}},iteratorBackwards:{configurable:!0, +enumerable:!0,get:function(){if(0>=this.s.length)return fb;var a=this.Kg;return null!==a?(a.reset(),a):new ib(this)}}});H.prototype.reverse=H.prototype.reverse;H.prototype.sortRange=H.prototype.Ei;H.prototype.sort=H.prototype.sort;H.prototype.toSet=H.prototype.zv;H.prototype.toArray=H.prototype.Ka;H.prototype.removeRange=H.prototype.removeRange;H.prototype.removeAt=H.prototype.sb;H.prototype["delete"]=H.prototype.delete;H.prototype.remove=H.prototype.remove;H.prototype.insertAt=H.prototype.Hb; +H.prototype.pop=H.prototype.pop;H.prototype.last=H.prototype.lc;H.prototype.first=H.prototype.first;H.prototype.set=H.prototype.set;H.prototype.setElt=H.prototype.ad;H.prototype.get=H.prototype.get;H.prototype.elt=H.prototype.N;H.prototype.indexOf=H.prototype.indexOf;H.prototype.has=H.prototype.has;H.prototype.contains=H.prototype.contains;H.prototype.clear=H.prototype.clear;H.prototype.addAll=H.prototype.addAll;H.prototype.push=H.prototype.push;H.prototype.add=H.prototype.add;H.prototype.thaw=H.prototype.pa; +H.prototype.freeze=H.prototype.freeze;H.className="List";function mb(a){this.ig=a;a.Ua=null;this.ta=a.A;this.xa=null}mb.prototype.reset=function(){var a=this.ig;a.Ua=null;this.ta=a.A;this.xa=null};mb.prototype.next=function(){var a=this.ig;if(a.A!==this.ta){if(null===this.key)return!1;Da(a)}var b=this.xa;b=null===b?a.ja:b.Aa;if(null!==b)return this.xa=b,this.value=b.value,this.key=b.key,!0;this.ce();return!1};mb.prototype.Ad=function(){return this.next()}; +mb.prototype.first=function(){var a=this.ig;this.ta=a.A;a=a.ja;if(null!==a){this.xa=a;var b=a.value;this.key=a.key;return this.value=b}return null};mb.prototype.any=function(a){var b=this.ig;b.Ua=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(a(d.value))return!0;b.A!==c&&Da(b);d=d.Aa}return!1};mb.prototype.all=function(a){var b=this.ig;b.Ua=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(!a(d.value))return!1;b.A!==c&&Da(b);d=d.Aa}return!0}; +mb.prototype.each=function(a){var b=this.ig;b.Ua=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;)a(d.value),b.A!==c&&Da(b),d=d.Aa;return this};mb.prototype.map=function(a){var b=this.ig;b.Ua=null;for(var c=new H,d=b.A,e=b.ja;null!==e;)c.add(a(e.value)),b.A!==d&&Da(b),e=e.Aa;return c.iterator};mb.prototype.filter=function(a){var b=this.ig;b.Ua=null;for(var c=new H,d=b.A,e=b.ja;null!==e;){var f=e.value;a(f)&&c.add(f);b.A!==d&&Da(b);e=e.Aa}return c.iterator}; +mb.prototype.ce=function(){this.value=this.key=null;this.ta=-1;this.ig.Ua=this};mb.prototype.toString=function(){return null!==this.xa?"SetIterator@"+this.xa.value:"SetIterator"};oa.Object.defineProperties(mb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.ig.Ub}}});mb.prototype.first=mb.prototype.first;mb.prototype.hasNext=mb.prototype.Ad;mb.prototype.next=mb.prototype.next;mb.prototype.reset=mb.prototype.reset; +mb.className="SetIterator";function I(a){Za(this);this._isFrozen=!1;this.Vb={};this.Ub=0;this.Ua=null;this.A=0;this.kf=this.ja=null;(G&&"function"===typeof a||"string"===typeof a)&&v("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=I.prototype;t.xb=function(){var a=this.A;a++;999999999<a&&(a=0);this.A=a};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){this._isFrozen=!1;return this}; +t.toString=function(){return"Set()#"+lb(this)};t.add=function(a){if(null===a)return this;this._isFrozen&&xa(this,a);var b=a;Ga(a)&&(b=nb(a));void 0===this.Vb[b]&&(this.Ub++,a=new ob(a,a),this.Vb[b]=a,b=this.kf,null===b?this.ja=a:(a.nl=b,b.Aa=a),this.kf=a,this.xb());return this};t.addAll=function(a){if(null===a)return this;this._isFrozen&&xa(this);if(Ha(a))for(var b=a.length,c=0;c<b;c++)this.add(a[c]);else for(a=a.iterator;a.next();)this.add(a.value);return this}; +t.contains=function(a){if(null===a)return!1;var b=a;return Ga(a)&&(b=lb(a),void 0===b)?!1:void 0!==this.Vb[b]};t.has=function(a){return this.contains(a)};t.Qy=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.Ry=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1};t.first=function(){var a=this.ja;return null===a?null:a.value}; +I.prototype.any=function(a){for(var b=this.A,c=this.ja;null!==c;){if(a(c.value))return!0;this.A!==b&&Da(this);c=c.Aa}return!1};I.prototype.all=function(a){for(var b=this.A,c=this.ja;null!==c;){if(!a(c.value))return!1;this.A!==b&&Da(this);c=c.Aa}return!0};I.prototype.each=function(a){for(var b=this.A,c=this.ja;null!==c;)a(c.value),this.A!==b&&Da(this),c=c.Aa;return this};I.prototype.map=function(a){for(var b=new I,c=this.A,d=this.ja;null!==d;)b.add(a(d.value)),this.A!==c&&Da(this),d=d.Aa;return b}; +I.prototype.filter=function(a){for(var b=new I,c=this.A,d=this.ja;null!==d;){var e=d.value;a(e)&&b.add(e);this.A!==c&&Da(this);d=d.Aa}return b};t=I.prototype;t.remove=function(a){if(null===a)return!1;this._isFrozen&&xa(this,a);var b=a;if(Ga(a)&&(b=lb(a),void 0===b))return!1;a=this.Vb[b];if(void 0===a)return!1;var c=a.Aa,d=a.nl;null!==c&&(c.nl=d);null!==d&&(d.Aa=c);this.ja===a&&(this.ja=c);this.kf===a&&(this.kf=d);delete this.Vb[b];this.Ub--;this.xb();return!0};t.delete=function(a){return this.remove(a)}; +t.Xo=function(a){if(null===a)return this;this._isFrozen&&xa(this);if(Ha(a))for(var b=a.length,c=0;c<b;c++)this.remove(a[c]);else for(a=a.iterator;a.next();)this.remove(a.value);return this};t.oA=function(a){if(null===a||0===this.count)return this;this._isFrozen&&xa(this);var b=new I;b.addAll(a);a=[];for(var c=this.iterator;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.Xo(a);return this}; +t.clear=function(){this._isFrozen&&xa(this);this.Vb={};this.Ub=0;null!==this.Ua&&this.Ua.reset();this.kf=this.ja=null;this.xb()};I.prototype.copy=function(){var a=new I,b=this.Vb,c;for(c in b)a.add(b[c].value);return a};I.prototype.Ka=function(){var a=Array(this.Ub),b=this.Vb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};I.prototype.yv=function(){var a=new H,b=this.Vb,c;for(c in b)a.add(b[c].value);return a};function Za(a){a.__gohashid=pb++} +function nb(a){var b=a.__gohashid;void 0===b&&(b=pb++,a.__gohashid=b);return b}function lb(a){return a.__gohashid}oa.Object.defineProperties(I.prototype,{count:{configurable:!0,get:function(){return this.Ub}},size:{configurable:!0,get:function(){return this.Ub}},iterator:{configurable:!0,get:function(){if(0>=this.Ub)return fb;var a=this.Ua;return null!==a?(a.reset(),a):new mb(this)}}});I.prototype.toList=I.prototype.yv;I.prototype.toArray=I.prototype.Ka; +I.prototype.clear=I.prototype.clear;I.prototype.retainAll=I.prototype.oA;I.prototype.removeAll=I.prototype.Xo;I.prototype["delete"]=I.prototype.delete;I.prototype.remove=I.prototype.remove;I.prototype.first=I.prototype.first;I.prototype.containsAny=I.prototype.Ry;I.prototype.containsAll=I.prototype.Qy;I.prototype.has=I.prototype.has;I.prototype.contains=I.prototype.contains;I.prototype.addAll=I.prototype.addAll;I.prototype.add=I.prototype.add;I.prototype.thaw=I.prototype.pa;I.prototype.freeze=I.prototype.freeze; +var pb=1;I.className="Set";I.uniqueHash=Za;I.hashIdUnique=nb;I.hashId=lb;function qb(a){this.ra=a;this.ta=a.A;this.xa=null}qb.prototype.reset=function(){this.ta=this.ra.A;this.xa=null};qb.prototype.next=function(){var a=this.ra;if(a.A!==this.ta){if(null===this.key)return!1;Da(a)}var b=this.xa;b=null===b?a.ja:b.Aa;if(null!==b)return this.xa=b,this.value=this.key=a=b.key,!0;this.ce();return!1};qb.prototype.Ad=function(){return this.next()}; +qb.prototype.first=function(){var a=this.ra;this.ta=a.A;a=a.ja;return null!==a?(this.xa=a,this.value=this.key=a=a.key):null};qb.prototype.any=function(a){var b=this.ra,c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(a(d.key))return!0;b.A!==c&&Da(b);d=d.Aa}return!1};qb.prototype.all=function(a){var b=this.ra,c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(!a(d.key))return!1;b.A!==c&&Da(b);d=d.Aa}return!0}; +qb.prototype.each=function(a){var b=this.ra,c=b.A;this.xa=null;for(var d=b.ja;null!==d;)a(d.key),b.A!==c&&Da(b),d=d.Aa;return this};qb.prototype.map=function(a){var b=this.ra,c=b.A;this.xa=null;for(var d=new H,e=b.ja;null!==e;)d.add(a(e.key)),b.A!==c&&Da(b),e=e.Aa;return d.iterator};qb.prototype.filter=function(a){var b=this.ra,c=b.A;this.xa=null;for(var d=new H,e=b.ja;null!==e;){var f=e.key;a(f)&&d.add(f);b.A!==c&&Da(b);e=e.Aa}return d.iterator}; +qb.prototype.ce=function(){this.value=this.key=null;this.ta=-1};qb.prototype.toString=function(){return null!==this.xa?"MapKeySetIterator@"+this.xa.value:"MapKeySetIterator"};oa.Object.defineProperties(qb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.ra.Ub}}});qb.prototype.first=qb.prototype.first;qb.prototype.hasNext=qb.prototype.Ad;qb.prototype.next=qb.prototype.next;qb.prototype.reset=qb.prototype.reset; +qb.className="MapKeySetIterator";function rb(a){I.call(this);Za(this);this._isFrozen=!0;this.ra=a}na(rb,I);t=rb.prototype;t.freeze=function(){return this};t.pa=function(){return this};t.toString=function(){return"MapKeySet("+this.ra.toString()+")"};t.add=function(){v("This Set is read-only: "+this.toString())};t.contains=function(a){return this.ra.contains(a)};t.has=function(a){return this.contains(a)};t.remove=function(){v("This Set is read-only: "+this.toString())};t.delete=function(a){return this.remove(a)}; +t.clear=function(){v("This Set is read-only: "+this.toString())};t.first=function(){var a=this.ra.ja;return null!==a?a.key:null};rb.prototype.any=function(a){for(var b=this.ra.ja;null!==b;){if(a(b.key))return!0;b=b.Aa}return!1};rb.prototype.all=function(a){for(var b=this.ra.ja;null!==b;){if(!a(b.key))return!1;b=b.Aa}return!0};rb.prototype.each=function(a){for(var b=this.ra.ja;null!==b;)a(b.key),b=b.Aa;return this}; +rb.prototype.map=function(a){for(var b=new I,c=this.ra.ja;null!==c;)b.add(a(c.key)),c=c.Aa;return b};rb.prototype.filter=function(a){for(var b=new I,c=this.ra.ja;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.Aa}return b};rb.prototype.copy=function(){return new rb(this.ra)};rb.prototype.zv=function(){var a=new I,b=this.ra.Vb,c;for(c in b)a.add(b[c].key);return a};rb.prototype.Ka=function(){var a=this.ra.Vb,b=Array(this.ra.Ub),c=0,d;for(d in a)b[c]=a[d].key,c++;return b}; +rb.prototype.yv=function(){var a=new H,b=this.ra.Vb,c;for(c in b)a.add(b[c].key);return a};oa.Object.defineProperties(rb.prototype,{count:{configurable:!0,get:function(){return this.ra.Ub}},size:{configurable:!0,get:function(){return this.ra.Ub}},iterator:{configurable:!0,get:function(){return 0>=this.ra.Ub?fb:new qb(this.ra)}}});rb.prototype.toList=rb.prototype.yv;rb.prototype.toArray=rb.prototype.Ka;rb.prototype.toSet=rb.prototype.zv; +rb.prototype.first=rb.prototype.first;rb.prototype.clear=rb.prototype.clear;rb.prototype["delete"]=rb.prototype.delete;rb.prototype.remove=rb.prototype.remove;rb.prototype.has=rb.prototype.has;rb.prototype.contains=rb.prototype.contains;rb.prototype.add=rb.prototype.add;rb.prototype.thaw=rb.prototype.pa;rb.prototype.freeze=rb.prototype.freeze;rb.className="MapKeySet";function ub(a){this.ra=a;a.jf=null;this.ta=a.A;this.xa=null} +ub.prototype.reset=function(){var a=this.ra;a.jf=null;this.ta=a.A;this.xa=null};ub.prototype.next=function(){var a=this.ra;if(a.A!==this.ta){if(null===this.key)return!1;Da(a)}var b=this.xa;b=null===b?a.ja:b.Aa;if(null!==b)return this.xa=b,this.value=b.value,this.key=b.key,!0;this.ce();return!1};ub.prototype.Ad=function(){return this.next()};ub.prototype.first=function(){var a=this.ra;this.ta=a.A;a=a.ja;if(null!==a){this.xa=a;var b=a.value;this.key=a.key;return this.value=b}return null}; +ub.prototype.any=function(a){var b=this.ra;b.jf=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(a(d.value))return!0;b.A!==c&&Da(b);d=d.Aa}return!1};ub.prototype.all=function(a){var b=this.ra;b.jf=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(!a(d.value))return!1;b.A!==c&&Da(b);d=d.Aa}return!0};ub.prototype.each=function(a){var b=this.ra;b.jf=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;)a(d.value),b.A!==c&&Da(b),d=d.Aa;return this}; +ub.prototype.map=function(a){var b=this.ra;b.jf=null;var c=b.A;this.xa=null;for(var d=new H,e=b.ja;null!==e;)d.add(a(e.value)),b.A!==c&&Da(b),e=e.Aa;return d.iterator};ub.prototype.filter=function(a){var b=this.ra;b.jf=null;var c=b.A;this.xa=null;for(var d=new H,e=b.ja;null!==e;){var f=e.value;a(f)&&d.add(f);b.A!==c&&Da(b);e=e.Aa}return d.iterator};ub.prototype.ce=function(){this.value=this.key=null;this.ta=-1;this.ra.jf=this}; +ub.prototype.toString=function(){return null!==this.xa?"MapValueSetIterator@"+this.xa.value:"MapValueSetIterator"};oa.Object.defineProperties(ub.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.ra.Ub}}});ub.prototype.first=ub.prototype.first;ub.prototype.hasNext=ub.prototype.Ad;ub.prototype.next=ub.prototype.next;ub.prototype.reset=ub.prototype.reset;ub.className="MapValueSetIterator"; +function ob(a,b){this.key=a;this.value=b;this.nl=this.Aa=null}ob.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};ob.className="KeyValuePair";function vb(a){this.ra=a;a.Ua=null;this.ta=a.A;this.xa=null}vb.prototype.reset=function(){var a=this.ra;a.Ua=null;this.ta=a.A;this.xa=null}; +vb.prototype.next=function(){var a=this.ra;if(a.A!==this.ta){if(null===this.key)return!1;Da(a)}var b=this.xa;b=null===b?a.ja:b.Aa;if(null!==b)return this.xa=b,this.key=b.key,this.value=b.value,!0;this.ce();return!1};vb.prototype.Ad=function(){return this.next()};vb.prototype.first=function(){var a=this.ra;this.ta=a.A;a=a.ja;return null!==a?(this.xa=a,this.key=a.key,this.value=a.value,a):null}; +vb.prototype.any=function(a){var b=this.ra;b.Ua=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(a(d))return!0;b.A!==c&&Da(b);d=d.Aa}return!1};vb.prototype.all=function(a){var b=this.ra;b.Ua=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(!a(d))return!1;b.A!==c&&Da(b);d=d.Aa}return!0};vb.prototype.each=function(a){var b=this.ra;b.Ua=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;)a(d),b.A!==c&&Da(b),d=d.Aa;return this}; +vb.prototype.map=function(a){var b=this.ra;b.Ua=null;var c=b.A;this.xa=null;for(var d=new H,e=b.ja;null!==e;)d.add(a(e)),b.A!==c&&Da(b),e=e.Aa;return d.iterator};vb.prototype.filter=function(a){var b=this.ra;b.Ua=null;var c=b.A;this.xa=null;for(var d=new H,e=b.ja;null!==e;)a(e)&&d.add(e),b.A!==c&&Da(b),e=e.Aa;return d.iterator};vb.prototype.ce=function(){this.value=this.key=null;this.ta=-1;this.ra.Ua=this};vb.prototype.toString=function(){return null!==this.xa?"MapIterator@"+this.xa:"MapIterator"}; +oa.Object.defineProperties(vb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.ra.Ub}}});vb.prototype.first=vb.prototype.first;vb.prototype.hasNext=vb.prototype.Ad;vb.prototype.next=vb.prototype.next;vb.prototype.reset=vb.prototype.reset;vb.className="MapIterator"; +function yb(a){Za(this);this._isFrozen=!1;this.Vb={};this.Ub=0;this.jf=this.Ua=null;this.A=0;this.kf=this.ja=null;(G&&"function"===typeof a||"string"===typeof a)&&v("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=yb.prototype;t.xb=function(){var a=this.A;a++;999999999<a&&(a=0);this.A=a};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){this._isFrozen=!1;return this};t.toString=function(){return"Map()#"+lb(this)}; +t.add=function(a,b){this._isFrozen&&xa(this,a);var c=a;Ga(a)&&(c=nb(a));var d=this.Vb[c];void 0===d?(this.Ub++,a=new ob(a,b),this.Vb[c]=a,c=this.kf,null===c?this.ja=a:(a.nl=c,c.Aa=a),this.kf=a,this.xb()):d.value=b;return this};t.set=function(a,b){return this.add(a,b)}; +t.addAll=function(a){if(null===a)return this;if(Ha(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];this.add(d.key,d.value)}else if(a instanceof yb)for(a=a.iterator;a.next();)this.add(a.key,a.value);else for(a=a.iterator;a.next();)b=a.value,this.add(b.key,b.value);return this};t.first=function(){return this.ja};yb.prototype.any=function(a){for(var b=this.A,c=this.ja;null!==c;){if(a(c))return!0;this.A!==b&&Da(this);c=c.Aa}return!1}; +yb.prototype.all=function(a){for(var b=this.A,c=this.ja;null!==c;){if(!a(c))return!1;this.A!==b&&Da(this);c=c.Aa}return!0};yb.prototype.each=function(a){for(var b=this.A,c=this.ja;null!==c;)a(c),this.A!==b&&Da(this),c=c.Aa;return this};yb.prototype.map=function(a){for(var b=new yb,c=this.A,d=this.ja;null!==d;)b.add(d.key,a(d)),this.A!==c&&Da(this),d=d.Aa;return b};yb.prototype.filter=function(a){for(var b=new yb,c=this.A,d=this.ja;null!==d;)a(d)&&b.add(d.key,d.value),this.A!==c&&Da(this),d=d.Aa;return b}; +t=yb.prototype;t.contains=function(a){var b=a;return Ga(a)&&(b=lb(a),void 0===b)?!1:void 0!==this.Vb[b]};t.has=function(a){return this.contains(a)};t.L=function(a){var b=a;if(Ga(a)&&(b=lb(a),void 0===b))return null;a=this.Vb[b];return void 0===a?null:a.value};t.get=function(a){return this.L(a)}; +t.remove=function(a){if(null===a)return!1;this._isFrozen&&xa(this,a);var b=a;if(Ga(a)&&(b=lb(a),void 0===b))return!1;a=this.Vb[b];if(void 0===a)return!1;var c=a.Aa,d=a.nl;null!==c&&(c.nl=d);null!==d&&(d.Aa=c);this.ja===a&&(this.ja=c);this.kf===a&&(this.kf=d);delete this.Vb[b];this.Ub--;this.xb();return!0};t.delete=function(a){return this.remove(a)}; +t.clear=function(){this._isFrozen&&xa(this);this.Vb={};this.Ub=0;null!==this.Ua&&this.Ua.reset();null!==this.jf&&this.jf.reset();this.kf=this.ja=null;this.xb()};yb.prototype.copy=function(){var a=new yb,b=this.Vb,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};yb.prototype.Ka=function(){var a=this.Vb,b=Array(this.Ub),c=0,d;for(d in a){var e=a[d];b[c]=new ob(e.key,e.value);c++}return b};yb.prototype.Of=function(){return new rb(this)}; +oa.Object.defineProperties(yb.prototype,{count:{configurable:!0,get:function(){return this.Ub}},size:{configurable:!0,get:function(){return this.Ub}},iterator:{configurable:!0,get:function(){if(0>=this.count)return fb;var a=this.Ua;return null!==a?(a.reset(),a):new vb(this)}},iteratorKeys:{configurable:!0,get:function(){return 0>=this.count?fb:new qb(this)}},iteratorValues:{configurable:!0,get:function(){if(0>=this.count)return fb; +var a=this.jf;return null!==a?(a.reset(),a):new ub(this)}}});yb.prototype.toKeySet=yb.prototype.Of;yb.prototype.toArray=yb.prototype.Ka;yb.prototype.clear=yb.prototype.clear;yb.prototype["delete"]=yb.prototype.delete;yb.prototype.remove=yb.prototype.remove;yb.prototype.get=yb.prototype.get;yb.prototype.getValue=yb.prototype.L;yb.prototype.has=yb.prototype.has;yb.prototype.contains=yb.prototype.contains;yb.prototype.first=yb.prototype.first;yb.prototype.addAll=yb.prototype.addAll; +yb.prototype.set=yb.prototype.set;yb.prototype.add=yb.prototype.add;yb.prototype.thaw=yb.prototype.pa;yb.prototype.freeze=yb.prototype.freeze;yb.className="Map";function K(a,b){void 0===a?this.K=this.J=0:"number"===typeof a&&"number"===typeof b?(this.J=a,this.K=b):v("Invalid arguments to Point constructor: "+a+", "+b);this._isFrozen=!1}var zb,Ab,Bb,Cb,Db;K.prototype.assign=function(a){this.J=a.J;this.K=a.K;return this};K.prototype.h=function(a,b){this.J=a;this.K=b;return this}; +K.prototype.wg=function(a,b){G&&(A(a,"number",K,"setTo:x"),A(b,"number",K,"setTo:y"),this.la());this.J=a;this.K=b;return this};K.prototype.set=function(a){G&&(w(a,K,K,"set:p"),this.la());this.J=a.J;this.K=a.K;return this};K.prototype.copy=function(){var a=new K;a.J=this.J;a.K=this.K;return a};t=K.prototype;t.na=function(){this._isFrozen=!0;Object.freeze(this);return this};t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this}; +t.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Point is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};function Eb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new K(c,e)}return new K} +function Fb(a){G&&w(a,K);return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.D=function(a){return a instanceof K?this.J===a.x&&this.K===a.y:!1};t.ni=function(a,b){return this.J===a&&this.K===b};t.fb=function(a){return L.C(this.J,a.x)&&L.C(this.K,a.y)};t.add=function(a){G&&(w(a,K,K,"add:p"),this.la());this.J+=a.x;this.K+=a.y;return this};t.re=function(a){G&&(w(a,K,K,"subtract:p"),this.la());this.J-=a.x;this.K-=a.y;return this}; +t.offset=function(a,b){G&&(E(a,K,"offset:dx"),E(b,K,"offset:dy"),this.la());this.J+=a;this.K+=b;return this};K.prototype.rotate=function(a){G&&(E(a,K,"rotate:angle"),this.la());if(0===a)return this;var b=this.J,c=this.K;if(0===b&&0===c)return this;360<=a?a-=360:0>a&&(a+=360);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));this.J=a*b-d*c;this.K=d*b+a*c;return this};t=K.prototype; +t.scale=function(a,b){G&&(E(a,K,"scale:sx"),E(b,K,"scale:sy"),this.la());this.J*=a;this.K*=b;return this};t.Df=function(a){G&&w(a,K,K,"distanceSquaredPoint:p");var b=a.x-this.J;a=a.y-this.K;return b*b+a*a};t.zd=function(a,b){G&&(E(a,K,"distanceSquared:px"),E(b,K,"distanceSquared:py"));a-=this.J;b-=this.K;return a*a+b*b};t.normalize=function(){G&&this.la();var a=this.J,b=this.K,c=Math.sqrt(a*a+b*b);0<c&&(this.J=a/c,this.K=b/c);return this}; +t.cb=function(a){G&&w(a,K,K,"directionPoint:p");return Gb(a.x-this.J,a.y-this.K)};t.direction=function(a,b){G&&(E(a,K,"direction:px"),E(b,K,"direction:py"));return Gb(a-this.J,b-this.K)};function Gb(a,b){if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;var c=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c} +t.Py=function(a,b){G&&(w(a,K,K,"compareWithLineSegmentPoint:p"),w(b,K,K,"compareWithLineSegmentPoint:q"));return L.Gl(a.x,a.y,b.x,b.y,this.x,this.y)};t.eA=function(a,b,c,d){G&&(E(a,K,"projectOntoLineSegment:px"),E(b,K,"projectOntoLineSegment:py"),E(c,K,"projectOntoLineSegment:qx"),E(d,K,"projectOntoLineSegment:qy"));L.qh(a,b,c,d,this.J,this.K,this);return this}; +t.fA=function(a,b){G&&(w(a,K,K,"projectOntoLineSegmentPoint:p"),w(b,K,K,"projectOntoLineSegmentPoint:q"));L.qh(a.x,a.y,b.x,b.y,this.J,this.K,this);return this};t.tA=function(a,b,c,d){G&&(E(a,K,"snapToGrid:originx"),E(b,K,"snapToGrid:originy"),E(c,K,"snapToGrid:cellwidth"),E(d,K,"snapToGrid:cellheight"));L.Eo(this.J,this.K,a,b,c,d,this);return this};t.uA=function(a,b){G&&(w(a,K,K,"snapToGridPoint:p"),w(b,Hb,K,"snapToGridPoint:q"));L.Eo(this.J,this.K,a.x,a.y,b.width,b.height,this);return this}; +t.Ci=function(a,b){G&&(w(a,M,K,"setRectSpot:r"),w(b,Ib,K,"setRectSpot:spot"),this.la());this.J=a.x+b.x*a.width+b.offsetX;this.K=a.y+b.y*a.height+b.offsetY;return this};t.Di=function(a,b,c,d,e){G&&(E(a,K,"setSpot:x"),E(b,K,"setSpot:y"),E(c,K,"setSpot:w"),E(d,K,"setSpot:h"),(0>c||0>d)&&v("Point.setSpot:Width and height cannot be negative"),w(e,Ib,K,"setSpot:spot"),this.la());this.J=a+e.x*c+e.offsetX;this.K=b+e.y*d+e.offsetY;return this}; +t.transform=function(a){G&&w(a,Jb,K,"transform:t");a.La(this);return this};function Kb(a,b){G&&w(b,Jb,K,"transformInverted:t");b.Rd(a);return a} +function Lb(a,b,c,d,e,f){G&&(E(a,K,"distanceLineSegmentSquared:px"),E(b,K,"distanceLineSegmentSquared:py"),E(c,K,"distanceLineSegmentSquared:ax"),E(d,K,"distanceLineSegmentSquared:ay"),E(e,K,"distanceLineSegmentSquared:bx"),E(f,K,"distanceLineSegmentSquared:by"));var g=e-c,h=f-d,k=g*g+h*h;c-=a;d-=b;var l=-c*g-d*h;if(0>=l||l>=k)return g=e-a,h=f-b,Math.min(c*c+d*d,g*g+h*h);a=g*d-h*c;return a*a/k} +function Mb(a,b,c,d){G&&(E(a,K,"distanceSquared:px"),E(b,K,"distanceSquared:py"),E(c,K,"distanceSquared:qx"),E(d,K,"distanceSquared:qy"));a=c-a;b=d-b;return a*a+b*b}function Nb(a,b,c,d){G&&(E(a,K,"direction:px"),E(b,K,"direction:py"),E(c,K,"direction:qx"),E(d,K,"direction:qy"));a=c-a;b=d-b;if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;d=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d} +t.u=function(){return isFinite(this.x)&&isFinite(this.y)};K.alloc=function(){var a=Ob.pop();return void 0===a?new K:a};K.allocAt=function(a,b){var c=Ob.pop();if(void 0===c)return new K(a,b);c.x=a;c.y=b;return c};K.free=function(a){Ob.push(a)}; +oa.Object.defineProperties(K.prototype,{x:{configurable:!0,get:function(){return this.J},set:function(a){G&&(A(a,"number",K,"x"),this.la(a));this.J=a}},y:{configurable:!0,get:function(){return this.K},set:function(a){G&&(A(a,"number",K,"y"),this.la(a));this.K=a}}});K.prototype.isReal=K.prototype.u;K.prototype.setSpot=K.prototype.Di;K.prototype.setRectSpot=K.prototype.Ci;K.prototype.snapToGridPoint=K.prototype.uA;K.prototype.snapToGrid=K.prototype.tA; +K.prototype.projectOntoLineSegmentPoint=K.prototype.fA;K.prototype.projectOntoLineSegment=K.prototype.eA;K.intersectingLineSegments=function(a,b,c,d,e,f,g,h){G&&(E(a,K,"intersectingLineSegments:a1x"),E(b,K,"intersectingLineSegments:a1y"),E(c,K,"intersectingLineSegments:a2x"),E(d,K,"intersectingLineSegments:a2y"),E(e,K,"intersectingLineSegments:b1x"),E(f,K,"intersectingLineSegments:b1y"),E(g,K,"intersectingLineSegments:b2x"),E(h,K,"intersectingLineSegments:b2y"));return L.Nl(a,b,c,d,e,f,g,h)}; +K.prototype.compareWithLineSegmentPoint=K.prototype.Py;K.compareWithLineSegment=function(a,b,c,d,e,f){G&&(E(a,K,"compareWithLineSegment:a1x"),E(b,K,"compareWithLineSegment:a1y"),E(c,K,"compareWithLineSegment:a2x"),E(d,K,"compareWithLineSegment:a2y"),E(e,K,"compareWithLineSegment:b1x"),E(f,K,"compareWithLineSegment:b1y"));return L.Gl(a,b,c,d,e,f)};K.prototype.direction=K.prototype.direction;K.prototype.directionPoint=K.prototype.cb;K.prototype.normalize=K.prototype.normalize; +K.prototype.distanceSquared=K.prototype.zd;K.prototype.distanceSquaredPoint=K.prototype.Df;K.prototype.scale=K.prototype.scale;K.prototype.rotate=K.prototype.rotate;K.prototype.offset=K.prototype.offset;K.prototype.subtract=K.prototype.re;K.prototype.add=K.prototype.add;K.prototype.equalsApprox=K.prototype.fb;K.prototype.equalTo=K.prototype.ni;K.prototype.equals=K.prototype.D;K.prototype.set=K.prototype.set;K.prototype.setTo=K.prototype.wg;var Ob=[];K.className="Point";K.parse=Eb;K.stringify=Fb; +K.distanceLineSegmentSquared=Lb;K.distanceSquared=Mb;K.direction=Nb;K.Origin=zb=(new K(0,0)).na();K.InfiniteTopLeft=Ab=(new K(-Infinity,-Infinity)).na();K.InfiniteBottomRight=Bb=(new K(Infinity,Infinity)).na();K.SixPoint=Cb=(new K(6,6)).na();K.NoPoint=Db=(new K(NaN,NaN)).na();K.parse=Eb;K.stringify=Fb;K.distanceLineSegmentSquared=Lb;K.distanceSquared=Mb;K.direction=Nb; +function Hb(a,b){void 0===a?this.da=this.fa=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.fa=a,this.da=b):v("Invalid arguments to Size constructor: "+a+", "+b);this._isFrozen=!1}var Pb,Qb,Rb,Sb,Tb,Ub,Vb;Hb.prototype.assign=function(a){this.fa=a.fa;this.da=a.da;return this};Hb.prototype.h=function(a,b){this.fa=a;this.da=b;return this}; +Hb.prototype.wg=function(a,b){G&&(A(a,"number",Hb,"setTo:w"),A(b,"number",Hb,"setTo:h"),0>a&&Ba(a,">= 0",Hb,"setTo:w"),0>b&&Ba(b,">= 0",Hb,"setTo:h"),this.la());this.fa=a;this.da=b;return this};Hb.prototype.set=function(a){G&&(w(a,Hb,Hb,"set:s"),this.la());this.fa=a.fa;this.da=a.da;return this};Hb.prototype.copy=function(){var a=new Hb;a.fa=this.fa;a.da=this.da;return a};t=Hb.prototype;t.na=function(){this._isFrozen=!0;Object.freeze(this);return this}; +t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; +function Zb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new Hb(c,e)}return new Hb}function $b(a){G&&w(a,Hb);return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.D=function(a){return a instanceof Hb?this.fa===a.width&&this.da===a.height:!1};t.ni=function(a,b){return this.fa===a&&this.da===b}; +t.fb=function(a){return L.C(this.fa,a.width)&&L.C(this.da,a.height)};t.Bc=function(a,b){G&&(E(a,Hb,"inflate:w"),E(b,Hb,"inflate:h"));a=this.width+a;this.fa=0<=a?a:0;b=this.height+b;this.da=0<=b?b:0;return this};t.u=function(){return isFinite(this.width)&&isFinite(this.height)};Hb.alloc=function(){var a=ac.pop();return void 0===a?new Hb:a};Hb.free=function(a){ac.push(a)}; +oa.Object.defineProperties(Hb.prototype,{width:{configurable:!0,get:function(){return this.fa},set:function(a){G&&(A(a,"number",Hb,"width"),this.la(a));0>a&&Ba(a,">= 0",Hb,"width");this.fa=a}},height:{configurable:!0,get:function(){return this.da},set:function(a){G&&(A(a,"number",Hb,"height"),this.la(a));0>a&&Ba(a,">= 0",Hb,"height");this.da=a}}});Hb.prototype.isReal=Hb.prototype.u;Hb.prototype.inflate=Hb.prototype.Bc;Hb.prototype.equalsApprox=Hb.prototype.fb; +Hb.prototype.equalTo=Hb.prototype.ni;Hb.prototype.equals=Hb.prototype.D;Hb.prototype.set=Hb.prototype.set;Hb.prototype.setTo=Hb.prototype.wg;var ac=[];Hb.className="Size";Hb.parse=Zb;Hb.stringify=$b;Hb.ZeroSize=Pb=(new Hb(0,0)).na();Hb.OneSize=Qb=(new Hb(1,1)).na();Hb.SixSize=Rb=(new Hb(6,6)).na();Hb.EightSize=Sb=(new Hb(8,8)).na();Hb.TenSize=Tb=(new Hb(10,10)).na();Hb.InfiniteSize=Ub=(new Hb(Infinity,Infinity)).na();Hb.NoSize=Vb=(new Hb(NaN,NaN)).na();Hb.parse=Zb;Hb.stringify=$b; +function M(a,b,c,d){void 0===a?this.da=this.fa=this.K=this.J=0:"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.J=a,this.K=b,this.fa=c,this.da=d):a instanceof K?(c=a.x,a=a.y,b instanceof K?(d=b.x,b=b.y,this.J=Math.min(c,d),this.K=Math.min(a,b),this.fa=Math.abs(c-d),this.da=Math.abs(a-b)):b instanceof Hb?(this.J=c,this.K=a,this.fa=b.width,this.da=b.height):v("Incorrect second argument supplied to Rect constructor "+b)):v("Invalid arguments to Rect constructor: "+ +a+", "+b+", "+c+", "+d);this._isFrozen=!1}t=M.prototype;t.assign=function(a){this.J=a.J;this.K=a.K;this.fa=a.fa;this.da=a.da;return this};t.h=function(a,b,c,d){this.J=a;this.K=b;this.fa=c;this.da=d;return this};function bc(a,b,c){a.fa=b;a.da=c}t.wg=function(a,b,c,d){G&&(A(a,"number",M,"setTo:x"),A(b,"number",M,"setTo:y"),A(c,"number",M,"setTo:w"),A(d,"number",M,"setTo:h"),0>c&&Ba(c,">= 0",M,"setTo:w"),0>d&&Ba(d,">= 0",M,"setTo:h"),this.la());this.J=a;this.K=b;this.fa=c;this.da=d;return this}; +t.set=function(a){G&&(w(a,M,M,"set:r"),this.la());this.J=a.J;this.K=a.K;this.fa=a.fa;this.da=a.da;return this};t.bd=function(a){G&&(w(a,K,M,"setPoint:p"),this.la());this.J=a.x;this.K=a.y;return this};t.sA=function(a){G&&(w(a,Hb,M,"setSize:s"),this.la());this.fa=a.width;this.da=a.height;return this};M.prototype.copy=function(){var a=new M;a.J=this.J;a.K=this.K;a.fa=this.fa;a.da=this.da;return a};t=M.prototype;t.na=function(){this._isFrozen=!0;Object.freeze(this);return this}; +t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; +function cc(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return new M(c,e,f,g)}return new M}function dc(a){G&&w(a,M);return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()} +t.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};t.D=function(a){return a instanceof M?this.J===a.x&&this.K===a.y&&this.fa===a.width&&this.da===a.height:!1};t.ni=function(a,b,c,d){return this.J===a&&this.K===b&&this.fa===c&&this.da===d};t.fb=function(a){return L.C(this.J,a.x)&&L.C(this.K,a.y)&&L.C(this.fa,a.width)&&L.C(this.da,a.height)};function ec(a,b){return L.ha(a.J,b.x)&&L.ha(a.K,b.y)&&L.ha(a.fa,b.width)&&L.ha(a.da,b.height)} +t.ga=function(a){G&&w(a,K,M,"containsPoint:p");return this.J<=a.x&&this.J+this.fa>=a.x&&this.K<=a.y&&this.K+this.da>=a.y};t.Re=function(a){G&&w(a,M,M,"containsRect:r");return this.J<=a.x&&a.x+a.width<=this.J+this.fa&&this.K<=a.y&&a.y+a.height<=this.K+this.da}; +t.contains=function(a,b,c,d){G?(E(a,M,"contains:x"),E(b,M,"contains:y"),void 0===c?c=0:E(c,M,"contains:w"),void 0===d?d=0:E(d,M,"contains:h"),(0>c||0>d)&&v("Rect.contains:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return this.J<=a&&a+c<=this.J+this.fa&&this.K<=b&&b+d<=this.K+this.da};t.offset=function(a,b){G&&(E(a,M,"offset:dx"),E(b,M,"offset:dy"),this.la());this.J+=a;this.K+=b;return this}; +t.Bc=function(a,b){G&&(E(a,M,"inflate:w"),E(b,M,"inflate:h"));return fc(this,b,a,b,a)};t.so=function(a){G&&w(a,gc,M,"addMargin:m");return fc(this,a.top,a.right,a.bottom,a.left)};t.xv=function(a){G&&w(a,gc,M,"subtractMargin:m");return fc(this,-a.top,-a.right,-a.bottom,-a.left)};t.Iz=function(a,b,c,d){G&&(E(a,M,"grow:t"),E(b,M,"grow:r"),E(c,M,"grow:b"),E(d,M,"grow:l"));return fc(this,a,b,c,d)}; +function fc(a,b,c,d,e){G&&a.la();var f=a.fa;c+e<=-f?(a.J+=f/2,a.fa=0):(a.J-=e,a.fa+=c+e);c=a.da;b+d<=-c?(a.K+=c/2,a.da=0):(a.K-=b,a.da+=b+d);return a}t.zx=function(a){G&&w(a,M,M,"intersectRect:r");return hc(this,a.x,a.y,a.width,a.height)};t.Vu=function(a,b,c,d){G&&(E(a,M,"intersect:x"),E(b,M,"intersect:y"),E(c,M,"intersect:w"),E(d,M,"intersect:h"),(0>c||0>d)&&v("Rect.intersect:Width and height cannot be negative"));return hc(this,a,b,c,d)}; +function hc(a,b,c,d,e){G&&a.la();var f=Math.max(a.J,b),g=Math.max(a.K,c);b=Math.min(a.J+a.fa,b+d);c=Math.min(a.K+a.da,c+e);a.J=f;a.K=g;a.fa=Math.max(0,b-f);a.da=Math.max(0,c-g);return a}t.Yc=function(a){G&&w(a,M,M,"intersectsRect:r");return this.Wu(a.x,a.y,a.width,a.height)}; +t.Wu=function(a,b,c,d){G&&(E(a,M,"intersects:x"),E(b,M,"intersects:y"),E(a,M,"intersects:w"),E(b,M,"intersects:h"),(0>c||0>d)&&v("Rect.intersects:Width and height cannot be negative"));var e=this.fa,f=this.J;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.da;c=this.K;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0}; +function ic(a,b){var c=a.fa,d=a.J,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.da;a=a.K;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.Ze=function(a){G&&w(a,K,M,"unionPoint:p");return lc(this,a.x,a.y,0,0)};t.cd=function(a){G&&w(a,M,M,"unionRect:r");return lc(this,a.J,a.K,a.fa,a.da)}; +t.Bv=function(a,b,c,d){G?(E(a,M,"union:x"),E(b,M,"union:y"),void 0===c?c=0:E(c,M,"union:w"),void 0===d?d=0:E(d,M,"union:h"),(0>c||0>d)&&v("Rect.union:Width and height cannot be negative"),this.la()):(void 0===c&&(c=0),void 0===d&&(d=0));return lc(this,a,b,c,d)};function lc(a,b,c,d,e){var f=Math.min(a.J,b),g=Math.min(a.K,c);b=Math.max(a.J+a.fa,b+d);c=Math.max(a.K+a.da,c+e);a.J=f;a.K=g;a.fa=b-f;a.da=c-g;return a} +t.Di=function(a,b,c){G&&(E(a,M,"setSpot:x"),E(b,M,"setSpot:y"),w(c,Ib,M,"setSpot:spot"),this.la());this.J=a-c.offsetX-c.x*this.fa;this.K=b-c.offsetY-c.y*this.da;return this}; +function mc(a,b,c,d,e,f,g,h){G?(E(a,M,"contains:rx"),E(b,M,"contains:ry"),E(c,M,"contains:rw"),E(d,M,"contains:rh"),E(e,M,"contains:x"),E(f,M,"contains:y"),void 0===g?g=0:E(g,M,"contains:w"),void 0===h?h=0:E(h,M,"contains:h"),(0>c||0>d||0>g||0>h)&&v("Rect.contains:Width and height cannot be negative")):(void 0===g&&(g=0),void 0===h&&(h=0));return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d} +function nc(a,b,c,d,e,f,g,h){G&&(E(a,M,"intersects:rx"),E(b,M,"intersects:ry"),E(c,M,"intersects:rw"),E(d,M,"intersects:rh"),E(e,M,"intersects:x"),E(f,M,"intersects:y"),E(g,M,"intersects:w"),E(h,M,"intersects:h"),(0>c||0>d||0>g||0>h)&&v("Rect.intersects:Width and height cannot be negative"));return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0}t.u=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Oz=function(){return 0===this.width&&0===this.height}; +M.alloc=function(){var a=oc.pop();return void 0===a?new M:a};M.allocAt=function(a,b,c,d){var e=oc.pop();return void 0===e?new M(a,b,c,d):e.h(a,b,c,d)};M.free=function(a){oc.push(a)}; +oa.Object.defineProperties(M.prototype,{x:{configurable:!0,get:function(){return this.J},set:function(a){G&&(A(a,"number",M,"x"),this.la(a));this.J=a}},y:{configurable:!0,get:function(){return this.K},set:function(a){G&&(A(a,"number",M,"y"),this.la(a));this.K=a}},width:{configurable:!0,get:function(){return this.fa},set:function(a){G&&(A(a,"number",M,"width"),this.la(a));0>a&&Ba(a,">= 0",M,"width");this.fa=a}},height:{configurable:!0,get:function(){return this.da}, +set:function(a){G&&(A(a,"number",M,"height"),this.la(a));0>a&&Ba(a,">= 0",M,"height");this.da=a}},left:{configurable:!0,get:function(){return this.J},set:function(a){G&&(A(a,"number",M,"left"),this.la(a));this.J=a}},top:{configurable:!0,get:function(){return this.K},set:function(a){G&&(A(a,"number",M,"top"),this.la(a));this.K=a}},right:{configurable:!0,get:function(){return this.J+this.fa},set:function(a){G&&(E(a,M,"right"),this.la(a));this.J+=a-(this.J+this.fa)}}, +bottom:{configurable:!0,get:function(){return this.K+this.da},set:function(a){G&&(E(a,M,"top"),this.la(a));this.K+=a-(this.K+this.da)}},position:{configurable:!0,get:function(){return new K(this.J,this.K)},set:function(a){G&&(w(a,K,M,"position"),this.la(a));this.J=a.x;this.K=a.y}},size:{configurable:!0,get:function(){return new Hb(this.fa,this.da)},set:function(a){G&&(w(a,Hb,M,"size"),this.la(a));this.fa=a.width;this.da=a.height}},center:{configurable:!0, +enumerable:!0,get:function(){return new K(this.J+this.fa/2,this.K+this.da/2)},set:function(a){G&&(w(a,K,M,"center"),this.la(a));this.J=a.x-this.fa/2;this.K=a.y-this.da/2}},centerX:{configurable:!0,get:function(){return this.J+this.fa/2},set:function(a){G&&(E(a,M,"centerX"),this.la(a));this.J=a-this.fa/2}},centerY:{configurable:!0,get:function(){return this.K+this.da/2},set:function(a){G&&(E(a,M,"centerY"),this.la(a));this.K=a-this.da/2}}});M.prototype.isEmpty=M.prototype.Oz; +M.prototype.isReal=M.prototype.u;M.intersectsLineSegment=function(a,b,c,d,e,f,g,h){G&&(E(a,M,"intersectsLineSegment:x"),E(b,M,"intersectsLineSegment:y"),E(c,M,"intersectsLineSegment:w"),E(d,M,"intersectsLineSegment:h"),E(e,M,"intersectsLineSegment:p1x"),E(f,M,"intersectsLineSegment:p1y"),E(g,M,"intersectsLineSegment:p2x"),E(h,M,"intersectsLineSegment:p2y"),(0>c||0>d)&&v("Rect.intersectsLineSegment: width and height cannot be negative"));return L.Ax(a,b,c,d,e,f,g,h)};M.prototype.setSpot=M.prototype.Di; +M.prototype.union=M.prototype.Bv;M.prototype.unionRect=M.prototype.cd;M.prototype.unionPoint=M.prototype.Ze;M.prototype.intersects=M.prototype.Wu;M.prototype.intersectsRect=M.prototype.Yc;M.prototype.intersect=M.prototype.Vu;M.prototype.intersectRect=M.prototype.zx;M.prototype.grow=M.prototype.Iz;M.prototype.subtractMargin=M.prototype.xv;M.prototype.addMargin=M.prototype.so;M.prototype.inflate=M.prototype.Bc;M.prototype.offset=M.prototype.offset;M.prototype.contains=M.prototype.contains; +M.prototype.containsRect=M.prototype.Re;M.prototype.containsPoint=M.prototype.ga;M.prototype.equalsApprox=M.prototype.fb;M.prototype.equalTo=M.prototype.ni;M.prototype.equals=M.prototype.D;M.prototype.setSize=M.prototype.sA;M.prototype.setPoint=M.prototype.bd;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.wg;var pc=null,qc=null,oc=[];M.className="Rect";M.parse=cc;M.stringify=dc;M.contains=mc;M.intersects=nc;M.ZeroRect=pc=(new M(0,0,0,0)).na();M.NoRect=qc=(new M(NaN,NaN,NaN,NaN)).na(); +M.parse=cc;M.stringify=dc;M.contains=mc;M.intersects=nc;function gc(a,b,c,d){void 0===a?this.Fe=this.we=this.Oe=this.Pe=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(this.top=a,this.right=b,this.bottom=a,this.left=b):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):v("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this._isFrozen=!1}gc.prototype.assign=function(a){this.Pe=a.Pe;this.Oe=a.Oe;this.we=a.we;this.Fe=a.Fe;return this}; +gc.prototype.wg=function(a,b,c,d){G&&(A(a,"number",gc,"setTo:t"),A(b,"number",gc,"setTo:r"),A(c,"number",gc,"setTo:b"),A(d,"number",gc,"setTo:l"),this.la());this.Pe=a;this.Oe=b;this.we=c;this.Fe=d;return this};gc.prototype.set=function(a){G&&(w(a,gc,gc,"assign:m"),this.la());this.Pe=a.Pe;this.Oe=a.Oe;this.we=a.we;this.Fe=a.Fe;return this};gc.prototype.copy=function(){var a=new gc;a.Pe=this.Pe;a.Oe=this.Oe;a.we=this.we;a.Fe=this.Fe;return a};t=gc.prototype; +t.na=function(){this._isFrozen=!0;Object.freeze(this);return this};t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; +function rc(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new gc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new gc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new gc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new gc(c,e):new gc(c,e,f,g)}return new gc} +function sc(a){G&&w(a,gc);return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}t.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};t.D=function(a){return a instanceof gc?this.Pe===a.top&&this.Oe===a.right&&this.we===a.bottom&&this.Fe===a.left:!1};t.ni=function(a,b,c,d){return this.Pe===a&&this.Oe===b&&this.we===c&&this.Fe===d}; +t.fb=function(a){return L.C(this.Pe,a.top)&&L.C(this.Oe,a.right)&&L.C(this.we,a.bottom)&&L.C(this.Fe,a.left)};t.u=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};gc.alloc=function(){var a=xc.pop();return void 0===a?new gc:a};gc.free=function(a){xc.push(a)}; +oa.Object.defineProperties(gc.prototype,{top:{configurable:!0,get:function(){return this.Pe},set:function(a){G&&(E(a,gc,"top"),this.la(a));this.Pe=a}},right:{configurable:!0,get:function(){return this.Oe},set:function(a){G&&(E(a,gc,"right"),this.la(a));this.Oe=a}},bottom:{configurable:!0,get:function(){return this.we},set:function(a){G&&(E(a,gc,"bottom"),this.la(a));this.we=a}},left:{configurable:!0,get:function(){return this.Fe},set:function(a){G&& +(E(a,gc,"left"),this.la(a));this.Fe=a}}});gc.prototype.isReal=gc.prototype.u;gc.prototype.equalsApprox=gc.prototype.fb;gc.prototype.equalTo=gc.prototype.ni;gc.prototype.equals=gc.prototype.D;gc.prototype.set=gc.prototype.set;gc.prototype.setTo=gc.prototype.wg;var yc=null,zc=null,xc=[];gc.className="Margin";gc.parse=rc;gc.stringify=sc;gc.ZeroMargin=yc=(new gc(0,0,0,0)).na();gc.TwoMargin=zc=(new gc(2,2,2,2)).na();gc.parse=rc;gc.stringify=sc; +function Ib(a,b,c,d){void 0===a?this.le=this.ke=this.K=this.J=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d);this._isFrozen=!1}var Ec,Fc,Gc,Hc,Jc,Kc,Lc,Mc,Nc,Oc,Qc,Rc,Sc,Tc,Uc,Vc,Wc,Xc,Yc,Zc,$c,ad,ed,fd,gd,hd,id,jd,kd,ld,md,pd,qd,rd,sd,td;Ib.prototype.assign=function(a){this.J=a.J;this.K=a.K;this.ke=a.ke;this.le=a.le;return this}; +Ib.prototype.wg=function(a,b,c,d){G&&(ud(a,"setTo:x"),ud(b,"setTo:y"),vd(c,"setTo:offx"),vd(d,"setTo:offy"),this.la());this.J=a;this.K=b;this.ke=c;this.le=d;return this};Ib.prototype.set=function(a){G&&(w(a,Ib,Ib,"set:s"),this.la());this.J=a.J;this.K=a.K;this.ke=a.ke;this.le=a.le;return this};Ib.prototype.copy=function(){var a=new Ib;a.J=this.J;a.K=this.K;a.ke=this.ke;a.le=this.le;return a};t=Ib.prototype;t.na=function(){this._isFrozen=!0;Object.freeze(this);return this}; +t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};function wd(a,b){a.J=NaN;a.K=NaN;a.ke=b;return a} +function ud(a,b){(isNaN(a)||1<a||0>a)&&Ba(a,"0 <= "+b+" <= 1",Ib,b)}function vd(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&Ba(a,"real number, not NaN or Infinity",Ib,b)} +function xd(a){if("string"===typeof a){a=a.trim();if("None"===a)return Ec;if("TopLeft"===a)return Fc;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return Gc;if("TopRight"===a)return Hc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Jc;if("Center"===a)return Kc;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Lc;if("BottomLeft"===a)return Mc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Nc;if("BottomRight"===a)return Oc;if("TopSide"===a)return Qc;if("LeftSide"=== +a)return Rc;if("RightSide"===a)return Sc;if("BottomSide"===a)return Tc;if("TopBottomSides"===a)return Uc;if("LeftRightSides"===a)return Vc;if("TopLeftSides"===a)return Wc;if("TopRightSides"===a)return Xc;if("BottomLeftSides"===a)return Yc;if("BottomRightSides"===a)return Zc;if("NotTopSide"===a)return $c;if("NotLeftSide"===a)return ad;if("NotRightSide"===a)return ed;if("NotBottomSide"===a)return fd;if("AllSides"===a)return gd;if("Default"===a)return hd;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; +var d=a[b++];void 0!==d&&0<d.length&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(f=parseFloat(d));for(var g=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(g=parseFloat(d));return new Ib(c,e,f,g)}return new Ib}function yd(a){G&&w(a,Ib);return a.mb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()} +t.toString=function(){return this.mb()?0===this.ke&&0===this.le?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.D(Ec)?"None":this.D(Fc)?"TopLeft":this.D(Gc)?"Top":this.D(Hc)?"TopRight":this.D(Jc)?"Left":this.D(Kc)?"Center":this.D(Lc)?"Right":this.D(Mc)?"BottomLeft":this.D(Nc)?"Bottom":this.D(Oc)?"BottomRight":this.D(Qc)?"TopSide":this.D(Rc)?"LeftSide":this.D(Sc)?"RightSide":this.D(Tc)?"BottomSide":this.D(Uc)?"TopBottomSides":this.D(Vc)?"LeftRightSides": +this.D(Wc)?"TopLeftSides":this.D(Xc)?"TopRightSides":this.D(Yc)?"BottomLeftSides":this.D(Zc)?"BottomRightSides":this.D($c)?"NotTopSide":this.D(ad)?"NotLeftSide":this.D(ed)?"NotRightSide":this.D(fd)?"NotBottomSide":this.D(gd)?"AllSides":this.D(hd)?"Default":"None"};t.D=function(a){return a instanceof Ib?(this.J===a.x||isNaN(this.J)&&isNaN(a.x))&&(this.K===a.y||isNaN(this.K)&&isNaN(a.y))&&this.ke===a.offsetX&&this.le===a.offsetY:!1}; +t.dv=function(){return new Ib(.5-(this.J-.5),.5-(this.K-.5),-this.ke,-this.le)};t.Jf=function(a){if(!this.$c())return!1;if(!a.$c())if(a.D(id))a=Rc;else if(a.D(jd))a=Sc;else if(a.D(kd))a=Qc;else if(a.D(ld))a=Tc;else return!1;a=a.offsetY;return(this.le&a)===a};t.mb=function(){return!isNaN(this.x)&&!isNaN(this.y)};t.kc=function(){return isNaN(this.x)||isNaN(this.y)};t.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&1===this.offsetX&&0!==this.offsetY}; +t.No=function(){return isNaN(this.x)&&isNaN(this.y)&&0===this.offsetX&&0===this.offsetY};t.Rb=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};Ib.alloc=function(){var a=zd.pop();return void 0===a?new Ib:a};Ib.free=function(a){zd.push(a)}; +oa.Object.defineProperties(Ib.prototype,{x:{configurable:!0,get:function(){return this.J},set:function(a){G&&(ud(a,"x"),this.la(a));this.J=a}},y:{configurable:!0,get:function(){return this.K},set:function(a){G&&(ud(a,"y"),this.la(a));this.K=a}},offsetX:{configurable:!0,get:function(){return this.ke},set:function(a){G&&(vd(a,"offsetX"),this.la(a));this.ke=a}},offsetY:{configurable:!0,get:function(){return this.le},set:function(a){G&&(vd(a,"offsetY"), +this.la(a));this.le=a}}});Ib.prototype.isDefault=Ib.prototype.Rb;Ib.prototype.isNone=Ib.prototype.No;Ib.prototype.isSide=Ib.prototype.$c;Ib.prototype.isNoSpot=Ib.prototype.kc;Ib.prototype.isSpot=Ib.prototype.mb;Ib.prototype.includesSide=Ib.prototype.Jf;Ib.prototype.opposite=Ib.prototype.dv;Ib.prototype.equals=Ib.prototype.D;Ib.prototype.set=Ib.prototype.set;Ib.prototype.setTo=Ib.prototype.wg;var zd=[];Ib.className="Spot";Ib.parse=xd;Ib.stringify=yd;Ib.None=Ec=wd(new Ib(0,0,0,0),0).na(); +Ib.Default=hd=wd(new Ib(0,0,-1,0),-1).na();Ib.TopLeft=Fc=(new Ib(0,0,0,0)).na();Ib.TopCenter=Gc=(new Ib(.5,0,0,0)).na();Ib.TopRight=Hc=(new Ib(1,0,0,0)).na();Ib.LeftCenter=Jc=(new Ib(0,.5,0,0)).na();Ib.Center=Kc=(new Ib(.5,.5,0,0)).na();Ib.RightCenter=Lc=(new Ib(1,.5,0,0)).na();Ib.BottomLeft=Mc=(new Ib(0,1,0,0)).na();Ib.BottomCenter=Nc=(new Ib(.5,1,0,0)).na();Ib.BottomRight=Oc=(new Ib(1,1,0,0)).na();Ib.MiddleTop=md=Gc;Ib.MiddleLeft=pd=Jc;Ib.MiddleRight=qd=Lc;Ib.MiddleBottom=rd=Nc;Ib.Top=kd=Gc; +Ib.Left=id=Jc;Ib.Right=jd=Lc;Ib.Bottom=ld=Nc;Ib.TopSide=Qc=wd(new Ib(0,0,1,1),1).na();Ib.LeftSide=Rc=wd(new Ib(0,0,1,2),1).na();Ib.RightSide=Sc=wd(new Ib(0,0,1,4),1).na();Ib.BottomSide=Tc=wd(new Ib(0,0,1,8),1).na();Ib.TopBottomSides=Uc=wd(new Ib(0,0,1,9),1).na();Ib.LeftRightSides=Vc=wd(new Ib(0,0,1,6),1).na();Ib.TopLeftSides=Wc=wd(new Ib(0,0,1,3),1).na();Ib.TopRightSides=Xc=wd(new Ib(0,0,1,5),1).na();Ib.BottomLeftSides=Yc=wd(new Ib(0,0,1,10),1).na();Ib.BottomRightSides=Zc=wd(new Ib(0,0,1,12),1).na(); +Ib.NotTopSide=$c=wd(new Ib(0,0,1,14),1).na();Ib.NotLeftSide=ad=wd(new Ib(0,0,1,13),1).na();Ib.NotRightSide=ed=wd(new Ib(0,0,1,11),1).na();Ib.NotBottomSide=fd=wd(new Ib(0,0,1,7),1).na();Ib.AllSides=gd=wd(new Ib(0,0,1,15),1).na();sd=(new Ib(.156,.156)).na();td=(new Ib(.844,.844)).na();Ib.parse=xd;Ib.stringify=yd;function Jb(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0} +Jb.prototype.set=function(a){this.m11=a.m11;this.m12=a.m12;this.m21=a.m21;this.m22=a.m22;this.dx=a.dx;this.dy=a.dy;return this};Jb.prototype.setTransform=function(a,b,c,d,e,f){this.m11=a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this};Jb.prototype.copy=function(){var a=new Jb;a.m11=this.m11;a.m12=this.m12;a.m21=this.m21;a.m22=this.m22;a.dx=this.dx;a.dy=this.dy;return a}; +Jb.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"};Jb.prototype.D=function(a){return this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy};Jb.prototype.js=function(){return 0===this.dx&&0===this.dy&&1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22};Jb.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this}; +Jb.prototype.multiply=function(a){var b=this.m11*a.m11+this.m21*a.m12,c=this.m12*a.m11+this.m22*a.m12,d=this.m11*a.m21+this.m21*a.m22,e=this.m12*a.m21+this.m22*a.m22;this.dx=this.m11*a.dx+this.m21*a.dy+this.dx;this.dy=this.m12*a.dx+this.m22*a.dy+this.dy;this.m11=b;this.m12=c;this.m21=d;this.m22=e;return this}; +Jb.prototype.bv=function(a){var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,f=a.m11*b,g=b*(a.m21*a.dy-a.m22*a.dx);a=b*(a.m12*a.dx-a.m11*a.dy);b=this.m11*c+this.m21*d;c=this.m12*c+this.m22*d;d=this.m11*e+this.m21*f;e=this.m12*e+this.m22*f;this.dx=this.m11*g+this.m21*a+this.dx;this.dy=this.m12*g+this.m22*a+this.dy;this.m11=b;this.m12=c;this.m21=d;this.m22=e;return this}; +Jb.prototype.gs=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),f=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this}; +Jb.prototype.rotate=function(a,b,c){360<=a?a-=360:0>a&&(a+=360);if(0===a)return this;this.translate(b,c);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));var e=this.m12*a+this.m22*d,f=this.m11*-d+this.m21*a,g=this.m12*-d+this.m22*a;this.m11=this.m11*a+this.m21*d;this.m12=e;this.m21=f;this.m22=g;this.translate(-b,-c);return this};t=Jb.prototype;t.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this}; +t.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};t.La=function(a){var b=a.x,c=a.y;return a.h(b*this.m11+c*this.m21+this.dx,b*this.m12+c*this.m22+this.dy)};t.Rd=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=a.x,d=a.y;return a.h(c*this.m22*b+d*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx),c*-this.m12*b+d*this.m11*b+b*(this.m12*this.dx-this.m11*this.dy))}; +t.Tw=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=1.25*a.x,d=1.2*a.y;return a.h(c*this.m22*b+d*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx),c*-this.m12*b+d*this.m11*b+b*(this.m12*this.dx-this.m11*this.dy))}; +t.fp=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,g=this.m12,h=this.m21,k=this.m22,l=this.dx,m=this.dy,n=b*f+c*h+l,p=b*g+c*k+m,r=d*f+c*h+l,q=d*g+c*k+m;c=b*f+e*h+l;b=b*g+e*k+m;f=d*f+e*h+l;d=d*g+e*k+m;e=Math.min(n,r);n=Math.max(n,r);r=Math.min(p,q);p=Math.max(p,q);e=Math.min(e,c);n=Math.max(n,c);r=Math.min(r,b);p=Math.max(p,b);e=Math.min(e,f);n=Math.max(n,f);r=Math.min(r,d);p=Math.max(p,d);a.h(e,r,n-e,p-r);return a};Jb.alloc=function(){var a=Ad.pop();return void 0===a?new Jb:a}; +Jb.free=function(a){Ad.push(a)};Jb.prototype.transformRect=Jb.prototype.fp;Jb.prototype.transformPoint=Jb.prototype.La;Jb.prototype.scale=Jb.prototype.scale;Jb.prototype.translate=Jb.prototype.translate;Jb.prototype.rotate=Jb.prototype.rotate;Jb.prototype.invert=Jb.prototype.gs;Jb.prototype.multiplyInverted=Jb.prototype.bv;Jb.prototype.multiply=Jb.prototype.multiply;Jb.prototype.reset=Jb.prototype.reset;Jb.prototype.isIdentity=Jb.prototype.js;Jb.prototype.equals=Jb.prototype.D; +Jb.prototype.setTransform=Jb.prototype.setTransform;Jb.prototype.set=Jb.prototype.set;var Ad=[];Jb.className="Transform";Jb.xF="54a702f3e53909c447824c6706603faf4c"; +var L={CA:"7da71ca0ad381e90",zg:(Math.sqrt(2)-1)/3*4,Mv:null,sqrt:function(a){if(0>=a)return 0;var b=L.Mv;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);L.Mv=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},C:function(a,b){a-=b;return.5>a&&-.5<a},ha:function(a,b){a-=b;return 5E-8>a&&-5E-8<a},Yb:function(a,b,c,d,e,f,g){0>=e&&(e=1E-6);if(a<c){var h=a;var k=c}else h=c,k=a;if(b<d){var l=b;var m=d}else l=d,m=b;if(a===c)return l<=g&&g<=m&&a-e<=f&&f<=a+e;if(b===d)return h<= +f&&f<=k&&b-e<=g&&g<=b+e;k+=e;h-=e;if(h<=f&&f<=k&&(m+=e,l-=e,l<=g&&g<=m))if(k-h>m-l)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=g&&g<=f+e)return!0}else return!0;else if(b-d>e||d-b>e){if(g=(c-a)/(d-b)*(g-b)+a,g-e<=f&&f<=g+e)return!0}else return!0;return!1},Or:function(a,b,c,d,e,f,g,h,k,l,m,n){if(L.Yb(a,b,g,h,n,c,d)&&L.Yb(a,b,g,h,n,e,f))return L.Yb(a,b,g,h,n,l,m);var p=(a+c)/2,r=(b+d)/2,q=(c+e)/2,u=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(p+q)/2;c=(r+u)/2;q=(q+e)/2;u=(u+f)/2;var x=(d+q)/2,y=(c+u)/2;return L.Or(a, +b,p,r,d,c,x,y,k,l,m,n)||L.Or(x,y,q,u,e,f,g,h,k,l,m,n)},Uw:function(a,b,c,d,e,f,g,h,k){var l=(c+e)/2,m=(d+f)/2;k.h((((a+c)/2+l)/2+(l+(e+g)/2)/2)/2,(((b+d)/2+m)/2+(m+(f+h)/2)/2)/2);return k},Ky:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Nb(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},Dl:function(a,b,c,d,e,f,g,h,k,l){if(L.Yb(a,b,g,h,k,c,d)&&L.Yb(a,b,g,h,k,e,f))lc(l,a,b,0,0),lc(l,g,h,0,0);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/ +2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;L.Dl(a,b,m,n,d,c,q,u,k,l);L.Dl(q,u,p,r,e,f,g,h,k,l)}return l},Qe:function(a,b,c,d,e,f,g,h,k,l){if(L.Yb(a,b,g,h,k,c,d)&&L.Yb(a,b,g,h,k,e,f))0===l.length&&(l.push(a),l.push(b)),l.push(g),l.push(h);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;L.Qe(a,b,m,n,d,c,q,u,k,l);L.Qe(q,u,p,r,e,f,g,h,k,l)}return l},gv:function(a,b,c,d,e,f,g,h,k,l){if(L.Yb(a,b,e,f,l,c,d))return L.Yb(a, +b,e,f,l,h,k);var m=(a+c)/2,n=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var p=(m+c)/2,r=(n+d)/2;return L.gv(a,b,m,n,p,r,g,h,k,l)||L.gv(p,r,c,d,e,f,g,h,k,l)},NA:function(a,b,c,d,e,f,g){g.h(((a+c)/2+(c+e)/2)/2,((b+d)/2+(d+f)/2)/2);return g},fv:function(a,b,c,d,e,f,g,h){if(L.Yb(a,b,e,f,g,c,d))lc(h,a,b,0,0),lc(h,e,f,0,0);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;L.fv(a,b,k,l,m,n,g,h);L.fv(m,n,c,d,e,f,g,h)}return h},To:function(a,b,c,d,e,f,g,h){if(L.Yb(a,b,e,f,g,c,d))0===h.length&&(h.push(a), +h.push(b)),h.push(e),h.push(f);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;L.To(a,b,k,l,m,n,g,h);L.To(m,n,c,d,e,f,g,h)}return h},uo:function(a,b,c,d,e,f,g,h,k,l,m,n,p,r){if(L.Yb(a,b,g,h,p,c,d)&&L.Yb(a,b,g,h,p,e,f)){if(!L.Nl(a,b,g,h,k,l,m,n))return!1;p=(a-g)*(l-n)-(b-h)*(k-m);if(0===p)return!1;r.h(((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/p,((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/p);return!0}var q=(a+c)/2,u=(b+d)/2,x=(c+e)/2,y=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+x)/2;c=(u+y)/2;x=(x+e)/ +2;y=(y+f)/2;var z=(d+x)/2,B=(c+y)/2,C=Infinity,D=!1,J=0,U=0;L.uo(a,b,q,u,d,c,z,B,k,l,m,n,p,r)&&(a=(r.x-k)*(r.x-k)+(r.y-l)*(r.y-l),a<C&&(C=a,D=!0,J=r.x,U=r.y));L.uo(z,B,x,y,e,f,g,h,k,l,m,n,p,r)&&(r.x-k)*(r.x-k)+(r.y-l)*(r.y-l)<C&&(D=!0,J=r.x,U=r.y);D&&(r.x=J,r.y=U);return D},vo:function(a,b,c,d,e,f,g,h,k,l,m,n,p){var r=0;if(L.Yb(a,b,g,h,p,c,d)&&L.Yb(a,b,g,h,p,e,f)){p=(a-g)*(l-n)-(b-h)*(k-m);if(0===p)return r;var q=((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/p,u=((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/p;if(q>=m)return r; +if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(b<h?(k=b,a=h):(k=h,a=b),u<k||u>a)return r}else if(a<g?(k=a,a=g):k=g,q<k||q>a)return r;0<p?r++:0>p&&r--}else{q=(a+c)/2;u=(b+d)/2;var x=(c+e)/2,y=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+x)/2;c=(u+y)/2;x=(x+e)/2;y=(y+f)/2;var z=(d+x)/2,B=(c+y)/2;r+=L.vo(a,b,q,u,d,c,z,B,k,l,m,n,p);r+=L.vo(z,B,x,y,e,f,g,h,k,l,m,n,p)}return r},qh:function(a,b,c,d,e,f,g){if(L.ha(a,c)){b<d?(c=b,b=d):c=d;if(f<c)return g.h(a,c),!1;if(f>b)return g.h(a,b),!1;g.h(a,f);return!0}if(L.ha(b,d)){a<c?(d= +a,a=c):d=c;if(e<d)return g.h(d,b),!1;if(e>a)return g.h(a,b),!1;g.h(e,b);return!0}e=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>e)return g.h(a,b),!1;if(1.000005<e)return g.h(c,d),!1;g.h(a+e*(c-a),b+e*(d-b));return!0},We:function(a,b,c,d,e,f,g,h,k){if(L.C(a,c)&&L.C(b,d))return k.h(a,b),!1;if(L.ha(e,g))return L.ha(a,c)?(L.qh(a,b,c,d,e,f,k),!1):L.qh(a,b,c,d,e,(d-b)/(c-a)*(e-a)+b,k);h=(h-f)/(g-e);if(L.ha(a,c)){c=h*(a-e)+f;b<d?(e=b,b=d):e=d;if(c<e)return k.h(a,e),!1;if(c>b)return k.h(a, +b),!1;k.h(a,c);return!0}g=(d-b)/(c-a);if(L.ha(h,g))return L.qh(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(L.ha(g,0)){a<c?(d=a,a=c):d=c;if(e<d)return k.h(d,b),!1;if(e>a)return k.h(a,b),!1;k.h(e,b);return!0}return L.qh(a,b,c,d,e,g*(e-a)+b,k)},LA:function(a,b,c,d,e){return L.We(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},KA:function(a,b,c,d,e,f,g,h,k,l){function m(c,d){var e=(c-a)*(c-a)+(d-b)*(d-b);e<n&&(n=e,k.h(c,d))}var n=Infinity;m(k.x,k.y);var p=0,r=0,q=0,u=0;e<g?(p=e,r=g):(p=g,r=e);f<h?(q=e,u=g):(q=g,u= +e);p=(r-p)/2+l;l=(u-q)/2+l;e=(e+g)/2;f=(f+h)/2;if(0===p||0===l)return k;if(.5>(c>a?c-a:a-c)){p=1-(c-e)*(c-e)/(p*p);if(0>p)return k;p=Math.sqrt(p);d=-l*p+f;m(c,l*p+f);m(c,d)}else{c=(d-b)/(c-a);d=1/(p*p)+c*c/(l*l);h=2*c*(b-c*a)/(l*l)-2*c*f/(l*l)-2*e/(p*p);p=h*h-4*d*(2*c*a*f/(l*l)-2*b*f/(l*l)+f*f/(l*l)+e*e/(p*p)-1+(b-c*a)*(b-c*a)/(l*l));if(0>p)return k;p=Math.sqrt(p);l=(-h+p)/(2*d);m(l,c*l-c*a+b);p=(-h-p)/(2*d);m(p,c*p-c*a+b)}return k},If:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(L.We(a,b,a, +d,e,f,g,h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);p<l&&(l=p,m=k.x,n=k.y)}L.We(c,b,c,d,e,f,g,h,k)&&(p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f),p<l&&(l=p,m=k.x,n=k.y));L.We(a,b,c,b,e,f,g,h,k)&&(b=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f),b<l&&(l=b,m=k.x,n=k.y));L.We(a,d,c,d,e,f,g,h,k)&&(a=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f),a<l&&(l=a,m=k.x,n=k.y));k.h(m,n);return 1E21>l},JA:function(a,b,c,d,e,f,g,h,k){c=a-c;g=e-g;0===c||0===g?0===c?(b=(f-h)/g,h=a,e=b*h+(f-b*e)):(f=(b-d)/c,h=e,e=f*h+(b-f*a)):(d=(b-d)/c,h=(f-h)/g,a=b-d*a, +h=(f-h*e-a)/(d-h),e=d*h+a);k.h(h,e);return k},es:function(a,b,c){return L.Ax(a.x,a.y,a.width,a.height,b.x,b.y,c.x,c.y)},Ax:function(a,b,c,d,e,f,g,h){var k=a+c,l=b+d;return e===g?(f<h?(g=f,f=h):g=h,a<=e&&e<=k&&g<=l&&f>=b):f===h?(e<g?(h=e,e=g):h=g,b<=f&&f<=l&&h<=k&&e>=a):mc(a,b,c,d,e,f)||mc(a,b,c,d,g,h)||L.Nl(a,b,k,b,e,f,g,h)||L.Nl(k,b,k,l,e,f,g,h)||L.Nl(k,l,a,l,e,f,g,h)||L.Nl(a,l,a,b,e,f,g,h)?!0:!1},Nl:function(a,b,c,d,e,f,g,h){return 0>=L.Gl(a,b,c,d,e,f)*L.Gl(a,b,c,d,g,h)&&0>=L.Gl(e,f,g,h,a,b)*L.Gl(e, +f,g,h,c,d)},Gl:function(a,b,c,d,e,f){c-=a;d-=b;a=e-a;b=f-b;f=a*d-b*c;0===f&&(f=a*c+b*d,0<f&&(f=(a-c)*c+(b-d)*d,0>f&&(f=0)));return f},Ro:function(a){0>a&&(a+=360);360<=a&&(a-=360);return a},$w:function(a,b,c,d,e,f){var g=Math.PI;f||(d*=g/180,e*=g/180);var h=d>e?-1:1;f=[];var k=g/2,l=d;d=Math.min(2*g,Math.abs(e-d));if(1E-5>d)return k=l+h*Math.min(d,k),h=a+c*Math.cos(l),l=b+c*Math.sin(l),a+=c*Math.cos(k),b+=c*Math.sin(k),c=(h+a)/2,k=(l+b)/2,f.push([h,l,c,k,c,k,a,b]),f;for(;1E-5<d;)e=l+h*Math.min(d, +k),f.push(L.Ty(c,l,e,a,b)),d-=Math.abs(e-l),l=e;return f},Ty:function(a,b,c,d,e){var f=(c-b)/2,g=a*Math.cos(f),h=a*Math.sin(f),k=-h,l=g*g+k*k,m=l+g*g+k*h;l=4/3*(Math.sqrt(2*l*m)-m)/(g*h-k*g);h=g-l*k;g=k+l*g;k=-g;l=f+b;f=Math.cos(l);l=Math.sin(l);return[d+a*Math.cos(b),e+a*Math.sin(b),d+h*f-g*l,e+h*l+g*f,d+h*f-k*l,e+h*l+k*f,d+a*Math.cos(c),e+a*Math.sin(c)]},Eo:function(a,b,c,d,e,f,g){c=Math.floor((a-c)/e)*e+c;d=Math.floor((b-d)/f)*f+d;var h=c;c+e-a<e/2&&(h=c+e);a=d;d+f-b<f/2&&(a=d+f);g.h(h,a);return g}, +ox:function(a,b){var c=Math.max(a,b);a=Math.min(a,b);var d;do b=c%a,c=d=a,a=b;while(0<b);return d},Yy:function(a,b,c,d){var e=0>c,f=0>d;if(a<b){var g=1;var h=0}else g=0,h=1;var k=0===g?a:b;var l=0===g?c:d;if(0===g?e:f)l=-l;g=h;c=0===g?c:d;if(0===g?e:f)c=-c;return L.Zy(k,0===g?a:b,l,c,0,0)},Zy:function(a,b,c,d,e,f){if(0<d)if(0<c){e=a*a;f=b*b;a*=c;var g=b*d,h=-f+g,k=-f+Math.sqrt(a*a+g*g);b=h;for(var l=0;9999999999>l;++l){b=.5*(h+k);if(b===h||b===k)break;var m=a/(b+e),n=g/(b+f);m=m*m+n*n-1;if(0<m)h= +b;else if(0>m)k=b;else break}c=e*c/(b+e)-c;d=f*d/(b+f)-d;c=Math.sqrt(c*c+d*d)}else c=Math.abs(d-b);else d=a*a-b*b,f=a*c,f<d?(d=f/d,f=b*Math.sqrt(Math.abs(1-d*d)),c=a*d-c,c=Math.sqrt(c*c+f*f)):c=Math.abs(c-a);return c},te:new db,qm:new db,Pf:new db,Qf:0,rm:100};L.za=L.CA; +function N(a){G&&1<arguments.length&&v("Geometry constructor can take at most one optional argument, the Geometry type.");Za(this);this.o=2;void 0===a?a=N.m:G&&ab(a,N,N,"constructor:type");this.wa=a;this.Ec=this.Dc=this.od=this.nd=0;a===N.m?this.de=new H:(null===N.$&&(N.$=(new H).freeze()),this.de=N.$);this.Rp=this.de.A;this.zp=(new M).freeze();this.tm=this.uk=null;this.um=NaN;this.jg=Fc;this.kg=Oc;this.Tk=this.Uk=NaN;this.Wf=Bd} +N.prototype.copy=function(){var a=new N;a.o=this.o&-2;a.wa=this.wa;a.nd=this.nd;a.od=this.od;a.Dc=this.Dc;a.Ec=this.Ec;if(this.wa===N.m){for(var b=this.de.s,c=a.de,d=0;d<b.length;d++)c.add(b[d].copy());a.de=c}else a.de=this.de;a.Rp=this.Rp;a.zp.assign(this.zp);a.uk=this.uk;a.tm=this.tm;a.um=this.um;a.jg=this.jg.M();a.kg=this.kg.M();a.Uk=this.Uk;a.Tk=this.Tk;a.Wf=this.Wf;return a};N.prototype.na=function(){this.freeze();Object.freeze(this);return this}; +N.prototype.freeze=function(){this._isFrozen=!0;if(this.type!==N.m)return this;var a=this.figures;a.freeze();a=a.s;for(var b=a.length,c=0;c<b;c++)a[c].freeze();return this};N.prototype.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;if(this.type!==N.m)return this;var a=this.figures;a.pa();a=a.s;for(var b=a.length,c=0;c<b;c++)a[c].pa();return this}; +N.prototype.fb=function(a){if(!(a instanceof N))return!1;if(this.type!==a.type)return this.type===N.j&&a.type===N.m?Cd(this,a):a.type===N.j&&this.type===N.m?Cd(a,this):!1;if(this.type===N.m){var b=this.figures.s;a=a.figures.s;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].fb(a[d]))return!1;return!0}return L.C(this.startX,a.startX)&&L.C(this.startY,a.startY)&&L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)}; +function Cd(a,b){return a.type!==N.j||b.type!==N.m?!1:1===b.figures.count&&(b=b.figures.N(0),1===b.segments.count&&L.C(a.startX,b.startX)&&L.C(a.startY,b.startY)&&(b=b.segments.N(0),b.type===Dd&&L.C(a.endX,b.endX)&&L.C(a.endY,b.endY)))?!0:!1}N.ma=function(a){return a.toString()};N.prototype.ub=function(a){a.classType===N?this.type=a:Ea(this,a)}; +N.prototype.toString=function(a){void 0===a&&(a=-1);switch(this.type){case N.j:return 0>a?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a)+"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);case N.v:var b=new M(this.startX,this.startY,0,0);b.Bv(this.endX,this.endY,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+ +b.x.toFixed(a)+" "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+"V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case N.G:b=new M(this.startX,this.startY,0,0);b.Bv(this.endX,this.endY,0,0);if(0>a)return a=b.left.toString()+" "+(b.y+b.height/2).toString(),"M"+a+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+(b.right.toString()+" "+(b.y+b.height/2).toString())+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+a;var c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+ +c+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+(b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a))+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case N.m:b="";c=this.figures.s;for(var d=c.length,e=0;e<d;e++){var f=c[e];0<e&&(b+=" x ");f.isFilled&&(b+="F ");b+=f.toString(a)}return b;default:return this.type.toString()}}; +N.ob=function(a){"string"!==typeof a&&Aa(a,"string",N,"fillPath:str");a=a.split(/[Xx]/);for(var b=a.length,c="",d=0;d<b;d++){var e=a[d];c=null!==e.match(/[Ff]/)?0===d?c+e:c+("X"+(" "===e[0]?"":" ")+e):c+((0===d?"":"X ")+"F"+(" "===e[0]?"":" ")+e)}return c}; +N.parse=function(a,b){function c(){return u>=C-1?!0:null!==l[u+1].match(D)}function d(){u++;return l[u]}function e(a){var b=parseFloat(d()),c=parseFloat(d());x===x.toLowerCase()&&(b=B.x+b,c=B.y+c);a.h(b,c)}function f(){e(B);return B}function g(){e(z);return z}function h(){var a=y.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!==a?B:new K(2*B.x-z.x,2*B.y-z.y)}void 0===b&&(b=!1);"string"!==typeof a&&Aa(a,"string",N,"parse:str");var k=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm; +a=a.replace(/,/gm," ");a=a.replace(k,"$1 $2");a=a.replace(k,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2");a=a.replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");var l=a.split(" ");for(a=0;a<l.length;a++){var m=l[a];if(null!==m.match(/(\.[0-9]*)(\.)/gm)){k=Na();for(var n="",p=!1,r=0;r<m.length;r++){var q=m[r];"."!==q||p?"."===q?(k.push(n),n="."):n+=q:(p=!0,n+=q)}k.push(n); +l.splice(a,1);for(m=0;m<k.length;m++)l.splice(a+m,0,k[m]);a+=k.length-1;Pa(k)}}var u=-1,x="",y="";k=new K(0,0);var z=new K(0,0),B=new K(0,0),C=l.length;a=Jd(null);n=m=!1;p=!0;r=null;for(var D=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(u>=C-1);)if(y=x,x=d(),""!==x)switch(x.toUpperCase()){case "X":p=!0;n=m=!1;break;case "M":r=f();null===a.vc||!0===p?(Kd(a,r.x,r.y,m,!n),p=!1):a.moveTo(r.x,r.y);for(k.assign(B);!c();)r=f(),a.lineTo(r.x,r.y);break;case "L":for(;!c();)r=f(),a.lineTo(r.x,r.y);break;case "H":for(;!c();)B= +new K((x===x.toLowerCase()?B.x:0)+parseFloat(d()),B.y),a.lineTo(B.x,B.y);break;case "V":for(;!c();)B=new K(B.x,(x===x.toLowerCase()?B.y:0)+parseFloat(d())),a.lineTo(B.x,B.y);break;case "C":for(;!c();){r=new K;e(r);q=g();var J=f();Ld(a,r.x,r.y,q.x,q.y,J.x,J.y)}break;case "S":for(;!c();)r=h(),q=g(),J=f(),Ld(a,r.x,r.y,q.x,q.y,J.x,J.y);break;case "Q":for(;!c();)r=g(),q=f(),Md(a,r.x,r.y,q.x,q.y);break;case "T":for(;!c();)z=r=h(),q=f(),Md(a,r.x,r.y,q.x,q.y);break;case "B":for(;!c();){r=parseFloat(d()); +q=parseFloat(d());J=parseFloat(d());var U=parseFloat(d()),aa=parseFloat(d()),Y=aa,W=!1;c()||(Y=parseFloat(d()),c()||(W=0!==parseFloat(d())));x===x.toLowerCase()&&(J+=B.x,U+=B.y);a.arcTo(r,q,J,U,aa,Y,W)}break;case "A":for(;!c();)r=Math.abs(parseFloat(d())),q=Math.abs(parseFloat(d())),J=parseFloat(d()),aa=U=!1,W=Y=0,Y=d(),1===Y.length?(U=!!parseFloat(Y),aa=!!parseFloat(d()),Y=parseFloat(d())):2===Y.length?(U=!!parseFloat(Y[0]),aa=!!parseFloat(Y[1]),Y=parseFloat(d())):(U=!!parseFloat(Y[0]),aa=!!parseFloat(Y[1]), +Y=parseFloat(Y.slice(2))),W=parseFloat(d()),x===x.toLowerCase()&&(Y=B.x+Y,W=B.y+W),B.h(Y,W),Nd(a,r,q,J,U,aa,Y,W);break;case "Z":Od(a);B.assign(k);break;case "F":r="";for(q=1;l[u+q];)if(null!==l[u+q].match(/[Uu]/))q++;else if(null===l[u+q].match(D))q++;else{r=l[u+q];break}r.match(/[Mm]/)?m=!0:0<a.vc.segments.length&&(a.vc.isFilled=!0);break;case "U":r="";for(q=1;l[u+q];)if(null!==l[u+q].match(/[Ff]/))q++;else if(null===l[u+q].match(D))q++;else{r=l[u+q];break}r.match(/[Mm]/)?n=!0:a.km(!1)}k=a.Yr;Pd= +a;if(b)for(b=k.figures.iterator;b.next();)b.value.isFilled=!0;return k};N.Ma=function(a,b){for(var c=a.length,d=K.alloc(),e=0;e<c;e++){var f=a[e];d.x=f[0];d.y=f[1];b.La(d);f[0]=d.x;f[1]=d.y;d.x=f[2];d.y=f[3];b.La(d);f[2]=d.x;f[3]=d.y;d.x=f[4];d.y=f[5];b.La(d);f[4]=d.x;f[5]=d.y;d.x=f[6];d.y=f[7];b.La(d);f[6]=d.x;f[7]=d.y}K.free(d)};N.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===N.m){if(this.Rp!==this.figures.A)return!0;for(var a=this.figures.s,b=a.length,c=0;c<b;c++)if(a[c].Zu())return!0}return!1}; +N.prototype.computeBounds=function(){this._isInvalidBounds=!1;this.tm=this.uk=null;this.um=NaN;if(this.type===N.m){this.Rp=this.figures.A;for(var a=this.figures.s,b=a.length,c=0;c<b;c++){var d=a[c];d._isInvalidBounds=!1;var e=d.segments;d.br=e.A;d=e.s;e=d.length;for(var f=0;f<e;f++){var g=d[f];g._isInvalidBounds=!1;g.$d=null}}}a=this.zp;a.pa();isNaN(this.Uk)||isNaN(this.Tk)?a.h(0,0,0,0):a.h(0,0,this.Uk,this.Tk);Qd(this,a,!1);lc(a,0,0,0,0);a.freeze()}; +N.prototype.Zw=function(){var a=new M;Qd(this,a,!0);return a}; +function Qd(a,b,c){switch(a.type){case N.j:case N.v:case N.G:c?b.h(a.nd,a.od,0,0):lc(b,a.nd,a.od,0,0);lc(b,a.Dc,a.Ec,0,0);break;case N.m:var d=a.figures;a=d.s;d=d.length;for(var e=0;e<d;e++){var f=a[e];c&&0===e?b.h(f.startX,f.startY,0,0):lc(b,f.startX,f.startY,0,0);for(var g=f.segments.s,h=g.length,k=f.startX,l=f.startY,m=0;m<h;m++){var n=g[m];switch(n.type){case Dd:case Wd:k=n.endX;l=n.endY;lc(b,k,l,0,0);break;case Xd:L.Dl(k,l,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.5,b);k=n.endX; +l=n.endY;break;case Yd:L.fv(k,l,n.point1X,n.point1Y,n.endX,n.endY,.5,b);k=n.endX;l=n.endY;break;case Zd:case $d:var p=n.type===Zd?ae(n,f):be(n,f,k,l),r=p.length;if(0===r){k=n.type===Zd?n.centerX:n.endX;l=n.type===Zd?n.centerY:n.endY;lc(b,k,l,0,0);break}n=null;for(var q=0;q<r;q++)n=p[q],L.Dl(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],.5,b);null!==n&&(k=n[6],l=n[7]);break;default:v("Unknown Segment type: "+n.type)}}}break;default:v("Unknown Geometry type: "+a.type)}} +N.prototype.normalize=function(){this._isFrozen&&xa(this);var a=this.Zw();this.offset(-a.x,-a.y);return new K(-a.x,-a.y)};N.prototype.offset=function(a,b){this._isFrozen&&xa(this);G&&(E(a,N,"offset"),E(b,N,"offset"));this.transform(1,0,0,1,a,b);return this};N.prototype.scale=function(a,b){this._isFrozen&&xa(this);G&&(E(a,N,"scale:x"),E(b,N,"scale:y"),0===a&&Ba(a,"scale must be non-zero",N,"scale:x"),0===b&&Ba(b,"scale must be non-zero",N,"scale:y"));this.transform(a,0,0,b,0,0);return this}; +N.prototype.rotate=function(a,b,c){this._isFrozen&&xa(this);void 0===b&&(b=0);void 0===c&&(c=0);G&&(E(a,N,"rotate:angle"),E(b,N,"rotate:x"),E(c,N,"rotate:y"));var d=Jb.alloc();d.reset();d.rotate(a,b,c);this.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);Jb.free(d);return this};t=N.prototype; +t.transform=function(a,b,c,d,e,f){switch(this.type){case N.j:case N.v:case N.G:var g=this.nd;var h=this.od;this.nd=g*a+h*c+e;this.od=g*b+h*d+f;g=this.Dc;h=this.Ec;this.Dc=g*a+h*c+e;this.Ec=g*b+h*d+f;break;case N.m:for(var k=this.figures.s,l=k.length,m=0;m<l;m++){var n=k[m];g=n.startX;h=n.startY;n.startX=g*a+h*c+e;n.startY=g*b+h*d+f;n=n.segments.s;for(var p=n.length,r=0;r<p;r++){var q=n[r];switch(q.type){case Dd:case Wd:g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;break;case Xd:g=q.point1X; +h=q.point1Y;q.point1X=g*a+h*c+e;q.point1Y=g*b+h*d+f;g=q.point2X;h=q.point2Y;q.point2X=g*a+h*c+e;q.point2Y=g*b+h*d+f;g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;break;case Yd:g=q.point1X;h=q.point1Y;q.point1X=g*a+h*c+e;q.point1Y=g*b+h*d+f;g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;break;case Zd:g=q.centerX;h=q.centerY;q.centerX=g*a+h*c+e;q.centerY=g*b+h*d+f;0!==b&&(g=180*Math.atan2(b,a)/Math.PI,0>g&&(g+=360),q.startAngle+=g);0>a&&(q.startAngle=180-q.startAngle,q.sweepAngle=-q.sweepAngle); +0>d&&(q.startAngle=-q.startAngle,q.sweepAngle=-q.sweepAngle);q.radiusX*=Math.sqrt(a*a+c*c);void 0!==q.radiusY&&(q.radiusY*=Math.sqrt(b*b+d*d));break;case $d:g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;if(0===q.radiusX||0===q.radiusY)break;0!==b&&(g=180*Math.atan2(b,a)/Math.PI,0>g&&(g+=360),q.xAxisRotation+=g);0>a&&(q.xAxisRotation=180-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);0>d&&(q.xAxisRotation=-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);q.radiusX*=Math.sqrt(a*a+c*c); +q.radiusY*=Math.sqrt(b*b+d*d);break;default:v("Unknown Segment type: "+q.type)}}}}this._isInvalidBounds=!0;return this}; +t.ga=function(a,b){void 0===b&&(b=0);var c=this.nd,d=this.od,e=this.Dc,f=this.Ec;switch(this.type){case N.j:return L.Yb(c,d,e,f,b,a.x,a.y);case N.v:var g=M.allocAt(Math.min(c,e)-b,Math.min(d,f)-b,Math.abs(e-c)+2*b,Math.abs(f-d)+2*b);a=g.ga(a);M.free(g);return a;case N.G:g=Math.min(c,e)-b;var h=Math.min(d,f)-b;c=(Math.abs(e-c)+2*b)/2;b=(Math.abs(f-d)+2*b)/2;if(0>=c||0>=b)return!1;g=a.x-(g+c);h=a.y-(h+b);return 1>=g*g/(c*c)+h*h/(b*b);case N.m:return fe(this,a,b,!0,!1);default:return!1}}; +function fe(a,b,c,d,e){var f=b.x;b=b.y;for(var g=a.bounds.x-20,h=0,k,l,m,n,p=a.figures.s,r=p.length,q=0;q<r;q++){var u=p[q];if(u.isFilled){if(d&&u.ga(f,b,c))return!0;var x=u.segments;k=u.startX;l=u.startY;for(var y=k,z=l,B=x.s,C=0;C<=x.length;C++){var D=void 0;if(C!==x.length){D=B[C];var J=D.type;a=D.endX;n=D.endY}else J=Dd,a=y,n=z;switch(J){case Wd:y=ge(f,b,g,b,k,l,y,z);if(isNaN(y))return!0;h+=y;y=a;z=n;break;case Dd:k=ge(f,b,g,b,k,l,a,n);if(isNaN(k))return!0;h+=k;break;case Xd:m=L.vo(k,l,D.point1X, +D.point1Y,D.point2X,D.point2Y,a,n,g,b,f,b,.5);h+=m;break;case Yd:m=L.vo(k,l,(k+2*D.point1X)/3,(l+2*D.point1Y)/3,(2*D.point1X+a)/3,(2*D.point1Y+n)/3,a,n,g,b,f,b,.5);h+=m;break;case Zd:case $d:J=D.type===Zd?ae(D,u):be(D,u,k,l);var U=J.length;if(0===U){k=ge(f,b,g,b,k,l,D.type===Zd?D.centerX:D.endX,D.type===Zd?D.centerY:D.endY);if(isNaN(k))return!0;h+=k;break}D=null;for(var aa=0;aa<U;aa++){D=J[aa];if(0===aa){m=ge(f,b,g,b,k,l,D[0],D[1]);if(isNaN(m))return!0;h+=m}m=L.vo(D[0],D[1],D[2],D[3],D[4],D[5],D[6], +D[7],g,b,f,b,.5);h+=m}null!==D&&(a=D[6],n=D[7]);break;default:v("Unknown Segment type: "+D.type)}k=a;l=n}if(0!==h)return!0;h=0}else if(u.ga(f,b,e?c:c+2))return!0}return 0!==h} +function ge(a,b,c,d,e,f,g,h){if(L.Yb(e,f,g,h,.05,a,b))return NaN;var k=(a-c)*(f-h);if(0===k)return 0;var l=((a*d-b*c)*(e-g)-(a-c)*(e*h-f*g))/k;b=(a*d-b*c)*(f-h)/k;if(l>=a)return 0;if((e>g?e-g:g-e)<(f>h?f-h:h-f))if(f<h){if(b<f||b>h)return 0}else{if(b<h||b>f)return 0}else if(e<g){if(l<e||l>g)return 0}else if(l<g||l>e)return 0;return 0<k?1:-1}function he(a,b,c,d){a=a.figures.s;for(var e=a.length,f=0;f<e;f++)if(a[f].ga(b,c,d))return!0;return!1} +t.Qu=function(a,b){0>a?a=0:1<a&&(a=1);void 0===b&&(b=new K);if(this.type===N.j)return b.h(this.startX+a*(this.endX-this.startX),this.startY+a*(this.endY-this.startY)),b;for(var c=this.flattenedSegments,d=this.flattenedLengths,e=c.length,f=this.flattenedTotalLength*a,g=0,h=0;h<e;h++){var k=d[h],l=k.length;for(a=0;a<l;a++){var m=k[a];if(g+m>=f)return d=f-g,d=0===m?0:d/m,c=c[h],h=c[2*a],e=c[2*a+1],b.h(h+(c[2*a+2]-h)*d,e+(c[2*a+3]-e)*d),b;g+=m}}return b}; +t.px=function(a){0>a?a=0:1<a&&(a=1);if(this.type===N.j)return 180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI;for(var b=this.flattenedSegments,c=this.flattenedLengths,d=b.length,e=this.flattenedTotalLength*a,f=0,g=0;g<d;g++){var h=c[g],k=h.length;for(a=0;a<k;a++){var l=h[a];if(f+l>=e)return e=b[g],b=e[2*a],c=e[2*a+1],d=e[2*a+2],a=e[2*a+3],1>Math.abs(d-b)&&1>Math.abs(a-c)?0:1>Math.abs(d-b)?0<=a-c?90:270:1>Math.abs(a-c)?0<=d-b?0:180:180*Math.atan2(a-c,d-b)/Math.PI;f+=l}}return NaN}; +t.Ru=function(a,b){0>a?a=0:1<a&&(a=1);void 0===b&&(b=[]);b.length=3;if(this.type===N.j)return b[0]=this.startX+a*(this.endX-this.startX),b[1]=this.startY+a*(this.endY-this.startY),b[2]=180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI,b;for(var c=this.flattenedSegments,d=this.flattenedLengths,e=c.length,f=this.flattenedTotalLength*a,g=0,h=0;h<e;h++){var k=d[h],l=k.length;for(a=0;a<l;a++){var m=k[a];if(g+m>=f)return d=f-g,d=0===m?0:d/m,m=c[h],c=m[2*a],h=m[2*a+1],e=m[2*a+2],a=m[2* +a+3],b[0]=c+(e-c)*d,b[1]=h+(a-h)*d,b[2]=1>Math.abs(e-c)&&1>Math.abs(a-h)?0:1>Math.abs(e-c)?0<=a-h?90:270:1>Math.abs(a-h)?0<=e-c?0:180:180*Math.atan2(a-h,e-c)/Math.PI,b;g+=m}}return b}; +t.qx=function(a){if(this.type===N.j){var b=this.startX,c=this.startY,d=this.endX,e=this.endY;if(b!==d||c!==e){var f=a.x;a=a.y;if(b===d){if(c<e){var g=c;d=e}else g=e,d=c;return a<=g?g===c?0:1:a>=d?d===c?0:1:Math.abs(a-c)/(d-g)}if(c===e)return b<d?g=b:(g=d,d=b),f<=g?g===b?0:1:f>=d?d===b?0:1:Math.abs(f-b)/(d-g);g=(d-b)*(d-b)+(e-c)*(e-c);var h=K.alloc();L.qh(b,c,d,e,f,a,h);a=h.x;f=h.y;K.free(h);return Math.sqrt(((a-b)*(a-b)+(f-c)*(f-c))/g)}}else if(this.type===N.v){g=this.startX;h=this.startY;var k=this.endX; +e=this.endY;if(g!==k||h!==e){b=k-g;c=e-h;f=2*b+2*c;d=a.x;a=a.y;d=Math.min(Math.max(d,g),k);a=Math.min(Math.max(a,h),e);g=Math.abs(d-g);k=Math.abs(d-k);h=Math.abs(a-h);e=Math.abs(a-e);var l=Math.min(g,k,h,e);if(l===h)return d/f;if(l===k)return(b+a)/f;if(l===e)return(2*b+c-d)/f;if(l===g)return(2*b+2*c-a)/f}}else{b=this.flattenedSegments;c=this.flattenedLengths;f=this.flattenedTotalLength;d=K.alloc();e=Infinity;h=g=0;k=b.length;for(var m=l=0,n=0;n<k;n++)for(var p=b[n],r=c[n],q=p.length,u=0;u<q;u+=2){var x= +p[u],y=p[u+1];if(0!==u){L.qh(l,m,x,y,a.x,a.y,d);var z=(d.x-a.x)*(d.x-a.x)+(d.y-a.y)*(d.y-a.y);z<e&&(e=z,g=h,g+=Math.sqrt((d.x-l)*(d.x-l)+(d.y-m)*(d.y-m)));h+=r[(u-2)/2]}l=x;m=y}K.free(d);a=g/f;return 0>a?0:1<a?1:a}return 0}; +function ie(a){if(null===a.uk){var b=a.uk=[],c=a.tm=[],d=[],e=[];if(a.type===N.j)d.push(a.startX),d.push(a.startY),d.push(a.endX),d.push(a.endY),b.push(d),e.push(Math.sqrt((a.startX-a.endX)*(a.startX-a.endX)+(a.startY-a.endY)*(a.startY-a.endY))),c.push(e);else if(a.type===N.v)d.push(a.startX),d.push(a.startY),d.push(a.endX),d.push(a.startY),d.push(a.endX),d.push(a.endY),d.push(a.startX),d.push(a.endY),d.push(a.startX),d.push(a.startY),b.push(d),e.push(Math.abs(a.startX-a.endX)),e.push(Math.abs(a.startY- +a.endY)),e.push(Math.abs(a.startX-a.endX)),e.push(Math.abs(a.startY-a.endY)),c.push(e);else if(a.type===N.G){var f=new je;f.startX=a.endX;f.startY=(a.startY+a.endY)/2;var g=new ke(Zd);g.startAngle=0;g.sweepAngle=360;g.centerX=(a.startX+a.endX)/2;g.centerY=(a.startY+a.endY)/2;g.radiusX=Math.abs(a.startX-a.endX)/2;g.radiusY=Math.abs(a.startY-a.endY)/2;f.add(g);a=ae(g,f);e=a.length;if(0===e)d.push(g.centerX),d.push(g.centerY);else{g=f.startX;f=f.startY;for(var h=0;h<e;h++){var k=a[h];L.Qe(g,f,k[2],k[3], +k[4],k[5],k[6],k[7],.5,d);g=k[6];f=k[7]}}b.push(d);c.push(le(d))}else for(a=a.figures.iterator;a.next();){e=a.value;d=[];d.push(e.startX);d.push(e.startY);g=e.startX;f=e.startY;h=g;k=f;for(var l=e.segments.s,m=l.length,n=0;n<m;n++){var p=l[n];switch(p.type){case Wd:4<=d.length&&(b.push(d),c.push(le(d)));d=[];d.push(p.endX);d.push(p.endY);g=p.endX;f=p.endY;h=g;k=f;break;case Dd:d.push(p.endX);d.push(p.endY);g=p.endX;f=p.endY;break;case Xd:L.Qe(g,f,p.point1X,p.point1Y,p.point2X,p.point2Y,p.endX,p.endY, +.5,d);g=p.endX;f=p.endY;break;case Yd:L.To(g,f,p.point1X,p.point1Y,p.endX,p.endY,.5,d);g=p.endX;f=p.endY;break;case Zd:var r=ae(p,e),q=r.length;if(0===q){d.push(p.centerX);d.push(p.centerY);g=p.centerX;f=p.centerY;break}for(var u=0;u<q;u++){var x=r[u];L.Qe(g,f,x[2],x[3],x[4],x[5],x[6],x[7],.5,d);g=x[6];f=x[7]}break;case $d:r=be(p,e,g,f);q=r.length;u=p.endX;x=p.endY;if(0===q){d.push(u);d.push(x);g=u;f=x;break}for(u=0;u<q;u++)x=r[u],L.Qe(g,f,x[2],x[3],x[4],x[5],x[6],x[7],.5,d),g=x[6],f=x[7];break;default:v("Segment not of valid type: "+ +p.type)}p.isClosed&&(d.push(h),d.push(k))}4<=d.length&&(b.push(d),c.push(le(d)))}}}function le(a){for(var b=[],c=0,d=0,e=a.length,f=0;f<e;f+=2){var g=a[f],h=a[f+1];0!==f&&(c=Math.sqrt(Mb(c,d,g,h)),b.push(c));c=g;d=h}return b}t.add=function(a){this.de.add(a);return this};t.lm=function(a,b,c,d,e,f,g,h){this._isFrozen&&xa(this);this.jg=(new Ib(a,b,e,f)).freeze();this.kg=(new Ib(c,d,g,h)).freeze();return this}; +oa.Object.defineProperties(N.prototype,{_isFrozen:{configurable:!0,get:function(){return 0!==(this.o&1)},set:function(a){this.o=a?this.o|1:this.o&-2}},_isInvalidBounds:{configurable:!0,get:function(){return 0!==(this.o&2)},set:function(a){this.o=a?this.o|2:this.o&-3}},flattenedSegments:{configurable:!0,get:function(){ie(this);return this.uk}},flattenedLengths:{configurable:!0,get:function(){ie(this);return this.tm}},flattenedTotalLength:{configurable:!0, +enumerable:!0,get:function(){var a=this.um;if(isNaN(a)){if(this.type===N.j){a=Math.abs(this.endX-this.startX);var b=Math.abs(this.endY-this.startY);a=Math.sqrt(a*a+b*b)}else if(this.type===N.v)a=2*Math.abs(this.endX-this.startX)+2*Math.abs(this.endY-this.startY);else{b=this.flattenedLengths;for(var c=b.length,d=a=0;d<c;d++)for(var e=b[d],f=e.length,g=0;g<f;g++)a+=e[g]}this.um=a}return a}},type:{configurable:!0,get:function(){return this.wa},set:function(a){this.wa!==a&&(G&&ab(a,N,N, +"type"),this._isFrozen&&xa(this,a),this.wa=a,a===N.m?this.de=new H:(null===N.$&&(N.$=(new H).freeze()),this.de=N.$),this._isInvalidBounds=!0)}},startX:{configurable:!0,get:function(){return this.nd},set:function(a){this.nd!==a&&(G&&E(a,N,"startX"),this._isFrozen&&xa(this,a),this.nd=a,this._isInvalidBounds=!0)}},startY:{configurable:!0,get:function(){return this.od},set:function(a){this.od!==a&&(G&&E(a,N,"startY"),this._isFrozen&&xa(this,a),this.od=a,this._isInvalidBounds= +!0)}},endX:{configurable:!0,get:function(){return this.Dc},set:function(a){this.Dc!==a&&(G&&E(a,N,"endX"),this._isFrozen&&xa(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{configurable:!0,get:function(){return this.Ec},set:function(a){this.Ec!==a&&(G&&E(a,N,"endY"),this._isFrozen&&xa(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{configurable:!0,get:function(){return this.de},set:function(a){this.de!==a&&(G&&w(a,H,N,"figures"),this._isFrozen&& +xa(this,a),this.de=a,this._isInvalidBounds=!0)}},spot1:{configurable:!0,get:function(){return this.jg},set:function(a){G&&w(a,Ib,N,"spot1");this._isFrozen&&xa(this,a);this.jg=a.M()}},spot2:{configurable:!0,get:function(){return this.kg},set:function(a){G&&w(a,Ib,N,"spot2");this._isFrozen&&xa(this,a);this.kg=a.M()}},defaultStretch:{configurable:!0,get:function(){return this.Wf},set:function(a){G&&ab(a,O,N,"stretch");this._isFrozen&&xa(this,a);this.Wf=a}},bounds:{configurable:!0, +enumerable:!0,get:function(){this.Zu()&&this.computeBounds();return this.zp}}});N.prototype.setSpots=N.prototype.lm;N.prototype.add=N.prototype.add;N.prototype.getFractionForPoint=N.prototype.qx;N.prototype.getPointAndAngleAlongPath=N.prototype.Ru;N.prototype.getAngleAlongPath=N.prototype.px;N.prototype.getPointAlongPath=N.prototype.Qu;N.prototype.containsPoint=N.prototype.ga;N.prototype.transform=N.prototype.transform;N.prototype.rotate=N.prototype.rotate;N.prototype.scale=N.prototype.scale; +N.prototype.offset=N.prototype.offset;N.prototype.normalize=N.prototype.normalize;N.prototype.computeBoundsWithoutOrigin=N.prototype.Zw;N.prototype.equalsApprox=N.prototype.fb;N.className="Geometry";N.j=new F(N,"Line",0);N.v=new F(N,"Rectangle",1);N.G=new F(N,"Ellipse",2);N.m=new F(N,"Path",3);N.$=null;N.jb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx";N.className="Geometry";N.stringify=N.ma;N.fillPath=N.ob;N.parse=N.parse;N.Line=N.j;N.Rectangle=N.v;N.Ellipse=N.G;N.Path=N.m; +function je(a,b,c,d){Za(this);void 0===c&&(c=!0);void 0===d&&(d=!0);this.o=2|(c?4:0)|(d?8:0);void 0!==a?(G&&E(a,je,"sx"),this.nd=a):this.nd=0;void 0!==b?(G&&E(b,je,"sy"),this.od=b):this.od=0;this.rl=new H;this.br=this.rl.A;this.Yv=null}je.prototype.copy=function(){var a=new je;a.o=this.o&-2;a.nd=this.nd;a.od=this.od;for(var b=this.rl.s,c=b.length,d=a.rl,e=0;e<c;e++){var f=b[e].copy();d.add(f)}a.br=this.br;a.Yv=this.Yv;return a};t=je.prototype; +t.fb=function(a){if(!(a instanceof je&&L.C(this.startX,a.startX)&&L.C(this.startY,a.startY)))return!1;var b=this.segments.s;a=a.segments.s;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].fb(a[d]))return!1;return!0};t.toString=function(a){void 0===a&&(a=-1);var b=0>a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a);for(var c=this.segments.s,d=c.length,e=0;e<d;e++)b+=" "+c[e].toString(a);return b}; +t.freeze=function(){this._isFrozen=!0;var a=this.segments;a.freeze();var b=a.s;a=a.length;for(var c=0;c<a;c++)b[c].freeze();return this};t.pa=function(){this._isFrozen=!1;var a=this.segments;a.pa();a=a.s;for(var b=a.length,c=0;c<b;c++)a[c].pa();return this};t.Zu=function(){if(this._isInvalidBounds)return!0;var a=this.segments;if(this.br!==a.A)return!0;a=a.s;for(var b=a.length,c=0;c<b;c++)if(a[c]._isInvalidBounds)return!0;return!1};t.add=function(a){this.rl.add(a);return this}; +t.ga=function(a,b,c){for(var d=this.startX,e=this.startY,f=d,g=e,h=this.segments.s,k=h.length,l=0;l<k;l++){var m=h[l];switch(m.type){case Wd:f=m.endX;g=m.endY;d=m.endX;e=m.endY;break;case Dd:if(L.Yb(d,e,m.endX,m.endY,c,a,b))return!0;d=m.endX;e=m.endY;break;case Xd:if(L.Or(d,e,m.point1X,m.point1Y,m.point2X,m.point2Y,m.endX,m.endY,.5,a,b,c))return!0;d=m.endX;e=m.endY;break;case Yd:if(L.gv(d,e,m.point1X,m.point1Y,m.endX,m.endY,.5,a,b,c))return!0;d=m.endX;e=m.endY;break;case Zd:case $d:var n=m.type=== +Zd?ae(m,this):be(m,this,d,e),p=n.length,r=m.type===Zd?m.centerX:m.endX,q=m.type===Zd?m.centerY:m.endY;if(0===p){if(L.Yb(d,e,r,q,c,a,b))return!0;d=r;e=q;break}r=null;for(q=0;q<p;q++)if(r=n[q],0===q&&L.Yb(d,e,r[0],r[1],c,a,b)||L.Or(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],.5,a,b,c))return!0;null!==r&&(d=r[6],e=r[7]);break;default:v("Unknown Segment type: "+m.type)}if(m.isClosed&&(d!==f||e!==g)&&L.Yb(d,e,f,g,c,a,b))return!0}return!1}; +oa.Object.defineProperties(je.prototype,{_isFrozen:{configurable:!0,get:function(){return 0!==(this.o&1)},set:function(a){this.o=a?this.o|1:this.o&-2}},_isInvalidBounds:{configurable:!0,get:function(){return 0!==(this.o&2)},set:function(a){this.o=a?this.o|2:this.o&-3}},isFilled:{configurable:!0,get:function(){return 0!==(this.o&4)},set:function(a){G&&A(a,"boolean",je,"isFilled");this._isFrozen&&xa(this,a);this.o=a?this.o|4:this.o&-5}},isShadowed:{configurable:!0, +enumerable:!0,get:function(){return 0!==(this.o&8)},set:function(a){G&&A(a,"boolean",je,"isShadowed");this._isFrozen&&xa(this,a);this.o=a?this.o|8:this.o&-9}},startX:{configurable:!0,get:function(){return this.nd},set:function(a){G&&E(a,je,"startX");this._isFrozen&&xa(this,a);this.nd=a;this._isInvalidBounds=!0}},startY:{configurable:!0,get:function(){return this.od},set:function(a){G&&E(a,je,"startY");this._isFrozen&&xa(this,a);this.od=a;this._isInvalidBounds=!0}},segments:{configurable:!0, +enumerable:!0,get:function(){return this.rl},set:function(a){G&&w(a,H,je,"segments");this._isFrozen&&xa(this,a);this.rl=a;this._isInvalidBounds=!0}}});je.prototype.add=je.prototype.add;je.prototype.equalsApprox=je.prototype.fb;je.className="PathFigure"; +function ke(a,b,c,d,e,f,g,h){Za(this);void 0===a?a=Dd:G&&ab(a,ke,ke,"constructor:type");this.wa=a;this.o=2;void 0!==b?(G&&E(b,ke,"ex"),this.Dc=b):this.Dc=0;void 0!==c?(G&&E(c,ke,"ey"),this.Ec=c):this.Ec=0;void 0===d&&(d=0);void 0===e&&(e=0);void 0===f&&(f=0);void 0===g&&(g=0);a===$d?(a=f%360,0>a&&(a+=360),this.Me=a,this.$h=0,G&&E(d,ke,"x1"),this.ai=Math.max(d,0),G&&E(e,ke,"y1"),this.Rg=Math.max(e,0),"boolean"===typeof g?g&&(this.isLargeArc=!0):"number"===typeof g&&g&&(this.isLargeArc=!0),h&&(this.isClockwiseArc= +!0)):(G&&E(d,ke,"x1"),this.Me=d,G&&E(e,ke,"y1"),this.$h=e,G&&E(f,ke,"x2"),a===Zd&&(f=Math.max(f,0)),this.ai=f,"number"===typeof g?(a===Zd&&(g=Math.max(g,0)),this.Rg=g):this.Rg=0);this.$d=null}ke.prototype.copy=function(){var a=new ke;a.wa=this.wa;a.o=this.o&-2;a.Dc=this.Dc;a.Ec=this.Ec;a.Me=this.Me;a.$h=this.$h;a.ai=this.ai;a.Rg=this.Rg;return a};t=ke.prototype; +t.fb=function(a){if(!(a instanceof ke)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case Wd:case Dd:return L.C(this.endX,a.endX)&&L.C(this.endY,a.endY);case Xd:return L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)&&L.C(this.point1X,a.point1X)&&L.C(this.point1Y,a.point1Y)&&L.C(this.point2X,a.point2X)&&L.C(this.point2Y,a.point2Y);case Yd:return L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)&&L.C(this.point1X,a.point1X)&&L.C(this.point1Y,a.point1Y);case Zd:return L.C(this.startAngle, +a.startAngle)&&L.C(this.sweepAngle,a.sweepAngle)&&L.C(this.centerX,a.centerX)&&L.C(this.centerY,a.centerY)&&L.C(this.radiusX,a.radiusX)&&L.C(this.radiusY,a.radiusY);case $d:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&L.C(this.xAxisRotation,a.xAxisRotation)&&L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)&&L.C(this.radiusX,a.radiusX)&&L.C(this.radiusY,a.radiusY);default:return!1}};t.ub=function(a){a.classType===ke?this.type=a:Ea(this,a)}; +t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Wd:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Dd:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Xd:a=0>a?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(a)+ +" "+this.point1Y.toFixed(a)+" "+this.point2X.toFixed(a)+" "+this.point2Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Yd:a=0>a?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Zd:a=0>a?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+ +" "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(a)+" "+this.sweepAngle.toFixed(a)+" "+this.centerX.toFixed(a)+" "+this.centerY.toFixed(a)+" "+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a);break;case $d:a=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+ +" "+this.xAxisRotation.toFixed(a)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;default:a=this.type.toString()}return a+(this.isClosed?"z":"")};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){this._isFrozen=!1;return this};t.close=function(){this.isClosed=!0;return this}; +function ae(a,b){if(null!==a.$d&&!1===b._isInvalidBounds)return a.$d;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.$d=[],a.$d;b=a.Me;var e=a.$h,f=L.$w(0,0,c<d?c:d,a.startAngle,a.startAngle+a.sweepAngle,!1);if(c!==d){var g=Jb.alloc();g.reset();c<d?g.scale(1,d/c):g.scale(c/d,1);N.Ma(f,g);Jb.free(g)}c=f.length;for(d=0;d<c;d++)g=f[d],g[0]+=b,g[1]+=e,g[2]+=b,g[3]+=e,g[4]+=b,g[5]+=e,g[6]+=b,g[7]+=e;a.$d=f;return a.$d} +function be(a,b,c,d){function e(a,b,c,d){return(a*d<b*c?-1:1)*Math.acos((a*c+b*d)/(Math.sqrt(a*a+b*b)*Math.sqrt(c*c+d*d)))}if(null!==a.$d&&!1===b._isInvalidBounds)return a.$d;if(0===a.radiusX||0===a.radiusY)return a.$d=[],a.$d;b=a.ai;var f=a.Rg;0===b&&(b=1E-4);0===f&&(f=1E-4);var g=Math.PI/180*a.Me,h=a.isLargeArc,k=a.isClockwiseArc,l=a.Dc,m=a.Ec,n=Math.cos(g),p=Math.sin(g),r=n*(c-l)/2+p*(d-m)/2;g=-p*(c-l)/2+n*(d-m)/2;var q=r*r/(b*b)+g*g/(f*f);1<q&&(b*=Math.sqrt(q),f*=Math.sqrt(q));q=(h===k?-1:1)* +Math.sqrt((b*b*f*f-b*b*g*g-f*f*r*r)/(b*b*g*g+f*f*r*r));isNaN(q)&&(q=0);h=q*b*g/f;q=q*-f*r/b;isNaN(h)&&(h=0);isNaN(q)&&(q=0);c=(c+l)/2+n*h-p*q;d=(d+m)/2+p*h+n*q;m=e(1,0,(r-h)/b,(g-q)/f);n=(r-h)/b;l=(g-q)/f;r=(-r-h)/b;h=(-g-q)/f;g=e(n,l,r,h);r=(n*r+l*h)/(Math.sqrt(n*n+l*l)*Math.sqrt(r*r+h*h));-1>=r?g=Math.PI:1<=r&&(g=0);!k&&0<g&&(g-=2*Math.PI);k&&0>g&&(g+=2*Math.PI);k=b>f?1:b/f;r=b>f?f/b:1;b=L.$w(0,0,b>f?b:f,m,m+g,!0);f=Jb.alloc();f.reset();f.translate(c,d);f.rotate(a.Me,0,0);f.scale(k,r);N.Ma(b,f); +Jb.free(f);a.$d=b;return a.$d} +oa.Object.defineProperties(ke.prototype,{_isFrozen:{configurable:!0,get:function(){return 0!==(this.o&1)},set:function(a){this.o=a?this.o|1:this.o&-2}},_isInvalidBounds:{configurable:!0,get:function(){return 0!==(this.o&2)},set:function(a){this.o=a?this.o|2:this.o&-3}},isClosed:{configurable:!0,get:function(){return 0!==(this.o&8)},set:function(a){this.isClosed!==a&&(this.o=a?this.o|8:this.o&-9,this._isInvalidBounds=!0)}},type:{configurable:!0, +get:function(){return this.wa},set:function(a){G&&ab(a,ke,ke,"type");this._isFrozen&&xa(this,a);this.wa=a;this._isInvalidBounds=!0}},endX:{configurable:!0,get:function(){return this.Dc},set:function(a){G&&E(a,ke,"endX");this._isFrozen&&xa(this,a);this.Dc=a;this._isInvalidBounds=!0}},endY:{configurable:!0,get:function(){return this.Ec},set:function(a){G&&E(a,ke,"endY");this._isFrozen&&xa(this,a);this.Ec=a;this._isInvalidBounds=!0}},point1X:{configurable:!0, +get:function(){return this.Me},set:function(a){G&&E(a,ke,"point1X");this._isFrozen&&xa(this,a);this.Me=a;this._isInvalidBounds=!0}},point1Y:{configurable:!0,get:function(){return this.$h},set:function(a){G&&E(a,ke,"point1Y");this._isFrozen&&xa(this,a);this.$h=a;this._isInvalidBounds=!0}},point2X:{configurable:!0,get:function(){return this.ai},set:function(a){G&&E(a,ke,"point2X");this._isFrozen&&xa(this,a);this.ai=a;this._isInvalidBounds=!0}},point2Y:{configurable:!0, +get:function(){return this.Rg},set:function(a){G&&E(a,ke,"point2Y");this._isFrozen&&xa(this,a);this.Rg=a;this._isInvalidBounds=!0}},centerX:{configurable:!0,get:function(){return this.Me},set:function(a){G&&E(a,ke,"centerX");this._isFrozen&&xa(this,a);this.Me=a;this._isInvalidBounds=!0}},centerY:{configurable:!0,get:function(){return this.$h},set:function(a){G&&E(a,ke,"centerY");this._isFrozen&&xa(this,a);this.$h=a;this._isInvalidBounds=!0}},radiusX:{configurable:!0, +get:function(){return this.ai},set:function(a){G&&E(a,ke,"radiusX");0>a&&Ba(a,">= zero",ke,"radiusX");this._isFrozen&&xa(this,a);this.ai=a;this._isInvalidBounds=!0}},radiusY:{configurable:!0,get:function(){return this.Rg},set:function(a){G&&E(a,ke,"radiusY");0>a&&Ba(a,">= zero",ke,"radiusY");this._isFrozen&&xa(this,a);this.Rg=a;this._isInvalidBounds=!0}},startAngle:{configurable:!0,get:function(){return this.Dc},set:function(a){G&&E(a,ke,"startAngle");this._isFrozen&&xa(this, +a);a%=360;0>a&&(a+=360);this.Dc=a;this._isInvalidBounds=!0}},sweepAngle:{configurable:!0,get:function(){return this.Ec},set:function(a){G&&E(a,ke,"sweepAngle");this._isFrozen&&xa(this,a);360<a&&(a=360);-360>a&&(a=-360);this.Ec=a;this._isInvalidBounds=!0}},isClockwiseArc:{configurable:!0,get:function(){return 0!==(this.o&4)},set:function(a){this._isFrozen&&xa(this,a);this.o=a?this.o|4:this.o&-5;this._isInvalidBounds=!0}},isLargeArc:{configurable:!0,get:function(){return 0!== +(this.o&16)},set:function(a){this._isFrozen&&xa(this,a);this.o=a?this.o|16:this.o&-17;this._isInvalidBounds=!0}},xAxisRotation:{configurable:!0,get:function(){return this.Me},set:function(a){G&&E(a,ke,"xAxisRotation");this._isFrozen&&xa(this,a);a%=360;0>a&&(a+=360);this.Me=a;this._isInvalidBounds=!0}}});ke.prototype.equalsApprox=ke.prototype.fb; +var Wd=new F(ke,"Move",0),Dd=new F(ke,"Line",1),Xd=new F(ke,"Bezier",2),Yd=new F(ke,"QuadraticBezier",3),Zd=new F(ke,"Arc",4),$d=new F(ke,"SvgArc",4);ke.className="PathSegment";ke.Move=Wd;ke.Line=Dd;ke.Bezier=Xd;ke.QuadraticBezier=Yd;ke.Arc=Zd;ke.SvgArc=$d;function me(){this.H=null;this.pu=(new K(0,0)).freeze();this.at=(new K(0,0)).freeze();this.rp=this.Dq=0;this.sp=1;this.Kh="";this.Ir=this.Kp=!1;this.Ip=this.vp=0;this.Ag=this.bq=this.iq=!1;this.Pp=null;this.Dr=0;this.yd=this.zr=null} +me.prototype.copy=function(){var a=new me;return this.clone(a)};me.prototype.clone=function(a){a.H=this.H;a.pu.assign(this.viewPoint);a.at.assign(this.documentPoint);a.Dq=this.Dq;a.rp=this.rp;a.sp=this.sp;a.Kh=this.Kh;a.Kp=this.Kp;a.Ir=this.Ir;a.vp=this.vp;a.Ip=this.Ip;a.iq=this.iq;a.bq=this.bq;a.Ag=this.Ag;a.Pp=this.Pp;a.Dr=this.Dr;a.zr=this.zr;a.yd=this.yd;return a}; +me.prototype.toString=function(){var a="^";0!==this.modifiers&&(a+="M:"+this.modifiers);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.clickCount&&(a+="C:"+this.clickCount);0!==this.delta&&(a+="D:"+this.delta);this.handled&&(a+="h");this.bubbles&&(a+="b");null!==this.documentPoint&&(a+="@"+this.documentPoint.toString());return a};me.prototype.Ho=function(a,b){var c=this.diagram;if(null===c)return b;ne(c,this.event,a,b);return b}; +me.prototype.Cz=function(a,b){var c=this.diagram;if(null===c)return b;ne(c,this.event,a,b);b.assign(c.Es(b));return b}; +oa.Object.defineProperties(me.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){this.H=a}},viewPoint:{configurable:!0,get:function(){return this.pu},set:function(a){w(a,K,me,"viewPoint");this.pu.assign(a)}},documentPoint:{configurable:!0,get:function(){return this.at},set:function(a){w(a,K,me,"documentPoint");this.at.assign(a)}},modifiers:{configurable:!0,get:function(){return this.Dq},set:function(a){this.Dq= +a}},button:{configurable:!0,get:function(){return this.rp},set:function(a){this.rp=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{configurable:!0,get:function(){return this.sp},set:function(a){this.sp=a}},key:{configurable:!0,get:function(){return this.Kh},set:function(a){this.Kh=a}},down:{configurable:!0,get:function(){return this.Kp},set:function(a){this.Kp=a}},up:{configurable:!0, +enumerable:!0,get:function(){return this.Ir},set:function(a){this.Ir=a}},clickCount:{configurable:!0,get:function(){return this.vp},set:function(a){this.vp=a}},delta:{configurable:!0,get:function(){return this.Ip},set:function(a){this.Ip=a}},isMultiTouch:{configurable:!0,get:function(){return this.iq},set:function(a){this.iq=a}},handled:{configurable:!0,get:function(){return this.bq},set:function(a){this.bq=a}},bubbles:{configurable:!0, +get:function(){return this.Ag},set:function(a){this.Ag=a}},event:{configurable:!0,get:function(){return this.Pp},set:function(a){this.Pp=a}},isTouchEvent:{configurable:!0,get:function(){var a=sa.TouchEvent,b=this.event;return a&&b instanceof a?!0:(a=sa.PointerEvent)&&b instanceof a&&("touch"===b.pointerType||"pen"===b.pointerType)}},timestamp:{configurable:!0,get:function(){return this.Dr},set:function(a){this.Dr=a}},targetDiagram:{configurable:!0, +get:function(){return this.zr},set:function(a){this.zr=a}},targetObject:{configurable:!0,get:function(){return this.yd},set:function(a){this.yd=a}},control:{configurable:!0,get:function(){return 0!==(this.modifiers&1)},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{configurable:!0,get:function(){return 0!==(this.modifiers&4)},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{configurable:!0, +get:function(){return 0!==(this.modifiers&2)},set:function(a){this.modifiers=a?this.modifiers|2:this.modifiers&-3}},meta:{configurable:!0,get:function(){return 0!==(this.modifiers&8)},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{configurable:!0,get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&1):0===this.button},set:function(a){this.buttons= +a?this.buttons|1:this.buttons&-2}},right:{configurable:!0,get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&2):2===this.button},set:function(a){this.buttons=a?this.buttons|2:this.buttons&-3}},middle:{configurable:!0,get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons& +4):1===this.button},set:function(a){this.buttons=a?this.buttons|4:this.buttons&-5}}});me.prototype.getMultiTouchDocumentPoint=me.prototype.Cz;me.prototype.getMultiTouchViewPoint=me.prototype.Ho;me.className="InputEvent";function oe(){this.H=null;this.Ca="";this.Mq=this.vr=null}oe.prototype.copy=function(){var a=new oe;a.H=this.H;a.Ca=this.Ca;a.vr=this.vr;a.Mq=this.Mq;return a}; +oe.prototype.toString=function(){var a="*"+this.name;null!==this.subject&&(a+=":"+this.subject.toString());null!==this.parameter&&(a+="("+this.parameter.toString()+")");return a}; +oa.Object.defineProperties(oe.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){this.H=a}},name:{configurable:!0,get:function(){return this.Ca},set:function(a){this.Ca=a}},subject:{configurable:!0,get:function(){return this.vr},set:function(a){this.vr=a}},parameter:{configurable:!0,get:function(){return this.Mq},set:function(a){this.Mq=a}}});oe.className="DiagramEvent"; +function pe(){this.Am=qe;this.rf=this.Cq="";this.En=this.Fn=this.Kn=this.Ln=this.Jn=this.H=this.fc=null}pe.prototype.clear=function(){this.En=this.Fn=this.Kn=this.Ln=this.Jn=this.H=this.fc=null}; +pe.prototype.copy=function(){var a=new pe;a.Am=this.Am;a.Cq=this.Cq;a.rf=this.rf;a.fc=this.fc;a.H=this.H;a.Jn=this.Jn;var b=this.Ln;a.Ln=Ga(b)&&"function"===typeof b.M?b.M():b;b=this.Kn;a.Kn=Ga(b)&&"function"===typeof b.M?b.M():b;b=this.Fn;a.Fn=Ga(b)&&"function"===typeof b.M?b.M():b;b=this.En;a.En=Ga(b)&&"function"===typeof b.M?b.M():b;return a};pe.prototype.ub=function(a){a.classType===pe?this.change=a:Ea(this,a)}; +pe.prototype.toString=function(){var a="";a=this.change===re?a+"* ":this.change===qe?a+(null!==this.model?"!m":"!d"):a+((null!==this.model?"!m":"!d")+this.change);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.modelChange&&this.modelChange!==this.propertyName&&(a+=" "+this.modelChange);a+=": ";this.change===re?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Ra(this.object)),null!==this.oldValue&&(a+=" old: "+Ra(this.oldValue)),null!== +this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Ra(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};pe.prototype.L=function(a){return a?this.oldValue:this.newValue};pe.prototype.Ez=function(a){return a?this.oldParam:this.newParam};pe.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1}; +pe.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))};pe.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};pe.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))}; +oa.Object.defineProperties(pe.prototype,{model:{configurable:!0,get:function(){return this.fc},set:function(a){this.fc=a}},diagram:{configurable:!0,get:function(){return this.H},set:function(a){this.H=a}},change:{configurable:!0,get:function(){return this.Am},set:function(a){G&&ab(a,pe,pe,"change");this.Am=a}},modelChange:{configurable:!0,get:function(){return this.Cq},set:function(a){G&&A(a,"string",pe,"modelChange");this.Cq=a}},propertyName:{configurable:!0, +enumerable:!0,get:function(){return this.rf},set:function(a){G&&"string"!==typeof a&&A(a,"function",pe,"propertyName");this.rf=a}},isTransactionFinished:{configurable:!0,get:function(){return this.Am===re&&("CommittedTransaction"===this.rf||"FinishedUndo"===this.rf||"FinishedRedo"===this.rf)}},object:{configurable:!0,get:function(){return this.Jn},set:function(a){this.Jn=a}},oldValue:{configurable:!0,get:function(){return this.Ln},set:function(a){this.Ln= +a}},oldParam:{configurable:!0,get:function(){return this.Kn},set:function(a){this.Kn=a}},newValue:{configurable:!0,get:function(){return this.Fn},set:function(a){this.Fn=a}},newParam:{configurable:!0,get:function(){return this.En},set:function(a){this.En=a}}});pe.prototype.redo=pe.prototype.redo;pe.prototype.canRedo=pe.prototype.canRedo;pe.prototype.undo=pe.prototype.undo;pe.prototype.canUndo=pe.prototype.canUndo;pe.prototype.getParam=pe.prototype.Ez; +pe.prototype.getValue=pe.prototype.L;pe.prototype.clear=pe.prototype.clear;var re=new F(pe,"Transaction",-1),qe=new F(pe,"Property",0),se=new F(pe,"Insert",1),te=new F(pe,"Remove",2);pe.className="ChangedEvent";pe.Transaction=re;pe.Property=qe;pe.Insert=se;pe.Remove=te;function ue(){this.m=(new H).freeze();this.Ca="";this.j=!1} +ue.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0<a){a=this.changes.count;for(var c=0;c<a;c++){var d=this.changes.N(c);null!==d&&(b+="\n "+d.toString())}}return b};ue.prototype.clear=function(){var a=this.changes;a.pa();for(var b=a.count-1;0<=b;b--){var c=a.N(b);null!==c&&c.clear()}a.clear();a.freeze()};ue.prototype.canUndo=function(){return this.isComplete}; +ue.prototype.undo=function(){if(this.canUndo())for(var a=this.changes.count-1;0<=a;a--){var b=this.changes.N(a);null!==b&&b.undo()}};ue.prototype.canRedo=function(){return this.isComplete};ue.prototype.redo=function(){if(this.canRedo())for(var a=this.changes.count,b=0;b<a;b++){var c=this.changes.N(b);null!==c&&c.redo()}}; +ue.prototype.gk=function(){if(this.isComplete){var a=this.changes;a.pa();for(var b=new yb,c=0;c<a.count;c++){var d=a.N(c);if(null!==d&&d.change===qe&&d.object){var e=b.get(d.object);e||(e=new yb,b.set(d.object,e));var f=e.get(d.propertyName);null===f?e.set(d.propertyName,-1):(0<f&&a.ad(f,null),e.set(d.propertyName,c))}}for(c=b=0;c<a.count;c++)d=a.N(c),null!==d&&(c>b&&a.ad(b,d),b++);for(;a.length>b;)a.pop();a.freeze()}}; +oa.Object.defineProperties(ue.prototype,{changes:{configurable:!0,get:function(){return this.m}},name:{configurable:!0,get:function(){return this.Ca},set:function(a){this.Ca=a}},isComplete:{configurable:!0,get:function(){return this.j},set:function(a){this.j=a}}});ue.prototype.optimize=ue.prototype.gk;ue.prototype.redo=ue.prototype.redo;ue.prototype.canRedo=ue.prototype.canRedo;ue.prototype.undo=ue.prototype.undo;ue.prototype.canUndo=ue.prototype.canUndo; +ue.prototype.clear=ue.prototype.clear;ue.className="Transaction";function ve(){this.Ht=new I;this.Gd=!1;this.v=(new H).freeze();this.Ce=-1;this.m=999;this.Ee=!1;this.Ep=null;this.gi=0;this.j=!1;G&&(this.j=!0);this.Ie=(new H).freeze();this.il=new H;this.it=!0;this.st=this.gq=this.vt=this.ut=!1} +ve.prototype.toString=function(a){var b="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;b+="[";for(var c=this.nestedTransactionNames.count,d=0;d<c;d++)0<d&&(b+=" "),b+=this.nestedTransactionNames.N(d);b+="]";if(void 0!==a&&0<a)for(c=this.history.count,d=0;d<c;d++)b+="\n "+this.history.N(d).toString(a-1);return b}; +ve.prototype.clear=function(){var a=this.history;a.pa();for(var b=a.count-1;0<=b;b--){var c=a.N(b);null!==c&&c.clear()}a.clear();this.Ce=-1;a.freeze();this.Ee=!1;this.Ep=null;this.gi=0;this.Ie.pa();this.Ie.clear();this.Ie.freeze();this.il.clear();this.st=this.gq=this.vt=this.ut=!1};ve.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled;this.maxHistoryLength=a.maxHistoryLength;this.checksTransactionLevel=a.checksTransactionLevel};t=ve.prototype;t.Pw=function(a){this.Ht.add(a)};t.Px=function(a){this.Ht.remove(a)}; +t.Ja=function(a){void 0===a&&(a="");null===a&&(a="");if(this.isUndoingRedoing)return!1;!0===this.it&&(this.it=!1,this.gi++,this.isInternalTransaction||this.Pb("StartingFirstTransaction",a,this.currentTransaction),0<this.gi&&this.gi--);this.isEnabled&&(this.Ie.pa(),this.Ie.add(a),this.Ie.freeze(),null===this.currentTransaction?this.il.add(0):this.il.add(this.currentTransaction.changes.count));this.gi++;var b=1===this.transactionLevel;b&&(this.isInternalTransaction||this.Pb("StartedTransaction",a,this.currentTransaction)); +return b};t.kb=function(a){void 0===a&&(a="");return we(this,!0,a)};t.Nf=function(){return we(this,!1,"")}; +function we(a,b,c){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&Fa("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel,e=a.currentTransaction;d&&b&&(a.isInternalTransaction||a.Pb("CommittingTransaction",c,e));var f=0;if(0<a.transactionLevel&&(a.gi--,a.isEnabled)){var g=a.Ie.count;0<g&&(""===c&&(c=a.Ie.N(0)),a.Ie.pa(),a.Ie.sb(g-1),a.Ie.freeze());g=a.il.count;0<g&&(f=a.il.N(g-1),a.il.sb(g-1))}if(d){if(b){a.gq=!1;null===e&&""!== +c&&(e=a.currentTransaction);if(a.isEnabled&&null!==e){e.isComplete||(e.isComplete=!0,e.name=c);b=a.history;b.pa();for(d=b.count-1;d>a.historyIndex;d--)f=b.N(d),null!==f&&f.clear(),b.sb(d),a.gq=!0;d=a.maxHistoryLength;0<=d&&(0===d?b.clear():b.count>=d&&(f=b.N(0),null!==f&&f.clear(),b.sb(0),a.Ce--));0===d||0!==b.count&&b.get(b.count-1)===e||(b.add(e),a.Ce++);b.freeze()}a.isInternalTransaction||a.Pb("CommittedTransaction",c,e)}else{a.Ee=!0;try{a.isEnabled&&null!==e&&(e.isComplete=!0,e.undo())}finally{a.isInternalTransaction|| +a.Pb("RolledBackTransaction",c,e),a.Ee=!1}null!==e&&e.clear()}a.Ep=null;a.isPendingClear&&a.clear();a.isPendingClear=!1;a.isPendingUnmodified=!1;return!0}if(a.isEnabled&&!b&&null!==e){a=f;c=e.changes;for(e=c.count-1;e>=a;e--)b=c.N(e),null!==b&&b.undo(),c.pa(),c.sb(e);c.freeze()}return!1}ve.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return null!==a&&a.canUndo()?!0:!1}; +ve.prototype.undo=function(){if(this.canUndo()){var a=this.transactionToUndo;try{this.Ee=!0,this.Pb("StartingUndo","Undo",a),this.Ce--,a.undo()}catch(b){Fa("undo error: "+b.toString())}finally{this.Pb("FinishedUndo","Undo",a),this.Ee=!1}}};ve.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return null!==a&&a.canRedo()?!0:!1}; +ve.prototype.redo=function(){if(this.canRedo()){var a=this.transactionToRedo;try{this.Ee=!0,this.Pb("StartingRedo","Redo",a),this.Ce++,a.redo()}catch(b){Fa("redo error: "+b.toString())}finally{this.Pb("FinishedRedo","Redo",a),this.Ee=!1}}};ve.prototype.Pb=function(a,b,c){void 0===c&&(c=null);var d=new pe;d.change=re;d.propertyName=a;d.object=c;d.oldValue=b;for(a=this.models;a.next();)b=a.value,d.model=b,b.Pr(d)}; +ve.prototype.Uu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var b=this.currentTransaction;null===b&&(this.Ep=b=new ue);var c=a.copy();b=b.changes;b.pa();b.add(c);b.freeze();this.checksTransactionLevel&&0>=this.transactionLevel&&!this.it&&(a=a.diagram,null!==a&&!1===a.xi||Fa("Change not within a transaction: "+c.toString()))}}; +ve.prototype.skipsEvent=function(a){if(null===a||0>a.change.value)return!0;a=a.object;if(null===a)return!1;if(void 0!==a.layer){if(a=a.layer,null!==a&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1}; +oa.Object.defineProperties(ve.prototype,{models:{configurable:!0,get:function(){return this.Ht.iterator}},isEnabled:{configurable:!0,get:function(){return this.Gd},set:function(a){this.Gd=a}},transactionToUndo:{configurable:!0,get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.N(this.historyIndex):null}},transactionToRedo:{configurable:!0,get:function(){return this.historyIndex<this.history.count- +1?this.history.N(this.historyIndex+1):null}},isUndoingRedoing:{configurable:!0,get:function(){return this.Ee}},history:{configurable:!0,get:function(){return this.v}},maxHistoryLength:{configurable:!0,get:function(){return this.m},set:function(a){this.m=a}},historyIndex:{configurable:!0,get:function(){return this.Ce}},currentTransaction:{configurable:!0,get:function(){return this.Ep}},transactionLevel:{configurable:!0, +get:function(){return this.gi}},isInTransaction:{configurable:!0,get:function(){return 0<this.gi}},checksTransactionLevel:{configurable:!0,get:function(){return this.j},set:function(a){this.j=a}},nestedTransactionNames:{configurable:!0,get:function(){return this.Ie}},isPendingClear:{configurable:!0,get:function(){return this.ut},set:function(a){this.ut=a}},isPendingUnmodified:{configurable:!0,get:function(){return this.vt},set:function(a){this.vt= +a}},isInternalTransaction:{configurable:!0,get:function(){return this.st},set:function(a){this.st=a}},isJustDiscarded:{configurable:!0,get:function(){return this.gq}}});ve.prototype.handleChanged=ve.prototype.Uu;ve.prototype.redo=ve.prototype.redo;ve.prototype.undo=ve.prototype.undo;ve.prototype.canUndo=ve.prototype.canUndo;ve.prototype.rollbackTransaction=ve.prototype.Nf;ve.prototype.commitTransaction=ve.prototype.kb;ve.prototype.startTransaction=ve.prototype.Ja; +ve.prototype.removeModel=ve.prototype.Px;ve.prototype.addModel=ve.prototype.Pw;ve.prototype.clear=ve.prototype.clear;ve.className="UndoManager";function xe(){0<arguments.length&&Ca(xe);Za(this);this.H=ye;this.Ca="";this.Gd=!0;this.ob=!1;this.Ki=null;this.xy=new me;this.Lr=-1}xe.prototype.toString=function(){return""!==this.name?this.name+" Tool":Qa(this.constructor)};xe.prototype.updateAdornments=function(){};xe.prototype.canStart=function(){return this.isEnabled};xe.prototype.doStart=function(){}; +xe.prototype.doActivate=function(){this.isActive=!0};xe.prototype.doDeactivate=function(){this.isActive=!1};xe.prototype.doStop=function(){};xe.prototype.doCancel=function(){this.transactionResult=null;this.stopTool()};xe.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")};xe.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()};xe.prototype.doMouseMove=function(){};xe.prototype.doMouseUp=function(){this.stopTool()}; +xe.prototype.doMouseWheel=function(){};xe.prototype.canStartMultiTouch=function(){return!0};xe.prototype.standardPinchZoomStart=function(){var a=this.diagram,b=a.lastInput,c=b.Ho(0,K.allocAt(NaN,NaN)),d=b.Ho(1,K.allocAt(NaN,NaN));if(c.u()&&d.u()&&(this.doCancel(),a.Ml("hasGestureZoom"))){a.tw=a.scale;var e=d.x-c.x,f=d.y-c.y;a.Bw=Math.sqrt(e*e+f*f);b.bubbles=!1}K.free(c);K.free(d)}; +xe.prototype.standardPinchZoomMove=function(){var a=this.diagram,b=a.lastInput,c=b.Ho(0,K.allocAt(NaN,NaN)),d=b.Ho(1,K.allocAt(NaN,NaN));if(c.u()&&d.u()&&(this.doCancel(),a.Ml("hasGestureZoom"))){var e=d.x-c.x,f=d.y-c.y;f=Math.sqrt(e*e+f*f)/a.Bw;e=new K((Math.min(d.x,c.x)+Math.max(d.x,c.x))/2,(Math.min(d.y,c.y)+Math.max(d.y,c.y))/2);f*=a.tw;var g=a.commandHandler;if(f!==a.scale&&g.canResetZoom(f)){var h=a.zoomPoint;a.zoomPoint=e;g.resetZoom(f);a.zoomPoint=h}b.bubbles=!1}K.free(c);K.free(d)}; +xe.prototype.doKeyDown=function(){"Esc"===this.diagram.lastInput.key&&this.doCancel()};xe.prototype.doKeyUp=function(){};xe.prototype.Ja=function(a){void 0===a&&(a=this.name);this.transactionResult=null;return this.diagram.Ja(a)};xe.prototype.stopTransaction=function(){var a=this.diagram;return null===this.transactionResult?a.Nf():a.kb(this.transactionResult)}; +xe.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var b=a.lastInput,c=a.Kl(b.documentPoint,!1);if(null!==c)if(Ya?b.meta:b.control){a.T("ChangingSelection",a.selection);for(b=c;null!==b&&!b.canSelect();)b=b.containingGroup;null!==b&&(b.isSelected=!b.isSelected);a.T("ChangedSelection",a.selection)}else if(b.shift){if(!c.isSelected){a.T("ChangingSelection",a.selection);for(b=c;null!==b&&!b.canSelect();)b=b.containingGroup;null!==b&&(b.isSelected=!0);a.T("ChangedSelection", +a.selection)}}else{if(!c.isSelected){for(b=c;null!==b&&!b.canSelect();)b=b.containingGroup;null!==b&&a.select(b)}}else!b.left||(Ya?b.meta:b.control)||b.shift||a.clearSelection()}};xe.prototype.standardMouseClick=function(a,b){void 0===a&&(a=null);void 0===b&&(b=function(a){return!a.layer.isTemporary});var c=this.diagram,d=c.lastInput;a=c.jc(d.documentPoint,a,b);d.targetObject=a;ze(a,d,c);return d.handled}; +function ze(a,b,c){b.handled=!1;if(null===a||a.Kf()){var d=0;b.left?d=1===b.clickCount?1:2===b.clickCount?2:1:b.right&&1===b.clickCount&&(d=3);var e="ObjectSingleClicked";if(null!==a){switch(d){case 1:e="ObjectSingleClicked";break;case 2:e="ObjectDoubleClicked";break;case 3:e="ObjectContextClicked"}0!==d&&c.T(e,a)}else{switch(d){case 1:e="BackgroundSingleClicked";break;case 2:e="BackgroundDoubleClicked";break;case 3:e="BackgroundContextClicked"}0!==d&&c.T(e)}if(null!==a)for(;null!==a;){c=null;switch(d){case 1:c= +a.click;break;case 2:c=a.doubleClick?a.doubleClick:a.click;break;case 3:c=a.contextClick}if(null!==c&&(c(b,a),b.handled))break;a=a.panel}else{a=null;switch(d){case 1:a=c.click;break;case 2:a=c.doubleClick?c.doubleClick:c.click;break;case 3:a=c.contextClick}null!==a&&a(b)}}} +xe.prototype.standardMouseOver=function(){var a=this.diagram,b=a.lastInput;if(!0!==a.animationManager.Eb){var c=a.skipsUndoManager;a.skipsUndoManager=!0;var d=a.viewportBounds.ga(b.documentPoint)?a.jc(b.documentPoint,null,null):null;b.targetObject=d;var e=!1;if(d!==a.Dk){var f=a.Dk,g=f;a.Dk=d;this.doCurrentObjectChanged(f,d);for(b.handled=!1;null!==f;){var h=f.mouseLeave;if(null!==h){if(d===f)break;if(null!==d&&d.vg(f))break;h(b,f,d);e=!0;if(b.handled)break}f=f.panel}f=g;for(b.handled=!1;null!==d;){g= +d.mouseEnter;if(null!==g){if(f===d)break;if(null!==f&&f.vg(d))break;g(b,d,f);e=!0;if(b.handled)break}d=d.panel}d=a.Dk}if(null!==d){f=d;for(g="";null!==f;){g=f.cursor;if(""!==g)break;f=f.panel}a.currentCursor=g;b.handled=!1;for(f=d;null!==f;){d=f.mouseOver;if(null!==d&&(d(b,f),e=!0,b.handled))break;f=f.panel}}else a.currentCursor="",d=a.mouseOver,null!==d&&(d(b),e=!0);e&&a.Sb();a.skipsUndoManager=c}};xe.prototype.doCurrentObjectChanged=function(){}; +xe.prototype.standardMouseWheel=function(){var a=this.diagram,b=a.lastInput,c=b.delta;if(0!==c&&a.documentBounds.u()){var d=a.commandHandler,e=a.toolManager.mouseWheelBehavior;if(null!==d&&(e===Ae&&!b.shift||e===Be&&b.control)){if(0<c?d.canIncreaseZoom():d.canDecreaseZoom())e=a.zoomPoint,a.zoomPoint=b.viewPoint,0<c?d.increaseZoom():d.decreaseZoom(),a.zoomPoint=e;b.bubbles=!1}else if(e===Ae&&b.shift||e===Be&&!b.control){d=a.position.copy();var f=0<c?c:-c,g=b.event,h=g.deltaMode;e=g.deltaX;g=g.deltaY; +if(Wa||Xa)h=1,0<e&&(e=3),0>e&&(e=-3),0<g&&(g=3),0>g&&(g=-3);if(void 0===h||void 0===e||void 0===g||0===e&&0===g||b.shift)!b.shift&&a.allowVerticalScroll?(f=3*f*a.scrollVerticalLineChange,0<c?a.scroll("pixel","up",f):a.scroll("pixel","down",f)):b.shift&&a.allowHorizontalScroll&&(f=3*f*a.scrollHorizontalLineChange,0<c?a.scroll("pixel","left",f):a.scroll("pixel","right",f));else{switch(h){case 0:c="pixel";break;case 1:c="line";break;case 2:c="page";break;default:c="pixel"}0!==e&&a.allowHorizontalScroll&& +(e*=a.scrollHorizontalLineChange/16,0<e?a.scroll(c,"left",-e):a.scroll(c,"right",e));0!==g&&a.allowVerticalScroll&&(g*=a.scrollVerticalLineChange/16,0<g?a.scroll(c,"up",-g):a.scroll(c,"down",g))}a.position.D(d)||(b.bubbles=!1)}}};xe.prototype.standardWaitAfter=function(a,b){G&&A(a,"number",xe,"standardWaitAfter:delay");void 0===b&&(b=this.diagram.lastInput);this.cancelWaitAfter();var c=this,d=b.clone(this.xy);this.Lr=va(function(){c.doWaitAfter(d)},a)}; +xe.prototype.cancelWaitAfter=function(){-1!==this.Lr&&sa.clearTimeout(this.Lr);this.Lr=-1};xe.prototype.doWaitAfter=function(){};xe.prototype.findToolHandleAt=function(a,b){a=this.diagram.jc(a,function(a){for(;null!==a&&!(a.panel instanceof Ce);)a=a.panel;return a});return null===a?null:a.part.category===b?a:null}; +xe.prototype.isBeyondDragSize=function(a,b){var c=this.diagram;void 0===a&&(a=c.firstInput.viewPoint);void 0===b&&(b=c.lastInput.viewPoint);var d=c.toolManager.dragSize,e=d.width;d=d.height;c.firstInput.isTouchEvent&&(e+=6,d+=6);return Math.abs(b.x-a.x)>e||Math.abs(b.y-a.y)>d}; +oa.Object.defineProperties(xe.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){a instanceof P&&(this.H=a)}},name:{configurable:!0,get:function(){return this.Ca},set:function(a){A(a,"string",xe,"name");this.Ca=a}},isEnabled:{configurable:!0,get:function(){return this.Gd},set:function(a){A(a,"boolean",xe,"isEnabled");this.Gd=a}},isActive:{configurable:!0,get:function(){return this.ob},set:function(a){A(a,"boolean", +xe,"isActive");this.ob=a}},transactionResult:{configurable:!0,get:function(){return this.Ki},set:function(a){null!==a&&A(a,"string",xe,"transactionResult");this.Ki=a}}});xe.prototype.startTransaction=xe.prototype.Ja;xe.className="Tool";function Ua(){xe.call(this);this.name="ToolManager";this.jb=new H;this.tb=new H;this.Ib=new H;this.G=this.$=850;this.m=(new Hb(2,2)).na();this.Ma=5E3;this.ma=Be;this.v=Ie;this.Dp=this.j=null;this.Hj=-1}na(Ua,xe);Ua.prototype.initializeStandardTools=function(){}; +Ua.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof Ce&&this.Dp===a){var c=b.adornedObject;(null!==a?c.part===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; +Ua.prototype.doMouseDown=function(){var a=this.diagram,b=a.lastInput;b.isTouchEvent&&this.gestureBehavior===Je&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===Ke){b.bubbles=!0;return}if(this.gestureBehavior===Je)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}var c=a.undoManager;G&&c.checksTransactionLevel&&0!==c.transactionLevel&&Fa("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");c=this.mouseDownTools.length; +for(var d=0;d<c;d++){var e=this.mouseDownTools.N(d);e.diagram=this.diagram;if(e.canStart()){a.doFocus();a.currentTool=e;a.currentTool===e&&(e.isActive||e.doActivate(),e.doMouseDown());return}}1===a.lastInput.button&&(this.mouseWheelBehavior===Be?this.mouseWheelBehavior=Ae:this.mouseWheelBehavior===Ae&&(this.mouseWheelBehavior=Be));this.doActivate();this.standardWaitAfter(this.holdDelay,b)}; +Ua.prototype.doMouseMove=function(){var a=this.diagram,b=a.lastInput;if(b.isMultiTouch){if(this.gestureBehavior===Ke){b.bubbles=!0;return}if(this.gestureBehavior===Je)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomMove();return}}if(this.isActive)for(var c=this.mouseMoveTools.length,d=0;d<c;d++){var e=this.mouseMoveTools.N(d);e.diagram=this.diagram;if(e.canStart()){a.doFocus();a.currentTool=e;a.currentTool===e&&(e.isActive||e.doActivate(),e.doMouseMove());return}}Le(this, +a);a=b.event;null===a||"pointermove"!==a.type&&a.cancelable||(b.bubbles=!0)};function Le(a,b){a.standardMouseOver();a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,b.lastInput)}Ua.prototype.doCurrentObjectChanged=function(a,b){a=this.currentToolTip;null===a||null!==b&&a instanceof Ce&&(b===a||b.vg(a))||this.hideToolTip()}; +Ua.prototype.doWaitAfter=function(a){var b=this.diagram;b.Na&&(this.doMouseHover(),this.isActive||this.doToolTip(),a.isTouchEvent&&!b.lastInput.handled&&(a=a.copy(),a.button=2,a.buttons=2,b.lastInput=a,b.iu=!0,b.doMouseUp()))}; +Ua.prototype.doMouseHover=function(){var a=this.diagram,b=a.lastInput;null===b.targetObject&&(b.targetObject=a.jc(b.documentPoint,null,null));var c=b.targetObject;if(null!==c)for(b.handled=!1;null!==c;){a=this.isActive?c.mouseHold:c.mouseHover;if(null!==a&&(a(b,c),b.handled))break;c=c.panel}else c=this.isActive?a.mouseHold:a.mouseHover,null!==c&&c(b)}; +Ua.prototype.doToolTip=function(){var a=this.diagram,b=a.lastInput;null===b.targetObject&&(b.targetObject=a.jc(b.documentPoint,null,null));b=b.targetObject;if(null!==b){if(a=this.currentToolTip,!(a instanceof Ce)||b!==a&&!b.vg(a)){for(;null!==b;){a=b.toolTip;if(null!==a){this.showToolTip(a,b);return}b=b.panel}this.hideToolTip()}}else b=a.toolTip,null!==b?this.showToolTip(b,null):this.hideToolTip()}; +Ua.prototype.showToolTip=function(a,b){!G||a instanceof Ce||a instanceof Me||v("showToolTip:tooltip must be an Adornment or HTMLInfo.");null!==b&&w(b,O,Ua,"showToolTip:obj");var c=this.diagram;a!==this.currentToolTip&&this.hideToolTip();if(a instanceof Ce){a.layerName="Tool";a.selectable=!1;a.scale=1/c.scale;a.category="ToolTip";null!==a.placeholder&&(a.placeholder.scale=c.scale);var d=a.diagram;null!==d&&d!==c&&d.remove(a);c.add(a);null!==b?a.adornedObject=b:a.data=c.model;a.eb();this.positionToolTip(a, +b)}else a instanceof Me&&a!==this.currentToolTip&&a.show(b,c,this);this.currentToolTip=a;-1!==this.Hj&&(sa.clearTimeout(this.Hj),this.Hj=-1);a=this.toolTipDuration;if(0<a&&Infinity!==a){var e=this;this.Hj=va(function(){e.hideToolTip()},a)}}; +Ua.prototype.positionToolTip=function(a){if(null===a.placeholder){var b=this.diagram,c=b.lastInput.documentPoint.copy(),d=a.measuredBounds,e=b.viewportBounds;b.lastInput.isTouchEvent&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5/b.scale);c.x<e.x&&(c.x=e.x);c.y=c.y+20/b.scale+d.height>e.bottom?c.y-(d.height+5/b.scale):c.y+20/b.scale;c.y<e.y&&(c.y=e.y);a.position=c}}; +Ua.prototype.hideToolTip=function(){-1!==this.Hj&&(sa.clearTimeout(this.Hj),this.Hj=-1);var a=this.diagram,b=this.currentToolTip;null!==b&&(b instanceof Ce?(a.remove(b),null!==this.Dp&&this.Dp.Mf(b.category),b.data=null,b.adornedObject=null):b instanceof Me&&null!==b.hide&&b.hide(a,this),this.currentToolTip=null)}; +Ua.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.diagram;if(this.isActive)for(var b=this.mouseUpTools.length,c=0;c<b;c++){var d=this.mouseUpTools.N(c);d.diagram=this.diagram;if(d.canStart()){a.doFocus();a.currentTool=d;a.currentTool===d&&(d.isActive||d.doActivate(),d.doMouseUp());return}}a.doFocus();this.doDeactivate()};Ua.prototype.doMouseWheel=function(){this.standardMouseWheel()};Ua.prototype.doKeyDown=function(){var a=this.diagram;null!==a.commandHandler&&a.commandHandler.doKeyDown()}; +Ua.prototype.doKeyUp=function(){var a=this.diagram;null!==a.commandHandler&&a.commandHandler.doKeyUp()};Ua.prototype.findTool=function(a){A(a,"string",Ua,"findTool:name");for(var b=this.mouseDownTools.length,c=0;c<b;c++){var d=this.mouseDownTools.N(c);if(d.name===a)return d}b=this.mouseMoveTools.length;for(c=0;c<b;c++)if(d=this.mouseMoveTools.N(c),d.name===a)return d;b=this.mouseUpTools.length;for(c=0;c<b;c++)if(d=this.mouseUpTools.N(c),d.name===a)return d;return null}; +Ua.prototype.replaceTool=function(a,b){A(a,"string",Ua,"replaceTool:name");null!==b&&(w(b,xe,Ua,"replaceTool:newtool"),b.diagram=this.diagram);for(var c=this.mouseDownTools.length,d=0;d<c;d++){var e=this.mouseDownTools.N(d);if(e.name===a)return null!==b?this.mouseDownTools.ad(d,b):this.mouseDownTools.sb(d),e}c=this.mouseMoveTools.length;for(d=0;d<c;d++)if(e=this.mouseMoveTools.N(d),e.name===a)return null!==b?this.mouseMoveTools.ad(d,b):this.mouseMoveTools.sb(d),e;c=this.mouseUpTools.length;for(d= +0;d<c;d++)if(e=this.mouseUpTools.N(d),e.name===a)return null!==b?this.mouseUpTools.ad(d,b):this.mouseUpTools.sb(d),e;return null};Ua.prototype.nb=function(a,b,c){A(a,"string",Ua,"replaceStandardTool:name");w(c,H,Ua,"replaceStandardTool:list");null!==b&&(w(b,xe,Ua,"replaceStandardTool:newtool"),b.name=a,b.diagram=this.diagram);this.findTool(a)?this.replaceTool(a,b):null!==b&&c.add(b)}; +oa.Object.defineProperties(Ua.prototype,{mouseWheelBehavior:{configurable:!0,get:function(){return this.ma},set:function(a){ab(a,Ua,Ua,"mouseWheelBehavior");this.ma=a}},gestureBehavior:{configurable:!0,get:function(){return this.v},set:function(a){ab(a,Ua,Ua,"gestureBehavior");this.v=a}},currentToolTip:{configurable:!0,get:function(){return this.j},set:function(a){!G||null===a||a instanceof Ce||a instanceof Me||v("ToolManager.currentToolTip must be an Adornment or HTMLInfo."); +this.j=a;this.Dp=null!==a&&a instanceof Ce?a.adornedPart:null}},mouseDownTools:{configurable:!0,get:function(){return this.jb}},mouseMoveTools:{configurable:!0,get:function(){return this.tb}},mouseUpTools:{configurable:!0,get:function(){return this.Ib}},hoverDelay:{configurable:!0,get:function(){return this.$},set:function(a){A(a,"number",Ua,"hoverDelay");this.$=a}},holdDelay:{configurable:!0,get:function(){return this.G},set:function(a){A(a, +"number",Ua,"holdDelay");this.G=a}},dragSize:{configurable:!0,get:function(){return this.m},set:function(a){w(a,Hb,Ua,"dragSize");this.m=a.M()}},toolTipDuration:{configurable:!0,get:function(){return this.Ma},set:function(a){A(a,"number",Ua,"toolTipDuration");this.Ma=a}}});Ua.prototype.replaceStandardTool=Ua.prototype.nb; +var Be=new F(Ua,"WheelScroll",0),Ae=new F(Ua,"WheelZoom",1),Ne=new F(Ua,"WheelNone",2),Ie=new F(Ua,"GestureZoom",3),Je=new F(Ua,"GestureCancel",4),Ke=new F(Ua,"GestureNone",5);Ua.className="ToolManager";Ua.WheelScroll=Be;Ua.WheelZoom=Ae;Ua.WheelNone=Ne;Ua.GestureZoom=Ie;Ua.GestureCancel=Je;Ua.GestureNone=Ke; +function Oe(){xe.call(this);0<arguments.length&&Ca(Oe);this.name="Dragging";this.v=this.Kw=this.tb=!0;this.m=this.Ma=this.$=this.Ne=null;this.Tm=this.Ib=!1;this.vl=new K(NaN,NaN);this.pr=new K;this.jb=!0;this.Jk=100;this.Fg=[];this.ue=(new I).freeze();this.ma=new Pe;this.un=null;this.G="copy";this.Nc="";this.Oc="no-drop"}var Qe;na(Oe,xe); +Oe.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly&&!a.allowDragOut||!a.allowMove&&!a.allowCopy&&!a.allowDragOut||!a.allowSelect)return!1;var b=a.lastInput;return!b.left||a.currentTool!==this&&(!this.isBeyondDragSize()||b.isTouchEvent&&b.timestamp-a.firstInput.timestamp<this.Jk)?!1:null!==this.findDraggablePart()}; +Oe.prototype.findDraggablePart=function(){var a=this.diagram;a=a.Kl(a.firstInput.documentPoint,!1);if(null===a)return null;for(;null!==a&&!a.canSelect();)a=a.containingGroup;return null!==a&&(a.canMove()||a.canCopy())?a:null}; +Oe.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var b=a.Kl(a.firstInput.documentPoint,!1);if(null!==b){for(;null!==b&&!b.canSelect();)b=b.containingGroup;this.currentPart=b;null===this.currentPart||this.currentPart.isSelected||(a.T("ChangingSelection",a.selection),b=a.lastInput,(Ya?b.meta:b.control)||b.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.T("ChangedSelection",a.selection))}}}; +Oe.prototype.doActivate=function(){var a=this.diagram;this.un=null;null===this.currentPart&&this.standardMouseSelect();var b=this.currentPart;null!==b&&(b.canMove()||b.canCopy())&&(a.yu(!0),Re=null,this.isActive=!0,this.vl.set(a.position),Se(this,a.selection),this.Fg.length=0,a.animationManager.Cc(),this.draggedParts=this.computeEffectiveCollection(a.selection,this.dragOptions),this.Kw=this.diagram.layout.isRealtime,this.diagram.layout.isRealtime=!1,a.Bs=!0,!0===a.Te("temporaryPixelRatio")&&30<a.Sw&& +Te(a),Ue(a,this.draggedParts),this.Ja("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Tm=!1,Re=this,Ve=this.diagram,this.doSimulatedDragOut()))}; +function Se(a,b){if(a.dragsLink){var c=a.diagram;c.allowRelink&&(c.model.$j()&&1===b.count&&b.first()instanceof R?(a.draggedLink=b.first(),a.draggedLink.canRelinkFrom()&&a.draggedLink.canRelinkTo()&&a.draggedLink.Mj(),a.Ne=c.toolManager.findTool("Relinking"),null===a.Ne&&(a.Ne=new We,a.Ne.diagram=c),a.Ne.originalLink=a.draggedLink):(a.draggedLink=null,a.Ne=null))}}Oe.prototype.computeEffectiveCollection=function(a,b){return this.diagram.commandHandler.computeEffectiveCollection(a,b)}; +Oe.prototype.Md=function(a){return void 0===a?new Xe(zb):this.isGridSnapEnabled?new Xe(new K(Math.round(1E3*a.x)/1E3,Math.round(1E3*a.y)/1E3)):new Xe(a.copy())}; +Oe.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;this.diagram.layout.isRealtime=this.Kw;a.yu(!1);a.xg();hf(this);jf(a,this.draggedParts);this.draggedParts=this.currentPart=this.un=null;this.Tm=this.isDragOutStarted=!1;if(0<Qe.count){for(var b=Qe,c=b.length,d=0;d<c;d++){var e=b.N(d);kf(e);lf(e);hf(e);e.diagram.xg()}b.clear()}kf(this);this.vl.h(NaN,NaN);null!==Ve&&(Ve.currentCursor="");Re=Ve=null;lf(this);a.isMouseCaptured=!1;a.currentCursor="";a.Bs=!1;this.stopTransaction(); +mf(a,!0)};Oe.prototype.stopTransaction=function(){var a=this.diagram,b=xe.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.gk();return b};function hf(a){var b=a.diagram,c=b.skipsUndoManager;b.skipsUndoManager=!0;nf(a,b.lastInput,null);b.skipsUndoManager=c;a.Fg.length=0}function of(){var a=Re;lf(a);pf(a);var b=a.diagram;a.vl.u()&&(b.position=a.vl);b.xg()} +Oe.prototype.doCancel=function(){lf(this);pf(this);var a=this.diagram;this.vl.u()&&(a.position=this.vl);this.stopTool()};Oe.prototype.doKeyDown=function(){var a=this.diagram,b=a.lastInput;this.isActive&&("Esc"===b.key?this.doCancel():b.key!==a.previousInput.key&&this.doMouseMove())};Oe.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()}; +function qf(a,b){if(null===a.copiedParts){var c=a.diagram;if((!b||!c.isReadOnly&&!c.isModelReadOnly)&&null!==a.draggedParts){var d=c.undoManager;d.isEnabled&&d.isInTransaction?null!==d.currentTransaction&&0<d.currentTransaction.changes.count&&(c.undoManager.Nf(),c.Ja("Drag")):pf(a);c.skipsUndoManager=!b;c.partManager.addsToTemporaryLayer=!b;a.startPoint=c.firstInput.documentPoint;b=a.copiesEffectiveCollection?a.draggedParts.Of():c.selection;b=c.Rj(b,c,!0);c=new yb;for(d=a.draggedParts.iterator;d.next();){var e= +d.key;if(e.Zc()&&e.canCopy()){var f=b.L(e);null!==f&&(f.location=e.location,f.eb(),c.add(f,a.Md(f.location)))}}for(b=b.iterator;b.next();)d=b.value,d instanceof R&&d.canCopy()&&c.add(d,a.Md());a.copiedParts=c;Se(a,c.Of());null!==a.draggedLink&&(c=a.draggedLink,b=c.routeBounds,rf(c,a.startPoint.x-(b.x+b.width/2),a.startPoint.y-(b.y+b.height/2)));a.doUpdateCursor(null,!0)}}} +function lf(a){var b=a.diagram;if(null!==a.copiedParts){b.vs(a.copiedParts.Of(),!1);a.copiedParts=null;if(null!==a.draggedParts)for(var c=a.draggedParts.iterator;c.next();)c.key instanceof R&&(c.value.point=new K(0,0));a.doUpdateCursor(null,!0)}b.skipsUndoManager=!1;b.partManager.addsToTemporaryLayer=!1;a.startPoint=b.firstInput.documentPoint} +function kf(a){if(null!==a.draggedLink){if(a.dragsLink&&null!==a.Ne){var b=a.Ne;b.diagram.remove(b.temporaryFromNode);b.diagram.remove(b.temporaryToNode);a.Ne.originalLink=null}a.draggedLink=null;a.Ne=null}}function sf(a,b,c){var d=a.diagram,e=a.startPoint,f=K.alloc();f.assign(d.lastInput.documentPoint);a.moveParts(b,f.re(e),c);K.free(f);!0===d.Te("temporaryPixelRatio")&&null===d.ci&&30<d.Sw&&(Te(d),d.Wo())} +Oe.prototype.moveParts=function(a,b,c){void 0===c&&(c=!1);var d=this.diagram;null!==d&&tf(d,a,b,this.dragOptions,c)};function pf(a){if(null!==a.draggedParts){for(var b=a.diagram,c=a.draggedParts.iterator;c.next();){var d=c.key;d.Zc()&&(d.location=c.value.point)}for(c=a.draggedParts.iterator;c.next();)if(d=c.key,d instanceof R&&d.suspendsRouting){var e=c.value.point;a.draggedParts.add(d,a.Md());rf(d,-e.x,-e.y)}b.td()}} +function uf(a,b){var c=a.diagram;a.dragsLink&&(null!==a.draggedLink&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),vf(a,!1));var d=a.findDragOverObject(b),e=c.lastInput;e.targetObject=d;a.doUpdateCursor(d,!1);var f=c.skipsUndoManager,g=!1;try{c.skipsUndoManager=!0;g=nf(a,e,d);if(!a.isActive&&null===Re)return;var h=null!==d?d.part:null;if(null===h||c.handlesDragDropForTopLevelParts&&h.isTopLevel&&!(h instanceof wf)){var k=c.mouseDragOver;null!==k&&(k(e),g=!0)}if(!a.isActive&&null===Re)return; +a.doDragOver(b,d);if(!a.isActive&&null===Re)return}finally{c.skipsUndoManager=f,g&&c.td()}a.un=d;c.isReadOnly||!c.allowMove&&!c.allowCopy||!c.allowHorizontalScroll&&!c.allowVerticalScroll||c.Sr(e.viewPoint)}Oe.prototype.findDragOverObject=function(a){var b=this;return xf(this.diagram,a,null,function(a){null===a?a=!0:(a=a.part,a=null===a||a instanceof Ce||a.layer.isTemporary||b.draggedParts&&b.draggedParts.contains(a)||b.copiedParts&&b.copiedParts.contains(a)?!0:!1);return!a})}; +Oe.prototype.doUpdateCursor=function(a,b){var c=this.diagram;if(b||this.un!==a)!this.diagram.currentTool.isActive||this.mayCopy()?c.currentCursor=this.copyCursor:this.mayMove()?c.currentCursor=this.moveCursor:this.mayDragOut()&&(c.currentCursor=this.nodropCursor)}; +function nf(a,b,c){var d=!1,e=a.Fg.length,f=0<e?a.Fg[0]:null;if(c===f)return!1;b.handled=!1;for(var g=0;g<e;g++){var h=a.Fg[g],k=h.mouseDragLeave;if(null!==k&&(k(b,h,c),d=!0,b.handled))break}a.Fg.length=0;if(!a.isActive&&null===Re||null===c)return d;b.handled=!1;for(e=c;null!==e;)a.Fg.push(e),e=yf(e);e=a.Fg.length;for(c=0;c<e&&(g=a.Fg[c],h=g.mouseDragEnter,null===h||(h(b,g,f),d=!0,!b.handled));c++);return d} +function yf(a){var b=a.panel;return null!==b?b:a instanceof S&&!(a instanceof wf)&&(a=a.containingGroup,null!==a&&a.handlesDragDropForMembers)?a:null}function Hf(a,b,c){var d=a.Ne;if(null===d)return null;var e=a.diagram.tg(b,d.portGravity,function(a){return d.findValidLinkablePort(a,c)});a=K.alloc();var f=Infinity,g=null;for(e=e.iterator;e.next();){var h=e.value;if(null!==h.part){var k=h.oa(Kc,a);k=b.Df(k);k<f&&(g=h,f=k)}}K.free(a);return g} +function vf(a,b){var c=a.draggedLink;if(null!==c&&!(2>c.pointsCount)){var d=a.diagram;if(!d.isReadOnly){var e=a.Ne;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=Hf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=Hf(a,c.i(c.pointsCount-1),!0),null!==h&&(k=h.part));e.isValidLink(g,f,k,h)?b?(c.defaultFromPoint=c.i(0),c.defaultToPoint=c.i(c.pointsCount-1),c.suspendsRouting=!1,c.fromNode=g,null!==f&&(c.fromPortId=f.portId),c.toNode=k,null!==h&&(c.toPortId=h.portId),c.fromPort!== +d.Kx&&d.T("LinkRelinked",c,d.Kx),c.toPort!==d.Lx&&d.T("LinkRelinked",c,d.Lx)):If(e,g,f,k,h):If(e,null,null,null,null)}}}}Oe.prototype.doDragOver=function(){}; +function Jf(a,b){var c=a.diagram;a.dragsLink&&vf(a,!0);hf(a);var d=a.findDragOverObject(b),e=c.lastInput;e.targetObject=d;if(null!==d){e.handled=!1;for(var f=d;null!==f;){var g=f.mouseDrop;if(null!==g&&(g(e,f),e.handled))break;Kf(a,e,f);f=yf(f)}}else f=c.mouseDrop,null!==f&&f(e);if(a.isActive||null!==Re){for(e=(a.copiedParts||a.draggedParts).iterator;e.next();)f=e.key,f instanceof T&&f.linksConnected.each(function(a){a.suspendsRouting=!1});a.doDropOnto(b,d);if(a.isActive||null!==Re){a=M.alloc();for(b= +c.selection.iterator;b.next();)d=b.value,d instanceof T&&Lf(c,d,a);M.free(a)}}}function Kf(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof wf||(c=a.mouseDrop,null!==c&&c(b))}function Lf(a,b,c){var d=!1;b.getAvoidableRect(c);a.viewportBounds.Re(c)&&(d=!0);a=a.Ou(c,function(a){return a.part},function(a){return a instanceof R},!0,function(a){return a instanceof R},d);if(0!==a.count)for(a=a.iterator;a.next();)c=a.value,!c.Sd(b)&&c.isAvoiding&&c.gb()} +Oe.prototype.doDropOnto=function(){};Oe.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;this.simulatedMouseMove(b.event,b.documentPoint,b.targetDiagram)||null===this.currentPart||null===this.draggedParts||(this.mayCopy()?(qf(this,!1),Ue(a,this.copiedParts),sf(this,this.copiedParts,!1),jf(a,this.copiedParts)):this.mayMove()?(lf(this),sf(this,this.draggedParts,!0)):this.mayDragOut()?(qf(this,!1),sf(this,this.copiedParts,!1)):lf(this),uf(this,a.lastInput.documentPoint))}}; +Oe.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;if(!this.simulatedMouseUp(b.event,b.documentPoint,b.targetDiagram)){b=!1;var c=this.mayCopy();c&&null!==this.copiedParts?(lf(this),qf(this,!0),Ue(a,this.copiedParts),sf(this,this.copiedParts,!1),jf(a,this.copiedParts),null!==this.copiedParts&&(a.T("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}))):(b=!0,lf(this),this.mayMove()&&(sf(this,this.draggedParts, +!0),uf(this,a.lastInput.documentPoint)));this.Tm=!0;Jf(this,a.lastInput.documentPoint);if(this.isActive){var d=c?this.copiedParts.Of():this.draggedParts.Of();this.copiedParts=null;b&&Mf(this);a.ab();jf(a,this.draggedParts);this.transactionResult=c?"Copy":"Move";a.T(c?"SelectionCopied":"SelectionMoved",d)}this.stopTool();c&&a.T("ChangedSelection",a.selection)}}}; +Oe.prototype.simulatedMouseMove=function(a,b,c){if(null===Re)return!1;var d=Re.diagram;c instanceof P||(c=null);var e=Ve;c!==e&&(null!==e&&e!==d&&(e.xg(),Re.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),Ve=c,null!==c&&c!==d&&(of(),e=c.toolManager.findTool("Dragging"),null!==e&&(Qe.contains(e)||Qe.add(e),e.doSimulatedDragEnter())),this.doUpdateCursor(null,!0));if(null===c||c===d||!c.allowDrop||c.isReadOnly||!c.allowInsert)return!1;d=c.toolManager.findTool("Dragging"); +null!==d&&(null!==a&&(void 0!==a.targetTouches&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),b=c.getMouse(a)),c.lastInput.documentPoint=b,c.lastInput.viewPoint=c.ep(b),c.lastInput.down=!1,c.lastInput.up=!1,d.doSimulatedDragOver());return!0}; +Oe.prototype.simulatedMouseUp=function(a,b,c){if(null===Re)return!1;var d=Ve,e=Re.diagram;if(null===c)return Re.doCancel(),!0;if(c!==d){var f=d.toolManager.findTool("Dragging");if(null!==d&&d!==e&&null!==f)return d.xg(),Re.isDragOutStarted=!1,f.doSimulatedDragLeave(),!1;Ve=c;d=c.toolManager.findTool("Dragging");null!==d&&(of(),Qe.contains(d)||Qe.add(d),d.doSimulatedDragEnter())}return c!==this.diagram?(null!==a?(void 0!==a.targetTouches&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&& +(a=a.changedTouches[0])),b=c.getMouse(a)):null===b&&(b=new K),c.lastInput.documentPoint=b,c.lastInput.viewPoint=c.ep(b),c.lastInput.down=!1,c.lastInput.up=!0,a=c.toolManager.findTool("Dragging"),null!==a&&a.doSimulatedDrop(),a=Re,null!==a&&(c=a.mayCopy(),a.transactionResult=c?"Copy":"Move",a.stopTool()),!0):!1}; +function Mf(a){if(null!==a.draggedParts)for(var b=a.draggedParts.iterator;b.next();){var c=b.key;c instanceof T&&(c=c.containingGroup,null===c||null===c.placeholder||a.draggedParts.contains(c)||c.placeholder.w())}} +Oe.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(Ya?!a.lastInput.alt:!a.lastInput.control))return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return null!==this.draggedLink&&this.dragsLink&&this.draggedLink.canCopy()?!0:!1}; +Oe.prototype.mayDragOut=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(!a.allowDragOut||!a.allowCopy||a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return null!==this.draggedLink&&this.dragsLink&&this.draggedLink.canCopy()?!0:!1}; +Oe.prototype.mayMove=function(){var a=this.diagram;if(a.isReadOnly||!a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canMove())return!0;return null!==this.draggedLink&&this.dragsLink&&this.draggedLink.canMove()?!0:!1};Oe.prototype.computeBorder=function(a,b,c){return this.Tm||null===this.draggedParts||this.draggedParts.contains(a)?null:c.assign(b)};Oe.prototype.Bz=function(){return Re}; +Oe.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var b=Re;return null===b||b.diagram.model.dataFormat!==a.model.dataFormat?!1:!0};Oe.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc();Nf(a);a.animationManager.Cc();a=Re;null!==a&&(a.diagram.Bs=!1);this.doUpdateCursor(null,!0)}};Oe.prototype.doSimulatedDragLeave=function(){var a=Re;null!==a&&a.doSimulatedDragOut();this.doCancel()}; +Oe.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.ym=!0;var b=Re;if(null!==b&&null!==b.draggedParts){if(!this.mayDragIn())return;Of(this,b.draggedParts.Of(),!1,a.firstInput);sf(this,this.copiedParts,!1);uf(this,a.lastInput.documentPoint)}a.animationManager.ym=!1}; +Oe.prototype.doSimulatedDrop=function(){var a=this.diagram,b=Re;if(null!==b){var c=b.diagram;b.Tm=!0;lf(this);if(!this.mayDragIn())return;a.animationManager.ym=!0;a.T("ChangingSelection",a.selection);this.Ja("Drop");Of(this,b.draggedParts.Of(),!0,a.lastInput);sf(this,this.copiedParts,!1);null!==this.copiedParts&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}));Jf(this,a.lastInput.documentPoint);a.ab();b=a.selection;null!==this.copiedParts?this.transactionResult= +"ExternalCopy":b=new I;this.copiedParts=null;a.doFocus();a.T("ExternalObjectsDropped",b,c);this.stopTransaction();a.T("ChangedSelection",a.selection)}a.animationManager.ym=!1}; +function Of(a,b,c,d){if(null===a.copiedParts){var e=a.diagram;if(!e.isReadOnly&&!e.isModelReadOnly){e.skipsUndoManager=!c;e.partManager.addsToTemporaryLayer=!c;a.startPoint=d.documentPoint;c=e.Rj(b,e,!0);var f=M.alloc();e=d=Infinity;for(var g=-Infinity,h=-Infinity,k=b.iterator;k.next();){var l=k.value;if(l.isVisible()){var m=l.location;l=m.x;m=m.y;isNaN(l)||isNaN(m)||(l<d&&(d=l),m<e&&(e=m),l>g&&(g=l),m>h&&(h=m))}}Infinity===d?f.h(0,0,0,0):f.h(d,e,g-d,h-e);d=f.x+f.width/2;e=f.y+f.height/2;M.free(f); +f=a.pr;g=new yb;h=K.alloc();for(k=b.iterator;k.next();)l=k.value,l instanceof R&&l.canCopy()&&(m=c.L(l),null!==m&&(m.points=l.points,rf(m,f.x-d,f.y-e),m.suspendsRouting=!0,g.add(m,a.Md())));for(b=b.iterator;b.next();)l=b.value,l.Zc()&&l.canCopy()&&(k=c.L(l),null!==k&&(l=l.location,h.h(f.x-(d-l.x),f.y-(e-l.y)),k.location=h,k.eb(),g.add(k,a.Md(h))));K.free(h);a.copiedParts=g;Se(a,g.Of());null!==a.draggedLink&&(c=a.draggedLink,b=c.routeBounds,rf(c,a.startPoint.x-(b.x+b.width/2),a.startPoint.y-(b.y+b.height/ +2)));a.doUpdateCursor(null,!0)}}}Oe.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Bs=!1;this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor;this.un=null};Oe.prototype.computeMove=function(a,b,c,d){c=this.diagram;return null!==c?c.computeMove(a,b,this.dragOptions,d):new K}; +oa.Object.defineProperties(Oe.prototype,{isCopyEnabled:{configurable:!0,get:function(){return this.tb},set:function(a){A(a,"boolean",Oe,"isCopyEnabled");this.tb=a}},copiesEffectiveCollection:{configurable:!0,get:function(){return this.v},set:function(a){A(a,"boolean",Oe,"copiesEffectiveCollection");this.v=a}},dragOptions:{configurable:!0,get:function(){return this.ma},set:function(a){w(a,Pe,Oe,"dragOptions");this.ma=a}},isGridSnapEnabled:{configurable:!0, +enumerable:!0,get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){A(a,"boolean",Oe,"isGridSnapEnabled");this.dragOptions.isGridSnapEnabled=a}},isComplexRoutingRealtime:{configurable:!0,get:function(){return this.jb},set:function(a){A(a,"boolean",Oe,"isComplexRoutingRealtime");this.jb=a}},isGridSnapRealtime:{configurable:!0,get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){A(a,"boolean",Oe,"isGridSnapRealtime");this.dragOptions.isGridSnapRealtime= +a}},gridSnapCellSize:{configurable:!0,get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){w(a,Hb,Oe,"gridSnapCellSize");this.dragOptions.gridSnapCellSize.D(a)||(a=a.M(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{configurable:!0,get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){w(a,Ib,Oe,"gridSnapCellSpot");this.dragOptions.gridSnapCellSpot.D(a)||(a=a.M(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{configurable:!0, +enumerable:!0,get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){w(a,K,Oe,"gridSnapOrigin");this.dragOptions.gridSnapOrigin.D(a)||(a=a.M(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{configurable:!0,get:function(){return this.dragOptions.dragsLink},set:function(a){A(a,"boolean",Oe,"dragsLink");this.dragOptions.dragsLink=a}},dragsTree:{configurable:!0,get:function(){return this.dragOptions.dragsTree},set:function(a){A(a,"boolean",Oe,"dragsTree"); +this.dragOptions.dragsTree=a}},copyCursor:{configurable:!0,get:function(){return this.G},set:function(a){this.G=a}},moveCursor:{configurable:!0,get:function(){return this.Nc},set:function(a){this.Nc=a}},nodropCursor:{configurable:!0,get:function(){return this.Oc},set:function(a){this.Oc=a}},currentPart:{configurable:!0,get:function(){return this.$},set:function(a){null!==a&&w(a,S,Oe,"currentPart");this.$=a}},copiedParts:{configurable:!0, +get:function(){return this.m},set:function(a){this.m=a}},draggedParts:{configurable:!0,get:function(){return this.Ma},set:function(a){this.Ma=a}},draggingParts:{configurable:!0,get:function(){return null!==this.copiedParts?this.copiedParts.Of():null!==this.draggedParts?this.draggedParts.Of():this.ue}},draggedLink:{configurable:!0,get:function(){return this.diagram.draggedLink},set:function(a){null!==a&&w(a,R,Oe,"draggedLink");this.diagram.draggedLink=a}}, +isDragOutStarted:{configurable:!0,get:function(){return this.Ib},set:function(a){this.Ib=a}},startPoint:{configurable:!0,get:function(){return this.pr},set:function(a){w(a,K,Oe,"startPoint");this.pr.D(a)||this.pr.assign(a)}},delay:{configurable:!0,get:function(){return this.Jk},set:function(a){A(a,"number",Oe,"delay");this.Jk=a}}});Oe.prototype.getDraggingSource=Oe.prototype.Bz;var Re=null,Ve=null;Oe.className="DraggingTool";Qe=new H; +Ta("draggingTool",function(){return this.findTool("Dragging")},function(a){this.nb("Dragging",a,this.mouseMoveTools)});Ua.prototype.doCancel=function(){null!==Re&&Re.doCancel();xe.prototype.doCancel.call(this)}; +function Pf(){0<arguments.length&&Ca(Pf);xe.call(this);this.ue=100;this.Ma=!1;this.v="pointer";var a=new R,b=new Qf;b.isPanelMain=!0;b.stroke="blue";a.add(b);b=new Qf;b.toArrow="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.layerName="Tool";this.Ii=a;a=new T;b=new Qf;b.portId="";b.figure="Rectangle";b.fill=null;b.stroke="magenta";b.strokeWidth=2;b.desiredSize=Qb;a.add(b);a.selectable=!1;a.layerName="Tool";this.Hi=a;this.j=b;a=new T;b=new Qf;b.portId="";b.figure="Rectangle";b.fill=null;b.stroke= +"magenta";b.strokeWidth=2;b.desiredSize=Qb;a.add(b);a.selectable=!1;a.layerName="Tool";this.Ji=a;this.m=b;this.Oc=this.Nc=this.tb=this.jb=this.Ib=null;this.ma=!0;this.jp=new yb;this.Rf=this.oj=this.Sf=null}na(Pf,xe);Pf.prototype.doStop=function(){this.diagram.xg();this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null;this.validPortsCache.clear();this.targetPort=null}; +Pf.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){var f=b.Gf(),g=Hb.alloc();g.width=b.naturalBounds.width*f;g.height=b.naturalBounds.height*f;d.desiredSize=g;Hb.free(g);e?(d.toSpot=b.toSpot,d.toEndSegmentLength=b.toEndSegmentLength):(d.fromSpot=b.fromSpot,d.fromEndSegmentLength=b.fromEndSegmentLength);c.locationSpot=Kc;f=K.alloc();c.location=b.oa(Kc,f);K.free(f);d.angle=b.si();null!==this.portTargeted&&this.portTargeted(a,b,c,d,e)}}; +Pf.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.desiredSize=Qb,b.fromSpot=Ec,b.toSpot=Ec);null!==a&&(a.location=this.diagram.lastInput.documentPoint);null!==this.portTargeted&&this.portTargeted(null,null,a,b,c)};Pf.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()}; +Pf.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;this.targetPort=this.findTargetPort(this.isForwards);if(null!==this.targetPort&&this.targetPort.part instanceof T){var b=this.targetPort.part;this.isForwards?this.copyPortProperties(b,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(b,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort, +!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.Sr(a.lastInput.viewPoint)}};Pf.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.part;if(!(c instanceof T))return null;for(;null!==a;){var d=b?a.toLinkable:a.fromLinkable;if(!0===d&&(null!==a.portId||a instanceof T)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.panel}return null}; +Pf.prototype.findTargetPort=function(a){var b=this.diagram,c=b.lastInput.documentPoint,d=this.portGravity;0>=d&&(d=.1);var e=this,f=b.tg(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0);d=Infinity;b=null;for(f=f.iterator;f.next();){var g=f.value,h=g.part;if(h instanceof T){var k=g.oa(Kc,K.alloc()),l=c.x-k.x,m=c.y-k.y;K.free(k);k=l*l+m*m;k<d&&(l=this.validPortsCache.L(g),null!==l?l&&(b=g,d=k):a&&this.isValidLink(this.originalFromNode,this.originalFromPort,h,g)||!a&&this.isValidLink(h, +g,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(g,!0),b=g,d=k):this.validPortsCache.add(g,!1))}}return null!==b&&(c=b.part,c instanceof T&&(null===c.layer||c.layer.allowLink))?b:null}; +Pf.prototype.isValidFrom=function(a,b){if(null===a||null===b)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==a.layer&&!a.layer.allowLink||!0!==b.fromLinkable))return!1;var c=b.fromMaxLinks;if(Infinity>c){if(null!==this.originalLink&&a===this.originalFromNode&&b===this.originalFromPort)return!0;b=b.portId;null===b&&(b="");if(a.Do(b).count>=c)return!1}return!0}; +Pf.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==a.layer&&!a.layer.allowLink||!0!==b.toLinkable))return!1;var c=b.toMaxLinks;if(Infinity>c){if(null!==this.originalLink&&a===this.originalToNode&&b===this.originalToPort)return!0;b=b.portId;null===b&&(b="");if(a.Qd(b).count>=c)return!1}return!0}; +Pf.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;a=a.part;b=b.part;return null!==a&&a===b};Pf.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.part;if(!(c instanceof T))return!1;a=a.portId;null===a&&(a="");var d=b.part;if(!(d instanceof T))return!1;b=b.portId;null===b&&(b="");for(b=d.Qd(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1}; +Pf.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.fromLinkableSelfNode&&d.toLinkableSelfNode||!this.isInSameNode(b,d))&&(b.fromLinkableDuplicates&&d.toLinkableDuplicates||!this.isLinked(b,d)))||null!==this.originalLink&&(null!==a&&this.isLabelDependentOnLink(a,this.originalLink)||null!==c&&this.isLabelDependentOnLink(c,this.originalLink))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a, +c,this.originalLink))return!1;if(null!==a){var e=a.linkValidation;if(null!==e&&!e(a,b,c,d,this.originalLink))return!1}if(null!==c&&(e=c.linkValidation,null!==e&&!e(a,b,c,d,this.originalLink)))return!1;e=this.linkValidation;return null!==e?e(a,b,c,d,this.originalLink):!0};Pf.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.labeledLink;if(null===c)return!1;if(c===b)return!0;var d=new I;d.add(a);return Rf(this,c,b,d)}; +function Rf(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),Rf(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),Rf(a,b.labeledLink,c,d))?!0:!1} +Pf.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.isUnconnectedLinkValid;var d=this.diagram.validCycle;if(d!==Sf){if(d===Tf){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=b.linksConnected;d.next();){var e=d.value;if(e!==c&&e.isTreeLink&&e.toNode===b)return!1}return!Uf(this,a,b,c,!0)}if(d===Vf){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=a.linksConnected;d.next();)if(e=d.value,e!==c&&e.isTreeLink&&e.fromNode=== +a)return!1;return!Uf(this,a,b,c,!0)}if(d===Wf)return a===b?a=!0:(d=new I,d.add(b),a=Xf(this,d,a,b,c)),!a;if(d===Yf)return!Uf(this,a,b,c,!1);if(d===Zf)return a===b?a=!0:(d=new I,d.add(b),a=$f(this,d,a,b,c)),!a}return!0};function Uf(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.linksConnected;f.next();){var g=f.value;if(g!==d&&(!e||g.isTreeLink)&&g.toNode===b&&(g=g.fromNode,g!==b&&Uf(a,g,c,d,e)))return!0}return!1} +function Xf(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.linksConnected;f.next();){var g=f.value;if(g!==e&&g.toNode===c&&(g=g.fromNode,g!==c&&Xf(a,b,g,d,e)))return!0}return!1}function $f(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.linksConnected;f.next();){var g=f.value;if(g!==e){var h=g.fromNode;g=g.toNode;h=h===c?g:h;if(h!==c&&$f(a,b,h,d,e))return!0}}return!1} +oa.Object.defineProperties(Pf.prototype,{portGravity:{configurable:!0,get:function(){return this.ue},set:function(a){A(a,"number",Pf,"portGravity");0<=a&&(this.ue=a)}},isUnconnectedLinkValid:{configurable:!0,get:function(){return this.Ma},set:function(a){A(a,"boolean",Pf,"isUnconnectedLinkValid");this.Ma=a}},linkingCursor:{configurable:!0,get:function(){return this.v},set:function(a){this.v=a}},temporaryLink:{configurable:!0,get:function(){return this.Ii}, +set:function(a){w(a,R,Pf,"temporaryLink");this.Ii=a}},temporaryFromNode:{configurable:!0,get:function(){return this.Hi},set:function(a){w(a,T,Pf,"temporaryFromNode");if(this.Hi=a)this.j=a.port}},temporaryFromPort:{configurable:!0,get:function(){return this.j},set:function(a){w(a,O,Pf,"temporaryFromPort");if(null!==this.j){var b=this.j.panel;if(null!==b){var c=b.U.indexOf(this.j);b.sb(c);b.Hb(c,a)}}this.j=a}},temporaryToNode:{configurable:!0,get:function(){return this.Ji}, +set:function(a){w(a,T,Pf,"temporaryToNode");if(this.Ji=a)this.m=a.port}},temporaryToPort:{configurable:!0,get:function(){return this.m},set:function(a){w(a,O,Pf,"temporaryToPort");if(null!==this.m){var b=this.m.panel;if(null!==b){var c=b.U.indexOf(this.m);b.sb(c);b.Hb(c,a)}}this.m=a}},originalLink:{configurable:!0,get:function(){return this.Ib},set:function(a){null!==a&&w(a,R,Pf,"originalLink");this.Ib=a}},originalFromNode:{configurable:!0,get:function(){return this.jb}, +set:function(a){null!==a&&w(a,T,Pf,"originalFromNode");this.jb=a}},originalFromPort:{configurable:!0,get:function(){return this.tb},set:function(a){null!==a&&w(a,O,Pf,"originalFromPort");this.tb=a}},originalToNode:{configurable:!0,get:function(){return this.Nc},set:function(a){null!==a&&w(a,T,Pf,"originalToNode");this.Nc=a}},originalToPort:{configurable:!0,get:function(){return this.Oc},set:function(a){null!==a&&w(a,O,Pf,"originalToPort");this.Oc=a}},isForwards:{configurable:!0, +enumerable:!0,get:function(){return this.ma},set:function(a){A(a,"boolean",Pf,"isForwards");this.ma=a}},validPortsCache:{configurable:!0,get:function(){return this.jp}},targetPort:{configurable:!0,get:function(){return this.Sf},set:function(a){null!==a&&w(a,O,Pf,"targetPort");this.Sf=a}},linkValidation:{configurable:!0,get:function(){return this.oj},set:function(a){null!==a&&A(a,"function",Pf,"linkValidation");this.oj=a}},portTargeted:{configurable:!0, +get:function(){return this.Rf},set:function(a){null!==a&&A(a,"function",Pf,"portTargeted");this.Rf=a}}});Pf.className="LinkingBaseTool";function ag(){0<arguments.length&&Ca(ag);Pf.call(this);this.name="Linking";this.$={};this.G=null;this.O=bg;this.Wd=null}na(ag,Pf);ag.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.ks()||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:null!==this.findLinkablePort()}; +ag.prototype.findLinkablePort=function(){var a=this.diagram,b=this.startObject;null===b&&(b=a.jc(a.firstInput.documentPoint,null,null));if(null===b)return null;a=b.part;if(!(a instanceof T))return null;var c=this.direction;if(c===bg||c===cg){var d=this.findValidLinkablePort(b,!1);if(null!==d||this.startObject===a&&(d=a.port,this.findValidLinkablePort(d,!1)))return this.isForwards=!0,d}if(c===bg||c===jg)if(b=this.findValidLinkablePort(b,!0),null!==b||this.startObject===a&&(b=a.port,this.findValidLinkablePort(b, +!0)))return this.isForwards=!1,b;return null}; +ag.prototype.doActivate=function(){var a=this.diagram,b=this.findLinkablePort();null===b?this.stopTool():(this.Ja(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(null===this.temporaryToNode||this.temporaryToNode.location.u()||(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=b,b=this.originalFromPort.part,b instanceof T&&(this.originalFromNode=b),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode, +this.temporaryFromPort,!1)):(null===this.temporaryFromNode||this.temporaryFromNode.location.u()||(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=b,b=this.originalToPort.part,b instanceof T&&(this.originalToNode=b),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),a.add(this.temporaryToNode),null!==this.temporaryLink&&(null!==this.temporaryFromNode&&(this.temporaryLink.fromNode= +this.temporaryFromNode),null!==this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.gb(),a.add(this.temporaryLink)),this.isActive=!0)};ag.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink);a.remove(this.temporaryFromNode);a.remove(this.temporaryToNode);a.isMouseCaptured=!1;a.currentCursor="";this.stopTransaction()}; +ag.prototype.doStop=function(){Pf.prototype.doStop.call(this);this.startObject=null}; +ag.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,b=this.transactionResult=null,c=null,d=null,e=null,f=null;try{var g=this.targetPort=this.findTargetPort(this.isForwards);if(null!==g){var h=g.part;h instanceof T&&(this.isForwards?(null!==this.originalFromNode&&(b=this.originalFromNode,c=this.originalFromPort),d=h,e=g):(b=h,c=g,null!==this.originalToNode&&(d=this.originalToNode,e=this.originalToPort)))}else this.isForwards?null!==this.originalFromNode&&this.isUnconnectedLinkValid&& +(b=this.originalFromNode,c=this.originalFromPort):null!==this.originalToNode&&this.isUnconnectedLinkValid&&(d=this.originalToNode,e=this.originalToPort);null!==b||null!==d?(f=this.insertLink(b,c,d,e),null!==f?(null===g&&(this.isForwards?f.defaultToPoint=a.lastInput.documentPoint:f.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.T("ChangingSelection",a.selection),a.clearSelection(!0),f.isSelected=!0),this.transactionResult=this.name,a.T("LinkDrawn",f)):this.doNoLink(b,c,d,e)):this.isForwards? +this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),f&&a.allowSelect&&a.T("ChangedSelection",a.selection)}}};ag.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(null===a)return!0;if(a instanceof R)return a.isTreeLink;var b=this.diagram;if(null===b)return!0;a=b.partManager.getLinkCategoryForData(a);b=b.partManager.findLinkTemplateForCategory(a);return null!==b?b.isTreeLink:!0}; +ag.prototype.insertLink=function(a,b,c,d){return this.diagram.partManager.insertLink(a,b,c,d)};ag.prototype.doNoLink=function(){}; +oa.Object.defineProperties(ag.prototype,{archetypeLinkData:{configurable:!0,get:function(){return this.$},set:function(a){null!==a&&A(a,"object",ag,"archetypeLinkData");a instanceof O&&w(a,R,ag,"archetypeLinkData");this.$=a}},archetypeLabelNodeData:{configurable:!0,get:function(){return this.G},set:function(a){null!==a&&A(a,"object",ag,"archetypeLabelNodeData");a instanceof O&&w(a,T,ag,"archetypeLabelNodeData");this.G=a}},direction:{configurable:!0,get:function(){return this.O}, +set:function(a){ab(a,ag,ag,"direction");this.O=a}},startObject:{configurable:!0,get:function(){return this.Wd},set:function(a){null!==a&&w(a,O,ag,"startObject");this.Wd=a}}});var bg=new F(ag,"Either",0),cg=new F(ag,"ForwardsOnly",0),jg=new F(ag,"BackwardsOnly",0);ag.className="LinkingTool";ag.Either=bg;ag.ForwardsOnly=cg;ag.BackwardsOnly=jg; +function We(){0<arguments.length&&Ca(We);Pf.call(this);this.name="Relinking";var a=new Qf;a.figure="Diamond";a.desiredSize=Sb;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=0;this.$=a;a=new Qf;a.figure="Diamond";a.desiredSize=Sb;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=-1;this.Wd=a;this.G=null;this.ww=new M}na(We,Pf); +We.prototype.updateAdornments=function(a){if(null!==a&&a instanceof R){var b="RelinkFrom",c=null;if(a.isSelected&&!this.diagram.isReadOnly){var d=a.selectionObject;null!==d&&a.canRelinkFrom()&&a.actualBounds.u()&&a.isVisible()&&d.actualBounds.u()&&d.Lf()&&(c=a.Uj(b),null===c&&(c=this.makeAdornment(d,!1),a.eh(b,c)))}null===c&&a.Mf(b);b="RelinkTo";c=null;a.isSelected&&!this.diagram.isReadOnly&&(d=a.selectionObject,null!==d&&a.canRelinkTo()&&a.actualBounds.u()&&a.isVisible()&&d.actualBounds.u()&&d.Lf()&& +(c=a.Uj(b),null===c?(c=this.makeAdornment(d,!0),a.eh(b,c)):c.w()));null===c&&a.Mf(b)}};We.prototype.makeAdornment=function(a,b){var c=new Ce;c.type=V.Link;b=b?this.toHandleArchetype:this.fromHandleArchetype;null!==b&&c.add(b.copy());c.adornedObject=a;return c}; +We.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.ks()||!a.lastInput.left)return!1;var b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo"));return null!==b}; +We.prototype.doActivate=function(){var a=this.diagram;if(null===this.originalLink){var b=this.handle;null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom"),null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo")));if(null===b)return;var c=b.part;if(!(c instanceof Ce&&c.adornedPart instanceof R))return;this.handle=b;this.isForwards=null===c||"RelinkTo"===c.category;this.originalLink=c.adornedPart}this.Ja(this.name);a.isMouseCaptured=!0;a.currentCursor=this.linkingCursor; +this.originalFromPort=this.originalLink.fromPort;this.originalFromNode=this.originalLink.fromNode;this.originalToPort=this.originalLink.toPort;this.originalToNode=this.originalLink.toNode;this.ww.set(this.originalLink.actualBounds);null!==this.originalLink&&0<this.originalLink.pointsCount&&(null===this.originalLink.fromNode&&(null!==this.temporaryFromPort&&(this.temporaryFromPort.desiredSize=Pb),null!==this.temporaryFromNode&&(this.temporaryFromNode.location=this.originalLink.i(0))),null===this.originalLink.toNode&& +(null!==this.temporaryToPort&&(this.temporaryToPort.desiredSize=Pb),null!==this.temporaryToNode&&(this.temporaryToNode.location=this.originalLink.i(this.originalLink.pointsCount-1))));this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1);this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0);a.add(this.temporaryFromNode);a.add(this.temporaryToNode);null!==this.temporaryLink&&(null!== +this.temporaryFromNode&&(this.temporaryLink.fromNode=this.temporaryFromNode),null!==this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(this.originalLink,this.temporaryLink),this.temporaryLink.gb(),a.add(this.temporaryLink));this.isActive=!0}; +We.prototype.copyLinkProperties=function(a,b){if(null!==a&&null!==b){b.adjusting=a.adjusting;b.corner=a.corner;var c=a.curve;if(c===kg||c===lg)c=mg;b.curve=c;b.curviness=a.curviness;b.isTreeLink=a.isTreeLink;b.points=a.points;b.routing=a.routing;b.smoothness=a.smoothness;b.fromSpot=a.fromSpot;b.fromEndSegmentLength=a.fromEndSegmentLength;b.fromShortLength=a.fromShortLength;b.toSpot=a.toSpot;b.toEndSegmentLength=a.toEndSegmentLength;b.toShortLength=a.toShortLength}}; +We.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink);a.remove(this.temporaryFromNode);a.remove(this.temporaryToNode);a.isMouseCaptured=!1;a.currentCursor="";this.stopTransaction()};We.prototype.doStop=function(){Pf.prototype.doStop.call(this);this.handle=null}; +We.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;this.transactionResult=null;var b=this.originalFromNode,c=this.originalFromPort,d=this.originalToNode,e=this.originalToPort,f=this.originalLink;try{this.targetPort=this.findTargetPort(this.isForwards);if(null!==this.targetPort){var g=this.targetPort.part;g instanceof T&&(this.isForwards?(d=g,e=this.targetPort):(b=g,c=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?e=d=null:c=b=null:f=null;null!==f?(this.reconnectLink(f, +this.isForwards?d:b,this.isForwards?e:c,this.isForwards),null===this.targetPort&&(this.isForwards?f.defaultToPoint=a.lastInput.documentPoint:f.defaultFromPoint=a.lastInput.documentPoint,f.gb()),this.transactionResult=this.name,a.T("LinkRelinked",f,this.isForwards?this.originalToPort:this.originalFromPort)):this.doNoRelink(this.originalLink,this.isForwards);this.originalLink.Mo(this.ww)}finally{this.stopTool()}}}; +We.prototype.reconnectLink=function(a,b,c,d){c=null!==c&&null!==c.portId?c.portId:"";d?(a.toNode=b,a.toPortId=c):(a.fromNode=b,a.fromPortId=c);return!0};We.prototype.doNoRelink=function(){}; +function If(a,b,c,d,e){null!==b?(a.copyPortProperties(b,c,a.temporaryFromNode,a.temporaryFromPort,!1),a.diagram.add(a.temporaryFromNode)):a.diagram.remove(a.temporaryFromNode);null!==d?(a.copyPortProperties(d,e,a.temporaryToNode,a.temporaryToPort,!0),a.diagram.add(a.temporaryToNode)):a.diagram.remove(a.temporaryToNode)} +oa.Object.defineProperties(We.prototype,{fromHandleArchetype:{configurable:!0,get:function(){return this.$},set:function(a){null!==a&&w(a,O,We,"fromHandleArchetype");this.$=a}},toHandleArchetype:{configurable:!0,get:function(){return this.Wd},set:function(a){null!==a&&w(a,O,We,"toHandleArchetype");this.Wd=a}},handle:{configurable:!0,get:function(){return this.G},set:function(a){if(null!==a&&(w(a,O,We,"handle"),!(a.part instanceof Ce)))throw Error("new handle is not in an Adornment: "+ +a);this.G=a}}});We.className="RelinkingTool";Ta("linkingTool",function(){return this.findTool("Linking")},function(a){this.nb("Linking",a,this.mouseMoveTools)});Ta("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.nb("Relinking",a,this.mouseDownTools)}); +function ng(){0<arguments.length&&Ca(ng);xe.call(this);this.name="LinkReshaping";var a=new Qf;a.figure="Rectangle";a.desiredSize=Rb;a.fill="lightblue";a.stroke="dodgerblue";this.m=a;a=new Qf;a.figure="Diamond";a.desiredSize=Sb;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="move";this.v=a;this.G=3;this.Is=this.j=null;this.xw=new K;this.Kq=new H}na(ng,xe);ng.prototype.Su=function(a){return a&&0!==a.reshapingBehavior.value?a.reshapingBehavior:og}; +ng.prototype.jm=function(a,b){w(a,O,ng,"setReshapingBehavior:obj");ab(b,ng,ng,"setReshapingBehavior:behavior");a.reshapingBehavior=b}; +ng.prototype.updateAdornments=function(a){if(null!==a&&a instanceof R){var b=null;if(a.isSelected&&!this.diagram.isReadOnly){var c=a.path;null!==c&&a.canReshape()&&a.actualBounds.u()&&a.isVisible()&&c.actualBounds.u()&&c.Lf()&&(b=a.Uj(this.name),null===b||b.sw!==a.pointsCount||b.Mw!==a.resegmentable)&&(b=this.makeAdornment(c),null!==b&&(b.sw=a.pointsCount,b.Mw=a.resegmentable,a.eh(this.name,b)))}null===b&&a.Mf(this.name)}}; +ng.prototype.makeAdornment=function(a){var b=a.part,c=b.pointsCount,d=b.isOrthogonal,e=null;if(null!==b.points&&1<c){e=new Ce;e.type=V.Link;c=b.firstPickIndex;var f=b.lastPickIndex,g=d?1:0;if(b.resegmentable&&b.computeCurve()!==pg)for(var h=c+g;h<f-g;h++){var k=this.makeResegmentHandle(a,h);null!==k&&(k.segmentIndex=h,k.segmentFraction=.5,k.fromMaxLinks=999,e.add(k))}for(g=c+1;g<f;g++)if(h=this.makeHandle(a,g),null!==h){h.segmentIndex=g;if(g!==c)if(g===c+1&&d){k=b.i(c);var l=b.i(c+1);L.C(k.x,l.x)&& +L.C(k.y,l.y)&&(l=b.i(c-1));L.C(k.x,l.x)?(this.jm(h,qg),h.cursor="n-resize"):L.C(k.y,l.y)&&(this.jm(h,rg),h.cursor="w-resize")}else g===f-1&&d?(k=b.i(f-1),l=b.i(f),L.C(k.x,l.x)&&L.C(k.y,l.y)&&(k=b.i(f+1)),L.C(k.x,l.x)?(this.jm(h,qg),h.cursor="n-resize"):L.C(k.y,l.y)&&(this.jm(h,rg),h.cursor="w-resize")):g!==f&&(this.jm(h,sg),h.cursor="move");e.add(h)}e.adornedObject=a}return e};ng.prototype.makeHandle=function(){var a=this.handleArchetype;return null===a?null:a.copy()}; +ng.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return null===a?null:a.copy()};ng.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowReshape&&a.lastInput.left?null!==this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1}; +ng.prototype.doActivate=function(){var a=this.diagram;null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));if(null!==this.handle){var b=this.handle.part.adornedPart;if(b instanceof R){this.Is=b;a.isMouseCaptured=!0;this.Ja(this.name);if(b.resegmentable&&999===this.handle.fromMaxLinks){var c=b.points.copy(),d=this.getResegmentingPoint();c.Hb(this.handle.segmentIndex+1,d);b.isOrthogonal&&c.Hb(this.handle.segmentIndex+1,d);b.points=c;b.Xb();b.updateAdornments(); +this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name);if(null===this.handle){this.doDeactivate();return}}this.xw=b.i(this.handle.segmentIndex);this.Kq=b.points.copy();this.isActive=!0}}};ng.prototype.doDeactivate=function(){this.stopTransaction();this.Is=this.handle=null;this.isActive=this.diagram.isMouseCaptured=!1}; +ng.prototype.stopTransaction=function(){var a=this.diagram,b=xe.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.gk();return b};ng.prototype.doCancel=function(){var a=this.adornedLink;null!==a&&(a.points=this.Kq);this.stopTool()};ng.prototype.getResegmentingPoint=function(){return this.handle.oa(Kc)};ng.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))}; +ng.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.computeReshape(a.lastInput.documentPoint);this.reshape(b);b=this.adornedLink;if(null!==b&&b.resegmentable){var c=this.handle.segmentIndex,d=b.i(c-1),e=b.i(c),f=b.i(c+1);if(b.isOrthogonal){if(c>b.firstPickIndex+1&&c<b.lastPickIndex-1){var g=b.i(c-2);if(Math.abs(d.x-e.x)<this.resegmentingDistance&&Math.abs(d.y-e.y)<this.resegmentingDistance&&(tg(this,g,d,e,f,!0)||tg(this,g,d,e,f,!1))){var h=b.points.copy();tg(this,g,d, +e,f,!0)?(h.ad(c-2,new K(g.x,(f.y+g.y)/2)),h.ad(c+1,new K(f.x,(f.y+g.y)/2))):(h.ad(c-2,new K((f.x+g.x)/2,g.y)),h.ad(c+1,new K((f.x+g.x)/2,f.y)));h.sb(c);h.sb(c-1);b.points=h;b.Xb()}else g=b.i(c+2),Math.abs(e.x-f.x)<this.resegmentingDistance&&Math.abs(e.y-f.y)<this.resegmentingDistance&&(tg(this,d,e,f,g,!0)||tg(this,d,e,f,g,!1))&&(h=b.points.copy(),tg(this,d,e,f,g,!0)?(h.ad(c-1,new K(d.x,(d.y+g.y)/2)),h.ad(c+2,new K(g.x,(d.y+g.y)/2))):(h.ad(c-1,new K((d.x+g.x)/2,d.y)),h.ad(c+2,new K((d.x+g.x)/2,g.y))), +h.sb(c+1),h.sb(c),b.points=h,b.Xb())}}else g=K.alloc(),L.qh(d.x,d.y,f.x,f.y,e.x,e.y,g)&&g.Df(e)<this.resegmentingDistance*this.resegmentingDistance&&(d=b.points.copy(),d.sb(c),b.points=d,b.Xb()),K.free(g)}a.ab();this.transactionResult=this.name;a.T("LinkReshaped",this.adornedLink,this.Kq)}this.stopTool()}; +function tg(a,b,c,d,e,f){return f?Math.abs(b.y-c.y)<a.resegmentingDistance&&Math.abs(c.y-d.y)<a.resegmentingDistance&&Math.abs(d.y-e.y)<a.resegmentingDistance:Math.abs(b.x-c.x)<a.resegmentingDistance&&Math.abs(c.x-d.x)<a.resegmentingDistance&&Math.abs(d.x-e.x)<a.resegmentingDistance} +ng.prototype.reshape=function(a){var b=this.adornedLink;b.uh();var c=this.handle.segmentIndex,d=this.Su(this.handle);if(b.isOrthogonal)if(c===b.firstPickIndex+1)c=b.firstPickIndex+1,d===qg?(b.P(c,b.i(c-1).x,a.y),b.P(c+1,b.i(c+2).x,a.y)):d===rg&&(b.P(c,a.x,b.i(c-1).y),b.P(c+1,a.x,b.i(c+2).y));else if(c===b.lastPickIndex-1)c=b.lastPickIndex-1,d===qg?(b.P(c-1,b.i(c-2).x,a.y),b.P(c,b.i(c+1).x,a.y)):d===rg&&(b.P(c-1,a.x,b.i(c-2).y),b.P(c,a.x,b.i(c+1).y));else{d=c;var e=b.i(d),f=b.i(d-1),g=b.i(d+1);L.C(f.x, +e.x)&&L.C(e.y,g.y)?(L.C(f.x,b.i(d-2).x)&&!L.C(f.y,b.i(d-2).y)?(b.l(d,a.x,f.y),c++,d++):b.P(d-1,a.x,f.y),L.C(g.y,b.i(d+2).y)&&!L.C(g.x,b.i(d+2).x)?b.l(d+1,g.x,a.y):b.P(d+1,g.x,a.y)):L.C(f.y,e.y)&&L.C(e.x,g.x)?(L.C(f.y,b.i(d-2).y)&&!L.C(f.x,b.i(d-2).x)?(b.l(d,f.x,a.y),c++,d++):b.P(d-1,f.x,a.y),L.C(g.x,b.i(d+2).x)&&!L.C(g.y,b.i(d+2).y)?b.l(d+1,a.x,g.y):b.P(d+1,a.x,g.y)):L.C(f.x,e.x)&&L.C(e.x,g.x)?(L.C(f.x,b.i(d-2).x)&&!L.C(f.y,b.i(d-2).y)?(b.l(d,a.x,f.y),c++,d++):b.P(d-1,a.x,f.y),L.C(g.x,b.i(d+2).x)&& +!L.C(g.y,b.i(d+2).y)?b.l(d+1,a.x,g.y):b.P(d+1,a.x,g.y)):L.C(f.y,e.y)&&L.C(e.y,g.y)&&(L.C(f.y,b.i(d-2).y)&&!L.C(f.x,b.i(d-2).x)?(b.l(d,f.x,a.y),c++,d++):b.P(d-1,f.x,a.y),L.C(g.y,b.i(d+2).y)&&!L.C(g.x,b.i(d+2).x)?b.l(d+1,g.x,a.y):b.P(d+1,g.x,a.y));b.P(c,a.x,a.y)}else b.P(c,a.x,a.y),d=b.fromNode,e=b.fromPort,null!==d&&(f=d.findVisibleNode(),null!==f&&f!==d&&(d=f,e=d.port)),1===c&&b.computeSpot(!0,e).kc()&&(f=e.oa(Kc,K.alloc()),d=b.getLinkPointFromPoint(d,e,f,a,!0,K.alloc()),b.P(0,d.x,d.y),K.free(f), +K.free(d)),d=b.toNode,e=b.toPort,null!==d&&(f=d.findVisibleNode(),null!==f&&f!==d&&(d=f,e=d.port)),c===b.pointsCount-2&&b.computeSpot(!1,e).kc()&&(c=e.oa(Kc,K.alloc()),a=b.getLinkPointFromPoint(d,e,c,a,!1,K.alloc()),b.P(b.pointsCount-1,a.x,a.y),K.free(c),K.free(a));b.Bf()};ng.prototype.computeReshape=function(a){var b=this.adornedLink,c=this.handle.segmentIndex;switch(this.Su(this.handle)){case sg:return a;case qg:return new K(b.i(c).x,a.y);case rg:return new K(a.x,b.i(c).y);default:case og:return b.i(c)}}; +oa.Object.defineProperties(ng.prototype,{handleArchetype:{configurable:!0,get:function(){return this.m},set:function(a){null!==a&&w(a,O,ng,"handleArchetype");this.m=a}},midHandleArchetype:{configurable:!0,get:function(){return this.v},set:function(a){null!==a&&w(a,O,ng,"midHandleArchetype");this.v=a}},handle:{configurable:!0,get:function(){return this.j},set:function(a){if(null!==a&&(w(a,O,ng,"handle"),!(a.part instanceof Ce)))throw Error("new handle is not in an Adornment: "+ +a);this.j=a}},adornedLink:{configurable:!0,get:function(){return this.Is}},resegmentingDistance:{configurable:!0,get:function(){return this.G},set:function(a){A(a,"number",ng,"resegmentingDistance");this.G=a}},originalPoint:{configurable:!0,get:function(){return this.xw}},originalPoints:{configurable:!0,get:function(){return this.Kq}}});ng.prototype.setReshapingBehavior=ng.prototype.jm;ng.prototype.getReshapingBehavior=ng.prototype.Su; +var og=new F(ng,"None",0),rg=new F(ng,"Horizontal",1),qg=new F(ng,"Vertical",2),sg=new F(ng,"All",3);ng.className="LinkReshapingTool";ng.None=og;ng.Horizontal=rg;ng.Vertical=qg;ng.All=sg;Ta("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.nb("LinkReshaping",a,this.mouseDownTools)}); +function ug(){0<arguments.length&&Ca(ug);xe.call(this);this.name="Resizing";this.m=(new Hb(1,1)).freeze();this.j=(new Hb(9999,9999)).freeze();this.Bg=(new Hb(NaN,NaN)).freeze();this.$=!1;this.ma=!0;this.ve=null;var a=new Qf;a.alignmentFocus=Kc;a.figure="Rectangle";a.desiredSize=Rb;a.fill="lightblue";a.stroke="dodgerblue";a.strokeWidth=1;a.cursor="pointer";this.G=a;this.v=null;this.Jq=new K;this.vw=new Hb;this.Mn=new K;this.gt=new Hb(0,0);this.ft=new Hb(Infinity,Infinity);this.et=new Hb(1,1)} +na(ug,xe);ug.prototype.updateAdornments=function(a){if(!(null===a||a instanceof R)){if(a.isSelected&&!this.diagram.isReadOnly){var b=a.resizeObject,c=a.Uj(this.name);if(null!==b&&a.canResize()&&a.actualBounds.u()&&a.isVisible()&&b.actualBounds.u()&&b.Lf()){if(null===c||c.adornedObject!==b)c=this.makeAdornment(b);if(null!==c){b=b.si();vg(a)&&this.updateResizeHandles(c,b);a.eh(this.name,c);return}}}a.Mf(this.name)}}; +ug.prototype.makeAdornment=function(a){var b=a.part.resizeAdornmentTemplate;if(null===b){b=new Ce;b.type=V.Spot;b.locationSpot=Kc;var c=new wg;c.isPanelMain=!0;b.add(c);b.add(this.makeHandle(a,Fc));b.add(this.makeHandle(a,Hc));b.add(this.makeHandle(a,Oc));b.add(this.makeHandle(a,Mc));b.add(this.makeHandle(a,md));b.add(this.makeHandle(a,qd));b.add(this.makeHandle(a,rd));b.add(this.makeHandle(a,pd))}else if(xg(b),b=b.copy(),null===b)return null;b.adornedObject=a;return b}; +ug.prototype.makeHandle=function(a,b){a=this.handleArchetype;if(null===a)return null;a=a.copy();a.alignment=b;return a}; +ug.prototype.updateResizeHandles=function(a,b){if(null!==a)if(!a.alignment.Rb()&&("pointer"===a.cursor||0<a.cursor.indexOf("resize")))a:{var c=a.alignment;c.kc()&&(c=Kc);if(0>=c.x)b=0>=c.y?b+225:1<=c.y?b+135:b+180;else if(1<=c.x)0>=c.y?b+=315:1<=c.y&&(b+=45);else if(0>=c.y)b+=270;else if(1<=c.y)b+=90;else break a;0>b?b+=360:360<=b&&(b-=360);a.cursor=22.5>b?"e-resize":67.5>b?"se-resize":112.5>b?"s-resize":157.5>b?"sw-resize":202.5>b?"w-resize":247.5>b?"nw-resize":292.5>b?"n-resize":337.5>b?"ne-resize": +"e-resize"}else if(a instanceof V)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};ug.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowResize&&a.lastInput.left?null!==this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1}; +ug.prototype.doActivate=function(){var a=this.diagram;null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));null!==this.handle&&(this.adornedObject=this.handle.part.adornedObject,null!==this.adornedObject&&(a.isMouseCaptured=!0,a.animationManager.Cc(),this.Ja(this.name),this.Jq.set(this.adornedObject.oa(this.handle.alignment.dv())),this.Mn.set(this.adornedObject.part.location),this.vw.set(this.adornedObject.desiredSize),this.et=this.computeCellSize(),this.gt= +this.computeMinSize(),this.ft=this.computeMaxSize(),this.isActive=!0))};ug.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.ve=this.handle=null;this.isActive=a.isMouseCaptured=!1};ug.prototype.stopTransaction=function(){var a=this.diagram,b=xe.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.gk();return b}; +ug.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()};ug.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.gt,c=this.ft,d=this.et,e=this.adornedObject.$r(a.lastInput.documentPoint,K.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.td();K.free(e)}}; +ug.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.gt,c=this.ft,d=this.et,e=this.adornedObject.$r(a.lastInput.documentPoint,K.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);K.free(e);a.ab();this.transactionResult=this.name;a.T("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}; +ug.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject;if(null!==c){c.desiredSize=a.size;a=c.part;a.eb();c=c.oa(this.handle.alignment.dv());if(a instanceof wf){var d=new H;d.add(a);if(!this.dragsMembers&&null===a.placeholder){var e=new Pe;e.dragsMembers=!1}b.moveParts(d,this.oppositePoint.copy().re(c),!0,e)}else a.location=a.location.copy().re(c).add(this.oppositePoint);b.td()}}; +ug.prototype.computeResize=function(a,b,c,d,e,f){b.kc()&&(b=Kc);var g=this.adornedObject.naturalBounds,h=g.x,k=g.y,l=g.x+g.width,m=g.y+g.height,n=1;if(!f){n=g.width;var p=g.height;0>=n&&(n=1);0>=p&&(p=1);n=p/n}p=K.alloc();L.Eo(a.x,a.y,h,k,e.width,e.height,p);a=g.copy();0>=b.x?0>=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n* +a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width,a.y=m-a.height)):1<=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width)):(a.x= +Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=l-a.x,f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width), +a.y=m-a.height)):1<=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width))):(a.width=Math.max(Math.min(p.x-h,d.width),c.width),f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):0>=b.y?(a.y=Math.max(p.y,m-d.height), +a.y=Math.min(a.y,m-c.height),a.height=m-a.y,f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width))):1<=b.y&&(a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width)));K.free(p);return a};ug.prototype.computeReshape=function(){var a=yg;this.adornedObject instanceof Qf&&(a=zg(this.adornedObject));return!(a===Ag||this.diagram.lastInput.shift)}; +ug.prototype.computeMinSize=function(){var a=this.adornedObject.minSize.copy(),b=this.minSize;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};ug.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),b=this.maxSize;!isNaN(b.width)&&b.width<a.width&&(a.width=b.width);!isNaN(b.height)&&b.height<a.height&&(a.height=b.height);return a}; +ug.prototype.computeCellSize=function(){var a=new Hb(NaN,NaN),b=this.adornedObject.part;null!==b&&(b=b.resizeCellSize,!isNaN(b.width)&&0<b.width&&(a.width=b.width),!isNaN(b.height)&&0<b.height&&(a.height=b.height));b=this.cellSize;isNaN(a.width)&&!isNaN(b.width)&&0<b.width&&(a.width=b.width);isNaN(a.height)&&!isNaN(b.height)&&0<b.height&&(a.height=b.height);b=this.diagram;(isNaN(a.width)||isNaN(a.height))&&b&&(b=b.grid,null!==b&&b.visible&&this.isGridSnapEnabled&&(b=b.gridCellSize,isNaN(a.width)&& +!isNaN(b.width)&&0<b.width&&(a.width=b.width),isNaN(a.height)&&!isNaN(b.height)&&0<b.height&&(a.height=b.height)));if(isNaN(a.width)||0===a.width||Infinity===a.width)a.width=1;if(isNaN(a.height)||0===a.height||Infinity===a.height)a.height=1;return a}; +oa.Object.defineProperties(ug.prototype,{handleArchetype:{configurable:!0,get:function(){return this.G},set:function(a){null!==a&&w(a,O,ug,"handleArchetype");this.G=a}},handle:{configurable:!0,get:function(){return this.v},set:function(a){if(null!==a&&(w(a,O,ug,"handle"),!(a.part instanceof Ce)))throw Error("new handle is not in an Adornment: "+a);this.v=a}},adornedObject:{configurable:!0,get:function(){return this.ve},set:function(a){if(null!==a&&(w(a,O, +ug,"handle"),a.part instanceof Ce))throw Error("new handle must not be in an Adornment: "+a);this.ve=a}},minSize:{configurable:!0,get:function(){return this.m},set:function(a){w(a,Hb,ug,"minSize");if(!this.m.D(a)){var b=a.width;isNaN(b)&&(b=0);a=a.height;isNaN(a)&&(a=0);this.m.h(b,a)}}},maxSize:{configurable:!0,get:function(){return this.j},set:function(a){w(a,Hb,ug,"maxSize");if(!this.j.D(a)){var b=a.width;isNaN(b)&&(b=Infinity);a=a.height;isNaN(a)&&(a=Infinity);this.j.h(b, +a)}}},cellSize:{configurable:!0,get:function(){return this.Bg},set:function(a){w(a,Hb,ug,"cellSize");this.Bg.D(a)||this.Bg.assign(a)}},isGridSnapEnabled:{configurable:!0,get:function(){return this.$},set:function(a){A(a,"boolean",ug,"isGridSnapEnabled");this.$=a}},dragsMembers:{configurable:!0,get:function(){return this.ma},set:function(a){A(a,"boolean",ug,"dragsMembers");this.ma=a}},oppositePoint:{configurable:!0,get:function(){return this.Jq}, +set:function(a){w(a,K,ug,"oppositePoint");this.Jq.D(a)||this.Jq.assign(a)}},originalDesiredSize:{configurable:!0,get:function(){return this.vw}},originalLocation:{configurable:!0,get:function(){return this.Mn}}});ug.className="ResizingTool";Ta("resizingTool",function(){return this.findTool("Resizing")},function(a){this.nb("Resizing",a,this.mouseDownTools)}); +function Bg(){0<arguments.length&&Ca(Bg);xe.call(this);this.name="Rotating";this.ma=45;this.$=2;this.Mn=new K;this.ve=null;var a=new Qf;a.figure="Ellipse";a.desiredSize=Sb;a.fill="lightblue";a.stroke="dodgerblue";a.strokeWidth=1;a.cursor="pointer";this.m=a;this.j=null;this.uw=0;this.Wq=new K(NaN,NaN);this.v=0;this.G=50}na(Bg,xe); +Bg.prototype.updateAdornments=function(a){if(null!==a){if(a.ph()){var b=a.rotateObject;if(b===a||b===a.path||b.isPanelMain)return}if(a.isSelected&&!this.diagram.isReadOnly&&(b=a.rotateObject,null!==b&&a.canRotate()&&a.actualBounds.u()&&a.isVisible()&&b.actualBounds.u()&&b.Lf())){var c=a.Uj(this.name);if(null===c||c.adornedObject!==b)c=this.makeAdornment(b);if(null!==c){c.angle=b.si();null===c.placeholder&&(c.location=this.computeAdornmentLocation(b));a.eh(this.name,c);return}}a.Mf(this.name)}}; +Bg.prototype.makeAdornment=function(a){var b=a.part.rotateAdornmentTemplate;if(null===b){b=new Ce;b.type=V.Position;b.locationSpot=Kc;var c=this.handleArchetype;null!==c&&b.add(c.copy())}else if(xg(b),b=b.copy(),null===b)return null;b.adornedObject=a;return b};Bg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowRotate&&a.lastInput.left?null!==this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1}; +Bg.prototype.doActivate=function(){var a=this.diagram;if(null===this.adornedObject){null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));if(null===this.handle)return;this.adornedObject=this.handle.part.adornedObject}null!==this.adornedObject&&(a.isMouseCaptured=!0,a.delaysLayout=!0,this.Ja(this.name),this.uw=this.adornedObject.angle,this.Wq=this.computeRotationPoint(this.adornedObject),this.Mn=this.adornedObject.part.location.copy(),this.isActive=!0)}; +Bg.prototype.computeRotationPoint=function(a){var b=a.part,c=b.locationObject;return b.rotationSpot.mb()?a.oa(b.rotationSpot):a===b||a===c?c.oa(b.locationSpot):a.oa(Kc)}; +Bg.prototype.computeAdornmentLocation=function(a){var b=this.rotationPoint;b.u()||(b=this.computeRotationPoint(a));b=a.$r(b);var c=this.handleAngle;0>c?c+=360:360<=c&&(c-=360);c=Math.round(45*Math.round(c/45));var d=this.handleDistance;0===c?b.x=a.naturalBounds.width+d:45===c?(b.x=a.naturalBounds.width+d,b.y=a.naturalBounds.height+d):90===c?b.y=a.naturalBounds.height+d:135===c?(b.x=-d,b.y=a.naturalBounds.height+d):180===c?b.x=-d:225===c?(b.x=-d,b.y=-d):270===c?b.y=-d:315===c&&(b.x=a.naturalBounds.width+ +d,b.y=-d);return a.oa(b)};Bg.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.ve=this.handle=null;this.Wq=new K(NaN,NaN);this.isActive=a.isMouseCaptured=!1};Bg.prototype.stopTransaction=function(){var a=this.diagram,b=xe.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.gk();return b};Bg.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()}; +Bg.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))};Bg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.ab();this.transactionResult=this.name;a.T("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()}; +Bg.prototype.rotate=function(a){G&&E(a,Bg,"rotate:newangle");var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.eb();var c=b.locationObject,d=b.rotateObject;if(c===d||c.vg(d))c=this.Mn.copy(),b.location=c.re(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint);this.diagram.td()}}; +Bg.prototype.computeRotate=function(a){a=this.rotationPoint.cb(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.si());360<=a?a-=360:0>a&&(a+=360);b=Math.min(Math.abs(this.snapAngleMultiple),180);var c=Math.min(Math.abs(this.snapAngleEpsilon),b/2);!this.diagram.lastInput.shift&&0<b&&0<c&&(a%b<c?a=Math.floor(a/b)*b:a%b>b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a}; +oa.Object.defineProperties(Bg.prototype,{handleArchetype:{configurable:!0,get:function(){return this.m},set:function(a){null!==a&&w(a,O,Bg,"handleArchetype");this.m=a}},handle:{configurable:!0,get:function(){return this.j},set:function(a){if(null!==a&&(w(a,O,Bg,"handle"),!(a.part instanceof Ce)))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedObject:{configurable:!0,get:function(){return this.ve},set:function(a){if(null!==a&&(w(a,O, +Bg,"handle"),a.part instanceof Ce))throw Error("new handle must not be in an Adornment: "+a);this.ve=a}},snapAngleMultiple:{configurable:!0,get:function(){return this.ma},set:function(a){A(a,"number",Bg,"snapAngleMultiple");this.ma=a}},snapAngleEpsilon:{configurable:!0,get:function(){return this.$},set:function(a){A(a,"number",Bg,"snapAngleEpsilon");this.$=a}},originalAngle:{configurable:!0,get:function(){return this.uw}},rotationPoint:{configurable:!0, +get:function(){return this.Wq},set:function(a){this.Wq=a.copy()}},handleAngle:{configurable:!0,get:function(){return this.v},set:function(a){A(a,"number",Bg,"handleAngle");this.v=a}},handleDistance:{configurable:!0,get:function(){return this.G},set:function(a){A(a,"number",Bg,"handleDistance");this.G=a}}});Bg.className="RotatingTool";Ta("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.nb("Rotating",a,this.mouseDownTools)}); +function Cg(){xe.call(this);0<arguments.length&&Ca(Cg);this.name="ClickSelecting"}na(Cg,xe);Cg.prototype.canStart=function(){return!this.isEnabled||this.isBeyondDragSize()?!1:!0};Cg.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip());this.stopTool()};Cg.className="ClickSelectingTool";function Dg(){xe.call(this);0<arguments.length&&Ca(Dg);this.name="Action";this.qk=null} +na(Dg,xe);Dg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,b=a.lastInput,c=a.jc(b.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a});if(null!==c){if(!c.isActionable)return!1;this.qk=c;a.Dk=a.jc(b.documentPoint,null,null);return!0}return!1};Dg.prototype.doMouseDown=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.qk;null!==b&&(a.targetObject=b,null!==b.actionDown&&b.actionDown(a,b))}else this.canStart()&&this.doActivate()}; +Dg.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.qk;null!==b&&(a.targetObject=b,null!==b.actionMove&&b.actionMove(a,b))}};Dg.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.qk;if(null===b)return;a.targetObject=b;null!==b.actionUp&&b.actionUp(a,b);this.standardMouseClick(function(a){for(;null!==a.panel&&(!a.isActionable||a!==b);)a=a.panel;return a},function(a){return a===b})}this.stopTool()}; +Dg.prototype.doCancel=function(){var a=this.diagram.lastInput,b=this.qk;null!==b&&(a.targetObject=b,null!==b.actionCancel&&b.actionCancel(a,b),this.stopTool())};Dg.prototype.doStop=function(){this.qk=null};Dg.className="ActionTool";function Eg(){xe.call(this);0<arguments.length&&Ca(Eg);this.name="ClickCreating";this.Yi=null;this.m=!0;this.j=!1;this.ew=new K(0,0)}na(Eg,xe); +Eg.prototype.canStart=function(){if(!this.isEnabled||null===this.archetypeNodeData)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(1===a.lastInput.clickCount&&(this.ew=a.lastInput.viewPoint.copy()),2!==a.lastInput.clickCount||this.isBeyondDragSize(this.ew))return!1}else if(1!==a.lastInput.clickCount)return!1;return a.currentTool!==this&&null!==a.Kl(a.lastInput.documentPoint,!0)?!1:!0}; +Eg.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint);this.stopTool()}; +Eg.prototype.insertPart=function(a){var b=this.diagram,c=this.archetypeNodeData;if(null===c)return null;var d=null;try{b.T("ChangingSelection",b.selection);this.Ja(this.name);if(c instanceof S)c.Zc()&&(xg(c),d=c.copy(),null!==d&&b.add(d));else if(null!==c){var e=b.model.copyNodeData(c);Ga(e)&&(b.model.yf(e),d=b.Lc(e))}if(null!==d){var f=K.allocAt(a.x,a.y);this.isGridSnapEnabled&&Fg(this.diagram,d,a,f);d.location=f;b.allowSelect&&(b.clearSelection(!0),d.isSelected=!0);K.free(f)}b.ab();this.transactionResult= +this.name;b.T("PartCreated",d)}finally{this.stopTransaction(),b.T("ChangedSelection",b.selection)}return d}; +oa.Object.defineProperties(Eg.prototype,{archetypeNodeData:{configurable:!0,get:function(){return this.Yi},set:function(a){null!==a&&A(a,"object",Eg,"archetypeNodeData");this.Yi=a}},isDoubleClick:{configurable:!0,get:function(){return this.m},set:function(a){A(a,"boolean",Eg,"isDoubleClick");this.m=a}},isGridSnapEnabled:{configurable:!0,get:function(){return this.j},set:function(a){A(a,"boolean",Eg,"isGridSnapEnabled");this.j=a}}});Eg.className="ClickCreatingTool"; +function Gg(){xe.call(this);0<arguments.length&&Ca(Gg);this.name="DragSelecting";this.Jk=175;this.m=!1;var a=new S;a.layerName="Tool";a.selectable=!1;var b=new Qf;b.name="SHAPE";b.figure="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.j=a}na(Gg,xe); +Gg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(!a.allowSelect)return!1;var b=a.lastInput;return!b.left||a.currentTool!==this&&(!this.isBeyondDragSize()||b.timestamp-a.firstInput.timestamp<this.delay||null!==a.Kl(b.documentPoint,!0))?!1:!0};Gg.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0;a.isMouseCaptured=!0;a.skipsUndoManager=!0;a.add(this.box);this.doMouseMove()}; +Gg.prototype.doDeactivate=function(){var a=this.diagram;a.xg();a.remove(this.box);a.skipsUndoManager=!1;this.isActive=a.isMouseCaptured=!1};Gg.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive&&null!==this.box){var b=this.computeBoxBounds(),c=this.box.lb("SHAPE");null===c&&(c=this.box.Ab());var d=Hb.alloc().h(b.width,b.height);c.desiredSize=d;this.box.hm(b.x,b.y,!1);Hb.free(d);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.Sr(a.lastInput.viewPoint)}}; +Gg.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;a.remove(this.box);try{a.currentCursor="wait",a.T("ChangingSelection",a.selection),this.selectInRect(this.computeBoxBounds()),a.T("ChangedSelection",a.selection)}finally{a.currentCursor=""}}this.stopTool()};Gg.prototype.computeBoxBounds=function(){var a=this.diagram;return new M(a.firstInput.documentPoint,a.lastInput.documentPoint)}; +Gg.prototype.selectInRect=function(a){var b=this.diagram,c=b.lastInput;a=b.nx(a,this.isPartialInclusion);if(Ya?c.meta:c.control)if(c.shift)for(a=a.iterator;a.next();)b=a.value,b.isSelected&&(b.isSelected=!1);else for(a=a.iterator;a.next();)b=a.value,b.isSelected=!b.isSelected;else if(c.shift)for(a=a.iterator;a.next();)b=a.value,b.isSelected||(b.isSelected=!0);else{c=new H;for(b=b.selection.iterator;b.next();){var d=b.value;a.contains(d)||c.add(d)}for(b=c.iterator;b.next();)b.value.isSelected=!1;for(a= +a.iterator;a.next();)b=a.value,b.isSelected||(b.isSelected=!0)}};oa.Object.defineProperties(Gg.prototype,{delay:{configurable:!0,get:function(){return this.Jk},set:function(a){A(a,"number",Gg,"delay");this.Jk=a}},isPartialInclusion:{configurable:!0,get:function(){return this.m},set:function(a){A(a,"boolean",Gg,"isPartialInclusion");this.m=a}},box:{configurable:!0,get:function(){return this.j},set:function(a){null!==a&&w(a,S,Gg,"box");this.j=a}}}); +Gg.className="DragSelectingTool";function Hg(){xe.call(this);0<arguments.length&&Ca(Hg);this.name="Panning";this.Pt=new K;this.wy=new K;this.Ag=!1;var a=this;this.Cw=function(){var b=a.diagram;null!==b&&b.removeEventListener(sa.document,"scroll",a.Cw,!1);a.stopTool()}}na(Hg,xe);Hg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.allowHorizontalScroll&&!a.allowVerticalScroll||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:!0}; +Hg.prototype.doActivate=function(){var a=this.diagram;this.Ag?(a.lastInput.bubbles=!0,a.addEventListener(sa.document,"scroll",this.Cw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Pt.assign(a.position));this.isActive=!0};Hg.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="";this.isActive=a.isMouseCaptured=!1};Hg.prototype.doCancel=function(){var a=this.diagram;a.position=this.Pt;a.isMouseCaptured=!1;this.stopTool()};Hg.prototype.doMouseMove=function(){this.move()}; +Hg.prototype.doMouseUp=function(){this.move();this.stopTool()};Hg.prototype.move=function(){var a=this.diagram;if(this.isActive&&a)if(this.Ag)a.lastInput.bubbles=!0;else{var b=a.position,c=a.firstInput.documentPoint,d=a.lastInput.documentPoint,e=b.x+c.x-d.x;c=b.y+c.y-d.y;a.allowHorizontalScroll||(e=b.x);a.allowVerticalScroll||(c=b.y);a.position=this.wy.h(e,c)}}; +oa.Object.defineProperties(Hg.prototype,{bubbles:{configurable:!0,get:function(){return this.Ag},set:function(a){A(a,"boolean",Hg,"bubbles");this.Ag=a}},originalPosition:{configurable:!0,get:function(){return this.Pt}}});Hg.className="PanningTool";Ta("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.nb("ClickCreating",a,this.mouseUpTools)}); +Ta("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.nb("ClickSelecting",a,this.mouseUpTools)});Ta("panningTool",function(){return this.findTool("Panning")},function(a){this.nb("Panning",a,this.mouseMoveTools)});Ta("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.nb("DragSelecting",a,this.mouseMoveTools)});Ta("actionTool",function(){return this.findTool("Action")},function(a){this.nb("Action",a,this.mouseDownTools)}); +function Me(){this.G=this.v=this.j=this.m=null} +oa.Object.defineProperties(Me.prototype,{mainElement:{configurable:!0,get:function(){return this.v},set:function(a){null!==a&&w(a,HTMLElement,Me,"mainElement");this.v=a}},show:{configurable:!0,get:function(){return this.m},set:function(a){this.m!==a&&(null!==a&&A(a,"function",Me,"show"),this.m=a)}},hide:{configurable:!0,get:function(){return this.j},set:function(a){this.j!==a&&(null!==a&&A(a,"function",Me,"hide"),this.j=a)}},valueFunction:{configurable:!0, +enumerable:!0,get:function(){return this.G},set:function(a){this.G=a}}});Me.className="HTMLInfo";function Ig(a,b,c){this.text=a;this.Yw=b;this.visible=c}Ig.className="ContextMenuButtonInfo";function Jg(){xe.call(this);0<arguments.length&&Ca(Jg);this.name="ContextMenu";this.m=this.Ws=this.j=null;this.qw=new K;this.Ys=null;this.tt=!1;var a=this;this.lu=function(){a.stopTool()}}na(Jg,xe); +function Kg(a){var b=new Me;b.show=function(a,b,c){c.showDefaultContextMenu()};b.hide=function(a,b){b.hideDefaultContextMenu()};Lg=b;a.lu=function(){a.stopTool()};b=wa("div");var c=wa("div");b.style.cssText="top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px";c.style.cssText="z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;"; +var d=wa("style");sa.document.getElementsByTagName("head")[0].appendChild(d);d.sheet.insertRule(".goCXul { list-style: none; }",0);d.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0);d.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0);d=a.diagram;null!==d&&(d.addEventListener(b,"contextmenu",Ug,!1),d.addEventListener(b,"selectstart", +Ug,!1),d.addEventListener(c,"contextmenu",Ug,!1));b.className="goCXforeground";c.className="goCXbackground";sa.document.body&&(sa.document.body.appendChild(b),sa.document.body.appendChild(c));Vg=b;Wg=c;Xg=!0}function Ug(a){a.preventDefault();return!1} +Jg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return this.isBeyondDragSize()||!a.lastInput.right||1<a.lastInput.clickCount?!1:a.lastInput.isTouchEvent&&null!==this.defaultTouchContextMenu||null!==this.findObjectWithContextMenu()?!0:!1};Jg.prototype.doStart=function(){this.qw.set(this.diagram.firstInput.documentPoint)};Jg.prototype.doStop=function(){this.hideContextMenu();this.currentObject=null}; +Jg.prototype.findObjectWithContextMenu=function(a){void 0===a&&(a=null);var b=this.diagram,c=b.lastInput,d=null;a instanceof P||(a instanceof O?d=a:d=b.jc(c.documentPoint,null,function(a){return!a.layer.isTemporary}));if(null!==d){for(a=d;null!==a;){if(null!==a.contextMenu)return a;a=a.panel}if(b.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return d.part}else if(null!==b.contextMenu)return b;return null};Jg.prototype.doActivate=function(){}; +Jg.prototype.doMouseDown=function(){xe.prototype.doMouseDown.call(this);if(this.isActive&&this.currentContextMenu instanceof Ce){var a=this.diagram.toolManager.findTool("Action");null!==a&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&Yg(this)}; +Jg.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof Ce){var a=this.diagram.toolManager.findTool("Action");null!==a&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}Yg(this)}; +function Yg(a){var b=a.diagram;if(a.isActive){var c=a.currentContextMenu;if(null!==c){if(!(c instanceof Me)){var d=b.jc(b.lastInput.documentPoint,null,null);null!==d&&d.vg(c)&&a.standardMouseClick(null,null)}a.stopTool();a.canStart()&&(b.currentTool=a,a.doMouseUp())}}else a.canStart()&&(Zg(a,!0),a.isActive||a.stopTool())} +function Zg(a,b,c){void 0===c&&(c=null);if(!a.tt&&(a.tt=!0,b&&a.standardMouseSelect(),b=a.standardMouseClick(),a.tt=!1,!b)){a.isActive=!0;b=Lg;null===c&&(c=a.findObjectWithContextMenu());if(null!==c){var d=c.contextMenu;null!==d?(a.currentObject=c instanceof O?c:null,a.showContextMenu(d,a.currentObject)):null!==b&&a.showContextMenu(b,a.currentObject)}else null!==b&&a.showContextMenu(b,null);a.currentContextMenu instanceof Ce&&!a.currentContextMenu.visible&&a.stopTool()}} +Jg.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");null!==a&&a.doMouseMove();this.isActive&&this.diagram.toolManager.doMouseMove()}; +Jg.prototype.showContextMenu=function(a,b){!G||a instanceof Ce||a instanceof Me||v("showContextMenu:contextMenu must be an Adornment or HTMLInfo.");null!==b&&w(b,O,Jg,"showContextMenu:obj");var c=this.diagram;a!==this.currentContextMenu&&this.hideContextMenu();if(a instanceof Ce){a.layerName="Tool";a.selectable=!1;a.scale=1/c.scale;a.category=this.name;null!==a.placeholder&&(a.placeholder.scale=c.scale);var d=a.diagram;null!==d&&d!==c&&d.remove(a);c.add(a);null!==b?a.adornedObject=b:a.data=c.model; +a.eb();this.positionContextMenu(a,b)}else a instanceof Me&&a.show(b,c,this);this.currentContextMenu=a};Jg.prototype.positionContextMenu=function(a){if(null===a.placeholder){var b=this.diagram,c=b.lastInput.documentPoint.copy(),d=a.measuredBounds,e=b.viewportBounds;b.lastInput.isTouchEvent&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5/b.scale);c.x<e.x&&(c.x=e.x);c.y+d.height>e.bottom&&(c.y-=d.height+5/b.scale);c.y<e.y&&(c.y=e.y);a.position=c}}; +Jg.prototype.hideContextMenu=function(){var a=this.diagram,b=this.currentContextMenu;null!==b&&(b instanceof Ce?(a.remove(b),null!==this.Ws&&this.Ws.Mf(b.category),b.data=null,b.adornedObject=null):b instanceof Me&&(null!==b.hide?b.hide(a,this):null!==b.mainElement&&(b.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())}; +function $g(a){var b=new H;b.add(new Ig("Copy",function(a){a.commandHandler.copySelection()},function(a){return a.commandHandler.canCopySelection()}));b.add(new Ig("Cut",function(a){a.commandHandler.cutSelection()},function(a){return a.commandHandler.canCutSelection()}));b.add(new Ig("Delete",function(a){a.commandHandler.deleteSelection()},function(a){return a.commandHandler.canDeleteSelection()}));b.add(new Ig("Paste",function(b){b.commandHandler.pasteSelection(a.mouseDownPoint)},function(b){return b.commandHandler.canPasteSelection(a.mouseDownPoint)})); +b.add(new Ig("Select All",function(a){a.commandHandler.selectAll()},function(a){return a.commandHandler.canSelectAll()}));b.add(new Ig("Undo",function(a){a.commandHandler.undo()},function(a){return a.commandHandler.canUndo()}));b.add(new Ig("Redo",function(a){a.commandHandler.redo()},function(a){return a.commandHandler.canRedo()}));b.add(new Ig("Scroll To Part",function(a){a.commandHandler.scrollToPart()},function(a){return a.commandHandler.canScrollToPart()}));b.add(new Ig("Zoom To Fit",function(a){a.commandHandler.zoomToFit()}, +function(a){return a.commandHandler.canZoomToFit()}));b.add(new Ig("Reset Zoom",function(a){a.commandHandler.resetZoom()},function(a){return a.commandHandler.canResetZoom()}));b.add(new Ig("Group Selection",function(a){a.commandHandler.groupSelection()},function(a){return a.commandHandler.canGroupSelection()}));b.add(new Ig("Ungroup Selection",function(a){a.commandHandler.ungroupSelection()},function(a){return a.commandHandler.canUngroupSelection()}));b.add(new Ig("Edit Text",function(a){a.commandHandler.editTextBlock()}, +function(a){return a.commandHandler.canEditTextBlock()}));return b} +Jg.prototype.showDefaultContextMenu=function(){var a=this.diagram;null===this.Ys&&(this.Ys=$g(this));Vg.innerHTML="";Wg.addEventListener("pointerdown",this.lu,!1);var b=this,c=wa("ul");c.className="goCXul";Vg.appendChild(c);c.innerHTML="";for(var d=this.Ys.iterator;d.next();){var e=d.value,f=e.visible;if("function"===typeof e.Yw&&("function"!==typeof f||f(a))){f=wa("li");f.className="goCXli";var g=wa("a");g.className="goCXa";g.href="#";g.iy=e.Yw;g.addEventListener("pointerdown",function(c){this.iy(a); +b.stopTool();c.preventDefault();return!1},!1);g.textContent=e.text;f.appendChild(g);c.appendChild(f)}}Vg.style.display="block";Wg.style.display="block"};Jg.prototype.hideDefaultContextMenu=function(){if(null!==this.currentContextMenu&&this.currentContextMenu===Lg){Vg.style.display="none";Wg.style.display="none";var a=this.diagram;null!==a&&a.removeEventListener(Wg,"pointerdown",this.lu,!1);this.currentContextMenu=null}}; +oa.Object.defineProperties(Jg.prototype,{currentContextMenu:{configurable:!0,get:function(){return this.j},set:function(a){!G||null===a||a instanceof Ce||a instanceof Me||v("ContextMenuTool.currentContextMenu must be an Adornment or HTMLInfo.");this.j=a;this.Ws=a instanceof Ce?a.adornedPart:null}},defaultTouchContextMenu:{configurable:!0,get:function(){!1===Xg&&null===Lg&&ah&&Kg(this);return Lg},set:function(a){!G||null===a||a instanceof Ce||a instanceof Me||v("ContextMenuTool.defaultTouchContextMenu must be an Adornment or HTMLInfo."); +null===a&&(Xg=!0);Lg=a}},currentObject:{configurable:!0,get:function(){return this.m},set:function(a){null!==a&&w(a,O,Jg,"currentObject");this.m=a}},mouseDownPoint:{configurable:!0,get:function(){return this.qw}}});var Lg=null,Xg=!1,Wg=null,Vg=null;Jg.className="ContextMenuTool";Ta("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.nb("ContextMenu",a,this.mouseUpTools)}); +function bh(){0<arguments.length&&Ca(bh);xe.call(this);this.name="TextEditing";this.di=new ch;this.ma=null;this.$=dh;this.Dj=null;this.ta=eh;this.v=1;this.G=!0;this.m=null;this.j=new Me;this.Zs=null;fh(this,this.j)}na(bh,xe); +function fh(a,b){if(ah){var c=wa("textarea");a.Zs=c;c.addEventListener("input",function(){if(null!==a.textBlock){var b=a.Ix(this.value);this.style.width=20+b.measuredBounds.width*this.vA+"px";this.rows=b.lineCount}},!1);c.addEventListener("keydown",function(b){if(null!==a.textBlock){var c=b.key;"Enter"===c?(!1===a.textBlock.isMultiline&&b.preventDefault(),a.acceptText(gh)):"Tab"===c?(a.acceptText(hh),b.preventDefault()):"Escape"===c&&(a.doCancel(),null!==a.diagram&&a.diagram.doFocus())}},!1);c.addEventListener("focus", +function(){if(null!==a.currentTextEditor&&a.state!==eh){var b=a.Zs;a.ta===ih&&(a.ta=jh);"function"===typeof b.select&&a.selectsTextOnActivate&&(b.select(),b.setSelectionRange(0,9999))}},!1);c.addEventListener("blur",function(){if(null!==a.currentTextEditor&&a.state!==eh){var b=a.Zs;"function"===typeof b.focus&&b.focus();"function"===typeof b.select&&a.selectsTextOnActivate&&(b.select(),b.setSelectionRange(0,9999))}},!1);b.valueFunction=function(){return c.value};b.mainElement=c;b.show=function(a, +b,f){if(a instanceof ch&&f instanceof bh)if(f.state===kh)c.style.border="3px solid red",c.focus();else{var d=a.oa(Kc),e=b.position,k=b.scale,l=a.Gf()*k;l<f.minimumEditorScale&&(l=f.minimumEditorScale);var m=a.naturalBounds.width*l+6,n=a.naturalBounds.height*l+2,p=(d.x-e.x)*k;d=(d.y-e.y)*k;e=a.verticalAlignment;k=(a.lineHeight+a.spacingAbove+a.spacingBelow)*a.lineCount*l;n=e.y*n-e.y*k+e.offsetY-(.5*n-.5*k)-k/2;c.value=a.text;b.div.style.font=a.font;c.style.position="absolute";c.style.zIndex="100"; +c.style.font="inherit";c.style.fontSize=100*l+"%";c.style.lineHeight="normal";c.style.width=m+"px";c.style.left=(p-m/2|0)-1+"px";c.style.top=(d+n|0)-1+"px";c.style.textAlign=a.textAlign;c.style.margin="0";c.style.padding="1px";c.style.border="0";c.style.outline="none";c.style.whiteSpace="pre-wrap";c.style.overflow="hidden";c.rows=a.lineCount;c.vA=l;c.className="goTXarea";b.div.appendChild(c);c.focus();f.selectsTextOnActivate&&(c.select(),c.setSelectionRange(0,9999))}};b.hide=function(a){a.div.removeChild(c)}}} +bh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(null===a||a.isReadOnly||lh&&lh!==this&&(lh.acceptText(mh),lh&&lh!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var b=a.jc(a.lastInput.documentPoint);if(!(null!==b&&b instanceof ch&&b.editable&&b.part.canEdit()))return!1;b=b.part;return null===b||this.starting===dh&&!b.isSelected||this.starting===nh&&2>a.lastInput.clickCount?!1:!0};bh.prototype.doStart=function(){lh=this;null!==this.textBlock&&this.doActivate()}; +bh.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!==a){var b=this.textBlock;null===b&&(b=a.jc(a.lastInput.documentPoint));if(null!==b&&b instanceof ch&&(this.textBlock=b,null!==b.part)){a.animationManager.Cc();this.isActive=!0;this.ta=ih;var c=this.defaultTextEditor;null!==b.textEditor&&(c=b.textEditor);this.di=this.textBlock.copy();var d=new M(this.textBlock.oa(Fc),this.textBlock.oa(Oc));a.pv(d);c.show(b,a,this);this.currentTextEditor=c}}}};bh.prototype.doCancel=function(){this.stopTool()}; +bh.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()};bh.prototype.doMouseDown=function(){this.isActive&&this.acceptText(mh)};bh.prototype.acceptText=function(a){switch(a){case mh:if(this.ta===oh)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.ta===ih||this.ta===kh||this.ta===jh)this.ta=ph,qh(this);break;case rh:case gh:case hh:if(gh!==a||!0!==this.textBlock.isMultiline)if(this.ta===ih||this.ta===kh||this.ta===jh)this.ta=ph,qh(this)}}; +function qh(a){var b=a.textBlock,c=a.diagram,d=a.currentTextEditor;if(null!==b&&null!==d){var e=b.text,f="";null!==d.valueFunction&&(f=d.valueFunction());a.isValidText(b,e,f)?(a.Ja(a.name),a.ta=oh,a.transactionResult=a.name,b.text=f,a.doSuccess(e,f),null!==c&&c.T("TextEdited",b,e),a.stopTransaction(),a.stopTool(),null!==c&&c.doFocus()):(a.ta=kh,a.doError(e,f))}} +bh.prototype.doError=function(a,b){var c=this.textBlock;null!==c.errorFunction&&c.errorFunction(this,a,b);(a=this.currentTextEditor)&&a.show(c,this.diagram,this)};bh.prototype.doSuccess=function(a,b){var c=this.textBlock;null!==c.textEdited&&c.textEdited(c,a,b)};bh.prototype.doDeactivate=function(){var a=this.diagram;null!==a&&(this.ta=eh,null!==this.currentTextEditor&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)};bh.prototype.doStop=function(){lh=null}; +bh.prototype.isValidText=function(a,b,c){w(a,ch,bh,"isValidText:textblock");var d=this.textValidation;if(null!==d&&!d(a,b,c))return!1;d=a.textValidation;return null===d||d(a,b,c)?!0:!1};bh.prototype.Ix=function(a){var b=this.di;b.text=a;b.measure(this.textBlock.Lh,Infinity);return b}; +oa.Object.defineProperties(bh.prototype,{textBlock:{configurable:!0,get:function(){return this.ma},set:function(a){null!==a&&w(a,ch,bh,"textBlock");this.ma=a}},currentTextEditor:{configurable:!0,get:function(){return this.m},set:function(a){this.m=a}},defaultTextEditor:{configurable:!0,get:function(){return this.j},set:function(a){!G||a instanceof Me||v("TextEditingTool.defaultTextEditor must be an HTMLInfo.");this.j=a}},starting:{configurable:!0, +get:function(){return this.$},set:function(a){ab(a,bh,bh,"starting");this.$=a}},textValidation:{configurable:!0,get:function(){return this.Dj},set:function(a){null!==a&&A(a,"function",bh,"textValidation");this.Dj=a}},minimumEditorScale:{configurable:!0,get:function(){return this.v},set:function(a){null!==a&&A(a,"number",bh,"minimumEditorScale");this.v=a}},selectsTextOnActivate:{configurable:!0,get:function(){return this.G},set:function(a){null!==a&&A(a,"boolean", +bh,"selectsTextOnActivate");this.G=a}},state:{configurable:!0,get:function(){return this.ta},set:function(a){this.ta!==a&&(ab(a,bh,bh,"starting"),this.ta=a)}}});bh.prototype.measureTemporaryTextBlock=bh.prototype.Ix; +var rh=new F(bh,"LostFocus",0),mh=new F(bh,"MouseDown",1),hh=new F(bh,"Tab",2),gh=new F(bh,"Enter",3),sh=new F(bh,"SingleClick",0),dh=new F(bh,"SingleClickSelected",1),nh=new F(bh,"DoubleClick",2),eh=new F(bh,"StateNone",0),ih=new F(bh,"StateActive",1),jh=new F(bh,"StateEditing",2),ph=new F(bh,"StateValidating",3),kh=new F(bh,"StateInvalid",4),oh=new F(bh,"StateValidated",5),lh=null;bh.className="TextEditingTool";bh.LostFocus=rh;bh.MouseDown=mh;bh.Tab=hh;bh.Enter=gh;bh.SingleClick=sh; +bh.SingleClickSelected=dh;bh.DoubleClick=nh;bh.StateNone=eh;bh.StateActive=ih;bh.StateEditing=jh;bh.StateValidating=ph;bh.StateInvalid=kh;bh.StateValidated=oh;Ta("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.nb("TextEditing",a,this.mouseUpTools)}); +function th(a){uh||(vh(),uh=!0);this.H=ye;this.Qk=this.Eb=this.kq=this.ec=!1;this.Iw=!0;this.Rk=wh;this.ym=!1;this.Ih=this.Gd=!0;this.Gg=600;this.Vv=this.Gw=!1;this.Yd=new I;this.be=new xh;this.be.Xd=this;this.Li=new I;this.hu=new I;this.Er=new I;this.ql=new I;a&&Object.assign(this,a)}th.prototype.Ye=function(a){this.H=a};th.prototype.canStart=function(){return!0};function yh(a,b){a.Gd&&a.canStart(b)&&(a.Yd.add(b),a.defaultAnimation.isAnimating&&a.Cc(),zh(a.H),a.Eb=!0)} +function Ah(a){if(a.Gd&&a.Eb){var b=a.be,c=a.H,d=a.Yd.contains("Model");d&&(a.Qk=!0,a.Rk===wh?(b.isViewportUnconstrained=!0,b.xc.clear(),b.add(c,"position",c.position.copy().offset(0,-200),c.position),b.add(c,"opacity",0,1)):a.Rk===Bh&&b.xc.clear(),a.Iw=a.Rk===Ch&&c.Wt.D(c.va)?!0:!1,c.T("InitialAnimationStarting",a));d&&!a.Ih||0===b.xc.count?(a.Yd.clear(),a.Eb=!1,b.xc.clear(),Dh(b,c),a.Qk=!1,c.R()):(a.Yd.clear(),c.og=!1,d=b.xc.get(c),c.autoScale!==Eh&&null!==d&&(delete d.start.scale,delete d.end.scale), +sa.requestAnimationFrame(function(){!1===a.Eb||b.ec||(c.Te("temporaryPixelRatio")&&Te(c),Fh(c),a.Eb=!1,b.start(),b.ec&&(Gh(a),c.ab(),Hh(b,0),Nf(c,!0),Ih(a),c.T("AnimationStarting",a)))}))}}function Jh(a){return a.Yd.contains("Trigger")&&1===a.Yd.count}function Kh(a,b,c,d){a.isTicking||Jh(a)||b instanceof R&&(null!==b.fromNode||null!==b.toNode)||a.be.add(b,"position",c,d,!1)}t=th.prototype;t.ss=function(a){return this.be.ss(a)};t.Yu=function(a){return this.be.Yu(a)}; +function Lh(a,b){function c(){0<e.Er.count&&(d.addAll(e.Er),e.Er.clear(),e.ec=!0);if(!1!==e.ec&&0!==d.count){e.hu.addAll(d);for(var a=e.hu.iterator;a.next();){var b=a.value;if(!1!==b.ec){a:if(0<b.Al.count)var h=!0;else{for(h=b.xc.iterator;h.next();){var k=h.key;if(k instanceof O&&null!==k.diagram||k instanceof P){h=!0;break a}}h=!1}h?Mh(b,!1):b.Zk=!0}}e.hu.clear();!1!==e.ec&&(Gh(e),Nf(e.H),Ih(e));sa.requestAnimationFrame(c)}}var d=a.Li,e=a;a.ec?a.Er.add(b):(a.ec=!0,d.add(b),sa.requestAnimationFrame(function(){c()}))} +function Nh(a){for(a=a.Li.iterator;a.next();)a.value.Zk=!1}function Gh(a){if(!a.kq){var b=a.H;a.Gw=b.skipsUndoManager;a.Vv=b.skipsModelSourceBindings;b.skipsUndoManager=!0;b.skipsModelSourceBindings=!0;a.kq=!0}}function Ih(a){var b=a.H;b.skipsUndoManager=a.Gw;b.skipsModelSourceBindings=a.Vv;a.kq=!1} +t.Cc=function(a){var b=this.be;!0===this.Eb&&(this.Qk=this.Eb=!1,this.Yd.clear(),0<b.xc.count&&this.H.Sb());if(this.ec){if(b.Il(!0),b.xc.clear(),Dh(b,null),!0===a)for(a=this.Li.Ka(),b=0;b<a.length;b++)a[b].Il(!0)}else b.xc.clear(),Dh(b,this.H)};t.Il=function(a){a===this.defaultAnimation&&this.defaultAnimation.xc.clear();this.Li.remove(a);0===this.Li.count&&(this.ec=!1,this.H.Sb());a===this.defaultAnimation&&(this.defaultAnimation.xc.clear(),this.H.T("AnimationFinished",this))}; +t.Kj=function(a,b){this.Eb&&(this.Yd.contains("Expand Tree")||this.Yd.contains("Expand SubGraph"))&&(this.be.Kj(a,b),Oh(this,a))};t.Ij=function(a,b){this.Eb&&(this.Yd.contains("Collapse Tree")||this.Yd.contains("Collapse SubGraph"))&&(this.be.Ij(a,b),Ph(this.be,b,"position",b.position,b.position),Oh(this,a))};function Qh(a,b,c){!a.Eb||b.D(c)||Jh(a)||(a.H.xi||(b=c.copy()),Ph(a.be,a.H,"position",b,c))} +function Oh(a,b){for(b=b.findLinksConnected();b.next();){var c=b.value;c.sf=c.points.copy();a.ql.add(c)}}function Rh(a,b,c,d,e){null===a&&(a=[0,0,0,0]);null===b&&(b=[0,0,0,0]);var f=a[0],g=a[1],h=a[2];a=a[3];var k=b[0],l=b[1],m=b[2];b=b[3];if(0===h||100===h)f=k,g=l;else if(0===m||100===m)k=f,l=g;180<Math.abs(k-f)&&(k>f?f+=360:k+=360);f=e(c,f,k-f,d)%360;g=e(c,g,l-g,d);h=e(c,h,m-h,d);c=e(c,a,b-a,d);return"hsla("+f+", "+g+"%, "+h+"%, "+c+")"} +function vh(){function a(a,b,e,f,g,h){a.position=new K(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))}var b=new yb;b.add("position:diagram",a);b.add("position",a);b.add("position:part",function(a,b,e,f,g,h){g<h?a.hm(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h),!1):a.position=new K(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))});b.add("location",function(a,b,e,f,g,h){g<h?a.hm(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h),!0):a.location=new K(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))});b.add("position:placeholder",function(a,b,e,f, +g,h){g<h?a.hm(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h),!1):a.position=new K(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))});b.add("position:nodeCollapse",function(a,b,e,f,g,h){var c=a.actualBounds,d=e.actualBounds;e=d.x+d.width/2-c.width/2;c=d.y+d.height/2-c.height/2;g<h?a.hm(f(g,b.x,e-b.x,h),f(g,b.y,c-b.y,h),!1):a.position=new K(f(g,b.x,e-b.x,h),f(g,b.y,c-b.y,h))});b.add("desiredSize",function(a,b,e,f,g,h){a.desiredSize=new M(f(g,b.width,e.width-b.width,h),f(g,b.height,e.height-b.height,h))});b.add("width", +function(a,b,e,f,g,h){a.width=f(g,b,e-b,h)});b.add("height",function(a,b,e,f,g,h){a.height=f(g,b,e-b,h)});b.add("fill",function(a,b,e,f,g,h){a.fill=Rh(b,e,g,h,f)});b.add("stroke",function(a,b,e,f,g,h){a.stroke=Rh(b,e,g,h,f)});b.add("strokeWidth",function(a,b,e,f,g,h){a.strokeWidth=f(g,b,e-b,h)});b.add("strokeDashOffset",function(a,b,e,f,g,h){a.strokeDashOffset=f(g,b,e-b,h)});b.add("background",function(a,b,e,f,g,h){a.background=Rh(b,e,g,h,f)});b.add("areaBackground",function(a,b,e,f,g,h){a.areaBackground= +Rh(b,e,g,h,f)});b.add("opacity",function(a,b,e,f,g,h){a.opacity=f(g,b,e-b,h)});b.add("scale",function(a,b,e,f,g,h){a.scale=f(g,b,e-b,h)});b.add("angle",function(a,b,e,f,g,h){a.angle=f(g,b,e-b,h)});bi=b} +oa.Object.defineProperties(th.prototype,{animationReasons:{configurable:!0,get:function(){return this.Yd}},isEnabled:{configurable:!0,get:function(){return this.Gd},set:function(a){A(a,"boolean",th,"isEnabled");(this.Gd=a)&&this.Li.each(function(a){a.isAnimating||Infinity!==a.runCount||a.start()})}},duration:{configurable:!0,get:function(){return this.Gg},set:function(a){A(a,"number",th,"duration");1>a&&Ba(a,">= 1",th,"duration");this.Gg=a}},isAnimating:{configurable:!0, +enumerable:!0,get:function(){return this.ec}},isTicking:{configurable:!0,get:function(){return this.kq}},isInitial:{configurable:!0,get:function(){return this.Ih},set:function(a){A(a,"boolean",th,"isInitial");this.Ih=a}},defaultAnimation:{configurable:!0,get:function(){return this.be}},activeAnimations:{configurable:!0,get:function(){return this.Li}},initialAnimationStyle:{configurable:!0,get:function(){return this.Rk},set:function(a){G&& +ab(a,th,th,"initialAnimationStyle");this.Rk=a}}});th.prototype.stopAnimation=th.prototype.Cc;var bi=null,uh=!1,wh=new F(th,"Default",1),Ch=new F(th,"AnimateLocations",2),Bh=new F(th,"None",3);th.className="AnimationManager";th.defineAnimationEffect=function(a,b){uh||(vh(),uh=!0);bi.add(a,b)};th.Default=wh;th.AnimateLocations=Ch;th.None=Bh; +function xh(a){this.nu=this.Fw=this.Xd=this.H=null;this.Zk=this.ec=this.j=!1;this.Xm=this.Nd=0;this.Cp=this.dt=ci;this.Yk=this.Wn=!1;this.Vt=1;this.Tt=0;this.Ed=this.Gg=NaN;this.Zv=0;this.Ym=null;this.m=zb;this.xc=new yb;this.Lt=new yb;this.Al=new I;this.Mt=new I;this.Wv=di;a&&Object.assign(this,a)}xh.prototype.suspend=function(){this.Zk=!0};xh.prototype.advanceTo=function(a,b){b&&(this.Zk=!1);this.Wn&&a>=this.Ed&&(this.Yk=!0,a-=this.Ed);this.Zv=a;Mh(this,!0);Gh(this.Xd);Nf(this.H);Ih(this.Xd);this.H.redraw()}; +function Dh(a,b){a.Lt.clear();a.Yk=!1;a.Tt=0;a.Ed=NaN;0<a.Al.count&&a.Al.clear();0<a.Mt.count&&a.Mt.clear();if(null!==b)for(a=b.links;a.next();)a.value.sf=null}t=xh.prototype; +t.start=function(){if(0===this.xc.count||this.ec)return this;for(var a=this.H,b=this.xc.iterator;b.next();){var c=b.value.end,d=b.key;if(c["position:placeholder"]){var e=d.findVisibleNode();if(e instanceof wf&&null!==e.placeholder){var f=e.placeholder;e=f.oa(Fc);f=f.padding;e.x+=f.left;e.y+=f.top;c["position:placeholder"]=e}}null===a&&(d instanceof P?a=d:d instanceof O&&(a=d.diagram))}if(null!==a)this.H=a,this.Xd=a.animationManager;else return this;b=this.Xd;if(!1===b.isEnabled)return this;this.Ed= +isNaN(this.Gg)?b.duration:this.Gg;this.Cp=this.dt;b.Qk&&b.Rk===wh&&this===b.defaultAnimation&&(this.Cp=ei,this.Ed=isNaN(this.Gg)?600===b.duration?900:b.duration:this.Gg);this.Wv=a.scrollMode;this.isViewportUnconstrained&&(a.Aj=fi);Gh(b);this.Al.each(function(b){b.data=null;a.add(b)});Ih(b);this.ec=!0;this.Nd=+new Date;this.Xm=this.Nd+this.Ed;Lh(b,this);return this}; +t.Fy=function(a,b){if(!a.Zc())return this;G&&(void 0===b&&v("addTemporaryPart: Required Diagram argument missing"),a.diagram===b&&v("addTemporaryPart: Part already in Diagram, did you mean to pass in a copy?"),null!==this.H&&this.H!==b&&v("addTemporaryPart: A different Diagram is already associated with this Animation: "+this.H.toString()));this.Al.add(a);this.H=b;return this}; +t.add=function(a,b,c,d,e){if("position"===b&&c.D(d))return this;null===this.H&&(a instanceof P?this.H=a:a instanceof O&&null!==a.diagram&&(this.H=a.diagram));if(a instanceof S){if(!a.isAnimated)return this;"position"===b&&(b="position:part")}Ph(this,a,b,c,d,e);return this}; +function Ph(a,b,c,d,e,f){var g=a.xc;b instanceof P&&"position"===c&&(c="position:diagram");if("fill"===c||"stroke"===c||"background"===c||"areaBackground"===c)gi(d),hi(),d=[ii.j,ii.v,ii.m,ii.G],gi(e),hi(),e=[ii.j,ii.v,ii.m,ii.G];if(g.contains(b)){var h=g.L(b);var k=h.start;var l=h.end;void 0===k[c]&&(k[c]=ji(d));l[c]=ji(e)}else k={},l={},k[c]=ji(d),l[c]=ji(e),h=k.position,b instanceof O&&h instanceof K&&!h.u()&&b.diagram.animationManager.Yd.contains("Expand SubGraph")&&h.assign(l.position),h=new ki(k, +l,f),g.add(b,h);g=k[c];g instanceof K&&!g.u()&&g.assign(a.m);f&&0===c.indexOf("position:")&&b instanceof S?h.Ju.location=ji(b.location):f&&(h.Ju[c]=ji(d))}function ji(a){return a instanceof K?a.copy():a instanceof Hb?a.copy():a}t.ss=function(a){if(!this.ec)return!1;a=this.xc.L(a);return null!==a&&a.jv};t.Yu=function(a){if(!this.ec)return!1;a=this.xc.L(a);return null!==a&&(a.start.position||a.start.location)}; +function Mh(a,b){if(!a.Zk||b){var c=a.Xd;if(!1!==a.ec){var d=+new Date,e=d>a.Xm?a.Ed:d-a.Nd;b&&(e=a.Zv,e<a.Ed?(a.Nd=+new Date-e,a.Xm=a.Nd+a.Ed):e=a.Ed);Gh(c);Hh(a,e);Nf(a.H,!0);Ih(c);d>a.Xm&&(a.Wn&&!a.Yk?(a.Nd=+new Date,a.Xm=a.Nd+a.Ed,a.Yk=!0):a.Il(!1))}}} +function Hh(a,b){for(var c=a.Ed,d=a.xc.iterator,e=a.Yk;d.next();){var f=d.key;if(!(f instanceof O&&null===f.diagram)){var g=d.value,h=e?g.end:g.start;g=e?g.start:g.end;var k=bi,l;for(l in g)"position"===l&&(g["position:placeholder"]||g["position:nodeCollapse"])||null===k.get(l)||k.get(l)(f,h[l],g[l],a.Cp,b,c,a)}}}t.stop=function(){if(!this.ec)return this;this.Il(!0);return this}; +t.Il=function(a){null!==this.nu&&this.nu.Yn.remove(this.Fw);if(this.ec){var b=this.H,c=this.Xd;this.Zk=this.ec=c.Qk=!1;Gh(c);for(var d=this.xc,e=this.Al.iterator;e.next();)b.remove(e.value);for(e=this.Mt.iterator;e.next();)e.value.w();e=this.Wn;d=d.iterator;for(var f=bi;d.next();){var g=d.key,h=d.value,k=e?h.end:h.start,l=e?h.start:h.end,m=h.Ju,n;for(n in l)if(null!==f.get(n)){var p=n;!h.Bu||"position:nodeCollapse"!==p&&"position:placeholder"!==p||(p="position");f.get(p)(g,k[n],void 0!==m[n]?m[n]: +h.Bu?k[n]:l[n],this.Cp,this.Ed,this.Ed,this)}h.Bu&&void 0!==m.location&&g instanceof S&&(g.location=m.location);h.jv&&g instanceof S&&g.Zb(!1)}b.ns.clear();mf(b,!1);b.ab();b.R();Nf(b,!0);if(c.defaultAnimation===this){for(n=c.ql.iterator;n.next();)e=n.value,null!==e.sf&&(e.points=e.sf,e.sf=null);c.ql.clear()}Nf(b,!0);this.isViewportUnconstrained&&(b.scrollMode=this.Wv);Ih(c);this.Tt++;!a&&this.Vt>this.Tt?(this.Yk=!1,this.start()):(this.Ym&&this.Ym(this),Dh(this,null),c.Il(this),b.Sb())}}; +t.Kj=function(a,b){var c=b.actualBounds,d=null;b instanceof wf&&(d=b.placeholder);null!==d?(c=d.oa(Fc),d=d.padding,c.x+=d.left,c.y+=d.top,this.add(a,"position",c,a.position,!1)):this.add(a,"position",new K(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.add(a,"scale",.01,a.scale,!1);if(a instanceof wf)for(a=a.memberParts;a.next();)d=a.value,d instanceof T&&this.Kj(d,b)}; +t.Ij=function(a,b){if(a.isVisible()){var c=null;b instanceof wf&&(c=b.placeholder);null!==c?this.add(a,"position:placeholder",a.position,c,!0):this.add(a,"position:nodeCollapse",a.position,b,!0);this.add(a,"scale",a.scale,.01,!0);c=this.xc;c.contains(a)&&(c.L(a).jv=!0);if(a instanceof wf)for(a=a.memberParts;a.next();)c=a.value,c instanceof T&&this.Ij(c,b)}};t.Fz=function(a){var b=this.Lt.get(a);null===b&&(b={},this.Lt.add(a,b));return b}; +oa.Object.defineProperties(xh.prototype,{duration:{configurable:!0,get:function(){return this.Gg},set:function(a){A(a,"number",xh,"duration");1>a&&Ba(a,">= 1",xh,"duration");this.Gg=a}},reversible:{configurable:!0,get:function(){return this.Wn},set:function(a){this.Wn=a}},runCount:{configurable:!0,get:function(){return this.Vt},set:function(a){0<a?this.Vt=a:v("Animation.runCount value must be a positive integer.")}},finished:{configurable:!0, +get:function(){return this.Ym},set:function(a){this.Ym!==a&&(null!==a&&A(a,"function",xh,"finished"),this.Ym=a)}},easing:{configurable:!0,get:function(){return this.dt},set:function(a){this.dt=a}},isViewportUnconstrained:{configurable:!0,get:function(){return this.j},set:function(a){this.j=a}},isAnimating:{configurable:!0,get:function(){return this.ec}}});xh.prototype.getTemporaryState=xh.prototype.Fz;xh.prototype.stop=xh.prototype.stop;xh.prototype.add=xh.prototype.add; +xh.prototype.addTemporaryPart=xh.prototype.Fy;function ci(a,b,c,d){a/=d/2;return 1>a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function ei(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}xh.className="Animation";xh.EaseLinear=function(a,b,c,d){return c*a/d+b};xh.EaseInOutQuad=ci;xh.EaseInQuad=function(a,b,c,d){return c*(a/=d)*a+b};xh.EaseOutQuad=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};xh.EaseInExpo=function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b};xh.EaseOutExpo=ei; +function ki(a,b,c){this.start=a;this.end=b;this.Ju={};this.Bu=c;this.jv=!1}ki.className="AnimationState";function li(a,b,c){this.yd=null;this.rf=a;this.io=c||mi;this.vk=null;void 0!==b&&(this.vk=b,void 0===c&&(this.io=ni))}li.prototype.copy=function(){var a=new li(this.rf);a.io=this.io;var b=this.vk;if(null!==b){var c={};void 0!==b.duration&&(c.duration=b.duration);void 0!==b.finished&&(c.finished=b.finished);void 0!==b.easing&&(c.easing=b.easing);a.vk=c}return a}; +function oi(a,b){a=a.vk;null!==a&&(a.duration&&(b.duration=a.duration),a.finished&&(b.finished=a.finished),a.easing&&(b.easing=a.easing))} +oa.Object.defineProperties(li.prototype,{propertyName:{configurable:!0,get:function(){return this.rf},set:function(a){this.rf=a}},animationSettings:{configurable:!0,get:function(){return this.vk},set:function(a){this.vk=a}},startCondition:{configurable:!0,get:function(){return this.io},set:function(a){G&&ab(a,li,li,"startCondition");this.io=a}}});var mi=new F(li,"Default",1),ni=new F(li,"Immediate",2),pi=new F(li,"Bundled",3);li.className="AnimationTrigger"; +li.Default=mi;li.Immediate=ni;li.Bundled=pi;function qi(a){Za(this);this.H=null;this.Ra=new H;this.Ca="";this.yb=1;this.m=!1;this.j=this.Zh=this.v=this.Vi=this.Ui=this.Ti=this.Si=this.Qi=this.Ri=this.Pi=this.Xi=this.Oi=this.Wi=this.Ni=this.Mi=!0;this.Nn=[];a&&Object.assign(this,a)}t=qi.prototype;t.clear=function(){this.Ra.clear();this.Nn.length=0};t.Ye=function(a){this.H=a}; +t.toString=function(a){void 0===a&&(a=0);var b='Layer "'+this.name+'"';if(0>=a)return b;for(var c=0,d=0,e=0,f=0,g=0,h=this.Ra.iterator;h.next();){var k=h.value;k instanceof wf?e++:k instanceof T?d++:k instanceof R?f++:k instanceof Ce?g++:c++}h="";0<c&&(h+=c+" Parts ");0<d&&(h+=d+" Nodes ");0<e&&(h+=e+" Groups ");0<f&&(h+=f+" Links ");0<g&&(h+=g+" Adornments ");if(1<a)for(a=this.Ra.iterator;a.next();)c=a.value,h+="\n "+c.toString(),d=c.data,null!==d&&lb(d)&&(h+=" #"+lb(d)),c instanceof T?h+=" "+ +Ra(d):c instanceof R&&(h+=" "+Ra(c.fromNode)+" "+Ra(c.toNode));return b+" "+this.Ra.count+": "+h}; +t.jc=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);if(!1===this.Zh)return null;G&&!a.u()&&v("findObjectAt: Point must have a real value, not: "+a.toString());var d=!1;null!==this.diagram&&this.diagram.viewportBounds.ga(a)&&(d=!0);for(var e=K.alloc(),f=this.Ra.s,g=f.length;g--;){var h=f[g];if((!0!==d||!1!==vg(h))&&h.isVisible()&&(e.assign(a),Kb(e,h.oe),h=h.jc(e,b,c),null!==h&&(null!==b&&(h=b(h)),null!==h&&(null===c||c(h)))))return K.free(e),h}K.free(e);return null}; +t.pi=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof H||d instanceof I||(d=new I);if(!1===this.Zh)return d;G&&!a.u()&&v("findObjectsAt: Point must have a real value, not: "+a.toString());var e=!1;null!==this.diagram&&this.diagram.viewportBounds.ga(a)&&(e=!0);for(var f=K.alloc(),g=this.Ra.s,h=g.length;h--;){var k=g[h];if((!0!==e||!1!==vg(k))&&k.isVisible()){f.assign(a);Kb(f,k.oe);var l=k;k.pi(f,b,c,d)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||d.add(l))}}K.free(f);return d}; +t.Ff=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof H||e instanceof I||(e=new I);if(!1===this.Zh)return e;G&&!a.u()&&v("findObjectsIn: Rect must have a real value, not: "+a.toString());var f=!1;null!==this.diagram&&this.diagram.viewportBounds.Re(a)&&(f=!0);for(var g=this.Ra.s,h=g.length;h--;){var k=g[h];if((!0!==f||!1!==vg(k))&&k.isVisible()){var l=k;k.Ff(a,b,c,d,e)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||e.add(l))}}return e}; +t.Ou=function(a,b,c,d,e,f,g){if(!1===this.Zh)return e;for(var h=this.Ra.s,k=h.length;k--;){var l=h[k];if((!0!==g||!1!==vg(l))&&f(l)&&l.isVisible()){var m=l;l.Ff(a,b,c,d,e)&&(null!==b&&(m=b(m)),null===m||null!==c&&!c(m)||e.add(m))}}return e}; +t.tg=function(a,b,c,d,e,f){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof H||e instanceof I)f=e;e=!0}f instanceof H||f instanceof I||(f=new I);if(!1===this.Zh)return f;G&&!a.u()&&v("findObjectsNear: Point must have a real value, not: "+a.toString());var g=!1;null!==this.diagram&&this.diagram.viewportBounds.ga(a)&&(g=!0);for(var h=K.alloc(),k=K.alloc(),l=this.Ra.s,m=l.length;m--;){var n=l[m];if((!0!==g||!1!==vg(n))&&n.isVisible()){h.assign(a);Kb(h,n.oe); +k.h(a.x+b,a.y);Kb(k,n.oe);var p=n;n.tg(h,k,c,d,e,f)&&(null!==c&&(p=c(p)),null===p||null!==d&&!d(p)||f.add(p))}}K.free(h);K.free(k);return f}; +t.Vd=function(a,b){if(this.visible){var c=this.Ra.s,d=c.length;if(0!==d){a=Na();for(var e=Na(),f=0;f<d;f++){var g=c[f];g.ow=f;if(g instanceof R){if(!1===g.Dd)continue}else if(g instanceof Ce&&null!==g.adornedPart)continue;var h=g.actualBounds;g.isVisible()&&ic(h,b)?(g.Vd(!0),a.push(g)):(g.Vd(!1),null!==g.adornments&&0<g.adornments.count&&e.push(g))}for(b=0;b<a.length;b++)for(c=a[b],ri(c),c=c.adornments;c.next();)d=c.value,d.measure(Infinity,Infinity),d.arrange(),d.Vd(!0);for(b=0;b<e.length;b++)ri(e[b]); +Pa(a);Pa(e)}}};function si(a,b){var c=1;1!==a.yb&&(c=b.globalAlpha,b.globalAlpha=c*a.yb);return c}t.zc=function(a,b,c){if(this.visible&&0!==this.yb&&(void 0===c&&(c=!0),c||!this.isTemporary)){c=this.Ra.s;var d=c.length;if(0!==d){var e=si(this,a),f=this.Nn;f.length=0;for(var g=b.scale,h=M.alloc(),k=0;k<d;k++)this.li(a,c[k],b,f,g,h,!0);M.free(h);a.globalAlpha=e}}}; +t.li=function(a,b,c,d,e,f,g){if(!g||vg(b)){if(null!==d&&b instanceof R&&(b.isOrthogonal&&d.push(b),!1===b.Dd))return;g=!1;for(d=b.containingGroup;null!==d;)g?null!==d.pb&&f.zx(d.pb):null!==d.pb&&(g=!0,f.assign(d.pb)),d=d.containingGroup;var h=b.actualBounds;d=!1;if(g&&b.isVisible()){if(!f.Yc(h))return;d=!f.Re(h)}d&&(a.save(),a.beginPath(),a.rect(f.x,f.y,f.width,f.height),a.clip());h.width*e>c.Aq||h.height*e>c.Aq?b.zc(a,c):(e=b.actualBounds,f=b.naturalBounds,0===e.width||0===e.height||isNaN(e.x)|| +isNaN(e.y)||!b.isVisible()||(c=b.transform,null!==b.areaBackground&&(ti(b,a,b.areaBackground,!0,!0,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null===b.areaBackground&&null===b.background&&(ti(b,a,"rgba(0,0,0,0.3)",!0,!1,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null!==b.background&&(a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),ti(b,a,b.background,!0,!1,f,e),a.fillRect(0,0,f.width/2,f.height/2),c.js()||(b=1/(c.m11*c.m22-c.m12*c.m21),a.transform(c.m22*b,-c.m12*b,-c.m21*b,c.m11*b,b*(c.m21*c.dy-c.m22* +c.dx),b*(c.m12*c.dx-c.m11*c.dy))))));d&&(a.restore(),a.Uc(!0))}};t.g=function(a,b,c,d,e){var f=this.diagram;null!==f&&f.ib(qe,a,this,b,c,d,e)};t.vi=function(a,b,c){var d=this.Ra;b.Mh=this;if(a>=d.count)a=d.count;else if(d.N(a)===b)return-1;d.Hb(a,b);b.Ko(c);d=this.diagram;null!==d&&(c?d.R():d.vi(b));ui(this,a,b);return a}; +t.rc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.rc(a,b,c);var d=this.Ra;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.N(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.Lo(c);d.sb(a);d=this.diagram;null!==d&&(c?d.R():d.rc(b));b.Mh=null;return a}; +function ui(a,b,c){b=vi(a,b,c);if(c instanceof wf&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Ra.s,f=e.length,g=0;g<f;g++){var h=e[g];if(h===c&&(b=g,0<=d))break;if(0>d&&h.containingGroup===c&&(d=g,0<=b))break}!(0>d)&&d<b&&(e=a.Ra,e.sb(b),e.Hb(d,c))}c=c.containingGroup;null!==c&&ui(a,-1,c)}} +function vi(a,b,c){var d=c.zOrder;if(isNaN(d))return b;a=a.Ra;var e=a.count;if(1>=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var f=b-1,g=NaN;0<=f;){g=a.N(f).zOrder;if(!isNaN(g))break;f--}for(var h=b+1,k=NaN;h<e;){k=a.N(h).zOrder;if(!isNaN(k))break;h++}if(!isNaN(g)&&g>d)for(;;){if(-1===f||g<=d){f++;if(f===b)break;a.sb(b);a.Hb(f,c);return f}for(g=NaN;0<=--f&&(g=a.N(f).zOrder,isNaN(g)););}else if(!isNaN(k)&&k<d)for(;;){if(h===e||k>=d){h--;if(h===b)break;a.sb(b);a.Hb(h,c);return h}for(k=NaN;++h< +e&&(k=a.N(h).zOrder,isNaN(k)););}return b} +oa.Object.defineProperties(qi.prototype,{parts:{configurable:!0,get:function(){return this.Ra.iterator}},partsBackwards:{configurable:!0,get:function(){return this.Ra.iteratorBackwards}},diagram:{configurable:!0,get:function(){return this.H}},name:{configurable:!0,get:function(){return this.Ca},set:function(a){A(a,"string",qi,"name");var b=this.Ca;if(b!==a){var c=this.diagram;if(null!==c)for(""===b&&v("Cannot rename default Layer to: "+a),c= +c.layers;c.next();)c.value.name===a&&v("Layer.name is already present in this diagram: "+a);this.Ca=a;this.g("name",b,a);for(a=this.Ra.iterator;a.next();)a.value.layerName=this.Ca}}},opacity:{configurable:!0,get:function(){return this.yb},set:function(a){var b=this.yb;b!==a&&(A(a,"number",qi,"opacity"),(0>a||1<a)&&Ba(a,"0 <= value <= 1",qi,"opacity"),this.yb=a,this.g("opacity",b,a),a=this.diagram,null!==a&&a.R())}},isTemporary:{configurable:!0,get:function(){return this.m}, +set:function(a){var b=this.m;if(b!==a){A(a,"boolean",qi,"isTemporary");if(this.m=a)this.isInDocumentBounds=!1;this.g("isTemporary",b,a)}}},visible:{configurable:!0,get:function(){return this.v},set:function(a){var b=this.v;if(b!==a){A(a,"boolean",qi,"visible");this.v=a;this.g("visible",b,a);for(b=this.Ra.iterator;b.next();)b.value.Zb(a);a=this.diagram;null!==a&&a.R()}}},pickable:{configurable:!0,get:function(){return this.Zh},set:function(a){var b=this.Zh;b!==a&&(A(a,"boolean", +qi,"pickable"),this.Zh=a,this.g("pickable",b,a))}},isInDocumentBounds:{configurable:!0,get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a,null!==this.diagram&&this.diagram.ab())}},allowCopy:{configurable:!0,get:function(){return this.Mi},set:function(a){var b=this.Mi;b!==a&&(A(a,"boolean",qi,"allowCopy"),this.Mi=a,this.g("allowCopy",b,a))}},allowDelete:{configurable:!0,get:function(){return this.Ni},set:function(a){var b=this.Ni;b!==a&&(A(a, +"boolean",qi,"allowDelete"),this.Ni=a,this.g("allowDelete",b,a))}},allowTextEdit:{configurable:!0,get:function(){return this.Wi},set:function(a){var b=this.Wi;b!==a&&(A(a,"boolean",qi,"allowTextEdit"),this.Wi=a,this.g("allowTextEdit",b,a))}},allowGroup:{configurable:!0,get:function(){return this.Oi},set:function(a){var b=this.Oi;b!==a&&(A(a,"boolean",qi,"allowGroup"),this.Oi=a,this.g("allowGroup",b,a))}},allowUngroup:{configurable:!0,get:function(){return this.Xi}, +set:function(a){var b=this.Xi;b!==a&&(A(a,"boolean",qi,"allowUngroup"),this.Xi=a,this.g("allowUngroup",b,a))}},allowLink:{configurable:!0,get:function(){return this.Pi},set:function(a){var b=this.Pi;b!==a&&(A(a,"boolean",qi,"allowLink"),this.Pi=a,this.g("allowLink",b,a))}},allowRelink:{configurable:!0,get:function(){return this.Ri},set:function(a){var b=this.Ri;b!==a&&(A(a,"boolean",qi,"allowRelink"),this.Ri=a,this.g("allowRelink",b,a))}},allowMove:{configurable:!0, +get:function(){return this.Qi},set:function(a){var b=this.Qi;b!==a&&(A(a,"boolean",qi,"allowMove"),this.Qi=a,this.g("allowMove",b,a))}},allowReshape:{configurable:!0,get:function(){return this.Si},set:function(a){var b=this.Si;b!==a&&(A(a,"boolean",qi,"allowReshape"),this.Si=a,this.g("allowReshape",b,a))}},allowResize:{configurable:!0,get:function(){return this.Ti},set:function(a){var b=this.Ti;b!==a&&(A(a,"boolean",qi,"allowResize"),this.Ti=a,this.g("allowResize",b,a))}}, +allowRotate:{configurable:!0,get:function(){return this.Ui},set:function(a){var b=this.Ui;b!==a&&(A(a,"boolean",qi,"allowRotate"),this.Ui=a,this.g("allowRotate",b,a))}},allowSelect:{configurable:!0,get:function(){return this.Vi},set:function(a){var b=this.Vi;b!==a&&(A(a,"boolean",qi,"allowSelect"),this.Vi=a,this.g("allowSelect",b,a))}}});qi.prototype.findObjectsNear=qi.prototype.tg;qi.prototype.findObjectsIn=qi.prototype.Ff;qi.prototype.findObjectsAt=qi.prototype.pi; +qi.prototype.findObjectAt=qi.prototype.jc;qi.className="Layer"; +function P(a,b){wi||(xi(),wi=!0);Za(this);ye=this;this.Bb=!0;this.Qa=null;this.Ga=this.Ha=0;this.Na=null;if(ah){var c=this,d=function(){c.removeEventListener(sa.document,"DOMContentLoaded",d,!1);c.setRTL()};null!==sa.document.body?this.setRTL():c.addEventListener(sa.document,"DOMContentLoaded",d,!1)}this.pl=null;yi.add("Model",zi);var e=this;this.Ib=function(a){var b=e.partManager;if(a.model===b.diagram.model&&b.diagram.ca){b.diagram.ca=!1;try{var c=a.change;""===a.modelChange&&c===qe&&b.updateDataBindings(a.object, +a.propertyName)}finally{b.diagram.ca=!0}}};this.Nc=function(a){e.partManager.doModelChanged(a)};this.$t=this.cu=null;Ai(this);this.model=Bi();this.Xg=!0;Ci(this);this.layout=new Di;this.Xg=!1;this.jk=this.kk=this.ik=this.hk=this.aA=this.dk=this.Gv=null;this.Wo=function(){};this.preventDefault=null;this.kn=!1;this.Hh=new Ei;void 0!==a&&("string"===typeof a||sa.Element&&a instanceof Element?Fi(this,a):b=a);this.Bb=!1;b&&this.im(b);return this}var Gi,ye; +function Ai(a){a.Xd=new th;a.Xd.Ye(a);a.Fb=17;a.yw=!1;a.mn=!1;a.Ut="default";a.$a=new H;a.qy=new yb;a.Rx();a.Qx();a.yb=1;a.va=(new K(NaN,NaN)).freeze();a.Wt=new K(NaN,NaN);a.Ea=1;a.Gp=1;a.ot=(new K(NaN,NaN)).freeze();a.pt=NaN;a.Gt=1E-4;a.Ct=100;a.Gb=new Jb;a.ru=(new K(NaN,NaN)).freeze();a.jt=(new M(NaN,NaN,NaN,NaN)).freeze();a.zj=(new gc(0,0,0,0)).freeze();a.Aj=di;a.fu=!1;a.Rt=null;a.Yt=null;a.yh=Eh;a.Ak=hd;a.Ig=Eh;a.eq=hd;a.nt=Fc;a.qt=Fc;a.hd=!0;a.hn=!1;a.De=new I;a.Eh=new yb;a.Sm=!0;a.lp=250;a.wk= +-1;a.np=(new gc(16,16,16,16)).freeze();a.og=!1;a.Kk=!1;a.Zm=!0;a.Sp=new me;a.Sp.diagram=a;a.Sg=new me;a.Sg.diagram=a;a.kj=new me;a.kj.diagram=a;a.Cg=null;a.pf=null;a.iu=!1;Hi(a);a.fi=new I;a.xt=!0;a.mu=Ii;a.iw=!1;a.ou=Sf;a.Xs="auto";a.Fp="auto";a.zh=null;a.Fh=null;a.Bh=null;a.Vh=null;a.Th=null;a.Sh=null;a.It=null;a.Qh=null;a.mt=!1;a.Rh=null;a.Uh=null;a.ei=null;a.Ch=null;a.Jt=!1;a.Qt={};a.ml=[null,null];a.Xg=!1;a.Aw=!1;a.gu=!1;a.$s=!1;a.kw=!0;a.jd=!1;a.hj=!1;a.Lw=!0;a.Ce=-2;a.Qg=new yb;a.Rn=new H; +a.Jg=!1;a.Gd=!0;a.Js=!0;a.Mi=!0;a.Ni=!0;a.Ks=!1;a.Ls=!0;a.Wi=!0;a.Oi=!0;a.Xi=!0;a.Ns=!0;a.Pi=!0;a.Ri=!0;a.Qi=!0;a.Si=!0;a.Ti=!0;a.Ui=!0;a.Vi=!0;a.Os=!0;a.Qs=!0;a.jw=!1;a.Xk=!1;a.en=!0;a.fn=!0;a.Ms=!0;a.Ps=!0;a.au=16;a.eu=16;a.$q=!1;a.Zt=!1;a.du=0;a.bu=0;a.zb=(new gc(5)).freeze();a.zw=(new I).freeze();a.Dt=999999999;a.gw=(new I).freeze();a.ej=!0;a.fj=!0;a.gj=!0;a.hf=!1;a.$f=!1;a.xh=!0;a.bg=!1;a.py=new I;a.hw=new I;a.bi=null;a.Tv=new Hb(8,8);a.Uv=999;a.tw=1;a.Bw=0;a.qd={scale:1,position:new K,bounds:new M, +Vw:new Hb,Jx:new Hb,Cx:!1};a.Jw=(new M(NaN,NaN,NaN,NaN)).freeze();a.mo=(new Hb(NaN,NaN)).freeze();a.Jp=(new M(NaN,NaN,NaN,NaN)).freeze();a.yt=!1;a.Pg=new yb;var b=new T,c=new ch;c.bind(new Ji("text","",Ra));b.add(c);a.ly=b;a.Pg.add("",b);b=new T;c=new ch;c.stroke="brown";c.bind(new Ji("text","",Ra));b.add(c);a.Pg.add("Comment",b);b=new T;b.selectable=!1;b.avoidable=!1;c=new Qf;c.figure="Ellipse";c.fill="black";c.stroke=null;c.desiredSize=(new Hb(3,3)).na();b.add(c);a.Pg.add("LinkLabel",b);a.dj=new yb; +b=new wf;b.selectionObjectName="GROUPPANEL";b.type=V.Vertical;c=new ch;c.font="bold 12pt sans-serif";c.bind(new Ji("text","",Ra));b.add(c);c=new V(V.Auto);c.name="GROUPPANEL";var d=new Qf;d.figure="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new wg;d.padding=(new gc(5,5,5,5)).na();c.add(d);b.add(c);a.jy=b;a.dj.add("",b);a.Oh=new yb;b=new R;c=new Qf;c.isPanelMain=!0;b.add(c);c=new Qf;c.toArrow="Standard";c.fill="black";c.stroke=null;c.strokeWidth=0;b.add(c);a.ky=b;a.Oh.add("", +b);b=new R;c=new Qf;c.isPanelMain=!0;c.stroke="brown";b.add(c);a.Oh.add("Comment",b);b=new Ce;b.type=V.Auto;c=new Qf;c.fill=null;c.stroke="dodgerblue";c.strokeWidth=3;b.add(c);c=new wg;c.margin=(new gc(1.5,1.5,1.5,1.5)).na();b.add(c);a.Kt=b;a.lt=b;b=new Ce;b.type=V.Link;c=new Qf;c.isPanelMain=!0;c.fill=null;c.stroke="dodgerblue";c.strokeWidth=3;b.add(c);a.At=b;a.ee=null;a.aq=!1;a.Dk=null;a.partManager=new zi;a.toolManager=new Ua;a.toolManager.initializeStandardTools();a.defaultTool=a.toolManager; +a.currentTool=a.defaultTool;a.bt=null;a.Rm=new Pe;a.Nt=null;a.Ot=null;a.xr=!1;a.commandHandler=Ki();a.yr=!1;a.Up=null;a.Vp=Db;a.Hw=!1;a.qc=1;a.ci=null;a.Aq=1;a.Eq=0;a.rw=[0,0,0,0,0];a.Fq=0;a.lq=1;a.mw=0;a.nw=new K;a.yy=500;a.mp=new K;a.wt=!1}P.prototype.clear=function(){this.animationManager.Cc();this.model.clear();Li=null;Mi="";Ni(this,!1);this.Rn.clear();Oi();this.Qg.clear();this.bi=null;this.ab();this.eb();this.R()}; +function Ni(a,b){a.animationManager.Cc(!0);a.zw=(new I).freeze();a.gw=(new I).freeze();var c=a.skipsUndoManager,d=null!==a.fc&&void 0!==a.fc;d&&(a.skipsUndoManager=!0);var e=null;null!==a.ee&&(e=a.ee.part,null!==e&&a.remove(e));var f=[],g=a.$a.length;if(b){for(b=0;b<g;b++)for(var h=a.$a.s[b].parts;h.next();){var k=h.value;k!==e&&null===k.data&&f.push(k)}for(b=0;b<f.length;b++)a.remove(f[b])}for(b=0;b<g;b++)a.$a.s[b].clear();a.partManager.clear();a.De.clear();a.Eh.clear();a.fi.clear();a.Dk=null;a.Rn.clear(); +Oi();a.Qg.clear();Oa=[];null!==e&&(a.add(e),a.partManager.parts.remove(e));d&&(a.skipsUndoManager=c);return f}function Ki(){return null}P.prototype.reset=function(){this.clear();this.Bb=!0;Ai(this);Pi(this);this.Xg=!0;Ci(this);this.layout=new Di;this.Xg=!1;this.model=Bi();this.model.undoManager=new ve;this.Bb=this.kn=!1;this.R()}; +P.prototype.setRTL=function(a){a=void 0===a?this.div:a;null===a&&(a=sa.document.body);var b=wa("div");b.dir="rtl";b.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;";b.textContent="A";a.appendChild(b);var c="reverse";0<b.scrollLeft?c="default":(b.scrollLeft=1,0===b.scrollLeft&&(c="negative"));a.removeChild(b);this.Ut=c}; +P.prototype.setScrollWidth=function(a){a=void 0===a?this.div:a;null===a&&(a=sa.document.body);var b=0;if(ah){var c=Qi;b=Gi;null===c&&(c=Qi=wa("p"),c.style.width="100%",c.style.height="200px",c.style.boxSizing="content-box",b=Gi=wa("div"),b.style.position="absolute",b.style.visibility="hidden",b.style.width="200px",b.style.height="150px",b.style.boxSizing="content-box",b.appendChild(c));b.style.overflow="hidden";a.appendChild(b);var d=c.offsetWidth;b.style.overflow="scroll";c=c.offsetWidth;d===c&& +(c=b.clientWidth);a.removeChild(b);b=d-c;0!==b||Ya||(b=11)}this.Fb=b;this.yw=!0};P.prototype.ub=function(a){a.classType===P?this.autoScale=a:Ea(this,a)};P.prototype.toString=function(a){void 0===a&&(a=0);var b="";this.div&&this.div.id&&(b=this.div.id);b='Diagram "'+b+'"';if(0>=a)return b;for(var c=this.$a.iterator;c.next();)b+="\n "+c.value.toString(a-1);return b};P.prototype.addEventListener=function(a,b,c,d){a.addEventListener(b,c,{capture:d,passive:!1})}; +P.prototype.removeEventListener=function(a,b,c,d){a.removeEventListener(b,c,{capture:d})}; +function Ri(a){var b=a.Na.Xa;b instanceof HTMLCanvasElement&&(a.addEventListener(b,"pointerdown",a.hk,!1),a.addEventListener(b,"pointermove",a.ik,!1),a.addEventListener(b,"pointerup",a.kk,!1),a.addEventListener(b,"pointerout",a.jk,!1),a.addEventListener(b,"pointerenter",a.$y,!1),a.addEventListener(b,"pointerleave",a.az,!1),a.addEventListener(b,"wheel",a.dk,!1),a.addEventListener(b,"keydown",a.Rz,!1),a.addEventListener(b,"keyup",a.Sz,!1),a.addEventListener(b,"blur",a.My,!1),a.addEventListener(b,"focus", +a.Ny,!1),a.addEventListener(b,"selectstart",function(a){a.preventDefault();return!1},!1),a.addEventListener(b,"contextmenu",function(a){a.preventDefault();return!1},!1),a.addEventListener(sa,"resize",a.Gv,!1),Ya&&a.addEventListener(b,"touchstart",function(a){a.preventDefault()},!1))}function Te(a){30<a.Eq&&(a.ci=1)}function mf(a,b){null!==a.ci&&(a.ci=null,b&&a.Wo(),G&&G.hx||(a.Eq=0,a.rw=[0,0,0,0,0],a.Fq=0))} +P.prototype.computePixelRatio=function(){return null!==this.ci?this.ci:sa.devicePixelRatio||1};P.prototype.doMouseMove=function(){this.currentTool.doMouseMove()};P.prototype.doMouseDown=function(){this.currentTool.doMouseDown()};P.prototype.doMouseUp=function(){this.currentTool.doMouseUp()};P.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()};P.prototype.doKeyDown=function(){this.currentTool.doKeyDown()};P.prototype.doKeyUp=function(){this.currentTool.doKeyUp()}; +P.prototype.doFocus=function(){this.focus()};P.prototype.focus=function(){if(this.Na)if(this.scrollsPageOnFocus)this.Na.focus();else{var a=sa.scrollX||sa.pageXOffset,b=sa.scrollY||sa.pageYOffset;this.Na.focus();sa.scrollTo(a,b)}};P.prototype.Ny=function(){this.H.T("GainedFocus")};P.prototype.My=function(){this.H.T("LostFocus")}; +function Fh(a){if(null!==a.Na){var b=a.Qa;if(null!==b&&0!==b.clientWidth&&0!==b.clientHeight){a.yw||a.setScrollWidth();var c=a.$f?a.Fb:0,d=a.hf?a.Fb:0,e=a.qc;a.qc=a.computePixelRatio();a.qc!==e&&(a.hn=!0,a.Sb());if(b.clientWidth!==a.Ha+c||b.clientHeight!==a.Ga+d)a.fj=!0,a.hd=!0,b=a.layout,null!==b&&b.isViewportSized&&a.autoScale===Eh&&(a.Kk=!0,b.F()),a.jd||a.Sb()}}} +function Ci(a){var b=new qi;b.name="Background";a.Cl(b);b=new qi;b.name="";a.Cl(b);b=new qi;b.name="Foreground";a.Cl(b);b=new qi;b.name="Adornment";b.isTemporary=!0;b.isInDocumentBounds=!1;a.Cl(b);b=new qi;b.name="Tool";b.isTemporary=!0;b.isInDocumentBounds=!0;a.Cl(b);b=new qi;b.name="Grid";b.allowSelect=!1;b.pickable=!1;b.isTemporary=!0;b.isInDocumentBounds=!1;a.Ow(b,a.Vj("Background"))} +function Si(a){var b=new V(V.Grid);b.name="GRID";var c=new Qf;c.figure="LineH";c.stroke="lightgray";c.strokeWidth=.5;c.interval=1;b.add(c);c=new Qf;c.figure="LineH";c.stroke="gray";c.strokeWidth=.5;c.interval=5;b.add(c);c=new Qf;c.figure="LineH";c.stroke="gray";c.strokeWidth=1;c.interval=10;b.add(c);c=new Qf;c.figure="LineV";c.stroke="lightgray";c.strokeWidth=.5;c.interval=1;b.add(c);c=new Qf;c.figure="LineV";c.stroke="gray";c.strokeWidth=.5;c.interval=5;b.add(c);c=new Qf;c.figure="LineV";c.stroke= +"gray";c.strokeWidth=1;c.interval=10;b.add(c);c=new S;c.add(b);c.layerName="Grid";c.zOrder=0;c.isInDocumentBounds=!1;c.isAnimated=!1;c.pickable=!1;c.locationObjectName="GRID";a.add(c);a.partManager.parts.remove(c);b.visible=!1;return b}function Ti(){this.H.Zt?this.H.Zt=!1:this.H.isEnabled?this.H.ax(this):Ui(this.H)}function Vi(a){this.H.isEnabled?(this.H.du=a.target.scrollTop,this.H.bu=a.target.scrollLeft):Ui(this.H)} +P.prototype.ax=function(a){if(null!==this.Na){var b=this.cu,c=this.$t;this.$q=!0;var d=this.documentBounds,e=this.viewportBounds,f=this.zj,g=d.x-f.left,h=d.y-f.top,k=d.width+f.left+f.right,l=d.height+f.top+f.bottom,m=d.right+f.right;f=d.bottom+f.bottom;var n=e.x;d=e.y;var p=e.width,r=e.height,q=e.right,u=e.bottom;e=this.scale;var x=a.scrollLeft;if(this.mn)switch(this.Ut){case "negative":x=x+a.scrollWidth-a.clientWidth;break;case "reverse":x=a.scrollWidth-x-a.clientWidth}var y=x;p<k||r<l?(x=K.allocAt(this.position.x, +this.position.y),this.allowHorizontalScroll&&this.bu!==y&&(x.x=y/e+g,this.bu=y),this.allowVerticalScroll&&this.du!==a.scrollTop&&(x.y=a.scrollTop/e+h,this.du=a.scrollTop),this.position=x,K.free(x),this.fj=this.$q=!1):(x=K.alloc(),a.ty&&this.allowHorizontalScroll&&(g<n&&(this.position=x.h(y+g,this.position.y)),m>q&&(this.position=x.h(-(b.scrollWidth-this.Ha)+y-this.Ha/e+m,this.position.y))),a.uy&&this.allowVerticalScroll&&(h<d&&(this.position=x.h(this.position.x,a.scrollTop+h)),f>u&&(this.position= +x.h(this.position.x,-(b.scrollHeight-this.Ga)+a.scrollTop-this.Ga/e+f))),K.free(x),Wi(this),this.fj=this.$q=!1,d=this.documentBounds,e=this.viewportBounds,m=d.right,q=e.right,f=d.bottom,u=e.bottom,g=d.x,n=e.x,h=d.y,d=e.y,p>=k&&g>=n&&m<=q&&(c.style.width="1px"),r>=l&&h>=d&&f<=u&&(c.style.height="1px"))}};P.prototype.computeBounds=function(a){void 0===a&&(a=new M);zh(this);return Xi(this,a)}; +function Xi(a,b){if(a.fixedBounds.u())return b.assign(a.fixedBounds),b.so(a.zb),b;for(var c=!0,d=a.$a.s,e=d.length,f=0;f<e;f++){var g=d[f];if(g.visible&&g.isInDocumentBounds){g=g.Ra.s;for(var h=g.length,k=0;k<h;k++){var l=g[k];l.isInDocumentBounds&&l.isVisible()&&(l=l.actualBounds,l.u()&&(c?(c=!1,b.assign(l)):b.cd(l)))}}}c&&b.h(0,0,0,0);b.so(a.zb);return b} +P.prototype.computePartsBounds=function(a,b){void 0===b&&(b=!1);var c=null;if(Ha(a))for(var d=0;d<a.length;d++){var e=a[d];!b&&e instanceof R||(e.eb(),null===c?c=e.actualBounds.copy():c.cd(e.actualBounds))}else for(a=a.iterator;a.next();)d=a.value,!b&&d instanceof R||(d.eb(),null===c?c=d.actualBounds.copy():c.cd(d.actualBounds));return null===c?new M(NaN,NaN,0,0):c}; +function Yi(a,b){if((b||a.bg)&&!a.Bb&&null!==a.Na&&a.documentBounds.u()){if(b){var c=a.initialPosition;if(c.u()){a.position=c;return}c=K.alloc();c.Ci(a.documentBounds,a.initialDocumentSpot);var d=a.viewportBounds;d=M.allocAt(0,0,d.width,d.height);var e=K.alloc();e.Ci(d,a.initialViewportSpot);e.h(c.x-e.x,c.y-e.y);a.position=e;M.free(d);K.free(e);K.free(c)}a.Bb=!0;c=a.yh;b&&a.Ig!==Eh&&(c=a.Ig);var f=c!==Eh?hj(a,c):a.scale;c=a.va.x;d=a.va.y;e=a.Ha/f;var g=a.Ga/f,h=a.Ak,k=a.eq;b&&!h.mb()&&(k.mb()||k.Rb())&& +(h=k.Rb()?Kc:k);ij(a,a.documentBounds,e,g,h,b);b=a.scale;a.scale=f;a.Bb=!1;jj(a);kj(a,!0,!1);f=a.viewportBounds;if(!(L.C(f.J,c)&&L.C(f.K,d)&&L.C(f.fa,e)&&L.C(f.da,g)))a.onViewportBoundsChanged(new M(c,d,e,g),f,b,!1)}} +function hj(a,b){var c=a.Gp;if(null===a.Na)return c;a.eb();var d=a.documentBounds;if(!d.u())return c;var e=d.width;d=d.height;var f=a.Ha+(a.$f?a.Fb:0),g=a.Ga+(a.hf?a.Fb:0),h=f/e,k=g/d;return b===lj?(b=Math.min(k,h),b>c&&(b=c),b<a.minScale&&(b=a.minScale),b>a.maxScale&&(b=a.maxScale),b):b===mj?(b=k>h?(g-a.Fb)/d:(f-a.Fb)/e,b>c&&(b=c),b<a.minScale&&(b=a.minScale),b>a.maxScale&&(b=a.maxScale),b):a.scale} +P.prototype.zoomToFit=function(){var a=this.Aj;this.Aj=di;this.scale=hj(this,lj);a!==di&&(Yi(this,!1),ij(this,this.documentBounds,this.Ha/this.Ea,this.Ga/this.Ea,this.Ak,!1));this.Aj=a};t=P.prototype; +t.DA=function(a,b){void 0===b&&(b=lj);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===lj||b===mj)if(isNaN(c))e=this.viewportBounds.height*this.scale/d;else if(isNaN(d))e=this.viewportBounds.width*this.scale/c;else{e=this.Ha;var f=this.Ga;e=b===mj?f/d>e/c?(f-(this.hf?this.Fb:0))/d:(e-(this.$f?this.Fb:0))/c:Math.min(f/d,e/c)}this.scale=e;this.position=new K(a.x,a.y)}}; +t.Gy=function(a,b){this.eb();var c=this.documentBounds,d=this.viewportBounds;this.position=new K(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))};t.Az=function(a){if(a instanceof O){this.Up=a;var b=K.alloc();this.Vp=this.ep(a.oa(Fc,b));K.free(b)}else this.Up=null,this.Vp=Db}; +function ij(a,b,c,d,e,f){var g=K.allocAt(a.va.x,a.va.y),h=g.x,k=g.y;if(null!==a.Up){var l=K.alloc();l=a.Up.oa(Fc,l);h=l.x-a.Vp.x/a.scale;k=l.y-a.Vp.y/a.scale;e=Ec;K.free(l)}if(f||a.scrollMode===di)e.mb()&&(c>b.width&&(h=b.x+(e.x*b.width+e.offsetX)-(e.x*c-e.offsetX)),d>b.height&&(k=b.y+(e.y*b.height+e.offsetY)-(e.y*d-e.offsetY))),e=a.zj,f=c-b.width,c<b.width+e.left+e.right?(h=Math.min(h+c/2,b.right+Math.max(f,e.right)-c/2),h=Math.max(h,b.left-Math.max(f,e.left)+c/2),h-=c/2):h>b.left?h=b.left:h<b.right- +c&&(h=b.right-c),c=d-b.height,d<b.height+e.top+e.bottom?(k=Math.min(k+d/2,b.bottom+Math.max(c,e.bottom)-d/2),k=Math.max(k,b.top-Math.max(c,e.top)+d/2),k-=d/2):k>b.top?k=b.top:k<b.bottom-d&&(k=b.bottom-d);g.x=isFinite(h)?h:-a.zb.left;g.y=isFinite(k)?k:-a.zb.top;null!==a.positionComputation&&(b=a.positionComputation(a,g),g.x=b.x,g.y=b.y);Qh(a.Xd,a.va,g);a.va.h(g.x,g.y);Pi(a);K.free(g)} +t.Kl=function(a,b){void 0===b&&(b=!0);if(b){if(a=xf(this,a,function(a){return a.part},function(a){return a.canSelect()}),a instanceof S)return a}else if(a=xf(this,a,function(a){return a.part}),a instanceof S)return a;return null};t.jc=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);zh(this);for(var d=this.$a.iteratorBackwards;d.next();){var e=d.value;if(e.visible&&(e=e.jc(a,b,c),null!==e))return e}return null}; +function xf(a,b,c,d){void 0===c&&(c=null);void 0===d&&(d=null);zh(a);for(a=a.$a.iteratorBackwards;a.next();){var e=a.value;if(e.visible&&!e.isTemporary&&(e=e.jc(b,c,d),null!==e))return e}return null}t.mz=function(a,b,c){void 0===b&&(b=!0);return nj(this,a,function(a){return a.part},b?function(a){return a instanceof S&&a.canSelect()}:null,c)}; +function nj(a,b,c,d,e){void 0===c&&(c=null);void 0===d&&(d=null);e instanceof H||e instanceof I||(e=new I);zh(a);for(a=a.$a.iteratorBackwards;a.next();){var f=a.value;f.visible&&!f.isTemporary&&f.pi(b,c,d,e)}return e}t.pi=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof H||d instanceof I||(d=new I);zh(this);for(var e=this.$a.iteratorBackwards;e.next();){var f=e.value;f.visible&&f.pi(a,b,c,d)}return d}; +t.nx=function(a,b,c,d){void 0===b&&(b=!1);void 0===c&&(c=!0);return oj(this,a,function(a){return a instanceof S&&(!c||a.canSelect())},b,d)};t.Ff=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof H||e instanceof I||(e=new I);zh(this);for(var f=this.$a.iteratorBackwards;f.next();){var g=f.value;g.visible&&g.Ff(a,b,c,d,e)}return e}; +t.Ou=function(a,b,c,d,e,f){var g=new I;zh(this);for(var h=this.$a.iteratorBackwards;h.next();){var k=h.value;k.visible&&k.Ou(a,b,c,d,g,e,f)}return g};function oj(a,b,c,d,e){var f=null;void 0===f&&(f=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof H||e instanceof I||(e=new I);zh(a);for(a=a.$a.iteratorBackwards;a.next();){var g=a.value;g.visible&&!g.isTemporary&&g.Ff(b,f,c,d,e)}return e} +t.nz=function(a,b,c,d,e){void 0===c&&(c=!0);void 0===d&&(d=!0);return pj(this,a,b,function(a){return a instanceof S&&(!d||a.canSelect())},c,e)};t.tg=function(a,b,c,d,e,f){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof H||e instanceof I)f=e;e=!0}f instanceof H||f instanceof I||(f=new I);zh(this);for(var g=this.$a.iteratorBackwards;g.next();){var h=g.value;h.visible&&h.tg(a,b,c,d,e,f)}return f}; +function pj(a,b,c,d,e,f){var g=null;void 0===g&&(g=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof H||e instanceof I)f=e;e=!0}f instanceof H||f instanceof I||(f=new I);zh(a);for(a=a.$a.iteratorBackwards;a.next();){var h=a.value;h.visible&&!h.isTemporary&&h.tg(b,c,g,d,e,f)}return f}P.prototype.acceptEvent=function(a){return qj(this,a,a instanceof MouseEvent)}; +function qj(a,b,c){var d=a.Sg;a.Sg=a.kj;a.kj=d;d.diagram=a;d.event=b;c?rj(a,b,d):(d.viewPoint=a.Sg.viewPoint,d.documentPoint=a.Sg.documentPoint);a=0;b.ctrlKey&&(a+=1);b.altKey&&(a+=2);b.shiftKey&&(a+=4);b.metaKey&&(a+=8);d.modifiers=a;d.button=b.button;void 0!==b.buttons&&(d.buttons=b.buttons);Ya&&0===b.button&&b.ctrlKey&&(d.button=2);d.down=!1;d.up=!1;d.clickCount=1;d.delta=0;d.handled=!1;d.bubbles=!1;d.timestamp=b.timeStamp;d.isMultiTouch=!1;d.targetDiagram=sj(b,b.target);d.targetObject=null;return d} +function sj(a,b){if(null===b)return null;if(b=b.H)return b;(b=a.path)||"function"!==typeof a.composedPath||(b=a.composedPath());return b&&b[0]&&b[0].H?b[0].H:null} +function tj(a,b,c,d,e,f){var g=a.Sg;a.Sg=a.kj;a.kj=g;g.diagram=a;g.clickCount=1;a=g.delta=0;b.ctrlKey&&(a+=1);b.altKey&&(a+=2);b.shiftKey&&(a+=4);b.metaKey&&(a+=8);g.modifiers=a;g.event=b;g.timestamp=b.timeStamp;g.button=b.button;g.buttons=b.buttons;Ya&&0===b.button&&b.ctrlKey&&(g.button=2);g.down=c;g.up=d;g.handled=!1;g.bubbles=e;g.isMultiTouch=f;return g} +function uj(a,b,c){if(b.bubbles)return G&&G.yx&&Fa("NOT handled "+c.type+" "+b.toString()),!0;G&&G.yx&&Fa("handled "+c.type+" "+a.currentTool.name+" "+b.toString());void 0!==c.stopPropagation&&c.stopPropagation();!1!==c.cancelable&&c.preventDefault();c.cancelBubble=!0;return!1} +P.prototype.Rz=function(a){var b=this.H;if(!this.H.isEnabled)return!1;var c=qj(b,a,!1);c.key=String.fromCharCode(a.which);c.down=!0;switch(a.which){case 8:c.key="Backspace";break;case 33:c.key="PageUp";break;case 34:c.key="PageDown";break;case 35:c.key="End";break;case 36:c.key="Home";break;case 37:c.key="Left";break;case 38:c.key="Up";break;case 39:c.key="Right";break;case 40:c.key="Down";break;case 45:c.key="Insert";break;case 46:c.key="Del";break;case 48:c.key="0";break;case 187:case 61:case 107:c.key= +"Add";break;case 189:case 173:case 109:c.key="Subtract";break;case 27:c.key="Esc"}b.doKeyDown();return uj(b,c,a)}; +P.prototype.Sz=function(a){var b=this.H;if(!b.isEnabled)return!1;var c=qj(b,a,!1);c.key=String.fromCharCode(a.which);c.up=!0;switch(a.which){case 8:c.key="Backspace";break;case 33:c.key="PageUp";break;case 34:c.key="PageDown";break;case 35:c.key="End";break;case 36:c.key="Home";break;case 37:c.key="Left";break;case 38:c.key="Up";break;case 39:c.key="Right";break;case 40:c.key="Down";break;case 45:c.key="Insert";break;case 46:c.key="Del"}b.doKeyUp();return uj(b,c,a)}; +P.prototype.$y=function(a){var b=this.H;if(!b.isEnabled)return!1;var c=qj(b,a,!0);null!==b.mouseEnter&&b.mouseEnter(c);return uj(b,c,a)};P.prototype.az=function(a){var b=this.H;if(!b.isEnabled)return!1;var c=qj(b,a,!0);null!==b.mouseLeave&&b.mouseLeave(c);return uj(b,c,a)}; +P.prototype.getMouse=function(a){var b=this.Na;if(null===b)return new K(0,0);var c=b.getBoundingClientRect();b=a.clientX-this.Ha/c.width*c.left;a=a.clientY-this.Ga/c.height*c.top;return null!==this.Gb?Kb(new K(b,a),this.Gb):new K(b,a)}; +function rj(a,b,c){var d=a.Na,e=a.Ha,f=a.Ga,g=0,h=0;null!==d&&(d=d.getBoundingClientRect(),g=b.clientX-e/d.width*d.left,h=b.clientY-f/d.height*d.top);c.viewPoint.h(g,h);null!==a.Gb?(b=K.allocAt(g,h),a.Gb.Rd(b),c.documentPoint.assign(b),K.free(b)):c.documentPoint.h(g,h)} +function ne(a,b,c,d){if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;b=b.targetTouches[c]}else if(null!==a.ml[0])b=a.ml[c];else return;c=a.Na;null!==c&&(c=c.getBoundingClientRect(),d.h(b.clientX-a.Ha/c.width*c.left,b.clientY-a.Ga/c.height*c.top))}P.prototype.ab=function(){this.ej||(this.ej=!0,this.Sb(!0))};function vj(a){a.jd||zh(a);a.eb()}P.prototype.redraw=function(){this.Bb||this.jd||(this.R(),jj(this),this.td())};t=P.prototype;t.Qz=function(){return this.og}; +t.Vy=function(a){void 0===a&&(a=null);var b=this.animationManager,c=b.isEnabled;b.Cc();b.isEnabled=!1;Nf(this);this.bg=!1;this.Wt=new K(NaN,NaN);b.isEnabled=c;this.jd=!0;var d=this;null!==a&&va(function(){d.jd=!1;yh(b,"Model");a(d)},1)};t.Sb=function(a){void 0===a&&(a=!1);if(!0!==this.og&&!(this.Bb||!1===a&&this.jd)){this.og=!0;var b=this;sa.requestAnimationFrame(function(){b.og&&b.td()})}};t.td=function(){if(!this.Zm||this.og)this.Zm&&(this.Zm=!1),Nf(this)}; +function kj(a,b,c){a.animationManager.defaultAnimation.isAnimating||a.Bb||!a.fj||Ui(a)||(b&&zh(a),c&&Yi(a,!1))} +function Nf(a,b){if(!a.jd&&(a.og=!1,null!==a.Qa||a.mo.u())){a.jd=!0;var c=a.animationManager,d=a.Rn;if(!c.isAnimating&&0!==d.length){for(var e=d.s,f=e.length,g=0;g<f;g++){var h=e[g];wj(h,!1);h.w()}d.clear()}d=a.hw;0<d.count&&(d.each(function(a){a.Fv()}),d.clear());e=d=!1;c.defaultAnimation.isAnimating&&(e=!0,d=a.skipsUndoManager,a.skipsUndoManager=!0);c.Eb||Fh(a);kj(a,!1,!0);null!==a.ee&&(a.ee.visible&&!a.aq&&(xj(a),a.aq=!0),!a.ee.visible&&a.aq&&(a.aq=!1));zh(a);f=!1;if(!a.bg||a.xh)a.bg?yj(a,!a.Kk): +(a.Ja("Initial Layout"),!1===c.isEnabled&&c.Cc(),yj(a,!1)),f=!0;a.Kk=!1;zh(a);a.gu||vj(a);kj(a,!0,!1);g=!1;f?(c=M.alloc(),c.assign(a.viewportBounds),a.bg||(g=a.bg=!0,a.skipsUndoManager||(a.undoManager.isPendingClear=!0),a.undoManager.isPendingUnmodified=!0,zj(a)),a.T("LayoutCompleted"),c.D(a.viewportBounds)||kj(a,!0,!1),M.free(c)):c.Qk&&c.Iw&&(a.Ig!==Eh?a.scale=hj(a,a.Ig):a.yh!==Eh?a.scale=hj(a,a.yh):(c=a.initialScale,isFinite(c)&&0<c&&(a.scale=c)),Yi(a,!0));zh(a);f&&g&&a.kb("Initial Layout");a.zu(); +b||a.zc(a.dc);e&&(a.skipsUndoManager=d);a.jd=!1}}function zj(a){var b=a.Ea;if(a.Ig!==Eh)a.scale=hj(a,a.Ig);else if(a.yh!==Eh)a.scale=hj(a,a.yh);else{var c=a.initialScale;isFinite(c)&&0<c&&(a.scale=c)}a.Ea!==b&&(jj(a),kj(a,!0,!1));Yi(a,!0);b=a.$a.s;a.Vd(b,b.length,a,a.viewportBounds);a.T("InitialLayoutCompleted");a.Wt.assign(a.va);xj(a)} +function zh(a){if(0!==a.De.count&&(a.jd||!a.animationManager.isTicking)){for(var b=0;23>b;b++){var c=a.De.iterator;if(null===c||0===a.De.count)break;a.De=new I;a.Fv(c,a.De);G&&22===b&&Fa("failure to validate parts")}a.nodes.each(function(a){a instanceof wf&&0!==(a.Y&65536)!==!1&&(a.Y=a.Y^65536)})}} +t.Fv=function(a,b){for(a.reset();a.next();){var c=a.value;!c.Zc()||c instanceof wf||(c.Ai()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof wf&&c.isVisible()&&Aj(this,c);for(a.reset();a.next();)c=a.value,c instanceof R&&c.isVisible()&&(c.Ai()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof Ce&&c.isVisible()&&(c.Ai()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}; +function Aj(a,b){for(var c=Na(),d=Na(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof wf?(Bj(f)||Cj(f)||Dj(f))&&Aj(a,f):f instanceof R?f.fromNode===b||f.toNode===b?d.push(f):c.push(f):(f.measure(Infinity,Infinity),f.arrange()))}a=c.length;for(e=0;e<a;e++)f=c[e],f.measure(Infinity,Infinity),f.arrange();Pa(c);b.measure(Infinity,Infinity);b.arrange();a=d.length;for(b=0;b<a;b++)c=d[b],c.measure(Infinity,Infinity),c.arrange();Pa(d)} +t.Vd=function(a,b,c,d){if(this.gj||this.animationManager.isAnimating)for(var e=0;e<b;e++)a[e].Vd(c,d)}; +t.zc=function(a,b){if(null!==this.Qa){null===this.Na&&v("No canvas specified");var c=this.animationManager;if(!c.Eb&&(!c.isAnimating||c.isTicking)){var d=new Date;Ej(this);if("0"!==this.Qa.style.opacity){var e=a!==this.dc,f=this.$a.s,g=f.length,h=this;this.Vd(f,g,h,h.viewportBounds);if(e)a.Uc(!0),Wi(this);else if(!this.hd&&void 0===b&&!c.isAnimating)return;g=this.va;var k=this.Ea,l=Math.round(g.x*k)/k,m=Math.round(g.y*k)/k;c=this.Gb;c.reset();1!==k&&c.scale(k);0===g.x&&0===g.y||c.translate(-l,-m); +k=this.qc;a.setTransform(k,0,0,k,0,0);a.clearRect(0,0,this.Ha,this.Ga);1!==this.yb&&(a.globalAlpha=this.yb);G&&G.El&&G.Gu&&(a.setTransform(c.m11*k,c.m12*k,c.m21*k,c.m22*k,c.dx,c.dy),G.Gu(this,a));Fj(this,a);l=void 0!==b?function(c){if(c.visible&&0!==c.yb){var d=c.Ra.s,e=d.length;if(0!==e){var f=si(c,a),g=c.Nn;g.length=0;for(var k=h.scale,l=M.alloc(),m=0;m<e;m++){var n=d[m];b.contains(n)||c.li(a,n,h,g,k,l,!0)}M.free(l);a.globalAlpha=f}}}:function(b){b.zc(a,h)};g=f.length;for(m=0;m<g;m++)a.setTransform(k, +0,0,k,0,0),a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),a.Vc(),l(f[m]);f=!1;this.Hh?Gj(this.Hh,this)&&(f=this.ct()):f=!0;f&&(Jb.prototype.Rd=Jb.prototype.Tw);G&&(G.ix||G.El)&&G.Hu&&G.Hu(a,this,c);e?(this.dc.Uc(!0),Wi(this)):this.hd=this.gj=!1;f=+new Date-+d;e=G&&G.hx;d=this.rw;if(e||null===this.ci){d[this.Fq]=f;this.Fq=(this.Fq+1)%d.length;for(c=f=0;c<d.length;c++)f+=d[c];this.Eq=f/d.length}1!==this.yb&&(a.globalAlpha=1);if(e)for(a.setTransform(1,0,0,1,0,0),e=0;e<d.length;e++)a.fillText(d[e].toString(), +20,150+ +(20*e))}}}}; +function Hj(a,b,c,d,e,f,g,h,k,l){if(null!==a.Qa){null===a.Na&&v("No canvas specified");void 0===g&&(g=null);void 0===h&&(h=null);void 0===k&&(k=!1);void 0===l&&(l=!1);Ej(a);a.dc.Uc(!0);Wi(a);a.hj=!0;var m=a.Ea;a.Ea=e;var n=a.$a.s,p=n.length;try{var r=new M(f.x,f.y,d.width/e,d.height/e),q=r.copy();q.so(c);xj(a,q);zh(a);a.Vd(n,p,a,r);b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,d.width,d.height);null!==h&&""!==h&&(b.fillStyle=h,b.fillRect(0,0,d.width,d.height));var u=a.qc;b.scale(u,u);var x=Jb.alloc(); +x.reset();x.translate(c.left,c.top);x.scale(e);0===f.x&&0===f.y||x.translate(-f.x,-f.y);b.setTransform(x.m11,x.m12,x.m21,x.m22,x.dx,x.dy);b.Vc();Jb.free(x);Fj(a,b);b.globalAlpha=a.yb;var y=a.Vj("Grid");if(g){var z=new I,B=g.iterator;for(B.reset();B.next();){var C=B.value;C instanceof S&&(l||C.layer!==y)&&z.add(C)}for(l=0;l<p;l++){var D=n[l];y=b;var J=a;if(D.visible&&0!==D.yb&&(k||!D.isTemporary)){var U=D.Ra.s,aa=U.length;if(0!==aa){var Y=si(D,y),W=D.Nn;W.length=0;var Q=J.scale,la=M.alloc();for(c= +0;c<aa;c++){var fa=U[c];z.contains(fa)&&D.li(y,fa,J,W,Q,la,!1)}M.free(la);y.globalAlpha=Y}}}}else for(z=0;z<p;z++)J=n[z],J===y?l&&J.zc(b,a,!0):J.zc(b,a,k);a.hj=!1;a.Hh&&Gj(a.Hh,a)&&a.ct()}finally{a.Ea=m,a.dc.Uc(!0),Wi(a),a.Vd(n,p,a,a.viewportBounds),xj(a)}}}t.Te=function(a){return this.Tg[a]};t.Vx=function(a,b){"minDrawingLength"===a&&(this.Aq=b);this.Tg[a]=b;this.redraw()}; +t.Rx=function(){this.Tg=new db;this.Tg.drawShadows=!0;this.Tg.textGreeking=!0;this.Tg.viewportOptimizations=Ya||Wa?!1:!0;this.Tg.temporaryPixelRatio=!0;this.Tg.pictureRatioOptimization=!0;this.Aq=this.Tg.minDrawingLength=1};function Fj(a,b){a=a.Tg;null!==a&&(void 0!==a.imageSmoothingEnabled&&b.Ux(!!a.imageSmoothingEnabled),a=a.defaultFont,void 0!==a&&null!==a&&(b.font=a))}t.Ml=function(a){return this.gn[a]};t.rA=function(a,b){this.gn[a]=b}; +t.Qx=function(){this.gn=new db;this.gn.extraTouchArea=10;this.gn.extraTouchThreshold=10;this.gn.hasGestureZoom=!0};t.set=function(a){if(G)for(var b in a)(b.startsWith("_")||-1!==b.indexOf("."))&&v("Property with underscore or period passed to Diagram.set. Did you mean to use Diagram.assign?");Object.assign(this,a);return this};t.xu=function(a){return this.im(a)};t.im=function(a){Ij(this,a);return this}; +function Ij(a,b){var c=a instanceof V,d=a instanceof P,e;for(e in b){""===e&&v("Setting properties requires non-empty property names");var f=a,g=e;if(c||d){var h=e.indexOf(".");if(0<h){var k=e.substring(0,h);if(c)f=a.lb(k);else if(f=a[k],void 0===f||null===f)f=a.toolManager[k];Ga(f)?g=e.substr(h+1):v("Unable to find object named: "+k+" in "+a.toString()+" when trying to set property: "+e)}}if("_"!==g[0]&&!Sa(f,g))if(d&&"ModelChanged"===g){a.Qw(b[g]);continue}else if(d&&"Changed"===g){a.fh(b[g]);continue}else if(d&& +Sa(a.toolManager,g))f=a.toolManager;else if(d&&Jj(a,g)){a.Jj(g,b[g]);continue}else if(a instanceof X&&"Changed"===g){a.fh(b[g]);continue}else v('Trying to set undefined property "'+g+'" on object: '+f.toString());f[g]=b[e];"_"===g[0]&&f instanceof O&&f.Nw(g)}}t.zu=function(){if(0===this.undoManager.transactionLevel&&0!==this.Eh.count){for(;0<this.Eh.count;){var a=this.Eh;this.Eh=new yb;for(a=a.iterator;a.next();){var b=a.key;b.Mo(a.value);b.sc(!1)}}this.R()}}; +t.R=function(a){if(void 0===a)this.hd=!0,this.Sb();else{var b=this.viewportBounds;a.u()&&b.Yc(a)&&(this.hd=!0,this.Sb())}this.T("InvalidateDraw")}; +P.prototype.invalidateViewport=function(a,b){if(!0!==this.hd){this.hd=!0;var c=!0===this.Te("temporaryPixelRatio");if(!0===this.Te("viewportOptimizations")&&this.scrollMode!==fi&&this.zj.ni(0,0,0,0)&&b.width===a.width&&b.height===a.height){var d=this.scale,e=Math.max(a.x,b.x),f=Math.max(a.y,b.y);d=M.allocAt(e,f,Math.max(0,Math.min(a.x+a.width,b.x+b.width)-e)*d,Math.max(0,Math.min(a.y+a.height,b.y+b.height)-f)*d);if(!this.yr&&0<d.width&&0<d.height){if(!(this.jd||(this.og=!1,null===this.Qa||(this.jd= +!0,this.zu(),this.documentBounds.u()||(e=M.alloc(),Kj(this,this.computeBounds(e)),M.free(e)),e=this.Na,null===e||e instanceof Lj)))){var g=this.qc;f=this.Ha*g;var h=this.Ga*g,k=this.scale*g,l=Math.round(Math.round(b.x*k)-Math.round(a.x*k));b=Math.round(Math.round(b.y*k)-Math.round(a.y*k));k=this.bw;a=this.my;k.width!==f&&(k.width=f);k.height!==h&&(k.height=h);a.clearRect(0,0,f,h);k=190*g;var m=70*g,n=Math.max(l,0),p=Math.max(b,0),r=Math.floor(f-n),q=Math.floor(h-p);a.drawImage(e.Xa,n,p,r,q,0,0,r, +q);Gj(this.Hh,this)&&a.clearRect(0,0,k,m);e=Na();a=Na();q=Math.abs(l);r=Math.abs(b);var u=0===n?0:f-q;n=K.allocAt(u,0);q=K.allocAt(q+u,h);a.push(new M(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y)));var x=this.Gb;x.reset();x.scale(g,g);1!==this.Ea&&x.scale(this.Ea);g=this.va;(0!==g.x||0!==g.y)&&isFinite(g.x)&&isFinite(g.y)&&x.translate(-g.x,-g.y);Kb(n,x);Kb(q,x);e.push(new M(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y)));u=0===p?0:h-r;n.h(0,u); +q.h(f,r+u);a.push(new M(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y)));Kb(n,x);Kb(q,x);e.push(new M(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y)));Gj(this.Hh,this)&&(f=0<l?0:-l,h=0<b?0:-b,n.h(f,h),q.h(k+f,m+h),a.push(new M(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y))),Kb(n,x),Kb(q,x),e.push(new M(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y))));K.free(n);K.free(q);kj(this,!1,!0);null===this.Qa&& +v("No div specified");null===this.Na&&v("No canvas specified");if(!this.animationManager.Eb&&(f=this.dc,this.hd)){Ej(this);h=this.qc;f.setTransform(1,0,0,1,0,0);f.clearRect(0,0,this.Ha*h,this.Ga*h);f.drawImage(this.bw.Xa,0<l?0:Math.round(-l),0<b?0:Math.round(-b));b=this.va;g=this.Ea;k=Math.round(b.x*g)/g;m=Math.round(b.y*g)/g;l=this.Gb;l.reset();1!==g&&l.scale(g);0===b.x&&0===b.y||l.translate(-k,-m);f.save();f.beginPath();b=a.length;for(g=0;g<b;g++)k=a[g],0!==k.width&&0!==k.height&&f.rect(Math.floor(k.x), +Math.floor(k.y),Math.ceil(k.width),Math.ceil(k.height));f.clip();f.setTransform(h,0,0,h,0,0);f.transform(l.m11,l.m12,l.m21,l.m22,l.dx,l.dy);f.Vc();G&&G.El&&G.Gu&&G.Gu(this,f);h=this.$a.s;b=h.length;this.Vd(h,b,this,this.viewportBounds);Fj(this,f);f.globalAlpha=this.yb;for(g=0;g<b;g++)if(k=h[g],m=e,k.visible&&0!==k.yb){p=si(k,f);n=k.Nn;n.length=0;r=this.scale;q=M.alloc();x=k.Ra.s;u=x.length;for(var y=m.length,z=0;z<u;z++){var B=x[z];a:{var C=Mj(B,B.actualBounds);for(var D=m,J=y,U=2/r,aa=4/r,Y=0;Y< +J;Y++){var W=D[Y];if(0!==W.width&&0!==W.height&&C.Wu(W.x-U,W.y-U,W.width+aa,W.height+aa)){C=!0;break a}}C=!1}C&&k.li(f,B,this,n,r,q,!0)}M.free(q);f.globalAlpha=p}f.restore();f.Uc(!0);G&&(G.ix||G.El)&&G.Hu&&G.Hu(f,this,l);this.Hh&&Gj(this.Hh,this)&&this.ct();this.hd=this.gj=!1;this.Wo()}Pa(e);Pa(a);this.jd=!1}}else this.td();M.free(d);c&&(Te(this),this.td(),mf(this,!0))}else c?(Te(this),this.td(),mf(this,!0)):this.td()}};function jj(a){!1===a.fj&&(a.fj=!0)}function Wi(a){!1===a.gj&&(a.gj=!0)} +function Ej(a){!1!==a.hn&&(a.hn=!1,Nj(a,a.Ha,a.Ga))}function Nj(a,b,c){Pi(a);var d=a.qc;a.Na.resize(b*d,c*d,b,c)&&(a.hd=!0,a.dc.Uc(!0))} +function Ui(a){var b=a.Na;if(null===b||a.mo.u())return!0;var c=a.Ha,d=a.Ga,e=a.viewportBounds;if(!a.viewportBounds.u())return!0;var f=e.x,g=e.y,h=e.width,k=e.height,l=a.cu,m=a.$t,n=a.Qa,p=!1,r=a.$f?a.Fb:0,q=a.hf?a.Fb:0,u=n.clientWidth||c+r,x=n.clientHeight||d+q;if(u!==c+r||x!==d+q)a.$f=!1,a.hf=!1,q=r=0,a.Ha=u,a.Ga=x,p=a.hn=!0,Pi(a);if(!(p||a.$f||a.hf||a.en||a.fn))return!0;a.fj=!1;var y=a.documentBounds,z=0,B=0,C=0,D=0;n=e.width;var J=e.height,U=a.zj;a.contentAlignment.mb()?(y.width>n&&(z=U.left,B= +U.right),y.height>J&&(C=U.top,D=U.bottom)):(z=U.left,B=U.right,C=U.top,D=U.bottom);U=y.width+z+B;var aa=y.height+C+D;z=y.x-z;var Y=e.x;B=y.right+B;var W=e.right+r;C=y.y-C;var Q=e.y;y=y.bottom+D;D=e.bottom+q;var la="1px",fa="1px";e=a.scale;u=U>u/e;x=aa>x/e;a.scrollMode===di&&(u||x)&&(u&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(u=1,z+1<Y&&(u=Math.max((Y-z)*e+a.Ha,u)),B>W+1&&(u=Math.max((B-W)*e+a.Ha,u)),n+r+1<U&&(u=Math.max((U-n)*e+a.Ha,u)),la=u.toString()+"px"),x&&a.hasVerticalScrollbar&& +a.allowVerticalScroll&&(u=1,C+1<Q&&(u=Math.max((Q-C)*e+a.Ga,u)),y>D+1&&(u=Math.max((y-D)*e+a.Ga,u)),J+q+1<aa&&(u=Math.max((aa-J)*e+a.Ga,u)),fa=u.toString()+"px"));u="1px"!==la;x="1px"!==fa;u&&x||!u&&!x||(x&&(W-=a.Fb),u&&(D-=a.Fb),U<n+r||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(r=1,z+1<Y&&(r=Math.max((Y-z)*e+a.Ha,r)),B>W+1&&(r=Math.max((B-W)*e+a.Ha,r)),n+1<U&&(r=Math.max((U-n)*e+a.Ha,r)),la=r.toString()+"px"),u="1px"!==la,r=a.Ga,u!==a.hf&&(r=u?a.Ga-a.Fb:a.Ga+a.Fb),aa<J+q||!a.hasVerticalScrollbar|| +!a.allowVerticalScroll||(q=1,C+1<Q&&(q=Math.max((Q-C)*e+r,q)),y>D+1&&(q=Math.max((y-D)*e+r,q)),J+1<aa&&(q=Math.max((aa-J)*e+r,q)),fa=q.toString()+"px"),x="1px"!==fa);if(a.$q&&u===a.hf&&x===a.$f)return c===a.Ha&&d===a.Ga||a.td(),!1;u!==a.hf&&("1px"===la?a.Ga=a.Ga+a.Fb:a.Ga=Math.max(a.Ga-a.Fb,1),p=!0);a.hf=u;m.style.width=la;x!==a.$f&&("1px"===fa?a.Ha=a.Ha+a.Fb:a.Ha=Math.max(a.Ha-a.Fb,1),p=!0,a.mn&&(q=K.alloc(),x?(b.style.left=a.Fb+"px",a.position=q.h(a.va.x+a.Fb/a.scale,a.va.y)):(b.style.left="0px", +a.position=q.h(a.va.x-a.Fb/a.scale,a.va.y)),K.free(q)));p&&Pi(a);a.$f=x;m.style.height=fa;a.Zt=!0;p&&(a.hn=!0);b=l.scrollLeft;a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(n+1<U?b=(a.position.x-z)*e:z+1<Y?b=l.scrollWidth-l.clientWidth:B>W+1&&(b=a.position.x*e));if(a.mn)switch(a.Ut){case "negative":b=-(l.scrollWidth-b-l.clientWidth);break;case "reverse":b=l.scrollWidth-b-l.clientWidth}l.scrollLeft=b;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(J+1<aa?l.scrollTop=(a.position.y-C)*e:C+1<Q?l.scrollTop= +l.scrollHeight-l.clientHeight:y>D+1&&(l.scrollTop=a.position.y*e));u=a.Ha;x=a.Ga;l.style.width=u+(a.$f?a.Fb:0)+"px";l.style.height=x+(a.hf?a.Fb:0)+"px";return c!==u||d!==x||a.animationManager.Eb?(c=M.allocAt(f,g,h,k),a.onViewportBoundsChanged(c,a.viewportBounds,e,p),M.free(c),!1):!0}t=P.prototype; +t.add=function(a){w(a,S,P,"add:part");var b=a.diagram;if(b!==this&&(null!==b&&v("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString()),b=this.Vj(a.layerName),null===b&&(b=this.Vj("")),null===b&&v('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==b)){var c=b.vi(99999999,a,a.diagram===this);0<=c&&this.ib(se,"parts",b,null,a,null,c);b.isTemporary||this.ab();a.F(1);c=a.layerChanged;null!==c&&c(a,null, +b)}};t.vi=function(a){this.partManager.vi(a);var b=this;Oj(a,function(a){Pj(b,a)});(a instanceof Ce||a instanceof wf&&null!==a.placeholder)&&a.w();null!==a.data&&Oj(a,function(a){Qj(b.partManager,a)});!0!==Cj(a)&&!0!==Dj(a)||this.De.add(a);Rj(a,!0,this);Sj(a)?(a.actualBounds.u()&&this.R(Mj(a,a.actualBounds)),this.ab()):a.isVisible()&&a.actualBounds.u()&&this.R(Mj(a,a.actualBounds));this.Sb()}; +t.rc=function(a){a.Mj();this.partManager.rc(a);var b=this;null!==a.data&&Oj(a,function(a){Tj(b.partManager,a,b)});this.De.remove(a);Sj(a)?(a.actualBounds.u()&&this.R(Mj(a,a.actualBounds)),this.ab()):a.isVisible()&&a.actualBounds.u()&&this.R(Mj(a,a.actualBounds));this.Sb()};t.remove=function(a){w(a,S,P,"remove:part");Uj(this,a,!0)}; +function Uj(a,b,c){var d=b.layer;null!==d&&d.diagram===a&&(b.isSelected=!1,b.isHighlighted=!1,b.F(2),c&&b.Sj(),c=d.rc(-1,b,!1),0<=c&&a.ib(te,"parts",d,b,null,c,null),a=b.layerChanged,null!==a&&a(b,d,null))}t.vs=function(a,b){void 0===b&&(b=!1);if(Ha(a))for(var c=a.length,d=0;d<c;d++){var e=a[d];b&&!e.canDelete()||this.remove(e)}else for(c=new I,c.addAll(a),a=c.iterator;a.next();)c=a.value,b&&!c.canDelete()||this.remove(c)};t.Rj=function(a,b,c){void 0===c&&(c=!1);return this.partManager.Rj(a,b,c)}; +P.prototype.moveParts=function(a,b,c,d){void 0===c&&(c=!1);void 0===d&&(d=Vj(this));w(b,K,P,"moveParts:offset");if(null!==this.toolManager){var e=new yb;if(null!==a)if(Ha(a))for(var f=0;f<a.length;f++)Wj(this,e,a[f],c,d);else for(a=a.iterator;a.next();)Wj(this,e,a.value,c,d);else{for(a=this.parts;a.next();)Wj(this,e,a.value,c,d);for(a=this.nodes;a.next();)Wj(this,e,a.value,c,d);for(a=this.links;a.next();)Wj(this,e,a.value,c,d)}tf(this,e,b,d,c)}}; +function Wj(a,b,c,d,e,f){if(!b.contains(c)&&(void 0===f&&(f=!1),!d||f||c.canMove()||c.canCopy()))if(void 0===e&&(e=Vj(a)),c instanceof T){b.add(c,a.Md(e,c,c.location));if(c instanceof wf&&(null!==c.placeholder||e.dragsMembers))for(f=c.memberParts;f.next();)Wj(a,b,f.value,d,e,e.groupsAlwaysMove);for(f=c.linksConnected;f.next();){var g=f.value;if(!b.contains(g)){var h=g.fromNode,k=g.toNode;null!==h&&b.contains(h)&&null!==k&&b.contains(k)&&Wj(a,b,g,d,e)}}if(e.dragsTree)for(c=c.Pu();c.next();)Wj(a,b, +c.value,d,e)}else if(c instanceof R)for(b.add(c,a.Md(e,c)),c=c.labelNodes;c.next();)Wj(a,b,c.value,d,e);else c instanceof Ce||b.add(c,a.Md(e,c,c.location))} +function tf(a,b,c,d,e){if(null!==b&&(w(b,yb,P,"moveParts:parts"),0!==b.count)){var f=K.alloc(),g=K.alloc();g.assign(c);isNaN(g.x)&&(g.x=0);isNaN(g.y)&&(g.y=0);(c=a.xr)||Ue(a,b);for(var h=Na(),k=Na(),l=b.iterator,m=K.alloc();l.next();){var n=l.key,p=l.value;if(n.Zc()){var r=Xj(a,n,b);if(null!==r)h.push(new Yj(n,p,r));else if(!e||n.canMove())r=p.point,f.assign(r),a.computeMove(n,f.add(g),d,m),n.location=m,void 0===p.shifted&&(p.shifted=new K),p.shifted.assign(m.re(r))}else l.key instanceof R&&k.push(l.xa)}K.free(m); +e=h.length;for(l=0;l<e;l++)n=h[l],f.assign(n.info.point),void 0===n.Tu.shifted&&(n.Tu.shifted=new K),n.node.location=f.add(n.Tu.shifted);e=K.alloc();l=K.alloc();n=k.length;for(p=0;p<n;p++){var q=k[p];r=q.key;if(r instanceof R)if(r.suspendsRouting){r.sf=null;m=r.fromNode;var u=r.toNode;if(null!==a.draggedLink&&d.dragsLink)if(u=q.value.point,null===r.dragComputation)b.add(r,a.Md(d,r,g)),rf(r,g.x-u.x,g.y-u.y);else{q=K.allocAt(0,0);(m=r.i(0))&&m.u()&&q.assign(m);var x=m=K.alloc().assign(q).add(g);d.isGridSnapEnabled&& +(d.isGridSnapRealtime||a.lastInput.up)&&(x=K.alloc(),Fg(a,r,m,x,d));m.assign(r.dragComputation(r,m,x)).re(q);b.add(r,a.Md(d,r,m));rf(r,m.x-u.x,m.y-u.y);K.free(q);K.free(m);x!==m&&K.free(x)}else null!==m&&(e.assign(m.location),x=b.L(m),null!==x&&e.re(x.point)),null!==u&&(l.assign(u.location),x=b.L(u),null!==x&&l.re(x.point)),null!==m&&null!==u?e.fb(l)?(m=q.value.point,u=f,u.assign(e),u.re(m),b.add(r,a.Md(d,r,e)),rf(r,u.x,u.y)):(r.suspendsRouting=!1,r.gb()):(q=q.value.point,m=null!==m?e:null!==u?l: +g,b.add(r,a.Md(d,r,m)),rf(r,m.x-q.x,m.y-q.y))}else if(null===r.fromNode||null===r.toNode)m=q.value.point,b.add(r,a.Md(d,r,g)),rf(r,g.x-m.x,g.y-m.y)}K.free(f);K.free(g);K.free(e);K.free(l);Pa(h);Pa(k);c||(zh(a),jf(a,b))}} +P.prototype.computeMove=function(a,b,c,d){void 0===d&&(d=new K);d.assign(b);if(null===a)return d;var e=b,f=c.isGridSnapEnabled;f&&(c.isGridSnapRealtime||this.lastInput.up)&&(e=K.alloc(),Fg(this,a,b,e,c));c=null!==a.dragComputation?a.dragComputation(a,b,e):e;var g=a.minLocation,h=g.x;isNaN(h)&&(h=f?Math.round(1E3*a.location.x)/1E3:a.location.x);g=g.y;isNaN(g)&&(g=f?Math.round(1E3*a.location.y)/1E3:a.location.y);var k=a.maxLocation,l=k.x;isNaN(l)&&(l=f?Math.round(1E3*a.location.x)/1E3:a.location.x); +k=k.y;isNaN(k)&&(k=f?Math.round(1E3*a.location.y)/1E3:a.location.y);d.h(Math.max(h,Math.min(c.x,l)),Math.max(g,Math.min(c.y,k)));e!==b&&K.free(e);return d};function Vj(a){var b=a.toolManager.findTool("Dragging");return null!==b?b.dragOptions:a.Rm} +function Fg(a,b,c,d,e){void 0===e&&(e=Vj(a));d.assign(c);if(null!==b){var f=a.grid;b=e.gridSnapCellSize;a=b.width;b=b.height;var g=e.gridSnapOrigin,h=g.x;g=g.y;e=e.gridSnapCellSpot;if(null!==f){var k=f.gridCellSize;isNaN(a)&&(a=k.width);isNaN(b)&&(b=k.height);f=f.gridOrigin;isNaN(h)&&(h=f.x);isNaN(g)&&(g=f.y)}f=K.allocAt(0,0);f.Di(0,0,a,b,e);L.Eo(c.x,c.y,h+f.x,g+f.y,a,b,d);K.free(f)}}function Ue(a,b){if(null!==b)for(a.xr=!0,a=b.iterator;a.next();)b=a.key,b instanceof R&&(b.suspendsRouting=!0)} +function jf(a,b){if(null!==b){for(b=b.iterator;b.next();){var c=b.key;c instanceof R&&(c.suspendsRouting=!1,Zj(c)&&c.gb())}a.xr=!1}}function Xj(a,b,c){b=b.containingGroup;if(null!==b){a=Xj(a,b,c);if(null!==a)return a;a=c.L(b);if(null!==a)return a}return null}t=P.prototype;t.Md=function(a,b,c){if(void 0===c)return new Xe(zb);var d=a.isGridSnapEnabled;a.groupsSnapMembers||null===b.containingGroup||(d=!1);return d?new Xe(new K(Math.round(1E3*c.x)/1E3,Math.round(1E3*c.y)/1E3)):new Xe(c.copy())}; +function ak(a,b,c){w(b,qi,P,"addLayer:layer");null!==b.diagram&&b.diagram!==a&&v("Cannot share a Layer with another Diagram: "+b+" of "+b.diagram);null===c?null!==b.diagram&&v("Cannot add an existing Layer to this Diagram again: "+b):(w(c,qi,P,"addLayer:existingLayer"),c.diagram!==a&&v("Existing Layer must be in this Diagram: "+c+" not in "+c.diagram),b===c&&v("Cannot move a Layer before or after itself: "+b));if(b.diagram!==a){b=b.name;a=a.$a;c=a.count;for(var d=0;d<c;d++)a.N(d).name===b&&v("Cannot add Layer with the name '"+ +b+"'; a Layer with the same name is already present in this Diagram.")}}t.Cl=function(a){ak(this,a,null);a.Ye(this);var b=this.$a,c=b.count-1;if(!a.isTemporary)for(;0<=c&&b.N(c).isTemporary;)c--;b.Hb(c+1,a);null!==this.fc&&this.ib(se,"layers",this,null,a,null,c+1);this.R();this.ab();return this}; +t.Ow=function(a,b){ak(this,a,b);a.Ye(this);var c=this.$a,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.fc&&this.ib(te,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;f<e;f++)if(c.N(f)===b){c.Hb(f,a);break}null!==this.fc&&this.ib(se,"layers",this,null,a,null,f);this.R();0>d&&this.ab();return this}; +t.Ay=function(a,b){ak(this,a,b);a.Ye(this);var c=this.$a,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.fc&&this.ib(te,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;f<e;f++)if(c.N(f)===b){c.Hb(f+1,a);break}null!==this.fc&&this.ib(se,"layers",this,null,a,null,f+1);this.R();0>d&&this.ab();return this}; +t.jA=function(a){w(a,qi,P,"removeLayer:layer");a.diagram!==this&&v("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name){var b=this.$a,c=b.indexOf(a);if(b.remove(a)){for(b=a.Ra.copy().iterator;b.next();){var d=b.value,e=d.layerName;e!==a.name?d.layerName=e:d.layerName=""}null!==this.fc&&this.ib(te,"layers",this,a,null,c,null);this.R();this.ab()}}};t.Vj=function(a){for(var b=this.layers;b.next();){var c=b.value;if(c.name===a)return c}return null}; +t.Qw=function(a){A(a,"function",P,"addModelChangedListener:listener");null===this.pf&&(this.pf=new H);this.pf.add(a);this.model.fh(a);return this};t.lA=function(a){A(a,"function",P,"removeModelChangedListener:listener");null!==this.pf&&(this.pf.remove(a),0===this.pf.count&&(this.pf=null));this.model.mk(a)};t.fh=function(a){A(a,"function",P,"addChangedListener:listener");null===this.Cg&&(this.Cg=new H);this.Cg.add(a);return this}; +t.mk=function(a){A(a,"function",P,"removeChangedListener:listener");null!==this.Cg&&(this.Cg.remove(a),0===this.Cg.count&&(this.Cg=null))};t.Pr=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Uu(a);a.change!==re&&(this.isModified=!0);if(null!==this.Cg)for(var b=this.Cg,c=b.length,d=0;d<c;d++)b.N(d)(a)}; +t.ib=function(a,b,c,d,e,f,g){void 0===f&&(f=null);void 0===g&&(g=null);var h=new pe;h.diagram=this;h.change=a;h.propertyName=b;h.object=c;h.oldValue=d;h.oldParam=f;h.newValue=e;h.newParam=g;this.Pr(h)};t.g=function(a,b,c,d,e){this.ib(qe,a,this,b,c,d,e)}; +P.prototype.changeState=function(a,b){if(null!==a&&a.diagram===this){var c=this.skipsModelSourceBindings;try{this.skipsModelSourceBindings=!0;var d=a.change;if(d===qe){var e=a.object;bk(e,a.propertyName,a.L(b));if(e instanceof O){var f=e.part;null!==f&&f.Xb()}this.isModified=!0}else if(d===se){var g=a.object,h=a.newParam,k=a.newValue;if(g instanceof V)if("number"===typeof h&&k instanceof O){b?g.rc(h):g.Hb(h,k);var l=g.part;null!==l&&l.Xb()}else"number"===typeof h&&k instanceof ck&&(k.isRow?dk(g,h, +b?void 0:k):ek(g,h,b?void 0:k));else if(g instanceof qi){var m=!0===a.oldParam;"number"===typeof h&&k instanceof S&&(b?(k.isSelected=!1,k.isHighlighted=!1,k.Xb(),g.rc(m?h:-1,k,m)):g.vi(h,k,m))}else g instanceof P?"number"===typeof h&&k instanceof qi&&(b?this.$a.sb(h):(k.Ye(this),this.$a.Hb(h,k))):v("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(d===te){var n=a.object,p=a.oldParam,r=a.oldValue;if(n instanceof V)"number"===typeof p&&r instanceof O?b?n.Hb(p,r):n.rc(p): +"number"===typeof p&&r instanceof ck&&(r.isRow?dk(n,p,b?r:void 0):ek(n,p,b?r:void 0));else if(n instanceof qi){var q=!0===a.newParam;"number"===typeof p&&r instanceof S&&(b?0>n.Ra.indexOf(r)&&n.vi(p,r,q):(r.isSelected=!1,r.isHighlighted=!1,r.Xb(),n.rc(q?p:-1,r,q)))}else n instanceof P?"number"===typeof p&&r instanceof qi&&(b?(r.Ye(this),this.$a.Hb(p,r)):this.$a.sb(p)):v("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else d!==re&&v("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings= +c}}};P.prototype.Ja=function(a){return this.undoManager.Ja(a)};P.prototype.kb=function(a){return this.undoManager.kb(a)};P.prototype.Nf=function(){return this.undoManager.Nf()};P.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.Ja(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.kb(b):this.undoManager.Nf(),this.skipsUndoManager=c}};P.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)}; +P.prototype.hp=function(){this.partManager.hp()}; +function fk(a,b,c){var d=a.animationManager;if(a.Bb||a.jd)a.Ea=c,Pi(a),a=a.Ea,d.Eb&&(Jh(d)||d.be.add(d.H,"scale",b,a));else if(null===a.Na)a.Ea=c,Pi(a);else{a.Bb=!0;var e=a.viewportBounds.copy(),f=a.Ha,g=a.Ga;e.width=a.Ha/b;e.height=a.Ga/b;var h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.$c()?l.Jf(Rc)?h=0:l.Jf(Sc)&&(h=f-1):h=l.mb()?l.x*(f-1):f/2);isNaN(k)&&(l.$c()?l.Jf(Qc)?k=0:l.Jf(Tc)&&(k=g-1):k=l.mb()?l.y*(g-1):g/2);null===a.scaleComputation||a.animationManager.defaultAnimation.isAnimating|| +(c=a.scaleComputation(a,c));c<a.minScale&&(c=a.minScale);c>a.maxScale&&(c=a.maxScale);f=K.allocAt(a.va.x+h/b-h/c,a.va.y+k/b-k/c);a.position=f;K.free(f);a.Ea=c;Pi(a);a.onViewportBoundsChanged(e,a.viewportBounds,b,!1);a.Bb=!1;Yi(a,!1);c=a.Ea;d.Eb&&(Jh(d)||d.be.add(d.H,"scale",b,c));a.R();jj(a)}} +P.prototype.onViewportBoundsChanged=function(a,b,c,d){if(!a.D(b)){void 0===d&&(d=!1);d||jj(this);Wi(this);var e=this.layout;null===e||!e.isViewportSized||this.autoScale!==Eh||d||a.width===b.width&&a.height===b.height||e.F();e=this.currentTool;!0===this.Xk&&e instanceof Ua&&(this.lastInput.documentPoint=this.Es(this.lastInput.viewPoint),Le(e,this));this.Bb||this.invalidateViewport(a,b);xj(this);this.qd.scale=c;this.qd.position.x=a.x;this.qd.position.y=a.y;this.qd.bounds.assign(a);this.qd.Vw.width= +Math.round(a.width*c);this.qd.Vw.height=Math.round(a.height*c);this.qd.Jx.width=this.Ha;this.qd.Jx.height=this.Ga;this.qd.Cx=d;this.T("ViewportBoundsChanged",this.qd,a);this.isVirtualized&&this.links.each(function(a){a.isAvoiding&&a.actualBounds.Yc(b)&&a.gb()})}}; +function xj(a,b){var c=a.ee;if(null!==c&&c.visible){for(var d=Hb.alloc(),e=1,f=1,g=c.U.s,h=g.length,k=0;k<h;k++){var l=g[k],m=Math.abs(l.interval);2>m||(gk(l.figure)?f=f*m/L.ox(f,m):e=e*m/L.ox(e,m))}g=c.gridCellSize;d.h(f*g.width,e*g.height);if(void 0!==b)e=b.width,f=b.height,a=b.x,g=b.y;else{b=M.alloc();a=a.viewportBounds;b.h(a.x,a.y,a.width,a.height);if(!b.u()){M.free(b);return}e=b.width;f=b.height;a=b.x;g=b.y;M.free(b)}c.width=e+2*d.width;c.height=f+2*d.height;b=K.alloc();L.Eo(a,g,0,0,d.width, +d.height,b);b.offset(-d.width,-d.height);Hb.free(d);c.part.location=b;K.free(b)}}P.prototype.clearSelection=function(a){void 0===a&&(a=!1);var b=this.selection;if(0!==b.count){a||this.T("ChangingSelection",b);for(var c=b.Ka(),d=c.length,e=0;e<d;e++)c[e].isSelected=!1;b.pa();b.clear();b.freeze();a||this.T("ChangedSelection",b)}}; +P.prototype.select=function(a){null!==a&&(w(a,S,P,"select:part"),a.diagram===this&&(!a.isSelected||1<this.selection.count)&&(this.T("ChangingSelection",this.selection),this.clearSelection(!0),a.isSelected=!0,this.T("ChangedSelection",this.selection)))}; +P.prototype.qA=function(a){this.T("ChangingSelection",this.selection);this.clearSelection(!0);if(Ha(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];d instanceof S||v("Diagram.selectCollection given something that is not a Part: "+d);d.isSelected=!0}else for(a=a.iterator;a.next();)b=a.value,b instanceof S||v("Diagram.selectCollection given something that is not a Part: "+b),b.isSelected=!0;this.T("ChangedSelection",this.selection)}; +P.prototype.clearHighlighteds=function(){var a=this.highlighteds;if(0<a.count){for(var b=a.Ka(),c=b.length,d=0;d<c;d++)b[d].isHighlighted=!1;a.pa();a.clear();a.freeze()}};t=P.prototype;t.Kz=function(a){null!==a&&a.diagram===this&&(w(a,S,P,"highlight:part"),!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)}; +t.Lz=function(a){a=(new I).addAll(a);for(var b=this.highlighteds.copy().Xo(a).iterator;b.next();)b.value.isHighlighted=!1;for(a=a.iterator;a.next();)b=a.value,b instanceof S||v("Diagram.highlightCollection given something that is not a Part: "+b),b.isHighlighted=!0}; +t.scroll=function(a,b,c){void 0===c&&(c=1);var d="up"===b||"down"===b,e=0;if("pixel"===a)e=c;else if("line"===a)e=c*(d?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if("page"===a)a=d?this.viewportBounds.height:this.viewportBounds.width,a*=this.scale,0!==a&&(e=c*Math.max(a-(d?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0));else{if("document"===a){e=this.documentBounds;c=this.viewportBounds;d=K.alloc();"up"===b?this.position=d.h(c.x,e.y):"left"===b?this.position= +d.h(e.x,c.y):"down"===b?this.position=d.h(c.x,e.bottom-c.height):"right"===b&&(this.position=d.h(e.right-c.width,c.y));K.free(d);return}v("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+a)}e/=this.scale;c=this.position.copy();"up"===b?c.y=this.position.y-e:"down"===b?c.y=this.position.y+e:"left"===b?c.x=this.position.x-e:"right"===b?c.x=this.position.x+e:v("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+b);this.position=c}; +t.pv=function(a){var b=this.viewportBounds;b.Re(a)||(a=a.center,a.x-=b.width/2,a.y-=b.height/2,this.position=a)};t.Qr=function(a){var b=this.viewportBounds;a=a.center;a.x-=b.width/2;a.y-=b.height/2;this.position=a};t.ep=function(a){var b=this.Gb;b.reset();1!==this.Ea&&b.scale(this.Ea);var c=this.va;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return a.copy().transform(this.Gb)}; +t.zA=function(a){var b=this.Gb,c=a.x,d=a.y,e=c+a.width,f=d+a.height,g=b.m11,h=b.m12,k=b.m21,l=b.m22,m=b.dx,n=b.dy,p=c*g+d*k+m;b=c*h+d*l+n;var r=e*g+d*k+m;a=e*h+d*l+n;d=c*g+f*k+m;c=c*h+f*l+n;g=e*g+f*k+m;e=e*h+f*l+n;f=Math.min(p,r);p=Math.max(p,r);r=Math.min(b,a);b=Math.max(b,a);f=Math.min(f,d);p=Math.max(p,d);r=Math.min(r,c);b=Math.max(b,c);f=Math.min(f,g);p=Math.max(p,g);r=Math.min(r,e);b=Math.max(b,e);return new M(f,r,p-f,b-r)}; +t.Es=function(a){var b=this.Gb;b.reset();1!==this.Ea&&b.scale(this.Ea);var c=this.va;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return Kb(a.copy(),this.Gb)};function hk(a){var b=a.isModified;a.Lw!==b&&(a.Lw=b,a.T("Modified"))}function ik(a){a=yi.get(a);return null!==a?new a:new zi} +P.prototype.doModelChanged=function(a){var b=this;if(a.model===this.model){var c=a.change,d=a.propertyName;if(c===re&&"S"===d[0])if("StartingFirstTransaction"===d){var e=this;a=this.toolManager;a.mouseDownTools.each(function(a){a.diagram=e});a.mouseMoveTools.each(function(a){a.diagram=e});a.mouseUpTools.each(function(a){a.diagram=e});this.jd||this.bg||(this.Kk=!0,this.Zm&&(this.og=!0))}else"StartingUndo"===d||"StartingRedo"===d?(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&& +a.Cc(),this.T("ChangingSelection",this.selection)):"StartedTransaction"===d&&(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc());else if(this.ca){this.ca=!1;try{if(""===a.modelChange&&c===re){if("FinishedUndo"===d||"FinishedRedo"===d)this.T("ChangedSelection",this.selection),zh(this);var f=this.animationManager;"RolledBackTransaction"===d&&f.Cc();this.Kk=!0;this.td();0!==this.undoManager.transactionLevel&&1!==this.undoManager.transactionLevel||Ah(f);"CommittedTransaction"=== +d&&this.undoManager.isJustDiscarded&&(this.Ce=Math.min(this.Ce,this.undoManager.historyIndex-1));"CommittedTransaction"!==d&&"RolledBackTransaction"!==d||!this.undoManager.isPendingUnmodified||setTimeout(function(){b.isModified=!1},1);var g=a.isTransactionFinished;g&&(hk(this),this.ns.clear(),Nh(this.animationManager));if(!this.Jt&&g&&this.lastInput.targetDiagram){this.Jt=!0;var h=this;va(function(){h.currentTool.standardMouseOver();h.Jt=!1},10)}}}finally{this.ca=!0}}}}; +function Pj(a,b){b=b.U.s;for(var c=b.length,d=0;d<c;d++)jk(a,b[d])}function jk(a,b){if(b instanceof kk){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){c.Eg instanceof I&&c.Eg.add(a);var d=b.Hg;null!==d&&!0===d.hq&&null!==b.diagram&&b.diagram.Rn.add(b);if(c.an)if(c=c.getAttribute("src")||"",d=a.Qg.L(c),null===d)d=[],d.push(b),a.Qg.add(c,d);else{for(a=0;a<d.length;a++)if(d[a]===b)return;d.push(b)}}}} +function lk(a,b){if(b instanceof kk){var c=b.element;if(null!==c&&c instanceof HTMLImageElement&&c.an){var d=c.getAttribute("src")||"",e=a.Qg.L(d);if(null!==e)for(var f=0;f<e.length;f++)if(e[f]===b){e.splice(f,1);0===e.length&&(a.Qg.remove(d),c.sq&&c.removeEventListener("load",c.sq),c.Op&&c.removeEventListener("error",c.Op),delete c.sq,delete c.Op,c.Eg instanceof I&&c.Eg.remove(a),Oi(d));break}}}}P.prototype.Ud=function(){this.partManager.Ud()};P.prototype.Ij=function(a,b){this.Xd.Ij(a,b)}; +P.prototype.Kj=function(a,b){this.Xd.Kj(a,b)};P.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)};P.prototype.Qb=function(a){return this.partManager.Qb(a)};P.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)};t=P.prototype;t.Lc=function(a){return this.partManager.Lc(a)};t.oi=function(a){return this.partManager.oi(a)};t.Kc=function(a){return this.partManager.Kc(a)}; +t.Wr=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];return this.partManager.Wr.apply(this.partManager,b instanceof Array?b:da(ca(b)))};t.Vr=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];return this.partManager.Vr.apply(this.partManager,b instanceof Array?b:da(ca(b)))};function Pi(a){var b=a.va,c=a.Ea;a.Jw.h(b.x,b.y,Math.max(a.Ha,0)/c,Math.max(a.Ga,0)/c)} +function Kj(a,b){a.ej=!1;var c=a.Jp;c.D(b)||(c=c.copy(),a.Jp.assign(b),Yi(a,!1),a.T("DocumentBoundsChanged",void 0,c),jj(a))}t.eb=function(){if(this.ej){var a=M.alloc();Kj(this,this.computeBounds(a));M.free(a)}};t.sz=function(){for(var a=new I,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&a.add(c)}for(b=this.links;b.next();)c=b.value,c.isTopLevel&&a.add(c);return a.iterator};t.rz=function(){return this.fi.iterator};t.Uz=function(a){zh(this);a&&mk(this,!0);this.jd?yj(this,!1):(this.Kk=!0,Nf(this))}; +function mk(a,b){for(var c=a.fi.iterator;c.next();)nk(a,c.value,b);a.layout&&(b?a.layout.isValidLayout=!1:a.layout.F())}function nk(a,b,c){if(null!==b){for(var d=b.hl.iterator;d.next();)nk(a,d.value,c);null!==b.layout&&(c?b.layout.isValidLayout=!1:b.layout.F())}} +function yj(a,b){if(a.xh&&!a.$s){var c=a.ca;a.ca=!0;var d=a.undoManager.transactionLevel,e=a.layout,f=a.animationManager;try{0===d&&(a.undoManager.isInternalTransaction=!0,a.Ja("Layout"));1>=d&&!f.defaultAnimation.isAnimating&&!f.Eb&&(b||yh(f,"Layout"));a.xh=!1;for(var g=a.fi.iterator;g.next();)ok(a,g.value,b,d);e.isValidLayout||(!b||e.isRealtime||null===e.isRealtime||0===d?(e.doLayout(a),zh(a),e.isValidLayout=!0):a.xh=!0)}finally{b=a.undoManager.isInternalTransaction,0===d&&(a.kb("Layout"),a.undoManager.isInternalTransaction= +!1),!b||0!==d&&1!==d||Ah(f),a.ca=c}}}function ok(a,b,c,d){if(null!==b){for(var e=b.hl.iterator;e.next();)ok(a,e.value,c,d);e=b.layout;null===e||e.isValidLayout||(!c||e.isRealtime||0===d?(b.rh=!b.location.u(),e.doLayout(b),b.F(32),Aj(a,b),e.isValidLayout=!0):a.xh=!0)}}t.zz=function(){for(var a=new H,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&null===c.lh()&&a.add(c)}return a.iterator}; +function Hi(a){function b(a){var b=a.toLowerCase(),e=new H;c.add(a,e);c.add(b,e);d.add(a,a);d.add(b,a)}var c=new yb,d=new yb;b("InitialAnimationStarting");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("GainedFocus");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped"); +b("LostFocus");b("Modified");b("ObjectSingleClicked");b("ObjectDoubleClicked");b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");b("InvalidateDraw");a.aw=c;a.$v=d} +function Jj(a,b){var c=a.$v.L(b);return null!==c?c:a.$v.L(b.toLowerCase())}function pk(a,b){var c=a.aw.L(b);if(null!==c)return c;c=a.aw.L(b.toLowerCase());if(null!==c)return c;v("Unknown DiagramEvent name: "+b)}t.Jj=function(a,b){A(a,"string",P,"addDiagramListener:name");A(b,"function",P,"addDiagramListener:listener");a=pk(this,a);null!==a&&a.add(b);return this};t.Wl=function(a,b){A(a,"string",P,"removeDiagramListener:name");A(b,"function",P,"addDiagramListener:listener");a=pk(this,a);null!==a&&a.remove(b)}; +t.T=function(a,b,c){G&&A(a,"string",P,"raiseDiagramEvent:name");var d=pk(this,a),e=new oe;e.diagram=this;a=Jj(this,a);null!==a&&(e.name=a);void 0!==b&&(e.subject=b);void 0!==c&&(e.parameter=c);b=d.length;if(1===b)d.N(0)(e);else if(0!==b)for(d=d.Ka(),c=0;c<b;c++)(0,d[c])(e)};function qk(a){if(a.animationManager.isTicking)return!1;var b=a.currentTool;return b===a.toolManager.findTool("Dragging")?!a.xr||b.isComplexRoutingRealtime:!0} +t.ak=function(a,b){return rk(this,!1,null,b||null).ak(a.x,a.y,a.width,a.height)};P.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.ej?Xi(this,a):a.assign(this.documentBounds)}; +function rk(a,b,c,d){var e=a.bi;null===e&&(a.bi=e=new sk(a.avoidanceCellSize));if(e.fs||e.group!==c||e.Xx!==d){e.Ex=Math.max(e.Cs+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.width));e.Fx=Math.max(e.Cs+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.height));null!==c&&(c=tk(a,c));if(null===c){b=M.alloc();a.computeOccupiedArea(b);b.Bc(100,100);e.initialize(b);for(var f=a.nodes;f.next();){var g=f.value,h=g.layer;null!==h&&h.visible&&!h.isTemporary&&uk(a,g,d,b)}M.free(b)}else{0<c.memberParts.count&& +(b=a.computePartsBounds(c.memberParts,!1),b.Bc(20,20),e.initialize(b));b=M.alloc();for(f=c.memberParts;f.next();)g=f.value,g instanceof T&&uk(a,g,d,b);M.free(b)}e.group=c;e.Xx=d;e.fs=!1}else b&&vk(e);return e}function tk(a,b){return b.avoidable&&!b.isLinkLabel?b:null!==b.containingGroup?tk(a,b.containingGroup):null} +function uk(a,b,c,d){if(b!==c&&b.isVisible())if(b.avoidable&&!b.isLinkLabel){b=b.getAvoidableRect(d);a=a.bi;var e=b.x,f=b.y;if(wk(a,e,f))for(c=(f-a.Ld)/a.uc|0,d=Math.min((e+b.width-a.Kd)/a.tc|0,a.hi),b=Math.min((f+b.height-a.Ld)/a.uc|0,a.ii),e=(e-a.Kd)/a.tc|0;e<=d;e++)if(f=a.bc[e],f.fill)f.fill(xk,c,b+1);else for(var g=c;g<=b;g++)f[g]=xk}else if(b instanceof wf)for(b=b.memberParts;b.next();)e=b.value,e instanceof T&&uk(a,e,c,d)} +function yk(a,b){null===a.bi||a.bi.fs||void 0!==b&&(!b.avoidable||b.isLinkLabel)||(a.bi.fs=!0)}P.prototype.Sr=function(a){this.mp.assign(a);this.computeAutoScrollPosition(this.mp).fb(this.position)?this.xg():zk(this)}; +function zk(a){-1===a.wk&&(a.wk=va(function(){if(-1!==a.wk&&(a.xg(),null!==a.lastInput.event)){var b=a.computeAutoScrollPosition(a.mp);b.fb(a.position)||(a.position=b,a.lastInput.documentPoint=a.Es(a.mp),a.doMouseMove(),a.ej=!0,b=M.alloc(),a.computeBounds(b),b.cd(a.documentBounds),Kj(a,b),M.free(b),a.hd=!0,a.td(),zk(a))}},a.lp))}P.prototype.xg=function(){-1!==this.wk&&(sa.clearTimeout(this.wk),this.wk=-1)}; +P.prototype.computeAutoScrollPosition=function(a){var b=this.position,c=this.np;if(0>=c.top&&0>=c.left&&0>=c.right&&0>=c.bottom)return b;var d=this.viewportBounds,e=this.scale;d=M.allocAt(0,0,d.width*e,d.height*e);var f=K.allocAt(0,0);if(a.x>=d.x&&a.x<d.x+c.left&&this.allowHorizontalScroll){var g=Math.max(this.scrollHorizontalLineChange,1);g|=0;f.x-=g;a.x<d.x+c.left/2&&(f.x-=g);a.x<d.x+c.left/4&&(f.x-=4*g)}else a.x<=d.x+d.width&&a.x>d.x+d.width-c.right&&this.allowHorizontalScroll&&(g=Math.max(this.scrollHorizontalLineChange, +1),g|=0,f.x+=g,a.x>d.x+d.width-c.right/2&&(f.x+=g),a.x>d.x+d.width-c.right/4&&(f.x+=4*g));a.y>=d.y&&a.y<d.y+c.top&&this.allowVerticalScroll?(g=Math.max(this.scrollVerticalLineChange,1),g|=0,f.y-=g,a.y<d.y+c.top/2&&(f.y-=g),a.y<d.y+c.top/4&&(f.y-=4*g)):a.y<=d.y+d.height&&a.y>d.y+d.height-c.bottom&&this.allowVerticalScroll&&(g=Math.max(this.scrollVerticalLineChange,1),g|=0,f.y+=g,a.y>d.y+d.height-c.bottom/2&&(f.y+=g),a.y>d.y+d.height-c.bottom/4&&(f.y+=4*g));f.fb(zb)||(b=new K(b.x+f.x/e,b.y+f.y/e)); +M.free(d);K.free(f);return b};t=P.prototype;t.ps=function(){return null};t.av=function(){return null};t.Ey=function(a,b){this.qy.add(a,b)};t.yu=function(a){(this.Hw=a)||this.nodes.each(function(a){a instanceof wf&&(a.Qp=null)})}; +function Ak(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].cl){f=!1;break}f||a-l>k?b(c,e,h):sa.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.Qg.iterator;g.next();)if(!g.value[0].cl){f=!1;break}if("function"!==typeof e||f)return b(c,e,a);var h=a,k=c.callbackTimeout||300,l=+new Date;sa.requestAnimationFrame(function(){d()});return null}t.Wz=function(a){if(!ah)return null;void 0===a&&(a={});a.returnType="Image";return this.Gx(a)}; +t.Gx=function(a){void 0===a&&(a={});return Ak(this,this.Xz,a)}; +t.Xz=function(a,b,c){var d=Bk(c,a,"canvas",null);if(null===d)return null;c=d.ba.canvas;var e=null;if(null!==c)switch(e=a.returnType,void 0===e?e="string":e=e.toLowerCase(),e){case Ck+"data":e=d.getImageData(0,0,c.width,c.height);break;case Ck:d=(a.document||document).createElement("img");d.src=c.toDataURL(a.type,a.details);e=d;break;case "blob":"function"!==typeof b&&v('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.');if("function"=== +typeof c.toBlob)return c.toBlob(b,a.type,a.details),"toBlob";if("function"===typeof c.msToBlob)return b(c.msToBlob()),"msToBlob";b(null);return null;default:e=c.toDataURL(a.type,a.details)}return"function"===typeof b?(b(e),null):e}; +function Bk(a,b,c,d){a.animationManager.Cc();a.td();if(null===a.Na)return null;"object"!==typeof b&&v("properties argument must be an Object.");var e=!1,f=b.size||null,g=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(g="NaN");var h=b.maxSize;void 0===b.maxSize&&(e=!0,h="SVG"===c?new Hb(Infinity,Infinity):new Hb(2E3,2E3));var k=b.position||null,l=b.parts||null,m=void 0===b.padding?1:b.padding,n=b.background||null,p=b.omitTemporary;void 0===p&&(p=!0);var r=b.document||document,q=b.elementFinished|| +null,u=b.showTemporary;void 0===u&&(u=!p);b=b.showGrid;void 0===b&&(b=u);null!==f&&isNaN(f.width)&&isNaN(f.height)&&(f=null);"number"===typeof m?m=new gc(m):m instanceof gc||v("MakeImage padding must be a Margin or a number.");m.left=Math.max(m.left,0);m.right=Math.max(m.right,0);m.top=Math.max(m.top,0);m.bottom=Math.max(m.bottom,0);a.dc.Uc(!0);p=new Dk(null,r);var x=p.context;if(!(f||g||l||k)){p.width=a.Ha+Math.ceil(m.left+m.right);p.height=a.Ga+Math.ceil(m.top+m.bottom);if("SVG"===c){if(null=== +d)return null;d.resize(p.width,p.height,p.width,p.height);d.ownerDocument=r;d.Bo=q;Hj(a,d.context,m,new Hb(p.width,p.height),a.Ea,a.va,l,n,u,b);return d.context}a.Sm=!1;Hj(a,x,m,new Hb(p.width,p.height),a.Ea,a.va,l,n,u,b);a.Sm=!0;return p.context}var y=a.Gp,z=a.documentBounds.copy();z.xv(a.zb);if(u)for(var B=a.$a.s,C=B.length,D=0;D<C;D++){var J=B[D];if(J.visible&&J.isTemporary){J=J.Ra.s;for(var U=J.length,aa=0;aa<U;aa++){var Y=J[aa];Y.isInDocumentBounds&&Y.isVisible()&&(Y=Y.actualBounds,Y.u()&&z.cd(Y))}}}B= +new K(z.x,z.y);if(null!==l){C=new M(0,0,0,0);D=!0;J=l.iterator;for(J.reset();J.next();)U=J.value,U instanceof S&&(aa=U.layer,null!==aa&&!aa.visible||null!==aa&&!u&&aa.isTemporary||!U.isVisible()||(U=U.actualBounds,U.u()&&(D?(D=!1,C.assign(U)):C.cd(U))));z.width=C.width;z.height=C.height;B.x=C.x;B.y=C.y}null!==k&&k.u()&&(B=k,g||(g=y));C=k=0;null!==m&&(k=m.left+m.right,C=m.top+m.bottom);D=J=0;null!==f&&(J=f.width,D=f.height,isFinite(J)&&(J=Math.max(0,J-k)),isFinite(D)&&(D=Math.max(0,D-C)));null!==f&& +null!==g?("NaN"===g&&(g=y),f.u()?(f=J,z=D):isNaN(D)?(f=J,z=z.height*g):(f=z.width*g,z=D)):null!==f?f.u()?(g=Math.min(J/z.width,D/z.height),f=J,z=D):isNaN(D)?(g=J/z.width,f=J,z=z.height*g):(g=D/z.height,f=z.width*g,z=D):null!==g?"NaN"===g&&h.u()?(g=Math.min((h.width-k)/z.width,(h.height-C)/z.height),g>y?(g=y,f=z.width,z=z.height):(f=h.width,z=h.height)):(f=z.width*g,z=z.height*g):(g=y,f=z.width,z=z.height);null!==m?(f+=k,z+=C):m=new gc(0);null!==h&&(y=h.width,h=h.height,"SVG"!==c&&e&&!Ek&&G&&(f>y|| +z>h)&&(Fa("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(f)+"x"+Math.ceil(z)+" vs 2000x2000) Consider increasing the max size."),Ek=!0),isNaN(y)&&(y=2E3),isNaN(h)&&(h=2E3),isFinite(y)&&(f=Math.min(f,y)),isFinite(h)&&(z=Math.min(z,h)));p.width=Math.ceil(f);p.height=Math.ceil(z);if("SVG"===c){if(null===d)return null;d.resize(p.width,p.height,p.width,p.height);d.ownerDocument=r;d.Bo=q;Hj(a,d.context,m,new Hb(Math.ceil(f),Math.ceil(z)),g,B,l,n,u,b); +return d.context}a.Sm=!1;Hj(a,x,m,new Hb(Math.ceil(f),Math.ceil(z)),g,B,l,n,u,b);a.Sm=!0;return p.context} +oa.Object.defineProperties(P.prototype,{div:{configurable:!0,get:function(){return this.Qa},set:function(a){null!==a&&w(a,HTMLDivElement,P,"div");if(this.Qa!==a){var b=this.Qa;null!==b?(b.H=void 0,b.goDiagram=void 0,b.go=void 0,b.innerHTML="",null!==this.Na&&(b=this.Na.Xa,this.removeEventListener(b,"pointermove",this.ik,!1),this.removeEventListener(b,"pointerdown",this.hk,!1),this.removeEventListener(b,"pointerup",this.kk,!1),this.removeEventListener(b,"pointerout",this.jk,!1),this.Na.ex()), +this.pl&&(this.pl.disconnect(),this.pl=null),b=this.toolManager,null!==b&&(b.mouseDownTools.each(function(a){a.cancelWaitAfter()}),b.mouseMoveTools.each(function(a){a.cancelWaitAfter()}),b.mouseUpTools.each(function(a){a.cancelWaitAfter()})),b.cancelWaitAfter(),this.currentTool.doCancel(),this.Na=null,this.removeEventListener(sa,"resize",this.Gv,!1),this.removeEventListener(sa,"wheel",this.dk,!0),ye===this&&(ye=null)):this.bg=!1;this.Qa=null;if(null!==a){if(b=a.H)b.div=null;Fi(this,a);this.redraw()}}}}, +Sw:{configurable:!0,get:function(){return this.Eq}},xi:{configurable:!0,get:function(){return this.bg}},draggedLink:{configurable:!0,get:function(){return this.bt},set:function(a){this.bt!==a&&(this.bt=a,null!==a&&(this.Nt=a.fromPort,this.Ot=a.toPort))}},Kx:{configurable:!0,get:function(){return this.Nt},set:function(a){this.Nt=a}},Lx:{configurable:!0,get:function(){return this.Ot},set:function(a){this.Ot=a}},animationManager:{configurable:!0, +enumerable:!0,get:function(){return this.Xd}},undoManager:{configurable:!0,get:function(){return this.fc.undoManager}},skipsUndoManager:{configurable:!0,get:function(){return this.Xg},set:function(a){A(a,"boolean",P,"skipsUndoManager");this.Xg=a;this.fc.skipsUndoManager=a}},delaysLayout:{configurable:!0,get:function(){return this.$s},set:function(a){this.$s=a}},opacity:{configurable:!0,get:function(){return this.yb},set:function(a){var b=this.yb; +b!==a&&(A(a,"number",P,"opacity"),(0>a||1<a)&&Ba(a,"0 <= value <= 1",P,"opacity"),this.yb=a,this.g("opacity",b,a),this.R())}},validCycle:{configurable:!0,get:function(){return this.ou},set:function(a){var b=this.ou;b!==a&&(ab(a,P,P,"validCycle"),this.ou=a,this.g("validCycle",b,a))}},layers:{configurable:!0,get:function(){return this.$a.iterator}},isModelReadOnly:{configurable:!0,get:function(){var a=this.fc;return null===a?!1:a.isReadOnly},set:function(a){var b= +this.fc;null!==b&&(b.isReadOnly=a)}},isReadOnly:{configurable:!0,get:function(){return this.Jg},set:function(a){var b=this.Jg;b!==a&&(A(a,"boolean",P,"isReadOnly"),this.Jg=a,this.g("isReadOnly",b,a))}},isEnabled:{configurable:!0,get:function(){return this.Gd},set:function(a){var b=this.Gd;b!==a&&(A(a,"boolean",P,"isEnabled"),this.Gd=a,this.g("isEnabled",b,a))}},allowClipboard:{configurable:!0,get:function(){return this.Js},set:function(a){var b=this.Js;b!== +a&&(A(a,"boolean",P,"allowClipboard"),this.Js=a,this.g("allowClipboard",b,a))}},allowCopy:{configurable:!0,get:function(){return this.Mi},set:function(a){var b=this.Mi;b!==a&&(A(a,"boolean",P,"allowCopy"),this.Mi=a,this.g("allowCopy",b,a))}},allowDelete:{configurable:!0,get:function(){return this.Ni},set:function(a){var b=this.Ni;b!==a&&(A(a,"boolean",P,"allowDelete"),this.Ni=a,this.g("allowDelete",b,a))}},allowDragOut:{configurable:!0,get:function(){return this.Ks}, +set:function(a){var b=this.Ks;b!==a&&(A(a,"boolean",P,"allowDragOut"),this.Ks=a,this.g("allowDragOut",b,a))}},allowDrop:{configurable:!0,get:function(){return this.Ls},set:function(a){var b=this.Ls;b!==a&&(A(a,"boolean",P,"allowDrop"),this.Ls=a,this.g("allowDrop",b,a))}},allowTextEdit:{configurable:!0,get:function(){return this.Wi},set:function(a){var b=this.Wi;b!==a&&(A(a,"boolean",P,"allowTextEdit"),this.Wi=a,this.g("allowTextEdit",b,a))}},allowGroup:{configurable:!0, +enumerable:!0,get:function(){return this.Oi},set:function(a){var b=this.Oi;b!==a&&(A(a,"boolean",P,"allowGroup"),this.Oi=a,this.g("allowGroup",b,a))}},allowUngroup:{configurable:!0,get:function(){return this.Xi},set:function(a){var b=this.Xi;b!==a&&(A(a,"boolean",P,"allowUngroup"),this.Xi=a,this.g("allowUngroup",b,a))}},allowInsert:{configurable:!0,get:function(){return this.Ns},set:function(a){var b=this.Ns;b!==a&&(A(a,"boolean",P,"allowInsert"),this.Ns=a,this.g("allowInsert", +b,a))}},allowLink:{configurable:!0,get:function(){return this.Pi},set:function(a){var b=this.Pi;b!==a&&(A(a,"boolean",P,"allowLink"),this.Pi=a,this.g("allowLink",b,a))}},allowRelink:{configurable:!0,get:function(){return this.Ri},set:function(a){var b=this.Ri;b!==a&&(A(a,"boolean",P,"allowRelink"),this.Ri=a,this.g("allowRelink",b,a))}},allowMove:{configurable:!0,get:function(){return this.Qi},set:function(a){var b=this.Qi;b!==a&&(A(a,"boolean",P,"allowMove"), +this.Qi=a,this.g("allowMove",b,a))}},allowReshape:{configurable:!0,get:function(){return this.Si},set:function(a){var b=this.Si;b!==a&&(A(a,"boolean",P,"allowReshape"),this.Si=a,this.g("allowReshape",b,a))}},allowResize:{configurable:!0,get:function(){return this.Ti},set:function(a){var b=this.Ti;b!==a&&(A(a,"boolean",P,"allowResize"),this.Ti=a,this.g("allowResize",b,a))}},allowRotate:{configurable:!0,get:function(){return this.Ui},set:function(a){var b=this.Ui; +b!==a&&(A(a,"boolean",P,"allowRotate"),this.Ui=a,this.g("allowRotate",b,a))}},allowSelect:{configurable:!0,get:function(){return this.Vi},set:function(a){var b=this.Vi;b!==a&&(A(a,"boolean",P,"allowSelect"),this.Vi=a,this.g("allowSelect",b,a))}},allowUndo:{configurable:!0,get:function(){return this.Os},set:function(a){var b=this.Os;b!==a&&(A(a,"boolean",P,"allowUndo"),this.Os=a,this.g("allowUndo",b,a))}},allowZoom:{configurable:!0,get:function(){return this.Qs}, +set:function(a){var b=this.Qs;b!==a&&(A(a,"boolean",P,"allowZoom"),this.Qs=a,this.g("allowZoom",b,a))}},hasVerticalScrollbar:{configurable:!0,get:function(){return this.fn},set:function(a){var b=this.fn;b!==a&&(A(a,"boolean",P,"hasVerticalScrollbar"),this.fn=a,jj(this),this.R(),this.g("hasVerticalScrollbar",b,a),Yi(this,!1))}},hasHorizontalScrollbar:{configurable:!0,get:function(){return this.en},set:function(a){var b=this.en;b!==a&&(A(a,"boolean",P,"hasHorizontalScrollbar"), +this.en=a,jj(this),this.R(),this.g("hasHorizontalScrollbar",b,a),Yi(this,!1))}},allowHorizontalScroll:{configurable:!0,get:function(){return this.Ms},set:function(a){var b=this.Ms;b!==a&&(A(a,"boolean",P,"allowHorizontalScroll"),this.Ms=a,this.g("allowHorizontalScroll",b,a),Yi(this,!1))}},allowVerticalScroll:{configurable:!0,get:function(){return this.Ps},set:function(a){var b=this.Ps;b!==a&&(A(a,"boolean",P,"allowVerticalScroll"),this.Ps=a,this.g("allowVerticalScroll", +b,a),Yi(this,!1))}},scrollHorizontalLineChange:{configurable:!0,get:function(){return this.au},set:function(a){var b=this.au;b!==a&&(A(a,"number",P,"scrollHorizontalLineChange"),0>a&&Ba(a,">= 0",P,"scrollHorizontalLineChange"),this.au=a,this.g("scrollHorizontalLineChange",b,a))}},scrollVerticalLineChange:{configurable:!0,get:function(){return this.eu},set:function(a){var b=this.eu;b!==a&&(A(a,"number",P,"scrollVerticalLineChange"),0>a&&Ba(a,">= 0",P,"scrollVerticalLineChange"), +this.eu=a,this.g("scrollVerticalLineChange",b,a))}},lastInput:{configurable:!0,get:function(){return this.kj},set:function(a){G&&w(a,me,P,"lastInput");this.kj=a}},previousInput:{configurable:!0,get:function(){return this.Sg},set:function(a){G&&w(a,me,P,"previousInput");this.Sg=a}},firstInput:{configurable:!0,get:function(){return this.Sp},set:function(a){G&&w(a,me,P,"firstInput");this.Sp=a}},currentCursor:{configurable:!0,get:function(){return this.Xs}, +set:function(a){""===a&&(a=this.Fp);if(this.Xs!==a){A(a,"string",P,"currentCursor");var b=this.Na,c=this.Qa;if(null!==b&&null!==c){this.Xs=a;var d=b.style.cursor;b.style.cursor=a;c.style.cursor=a;b.style.cursor===d&&(b.style.cursor="-webkit-"+a,c.style.cursor="-webkit-"+a,b.style.cursor===d&&(b.style.cursor="-moz-"+a,c.style.cursor="-moz-"+a,b.style.cursor===d&&(b.style.cursor=a,c.style.cursor=a)))}}}},defaultCursor:{configurable:!0,get:function(){return this.Fp},set:function(a){""=== +a&&(a="auto");var b=this.Fp;b!==a&&(A(a,"string",P,"defaultCursor"),this.Fp=a,this.g("defaultCursor",b,a))}},click:{configurable:!0,get:function(){return this.zh},set:function(a){var b=this.zh;b!==a&&(null!==a&&A(a,"function",P,"click"),this.zh=a,this.g("click",b,a))}},doubleClick:{configurable:!0,get:function(){return this.Fh},set:function(a){var b=this.Fh;b!==a&&(null!==a&&A(a,"function",P,"doubleClick"),this.Fh=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0, +enumerable:!0,get:function(){return this.Bh},set:function(a){var b=this.Bh;b!==a&&(null!==a&&A(a,"function",P,"contextClick"),this.Bh=a,this.g("contextClick",b,a))}},mouseOver:{configurable:!0,get:function(){return this.Vh},set:function(a){var b=this.Vh;b!==a&&(null!==a&&A(a,"function",P,"mouseOver"),this.Vh=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return this.Th},set:function(a){var b=this.Th;b!==a&&(null!==a&&A(a,"function",P,"mouseHover"), +this.Th=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0,get:function(){return this.Sh},set:function(a){var b=this.Sh;b!==a&&(null!==a&&A(a,"function",P,"mouseHold"),this.Sh=a,this.g("mouseHold",b,a))}},mouseDragOver:{configurable:!0,get:function(){return this.It},set:function(a){var b=this.It;b!==a&&(null!==a&&A(a,"function",P,"mouseDragOver"),this.It=a,this.g("mouseDragOver",b,a))}},mouseDrop:{configurable:!0,get:function(){return this.Qh},set:function(a){var b= +this.Qh;b!==a&&(G&&null!==a&&A(a,"function",P,"mouseDrop"),this.Qh=a,this.g("mouseDrop",b,a))}},handlesDragDropForTopLevelParts:{configurable:!0,get:function(){return this.mt},set:function(a){var b=this.mt;b!==a&&(A(a,"boolean",P,"handlesDragDropForTopLevelParts"),this.mt=a,this.g("handlesDragDropForTopLevelParts",b,a))}},mouseEnter:{configurable:!0,get:function(){return this.Rh},set:function(a){var b=this.Rh;b!==a&&(null!==a&&A(a,"function",P,"mouseEnter"),this.Rh=a,this.g("mouseEnter", +b,a))}},mouseLeave:{configurable:!0,get:function(){return this.Uh},set:function(a){var b=this.Uh;b!==a&&(null!==a&&A(a,"function",P,"mouseLeave"),this.Uh=a,this.g("mouseLeave",b,a))}},toolTip:{configurable:!0,get:function(){return this.ei},set:function(a){var b=this.ei;b!==a&&(!G||null===a||a instanceof Ce||a instanceof Me||v("Diagram.toolTip must be an Adornment or HTMLInfo."),this.ei=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return this.Ch}, +set:function(a){var b=this.Ch;b!==a&&(!G||a instanceof Ce||a instanceof Me||v("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.Ch=a,this.g("contextMenu",b,a))}},commandHandler:{configurable:!0,get:function(){return this.ob},set:function(a){this.ob!==a&&(this.ob=a,a.Ye(this))}},toolManager:{configurable:!0,get:function(){return this.ue},set:function(a){this.ue!==a&&(w(a,Ua,P,"toolManager"),this.ue=a,a.diagram=this)}},defaultTool:{configurable:!0, +get:function(){return this.tb},set:function(a){var b=this.tb;b!==a&&(w(a,xe,P,"defaultTool"),this.tb=a,a.diagram=this,this.currentTool===b&&(this.currentTool=a))}},currentTool:{configurable:!0,get:function(){return this.jb},set:function(a){var b=this.jb;b&&(b.isActive&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.defaultTool);null!==a&&(w(a,xe,P,"currentTool"),this.jb=a,a.diagram=this,a.doStart())}},selection:{configurable:!0,get:function(){return this.zw}}, +maxSelectionCount:{configurable:!0,get:function(){return this.Dt},set:function(a){var b=this.Dt;if(b!==a)if(A(a,"number",P,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Dt=a,this.g("maxSelectionCount",b,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0<a)){this.T("ChangingSelection",this.selection);b=this.selection.Ka();for(var c=0;c<a;c++)b[c].isSelected=!1;this.T("ChangedSelection",this.selection)}}else Ba(a,">= 0",P,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{configurable:!0, +enumerable:!0,get:function(){return this.Kt},set:function(a){var b=this.Kt;b!==a&&(w(a,Ce,P,"nodeSelectionAdornmentTemplate"),this.Kt=a,this.g("nodeSelectionAdornmentTemplate",b,a))}},groupSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.lt},set:function(a){var b=this.lt;b!==a&&(w(a,Ce,P,"groupSelectionAdornmentTemplate"),this.lt=a,this.g("groupSelectionAdornmentTemplate",b,a))}},linkSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.At}, +set:function(a){var b=this.At;b!==a&&(w(a,Ce,P,"linkSelectionAdornmentTemplate"),this.At=a,this.g("linkSelectionAdornmentTemplate",b,a))}},highlighteds:{configurable:!0,get:function(){return this.gw}},isModified:{configurable:!0,get:function(){var a=this.undoManager;return a.isEnabled?null!==a.currentTransaction?!0:this.kn&&this.Ce!==a.historyIndex:this.kn},set:function(a){if(this.kn!==a){A(a,"boolean",P,"isModified");this.kn=a;var b=this.undoManager;!a&&b.isEnabled&&(this.Ce= +b.historyIndex);a||hk(this)}}},model:{configurable:!0,get:function(){return this.fc},set:function(a){var b=this.fc;if(b!==a){w(a,X,P,"model");this.currentTool.doCancel();b&&b.undoManager!==a.undoManager&&b.undoManager.isInTransaction&&v("Do not replace a Diagram.model while a transaction is in progress.");this.animationManager.Cc(!0);var c=Ni(this,!0);this.bg=!1;this.Zm=!0;this.Ce=-2;this.og=!1;var d=this.Bb;this.Bb=!0;yh(this.animationManager,"Model");b&&(null!==this.pf&&this.pf.each(function(a){b.mk(a)}), +b.mk(this.Nc));this.fc=a;this.partManager=ik(this.fc.type);for(var e=0;e<c.length;e++)this.add(c[e]);a.fh(this.Ib);this.partManager.addAllModeledParts();a.mk(this.Ib);a.fh(this.Nc);null!==this.pf&&this.pf.each(function(b){a.fh(b)});this.Bb=d;this.ab();this.Bb||this.R();b&&a.undoManager.copyProperties(b.undoManager)}}},ca:{configurable:!0,get:function(){return this.kw},set:function(a){this.kw=a}},ns:{configurable:!0,get:function(){return this.py}},skipsModelSourceBindings:{configurable:!0, +enumerable:!0,get:function(){return this.Aw},set:function(a){this.Aw=a}},Bs:{configurable:!0,get:function(){return this.gu},set:function(a){this.gu=a}},nodeTemplate:{configurable:!0,get:function(){return this.Pg.L("")},set:function(a){var b=this.Pg.L("");b!==a&&(w(a,S,P,"nodeTemplate"),this.Pg.add("",a),this.g("nodeTemplate",b,a),this.undoManager.isUndoingRedoing||this.Ud())}},nodeTemplateMap:{configurable:!0,get:function(){return this.Pg},set:function(a){var b= +this.Pg;b!==a&&(w(a,yb,P,"nodeTemplateMap"),this.Pg=a,this.g("nodeTemplateMap",b,a),this.undoManager.isUndoingRedoing||this.Ud())}},groupTemplate:{configurable:!0,get:function(){return this.dj.L("")},set:function(a){var b=this.dj.L("");b!==a&&(w(a,wf,P,"groupTemplate"),this.dj.add("",a),this.g("groupTemplate",b,a),this.undoManager.isUndoingRedoing||this.Ud())}},groupTemplateMap:{configurable:!0,get:function(){return this.dj},set:function(a){var b=this.dj;b!==a&&(w(a,yb, +P,"groupTemplateMap"),this.dj=a,this.g("groupTemplateMap",b,a),this.undoManager.isUndoingRedoing||this.Ud())}},linkTemplate:{configurable:!0,get:function(){return this.Oh.L("")},set:function(a){var b=this.Oh.L("");b!==a&&(w(a,R,P,"linkTemplate"),this.Oh.add("",a),this.g("linkTemplate",b,a),this.undoManager.isUndoingRedoing||this.Ud())}},linkTemplateMap:{configurable:!0,get:function(){return this.Oh},set:function(a){var b=this.Oh;b!==a&&(w(a,yb,P,"linkTemplateMap"),this.Oh= +a,this.g("linkTemplateMap",b,a),this.undoManager.isUndoingRedoing||this.Ud())}},isMouseCaptured:{configurable:!0,get:function(){return this.jw},set:function(a){var b=this.Na;null!==b&&(b=b.Xa,b instanceof SVGElement||(a?(this.lastInput.bubbles=!1,this.removeEventListener(b,"pointermove",this.ik,!1),this.removeEventListener(b,"pointerdown",this.hk,!1),this.removeEventListener(b,"pointerup",this.kk,!1),this.removeEventListener(b,"pointerout",this.jk,!1),this.addEventListener(sa,"pointermove", +this.ik,!0),this.addEventListener(sa,"pointerdown",this.hk,!0),this.addEventListener(sa,"pointerup",this.kk,!0),this.addEventListener(sa,"pointerout",this.jk,!0),this.removeEventListener(b,"wheel",this.dk,!1),this.addEventListener(sa,"wheel",this.dk,!0),this.addEventListener(sa,"selectstart",this.preventDefault,!1)):(this.removeEventListener(sa,"pointermove",this.ik,!0),this.removeEventListener(sa,"pointerdown",this.hk,!0),this.removeEventListener(sa,"pointerup",this.kk,!0),this.removeEventListener(sa, +"pointerout",this.jk,!0),this.addEventListener(b,"pointermove",this.ik,!1),this.addEventListener(b,"pointerdown",this.hk,!1),this.addEventListener(b,"pointerup",this.kk,!1),this.addEventListener(b,"pointerout",this.jk,!1),this.removeEventListener(sa,"wheel",this.dk,!0),this.removeEventListener(sa,"selectstart",this.preventDefault,!1),this.addEventListener(b,"wheel",this.dk,!1)),this.jw=a))}},position:{configurable:!0,get:function(){return this.va},set:function(a){var b=K.alloc().assign(this.va); +if(!b.D(a)){w(a,K,P,"position");var c=this.viewportBounds.copy();this.va.assign(a);Qh(this.animationManager,b,this.va);this.Bb||null===this.Na&&!this.mo.u()?Pi(this):(this.Bb=!0,a=this.scale,ij(this,this.Jp,this.Ha/a,this.Ga/a,this.Ak,!1),this.Bb=!1);if(!this.Bb)this.onViewportBoundsChanged(c,this.viewportBounds,this.Ea,!1)}K.free(b)}},initialPosition:{configurable:!0,get:function(){return this.ot},set:function(a){this.ot.D(a)||(w(a,K,P,"initialPosition"),this.ot=a.M())}},initialScale:{configurable:!0, +enumerable:!0,get:function(){return this.pt},set:function(a){this.pt!==a&&(A(a,"number",P,"initialScale"),this.pt=a)}},grid:{configurable:!0,get:function(){null===this.ee&&(this.ee=Si(this));return this.ee},set:function(a){var b=this.ee;if(b!==a){null===b&&(b=this.ee=Si(this));w(a,V,P,"grid");a.type!==V.Grid&&v("Diagram.grid must be a Panel of type Panel.Grid");var c=b.panel;null!==c&&c.remove(b);this.ee=a;a.name="GRID";null!==c&&c.add(a);xj(this);this.R();this.g("grid",b,a)}}},viewportBounds:{configurable:!0, +enumerable:!0,get:function(){return this.Jw}},viewSize:{configurable:!0,get:function(){return this.mo},set:function(a){var b=this.viewSize;b.D(a)||(w(a,Hb,P,"viewSize"),this.mo=a=a.M(),this.Ga=this.Ha=0,a.u()?(this.Ha=a.width,this.Ga=a.height):null!==this.Qa&&(this.Ha=this.Qa.clientWidth||1,this.Ga=this.Qa.clientHeight||1),Pi(this),this.ab(),this.g("viewSize",b,a),this.redraw())}},fixedBounds:{configurable:!0,get:function(){return this.jt},set:function(a){var b=this.jt; +b.D(a)||(w(a,M,P,"fixedBounds"),(G&&Infinity===a.width||-Infinity===a.width||Infinity===a.height||-Infinity===a.height)&&v("fixedBounds width/height must not be Infinity"),this.jt=a=a.M(),this.ab(),this.g("fixedBounds",b,a))}},scrollMargin:{configurable:!0,get:function(){return this.zj},set:function(a){"number"===typeof a?a=new gc(a):w(a,gc,P,"scrollMargin");var b=this.zj;b.D(a)||(this.zj=a=a.M(),this.g("scrollMargin",b,a),this.Wo())}},scrollMode:{configurable:!0,get:function(){return this.Aj}, +set:function(a){var b=this.Aj;b!==a&&(ab(a,P,P,"scrollMode"),this.Aj=a,a===di&&Yi(this,!1),this.g("scrollMode",b,a),this.R())}},scrollsPageOnFocus:{configurable:!0,get:function(){return this.fu},set:function(a){var b=this.fu;b!==a&&(A(a,"boolean",P,"scrollsPageOnFocus"),this.fu=a,this.g("scrollsPageOnFocus",b,a))}},positionComputation:{configurable:!0,get:function(){return this.Rt},set:function(a){var b=this.Rt;b!==a&&(null!==a&&A(a,"function",P,"positionComputation"), +this.Rt=a,Yi(this,!1),this.g("positionComputation",b,a))}},scaleComputation:{configurable:!0,get:function(){return this.Yt},set:function(a){var b=this.Yt;b!==a&&(null!==a&&A(a,"function",P,"scaleComputation"),this.Yt=a,fk(this,this.scale,this.scale),this.g("scaleComputation",b,a))}},documentBounds:{configurable:!0,get:function(){return this.Jp}},isVirtualized:{configurable:!0,get:function(){return this.yt},set:function(a){var b=this.yt;b!==a&&(A(a,"boolean", +P,"isVirtualized"),this.yt=a,this.g("isVirtualized",b,a))}},scale:{configurable:!0,get:function(){return this.Ea},set:function(a){var b=this.Ea;E(a,P,"scale");b!==a&&fk(this,b,a)}},defaultScale:{configurable:!0,get:function(){return this.Gp},set:function(a){G&&E(a,P,"defaultScale");!G||0<a||v("defaultScale must be larger than zero, not: "+a);this.Gp=a}},autoScale:{configurable:!0,get:function(){return this.yh},set:function(a){var b=this.yh;b!==a&&(ab(a,P, +P,"autoScale"),this.yh=a,this.g("autoScale",b,a),a!==Eh&&Yi(this,!1))}},initialAutoScale:{configurable:!0,get:function(){return this.Ig},set:function(a){var b=this.Ig;b!==a&&(ab(a,P,P,"initialAutoScale"),this.Ig=a,this.g("initialAutoScale",b,a))}},initialViewportSpot:{configurable:!0,get:function(){return this.qt},set:function(a){var b=this.qt;b!==a&&(w(a,Ib,P,"initialViewportSpot"),a.mb()||v("initialViewportSpot must be a specific Spot: "+a),this.qt=a,this.g("initialViewportSpot", +b,a))}},initialDocumentSpot:{configurable:!0,get:function(){return this.nt},set:function(a){var b=this.nt;b!==a&&(w(a,Ib,P,"initialDocumentSpot"),a.mb()||v("initialViewportSpot must be a specific Spot: "+a),this.nt=a,this.g("initialDocumentSpot",b,a))}},minScale:{configurable:!0,get:function(){return this.Gt},set:function(a){E(a,P,"minScale");var b=this.Gt;b!==a&&(0<a?(this.Gt=a,this.g("minScale",b,a),a>this.scale&&(this.scale=a)):Ba(a,"> 0",P,"minScale"))}},maxScale:{configurable:!0, +enumerable:!0,get:function(){return this.Ct},set:function(a){E(a,P,"maxScale");var b=this.Ct;b!==a&&(0<a?(this.Ct=a,this.g("maxScale",b,a),a<this.scale&&(this.scale=a)):Ba(a,"> 0",P,"maxScale"))}},zoomPoint:{configurable:!0,get:function(){return this.ru},set:function(a){this.ru.D(a)||(w(a,K,P,"zoomPoint"),this.ru=a=a.M())}},contentAlignment:{configurable:!0,get:function(){return this.Ak},set:function(a){var b=this.Ak;b.D(a)||(w(a,Ib,P,"contentAlignment"),this.Ak=a=a.M(), +this.g("contentAlignment",b,a),Yi(this,!1))}},initialContentAlignment:{configurable:!0,get:function(){return this.eq},set:function(a){var b=this.eq;b.D(a)||(w(a,Ib,P,"initialContentAlignment"),this.eq=a=a.M(),this.g("initialContentAlignment",b,a))}},padding:{configurable:!0,get:function(){return this.zb},set:function(a){"number"===typeof a?a=new gc(a):w(a,gc,P,"padding");var b=this.zb;b.D(a)||(this.zb=a=a.M(),this.ab(),this.g("padding",b,a))}},partManager:{configurable:!0, +enumerable:!0,get:function(){return this.Oc},set:function(a){var b=this.Oc;b!==a&&(w(a,zi,P,"partManager"),null!==a.diagram&&v("Cannot share PartManagers between Diagrams: "+a.toString()),b&&b.Ye(null),this.Oc=a,a.Ye(this))}},nodes:{configurable:!0,get:function(){return this.partManager.nodes.iterator}},links:{configurable:!0,get:function(){return this.partManager.links.iterator}},parts:{configurable:!0,get:function(){return this.partManager.parts.iterator}}, +layout:{configurable:!0,get:function(){return this.Qc},set:function(a){var b=this.Qc;b!==a&&(w(a,Di,P,"layout"),this.Qc=a,a.diagram=this,a.group=null,this.xh=!0,this.g("layout",b,a),this.Sb())}},isTreePathToChildren:{configurable:!0,get:function(){return this.xt},set:function(a){var b=this.xt;if(b!==a&&(A(a,"boolean",P,"isTreePathToChildren"),this.xt=a,this.g("isTreePathToChildren",b,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Fk(a.value)}},treeCollapsePolicy:{configurable:!0, +enumerable:!0,get:function(){return this.mu},set:function(a){var b=this.mu;b!==a&&(a!==Ii&&a!==Gk&&a!==Pk&&v("Unknown Diagram.treeCollapsePolicy: "+a),this.mu=a,this.g("treeCollapsePolicy",b,a))}},Ve:{configurable:!0,get:function(){return this.iw},set:function(a){this.iw=a}},avoidanceCellSize:{configurable:!0,get:function(){return this.Tv},set:function(a){this.bi=null;this.Tv=new Hb(Math.max(1,a.width),Math.max(1,a.height))}},avoidanceLimit:{configurable:!0, +get:function(){return this.Uv},set:function(a){this.Uv=Math.max(1,a)}},autoScrollInterval:{configurable:!0,get:function(){return this.lp},set:function(a){var b=this.lp;E(a,P,"scale");b!==a&&(this.lp=a,this.g("autoScrollInterval",b,a))}},autoScrollRegion:{configurable:!0,get:function(){return this.np},set:function(a){"number"===typeof a?a=new gc(a):w(a,gc,P,"autoScrollRegion");var b=this.np;b.D(a)||(this.np=a=a.M(),this.ab(),this.g("autoScrollRegion",b,a))}}}); +oa.Object.defineProperties(P,{licenseKey:{configurable:!0,get:function(){return Tk.lc()},set:function(a){Tk.add(a.replace(/\s/g,""))}},version:{configurable:!0,get:function(){return Uk}}});P.prototype.makeImageData=P.prototype.Gx;P.prototype.makeImage=P.prototype.Wz;P.prototype.cacheGroupExternalLinks=P.prototype.yu;P.prototype.addRenderer=P.prototype.Ey;P.prototype.makeSVG=P.prototype.av;P.prototype.makeSvg=P.prototype.ps;P.prototype.stopAutoScroll=P.prototype.xg; +P.prototype.doAutoScroll=P.prototype.Sr;P.prototype.isUnoccupied=P.prototype.ak;P.prototype.raiseDiagramEvent=P.prototype.T;P.prototype.removeDiagramListener=P.prototype.Wl;P.prototype.addDiagramListener=P.prototype.Jj;P.prototype.findTreeRoots=P.prototype.zz;P.prototype.layoutDiagram=P.prototype.Uz;P.prototype.findTopLevelGroups=P.prototype.rz;P.prototype.findTopLevelNodesAndLinks=P.prototype.sz;P.prototype.ensureBounds=P.prototype.eb;P.prototype.findLinksByExample=P.prototype.Vr; +P.prototype.findNodesByExample=P.prototype.Wr;P.prototype.findLinkForData=P.prototype.Kc;P.prototype.findNodeForData=P.prototype.oi;P.prototype.findPartForData=P.prototype.Lc;P.prototype.findLinkForKey=P.prototype.findLinkForKey;P.prototype.findNodeForKey=P.prototype.Qb;P.prototype.findPartForKey=P.prototype.findPartForKey;P.prototype.rebuildParts=P.prototype.Ud;P.prototype.transformViewToDoc=P.prototype.Es;P.prototype.transformRectDocToView=P.prototype.zA;P.prototype.transformDocToView=P.prototype.ep; +P.prototype.centerRect=P.prototype.Qr;P.prototype.scrollToRect=P.prototype.pv;P.prototype.scroll=P.prototype.scroll;P.prototype.highlightCollection=P.prototype.Lz;P.prototype.highlight=P.prototype.Kz;P.prototype.selectCollection=P.prototype.qA;P.prototype.select=P.prototype.select;P.prototype.updateAllRelationshipsFromData=P.prototype.hp;P.prototype.updateAllTargetBindings=P.prototype.updateAllTargetBindings;P.prototype.commit=P.prototype.commit;P.prototype.rollbackTransaction=P.prototype.Nf; +P.prototype.commitTransaction=P.prototype.kb;P.prototype.startTransaction=P.prototype.Ja;P.prototype.raiseChanged=P.prototype.g;P.prototype.raiseChangedEvent=P.prototype.ib;P.prototype.removeChangedListener=P.prototype.mk;P.prototype.addChangedListener=P.prototype.fh;P.prototype.removeModelChangedListener=P.prototype.lA;P.prototype.addModelChangedListener=P.prototype.Qw;P.prototype.findLayer=P.prototype.Vj;P.prototype.removeLayer=P.prototype.jA;P.prototype.addLayerAfter=P.prototype.Ay; +P.prototype.addLayerBefore=P.prototype.Ow;P.prototype.addLayer=P.prototype.Cl;P.prototype.moveParts=P.prototype.moveParts;P.prototype.copyParts=P.prototype.Rj;P.prototype.removeParts=P.prototype.vs;P.prototype.remove=P.prototype.remove;P.prototype.add=P.prototype.add;P.prototype.clearDelayedGeometries=P.prototype.zu;P.prototype.setProperties=P.prototype.im;P.prototype.attach=P.prototype.xu;P.prototype.set=P.prototype.set;P.prototype.resetInputOptions=P.prototype.Qx;P.prototype.setInputOption=P.prototype.rA; +P.prototype.getInputOption=P.prototype.Ml;P.prototype.resetRenderingHints=P.prototype.Rx;P.prototype.setRenderingHint=P.prototype.Vx;P.prototype.getRenderingHint=P.prototype.Te;P.prototype.maybeUpdate=P.prototype.td;P.prototype.requestUpdate=P.prototype.Sb;P.prototype.delayInitialization=P.prototype.Vy;P.prototype.isUpdateRequested=P.prototype.Qz;P.prototype.invalidateDocumentBounds=P.prototype.ab;P.prototype.findObjectsNear=P.prototype.tg;P.prototype.findPartsNear=P.prototype.nz; +P.prototype.findObjectsIn=P.prototype.Ff;P.prototype.findPartsIn=P.prototype.nx;P.prototype.findObjectsAt=P.prototype.pi;P.prototype.findPartsAt=P.prototype.mz;P.prototype.findObjectAt=P.prototype.jc;P.prototype.findPartAt=P.prototype.Kl;P.prototype.focusObject=P.prototype.Az;P.prototype.alignDocument=P.prototype.Gy;P.prototype.zoomToRect=P.prototype.DA;P.prototype.zoomToFit=P.prototype.zoomToFit;P.prototype.diagramScroll=P.prototype.ax;P.prototype.focus=P.prototype.focus; +var yi=new yb,Qi=null,ah=void 0!==sa.document,Li=null,Mi="",Eh=new F(P,"None",0),lj=new F(P,"Uniform",1),mj=new F(P,"UniformToFill",2),Sf=new F(P,"CycleAll",10),Wf=new F(P,"CycleNotDirected",11),Yf=new F(P,"CycleNotDirectedFast",12),Zf=new F(P,"CycleNotUndirected",13),Tf=new F(P,"CycleDestinationTree",14),Vf=new F(P,"CycleSourceTree",15),di=new F(P,"DocumentScroll",1),fi=new F(P,"InfiniteScroll",2),Ii=new F(P,"TreeParentCollapsed",21),Gk=new F(P,"AllParentsCollapsed",22),Pk=new F(P,"AnyParentsCollapsed", +23),Tk=new H,Uk="2.2.16",Ck="image",Ek=!1,Vk=null,wi=!1; +function xi(){if(ah){var a=sa.document.createElement("canvas"),b=a.getContext("2d"),c=Va("7ca11abfd022028846");b[c]=Va("398c3597c01238");for(var d=["5da73c80a36455d6038e4972187c3cae51fd22",ta.Dx+"4ae6247590da4bb21c324ba3a84e385776",Jb.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",L.za],e=1;5>e;e++)b[Va("7ca11abfd7330390")](Va(d[e-1]),10,15*e);b[c]=Va("39f046ebb36e4b");for(c=1;5>c;c++)b[Va("7ca11abfd7330390")](Va(d[c-1]),10,15*c);if(4!==d.length||"5"!==d[0][0]||"7"!==d[3][0])Jb.prototype.Rd=Jb.prototype.Tw; +Vk=a}}P.className="Diagram";P.fromDiv=function(a){var b=a;"string"===typeof a&&(b=sa.document.getElementById(a));return b instanceof HTMLDivElement&&b.H instanceof P?b.H:null};P.inherit=function(a,b){function c(){}if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);A(a,"function",P,"inherit");A(b,"function",P,"inherit");c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};P.useDOM=function(a){ah=a?void 0!==sa.document:!1}; +P.isUsingDOM=function(){return ah};P.None=Eh;P.Uniform=lj;P.UniformToFill=mj;P.CycleAll=Sf;P.CycleNotDirected=Wf;P.CycleNotDirectedFast=Yf;P.CycleNotUndirected=Zf;P.CycleDestinationTree=Tf;P.CycleSourceTree=Vf;P.DocumentScroll=di;P.InfiniteScroll=fi;P.TreeParentCollapsed=Ii;P.AllParentsCollapsed=Gk;P.AnyParentsCollapsed=Pk;function Ei(){this.vy=null;this.j="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.vd=this.j=!0:this.vd=null} +function Gj(a,b){b.dc.setTransform(b.qc,0,0,b.qc,0,0);b.dc.Vc();if(null===a.vd)a:{b="f";var c=sa[Va("76a715b2f73f148a")][Va("72ba13b5")];a.vd=!0;if(ah){var d=P[Va("76a115b6ed251eaf4692")];if(d)for(var e=Tk.iterator;e.next();){d=e.value;d=Va(d).split(Va("39e9"));if(6>d.length)break;var f=Va(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Va(ta[Va("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){var h=sa[Va("74a900bae4370f8b51")][Va("6fbb13a1c2311e8a57")].toLowerCase();g=h[Va("73a612b6fb191d")](Va("3aad1ab6e022098b4dc4")); +f=Va(d[2]);if(-1<g&&(h=h[Va("73a612b6fb191d")](f.toLowerCase()+"/"),a.vd=!(-1<h&&h<g),!a.vd))break;g=c[Va("76ad18b4f73e")];for(h=c[Va("73a612b6fb191d")](Va("35e7"))+2;h<g;h++)b+=c[h];g=b[Va("73a612b6fb191d")](f);0>g&&f!==Va("7da71ca0ad381e90")&&(g=b[Va("73a612b6fb191d")](Va("76a715b2ef3e149757")));0>g&&(g=b[Va("73a612b6fb191d")](Va("76a715b2ef3e149757")));0>g&&(g=c[Va("73a612b6fb191d")](Va("7baa19a6f76c1988428554")));a.vd=!(0<=g&&g<b[Va("73a612b6fb191d")](Va("35"))||-1===b[Va("73a612b6fb191d")](Va("35"))); +if(!a.vd)break;if(c[Va("73a612b6fb191d")](Va("7fb002b6ed25128b4da25b2e"))&&c[Va("73a612b6fb191d")](Va("75ba1beee63a1e875799507d"))&&(a.vd=!(-1<c[Va("73a612b6fb191d")](f)),!a.vd))break;if("#"===f[0]){g=sa.document.createElement("div");for(var k=d[0].replace(/[A-Za-z]/g,"");4>k.length;)k+="9";h=k;k=k.substr(k.length-4);d="";d+=["gsh","gsf"][parseInt(k.substr(0,1),10)%2];d+=["Header","Background","Display","Feedback"][parseInt(k.substr(0,1),10)%4];g[Va("79a417a0f0181a8946")]=d;if(sa.document[Va("78a712aa")]){sa.document[Va("78a712aa")][Va("7bb806b6ed32388c4a875b")](g); +k=sa.getComputedStyle(g).getPropertyValue(Va("78a704b7e62456904c9b12701b6532a8"));var l=sa.getComputedStyle(g).getPropertyValue(Va("75b817b0ea2202"));sa.document[Va("78a712aa")][Va("68ad1bbcf533388c4a875b")](g);if(k)if(g=sa[Va("77a902b0eb1b1e804a8a")],l==="0."+parseInt(h,10)%100||-1!==k.indexOf(parseInt(f[1]+f[2],16))&&-1!==k.indexOf(parseInt(f[3]+f[4],16))){a.vd=!1;break}else if(g&&g(Va("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(d="."+d,f=0;f<document.styleSheets.length;f++){g= +document.styleSheets[f].rules||document.styleSheets[f].cssRules;for(var m in g)if(d===g[m].selectorText){a.vd=!1;break a}}}else a.vd=null,a.vd=!1}}}else{m=c[Va("76ad18b4f73e")];for(e=c[Va("73a612b6fb191d")](Va("35e7"))+2;e<m;e++)b+=c[e];c=b[Va("73a612b6fb191d")](Va("7da71ca0ad381e90"));a.vd=!(0<=c&&c<b[Va("73a612b6fb191d")](Va("35")))}}}return 0<a.vd&&a!==a.vy?!0:!1} +function Fi(a,b){if(ah){void 0!==b&&null!==b||v("Diagram setup requires an argument DIV.");null!==a.Qa&&v("Diagram has already completed setup.");"string"===typeof b?a.Qa=sa.document.getElementById(b):b instanceof HTMLDivElement?a.Qa=b:v("No DIV or DIV id supplied: "+b);null===a.Qa&&v("Invalid DIV id; could not get element with id: "+b);void 0!==a.Qa.H&&v("Invalid div id; div already has a Diagram associated with it.");if(!a.pl&&sa.ResizeObserver){var c=ua(function(){a.Sb()},250);a.pl=new sa.ResizeObserver(function(){c()}); +a.pl.observe(a.Qa)}"static"===sa.getComputedStyle(a.Qa,null).position&&(a.Qa.style.position="relative");b=5;var d="rgba(2"+b+"5, 255, 255, 0)";b--;a.Qa.style["-webkit-tap-highlight-color"]=d;a.Qa.innerHTML="";a.Qa.H=a;a.Qa.goDiagram=a;a.Qa.go=sa.go;var e=a.yr?new Lj(a):new Dk(a);void 0!==e.style&&(e.style.position="absolute",e.style.top="0px",e.style.left="0px","rtl"===sa.getComputedStyle(a.Qa,null).getPropertyValue("direction")&&(a.mn=!0),e.style.zIndex="2",e.style.userSelect="none",e.style.MozUserSelect= +"none",e.style.touchAction="none");a.Na=e;a.dc=e.context;d=a.dc;a.qc=a.computePixelRatio();a.viewSize.u()||(a.Ha=a.Qa.clientWidth||1,a.Ga=a.Qa.clientHeight||1);Nj(a,a.Ha,a.Ga);a.Qa.insertBefore(e.Xa,a.Qa.firstChild);e=new Dk(null);e.width=1;e.height=1;a.bw=e;a.my=e.context;if(ah){e=wa("div");var f=wa("div");e.style.position="absolute";e.style.overflow="auto";e.style.width=a.Ha+"px";e.style.height=a.Ga+"px";e.style.zIndex="1";f.style.position="absolute";f.style.width="1px";f.style.height="1px";a.Qa.appendChild(e); +e.appendChild(f);e.onscroll=Ti;e.addEventListener("pointerdown",Vi);e.H=a;e.ty=!0;e.uy=!0;a.cu=e;a.$t=f}a.Wo=ua(function(){a.ci=null;a.R()},300);a.Gv=ua(function(){Fh(a)},250);a.preventDefault=function(a){a.preventDefault();return!1};a.dk=function(b){if(a.isEnabled){var c=qj(a,b,!0);c.bubbles=!0;var d=0,e=0;c.delta=0;void 0!==b.deltaX?(0!==b.deltaX&&(d=0<b.deltaX?1:-1),0!==b.deltaY&&(e=0<b.deltaY?1:-1),c.delta=Math.abs(b.deltaX)>Math.abs(b.deltaY)?-d:-e):void 0!==b.wheelDeltaX?(0!==b.wheelDeltaX&& +(d=0<b.wheelDeltaX?-1:1),0!==b.wheelDeltaY&&(e=0<b.wheelDeltaY?-1:1),c.delta=Math.abs(b.wheelDeltaX)>Math.abs(b.wheelDeltaY)?-d:-e):void 0!==b.wheelDelta&&0!==b.wheelDelta&&(c.delta=0<b.wheelDelta?1:-1);a.doMouseWheel();uj(a,c,b)}};a.aA=function(b){a.isEnabled&&(a.Xk=!1,qj(a,b,!0),b=a.currentTool,b.cancelWaitAfter(),b.standardMouseOver())};a.hk=function(b){if(a.isEnabled){a.Xk=!0;var c=a.Qt;void 0===c[b.pointerId]&&(c[b.pointerId]=b);c=a.ml;var d=!1;if(null!==c[0]&&c[0].pointerId===b.pointerId)c[0]= +b;else if(null!==c[1]&&c[1].pointerId===b.pointerId)c[1]=b,d=!0;else if(null===c[0])c[0]=b;else if(null===c[1])c[1]=b,d=!0;else{b.preventDefault();return}if(c="touch"===b.pointerType||"pen"===b.pointerType)a.iu=!1,a.wt=!0;var e=d;d=tj(a,b,!0,!1,!0,e);rj(a,b,d);d.targetDiagram=sj(b,b.target);d.targetObject=null;e||d.clone(a.Sp);e=a.nw;c=c?25:10;b.timeStamp-a.mw<a.yy&&!(Math.abs(e.x-b.screenX)>c||Math.abs(e.y-b.screenY)>c)?a.lq++:a.lq=1;d.clickCount=a.lq;a.mw=b.timeStamp;a.nw.wg(b.screenX,b.screenY); +a.doMouseDown();1===b.button?b.preventDefault():uj(a,d,b)}};a.ik=function(b){if(a.isEnabled){a.Xk=!0;var c=a.ml;if(null!==c[0]&&c[0].pointerId===b.pointerId)c[0]=b;else{if(null!==c[1]&&c[1].pointerId===b.pointerId){c[1]=b;return}if(null===c[0])c[0]=b;else return}if(c[0].pointerId===b.pointerId){c=tj(a,b,!1,!1,!1,null!==c[1]);var d=sa.document.elementFromPoint(b.clientX,b.clientY);null!==d&&void 0!==d.shadowRoot&&null!==d.shadowRoot&&(d=d.shadowRoot.elementFromPoint(b.clientX,b.clientY));var e=a,f= +b;d&&d.H&&(f=b,e=d.H);c.targetDiagram=e;rj(a,f,c);c.targetObject=null;a.doMouseMove();uj(a,c,b)}}};a.kk=function(b){if(a.isEnabled){a.Xk=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.Qt;if(c&&a.iu)delete d[b.pointerId],b.preventDefault();else if(d=a.ml,null!==d[0]&&d[0].pointerId===b.pointerId){d[0]=null;d=tj(a,b,!1,!0,!0,!1);var e=sa.document.elementFromPoint(b.clientX,b.clientY);null!==e&&void 0!==e.shadowRoot&&null!==e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(b.clientX,b.clientY)); +null!==e&&e.H instanceof P&&e.H!==a&&rj(e.H,b,d);null===e&&(e=b.target);rj(a,b,d);d.clickCount=a.lq;d.targetDiagram=sj(b,e);d.targetObject=null;a.doMouseUp();uj(a,d,b);c&&(a.wt=!1)}else null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null)}};a.jk=function(b){if(a.isEnabled){a.Xk=!1;var c=a.Qt;c[b.pointerId]&&delete c[b.pointerId];c=a.ml;null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null);null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null);"touch"!==b.pointerType&&"pen"!==b.pointerType&&(b= +a.currentTool,b.cancelWaitAfter(),b.standardMouseOver())}};a.ct=d.ba["d"+Wk[1]+Wk[2]+"wI"+Ck.slice(1,5)]["b"+Xk.slice(1,b)](d.ba,Vk,b,b);d.Uc(!0);Ri(a)}}Ei.className="DiagramHelper";function Xe(a){this.j=void 0===a?new K:a;this.m=new K}oa.Object.defineProperties(Xe.prototype,{point:{configurable:!0,get:function(){return this.j},set:function(a){this.j=a}},shifted:{configurable:!0,get:function(){return this.m},set:function(a){this.m=a}}});var Wk="DraggingInfo"; +Xe.className="DraggingInfo";function Yj(a,b,c){this.node=a;this.info=b;this.Tu=c}Yj.className="DraggingNodeInfoPair";function Pe(){this.reset()}Pe.prototype.reset=function(){this.isGridSnapEnabled=!1;this.isGridSnapRealtime=!0;this.gridSnapCellSize=(new Hb(NaN,NaN)).freeze();this.gridSnapCellSpot=Fc;this.gridSnapOrigin=(new K(NaN,NaN)).freeze();this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1;this.dragsMembers=this.groupsAlwaysMove=!0};Pe.className="DraggingOptions"; +function Yk(a,b){if("string"===typeof a||sa.Element&&a instanceof Element)var c=P.call(this,a)||this;else c=P.call(this)||this,b=a;Zk(c);b&&c.im(b);return c}na(Yk,P);function Zk(a){a.allowDragOut=!0;a.allowMove=!1;a.isReadOnly=!0;a.contentAlignment=Gc;a.layout=new $k}Yk.prototype.reset=function(){P.prototype.reset.call(this);Zk(this)};Yk.className="Palette"; +function al(a,b){if("string"===typeof a||sa.Element&&a instanceof Element)var c=P.call(this,a)||this;else c=P.call(this)||this,b=a;var d=c;c.animationManager.isEnabled=!1;c.Bb=!0;c.$=null;c.en=!1;c.fn=!1;c.G=!0;c.v=!0;c.ma=0;c.m=!1;c.sl=null;c.Vx("drawShadows",!1);a=new S;var e=new Qf;e.stroke="magenta";e.strokeWidth=2;e.fill="transparent";e.name="BOXSHAPE";a.selectable=!0;a.selectionAdorned=!1;a.selectionObjectName="BOXSHAPE";a.locationObjectName="BOXSHAPE";a.resizeObjectName="BOXSHAPE";a.cursor= +"move";a.add(e);c.j=a;c.allowCopy=!1;c.allowDelete=!1;c.allowSelect=!0;c.autoScrollRegion=new gc(0,0,0,0);c.va.h(0,0);c.toolManager.nb("Dragging",new bl,c.toolManager.mouseMoveTools);c.click=function(){var a=d.observed;if(null!==a){var b=a.viewportBounds,c=d.lastInput.documentPoint;a.position=new K(c.x-b.width/2,c.y-b.height/2)}};c.Sf=function(){d.ab();cl(d)};c.Wd=function(){null!==d.observed&&(d.ab(),d.R())};c.Ma=function(){1>d.updateDelay?d.R():d.m||(d.m=!0,setTimeout(function(){return d.redraw()}, +d.updateDelay))};c.Rf=function(){null!==d.observed&&cl(d)};c.autoScale=lj;c.Bb=!1;b&&Object.assign(c,b);return c}na(al,P);al.prototype.computePixelRatio=function(){return 1}; +al.prototype.redraw=function(){if(this.m&&1<=this.updateDelay){this.m=!1;var a=this.Na,b=this.dc;if(null!==a&&null!==b){Ej(this);if(null===this.sl){var c=new Dk(null);c.width=a.width;c.height=a.height;this.sl=c}try{this.Na=this.sl,this.dc=this.Na.context,this.dc.Uc(!0),this.dc.setTransform(1,0,0,1,0,0),this.dc.clearRect(0,0,this.Na.width,this.Na.height),dl(this)}finally{this.Na=a,this.dc=b}}}P.prototype.redraw.call(this)}; +al.prototype.zc=function(){null===this.Qa&&v("No div specified");null===this.Na&&v("No canvas specified");if(!(this.Na instanceof Lj)&&(ri(this.box),this.hd)){var a=this.observed;if(null!==a&&!a.animationManager.defaultAnimation.isAnimating&&a.xi){Ej(this);var b=this.Na;a=this.dc;a.Uc(!0);a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,b.width,b.height);1>this.updateDelay?dl(this):null!==this.sl&&(a.drawImage(this.sl.Xa,0,0),b=this.Gb,b.reset(),1!==this.scale&&b.scale(this.scale),0===this.position.x&& +0===this.position.y||b.translate(-this.position.x,-this.position.y),a.scale(this.qc,this.qc),a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy));b=this.$a.s;for(var c=b.length,d=0;d<c;d++)b[d].zc(a,this);this.hd=this.gj=!1}}}; +function dl(a){var b=a.observed;if(null!==b){var c=a.drawsTemporaryLayers,d=a.drawsGrid&&c,e=b.grid;d&&null!==e&&e.visible&&!isNaN(e.width)&&!isNaN(e.height)&&(e=M.alloc().assign(a.viewportBounds).cd(b.viewportBounds),xj(b,e),M.free(e),zh(b));var f=a.Gb;f.reset();1!==a.scale&&f.scale(a.scale);0===a.position.x&&0===a.position.y||f.translate(-a.position.x,-a.position.y);e=a.dc;e.scale(a.qc,a.qc);e.transform(f.m11,f.m12,f.m21,f.m22,f.dx,f.dy);b=b.$a.s;f=b.length;for(var g=0;g<f;g++){var h=b[g],k=a;if(h.visible&& +0!==h.opacity){var l=h.diagram.grid.part;if(!c&&h.isTemporary)d&&l.layer===h&&(h=si(h,e),l.zc(e,k),e.globalAlpha=h);else{for(var m=si(h,e),n=k.scale,p=M.alloc(),r=h.Ra.s,q=r.length,u=0;u<q;u++){var x=r[u];(d||x!==l)&&h.li(e,x,k,null,n,p,!1)}M.free(p);e.globalAlpha=m}}}}} +function cl(a){var b=a.box;if(null!==b){var c=a.observed;if(null!==c){a.hd=!0;c=c.viewportBounds;var d=b.selectionObject,e=Hb.alloc();e.h(c.width,c.height);d.desiredSize=e;Hb.free(e);a=2/a.scale;d instanceof Qf&&(d.strokeWidth=a);b.location=new K(c.x-a/2,c.y-a/2);b.isSelected=!0}}}al.prototype.computeBounds=function(){var a=this.observed;if(null===a)return pc;var b=a.documentBounds.copy();b.cd(a.viewportBounds);return b};al.prototype.invalidateViewport=function(){!0!==this.hd&&(this.hd=!0,this.Sb())}; +al.prototype.onViewportBoundsChanged=function(a,b,c,d){this.Bb||(Wi(this),this.R(),jj(this),this.ab(),cl(this),this.qd.scale=c,this.qd.position.x=a.x,this.qd.position.y=a.y,this.qd.bounds.assign(a),this.qd.Cx=d,this.T("ViewportBoundsChanged",this.qd,a))}; +oa.Object.defineProperties(al.prototype,{observed:{configurable:!0,get:function(){return this.$},set:function(a){var b=this.$;null!==a&&w(a,P,al,"observed");a instanceof al&&v("Overview.observed Diagram may not be an Overview itself: "+a);if(b!==a){null!==b&&(this.remove(this.box),b.Wl("ViewportBoundsChanged",this.Sf),b.Wl("DocumentBoundsChanged",this.Wd),b.Wl("InvalidateDraw",this.Ma),b.Wl("AnimationFinished",this.Rf));this.$=a;null!==a&&(a.Jj("ViewportBoundsChanged",this.Sf),a.Jj("DocumentBoundsChanged", +this.Wd),a.Jj("InvalidateDraw",this.Ma),a.Jj("AnimationFinished",this.Rf),this.add(this.box));this.ab();if(null===a){this.sl=null;var c=this.Na,d=this.dc;c&&d&&(d.setTransform(1,0,0,1,0,0),d.clearRect(0,0,c.width,c.height))}else this.Ma(null),cl(this),this.R();this.g("observed",b,a)}}},box:{configurable:!0,get:function(){return this.j},set:function(a){var b=this.j;b!==a&&(this.j=a,this.remove(b),this.add(this.j),cl(this),this.g("box",b,a))}},drawsTemporaryLayers:{configurable:!0, +get:function(){return this.G},set:function(a){this.G!==a&&(this.G=a,this.redraw())}},drawsGrid:{configurable:!0,get:function(){return this.v},set:function(a){this.v!==a&&(this.v=a,this.redraw())}},updateDelay:{configurable:!0,get:function(){return this.ma},set:function(a){0>a&&(a=0);this.ma!==a&&(this.ma=a)}}});al.className="Overview";function bl(){Oe.call(this);this.j=null}na(bl,Oe); +bl.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(null===a||!a.allowMove||!a.allowSelect)return!1;var b=a.observed;if(null===b)return!1;var c=a.lastInput;if(!c.left||a.currentTool!==this&&(!this.isBeyondDragSize()||c.isTouchEvent&&c.timestamp-a.firstInput.timestamp<this.delay))return!1;null===this.findDraggablePart()&&(c=b.viewportBounds,this.j=new K(c.width/2,c.height/2),a=a.firstInput.documentPoint,b.position=new K(a.x-this.j.x,a.y-this.j.y));return!0}; +bl.prototype.doActivate=function(){this.j=null;Oe.prototype.doActivate.call(this)};bl.prototype.doUpdateCursor=function(){var a=this.diagram,b=a.box;null!==b&&b.cursor&&(a.currentCursor=b.cursor)};bl.prototype.moveParts=function(){var a=this.diagram,b=a.observed;if(null!==b){var c=a.box;if(null!==c){if(null===this.j){var d=a.firstInput.documentPoint;c=c.location;this.j=new K(d.x-c.x,d.y-c.y)}a=a.lastInput.documentPoint;b.position=new K(a.x-this.j.x,a.y-this.j.y)}}};bl.className="OverviewDraggingTool"; +function el(){0<arguments.length&&Ca(el);Za(this);this.H=ye;this.Ma=this.v=this.m=!0;this.G=this.$=this.ob=this.ma=!1;this.qj=this.j=null;this.Ib=1.05;this.zt=NaN;this.lw=null;this.su=NaN;this.qu=pc;this.jb=!0;this.gg=null;this.tb=200}el.prototype.toString=function(){return"CommandHandler"};el.prototype.Ye=function(a){this.H=a}; +el.prototype.doKeyDown=function(){var a=this.diagram,b=a.lastInput,c=Ya?b.meta:b.control,d=b.shift,e=b.alt,f=b.key;!c||"C"!==f&&"Insert"!==f?c&&"X"===f||d&&"Del"===f?this.canCutSelection()&&this.cutSelection():c&&"V"===f||d&&"Insert"===f?this.canPasteSelection()&&this.pasteSelection():c&&"Y"===f||e&&d&&"Backspace"===f?this.canRedo()&&this.redo():c&&"Z"===f||e&&"Backspace"===f?this.canUndo()&&this.undo():"Del"===f||"Backspace"===f?this.canDeleteSelection()&&this.deleteSelection():c&&"A"===f?this.canSelectAll()&& +this.selectAll():"Esc"===f?this.canStopCommand()&&this.stopCommand():"Up"===f?a.allowVerticalScroll&&(c?a.scroll("pixel","up"):a.scroll("line","up")):"Down"===f?a.allowVerticalScroll&&(c?a.scroll("pixel","down"):a.scroll("line","down")):"Left"===f?a.allowHorizontalScroll&&(c?a.scroll("pixel","left"):a.scroll("line","left")):"Right"===f?a.allowHorizontalScroll&&(c?a.scroll("pixel","right"):a.scroll("line","right")):"PageUp"===f?d&&a.allowHorizontalScroll?a.scroll("page","left"):a.allowVerticalScroll&& +a.scroll("page","up"):"PageDown"===f?d&&a.allowHorizontalScroll?a.scroll("page","right"):a.allowVerticalScroll&&a.scroll("page","down"):"Home"===f?c&&a.allowVerticalScroll?a.scroll("document","up"):!c&&a.allowHorizontalScroll&&a.scroll("document","left"):"End"===f?c&&a.allowVerticalScroll?a.scroll("document","down"):!c&&a.allowHorizontalScroll&&a.scroll("document","right"):" "===f?this.canScrollToPart()&&this.scrollToPart():"Subtract"===f?this.canDecreaseZoom()&&this.decreaseZoom():"Add"===f?this.canIncreaseZoom()&& +this.increaseZoom():c&&"0"===f?this.canResetZoom()&&this.resetZoom():d&&"Z"===f?this.canZoomToFit()&&this.zoomToFit():c&&!d&&"G"===f?this.canGroupSelection()&&this.groupSelection():c&&d&&"G"===f?this.canUngroupSelection()&&this.ungroupSelection():"F2"===f||b.event&&"F2"===b.event.key?this.canEditTextBlock()&&this.editTextBlock():"ContextMenu"===f||b.event&&"ContextMenu"===b.event.key?this.canShowContextMenu()&&this.showContextMenu():b.bubbles=!0:this.canCopySelection()&&this.copySelection()}; +el.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0};el.prototype.stopCommand=function(){var a=this.diagram,b=a.currentTool;b instanceof Ua&&a.allowSelect&&a.clearSelection();null!==b&&b.doCancel()};el.prototype.canStopCommand=function(){return!0}; +el.prototype.selectAll=function(){var a=this.diagram;a.R();try{a.currentCursor="wait";a.T("ChangingSelection",a.selection);for(var b=a.parts;b.next();)b.value.isSelected=!0;for(var c=a.nodes;c.next();)c.value.isSelected=!0;for(var d=a.links;d.next();)d.value.isSelected=!0}finally{a.T("ChangedSelection",a.selection),a.currentCursor=""}};el.prototype.canSelectAll=function(){return this.diagram.allowSelect}; +el.prototype.deleteSelection=function(){var a=this.diagram;try{a.currentCursor="wait";a.T("ChangingSelection",a.selection);a.Ja("Delete");a.T("SelectionDeleting",a.selection);for(var b=new I,c=a.selection.iterator;c.next();)fl(b,c.value,!0,this.deletesTree?Infinity:0,this.deletesConnectedLinks?null:!1,function(a){return a.canDelete()});a.vs(b,!0);a.T("SelectionDeleted",b)}finally{a.kb("Delete"),a.T("ChangedSelection",a.selection),a.currentCursor=""}}; +el.prototype.canDeleteSelection=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowDelete||0===a.selection.count?!1:!0};el.prototype.copySelection=function(){var a=this.diagram,b=new I;for(a=a.selection.iterator;a.next();)fl(b,a.value,!0,this.copiesTree?Infinity:0,this.copiesConnectedLinks,function(a){return a.canCopy()});this.copyToClipboard(b)};el.prototype.canCopySelection=function(){var a=this.diagram;return a.allowCopy&&a.allowClipboard&&0!==a.selection.count?!0:!1}; +el.prototype.cutSelection=function(){this.copySelection();this.deleteSelection()};el.prototype.canCutSelection=function(){var a=this.diagram;return!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&0!==a.selection.count?!0:!1}; +el.prototype.copyToClipboard=function(a){var b=this.diagram,c=null;if(null===a)Li=null,Mi="";else{c=b.model;var d=!1,e=!1,f=null;try{c.Pl()&&(d=c.Qj,c.Qj=this.copiesParentKey),c.$j()&&(e=c.Pj,c.Pj=this.copiesGroupKey),f=b.Rj(a,null,!0)}finally{c.Pl()&&(c.Qj=d),c.$j()&&(c.Pj=e),c=new H,c.addAll(f),Li=c,Mi=b.model.dataFormat}}b.T("ClipboardChanged",c)}; +el.prototype.pasteFromClipboard=function(){var a=new I,b=Li;if(null===b)return a;var c=this.diagram;if(Mi!==c.model.dataFormat)return a;var d=c.model,e=!1,f=!1,g=null;try{d.Pl()&&(e=d.Qj,d.Qj=this.copiesParentKey),d.$j()&&(f=d.Pj,d.Pj=this.copiesGroupKey),g=c.Rj(b,c,!1)}finally{for(d.Pl()&&(d.Qj=e),d.$j()&&(d.Pj=f),b=g.iterator;b.next();)c=b.value,d=b.key,c.location.u()||(d.location.u()?c.location=d.location:!c.position.u()&&d.position.u()&&(c.position=d.position)),a.add(c)}return a}; +el.prototype.pasteSelection=function(a){void 0===a&&(a=null);var b=this.diagram;try{b.currentCursor="wait";b.T("ChangingSelection",b.selection);b.Ja("Paste");var c=this.pasteFromClipboard();0<c.count&&b.clearSelection(!0);for(var d=c.iterator;d.next();)d.value.isSelected=!0;if(null!==a){var e=b.computePartsBounds(b.selection);if(e.u()){var f=this.computeEffectiveCollection(b.selection,b.Rm);tf(b,f,new K(a.x-e.centerX,a.y-e.centerY),b.Rm,!1)}}b.T("ClipboardPasted",c)}finally{b.kb("Paste"),b.T("ChangedSelection", +b.selection),b.currentCursor=""}};el.prototype.canPasteSelection=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||null===Li||0===Li.count||Mi!==a.model.dataFormat?!1:!0};el.prototype.undo=function(){this.diagram.undoManager.undo()};el.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()};el.prototype.redo=function(){this.diagram.undoManager.redo()}; +el.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()};el.prototype.decreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);E(a,el,"decreaseZoom:factor");var b=this.diagram;b.autoScale===Eh&&(a=b.scale*a,a<b.minScale||a>b.maxScale||(b.scale=a))}; +el.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);E(a,el,"canDecreaseZoom:factor");var b=this.diagram;if(b.autoScale!==Eh)return!1;a=b.scale*a;return a<b.minScale||a>b.maxScale?!1:b.allowZoom};el.prototype.increaseZoom=function(a){void 0===a&&(a=this.zoomFactor);E(a,el,"increaseZoom:factor");var b=this.diagram;b.autoScale===Eh&&(a=b.scale*a,a<b.minScale||a>b.maxScale||(b.scale=a))}; +el.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.zoomFactor);E(a,el,"canIncreaseZoom:factor");var b=this.diagram;if(b.autoScale!==Eh)return!1;a=b.scale*a;return a<b.minScale||a>b.maxScale?!1:b.allowZoom};el.prototype.resetZoom=function(a){void 0===a&&(a=this.defaultScale);E(a,el,"resetZoom:newscale");var b=this.diagram;a<b.minScale||a>b.maxScale||(b.scale=a)}; +el.prototype.canResetZoom=function(a){void 0===a&&(a=this.defaultScale);E(a,el,"canResetZoom:newscale");var b=this.diagram;return a<b.minScale||a>b.maxScale?!1:b.allowZoom}; +el.prototype.zoomToFit=function(){var a=this.diagram,b=a.animationManager;b.Cc();a.redraw();var c=a.position,d=a.scale;yh(b,"Zoom To Fit");this.isZoomToFitRestoreEnabled&&d===this.su&&!isNaN(this.zt)&&a.documentBounds.D(this.qu)?(a.scale=this.zt,a.position=this.lw,this.su=NaN,this.qu=pc):(this.zt=d,this.lw=c.copy(),a.zoomToFit(),this.su=a.scale,this.qu=a.documentBounds.copy());Ah(b)};el.prototype.canZoomToFit=function(){return this.diagram.allowZoom}; +el.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&w(a,S,el,"part");var b=this.diagram;b.eb();if(null===a){try{null!==this.gg&&(this.gg.next()?a=this.gg.value:this.gg=null)}catch(k){this.gg=null}null===a&&(0<b.highlighteds.count?this.gg=b.highlighteds.iterator:0<b.selection.count&&(this.gg=b.selection.iterator),null!==this.gg&&this.gg.next()&&(a=this.gg.value))}if(null!==a){var c=b.animationManager;yh(c,"Scroll To Part");var d=this.scrollToPartPause;if(0<d){var e=gl(this,a,[a]); +if(1===e.length)b.Ja(),b.Qr(a.actualBounds),b.kb("Scroll To Part");else{var f=function(){b.Ja();for(var a=e.pop();0<e.length&&a instanceof T&&a.isTreeExpanded&&(!(a instanceof wf)||a.isSubGraphExpanded);)a=e.pop();0<e.length?(a instanceof S&&b.pv(a.actualBounds),a instanceof T&&!a.isTreeExpanded&&(a.isTreeExpanded=!0),a instanceof wf&&!a.isSubGraphExpanded&&(a.isSubGraphExpanded=!0)):(a instanceof S&&b.Qr(a.actualBounds),b.Wl("LayoutCompleted",g));b.kb("Scroll To Part")},g=function(){va(f,(c.isEnabled? +c.duration:0)+d)};b.Jj("LayoutCompleted",g);f()}}else{var h=b.position.copy();b.Qr(a.actualBounds);h.fb(b.position)&&c.Cc()}}}; +function gl(a,b,c){if(b.isVisible())return c;if(b instanceof Ce)gl(a,b.adornedPart,c);else if(b instanceof R){var d=b.fromNode;null!==d&&gl(a,d,c);b=b.toNode;null!==b&&gl(a,b,c)}else b instanceof T&&(d=b.labeledLink,null!==d&&gl(a,d,c),d=b.ug(),null!==d&&(d.isTreeExpanded||d.wasTreeExpanded||c.push(d),gl(a,d,c))),b=b.containingGroup,null!==b&&(b.isSubGraphExpanded||b.wasSubGraphExpanded||c.push(b),gl(a,b,c));return c} +el.prototype.canScrollToPart=function(a){void 0===a&&(a=null);if(null!==a&&!(a instanceof S))return!1;a=this.diagram;return 0===a.selection.count&&0===a.highlighteds.count?!1:a.allowHorizontalScroll&&a.allowVerticalScroll}; +el.prototype.collapseTree=function(a){void 0===a&&(a=null);var b=this.diagram;try{b.Ja("Collapse Tree");yh(b.animationManager,"Collapse Tree");var c=new H;if(null!==a&&a.isTreeExpanded)a.collapseTree(),c.add(a);else if(null===a)for(var d=b.selection.iterator;d.next();){var e=d.value;e instanceof T&&e.isTreeExpanded&&(e.collapseTree(),c.add(e))}b.T("TreeCollapsed",c)}finally{b.kb("Collapse Tree")}}; +el.prototype.canCollapseTree=function(a){void 0===a&&(a=null);var b=this.diagram;if(b.isReadOnly)return!1;if(null!==a){if(!(a instanceof T&&a.isTreeExpanded))return!1;if(0<a.Fo().count)return!0}else for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof T&&b.isTreeExpanded&&0<b.Fo().count)return!0;return!1}; +el.prototype.expandTree=function(a){void 0===a&&(a=null);var b=this.diagram;try{b.Ja("Expand Tree");yh(b.animationManager,"Expand Tree");var c=new H;if(null!==a&&!a.isTreeExpanded)a.expandTree(),c.add(a);else if(null===a)for(var d=b.selection.iterator;d.next();){var e=d.value;e instanceof T&&!e.isTreeExpanded&&(e.expandTree(),c.add(e))}b.T("TreeExpanded",c)}finally{b.kb("Expand Tree")}}; +el.prototype.canExpandTree=function(a){void 0===a&&(a=null);var b=this.diagram;if(b.isReadOnly)return!1;if(null!==a){if(!(a instanceof T)||a.isTreeExpanded)return!1;if(0<a.Fo().count)return!0}else for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof T&&!b.isTreeExpanded&&0<b.Fo().count)return!0;return!1}; +el.prototype.groupSelection=function(){var a=this.diagram,b=a.model;if(b.wi()){var c=this.archetypeGroupData;if(null!==c){var d=null;try{a.currentCursor="wait";a.T("ChangingSelection",a.selection);a.Ja("Group");for(var e=new H,f=a.selection.iterator;f.next();){var g=f.value;g.Zc()&&g.canGroup()&&e.add(g)}for(var h=new H,k=e.iterator;k.next();){var l=k.value;f=!1;for(var m=e.iterator;m.next();)if(l.Sd(m.value)){f=!0;break}f||h.add(l)}if(0<h.count){var n=h.first().containingGroup;if(null!==n)for(;null!== +n;){e=!1;for(var p=h.iterator;p.next();)if(!p.value.Sd(n)){e=!0;break}if(e)n=n.containingGroup;else break}if(c instanceof wf)xg(c),d=c.copy(),null!==d&&a.add(d);else if(b.hs(c)){var r=b.copyNodeData(c);Ga(r)&&(b.yf(r),d=a.oi(r))}if(null!==d){null!==n&&this.isValidMember(n,d)&&(d.containingGroup=n);for(var q=h.iterator;q.next();){var u=q.value;this.isValidMember(d,u)&&(u.containingGroup=d)}a.clearSelection(!0);d.isSelected=!0}}a.T("SelectionGrouped",d)}finally{a.kb("Group"),a.T("ChangedSelection", +a.selection),a.currentCursor=""}}}};el.prototype.canGroupSelection=function(){var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowGroup||!a.model.wi()||null===this.archetypeGroupData)return!1;for(a=a.selection.iterator;a.next();){var b=a.value;if(b.Zc()&&b.canGroup())return!0}return!1}; +function hl(a){var b=Na();for(a=a.iterator;a.next();){var c=a.value;c instanceof R||b.push(c)}a=new I;c=b.length;for(var d=0;d<c;d++){for(var e=b[d],f=!0,g=0;g<c;g++)if(e.Sd(b[g])){f=!1;break}f&&a.add(e)}Pa(b);return a} +el.prototype.isValidMember=function(a,b){if(null===b||a===b||b instanceof R)return!1;if(null!==a){if(a===b||a.Sd(b))return!1;var c=a.memberValidation;if(null!==c&&!c(a,b)||null===a.data&&null!==b.data||null!==a.data&&null===b.data)return!1}c=this.memberValidation;return null!==c?c(a,b):!0}; +el.prototype.ungroupSelection=function(a){void 0===a&&(a=null);var b=this.diagram,c=b.model;if(c.wi())try{b.currentCursor="wait";b.T("ChangingSelection",b.selection);b.Ja("Ungroup");var d=new H;if(null!==a)d.add(a);else for(var e=b.selection.iterator;e.next();){var f=e.value;f instanceof wf&&f.canUngroup()&&d.add(f)}var g=new H;if(0<d.count){b.clearSelection(!0);for(var h=d.iterator;h.next();){var k=h.value;k.expandSubGraph();var l=k.containingGroup,m=null!==l&&null!==l.data?c.Ba(l.data):void 0;g.addAll(k.memberParts); +for(var n=g.iterator;n.next();){var p=n.value;p.isSelected=!0;if(!(p instanceof R)){var r=p.data;null!==r?c.bp(r,m):p.containingGroup=l}}b.remove(k)}}b.T("SelectionUngrouped",d,g)}finally{b.kb("Ungroup"),b.T("ChangedSelection",b.selection),b.currentCursor=""}}; +el.prototype.canUngroupSelection=function(a){void 0===a&&(a=null);var b=this.diagram;if(b.isReadOnly||b.isModelReadOnly||!b.allowDelete||!b.allowUngroup||!b.model.wi())return!1;if(null!==a){if(!(a instanceof wf))return!1;if(a.canUngroup())return!0}else for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof wf&&b.canUngroup())return!0;return!1}; +el.prototype.addTopLevelParts=function(a,b){var c=!0;for(a=hl(a).iterator;a.next();){var d=a.value;null!==d.containingGroup&&(!b||this.isValidMember(null,d)?d.containingGroup=null:c=!1)}return c}; +el.prototype.collapseSubGraph=function(a){void 0===a&&(a=null);var b=this.diagram;try{b.Ja("Collapse SubGraph");yh(b.animationManager,"Collapse SubGraph");var c=new H;if(null!==a&&a.isSubGraphExpanded)a.collapseSubGraph(),c.add(a);else if(null===a)for(var d=b.selection.iterator;d.next();){var e=d.value;e instanceof wf&&e.isSubGraphExpanded&&(e.collapseSubGraph(),c.add(e))}b.T("SubGraphCollapsed",c)}finally{b.kb("Collapse SubGraph")}}; +el.prototype.canCollapseSubGraph=function(a){void 0===a&&(a=null);var b=this.diagram;if(b.isReadOnly)return!1;if(null!==a)return a instanceof wf&&a.isSubGraphExpanded?!0:!1;for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof wf&&b.isSubGraphExpanded)return!0;return!1}; +el.prototype.expandSubGraph=function(a){void 0===a&&(a=null);var b=this.diagram;try{b.Ja("Expand SubGraph");yh(b.animationManager,"Expand SubGraph");var c=new H;if(null!==a&&!a.isSubGraphExpanded)a.expandSubGraph(),c.add(a);else if(null===a)for(var d=b.selection.iterator;d.next();){var e=d.value;e instanceof wf&&!e.isSubGraphExpanded&&(e.expandSubGraph(),c.add(e))}b.T("SubGraphExpanded",c)}finally{b.kb("Expand SubGraph")}}; +el.prototype.canExpandSubGraph=function(a){void 0===a&&(a=null);var b=this.diagram;if(b.isReadOnly)return!1;if(null!==a)return a instanceof wf&&!a.isSubGraphExpanded?!0:!1;for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof wf&&!b.isSubGraphExpanded)return!0;return!1}; +el.prototype.editTextBlock=function(a){void 0===a&&(a=null);null!==a&&w(a,ch,el,"editTextBlock");var b=this.diagram,c=b.toolManager.findTool("TextEditing");if(null!==c){if(null===a){a=null;for(var d=b.selection.iterator;d.next();){var e=d.value;if(e.canEdit()){a=e;break}}if(null===a)return;a=a.Jl(function(a){return a instanceof ch&&a.editable})}null!==a&&(b.currentTool=null,c.textBlock=a,b.currentTool=c)}}; +el.prototype.canEditTextBlock=function(a){void 0===a&&(a=null);var b=this.diagram;if(b.isReadOnly||b.isModelReadOnly||!b.allowTextEdit||null===b.toolManager.findTool("TextEditing"))return!1;if(null!==a){if(!(a instanceof ch))return!1;a=a.part;if(null!==a&&a.canEdit())return!0}else for(b=b.selection.iterator;b.next();)if(a=b.value,a.canEdit()&&(a=a.Jl(function(a){return a instanceof ch&&a.editable}),null!==a))return!0;return!1}; +el.prototype.showContextMenu=function(a){var b=this.diagram,c=b.toolManager.findTool("ContextMenu");if(null!==c&&(void 0===a&&(a=0<b.selection.count?b.selection.first():b),a=c.findObjectWithContextMenu(a),null!==a)){var d=b.lastInput,e=null;a instanceof O?e=a.oa(Kc):b.viewportBounds.ga(d.documentPoint)||(e=b.viewportBounds,e=new K(e.x+e.width/2,e.y+e.height/2));null!==e&&(d.viewPoint=b.ep(e),d.documentPoint=e,d.left=!1,d.right=!0,d.up=!0);b.currentTool=c;Zg(c,!1,a)}}; +el.prototype.canShowContextMenu=function(a){var b=this.diagram,c=b.toolManager.findTool("ContextMenu");if(null===c)return!1;void 0===a&&(a=0<b.selection.count?b.selection.first():b);return null===c.findObjectWithContextMenu(a)?!1:!0}; +el.prototype.computeEffectiveCollection=function(a,b){var c=this.diagram,d=c.toolManager.findTool("Dragging"),e=c.currentTool===d;void 0===b&&(b=e?d.dragOptions:c.Rm);d=new yb;if(null===a)return d;for(var f=a.iterator;f.next();)Wj(c,d,f.value,e,b);if(null!==c.draggedLink&&b.dragsLink)return d;for(f=a.iterator;f.next();)a=f.value,a instanceof R&&(b=a.fromNode,null===b||d.contains(b)?(b=a.toNode,null===b||d.contains(b)||d.remove(a)):d.remove(a));return d}; +oa.Object.defineProperties(el.prototype,{diagram:{configurable:!0,get:function(){return this.H}},copiesClipboardData:{configurable:!0,get:function(){return this.m},set:function(a){A(a,"boolean",el,"copiesClipboardData");this.m=a}},copiesConnectedLinks:{configurable:!0,get:function(){return this.v},set:function(a){A(a,"boolean",el,"copiesConnectedLinks");this.v=a}},deletesConnectedLinks:{configurable:!0,get:function(){return this.Ma},set:function(a){A(a, +"boolean",el,"deletesConnectedLinks");this.Ma=a}},copiesTree:{configurable:!0,get:function(){return this.ma},set:function(a){A(a,"boolean",el,"copiesTree");this.ma=a}},deletesTree:{configurable:!0,get:function(){return this.ob},set:function(a){A(a,"boolean",el,"deletesTree");this.ob=a}},copiesParentKey:{configurable:!0,get:function(){return this.$},set:function(a){A(a,"boolean",el,"copiesParentKey");this.$=a}},copiesGroupKey:{configurable:!0, +get:function(){return this.G},set:function(a){A(a,"boolean",el,"copiesGroupKey");this.G=a}},archetypeGroupData:{configurable:!0,get:function(){return this.j},set:function(a){null!==a&&A(a,"object",el,"archetypeGroupData");var b=this.diagram;G&&(b=b.model,!b.wi()||a instanceof wf||b.hs(a)||v("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: "+a));this.j=a}},memberValidation:{configurable:!0,get:function(){return this.qj}, +set:function(a){null!==a&&A(a,"function",el,"memberValidation");this.qj=a}},defaultScale:{configurable:!0,get:function(){return this.diagram.defaultScale},set:function(a){this.diagram.defaultScale=a}},zoomFactor:{configurable:!0,get:function(){return this.Ib},set:function(a){E(a,el,"zoomFactor");1<a||v("zoomFactor must be larger than 1.0, not: "+a);this.Ib=a}},isZoomToFitRestoreEnabled:{configurable:!0,get:function(){return this.jb},set:function(a){A(a,"boolean", +el,"isZoomToFitRestoreEnabled");this.jb=a}},scrollToPartPause:{configurable:!0,get:function(){return this.tb},set:function(a){E(a,el,"scrollToPartPause");this.tb=a}}});el.className="CommandHandler";Ki=function(){return new el}; +function O(){Za(this);this.o=30723;this.yb=1;this.cc=this.fg=null;this.va=(new K(NaN,NaN)).freeze();this.fd=Vb;this.Gb=new Jb;this.wh=new Jb;this.Nb=null;this.Ea=this.Lk=1;this.Lb=0;this.Mg=yc;this.wc=(new M(NaN,NaN,NaN,NaN)).freeze();this.Jb=(new M(NaN,NaN,NaN,NaN)).freeze();this.gc=(new M(0,0,NaN,NaN)).freeze();this.ea=this.Sn=this.Tn=null;this.tk=this.Kb=hd;this.Dg=this.Xn=0;this.Yn=this.wj=this.pb=this.Dh=this.B=this.Wa=null}var Bd,yg,Ag,il,jl,kl,ll,ml,nl,ol; +O.prototype.cloneProtected=function(a){a.o=this.o|6144;a.yb=this.yb;a.cc=this.cc;a.va.assign(this.va);a.fd=this.fd.M();null!==this.Nb?a.Nb=this.Nb.copy():a.Nb=null;a.Ea=this.Ea;a.Lb=this.Lb;a.Mg=this.Mg.M();a.wc.assign(this.wc);a.Jb.assign(this.Jb);a.gc.assign(this.gc);a.Sn=this.Sn;null!==this.ea&&(a.ea=this.ea.copy());a.Kb=this.Kb.M();a.tk=this.tk.M();a.Xn=this.Xn;a.Dg=this.Dg;null!==this.Wa&&(a.Wa=this.Wa.copy());null!==this.B&&(a.B=this.B.oc?this.B:this.B.copy());null!==this.Dh&&(a.Dh=Ja(this.Dh)); +null!==this.pb&&(a.pb=this.pb.copy())};O.prototype.Nw=function(a){var b=this.Dh;if(Ha(b))for(var c=0;c<b.length;c++){if(b[c]===a)return}else this.Dh=b=[];b.push(a)};O.prototype.Cf=function(a){a.Tn=null;a.wj=null;a.w()};O.prototype.clone=function(){var a=new this.constructor;this.cloneProtected(a);if(null!==this.Dh)for(var b=0;b<this.Dh.length;b++){var c=this.Dh[b];a[c]=this[c]}return a};O.prototype.copy=function(){return this.clone()};t=O.prototype; +t.ub=function(a){a.classType===R?0===a.name.indexOf("Orient")?this.segmentOrientation=a:v("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===O?this.stretch=a:Ea(this,a)};t.toString=function(){return Qa(this.constructor)+"#"+lb(this)};t.th=function(){null!==this.B&&(this.B.oc=!0)};function pl(a){null===a.B?a.B=new ql:a.B.oc&&(a.B=a.B.copy())}t.Xc=function(){if(null===this.ea){var a=new rl;a.cj=Ec;a.Gj=Ec;a.aj=10;a.Ej=10;a.bj=0;a.Fj=0;this.ea=a}}; +t.ib=function(a,b,c,d,e,f,g){var h=this.part;if(null!==h&&(h.lk(a,b,c,d,e,f,g),c===this&&a===qe&&sl(this)&&tl(this,h,b),f=this.diagram,null===this.animationTriggers||null===f||!f.xi||f.undoManager.isUndoingRedoing||f.animationManager.ym||(a=this.animationTriggers.get(b),null!==a&&f.animationManager.isEnabled&&!f.animationManager.isTicking&&(null===this.Yn&&(this.Yn=new yb),g=0===f.undoManager.transactionLevel,a.startCondition===ni?g=!0:a.startCondition===pi&&(g=!1),g?(f=new xh,oi(a,f),g=this.Yn.get(a), +null!==g&&g.stop(),this.Yn.add(a,f),f.nu=this,f.Fw=a,f.add(this,b,d,e),f.start()):(yh(f.animationManager,"Trigger"),f.animationManager.defaultAnimation.add(this,b,d,e)))),this instanceof V&&c===h&&0!==(h.o&16777216)&&null!==h.data))for(c=this.U.s,d=c.length,e=0;e<d;e++)h=c[e],h instanceof V&&Oj(h,function(a){null!==a.data&&0!==(a.o&16777216)&&a.Pa(b)})}; +function tl(a,b,c){var d=a.jh();if(null!==d)for(var e=a.localBindings.iterator;e.next();){var f=e.value,g=null;if(null!==f.sourceName){g=ul(f,d,a);if(null===g)continue;f.ip(a,g,c,null)}else if(f.isToModel){var h=b.diagram;null===h||h.skipsModelSourceBindings||f.ip(a,h.model.modelData,c,d)}else{h=d.data;if(null===h)continue;var k=b.diagram;null===k||k.skipsModelSourceBindings||f.ip(a,h,c,d)}g===a&&(h=d.Ur(f.Gi),null!==h&&f.Dv(h,g,c))}}t.Ur=function(a){return this.bindingId===a?this:null}; +t.g=function(a,b,c){this.ib(qe,a,this,b,c)};t.Ge=function(a,b,c,d){var e=this.wc;e.h(a,b,c,d);if(1!==this.Ea||0!==this.Lb){null===this.Nb&&(this.Nb=new Jb);var f=this.Nb;f.reset();this.bo(f,a,b,c,d);f.fp(e)}};function vl(a,b,c,d){if(!1===a.pickable)return!1;d.multiply(a.transform);return c?a.Yc(b,d):a.hh(b,d)} +t.mx=function(a,b,c){if(!1===this.pickable)return!1;var d=this.naturalBounds;b=a.Df(b);return c?Lb(a.x,a.y,0,0,0,d.height)<=b||Lb(a.x,a.y,0,d.height,d.width,d.height)<=b||Lb(a.x,a.y,d.width,d.height,d.width,0)<=b||Lb(a.x,a.y,d.width,0,0,0)<=b:a.zd(0,0)<=b&&a.zd(0,d.height)<=b&&a.zd(d.width,0)<=b&&a.zd(d.width,d.height)<=b};t.se=function(){return!0}; +t.ga=function(a){G&&w(a,K,O,"containsPoint:p");var b=K.alloc();b.assign(a);this.transform.La(b);var c=this.actualBounds;if(!c.u())return K.free(b),!1;var d=this.diagram;if(null!==d&&d.wt){var e=d.Ml("extraTouchThreshold"),f=d.Ml("extraTouchArea"),g=f/2,h=this.naturalBounds;d=this.Gf()*d.scale;var k=1/d;if(h.width*d<e&&h.height*d<e)return a=mc(c.x-g*k,c.y-g*k,c.width+f*k,c.height+f*k,b.x,b.y),K.free(b),a}e=!1;if(this instanceof Ce||this instanceof Qf?mc(c.x-5,c.y-5,c.width+10,c.height+10,b.x,b.y): +c.ga(b))this.pb&&!this.pb.ga(b)?e=!1:null!==this.areaBackground&&c.ga(b)?e=!0:null!==this.cc&&this.gc.ga(a)?e=!0:e=this.ih(a);K.free(b);return e};t.ih=function(a){var b=this.naturalBounds;return mc(0,0,b.width,b.height,a.x,a.y)}; +t.Re=function(a){if(0===this.angle)return this.actualBounds.Re(a);var b=this.naturalBounds;b=M.allocAt(0,0,b.width,b.height);var c=this.transform,d=!1,e=K.allocAt(a.x,a.y);b.ga(c.Rd(e))&&(e.h(a.x,a.bottom),b.ga(c.Rd(e))&&(e.h(a.right,a.bottom),b.ga(c.Rd(e))&&(e.h(a.right,a.y),b.ga(c.Rd(e))&&(d=!0))));K.free(e);M.free(b);return d}; +t.hh=function(a,b){G&&w(a,M,O,"containedInRect:r");if(void 0===b)return a.Re(this.actualBounds);var c=this.naturalBounds,d=!1,e=K.allocAt(0,0);a.ga(b.La(e))&&(e.h(0,c.height),a.ga(b.La(e))&&(e.h(c.width,c.height),a.ga(b.La(e))&&(e.h(c.width,0),a.ga(b.La(e))&&(d=!0))));K.free(e);return d}; +t.Yc=function(a,b){G&&w(a,M,O,"intersectsRect:r");if(void 0===b&&(b=this.transform,0===this.angle))return a.Yc(this.actualBounds);var c=this.naturalBounds,d=K.allocAt(0,0),e=K.allocAt(0,c.height),f=K.allocAt(c.width,c.height),g=K.allocAt(c.width,0),h=!1;if(a.ga(b.La(d))||a.ga(b.La(e))||a.ga(b.La(f))||a.ga(b.La(g)))h=!0;else{c=M.allocAt(0,0,c.width,c.height);var k=K.allocAt(a.x,a.y);c.ga(b.Rd(k))?h=!0:(k.h(a.x,a.bottom),c.ga(b.Rd(k))?h=!0:(k.h(a.right,a.bottom),c.ga(b.Rd(k))?h=!0:(k.h(a.right,a.y), +c.ga(b.Rd(k))&&(h=!0))));K.free(k);M.free(c);!h&&(L.es(a,d,e)||L.es(a,e,f)||L.es(a,f,g)||L.es(a,g,d))&&(h=!0)}K.free(d);K.free(e);K.free(f);K.free(g);return h};t.oa=function(a,b){void 0===b&&(b=new K);if(a instanceof Ib){G&&a.kc()&&v("getDocumentPoint:s Spot must be specific: "+a.toString());var c=this.naturalBounds;b.h(a.x*c.width+a.offsetX,a.y*c.height+a.offsetY)}else b.set(a);this.oe.La(b);return b}; +t.ti=function(a){void 0===a&&(a=new M);var b=this.naturalBounds,c=this.oe,d=K.allocAt(0,0).transform(c);a.h(d.x,d.y,0,0);d.h(b.width,0).transform(c);lc(a,d.x,d.y,0,0);d.h(b.width,b.height).transform(c);lc(a,d.x,d.y,0,0);d.h(0,b.height).transform(c);lc(a,d.x,d.y,0,0);K.free(d);return a};t.si=function(){var a=this.oe;1===a.m11&&0===a.m12?a=0:(a=180*Math.atan2(a.m12,a.m11)/Math.PI,0>a&&(a+=360));return a}; +t.Gf=function(){if(0!==(this.o&4096)===!1)return this.Lk;var a=this.Ea;return null!==this.panel?a*this.panel.Gf():a};t.$r=function(a,b){void 0===b&&(b=new K);b.assign(a);this.oe.Rd(b);return b};t.bs=function(a,b,c){return this.Xj(a.x,a.y,b.x,b.y,c)}; +t.Xj=function(a,b,c,d,e){var f=this.transform,g=1/(f.m11*f.m22-f.m12*f.m21),h=f.m22*g,k=-f.m12*g,l=-f.m21*g,m=f.m11*g,n=g*(f.m21*f.dy-f.m22*f.dx),p=g*(f.m12*f.dx-f.m11*f.dy);if(null!==this.areaBackground)return f=this.actualBounds,L.If(f.left,f.top,f.right,f.bottom,a,b,c,d,e);g=a*h+b*l+n;a=a*k+b*m+p;b=c*h+d*l+n;c=c*k+d*m+p;e.h(0,0);d=this.naturalBounds;c=L.If(0,0,d.width,d.height,g,a,b,c,e);e.transform(f);return c}; +O.prototype.measure=function(a,b,c,d){if(!1!==Bj(this)){var e=this.Mg,f=e.right+e.left;e=e.top+e.bottom;a=Math.max(a-f,0);b=Math.max(b-e,0);c=Math.max((c||0)-f,0);d=Math.max((d||0)-e,0);f=this.angle;e=this.desiredSize;var g=0;this instanceof Qf&&(g=this.strokeWidth);90===f||270===f?(a=isFinite(e.height)?e.height+g:a,b=isFinite(e.width)?e.width+g:b):(a=isFinite(e.width)?e.width+g:a,b=isFinite(e.height)?e.height+g:b);e=c||0;g=d||0;var h=this instanceof V;switch(wl(this,!0)){case yg:g=e=0;h&&(b=a=Infinity); +break;case Bd:isFinite(a)&&a>c&&(e=a);isFinite(b)&&b>d&&(g=b);break;case il:isFinite(a)&&a>c&&(e=a);g=0;h&&(b=Infinity);break;case jl:isFinite(b)&&b>d&&(g=b),e=0,h&&(a=Infinity)}h=this.maxSize;var k=this.minSize;e>h.width&&k.width<h.width&&(e=h.width);g>h.height&&k.height<h.height&&(g=h.height);c=Math.max(e/this.scale,k.width);d=Math.max(g/this.scale,k.height);h.width<c&&(c=Math.min(k.width,c));h.height<d&&(d=Math.min(k.height,d));a=Math.min(h.width,a);b=Math.min(h.height,b);a=Math.max(c,a);b=Math.max(d, +b);if(90===f||270===f)f=a,a=b,b=f,f=c,c=d,d=f;this.wc.pa();this.Sl(a,b,c,d);this.wc.freeze();this.wc.u()||v("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.wc.toString());wj(this,!1)}};O.prototype.Sl=function(){};O.prototype.zi=function(){return!1}; +O.prototype.arrange=function(a,b,c,d,e){this.Wk();var f=M.alloc();f.assign(this.Jb);this.Jb.pa();!1===Cj(this)?this.Jb.h(a,b,c,d):this.gh(a,b,c,d);this.Jb.freeze();void 0===e?this.pb=null:this.pb=e;c=!1;if(void 0!==e)c=!0;else if(e=this.panel,null===e||e.type!==V.TableRow&&e.type!==V.TableColumn||(e=e.panel),null!==e&&(e=e.gc,d=this.measuredBounds,null!==this.areaBackground&&(d=this.Jb),c=b+d.height,d=a+d.width,c=!(0<=a+.05&&d<=e.width+.05&&0<=b+.05&&c<=e.height+.05),this instanceof ch&&(a=this.naturalBounds, +this.xq>a.height||this.Db>a.width)))c=!0;this.o=c?this.o|256:this.o&-257;this.Jb.u()||v("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Jb.toString());this.Tl(f,this.Jb);xl(this,!1);M.free(f)};t=O.prototype;t.gh=function(){}; +function yl(a,b,c,d,e){a.Jb.h(b,c,d,e);if(!a.desiredSize.u()){var f=a.wc;c=a.Mg;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=wl(a,!0);c===d&&f===e&&(b=yg);switch(b){case yg:if(c>d||f>e)wj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case Bd:wj(a,!0);a.measure(d,e,0,0);break;case il:wj(a,!0);a.measure(d,f,0,0);break;case jl:wj(a,!0),a.measure(c,e,0,0)}}} +t.Tl=function(a,b){var c=this.part;null!==c&&null!==c.diagram&&(c.selectionObject!==this&&c.resizeObject!==this&&c.rotateObject!==this||zl(c,!0),this.R(),ec(a,b)||(c.oh(),this.In(c)))};t.In=function(a){null!==this.portId&&(zl(a,!0),a instanceof T&&Al(a,this))}; +t.zc=function(a,b){if(this.visible){var c=this.opacity;if(0!==c){var d=this instanceof V&&(this.type===V.TableRow||this.type===V.TableColumn),e=this.Jb;if(d||0!==e.width&&0!==e.height&&!isNaN(e.x)&&!isNaN(e.y)){var f=1;1!==c&&(f=a.globalAlpha,a.globalAlpha=f*c);if(d){e=this.Jb;d=this.gc;var g=this.areaBackground,h=this.cc;null===g&&null===h||a.Vc();null!==g&&(ti(this,a,g,!0,!0,d,e),g instanceof Bl&&g.type===Cl?(a.beginPath(),a.rect(e.x,e.y,e.width,e.height),a.Ef(g)):a.fillRect(e.x,e.y,e.width,e.height)); +null!==h&&(ti(this,a,h,!0,!1,d,e),h instanceof Bl&&h.type===Cl?(a.beginPath(),a.rect(e.x,e.y,e.width,e.height),a.Ef(h)):a.fillRect(e.x,e.y,e.width,e.height));this.mi(a,b)}else if(!this.gx(a,b)){this instanceof R&&this.ck(!1);G&&G.El&&G.bz&&G.bz(a,this);d=this.transform;g=this.panel;0!==(this.o&4096)===!0&&Dl(this);var k=this.part;h=!1;var l=0;if(k&&b.Te("drawShadows")&&(h=k.isShadowed)){var m=k.shadowOffset;l=Math.max(m.y,m.x)*b.scale*b.qc}m=this.zi();var n;if(!(n=b.hj||!m)){var p=this.naturalBounds; +n=this.wh;var r=n.m11,q=n.m21,u=n.dx,x=n.m12,y=n.m22,z=n.dy,B,C=B=0;n=B*r+C*q+u;var D=B*x+C*y+z;B=p.width+l;C=0;var J=B*r+C*q+u;B=B*x+C*y+z;C=Math.min(n,J);var U=Math.min(D,B);var aa=Math.max(n+0,J)-C;var Y=Math.max(D+0,B)-U;n=C;D=U;B=p.width+l;C=p.height+l;J=B*r+C*q+u;B=B*x+C*y+z;C=Math.min(n,J);U=Math.min(D,B);aa=Math.max(n+aa,J)-C;Y=Math.max(D+Y,B)-U;n=C;D=U;B=0;C=p.height+l;J=B*r+C*q+u;B=B*x+C*y+z;C=Math.min(n,J);U=Math.min(D,B);aa=Math.max(n+aa,J)-C;Y=Math.max(D+Y,B)-U;n=C;D=U;l=b.viewportBounds; +p=l.x;r=l.y;n=!(n>l.width+p||p>aa+n||D>l.height+r||r>Y+D)}if(n){n=0!==(this.o&256);a.clipInsteadOfFill&&(n=!1);this instanceof ch&&(a.font=this.font);if(n){D=g.se()?g.naturalBounds:g.actualBounds;null!==this.pb?(p=this.pb,aa=p.x,Y=p.y,l=p.width,p=p.height):(aa=Math.max(e.x,D.x),Y=Math.max(e.y,D.y),l=Math.min(e.right,D.right)-aa,p=Math.min(e.bottom,D.bottom)-Y);if(aa>e.width+e.x||e.x>D.width+D.x){1!==c&&(a.globalAlpha=f);return}a.save();a.beginPath();a.rect(aa,Y,l,p);a.clip()}if(m){if(!k.isVisible()){1!== +c&&(a.globalAlpha=f);return}h&&(D=k.shadowOffset,a.wv(D.x*b.scale*b.qc,D.y*b.scale*b.qc,k.shadowBlur),El(a),a.shadowColor=k.shadowColor)}h&&!0===this.shadowVisible?El(a):h&&!1===this.shadowVisible&&Fl(a);k=this.naturalBounds;null!==this.areaBackground&&(a.Vc(),ti(this,a,this.areaBackground,!0,!0,k,e),this.areaBackground instanceof Bl&&this.areaBackground.type===Cl?(a.beginPath(),a.rect(e.x,e.y,e.width,e.height),a.Ef(this.areaBackground)):a.fillRect(e.x,e.y,e.width,e.height));a.transform(d.m11,d.m12, +d.m21,d.m22,d.dx,d.dy);h&&(null!==g&&0!==(g.o&512)||null!==g&&(g.type===V.Auto||g.type===V.Spot)&&g.Ab()!==this)&&null===this.shadowVisible&&Fl(a);null!==this.cc&&(a.Vc(),Gl(this,a,k,e));G&&G.El&&G.cz&&G.cz(a,this);h&&(null!==this.cc||null!==this.areaBackground||null!==g&&0!==(g.o&512)||null!==g&&(g.type===V.Auto||g.type===V.Spot)&&g.Ab()!==this)?(Hl(this,!0),null===this.shadowVisible&&Fl(a)):Hl(this,!1);this.mi(a,b);h&&0!==(this.o&512)===!0&&El(a);m&&h&&Fl(a);n&&(a.restore(),a.Uc(this instanceof +V));d.js()||(b=1/(d.m11*d.m22-d.m12*d.m21),a.transform(d.m22*b,-d.m12*b,-d.m21*b,d.m11*b,b*(d.m21*d.dy-d.m22*d.dx),b*(d.m12*d.dx-d.m11*d.dy)))}}1!==c&&(a.globalAlpha=f)}}}};function Gl(a,b,c,d){var e=a.naturalBounds,f=0,g=0,h=e.width;e=e.height;var k=a.fw();a instanceof Qf&&(e=a.ya.bounds,f=e.x,g=e.y,h=e.width,e=e.height);ti(a,b,a.cc,!0,!1,c,d);a.cc instanceof Bl&&a.cc.type===Cl?(b.beginPath(),b.rect(f-k/2,g-k/2,h+k,e+k),b.Ef(a.cc)):b.fillRect(f-k/2,g-k/2,h+k,e+k)}t.gx=function(){return!1};t.mi=function(){}; +function ti(a,b,c,d,e,f,g){if(null!==c){var h=1,k=1;if("string"===typeof c)d?b.fillStyle=c:b.strokeStyle=c;else if(c.type===Il)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var l=0;a instanceof Qf&&(l=a.strokeWidth);h=f.width;k=f.height;e?(h=g.width,k=g.height):d||(h+=l,k+=l);if((f=b instanceof Jl)&&c.ye&&(c.type===Kl||c.zk===h&&c.Us===k))var m=c.ye;else{var n=0,p=0,r=0,q=0,u=0,x=0;x=u=0;e?(u=g.x,x=g.y):d||(u-=l/2,x-=l/2);n=c.start.x*h+c.start.offsetX;p=c.start.y*k+c.start.offsetY;r=c.end.x*h+ +c.end.offsetX;q=c.end.y*k+c.end.offsetY;n+=u;r+=u;p+=x;q+=x;if(c.type===Ll)m=b.createLinearGradient(n,p,r,q);else if(c.type===Cl)x=isNaN(c.endRadius)?Math.max(h,k)/2:c.endRadius,isNaN(c.startRadius)?(u=0,x=Math.max(h,k)/2):u=c.startRadius,m=b.createRadialGradient(n,p,u,r,q,x);else if(c.type===Kl)try{m=b.createPattern(c.pattern,"repeat")}catch(z){m=null}else Aa(c.type,"Brush type");if(c.type!==Kl&&(e=c.colorStops,null!==e))for(e=e.iterator;e.next();)m.addColorStop(e.key,e.value);if(f&&(c.ye=m,null!== +m&&(c.zk=h,c.Us=k),null===m&&c.type===Kl&&-1!==c.zk)){c.zk=-1;var y=a.diagram;null!==y&&-1===c.zk&&va(function(){y.redraw()},600)}}d?b.fillStyle=m:b.strokeStyle=m}}}t.vg=function(a){if(a instanceof V)a:{if(this!==a&&null!==a)for(var b=this.panel;null!==b;){if(b===a){a=!0;break a}b=b.panel}a=!1}else a=!1;return a};t.Lf=function(){if(!this.visible)return!1;var a=this.panel;return null!==a?a.Lf():!0}; +t.Kf=function(){for(var a=this instanceof V?this:this.panel;null!==a&&a.isEnabled;)a=a.panel;return null===a}; +function Dl(a){if(0!==(a.o&2048)===!0){var b=a.Gb;b.reset();if(!a.Jb.u()||!a.wc.u()){Ml(a,!1);return}b.translate(a.Jb.x-a.wc.x,a.Jb.y-a.wc.y);if(1!==a.scale||0!==a.angle){var c=a.naturalBounds;a.bo(b,c.x,c.y,c.width,c.height)}Ml(a,!1);Nl(a,!0)}0!==(a.o&4096)===!0&&(b=a.panel,null===b?(a.wh.set(a.Gb),a.Lk=a.scale,Nl(a,!1)):null!==b.oe&&(c=a.wh,c.reset(),b.se()?c.multiply(b.wh):null!==b.panel&&c.multiply(b.panel.wh),c.multiply(a.Gb),a.Lk=a.scale*b.Lk,Nl(a,!1)))} +t.bo=function(a,b,c,d,e){1!==this.Ea&&a.scale(this.Ea);if(0!==this.Lb){var f=K.alloc();f.Di(b,c,d,e,Kc);a.rotate(this.Lb,f.x,f.y);K.free(f)}};t.w=function(a){if(!Bj(this)){void 0===a&&(a=!1);wj(this,!0);xl(this,!0);var b=this.panel;null===b||a||b.w()}};t.Zj=function(){Bj(this)||(wj(this,!0),xl(this,!0))};function Ol(a){if(!Cj(a)){var b=a.panel;null!==b?b.w():a.zi()&&(b=a.diagram,null!==b&&(b.De.add(a),a instanceof T&&a.Bd(),b.Sb()));xl(a,!0)}} +t.Wk=function(){0!==(this.o&2048)===!1&&(Ml(this,!0),Nl(this,!0))};t.Xu=function(){Nl(this,!0)};t.R=function(){var a=this.part;null!==a&&a.R()}; +function wl(a,b){var c=a.stretch,d=a.panel;if(null!==d&&d.type===V.Table)return Pl(a,d.getRowDefinition(a.row),d.getColumnDefinition(a.column),b);if(null!==d&&d.type===V.Auto&&d.Ab()===a)return Ql(a,Bd,b);if(c===kl){if(null!==d){if(d.type===V.Spot&&d.Ab()===a)return Ql(a,Bd,b);c=d.defaultStretch;return c===kl?Ql(a,yg,b):Ql(a,c,b)}return Ql(a,yg,b)}return Ql(a,c,b)} +function Pl(a,b,c,d){var e=a.stretch;if(e!==kl)return Ql(a,e,d);var f=e=null;switch(b.stretch){case jl:f=!0;break;case Bd:f=!0}switch(c.stretch){case il:e=!0;break;case Bd:e=!0}b=a.panel.defaultStretch;null===e&&(e=b===il||b===Bd);null===f&&(f=b===jl||b===Bd);return!0===e&&!0===f?Ql(a,Bd,d):!0===e?Ql(a,il,d):!0===f?Ql(a,jl,d):Ql(a,yg,d)} +function Ql(a,b,c){if(c)return b;if(b===yg)return yg;c=a.desiredSize;if(c.u())return yg;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===il)return yg;if(b===Bd)return jl}else{if(b===jl)return yg;if(b===Bd)return il}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===jl)return yg;if(b===Bd)return il}else{if(b===il)return yg;if(b===Bd)return jl}return b}function Hl(a,b){a.o=b?a.o|512:a.o&-513}function sl(a){return 0!==(a.o&1024)}function Rl(a,b){a.o=b?a.o|1024:a.o&-1025} +function Ml(a,b){a.o=b?a.o|2048:a.o&-2049}function Nl(a,b){a.o=b?a.o|4096:a.o&-4097}function Bj(a){return 0!==(a.o&8192)}function wj(a,b){a.o=b?a.o|8192:a.o&-8193}function Cj(a){return 0!==(a.o&16384)}function xl(a,b){a.o=b?a.o|16384:a.o&-16385}t.Bi=function(a){this.fg=a};t.As=function(){};t.tv=function(a){this.va=a;Ol(this);return!0};t.hm=function(a,b){if(this.va.x!==a||this.va.y!==b)this.va.h(a,b),this.Wk()};t.fw=function(){return 0}; +function Sl(a){var b=a.part;if(b instanceof T&&(null!==a.portId||a===b.port)){var c=b.diagram;null===c||c.undoManager.isUndoingRedoing||Al(b,a)}}function Tl(a){var b=a.diagram;null===b||b.undoManager.isUndoingRedoing||(a instanceof V?a instanceof T?a.Bd():a.nk(a,function(a){Sl(a)}):Sl(a))} +t.bind=function(a,b,c,d){var e=null;"string"===typeof a?e=new Ji(a,b,c,d):e=a;e.yd=this;a=this.jh();null!==a&&Ul(a)&&v("Cannot add a Binding to a template that has already been copied: "+e);null===this.localBindings&&(this.localBindings=new H);this.localBindings.add(e);return this};t.set=function(a){if(G)for(var b in a)(b.startsWith("_")||-1!==b.indexOf("."))&&v("Property with underscore or period passed to GraphObject.set. Did you mean to use GraphObject.assign?");Object.assign(this,a);return this}; +t.xu=function(a){Vl(this,a);return this};t.apply=function(a){a(this);return this};t.im=function(a){Ij(this,a);return this};t.qz=function(){return this.jh()};t.jh=function(){for(var a=this instanceof V?this:this.panel;null!==a;){if(null!==a.allBindings)return a;a=a.panel}return null};t.Av=function(a){a.yd=this;null===this.animationTriggers&&(this.animationTriggers=new yb);this.animationTriggers.add(a.propertyName,a);return this}; +function Wl(a,b){for(var c=1;c<arguments.length;++c);c=arguments;var d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var f=Xl.L(a);"function"===typeof f?(c=Ja(arguments),d=f(c),Ga(d)||v('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):e=sa.go[a]}null===d&&(void 0!==e&&null!==e&&e.constructor||v("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),d=new e);e=1;if(d instanceof P&&1<c.length){f= +d;var g=c[1];if("string"===typeof g||g instanceof HTMLDivElement)Fi(f,g),e++}for(;e<c.length;e++)f=c[e],void 0===f?v("Undefined value at argument "+e+" for object being constructed by GraphObject.make: "+d):Vl(d,f);return d} +function Vl(a,b){if("string"===typeof b)if(a instanceof ch)a.text=b;else if(a instanceof Qf)a.figure=b;else if(a instanceof kk)a.source=b;else if(a instanceof V){var c=Yl.L(b);null!==c?a.type=c:G&&v("Unknown Panel type as an argument to GraphObject.make: "+b+". If building from source, you may need to call Panel.definePanelLayout.")}else a instanceof Bl?(c=$a(Bl,b),null!==c?a.type=c:v("Unknown Brush type as an argument to GraphObject.make: "+b)):a instanceof N?(c=$a(N,b),null!==c?a.type=c:G&&v("Unknown Geometry type as an argument to GraphObject.make: "+ +b)):a instanceof ke?(c=$a(ke,b),null!==c?a.type=c:G&&v("Unknown PathSegment type as an argument to GraphObject.make: "+b)):G&&v("Unable to use a string as an argument to GraphObject.make: "+b);else if(b instanceof O)a instanceof V||v("A GraphObject can only be added to a Panel, not to: "+a),a.add(b);else if(b instanceof ck){var d;b.isRow&&"function"===typeof a.getRowDefinition?d=a.getRowDefinition(b.index):b.isRow||"function"!==typeof a.getColumnDefinition||(d=a.getColumnDefinition(b.index));d instanceof +ck?(a=d,w(b,ck,ck,"copyFrom:pd"),b.isRow?a.height=b.height:a.width=b.width,a.minimum=b.minimum,a.maximum=b.maximum,a.alignment=b.alignment,a.stretch=b.stretch,a.sizing=b.sizing,a.hg=null===b.separatorPadding?null:b.separatorPadding.M(),a.separatorStroke=b.separatorStroke,a.separatorStrokeWidth=b.separatorStrokeWidth,a.Bj=null,b.separatorDashArray&&(a.Bj=Ja(b.separatorDashArray)),a.background=b.background,a.coversSeparators=b.coversSeparators,a.ae=b.ae):v("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+ +a)}else if(b instanceof F)"function"===typeof a.ub?a.ub(b):Ea(a,b);else if(b instanceof Zl)a.type=b;else if(b instanceof Ji)a instanceof O?a.bind(b):a instanceof ck?a.bind(b):v("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(b instanceof li)a instanceof O?a.Av(b):v("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(b instanceof je)a instanceof N&&a.type===N.m?a.figures.add(b):v("A PathFigure can only be added to a Path Geometry, not to: "+ +a);else if(b instanceof ke)a instanceof je?a.segments.add(b):v("A PathSegment can only be added to a PathFigure, not to: "+a);else if(b instanceof Di)a instanceof P?a.layout=b:a instanceof wf?a.layout=b:v("A Layout can only be assigned to a Diagram or a Group, not to: "+a);else if(Array.isArray(b))for(c=0;c<b.length;c++)Vl(a,b[c]);else if("object"===typeof b&&null!==b)if(a instanceof Bl){c=new db;for(var e in b)d=parseFloat(e),isNaN(d)?c[e]=b[e]:a.addColorStop(d,b[e]);Ij(a,c)}else if(a instanceof +ck){void 0!==b.row?(e=b.row,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&v("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.isRow=!0,a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&v("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.isRow=!1,a.index=e);e=new db;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);Ij(a,e)}else Ij(a,b);else v('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+ +a)}function $l(a,b){A(a,"string",O,"defineBuilder:name");A(b,"function",O,"defineBuilder:func");var c=a.toLowerCase();G&&(""===a||"none"===c||a===c)&&v("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);Xl.add(a,b)} +function am(a,b,c){void 0===c&&(c=null);var d=a[1];if("function"===typeof c?c(d):"string"===typeof d)return a.splice(1,1),d;if(void 0===b)throw Error("no "+("function"===typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b} +oa.Object.defineProperties(O.prototype,{bindingId:{configurable:!0,get:function(){return null!==this.B?this.B.pp:-1},set:function(a){this.bindingId!==a&&(null===this.B&&(this.B=new ql),this.B.pp=a)}},localBindings:{configurable:!0,get:function(){return null!==this.B?this.B.Rf:null},set:function(a){this.localBindings!==a&&(null===this.B&&(this.B=new ql),this.B.Rf=a)}},srcBindings:{configurable:!0,get:function(){return null!==this.B?this.B.jp:null},set:function(a){this.srcBindings!== +a&&(null===this.B&&(this.B=new ql),this.B.jp=a)}},shadowVisible:{configurable:!0,get:function(){return null!==this.B?this.B.Ji:null},set:function(a){var b=this.shadowVisible;b!==a&&(G&&null!==a&&A(a,"boolean",O,"shadowVisible"),pl(this),this.B.Ji=a,this.R(),this.g("shadowVisible",b,a))}},enabledChanged:{configurable:!0,get:function(){return null!==this.B?this.B.Nc:null},set:function(a){var b=this.enabledChanged;b!==a&&(null!==a&&A(a,"function",O,"enabledChanged"),pl(this), +this.B.Nc=a,this.g("enabledChanged",b,a))}},segmentOrientation:{configurable:!0,get:function(){return null!==this.Wa?this.Wa.ar:mg},set:function(a){var b=this.segmentOrientation;b!==a&&(G&&ab(a,R,O,"segmentOrientation"),null===this.Wa&&(this.Wa=new bm),this.Wa.ar=a,this.w(),this.g("segmentOrientation",b,a),a===mg&&(this.angle=0))}},segmentIndex:{configurable:!0,get:function(){return null!==this.Wa?this.Wa.v:-Infinity},set:function(a){G&&A(a,"number",O,"segmentIndex");a= +Math.round(a);var b=this.segmentIndex;b!==a&&(null===this.Wa&&(this.Wa=new bm),this.Wa.v=a,this.w(),this.g("segmentIndex",b,a))}},segmentFraction:{configurable:!0,get:function(){return null!==this.Wa?this.Wa.m:0},set:function(a){G&&A(a,"number",O,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1<a&&(a=1);var b=this.segmentFraction;b!==a&&(null===this.Wa&&(this.Wa=new bm),this.Wa.m=a,this.w(),this.g("segmentFraction",b,a))}},segmentOffset:{configurable:!0,get:function(){return null!== +this.Wa?this.Wa.G:zb},set:function(a){var b=this.segmentOffset;b.D(a)||(G&&w(a,K,O,"segmentOffset"),a=a.M(),null===this.Wa&&(this.Wa=new bm),this.Wa.G=a,this.w(),this.g("segmentOffset",b,a))}},stretch:{configurable:!0,get:function(){return null!==this.B?this.B.lg:kl},set:function(a){var b=this.stretch;b!==a&&(G&&ab(a,O,O,"stretch"),pl(this),this.B.lg=a,this.w(),this.g("stretch",b,a))}},name:{configurable:!0,get:function(){return null!==this.B?this.B.Ca:""},set:function(a){var b= +this.name;b!==a&&(G&&A(a,"string",O,"name"),pl(this),this.B.Ca=a,null!==this.part&&(this.part.Wh=null),this.g("name",b,a))}},opacity:{configurable:!0,get:function(){return this.yb},set:function(a){var b=this.yb;b!==a&&(A(a,"number",O,"opacity"),(0>a||1<a)&&Ba(a,"0 <= value <= 1",O,"opacity"),this.yb=a,this.g("opacity",b,a),a=this.diagram,b=this.part,null!==a&&null!==b&&a.R(Mj(b,b.actualBounds)))}},visible:{configurable:!0,get:function(){return 0!==(this.o&1)},set:function(a){var b= +0!==(this.o&1);b!==a&&(G&&A(a,"boolean",O,"visible"),this.o^=1,this.g("visible",b,a),b=this.panel,null!==b?b.w():this.zi()&&this.Zb(a),this.R(),Tl(this))}},pickable:{configurable:!0,get:function(){return 0!==(this.o&2)},set:function(a){var b=0!==(this.o&2);b!==a&&(G&&A(a,"boolean",O,"pickable"),this.o^=2,this.g("pickable",b,a))}},fromLinkableDuplicates:{configurable:!0,get:function(){return 0!==(this.o&4)},set:function(a){var b=0!==(this.o&4);b!==a&&(G&&A(a,"boolean",O, +"fromLinkableDuplicates"),this.o^=4,this.g("fromLinkableDuplicates",b,a))}},fromLinkableSelfNode:{configurable:!0,get:function(){return 0!==(this.o&8)},set:function(a){var b=0!==(this.o&8);b!==a&&(G&&A(a,"boolean",O,"fromLinkableSelfNode"),this.o^=8,this.g("fromLinkableSelfNode",b,a))}},toLinkableDuplicates:{configurable:!0,get:function(){return 0!==(this.o&16)},set:function(a){var b=0!==(this.o&16);b!==a&&(G&&A(a,"boolean",O,"toLinkableDuplicates"),this.o^=16,this.g("toLinkableDuplicates", +b,a))}},toLinkableSelfNode:{configurable:!0,get:function(){return 0!==(this.o&32)},set:function(a){var b=0!==(this.o&32);b!==a&&(G&&A(a,"boolean",O,"toLinkableSelfNode"),this.o^=32,this.g("toLinkableSelfNode",b,a))}},isPanelMain:{configurable:!0,get:function(){return 0!==(this.o&64)},set:function(a){var b=0!==(this.o&64);b!==a&&(G&&A(a,"boolean",O,"isPanelMain"),this.o^=64,this.w(),this.g("isPanelMain",b,a))}},isActionable:{configurable:!0,get:function(){return 0!== +(this.o&128)},set:function(a){var b=0!==(this.o&128);b!==a&&(G&&A(a,"boolean",O,"isActionable"),this.o^=128,this.g("isActionable",b,a))}},areaBackground:{configurable:!0,get:function(){return null!==this.B?this.B.tb:null},set:function(a){var b=this.areaBackground;b!==a&&(null!==a&&cm(a,"GraphObject.areaBackground"),a instanceof Bl&&a.freeze(),pl(this),this.B.tb=a,this.R(),this.g("areaBackground",b,a))}},background:{configurable:!0,get:function(){return this.cc},set:function(a){var b= +this.cc;b!==a&&(null!==a&&cm(a,"GraphObject.background"),a instanceof Bl&&a.freeze(),this.cc=a,this.R(),this.g("background",b,a))}},part:{configurable:!0,get:function(){if(this.zi())return this;if(null!==this.wj)return this.wj;var a;for(a=this.panel;a;){if(a instanceof S)return this.wj=a;a=a.panel}return null}},svg:{configurable:!0,get:function(){return this.yr},set:function(a){this.yr=a}},panel:{configurable:!0,get:function(){return this.fg}},layer:{configurable:!0, +enumerable:!0,get:function(){var a=this.part;return null!==a?a.layer:null}},diagram:{configurable:!0,get:function(){var a=this.part;return null!==a?a.diagram:null}},position:{configurable:!0,get:function(){return this.va},set:function(a){G&&w(a,K,O,"position");var b=a.x,c=a.y,d=this.va,e=d.x;d=d.y;(e===b||isNaN(e)&&isNaN(b))&&(d===c||isNaN(d)&&isNaN(c))?this.As():(a=a.copy(),this.tv(a,e,d)&&this.g("position",new K(e,d),a))}},actualBounds:{configurable:!0, +get:function(){return this.Jb}},scale:{configurable:!0,get:function(){return this.Ea},set:function(a){var b=this.Ea;b!==a&&(G&&E(a,O,"scale"),0>=a&&v("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Ea=a,this.w(),this.g("scale",b,a))}},angle:{configurable:!0,get:function(){return this.Lb},set:function(a){var b=this.Lb;b!==a&&(G&&E(a,O,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.Lb=a,Tl(this),this.w(),this.g("angle",b,a)))}},desiredSize:{configurable:!0, +enumerable:!0,get:function(){return this.fd},set:function(a){G&&w(a,Hb,O,"desiredSize");var b=a.width,c=a.height,d=this.fd,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.fd=a=a.M(),this.w(),this instanceof Qf&&this.sc(),this.g("desiredSize",d,a),sl(this)&&(a=this.part,null!==a&&(tl(this,a,"width"),tl(this,a,"height"))))}},width:{configurable:!0,get:function(){return this.fd.width},set:function(a){var b=this.fd.width;b===a||isNaN(b)&&isNaN(a)||(G&& +A(a,"number",O,"width"),b=this.fd,this.fd=a=(new Hb(a,this.fd.height)).freeze(),this.w(),this instanceof Qf&&this.sc(),this.g("desiredSize",b,a),sl(this)&&(a=this.part,null!==a&&tl(this,a,"width")))}},height:{configurable:!0,get:function(){return this.fd.height},set:function(a){var b=this.fd.height;b===a||isNaN(b)&&isNaN(a)||(G&&A(a,"number",O,"height"),b=this.fd,this.fd=a=(new Hb(this.fd.width,a)).freeze(),this.w(),this instanceof Qf&&this.sc(),this.g("desiredSize",b,a),sl(this)&&(a= +this.part,null!==a&&tl(this,a,"height")))}},minSize:{configurable:!0,get:function(){return null!==this.B?this.B.v:Pb},set:function(a){var b=this.minSize;b.D(a)||(G&&w(a,Hb,O,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),pl(this),this.B.v=a,this.w(),this.g("minSize",b,a))}},maxSize:{configurable:!0,get:function(){return null!==this.B?this.B.m:Ub},set:function(a){var b=this.maxSize;b.D(a)||(G&&w(a,Hb,O,"maxSize"),a=a.copy(),isNaN(a.width)&& +(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),pl(this),this.B.m=a,this.w(),this.g("maxSize",b,a))}},measuredBounds:{configurable:!0,get:function(){return this.wc}},naturalBounds:{configurable:!0,get:function(){return this.gc}},margin:{configurable:!0,get:function(){return this.Mg},set:function(a){"number"===typeof a?a=new gc(a):G&&w(a,gc,O,"margin");var b=this.Mg;b.D(a)||(this.Mg=a=a.M(),this.w(),this.g("margin",b,a))}},transform:{configurable:!0, +enumerable:!0,get:function(){0!==(this.o&2048)===!0&&Dl(this);return this.Gb}},oe:{configurable:!0,get:function(){0!==(this.o&4096)===!0&&Dl(this);return this.wh}},animationTriggers:{configurable:!0,get:function(){return null!==this.B?this.B.jb:null},set:function(a){this.animationTriggers!==a&&(pl(this),this.B.jb=a)}},reshapingBehavior:{configurable:!0,get:function(){return null!==this.B?this.B.Hi:yg},set:function(a){this.reshapingBehavior!==a&&(pl(this), +this.B.Hi=a)}},alignment:{configurable:!0,get:function(){return this.Kb},set:function(a){var b=this.Kb;b.D(a)||(G&&w(a,Ib,O,"alignment"),a.kc()&&!a.Rb()&&v("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Kb=a=a.M(),Ol(this),this.g("alignment",b,a))}},column:{configurable:!0,get:function(){return this.Dg},set:function(a){G&&E(a,O,"column");a=Math.round(a);var b=this.Dg;b!==a&&(0>a&&Ba(a,">= 0",O,"column"),this.Dg=a,this.w(),this.g("column", +b,a))}},columnSpan:{configurable:!0,get:function(){return null!==this.B?this.B.Ib:1},set:function(a){G&&A(a,"number",O,"columnSpan");a=Math.round(a);var b=this.columnSpan;b!==a&&(1>a&&Ba(a,">= 1",O,"columnSpan"),pl(this),this.B.Ib=a,this.w(),this.g("columnSpan",b,a))}},row:{configurable:!0,get:function(){return this.Xn},set:function(a){G&&E(a,O,"row");a=Math.round(a);var b=this.Xn;b!==a&&(0>a&&Ba(a,">= 0",O,"row"),this.Xn=a,this.w(),this.g("row",b,a))}},rowSpan:{configurable:!0, +enumerable:!0,get:function(){return null!==this.B?this.B.Ii:1},set:function(a){G&&A(a,"number",O,"rowSpan");a=Math.round(a);var b=this.rowSpan;b!==a&&(1>a&&Ba(a,">= 1",O,"rowSpan"),pl(this),this.B.Ii=a,this.w(),this.g("rowSpan",b,a))}},spanAllocation:{configurable:!0,get:function(){return null!==this.B?this.B.Ki:null},set:function(a){var b=this.spanAllocation;b!==a&&(null!==a&&A(a,"function",O,"spanAllocation"),pl(this),this.B.Ki=a,this.w(),this.g("spanAllocation",b,a))}},alignmentFocus:{configurable:!0, +enumerable:!0,get:function(){return this.tk},set:function(a){var b=this.tk;b.D(a)||(G&&w(a,Ib,O,"alignmentFocus"),!G||!a.kc()||a.Rb()||a.No()&&this instanceof T||v("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.tk=a=a.M(),this.w(),this.g("alignmentFocus",b,a))}},portId:{configurable:!0,get:function(){return this.Sn},set:function(a){var b=this.Sn;if(b!==a){G&&null!==a&&A(a,"string",O,"portId");var c=this.part;null===c||c instanceof T||v("Cannot set portID on a Link: "+ +a);null!==b&&null!==c&&dm(c,this);this.Sn=a;null!==a&&null!==c&&(c.Ue=!0,em(c,this));this.g("portId",b,a)}}},toSpot:{configurable:!0,get:function(){return null!==this.ea?this.ea.Gj:Ec},set:function(a){var b=this.toSpot;b.D(a)||(G&&w(a,Ib,O,"toSpot"),a=a.M(),this.Xc(),this.ea.Gj=a,this.g("toSpot",b,a),Sl(this))}},toEndSegmentLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.Ej:10},set:function(a){var b=this.toEndSegmentLength;b!==a&&(G&&A(a,"number",O, +"toEndSegmentLength"),0>a&&Ba(a,">= 0",O,"toEndSegmentLength"),this.Xc(),this.ea.Ej=a,this.g("toEndSegmentLength",b,a),Sl(this))}},toShortLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.Fj:0},set:function(a){var b=this.toShortLength;b!==a&&(G&&A(a,"number",O,"toShortLength"),this.Xc(),this.ea.Fj=a,this.g("toShortLength",b,a),Sl(this))}},toLinkable:{configurable:!0,get:function(){return null!==this.ea?this.ea.Fr:null},set:function(a){var b=this.toLinkable; +b!==a&&(G&&null!==a&&A(a,"boolean",O,"toLinkable"),this.Xc(),this.ea.Fr=a,this.g("toLinkable",b,a))}},toMaxLinks:{configurable:!0,get:function(){return null!==this.ea?this.ea.Gr:Infinity},set:function(a){var b=this.toMaxLinks;b!==a&&(G&&A(a,"number",O,"toMaxLinks"),0>a&&Ba(a,">= 0",O,"toMaxLinks"),this.Xc(),this.ea.Gr=a,this.g("toMaxLinks",b,a))}},fromSpot:{configurable:!0,get:function(){return null!==this.ea?this.ea.cj:Ec},set:function(a){var b=this.fromSpot;b.D(a)||(G&& +w(a,Ib,O,"fromSpot"),a=a.M(),this.Xc(),this.ea.cj=a,this.g("fromSpot",b,a),Sl(this))}},fromEndSegmentLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.aj:10},set:function(a){var b=this.fromEndSegmentLength;b!==a&&(G&&A(a,"number",O,"fromEndSegmentLength"),0>a&&Ba(a,">= 0",O,"fromEndSegmentLength"),this.Xc(),this.ea.aj=a,this.g("fromEndSegmentLength",b,a),Sl(this))}},fromShortLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.bj:0},set:function(a){var b= +this.fromShortLength;b!==a&&(G&&A(a,"number",O,"fromShortLength"),this.Xc(),this.ea.bj=a,this.g("fromShortLength",b,a),Sl(this))}},fromLinkable:{configurable:!0,get:function(){return null!==this.ea?this.ea.Xp:null},set:function(a){var b=this.fromLinkable;b!==a&&(G&&null!==a&&A(a,"boolean",O,"fromLinkable"),this.Xc(),this.ea.Xp=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{configurable:!0,get:function(){return null!==this.ea?this.ea.Yp:Infinity},set:function(a){var b=this.fromMaxLinks; +b!==a&&(G&&A(a,"number",O,"fromMaxLinks"),0>a&&Ba(a,">= 0",O,"fromMaxLinks"),this.Xc(),this.ea.Yp=a,this.g("fromMaxLinks",b,a))}},cursor:{configurable:!0,get:function(){return null!==this.B?this.B.j:""},set:function(a){var b=this.cursor;b!==a&&(A(a,"string",O,"cursor"),pl(this),this.B.j=a,this.g("cursor",b,a))}},click:{configurable:!0,get:function(){return null!==this.B?this.B.zh:null},set:function(a){var b=this.click;b!==a&&(null!==a&&A(a,"function",O,"click"),pl(this), +this.B.zh=a,this.g("click",b,a))}},doubleClick:{configurable:!0,get:function(){return null!==this.B?this.B.Fh:null},set:function(a){var b=this.doubleClick;b!==a&&(null!==a&&A(a,"function",O,"doubleClick"),pl(this),this.B.Fh=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0,get:function(){return null!==this.B?this.B.Bh:null},set:function(a){var b=this.contextClick;b!==a&&(null!==a&&A(a,"function",O,"contextClick"),pl(this),this.B.Bh=a,this.g("contextClick",b, +a))}},mouseEnter:{configurable:!0,get:function(){return null!==this.B?this.B.Rh:null},set:function(a){var b=this.mouseEnter;b!==a&&(null!==a&&A(a,"function",O,"mouseEnter"),pl(this),this.B.Rh=a,this.g("mouseEnter",b,a))}},mouseLeave:{configurable:!0,get:function(){return null!==this.B?this.B.Uh:null},set:function(a){var b=this.mouseLeave;b!==a&&(null!==a&&A(a,"function",O,"mouseLeave"),pl(this),this.B.Uh=a,this.g("mouseLeave",b,a))}},mouseOver:{configurable:!0, +get:function(){return null!==this.B?this.B.Vh:null},set:function(a){var b=this.mouseOver;b!==a&&(null!==a&&A(a,"function",O,"mouseOver"),pl(this),this.B.Vh=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return null!==this.B?this.B.Th:null},set:function(a){var b=this.mouseHover;b!==a&&(null!==a&&A(a,"function",O,"mouseHover"),pl(this),this.B.Th=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0,get:function(){return null!==this.B?this.B.Sh: +null},set:function(a){var b=this.mouseHold;b!==a&&(null!==a&&A(a,"function",O,"mouseHold"),pl(this),this.B.Sh=a,this.g("mouseHold",b,a))}},mouseDragEnter:{configurable:!0,get:function(){return null!==this.B?this.B.Wd:null},set:function(a){var b=this.mouseDragEnter;b!==a&&(null!==a&&A(a,"function",O,"mouseDragEnter"),pl(this),this.B.Wd=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{configurable:!0,get:function(){return null!==this.B?this.B.Sf:null},set:function(a){var b= +this.mouseDragLeave;b!==a&&(null!==a&&A(a,"function",O,"mouseDragLeave"),pl(this),this.B.Sf=a,this.g("mouseDragLeave",b,a))}},mouseDrop:{configurable:!0,get:function(){return null!==this.B?this.B.Qh:null},set:function(a){var b=this.mouseDrop;b!==a&&(null!==a&&A(a,"function",O,"mouseDrop"),pl(this),this.B.Qh=a,this.g("mouseDrop",b,a))}},actionDown:{configurable:!0,get:function(){return null!==this.B?this.B.$:null},set:function(a){var b=this.actionDown;b!==a&&(null!==a&& +A(a,"function",O,"actionDown"),pl(this),this.B.$=a,this.g("actionDown",b,a))}},actionMove:{configurable:!0,get:function(){return null!==this.B?this.B.ma:null},set:function(a){var b=this.actionMove;b!==a&&(null!==a&&A(a,"function",O,"actionMove"),pl(this),this.B.ma=a,this.g("actionMove",b,a))}},actionUp:{configurable:!0,get:function(){return null!==this.B?this.B.Ma:null},set:function(a){var b=this.actionUp;b!==a&&(null!==a&&A(a,"function",O,"actionUp"),pl(this),this.B.Ma= +a,this.g("actionUp",b,a))}},actionCancel:{configurable:!0,get:function(){return null!==this.B?this.B.G:null},set:function(a){var b=this.actionCancel;b!==a&&(null!==a&&A(a,"function",O,"actionCancel"),pl(this),this.B.G=a,this.g("actionCancel",b,a))}},toolTip:{configurable:!0,get:function(){return null!==this.B?this.B.ei:null},set:function(a){var b=this.toolTip;b!==a&&(!G||null===a||a instanceof Ce||a instanceof Me||v("GraphObject.toolTip must be an Adornment or HTMLInfo."), +pl(this),this.B.ei=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return null!==this.B?this.B.Ch:null},set:function(a){var b=this.contextMenu;b!==a&&(!G||a instanceof Ce||a instanceof Me||v("GraphObject.contextMenu must be an Adornment or HTMLInfo."),pl(this),this.B.Ch=a,this.g("contextMenu",b,a))}}});O.prototype.trigger=O.prototype.Av;O.prototype.findBindingPanel=O.prototype.jh;O.prototype.findTemplateBinder=O.prototype.qz;O.prototype.setProperties=O.prototype.im; +O.prototype.apply=O.prototype.apply;O.prototype.attach=O.prototype.xu;O.prototype.set=O.prototype.set;O.prototype.isEnabledObject=O.prototype.Kf;O.prototype.isVisibleObject=O.prototype.Lf;O.prototype.isContainedBy=O.prototype.vg;O.prototype.getNearestIntersectionPoint=O.prototype.bs;O.prototype.getLocalPoint=O.prototype.$r;O.prototype.getDocumentScale=O.prototype.Gf;O.prototype.getDocumentAngle=O.prototype.si;O.prototype.getDocumentBounds=O.prototype.ti;O.prototype.getDocumentPoint=O.prototype.oa; +O.prototype.intersectsRect=O.prototype.Yc;O.prototype.containedInRect=O.prototype.hh;O.prototype.containsRect=O.prototype.Re;O.prototype.containsPoint=O.prototype.ga;O.prototype.raiseChanged=O.prototype.g;O.prototype.raiseChangedEvent=O.prototype.ib;O.prototype.addCopyProperty=O.prototype.Nw;var Xl=null;O.className="GraphObject";Xl=new yb; +$l("Button",function(){function a(a,b){return null!==a.diagram.jc(a.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a},function(a){return a===b})}var b=Wl(V,V.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof V){var c=a.lb("ButtonBorder");null!==c&&(c.fill=b?a._buttonFillNormal:a._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD", +_buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},Wl(Qf,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new Ib(0,0,2.76142374915397,2.761423749153969),spot2:new Ib(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));b.mouseEnter=function(a,b){if(b.Kf()&&b instanceof V&&(a=b.lb("ButtonBorder"),a instanceof Qf)){var c=b._buttonFillOver;b._buttonFillNormal=a.fill;a.fill=c;c=b._buttonStrokeOver;b._buttonStrokeNormal=a.stroke;a.stroke= +c}};b.mouseLeave=function(a,b){b.Kf()&&b instanceof V&&(a=b.lb("ButtonBorder"),a instanceof Qf&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.Kf()&&b instanceof V&&null!==b._buttonFillPressed&&0===a.button){var c=b.lb("ButtonBorder");if(c instanceof Qf){a=a.diagram;var d=a.skipsUndoManager;a.skipsUndoManager=!0;var g=b._buttonFillPressed;b._buttonFillOver=c.fill;c.fill=g;g=b._buttonStrokePressed;b._buttonStrokeOver=c.stroke;c.stroke=g;a.skipsUndoManager= +d}}};b.actionUp=function(b,d){if(d.Kf()&&d instanceof V&&null!==d._buttonFillPressed&&0===b.button){var c=d.lb("ButtonBorder");if(c instanceof Qf){var f=b.diagram,g=f.skipsUndoManager;f.skipsUndoManager=!0;a(b,d)?(c.fill=d._buttonFillOver,c.stroke=d._buttonStrokeOver):(c.fill=d._buttonFillNormal,c.stroke=d._buttonStrokeNormal);f.skipsUndoManager=g}}};b.actionCancel=function(b,d){if(d.Kf()&&d instanceof V&&null!==d._buttonFillPressed){var c=d.lb("ButtonBorder");if(c instanceof Qf){var f=b.diagram, +g=f.skipsUndoManager;f.skipsUndoManager=!0;a(b,d)?(c.fill=d._buttonFillOver,c.stroke=d._buttonStrokeOver):(c.fill=d._buttonFillNormal,c.stroke=d._buttonStrokeNormal);f.skipsUndoManager=g}}};b.actionMove=function(b,d){if(d.Kf()&&d instanceof V&&null!==d._buttonFillPressed){var c=b.diagram;if(0===c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.lb("ButtonBorder"),b instanceof Qf))){var f=c.skipsUndoManager;c.skipsUndoManager=!0;var g=d._buttonFillPressed;b.fill!==g&&(b.fill=g);g= +d._buttonStrokePressed;b.stroke!==g&&(b.stroke=g);c.skipsUndoManager=f}}};return b}); +$l("TreeExpanderButton",function(){var a=Wl("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Wl(Qf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Sb},(new Ji("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).So()),{visible:!1},(new Ji("visible","isTreeLeaf",function(a){return!a})).So());a.click=function(a,c){c=c.part;c instanceof Ce&&(c=c.adornedPart);if(c instanceof T){var b=c.diagram; +if(null!==b){b=b.commandHandler;if(c.isTreeExpanded){if(!b.canCollapseTree(c))return}else if(!b.canExpandTree(c))return;a.handled=!0;c.isTreeExpanded?b.collapseTree(c):b.expandTree(c)}}};return a}); +$l("SubGraphExpanderButton",function(){var a=Wl("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Wl(Qf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Sb},(new Ji("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).So()));a.click=function(a,c){c=c.part;c instanceof Ce&&(c=c.adornedPart);if(c instanceof wf){var b=c.diagram;if(null!==b){b=b.commandHandler;if(c.isSubGraphExpanded){if(!b.canCollapseSubGraph(c))return}else if(!b.canExpandSubGraph(c))return; +a.handled=!0;c.isSubGraphExpanded?b.collapseSubGraph(c):b.expandSubGraph(c)}}};return a});$l("ToolTip",function(){return Wl(Ce,V.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new K(0,3),shadowBlur:5},Wl(Qf,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new Ib(0,0,4,6),spot2:new Ib(1,1,-4,-4)}))}); +$l("ContextMenu",function(){return Wl(Ce,V.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new K(0,3),shadowBlur:5},new Ji("background","",function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});$l("ContextMenuButton",function(){var a=Wl("Button");a.stretch=il;var b=a.lb("ButtonBorder");b instanceof Qf&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new Ib(0,0,2,3),b.spot2=new Ib(1,1,-2,-2));return a}); +$l("PanelExpanderButton",function(a){var b=am(a,"COLLAPSIBLE"),c=Wl("Button",{_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8",_buttonFillNormal:"rgba(0, 0, 0, 0)",_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null,_buttonFillPressed:"rgba(0, 0, 0, .4)",_buttonStrokePressed:null},Wl(Qf,{name:"ButtonIcon",strokeWidth:2},(new Ji("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).So(b))); +a=c.lb("ButtonBorder");a instanceof Qf&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)");c.click=function(a,c){var d=c.diagram;if(null!==d&&!d.isReadOnly){var e=c.jh();null===e&&(e=c.part);null!==e&&(c=e.lb(b),null!==c&&(a.handled=!0,d.Ja("Collapse/Expand Panel"),c.visible=!c.visible,d.kb("Collapse/Expand Panel")))}};return c}); +$l("CheckBoxButton",function(a){var b=am(a);a=Wl("Button",{desiredSize:new Hb(14,14)},Wl(Qf,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Bd,geometryStretch:Ag,visible:!1},""!==b?(new Ji("visible",b)).Hx():[]));a.click=function(a,d){if(d instanceof V){var c=a.diagram;if(!(null===c||c.isReadOnly||""!==b&&c.model.isReadOnly)){a.handled=!0;var f=d.lb("ButtonIcon");c.Ja("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a, +d);c.kb("checkbox")}}};return a}); +$l("CheckBox",function(a){a=am(a);a=Wl("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new gc(0,1,0,0)});var b=Wl(V,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillPressed:a._buttonFillPressed,_buttonStrokePressed:a._buttonStrokePressed,_buttonFillDisabled:a._buttonFillDisabled,mouseEnter:a.mouseEnter,mouseLeave:a.mouseLeave, +actionDown:a.actionDown,actionUp:a.actionUp,actionCancel:a.actionCancel,actionMove:a.actionMove,click:a.click,_buttonClick:a.click});a.mouseEnter=null;a.mouseLeave=null;a.actionDown=null;a.actionUp=null;a.actionCancel=null;a.actionMove=null;a.click=null;return b});O.None=yg=new F(O,"None",0);O.Default=kl=new F(O,"Default",0);O.Vertical=jl=new F(O,"Vertical",4);O.Horizontal=il=new F(O,"Horizontal",5);O.Fill=Bd=new F(O,"Fill",3);O.Uniform=Ag=new F(O,"Uniform",1); +O.UniformToFill=ll=new F(O,"UniformToFill",2);O.FlipVertical=ml=new F(O,"FlipVertical",1);O.FlipHorizontal=nl=new F(O,"FlipHorizontal",2);O.FlipBoth=ol=new F(O,"FlipBoth",3);O.make=Wl;O.getBuilders=function(){var a=new yb,b;for(b in Xl)if(b!==b.toLowerCase()){var c=Xl.L(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};O.defineBuilder=$l; +O.build=function(a,b){var c=Xl.L(a);if("function"===typeof c&&(c=c(null),c instanceof O))return b&&c.set(b),c;v('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')};O.takeBuilderArgument=am; +function ql(){this.oc=!1;this.Ca="";this.pp=-1;this.ob=this.jp=this.Rf=null;this.j="";this.jb=this.Ki=this.Nc=this.Ch=this.ei=this.G=this.Ma=this.ma=this.$=this.Qh=this.Sf=this.Wd=this.Sh=this.Th=this.Vh=this.Uh=this.Rh=this.Bh=this.Fh=this.zh=null;this.v=Pb;this.m=Ub;this.lg=kl;this.Ib=this.Ii=1;this.Hi=yg;this.ue=this.Ji=this.tb=null;this.Oc="category"} +ql.prototype.copy=function(){var a=new ql;a.Ca=this.Ca;a.pp=this.pp;a.Rf=this.Rf;a.ob=this.ob;a.j=this.j;a.zh=this.zh;a.Fh=this.Fh;a.Bh=this.Bh;a.Rh=this.Rh;a.Uh=this.Uh;a.Vh=this.Vh;a.Th=this.Th;a.Sh=this.Sh;a.Wd=this.Wd;a.Sf=this.Sf;a.Qh=this.Qh;a.$=this.$;a.ma=this.ma;a.Ma=this.Ma;a.G=this.G;a.ei=this.ei;a.Ch=this.Ch;a.Nc=this.Nc;a.Ki=this.Ki;a.jb=this.jb;a.v=this.v.M();a.m=this.m.M();a.lg=this.lg;a.Ii=this.Ii;a.Ib=this.Ib;a.Hi=this.Hi;a.tb=this.tb;a.Ji=this.Ji;a.ue=this.ue;a.Oc=this.Oc;return a}; +function bm(){this.v=-Infinity;this.m=0;this.G=zb;this.ar=mg;this.j=this.$="None"}bm.prototype.copy=function(){var a=new bm;a.v=this.v;a.m=this.m;a.G=this.G.M();a.ar=this.ar;a.$=this.$;a.j=this.j;return a};bm.className="LinkElementSettings";function rl(){this.Gj=this.cj=hd;this.Fj=this.bj=this.Ej=this.aj=NaN;this.Fr=this.Xp=null;this.Gr=this.Yp=Infinity} +rl.prototype.copy=function(){var a=new rl;a.cj=this.cj.M();a.Gj=this.Gj.M();a.aj=this.aj;a.Ej=this.Ej;a.bj=this.bj;a.Fj=this.Fj;a.Xp=this.Xp;a.Fr=this.Fr;a.Yp=this.Yp;a.Gr=this.Gr;return a};rl.className="LinkSettings";function fm(){this.Za=[1,0,0,1,0,0]}fm.prototype.copy=function(){var a=new fm;a.Za[0]=this.Za[0];a.Za[1]=this.Za[1];a.Za[2]=this.Za[2];a.Za[3]=this.Za[3];a.Za[4]=this.Za[4];a.Za[5]=this.Za[5];return a}; +fm.prototype.translate=function(a,b){this.Za[4]+=this.Za[0]*a+this.Za[2]*b;this.Za[5]+=this.Za[1]*a+this.Za[3]*b};fm.prototype.scale=function(a,b){this.Za[0]*=a;this.Za[1]*=a;this.Za[2]*=b;this.Za[3]*=b};fm.className="STransform";function gm(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.Xw=[];this.pattern=null}gm.prototype.addColorStop=function(a,b){this.Xw.push({offset:a,color:b})};gm.className="SGradient"; +function Lj(a,b){this.ownerDocument=a=void 0===b?sa.document:b;this.bA="http://www.w3.org/2000/svg";void 0!==a&&(this.Xa=this.$b("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.Xa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Xa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.Bo=null;this.context=new hm(this)} +Lj.prototype.resize=function(a,b,c,d){return this.width!==a||this.height!==b?(this.style.width=c+"px",this.style.height=d+"px",this.Xa.setAttributeNS(null,"width",c+"px"),this.Xa.setAttributeNS(null,"height",d+"px"),this.Xa.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.pw.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.pw.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1}; +Lj.prototype.$b=function(a,b,c){a=this.ownerDocument.createElementNS(this.bA,a);if(Ga(b))for(var d in b)a.setAttributeNS("href"===d?"http://www.w3.org/1999/xlink":"",d,b[d]);void 0!==c&&(a.textContent=c);return a};Lj.prototype.getBoundingClientRect=function(){return this.Xa.getBoundingClientRect()};Lj.prototype.focus=function(){this.Xa.focus()};Lj.prototype.ex=function(){this.ownerDocument=null}; +oa.Object.defineProperties(Lj.prototype,{width:{configurable:!0,get:function(){return this.Xa.width.baseVal.value},set:function(a){this.Xa.width=a}},height:{configurable:!0,get:function(){return this.Xa.height.baseVal.value},set:function(a){this.Xa.height=a}},style:{configurable:!0,get:function(){return this.Xa.style}}});Lj.className="SVGSurface"; +function hm(a){this.Ds=a;this.svg=a.Xa;this.stack=[];this.sd=[];this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.lineDashOffset=0;this.lineJoin="miter";this.lineWidth=1;this.miterLimit=10;this.shadowBlur=0;this.shadowColor="rgba(0, 0, 0, 0)";this.shadowOffsetY=this.shadowOffsetX=0;this.strokeStyle="#000000";this.textAlign="start";this.clipInsteadOfFill=!1;this.Wg=this.kr=this.jr=0;this.ls=null;this.path=[];this.rt=!1;this.Zg=null;this.Cj=0;this.Se=new fm; +im(this,1,0,0,1,0,0);var b=pb++,c=this.$b("clipPath",{id:"mainClip"+b});c.appendChild(this.$b("rect",{x:0,y:0,width:a.width,height:a.height}));this.pw=c;this.Ds.Xa.appendChild(c);this.sd[0].setAttributeNS(null,"clip-path","url(#mainClip"+b+")");this.dA={}}t=hm.prototype; +t.arc=function(a,b,c,d,e,f,g,h){var k=2*Math.PI,l=k-1E-6,m=c*Math.cos(d),n=c*Math.sin(d),p=a+m,r=b+n,q=f?0:1;d=f?d-e:e-d;(1E-6<Math.abs(g-p)||1E-6<Math.abs(h-r))&&this.path.push(["L",p,+r]);0>d&&(d=d%k+k);d>l?(this.path.push(["A",c,c,0,1,q,a-m,b-n]),this.path.push(["A",c,c,0,1,q,p,r])):1E-6<d&&this.path.push(["A",c,c,0,+(d>=Math.PI),q,a+c*Math.cos(e),b+c*Math.sin(e)])};t.beginPath=function(){this.path=[]};t.bezierCurveTo=function(a,b,c,d,e,f){this.path.push(["C",a,b,c,d,e,f])};t.clearRect=function(){}; +t.clip=function(){this.addPath("clipPath",this.path,this.Se)};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new gm("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e}; +t.createPattern=function(a){var b="";a instanceof HTMLCanvasElement&&(b=a.toDataURL());a instanceof HTMLImageElement&&(b=a.getAttribute("src"));var c=this.dA;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+pb++,e={x:0,y:0,width:a.width,height:a.height,href:b};a=this.$b("pattern",{width:a.width,height:a.height,id:d,patternUnits:"userSpaceOnUse"});a.appendChild(this.$b(Ck,e));this.svg.appendChild(a);c[b]=d;return"url(#"+d+")"}; +t.createRadialGradient=function(a,b,c,d,e,f){var g=new gm("radial");g.x1=a;g.y1=b;g.r1=c;g.x2=d;g.y2=e;g.r2=f;return g}; +t.drawImage=function(a,b,c,d,e,f,g,h,k){var l="";a instanceof HTMLCanvasElement&&(l=a.toDataURL());a instanceof HTMLImageElement&&(l=a.getAttribute("src"));var m=a instanceof HTMLImageElement?a.naturalWidth:a.width,n=a instanceof HTMLImageElement?a.naturalHeight:a.height;void 0===d&&(f=b,g=c,h=d=m,k=e=n);d=d||0;e=e||0;f=f||0;g=g||0;h=h||0;k=k||0;a={x:0,y:0,width:m||d,height:n||e,href:l};L.ha(d,h)&&L.ha(e,k)?-1===l.toLowerCase().indexOf(".svg")&&-1===l.toLowerCase().indexOf("data:image/svg")&&(a.preserveAspectRatio= +"xMidYMid slice"):a.preserveAspectRatio="none";l="";h/=d;k/=e;if(0!==f||0!==g)l+=" translate("+f+", "+g+")";if(1!==h||1!==k)l+=" scale("+h+", "+k+")";if(0!==b||0!==c)l+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==m||e!==n)f="CLIP"+pb++,g=this.$b("clipPath",{id:f}),g.appendChild(this.$b("rect",{x:b,y:c,width:d,height:e})),this.svg.appendChild(g),a["clip-path"]="url(#"+f+")";jm(this,Ck,a,this.Se,l);this.addElement(Ck,a)};t.fill=function(){this.addPath("fill",this.path,this.Se)}; +t.Ef=function(){this.clipInsteadOfFill?this.clip():this.fill()};t.fillRect=function(a,b,c,d){a=[a,b,c,d];a={x:a[0],y:a[1],width:a[2],height:a[3]};jm(this,"fill",a,this.Se);this.addElement("rect",a)};t.fillText=function(a,b,c){a=[a,b,c];b=this.textAlign;"left"===b?b="start":"right"===b?b="end":"center"===b&&(b="middle");b={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":b};jm(this,"fill",b,this.Se);this.addElement("text",b,a[0])};t.lineTo=function(a,b){this.path.push(["L",a,b])}; +t.moveTo=function(a,b){this.path.push(["M",a,b])};t.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};t.rect=function(a,b,c,d){this.path.push(["M",a,b],["L",a+c,b],["L",a+c,b+d],["L",a,b+d],["z"])}; +t.restore=function(){this.Se=this.stack.pop();this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle;this.font=a.font;this.globalAlpha=a.globalAlpha;this.lineCap=a.lineCap;this.lineDashOffset=a.lineDashOffset;this.lineJoin=a.lineJoin;this.lineWidth=a.lineWidth;this.miterLimit=a.miterLimit;this.shadowBlur=a.shadowBlur;this.shadowColor=a.shadowColor;this.shadowOffsetX=a.shadowOffsetX;this.shadowOffsetY=a.shadowOffsetY;this.strokeStyle=a.strokeStyle;this.textAlign=a.textAlign}; +t.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign});for(var a=[],b=0;b<this.path.length;b++)a.push(this.path[b]);this.stack.push(a);this.stack.push(this.Se.copy())}; +t.setTransform=function(a,b,c,d,e,f){1===a&&0===b&&0===c&&1===d&&0===e&&0===f||im(this,a,b,c,d,e,f)};t.scale=function(a,b){this.Se.scale(a,b)};t.translate=function(a,b){this.Se.translate(a,b)};t.transform=function(){};t.Vc=function(){};t.stroke=function(){this.addPath("stroke",this.path,this.Se)};t.Fi=function(){this.clipInsteadOfFill||this.stroke()};t.$b=function(a,b,c){return this.Ds.$b(a,b,c)}; +t.addElement=function(a,b,c){a=this.$b(a,b,c);0<this.sd.length?this.sd[this.sd.length-1].appendChild(a):this.svg.appendChild(a);return this.ls=a}; +function jm(a,b,c,d,e){1!==a.globalAlpha&&(c.opacity=a.globalAlpha);"fill"===b?(a.fillStyle instanceof gm?c.fill=km(a,a.fillStyle):/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),c.fill="rgb("+a[1]+","+a[2]+","+a[3]+")",c["fill-opacity"]=a[4]):c.fill=a.fillStyle,c.stroke="none"):"stroke"===b&&(c.fill="none",a.strokeStyle instanceof gm?c.stroke=km(a,a.strokeStyle):/^rgba\(/.test(a.strokeStyle)?(b=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle), +c.stroke="rgb("+b[1]+","+b[2]+","+b[3]+")",c["stroke-opacity"]=b[4]):c.stroke=a.strokeStyle,c["stroke-width"]=a.lineWidth,c["stroke-linecap"]=a.lineCap,c["stroke-linejoin"]=a.lineJoin,c["stroke-miterlimit"]=a.miterLimit);d=d.Za;d="matrix("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+")";void 0!==e&&(d+=e);c.transform=d} +function km(a,b){var c="GRAD"+pb++;if("linear"===b.type)var d=a.$b("linearGradient",{x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,id:c,gradientUnits:"userSpaceOnUse"});else if("radial"===b.type)d=a.$b("radialGradient",{x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,r1:b.r1,r2:b.r2,id:c});else throw Error("invalid gradient");var e=b.Xw;b=e.length;for(var f=[],g=0;g<b;g++){var h=e[g],k=h.color;h={offset:h.offset,"stop-color":k};/^rgba\(/.test(k)&&(k=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(k), +h["stop-color"]="rgb("+k[1]+","+k[2]+","+k[3]+")",h["stop-opacity"]=k[4]);f.push(h)}f.sort(function(a,b){return a.offset>b.offset?1:-1});for(e=0;e<b;e++)d.appendChild(a.$b("stop",f[e]));a.svg.appendChild(d);return"url(#"+c+")"} +t.addPath=function(a,b,c){for(var d=[],e=0;e<b.length;e++){var f=Ja(b[e]),g=[f.shift()];if("A"===g[0])g.push(f.shift()+","+f.shift(),f.shift(),f.shift()+","+f.shift(),f.shift()+","+f.shift());else for(;f.length;)g.push(f.shift()+","+f.shift());d.push(g.join(" "))}b={d:d.join(" ")};"stroke"===a&&this.rt&&(b["stroke-dasharray"]=this.Zg.toString(),b["stroke-dashoffset"]=this.Cj);jm(this,a,b,c);"clipPath"===a?(a="CLIP"+pb++,c=this.$b("clipPath",{id:a}),c.appendChild(this.$b("path",b)),this.svg.appendChild(c), +0<this.sd.length&&this.sd[this.sd.length-1].setAttributeNS(null,"clip-path","url(#"+a+")")):this.addElement("path",b)};function im(a,b,c,d,e,f,g){var h=new fm;h.Za=[b,c,d,e,f,g];b={};jm(a,"g",b,h);h=a.addElement("g",b);a.sd.push(h)} +t.km=function(a){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var b="SHADOW"+pb++,c=this.addElement("filter",{id:b,x:"-100%",y:"-100%",width:"300%",height:"300%"},null),d=a.computePixelRatio();a=this.$b("feGaussianBlur",{"in":"SourceAlpha",result:"blur",stdDeviation:this.shadowBlur/2/d});var e=this.$b("feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor}),f=this.$b("feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});d=this.$b("feOffset", +{"in":"comp",result:"offsetBlur",dx:this.shadowOffsetX/d,dy:this.shadowOffsetY/d});var g=this.$b("feMerge",{});g.appendChild(this.$b("feMergeNode",{"in":"offsetBlur"}));g.appendChild(this.$b("feMergeNode",{"in":"SourceGraphic"}));c.appendChild(a);c.appendChild(e);c.appendChild(f);c.appendChild(d);c.appendChild(g);0<this.sd.length&&this.sd[this.sd.length-1].setAttributeNS(null,"filter","url(#"+b+")")}};t.wv=function(a,b,c){this.jr=a;this.kr=b;this.Wg=c}; +function Fl(a){a.shadowOffsetX=0;a.shadowOffsetY=0;a.shadowBlur=0}function El(a){a.shadowOffsetX=a.jr;a.shadowOffsetY=a.kr;a.shadowBlur=a.Wg}t.Tr=function(a,b){this.rt=!0;this.Zg=a;this.Cj=b};t.Rr=function(){this.rt=!1};t.Uc=function(){};t.Ux=function(){};hm.prototype.rotate=function(){};hm.prototype.getImageData=function(){return null};hm.prototype.measureText=function(){return null};hm.className="SVGContext"; +P.prototype.ps=function(a){var b=new Lj(this,sa.document);void 0===a&&(a=new db);var c=this;return Ak(this,function(a,e){a=Bk(c,a,"SVG",b);a=null!==a?a.svg:null;return"function"===typeof e?(e(a),null):a},a)};P.prototype.makeSvg=P.prototype.ps;P.prototype.av=function(a){return this.ps(a)};P.prototype.makeSVG=P.prototype.av; +O.prototype.gx=function(a,b){if(!(a instanceof hm))return!1;var c=null,d=a.ls,e=this.transform,f=this.panel;0!==(this.o&4096)===!0&&Dl(this);var g=this.Jb,h=0!==(this.o&256);a.clipInsteadOfFill&&(h=!1);var k=!1;this instanceof ch&&(a.font=this.font);if(h){k=f.se()?f.naturalBounds:f.actualBounds;if(null!==this.pb){var l=this.pb;var m=l.x;var n=l.y;var p=l.width;l=l.height}else m=Math.max(g.x,k.x),n=Math.max(g.y,k.y),p=Math.min(g.right,k.right)-m,l=Math.min(g.bottom,k.bottom)-n;if(m>g.width+g.x||g.x> +k.width+k.x||n>g.height+g.y||g.y>k.height+k.y)return!0;k=!0;im(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(m,n,p,l);a.clip()}if(this.zi()&&!this.isVisible())return!0;a.Se.Za=[1,0,0,1,0,0];(this instanceof ch&&1<this.lineCount||this instanceof Qf&&1<this.geometry.figures.length)&&im(a,1,0,0,1,0,0);m=!1;this.zi()&&this.isShadowed&&b.Te("drawShadows")&&(n=this.shadowOffset,a.wv(n.x*b.scale*b.qc,n.y*b.scale*b.qc,this.shadowBlur),El(a),a.shadowColor=this.shadowColor);n=!1;this.part&&b.Te("drawShadows")&& +(n=this.part.isShadowed);a.clipInsteadOfFill&&(n=!1);!0===this.shadowVisible?(El(a),!1===m&&n&&(im(a,1,0,0,1,0,0),a.km(b),m=!0)):!1===this.shadowVisible&&Fl(a);p=this.naturalBounds;null!==this.areaBackground&&(ti(this,a,this.areaBackground,!0,!0,p,g),!1===m&&n&&(im(a,1,0,0,1,0,0),a.km(b),m=!0),this.areaBackground instanceof Bl&&this.areaBackground.type===Cl?(a.beginPath(),a.rect(g.x,g.y,g.width,g.height),a.Ef(this.areaBackground)):a.fillRect(g.x,g.y,g.width,g.height));l=!1;this instanceof V?im(a, +e.m11,e.m12,e.m21,e.m22,e.dx,e.dy):(a.Se.Za=[e.m11,e.m12,e.m21,e.m22,e.dx,e.dy],!1===m&&n&&(l=!0));null!==this.background&&(!1===m&&n&&(im(a,1,0,0,1,0,0),a.km(b),m=!0),Gl(this,a,p,g));n&&(null!==this.background||null!==this.areaBackground||null!==f&&0!==(f.o&512)||null!==f&&(f.type===V.Auto||f.type===V.Spot)&&f.Ab()!==this)?(Hl(this,!0),null===this.shadowVisible&&Fl(a),l=!1):Hl(this,!1);l&&!1===m&&(im(a,1,0,0,1,0,0),a.km(b),m=!0);this.mi(a,b);n&&0!==(this.o&512)===!0&&El(a);this.zi()&&n&&Fl(a);h&& +(a.restore(),k&&a.sd.pop());this instanceof V&&(c=a.sd.pop());!0===m&&a.sd.pop();if(this instanceof ch&&1<this.lineCount||this instanceof Qf&&1<this.geometry.figures.length)c=a.sd.pop();null!==a.Ds.Bo&&(null===c&&(d===a.ls?(im(a,1,0,0,1,0,0),c=a.sd.pop()):c=a.ls),a.Ds.Bo(this,c));this.svg=c;return!0}; +function Dk(a,b){this.ownerDocument=b=void 0===b?sa.document:b;this.Bo=null;b=b.createElement("canvas");b.tabIndex=0;this.Xa=b;this.Xa.innerHTML="This text is displayed if your browser does not support the Canvas HTML element.";this.context=new Jl(b);b.H=a}Dk.prototype.resize=function(a,b,c,d){return this.width!==a||this.height!==b?(this.width=a,this.height=b,this.style.width=c+"px",this.style.height=d+"px",!0):!1};Dk.prototype.toDataURL=function(a,b){return this.Xa.toDataURL(a,b)}; +Dk.prototype.getBoundingClientRect=function(){return this.Xa.getBoundingClientRect()};Dk.prototype.focus=function(){this.Xa.focus()};Dk.prototype.ex=function(){this.ownerDocument=this.Xa.H=null};oa.Object.defineProperties(Dk.prototype,{width:{configurable:!0,get:function(){return this.Xa.width},set:function(a){this.Xa.width=a}},height:{configurable:!0,get:function(){return this.Xa.height},set:function(a){this.Xa.height=a}},style:{configurable:!0,get:function(){return this.Xa.style}}}); +Dk.className="CanvasSurface";function Jl(a){a.getContext&&a.getContext("2d")||v("Browser does not support HTML Canvas Element");this.ba=a.getContext("2d");this.Rs=this.Ts=this.Ss="";this.Cm=!1;this.Wg=this.kr=this.jr=0;this.Fl=new Jb}t=Jl.prototype;t.Ux=function(a){this.ba.imageSmoothingEnabled=a};t.arc=function(a,b,c,d,e,f){this.ba.arc(a,b,c,d,e,f)};t.beginPath=function(){this.ba.beginPath()};t.bezierCurveTo=function(a,b,c,d,e,f){this.ba.bezierCurveTo(a,b,c,d,e,f)}; +t.clearRect=function(a,b,c,d){this.Vc();this.ba.clearRect(a,b,c,d)};t.clip=function(){this.ba.clip()};t.closePath=function(){this.ba.closePath()};t.createLinearGradient=function(a,b,c,d){return this.ba.createLinearGradient(a,b,c,d)};t.createPattern=function(a,b){return this.ba.createPattern(a,b)};t.createRadialGradient=function(a,b,c,d,e,f){return this.ba.createRadialGradient(a,b,c,d,e,f)}; +t.drawImage=function(a,b,c,d,e,f,g,h,k){void 0===d?this.ba.drawImage(a,b,c):this.ba.drawImage(a,b,c,d,e,f,g,h,k)};t.fill=function(){this.ba.fill()};t.fillRect=function(a,b,c,d){this.ba.fillRect(a,b,c,d)};t.fillText=function(a,b,c){this.ba.fillText(a,b,c)};t.getImageData=function(a,b,c,d){return this.ba.getImageData(a,b,c,d)};t.lineTo=function(a,b){this.ba.lineTo(a,b)};t.measureText=function(a){return this.ba.measureText(a)};t.moveTo=function(a,b){this.ba.moveTo(a,b)}; +t.quadraticCurveTo=function(a,b,c,d){this.ba.quadraticCurveTo(a,b,c,d)};t.rect=function(a,b,c,d){this.ba.rect(a,b,c,d)};t.restore=function(){this.ba.restore()};t.save=function(){this.Vc();this.ba.save()};Jl.prototype.rotate=function(a){this.Fl.rotate(57.2958*a,0,0)};t=Jl.prototype;t.setTransform=function(a,b,c,d,e,f){this.Fl.setTransform(a,b,c,d,e,f)};t.scale=function(a,b){this.Fl.scale(a,b)};t.translate=function(a,b){this.Fl.translate(a,b)};t.stroke=function(){this.ba.stroke()}; +t.transform=function(a,b,c,d,e,f){if(1!==a||0!==b||0!==c||1!==d||0!==e||0!==f){var g=this.Fl,h=g.m11*a+g.m21*b;a=g.m12*a+g.m22*b;b=g.m11*c+g.m21*d;c=g.m12*c+g.m22*d;g.dx=g.m11*e+g.m21*f+g.dx;g.dy=g.m12*e+g.m22*f+g.dy;g.m11=h;g.m12=a;g.m21=b;g.m22=c}};t.Vc=function(){var a=this.Fl;this.ba.setTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy)}; +t.Ef=function(a){if(a instanceof Bl&&a.type===Cl){var b=a.zk;a=a.Us;a>b?(this.scale(b/a,1),this.translate((a-b)/2,0)):b>a&&(this.scale(1,a/b),this.translate(0,(b-a)/2));this.Cm?this.clip():this.fill();a>b?(this.translate(-(a-b)/2,0),this.scale(1/(b/a),1)):b>a&&(this.translate(0,-(b-a)/2),this.scale(1,1/(a/b)))}else this.Cm?this.clip():this.fill()};t.Fi=function(){this.Cm||this.stroke()};t.wv=function(a,b,c){this.jr=a;this.kr=b;this.Wg=c}; +t.Tr=function(a,b){var c=this.ba;void 0!==c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.Rr=function(){var a=this.ba;void 0!==a.setLineDash&&(a.setLineDash(lm),a.lineDashOffset=0)};t.Uc=function(a){a&&(this.Ss="");this.Rs=this.Ts=""}; +oa.Object.defineProperties(Jl.prototype,{fillStyle:{configurable:!0,get:function(){return this.ba.fillStyle},set:function(a){this.Rs!==a&&(this.Rs=this.ba.fillStyle=a)}},font:{configurable:!0,get:function(){return this.ba.font},set:function(a){this.Ss!==a&&(this.Ss=this.ba.font=a)}},globalAlpha:{configurable:!0,get:function(){return this.ba.globalAlpha},set:function(a){this.ba.globalAlpha=a}},lineCap:{configurable:!0,get:function(){return this.ba.lineCap}, +set:function(a){this.ba.lineCap=a}},lineDashOffset:{configurable:!0,get:function(){return this.ba.lineDashOffset},set:function(a){this.ba.lineDashOffset=a}},lineJoin:{configurable:!0,get:function(){return this.ba.lineJoin},set:function(a){this.ba.lineJoin=a}},lineWidth:{configurable:!0,get:function(){return this.ba.lineWidth},set:function(a){this.ba.lineWidth=a}},miterLimit:{configurable:!0,get:function(){return this.ba.miterLimit},set:function(a){this.ba.miterLimit= +a}},shadowBlur:{configurable:!0,get:function(){return this.ba.shadowBlur},set:function(a){this.ba.shadowBlur=a}},shadowColor:{configurable:!0,get:function(){return this.ba.shadowColor},set:function(a){this.ba.shadowColor=a}},shadowOffsetX:{configurable:!0,get:function(){return this.ba.shadowOffsetX},set:function(a){this.ba.shadowOffsetX=a}},shadowOffsetY:{configurable:!0,get:function(){return this.ba.shadowOffsetY},set:function(a){this.ba.shadowOffsetY= +a}},strokeStyle:{configurable:!0,get:function(){return this.ba.strokeStyle},set:function(a){this.Ts!==a&&(this.Ts=this.ba.strokeStyle=a)}},textAlign:{configurable:!0,get:function(){return this.ba.textAlign},set:function(a){this.ba.textAlign=a}},imageSmoothingEnabled:{configurable:!0,get:function(){return this.ba.imageSmoothingEnabled},set:function(a){this.ba.imageSmoothingEnabled=a}},clipInsteadOfFill:{configurable:!0,get:function(){return this.Cm}, +set:function(a){this.Cm=a}}});var lm=Object.freeze([]);Jl.className="CanvasSurfaceContext";function mm(){this.G=this.m=this.v=this.j=0}mm.className="ColorNumbers"; +function Bl(a,b){nm||(om(),nm=!0);Za(this);this._isFrozen=!1;void 0===a?(this.wa=Il,this.yk="black"):"string"===typeof a?(this.wa=Il,G&&!pm(a)&&v('Color "'+a+'" is not a valid color string for Brush constructor'),this.yk=a):(G&&ab(a,Bl,Bl,"constructor:type"),this.wa=a,this.yk="black");a=this.wa;a===Ll?(this.Nd=Gc,this.Mk=Nc):this.Mk=a===Cl?this.Nd=Kc:this.Nd=Ec;this.qr=0;this.Np=NaN;this.ye=this.Oq=this.xe=null;this.Us=this.zk=0;b&&Object.assign(this,b)} +Bl.prototype.copy=function(){var a=new Bl;a.wa=this.wa;a.yk=this.yk;a.Nd=this.Nd.M();a.Mk=this.Mk.M();a.qr=this.qr;a.Np=this.Np;null!==this.xe&&(a.xe=this.xe.copy());a.Oq=this.Oq;return a};t=Bl.prototype;t.freeze=function(){this._isFrozen=!0;null!==this.xe&&this.xe.freeze();return this};t.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;null!==this.xe&&this.xe.pa();return this};t.ub=function(a){a.classType===Bl?this.type=a:Ea(this,a)}; +t.toString=function(){var a="Brush(";if(this.type===Il)a+=this.color;else if(a=this.type===Ll?a+"Linear ":this.type===Cl?a+"Radial ":this.type===Kl?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.colorStops)for(var b=this.colorStops.iterator;b.next();)a+=" "+b.key+":"+b.value;return a+")"}; +t.addColorStop=function(a,b){this._isFrozen&&xa(this);("number"!==typeof a||!isFinite(a)||1<a||0>a)&&Ba(a,"0 <= loc <= 1",Bl,"addColorStop:loc");A(b,"string",Bl,"addColorStop:color");G&&!pm(b)&&v('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.xe&&(this.xe=new yb);this.xe.add(a,b);this.wa===Il&&(this.type=Ll);this.ye=null;return this}; +function pm(a){if("black"===a)return!0;if(""===a)return!1;G&&A(a,"string",Bl,"isValidColor");nm||(om(),nm=!0);var b=qm;if(null===b)return!0;b.fillStyle="#000000";var c=b.fillStyle;b.fillStyle=a;if(b.fillStyle!==c)return!0;b.fillStyle="#FFFFFF";c=b.fillStyle;b.fillStyle=a;return b.fillStyle!==c} +t.Vz=function(a,b){this._isFrozen&&xa(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?rm:b;if(this.type===Il)gi(this.color),this.color=sm(a,b);else if((this.type===Ll||this.type===Cl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)gi(c.value),this.addColorStop(c.key,sm(a,b));return this};function tm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?rm:c;gi(a);return sm(b,c)} +t.Uy=function(a,b){this._isFrozen&&xa(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?rm:b;if(this.type===Il)gi(this.color),this.color=sm(-a,b);else if((this.type===Ll||this.type===Cl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)gi(c.value),this.addColorStop(c.key,sm(-a,b));return this};function um(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?rm:c;gi(a);return sm(-b,c)} +function vm(a,b,c){gi(a);a=wm.j;var d=wm.v,e=wm.m,f=wm.G;gi(b);void 0===c&&(c=.5);return"rgba("+Math.round((wm.j-a)*c+a)+", "+Math.round((wm.v-d)*c+d)+", "+Math.round((wm.m-e)*c+e)+", "+Math.round((wm.G-f)*c+f)+")"} +t.Bx=function(){if(this.type===Il)return xm(this.color);if((this.type===Ll||this.type===Cl)&&null!==this.colorStops){var a=this.colorStops;if(this.type===Cl)return xm(a.first().value);if(null!==a.get(.5))return xm(a.get(.5));if(2===a.count)return a=a.Ka(),xm(vm(a[0].value,a[1].value));for(var b=a.iterator,c=-1,d=-1,e=1,f=1;b.next();){var g=b.key,h=Math.abs(.5-b.key);e>f&&h<e?(c=g,e=h):f>=e&&h<f&&(d=g,f=h)}c>d&&(f=c,c=d,d=f,f=e);e=d-c;return xm(vm(a.get(c),a.get(d),1-f/e))}return!1}; +function xm(a){if(!a)return!1;if(a instanceof Bl)return a.Bx();gi(a);return 128>(299*wm.j+587*wm.v+114*wm.m)/1E3} +function sm(a,b){switch(b){case rm:b=100*ym(wm.j);var c=100*ym(wm.v),d=100*ym(wm.m);zm.j=.4124564*b+.3575761*c+.1804375*d;zm.v=.2126729*b+.7151522*c+.072175*d;zm.m=.0193339*b+.119192*c+.9503041*d;zm.G=wm.G;b=Am(zm.j/Bm[0]);c=Am(zm.v/Bm[1]);d=Am(zm.m/Bm[2]);Cm.j=116*c-16;Cm.v=500*(b-c);Cm.m=200*(c-d);Cm.G=zm.G;Cm.j=Math.min(100,Math.max(0,Cm.j+100*a));a=(Cm.j+16)/116;b=a-Cm.m/200;zm.j=Bm[0]*Dm(Cm.v/500+a);zm.v=Bm[1]*(Cm.j>Em*Fm?Math.pow(a,3):Cm.j/Em);zm.m=Bm[2]*Dm(b);zm.G=Cm.G;a=-.969266*zm.j+1.8760108* +zm.v+.041556*zm.m;b=.0556434*zm.j+-.2040259*zm.v+1.0572252*zm.m;wm.j=255*Gm((3.2404542*zm.j+-1.5371385*zm.v+-.4985314*zm.m)/100);wm.v=255*Gm(a/100);wm.m=255*Gm(b/100);wm.G=zm.G;wm.j=Math.round(wm.j);255<wm.j?wm.j=255:0>wm.j&&(wm.j=0);wm.v=Math.round(wm.v);255<wm.v?wm.v=255:0>wm.v&&(wm.v=0);wm.m=Math.round(wm.m);255<wm.m?wm.m=255:0>wm.m&&(wm.m=0);return"rgba("+wm.j+", "+wm.v+", "+wm.m+", "+wm.G+")";case Hm:return hi(),ii.m=Math.min(100,Math.max(0,ii.m+100*a)),"hsla("+ii.j+", "+ii.v+"%, "+ii.m+"%, "+ +ii.G+")";default:v("Unknown color space: "+b)}}function gi(a){nm||(om(),nm=!0);var b=qm;if(null!==b){b.clearRect(0,0,1,1);b.fillStyle="#000000";var c=b.fillStyle;b.fillStyle=a;b.fillStyle!==c?(b.fillRect(0,0,1,1),a=b.getImageData(0,0,1,1).data,wm.j=a[0],wm.v=a[1],wm.m=a[2],wm.G=a[3]/255):(b.fillStyle="#FFFFFF",c=b.fillStyle,b.fillStyle=a,b.fillStyle===c&&G&&v('Color "'+a+'" is not a valid color string for RGBA color conversion'),wm.j=0,wm.v=0,wm.m=0,wm.G=1)}} +function hi(){var a=wm.j/255,b=wm.v/255,c=wm.m/255,d=Math.max(a,b,c),e=Math.min(a,b,c),f=d-e;e=(d+e)/2;if(0===f)var g=a=0;else{switch(d){case a:g=(b-c)/f%6;break;case b:g=(c-a)/f+2;break;case c:g=(a-b)/f+4}g*=60;0>g&&(g+=360);a=f/(1-Math.abs(2*e-1))}ii.j=Math.round(g);ii.v=Math.round(100*a);ii.m=Math.round(100*e);ii.G=wm.G}function ym(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Gm(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055} +function Am(a){return a>Fm?Math.pow(a,1/3):(Em*a+16)/116}function Dm(a){var b=a*a*a;return b>Fm?b:(116*a-16)/Em}function cm(a,b){"string"===typeof a?G&&!pm(a)&&v('Color "'+a+'" is not a valid color string for '+b):a instanceof Bl||v("Value for "+b+" must be a color string or a Brush, not "+a)}function om(){qm=ah?(new Dk(null)).context:null} +oa.Object.defineProperties(Bl.prototype,{type:{configurable:!0,get:function(){return this.wa},set:function(a){this._isFrozen&&xa(this,a);ab(a,Bl,Bl,"type");this.wa=a;this.start.kc()&&(a===Ll?this.start=Gc:a===Cl&&(this.start=Kc));this.end.kc()&&(a===Ll?this.end=Nc:a===Cl&&(this.end=Kc));this.ye=null}},color:{configurable:!0,get:function(){return this.yk},set:function(a){this._isFrozen&&xa(this,a);G&&!pm(a)&&v('Color "'+a+'" is not a valid color string for Brush.color'); +this.yk=a;this.ye=null}},start:{configurable:!0,get:function(){return this.Nd},set:function(a){this._isFrozen&&xa(this,a);w(a,Ib,Bl,"start");this.Nd=a.M();this.ye=null}},end:{configurable:!0,get:function(){return this.Mk},set:function(a){this._isFrozen&&xa(this,a);w(a,Ib,Bl,"end");this.Mk=a.M();this.ye=null}},startRadius:{configurable:!0,get:function(){return this.qr},set:function(a){this._isFrozen&&xa(this,a);E(a,Bl,"startRadius");0>a&&Ba(a,">= zero",Bl, +"startRadius");this.qr=a;this.ye=null}},endRadius:{configurable:!0,get:function(){return this.Np},set:function(a){this._isFrozen&&xa(this,a);E(a,Bl,"endRadius");0>a&&Ba(a,">= zero",Bl,"endRadius");this.Np=a;this.ye=null}},colorStops:{configurable:!0,get:function(){return this.xe},set:function(a){this._isFrozen&&xa(this,a);G&&w(a,yb,Bl,"colorStops");this.xe=a;this.ye=null}},pattern:{configurable:!0,get:function(){return this.Oq},set:function(a){this._isFrozen&& +xa(this,a);this.Oq=a;this.ye=null}}});Bl.prototype.isDark=Bl.prototype.Bx;Bl.prototype.darkenBy=Bl.prototype.Uy;Bl.prototype.lightenBy=Bl.prototype.Vz;Bl.prototype.addColorStop=Bl.prototype.addColorStop;var Fm=216/24389,Em=24389/27,Bm=[95.047,100,108.883],qm=null,wm=new mm,ii=new mm,zm=new mm,Cm=new mm,nm=!1;Bl.className="Brush";var Il;Bl.Solid=Il=new F(Bl,"Solid",0);var Ll;Bl.Linear=Ll=new F(Bl,"Linear",1);var Cl;Bl.Radial=Cl=new F(Bl,"Radial",2);var Kl;Bl.Pattern=Kl=new F(Bl,"Pattern",4);var rm; +Bl.Lab=rm=new F(Bl,"Lab",5);var Hm;Bl.HSL=Hm=new F(Bl,"HSL",6); +Bl.randomColor=function(a,b){void 0===a&&(a=128);G&&(E(a,Bl,"randomColor:min"),(0>a||255<a)&&Ba(a,"0 <= min <= 255",Bl,"randomColor:min"));void 0===b&&(b=Math.max(a,255));G&&(E(b,Bl,"randomColor:max"),(b<a||255<b)&&Ba(b,"min <= max <= 255",Bl,"randomColor:max"));var c=Math.abs(b-a);b=Math.floor(a+Math.random()*c).toString(16);var d=Math.floor(a+Math.random()*c).toString(16);a=Math.floor(a+Math.random()*c).toString(16);2>b.length&&(b="0"+b);2>d.length&&(d="0"+d);2>a.length&&(a="0"+a);return"#"+b+d+ +a};Bl.isValidColor=pm;Bl.lighten=function(a){return tm(a)};Bl.lightenBy=tm;Bl.darken=function(a){return um(a)};Bl.darkenBy=um;Bl.mix=vm;Bl.isDark=xm;function Zl(){this.Ca="Base"}Zl.prototype.measure=function(){};Zl.prototype.Yz=function(a,b,c,d,e){a.measure(b,c,d,e)};Zl.prototype.arrange=function(){};Zl.prototype.Iy=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};Zl.prototype.hA=function(a){a.Zj()};Zl.prototype.zc=function(){}; +oa.Object.defineProperties(Zl.prototype,{name:{configurable:!0,get:function(){return this.Ca},set:function(a){this.Ca=a}},classType:{configurable:!0,get:function(){return V}}});Zl.prototype.remeasureObject=Zl.prototype.hA;Zl.prototype.arrangeElement=Zl.prototype.Iy;Zl.prototype.measureElement=Zl.prototype.Yz;Zl.className="PanelLayout";function Im(){this.Ca="Base"}na(Im,Zl); +Im.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=Jm(a);for(var k=0;k<h;k++){var l=d[k];if(l.visible||l===a){var m=l.margin,n=m.right+m.left;m=m.top+m.bottom;l.measure(b,c,f,g);var p=l.measuredBounds;n=Math.max(p.width+n,0);m=Math.max(p.height+m,0);p=l.position.x;var r=l.position.y;isFinite(p)||(p=0);isFinite(r)||(r=0);l instanceof Qf&&l.isGeometryPositioned&&(l=l.strokeWidth/2,p-=l,r-=l);lc(e,p,r,n,m)}}}; +Im.prototype.arrange=function(a,b,c){var d=b.length,e=a.padding;a=c.x-e.left;c=c.y-e.top;for(e=0;e<d;e++){var f=b[e],g=f.measuredBounds,h=f.margin,k=f.position.x,l=f.position.y;k=isNaN(k)?-a:k-a;l=isNaN(l)?-c:l-c;if(f instanceof Qf&&f.isGeometryPositioned){var m=f.strokeWidth/2;k-=m;l-=m}f.visible&&f.arrange(k+h.left,l+h.top,g.width,g.height)}};function Km(){this.Ca="Base"}na(Km,Zl); +Km.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;b=Na();f=Jm(a);for(var k=0;k<h;k++){var l=d[k];if(l.visible||l===f){var m=wl(l,!1);if(m!==yg&&m!==il)b.push(l);else{l.measure(Infinity,c,0,g);m=l.margin;l=l.measuredBounds;var n=Math.max(l.height+m.top+m.bottom,0);e.width+=Math.max(l.width+m.right+m.left,0);e.height=Math.max(e.height,n)}}}d=b.length;a.desiredSize.height?c=Math.min(a.desiredSize.height,a.maxSize.height):0!==e.height&&(c=Math.min(e.height,a.maxSize.height));for(a=0;a<d;a++)if(k= +b[a],k.visible||k===f)m=k.margin,h=m.right+m.left,m=m.top+m.bottom,k.measure(Infinity,c,0,g),k=k.measuredBounds,m=Math.max(k.height+m,0),e.width+=Math.max(k.width+h,0),e.height=Math.max(e.height,m);Pa(b)}; +Km.prototype.arrange=function(a,b,c){for(var d=b.length,e=a.padding,f=e.top,g=a.isOpposite,h=g?c.width:e.left,k=0;k<d;k++){var l=f,m=b[k];if(m.visible){var n=m.measuredBounds,p=m.margin,r=p.top+p.bottom,q=f+e.bottom,u=n.height,x=wl(m,!1);if(isNaN(m.desiredSize.height)&&x===Bd||x===jl)u=Math.max(c.height-r-q,0);r=u+r+q;q=m.alignment;q.Rb()&&(q=a.defaultAlignment);q.mb()||(q=Kc);g&&(h-=n.width+p.left+p.right);m.arrange(h+q.offsetX+p.left,l+q.offsetY+p.top+(c.height*q.y-r*q.y),n.width,u);g||(h+=n.width+ +p.left+p.right)}}};function Lm(){this.Ca="Base"}na(Lm,Zl); +Lm.prototype.measure=function(a,b,c,d,e,f){var g=d.length;c=Na();for(var h=Jm(a),k=0;k<g;k++){var l=d[k];if(l.visible||l===h){var m=wl(l,!1);if(m!==yg&&m!==jl)c.push(l);else{var n=l.margin;m=n.right+n.left;n=n.top+n.bottom;l.measure(b,Infinity,f,0);l=l.measuredBounds;bc(e,Math.max(e.width,Math.max(l.width+m,0)),e.height+Math.max(l.height+n,0))}}}d=c.length;if(0!==d){a.desiredSize.width?b=Math.min(a.desiredSize.width,a.maxSize.width):0!==e.width&&(b=Math.min(e.width,a.maxSize.width));for(a=0;a<d;a++)if(k= +c[a],k.visible||k===h)l=k.margin,g=l.right+l.left,l=l.top+l.bottom,k.measure(b,Infinity,f,0),k=k.measuredBounds,l=Math.max(k.height+l,0),e.width=Math.max(e.width,Math.max(k.width+g,0)),e.height+=l;Pa(c)}}; +Lm.prototype.arrange=function(a,b,c){for(var d=b.length,e=a.padding,f=e.left,g=a.isOpposite,h=g?c.height:e.top,k=0;k<d;k++){var l=f,m=b[k];if(m.visible){var n=m.measuredBounds,p=m.margin,r=p.left+p.right,q=f+e.right,u=n.width,x=wl(m,!1);if(isNaN(m.desiredSize.width)&&x===Bd||x===il)u=Math.max(c.width-r-q,0);r=u+r+q;q=m.alignment;q.Rb()&&(q=a.defaultAlignment);q.mb()||(q=Kc);g&&(h-=n.height+p.bottom+p.top);m.arrange(l+q.offsetX+p.left+(c.width*q.x-r*q.x),h+q.offsetY+p.top,u,n.height);g||(h+=n.height+ +p.bottom+p.top)}}};function Mm(){this.Ca="Base"}na(Mm,Zl); +Mm.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length,k=a.Ab(),l=k.margin,m=l.right+l.left,n=l.top+l.bottom;k.measure(b,c,f,g);var p=k.measuredBounds;f=p.width;g=p.height;var r=Math.max(f+m,0);var q=Math.max(g+n,0);var u=a.isClipping,x=M.allocAt(-l.left,-l.top,r,q),y=M.allocAt(0,0,f,g);Nm(k,y,!0);f=y.width;g=y.height;for(var z=!0,B=Jm(a),C=0;C<h;C++){var D=d[C],J=b,U=c;if(D!==k&&(D.visible||D===B)){l=D.margin;r=l.right+l.left;q=l.top+l.bottom;p=wl(D,!1);switch(p){case Bd:J=f;U=g;break;case il:J= +f;break;case jl:U=g}D.measure(J,U,0,0);p=D.measuredBounds;r=Math.max(p.width+r,0);q=Math.max(p.height+q,0);J=D.alignment;J.Rb()&&(J=a.defaultAlignment);J.mb()||(J=Kc);var aa=D.alignmentFocus;aa.Rb()&&(aa=Kc);U=null;D instanceof V&&""!==D.af&&(U=D.lb(D.af),U===D&&(U=null));var Y=y.x,W=y.y;if(null!==U){D.arrange(0,0,p.width,p.height);l=U.actualBounds;l=K.allocAt(l.x+(aa.x*l.width-aa.offsetX),l.y+(aa.y*l.height-aa.offsetY));for(U=U.panel;U!==D;)U.transform.La(l),U=U.panel;Y+=J.x*f+J.offsetX-l.x;W+=J.y* +g+J.offsetY-l.y;K.free(l)}else Y+=J.x*f+J.offsetX-(aa.x*p.width+aa.offsetX)-l.left,W+=J.y*g+J.offsetY-(aa.y*p.height+aa.offsetY)-l.top;z?(z=!1,e.h(Y,W,r,q)):lc(e,Y,W,r,q)}}z?e.assign(x):u?e.Vu(y.x,y.y,y.width,y.height):lc(e,x.x,x.y,x.width,x.height);M.free(x);M.free(y);p=k.stretch;p===kl&&(p=wl(k,!1));switch(p){case yg:return;case Bd:if(!isFinite(b)&&!isFinite(c))return;break;case il:if(!isFinite(b))return;break;case jl:if(!isFinite(c))return}p=k.measuredBounds;f=p.width;g=p.height;r=Math.max(f+m, +0);q=Math.max(g+n,0);l=k.margin;y=M.allocAt(-l.left,-l.top,r,q);Nm(k,y,!0);f=y.width;g=y.height;for(b=0;b<h;b++)c=d[b],c===k||!c.visible&&c!==B||(l=c.margin,r=l.right+l.left,q=l.top+l.bottom,p=c.measuredBounds,r=Math.max(p.width+r,0),q=Math.max(p.height+q,0),m=c.alignment,m.Rb()&&(m=a.defaultAlignment),m.mb()||(m=Kc),c=c.alignmentFocus,c.Rb()&&(c=Kc),z?(z=!1,e.h(m.x*f+m.offsetX-(c.x*p.width+c.offsetX)-l.left,m.y*g+m.offsetY-(c.y*p.height+c.offsetY)-l.top,r,q)):lc(e,m.x*f+m.offsetX-(c.x*p.width+c.offsetX)- +l.left,m.y*g+m.offsetY-(c.y*p.height+c.offsetY)-l.top,r,q));z?e.assign(x):u?e.Vu(y.x,y.y,y.width,y.height):lc(e,x.x,x.y,x.width,x.height);M.free(y)}; +Mm.prototype.arrange=function(a,b,c){var d=b.length,e=a.Ab(),f=e.measuredBounds,g=f.width,h=f.height,k=a.padding;f=k.left;k=k.top;var l=f-c.x,m=k-c.y;e.arrange(l,m,g,h);g=M.allocAt(0,0,g,h);Nm(e,g,!1);for(h=0;h<d;h++){var n=b[h];if(n!==e){l=n.measuredBounds;var p=l.width,r=l.height;m=n.alignment;m.Rb()&&(m=a.defaultAlignment);m.mb()||(m=Kc);var q=n.alignmentFocus;q.Rb()&&(q=Kc);l=null;n instanceof V&&""!==n.af&&(l=n.lb(n.af),l===n&&(l=null));if(null!==l){var u=l.actualBounds;q=K.allocAt(u.x+(q.x* +u.width-q.offsetX),u.y+(q.y*u.height-q.offsetY));for(l=l.panel;l!==n;)l.transform.La(q),l=l.panel;l=m.x*g.width+m.offsetX-q.x;m=m.y*g.height+m.offsetY-q.y;K.free(q)}else l=m.x*g.width+m.offsetX-(q.x*p+q.offsetX),m=m.y*g.height+m.offsetY-(q.y*r+q.offsetY);l+=g.x-c.x;m+=g.y-c.y;n.visible&&n.arrange(f+l,k+m,p,r)}}M.free(g)}; +function Nm(a,b,c){var d=null;a instanceof V&&""!==a.af&&(d=a.lb(a.af),d===a&&(d=null));if(null!==d)for(c&&a.arrange(0,0,b.width,b.height),b.assign(d.actualBounds),d=d.panel;d!==a;)d.transform.fp(b),d=d.panel}function Om(){this.Ca="Base"}na(Om,Zl); +Om.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length,k=a.Ab(),l=k.margin,m=b,n=c,p=l.right+l.left,r=l.top+l.bottom;k.measure(b,c,f,g);l=k.measuredBounds;var q=0,u=null;k instanceof Qf&&(u=k,q=u.strokeWidth*u.scale);var x=Math.max(l.width+p,0);l=Math.max(l.height+r,0);var y=Pm(k),z=y.x*x+y.offsetX;y=y.y*l+y.offsetY;var B=Qm(k),C=B.x*x+B.offsetX;B=B.y*l+B.offsetY;isFinite(b)&&(m=Math.max(Math.abs(z-C)-q,0));isFinite(c)&&(n=Math.max(Math.abs(y-B)-q,0));q=Hb.alloc();q.h(0,0);a=Jm(a);for(B=0;B< +h;B++)y=d[B],y===k||!y.visible&&y!==a||(l=y.margin,x=l.right+l.left,z=l.top+l.bottom,y.measure(m,n,0,0),l=y.measuredBounds,x=Math.max(l.width+x,0),l=Math.max(l.height+z,0),q.h(Math.max(x,q.width),Math.max(l,q.height)));if(1===h)e.width=x,e.height=l,Hb.free(q);else{y=Pm(k);B=Qm(k);h=d=0;B.x!==y.x&&B.y!==y.y&&(d=q.width/Math.abs(B.x-y.x),h=q.height/Math.abs(B.y-y.y));Hb.free(q);q=0;null!==u&&(q=u.strokeWidth*u.scale,zg(u)===Ag&&(d=h=Math.max(d,h)));d+=Math.abs(y.offsetX)+Math.abs(B.offsetX)+q;h+=Math.abs(y.offsetY)+ +Math.abs(B.offsetY)+q;u=k.stretch;u===kl&&(u=wl(k,!1));switch(u){case yg:g=f=0;break;case Bd:isFinite(b)&&(d=b);isFinite(c)&&(h=c);break;case il:isFinite(b)&&(d=b);g=0;break;case jl:f=0,isFinite(c)&&(h=c)}k.Zj();k.measure(d,h,f,g);e.width=k.measuredBounds.width+p;e.height=k.measuredBounds.height+r}}; +Om.prototype.arrange=function(a,b){var c=b.length,d=a.Ab(),e=d.measuredBounds,f=M.alloc();f.h(0,0,1,1);var g=d.margin,h=g.left;g=g.top;var k=a.padding,l=k.left;k=k.top;d.arrange(l+h,k+g,e.width,e.height);var m=Pm(d),n=Qm(d),p=m.y*e.height+m.offsetY,r=n.x*e.width+n.offsetX;n=n.y*e.height+n.offsetY;f.x=m.x*e.width+m.offsetX;f.y=p;lc(f,r,n,0,0);f.x+=h+l;f.y+=g+k;for(e=0;e<c;e++)h=b[e],h!==d&&(l=h.measuredBounds,g=h.margin,k=Math.max(l.width+g.right+g.left,0),m=Math.max(l.height+g.top+g.bottom,0),p=h.alignment, +p.Rb()&&(p=a.defaultAlignment),p.mb()||(p=Kc),k=f.width*p.x+p.offsetX-k*p.x+g.left+f.x,g=f.height*p.y+p.offsetY-m*p.y+g.top+f.y,h.visible&&(mc(f.x,f.y,f.width,f.height,k,g,l.width,l.height)?h.arrange(k,g,l.width,l.height):h.arrange(k,g,l.width,l.height,new M(f.x,f.y,f.width,f.height))));M.free(f)};function Rm(){this.Ca="Base";this.name="Table"}na(Rm,Zl); +Rm.prototype.measure=function(a,b,c,d,e){for(var f=d.length,g=Na(),h=Na(),k=0;k<f;k++){var l=d[k],m=l instanceof V?l:null;if(null===m||m.type!==V.TableRow&&m.type!==V.TableColumn||!l.visible)g.push(l);else{G&&(m.desiredSize.u()&&v(m.toString()+" TableRow/TableColumn Panels cannot set a desiredSize: "+m.desiredSize.toString()),m.minSize.D(Pb)||v(m.toString()+" TableRow/TableColumn Panels cannot set a minSize: "+m.minSize.toString()),m.maxSize.D(Ub)||v(m.toString()+" TableRow/TableColumn Panels cannot set a maxSize: "+ +m.maxSize.toString()));h.push(m);for(var n=m.U.s,p=n.length,r=0;r<p;r++){var q=n[r];m.type===V.TableRow?q.row=l.row:m.type===V.TableColumn&&(q.column=l.column);g.push(q)}}}f=g.length;0===f&&(a.getRowDefinition(0),a.getColumnDefinition(0));for(var u=[],x=0;x<f;x++){var y=g[x];y.visible&&(wj(y,!0),xl(y,!0),u[y.row]||(u[y.row]=[]),u[y.row][y.column]||(u[y.row][y.column]=[]),u[y.row][y.column].push(y))}Pa(g);var z=Na(),B=Na(),C=Na(),D={count:0},J={count:0},U=b,aa=c,Y=a.rowDefs,W=a.colDefs,Q=null;f=Y.length; +for(var la=0;la<f;la++)Q=Y[la],void 0!==Q&&(Q.actual=0);f=W.length;for(var fa=0;fa<f;fa++)Q=W[fa],void 0!==Q&&(Q.actual=0);for(var za=u.length,Ma=0,sb=0;sb<za;sb++)u[sb]&&(Ma=Math.max(Ma,u[sb].length));var wb=Math.min(a.topIndex,za-1),Wb=Math.min(a.leftIndex,Ma-1),tb=0;za=u.length;for(var Ye=Jm(a),jb=0;jb<za;jb++)if(u[jb]){Ma=u[jb].length;var Ed=a.getRowDefinition(jb);Ed.actual=0;for(var Xb=Ed.pc=0;Xb<Ma;Xb++)if(u[jb][Xb]){var Ze=a.getColumnDefinition(Xb);void 0===z[Xb]&&(Ze.actual=0,Ze.pc=0,z[Xb]= +!0);for(var Ic=u[jb][Xb],bd=Ic.length,Ac=0;Ac<bd;Ac++){var tc=Ic[Ac];if(tc.visible||tc===Ye){var zf=1<tc.rowSpan||1<tc.columnSpan;zf&&(jb<wb||Xb<Wb||B.push(tc));var Fd=tc.margin,Sh=Fd.right+Fd.left,Bc=Fd.top+Fd.bottom;var Yb=Pl(tc,Ed,Ze,!1);var Zi=tc.desiredSize,Mg=!isNaN(Zi.height),Rd=!isNaN(Zi.width)&&Mg;zf||Yb===yg||Rd||jb<wb||Xb<Wb||(void 0!==D[Xb]||Yb!==Bd&&Yb!==il||(D[Xb]=-1,D.count++),void 0!==J[jb]||Yb!==Bd&&Yb!==jl||(J[jb]=-1,J.count++),C.push(tc));tc.measure(Infinity,Infinity,0,0);if(!(jb< +wb||Xb<Wb)){var uc=tc.measuredBounds,dg=Math.max(uc.width+Sh,0),Cc=Math.max(uc.height+Bc,0);if(1===tc.rowSpan&&(Yb===yg||Yb===il)){Q=a.getRowDefinition(jb);var Af=Q.Wc();tb=Math.max(Cc-Q.actual,0);tb+Af>aa&&(tb=Math.max(aa-Af,0));var Hk=0===Q.sa;Q.pc=Q.pc+tb;Q.actual=Q.sa+tb;aa=Math.max(aa-(tb+(Hk?Af:0)),0)}if(1===tc.columnSpan&&(Yb===yg||Yb===jl)){Q=a.getColumnDefinition(Xb);var $i=Q.Wc();tb=Math.max(dg-Q.actual,0);tb+$i>U&&(tb=Math.max(U-$i,0));var fo=0===Q.sa;Q.pc=Q.pc+tb;Q.actual=Q.sa+tb;U=Math.max(U- +(tb+(fo?$i:0)),0)}zf&&tc.Zj()}}}}}Pa(z);var ce=0,De=0;f=a.columnCount;for(var Ng=0;Ng<f;Ng++){var Bf=W[Ng];void 0!==Bf&&(ce+=isNaN(Bf.Hc)?Bf.pc:Bf.Hc,0!==Bf.pc&&(ce+=Bf.Wc()))}f=a.rowCount;for(var Th=0;Th<f;Th++){var Cf=Y[Th];void 0!==Cf&&(De+=isNaN(Cf.Hc)?Cf.pc:Cf.Hc,0!==Cf.pc&&(De+=Cf.Wc()))}U=Math.max(b-ce,0);var de=aa=Math.max(c-De,0),$e=U;f=C.length;for(var vc=0;vc<f;vc++){var Sd=C[vc],Ik=a.getRowDefinition(Sd.row),Ee=a.getColumnDefinition(Sd.column),Uh=Sd.measuredBounds,Gd=Sd.margin,eg=Gd.right+ +Gd.left,Td=Gd.top+Gd.bottom;D[Sd.column]=0===Ee.pc&&void 0!==D[Sd.column]?Math.max(Uh.width+eg,D[Sd.column]):null;J[Sd.row]=0===Ik.pc&&void 0!==J[Sd.row]?Math.max(Uh.height+Td,J[Sd.row]):null}var Og=0,Vh=0,nd;for(nd in J)"count"!==nd&&(Og+=J[nd]);for(nd in D)"count"!==nd&&(Vh+=D[nd]);for(var xb=Hb.alloc(),aj=0;aj<f;aj++){var jc=C[aj];if(jc.visible||jc===Ye){var kb=a.getRowDefinition(jc.row),kc=a.getColumnDefinition(jc.column),Fe=0;isFinite(kc.width)?Fe=kc.width:(isFinite(U)&&null!==D[jc.column]?0=== +Vh?Fe=kc.actual+U:Fe=D[jc.column]/Vh*$e:null!==D[jc.column]?Fe=U:Fe=kc.actual||U,Fe=Math.max(0,Fe-kc.Wc()));var af=0;isFinite(kb.height)?af=kb.height:(isFinite(aa)&&null!==J[jc.row]?0===Og?af=kb.actual+aa:af=J[jc.row]/Og*de:null!==J[jc.row]?af=aa:af=kb.actual||aa,af=Math.max(0,af-kb.Wc()));xb.h(Math.max(kc.minimum,Math.min(Fe,kc.maximum)),Math.max(kb.minimum,Math.min(af,kb.maximum)));Yb=Pl(jc,kb,kc,!1);switch(Yb){case il:xb.height=Math.max(xb.height,kb.actual+aa);break;case jl:xb.width=Math.max(xb.width, +kc.actual+U)}var fg=jc.margin,go=fg.right+fg.left,Jk=fg.top+fg.bottom;jc.Zj();jc.measure(xb.width,xb.height,kc.minimum,kb.minimum);var Wh=jc.measuredBounds,gg=Math.max(Wh.width+go,0),Pg=Math.max(Wh.height+Jk,0);isFinite(U)&&(gg=Math.min(gg,xb.width));isFinite(aa)&&(Pg=Math.min(Pg,xb.height));var wc=0;wc=kb.actual;kb.actual=Math.max(kb.actual,Pg);kb.pc=Math.max(kb.pc,Pg);tb=kb.actual-wc;aa=Math.max(aa-tb,0);null===J[jc.row]&&(de=Math.max(de-tb,0));wc=kc.actual;kc.actual=Math.max(kc.actual,gg);kc.pc= +Math.max(kc.pc,gg);tb=kc.actual-wc;U=Math.max(U-tb,0);null===D[jc.column]&&($e=Math.max($e-tb,0))}}Pa(C);var Ud=Hb.alloc(),Hd=Na(),Pc=Na();f=B.length;if(0!==f)for(var Df=0;Df<za;Df++)if(u[Df]){Ma=u[Df].length;var Xh=a.getRowDefinition(Df);Hd[Df]=Xh.actual;for(var Ef=0;Ef<Ma;Ef++)if(u[Df][Ef]){var Kk=a.getColumnDefinition(Ef);Pc[Ef]=Kk.actual}}for(var Yh=0;Yh<f;Yh++){var cb=B[Yh];if(cb.visible||cb===Ye){var od=a.getRowDefinition(cb.row),cd=a.getColumnDefinition(cb.column);xb.h(Math.max(cd.minimum, +Math.min(b,cd.maximum)),Math.max(od.minimum,Math.min(c,od.maximum)));Yb=Pl(cb,od,cd,!1);switch(Yb){case Bd:0!==Pc[cd.index]&&(xb.width=Math.min(xb.width,Pc[cd.index]));0!==Hd[od.index]&&(xb.height=Math.min(xb.height,Hd[od.index]));break;case il:0!==Pc[cd.index]&&(xb.width=Math.min(xb.width,Pc[cd.index]));break;case jl:0!==Hd[od.index]&&(xb.height=Math.min(xb.height,Hd[od.index]))}isFinite(cd.width)&&(xb.width=cd.width);isFinite(od.height)&&(xb.height=od.height);Ud.h(0,0);for(var Lk=cd.minimum,Dc= +od.minimum,bf=1;bf<cb.rowSpan&&!(cb.row+bf>=a.rowCount);bf++)Q=a.getRowDefinition(cb.row+bf),tb=0,tb=Yb===Bd||Yb===jl?Math.max(Q.minimum,0===Hd[cb.row+bf]?Q.maximum:Math.min(Hd[cb.row+bf],Q.maximum)):Math.max(Q.minimum,isNaN(Q.Hc)?Q.maximum:Math.min(Q.Hc,Q.maximum)),Ud.height+=tb,Dc+=Q.minimum;for(var dd=1;dd<cb.columnSpan&&!(cb.column+dd>=a.columnCount);dd++)Q=a.getColumnDefinition(cb.column+dd),tb=0,tb=Yb===Bd||Yb===il?Math.max(Q.minimum,0===Pc[cb.column+dd]?Q.maximum:Math.min(Pc[cb.column+dd], +Q.maximum)):Math.max(Q.minimum,isNaN(Q.Hc)?Q.maximum:Math.min(Q.Hc,Q.maximum)),Ud.width+=tb,Lk+=Q.minimum;xb.width+=Ud.width;xb.height+=Ud.height;var Zh=cb.margin,Ff=Zh.right+Zh.left,bj=Zh.top+Zh.bottom;cb.measure(xb.width,xb.height,Lk,Dc);for(var $h=cb.measuredBounds,Vd=Math.max($h.width+Ff,0),hg=Math.max($h.height+bj,0),Gf=0,ai=0;ai<cb.rowSpan&&!(cb.row+ai>=a.rowCount);ai++)Q=a.getRowDefinition(cb.row+ai),Gf+=Q.total||0;if(Gf<hg){var cf=hg-Gf,ee=hg-Gf;if(null!==cb.spanAllocation)for(var df=cb.spanAllocation, +Ge=0;Ge<cb.rowSpan&&!(0>=cf)&&!(cb.row+Ge>=a.rowCount);Ge++){Q=a.getRowDefinition(cb.row+Ge);var ef=Q.sa||0,ff=df(cb,Q,ee);G&&"number"!==typeof ff&&v(cb+" spanAllocation does not return a number: "+ff);Q.actual=Math.min(Q.maximum,ef+ff);Q.sa!==ef&&(cf-=Q.sa-ef)}for(;0<cf;){var Id=Q.sa||0;isNaN(Q.height)&&Q.maximum>Id&&(Q.actual=Math.min(Q.maximum,Id+cf),Q.sa!==Id&&(cf-=Q.sa-Id));if(0===Q.index)break;Q=a.getRowDefinition(Q.index-1)}}for(var Qg=0,gf=0;gf<cb.columnSpan&&!(cb.column+gf>=a.columnCount);gf++)Q= +a.getColumnDefinition(cb.column+gf),Qg+=Q.total||0;if(Qg<Vd){var Rg=Vd-Qg,ho=Vd-Qg;if(null!==cb.spanAllocation)for(var He=cb.spanAllocation,ig=0;ig<cb.columnSpan&&!(0>=Rg)&&!(cb.column+ig>=a.columnCount);ig++){Q=a.getColumnDefinition(cb.column+ig);var cj=Q.sa||0,dj=He(cb,Q,ho);G&&"number"!==typeof dj&&v(cb+" spanAllocation does not return a number: "+dj);Q.actual=Math.min(Q.maximum,cj+dj);Q.sa!==cj&&(Rg-=Q.sa-cj)}for(;0<Rg;){var Mk=Q.sa||0;isNaN(Q.width)&&Q.maximum>Mk&&(Q.actual=Math.min(Q.maximum, +Mk+Rg),Q.sa!==Mk&&(Rg-=Q.sa-Mk));if(0===Q.index)break;Q=a.getColumnDefinition(Q.index-1)}}}}Pa(B);Hb.free(Ud);Hb.free(xb);void 0!==Hd&&Pa(Hd);void 0!==Pc&&Pa(Pc);var Sg=0,Tg=0,Nk=a.desiredSize,Kr=a.maxSize;Yb=wl(a,!0);var ej=De=ce=0,fj=0;f=a.columnCount;for(var Ok=0;Ok<f;Ok++)void 0!==W[Ok]&&(Q=a.getColumnDefinition(Ok),isFinite(Q.width)?(ej+=Q.width,ej+=Q.Wc()):Sm(Q)===Tm?(ej+=Q.sa,ej+=Q.Wc()):0!==Q.sa&&(ce+=Q.sa,ce+=Q.Wc()));isFinite(Nk.width)?Sg=Math.min(Nk.width,Kr.width):Sg=Yb!==yg&&isFinite(b)? +b:ce;Sg=Math.max(Sg,a.minSize.width);Sg=Math.max(Sg-ej,0);for(var Cu=0===ce?1:Math.max(Sg/ce,1),Qk=0;Qk<f;Qk++)void 0!==W[Qk]&&(Q=a.getColumnDefinition(Qk),isFinite(Q.width)||Sm(Q)===Tm||(Q.actual=Q.sa*Cu),Q.position=e.width,0!==Q.sa&&(e.width+=Q.sa,e.width+=Q.Wc()));f=a.rowCount;for(var Rk=0;Rk<f;Rk++)void 0!==Y[Rk]&&(Q=a.getRowDefinition(Rk),isFinite(Q.height)?(fj+=Q.height,fj+=Q.Wc()):Sm(Q)===Tm?(fj+=Q.sa,fj+=Q.Wc()):0!==Q.sa&&(De+=Q.sa,De+=Q.Wc()));isFinite(Nk.height)?Tg=Math.min(Nk.height,Kr.height): +Tg=Yb!==yg&&isFinite(c)?c:De;Tg=Math.max(Tg,a.minSize.height);Tg=Math.max(Tg-fj,0);for(var Du=0===De?1:Math.max(Tg/De,1),Sk=0;Sk<f;Sk++)void 0!==Y[Sk]&&(Q=a.getRowDefinition(Sk),isFinite(Q.height)||Sm(Q)===Tm||(Q.actual=Q.sa*Du),Q.position=e.height,0!==Q.sa&&(e.height+=Q.sa,e.height+=Q.Wc()));f=h.length;for(var io=0;io<f;io++){var gj=h[io],jo=0,ko=0;gj.type===V.TableRow?(jo=e.width,Q=a.getRowDefinition(gj.row),ko=Q.actual):(Q=a.getColumnDefinition(gj.column),jo=Q.actual,ko=e.height);gj.measuredBounds.h(0, +0,jo,ko);wj(gj,!1)}Pa(h);a.inRowsCols=u}; +Rm.prototype.arrange=function(a,b,c){var d=b.length,e=a.padding,f=e.left;e=e.top;var g=a.inRowsCols;if(null!==g){for(var h,k,l=g.length,m=0,n=0;n<l;n++)g[n]&&(m=Math.max(m,g[n].length));k=a.rowDefs;h=a.colDefs;var p=n=0,r=Math.min(a.topIndex,l-1);if(0<k.length){for(;r!==l&&(void 0===k[r]||0===k[r].sa);)r++;r=Math.max(Math.min(r,l-1),0);n=-k[r].position}var q=Math.min(a.leftIndex,m-1);if(0<h.length){for(;q!==m&&(void 0===h[q]||0===h[q].sa);)q++;q=Math.max(Math.min(q,m-1),0);p=-h[q].position}for(var u= +0,x=0;u!==l&&void 0===k[u];)u++;for(;x!==l&&void 0===h[x];)x++;m=a.part;a.getRowDefinition(u);a.getColumnDefinition(x);for(var y=0;y<b.length;y++){var z=b[y];if(z instanceof V&&z.visible&&(z.type===V.TableRow||z.type===V.TableColumn)){if(z.type===V.TableRow){h=a.getRowDefinition(z.row);var B=a.getColumnDefinition(x)}else h=a.getRowDefinition(u),B=a.getColumnDefinition(z.column);k=h.position+n+e;0!==h.sa&&(k+=h.yo(Math.max(u,r)));h=B.position+p+f;0!==B.sa&&(h+=B.yo(Math.max(x,q)));B=z.measuredBounds; +z.Wk();z.actualBounds.pa();var C=z.actualBounds,D=M.allocAt(C.x,C.y,C.width,C.height);C.x=z.type===V.TableRow?f:h;C.y=z.type===V.TableColumn?e:k;C.width=B.width;C.height=B.height;z.actualBounds.freeze();xl(z,!1);ec(D,C)||null===m||(m.oh(),z.In(m));M.free(D)}}y=Hb.alloc();for(z=0;z<l;z++)if(g[z])for(m=g[z].length,B=a.getRowDefinition(z),k=B.position+n+e,0!==B.sa&&(k+=B.yo(Math.max(u,r))),C=0;C<m;C++)if(g[z][C]){D=a.getColumnDefinition(C);h=D.position+p+f;0!==D.sa&&(h+=D.yo(Math.max(x,q)));for(var J= +g[z][C],U=J.length,aa=0;aa<U;aa++){var Y=J[aa],W=Y.measuredBounds;y.h(0,0);for(var Q=1;Q<Y.rowSpan&&!(z+Q>=a.rowCount);Q++){var la=a.getRowDefinition(z+Q);0!==la.sa&&(y.height+=la.total)}for(Q=1;Q<Y.columnSpan&&!(C+Q>=a.columnCount);Q++)la=a.getColumnDefinition(C+Q),0!==la.sa&&(y.width+=la.total);var fa=D.sa+y.width,za=B.sa+y.height;Q=h;la=k;var Ma=fa,sb=za,wb=h,Wb=k,tb=fa,Ye=za;h+fa>c.width&&(tb=Math.max(c.width-h,0));k+za>c.height&&(Ye=Math.max(c.height-k,0));var jb=Y.alignment;if(jb.Rb()){jb=a.defaultAlignment; +jb.mb()||(jb=Kc);var Ed=jb.x;var Xb=jb.y;var Ze=jb.offsetX;jb=jb.offsetY;var Ic=D.alignment,bd=B.alignment;Ic.mb()&&(Ed=Ic.x,Ze=Ic.offsetX);bd.mb()&&(Xb=bd.y,jb=bd.offsetY)}else Ed=jb.x,Xb=jb.y,Ze=jb.offsetX,jb=jb.offsetY;if(isNaN(Ed)||isNaN(Xb))Xb=Ed=.5,jb=Ze=0;Ic=W.width;bd=W.height;var Ac=Y.margin,tc=Ac.left+Ac.right,zf=Ac.top+Ac.bottom,Fd=Pl(Y,B,D,!1);!isNaN(Y.desiredSize.width)||Fd!==Bd&&Fd!==il||(Ic=Math.max(fa-tc,0));!isNaN(Y.desiredSize.height)||Fd!==Bd&&Fd!==jl||(bd=Math.max(za-zf,0));fa= +Y.maxSize;za=Y.minSize;Ic=Math.min(fa.width,Ic);bd=Math.min(fa.height,bd);Ic=Math.max(za.width,Ic);bd=Math.max(za.height,bd);fa=bd+zf;Q+=Ma*Ed-(Ic+tc)*Ed+Ze+Ac.left;la+=sb*Xb-fa*Xb+jb+Ac.top;Y.visible&&(mc(wb,Wb,tb,Ye,Q,la,W.width,W.height)?Y.arrange(Q,la,Ic,bd):Y.arrange(Q,la,Ic,bd,new M(wb,Wb,tb,Ye)))}}Hb.free(y);for(a=0;a<d;a++)c=b[a],f=c instanceof V?c:null,null===f||f.type!==V.TableRow&&f.type!==V.TableColumn||(f=c.actualBounds,c.naturalBounds.pa(),c.naturalBounds.h(0,0,f.width,f.height),c.naturalBounds.freeze())}}; +function Um(){this.Ca="Base"}na(Um,Zl);Um.prototype.measure=function(){};Um.prototype.arrange=function(){};function Vm(){this.Ca="Base"}na(Vm,Zl);Vm.prototype.measure=function(){};Vm.prototype.arrange=function(){};function Wm(){this.Ca="Base"}na(Wm,Zl); +Wm.prototype.measure=function(a,b,c,d,e,f,g){1<d.length&&v("Viewbox Panel cannot contain more than one GraphObject.");d=d[0];d.Ea=1;d.Zj();d.measure(Infinity,Infinity,f,g);var h=d.measuredBounds,k=d.margin,l=k.right+k.left;k=k.top+k.bottom;if(isFinite(b)||isFinite(c)){var m=d.scale,n=h.width;h=h.height;var p=Math.max(b-l,0),r=Math.max(c-k,0),q=1;a.viewboxStretch===Ag?0!==n&&0!==h&&(q=Math.min(p/n,r/h)):0!==n&&0!==h&&(q=Math.max(p/n,r/h));0===q&&(q=1E-4);d.Ea*=q;m!==d.scale&&(wj(d,!0),d.measure(Infinity, +Infinity,f,g))}h=d.measuredBounds;e.width=isFinite(b)?b:Math.max(h.width+l,0);e.height=isFinite(c)?c:Math.max(h.height+k,0)};Wm.prototype.arrange=function(a,b,c){b=b[0];var d=b.measuredBounds,e=b.margin,f=Math.max(d.width+(e.right+e.left),0);e=Math.max(d.height+(e.top+e.bottom),0);var g=b.alignment;g.Rb()&&(g=a.defaultAlignment);g.mb()||(g=Kc);b.arrange(c.width*g.x-f*g.x+g.offsetX,c.height*g.y-e*g.y+g.offsetY,d.width,d.height)};function Xm(){this.Ca="Base"}na(Xm,Zl);Xm.prototype.measure=function(){}; +Xm.prototype.arrange=function(){}; +Xm.prototype.zc=function(a,b,c){c=a.Gf()*c.scale;0>=c&&(c=1);var d=a.gridCellSize,e=d.width;d=d.height;var f=a.naturalBounds,g=a.actualBounds,h=f.width,k=f.height,l=Math.ceil(h/e),m=Math.ceil(k/d),n=a.gridOrigin,p=n.x;n=n.y;b.save();b.beginPath();b.rect(0,0,h,k);b.clip();for(var r=[],q=a.U.s,u=q.length,x=0;x<u;x++){var y=q[x],z=[];r.push(z);if(y.visible){var B=y.interval;if(!(0>B)){y=gk(y.figure);for(var C=0;C<u;C++)if(C!==x){var D=q[C];D.visible&&gk(D.figure)===y&&(D=D.interval,D>B&&z.push(D))}}}}q= +a.U.s;u=q.length;for(x=0;x<u;x++){var J=q[x];if(J.visible&&(z=J.interval||1,y=Math.abs(z),!(2>e*y*c))){B=J.segmentIndex;if(!isFinite(B)||isNaN(B))B=0;0>B&&(B=y-Math.min(-B,y));B=Math.round(B%y);y=J.opacity;C=1;if(1!==y){if(0===y)continue;C=b.globalAlpha;b.globalAlpha=C*y}D=r[x];var U=!1,aa=J.strokeDashArray;null!==aa&&(U=!0,b.Tr(aa,J.strokeDashOffset));if("LineV"===J.figure&&null!==J.stroke&&0<J.strokeWidth){b.lineWidth=J.strokeWidth;ti(a,b,J.stroke,!1,!1,f,g);b.beginPath();for(aa=J=Math.floor((p- +e)/e);aa<=J+l;aa++){var Y=aa*e+p;0<=Y&&Y<=h&&Ym(aa,z,B,D)&&(b.moveTo(Y,0),b.lineTo(Y,k))}b.stroke()}else if("LineH"===J.figure&&null!==J.stroke&&0<J.strokeWidth){b.lineWidth=J.strokeWidth;ti(a,b,J.stroke,!1,!1,f,g);b.beginPath();for(aa=J=Math.floor((n-d)/d);aa<=J+m;aa++)Y=aa*d+n,0<=Y&&Y<=k&&Ym(aa,z,B,D)&&(b.moveTo(0,Y),b.lineTo(h,Y));b.stroke()}else if("BarV"===J.figure&&null!==J.fill)for(ti(a,b,J.fill,!0,!1,f,g),J=J.width,isNaN(J)&&(J=e),Y=aa=Math.floor((p-e)/e);Y<=aa+l;Y++){var W=Y*e+p;0<=W+J&& +W<=h&&Ym(Y,z,B,D)&&b.fillRect(W,0,J,k)}else if("BarH"===J.figure&&null!==J.fill)for(ti(a,b,J.fill,!0,!1,f,g),J=J.height,isNaN(J)&&(J=d),Y=aa=Math.floor((n-d)/d);Y<=aa+m;Y++)W=Y*d+n,0<=W+J&&W<=k&&Ym(Y,z,B,D)&&b.fillRect(0,W,h,J);U&&b.Rr();1!==y&&(b.globalAlpha=C)}}b.restore();b.Uc(!1)};function Ym(a,b,c,d){if(0>b)return a%b===c;if(a%b!==c)return!1;b=d.length;for(var e=0;e<b;e++)if(a%d[e]===c)return!1;return!0}function Zm(){this.Ca="Base"}na(Zm,Zl); +Zm.prototype.measure=function(a,b,c,d,e){var f=d.length;if(a instanceof Ce||a instanceof R){var g=null,h=null;a instanceof R&&(g=a);a instanceof Ce&&(h=a,g=h.adornedPart,null===a.j&&(a.j=[]));if(g instanceof R){var k=g;if(0===f)bc(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var l=a instanceof Ce?null:g.path;b=g.routeBounds;c=a.ng;c.h(0,0,b.width,b.height);var m=k.points,n=g.pointsCount;null!==h?h.ck(!1):null!==g&&g.ck(!1);h=b.width;var p=b.height,r=a.j;r.length=0;if(null!==l){$m(a,h,p,l); +var q=l.measuredBounds;c.cd(q);r.push(q)}q=Jb.alloc();for(var u=K.alloc(),x=K.alloc(),y=0;y<f;y++){var z=d[y];if(z!==l)if(z.isPanelMain&&z instanceof Qf){$m(a,h,p,z);var B=z.measuredBounds;c.cd(B);r.push(B)}else if(2>n)z.measure(Infinity,Infinity,0,0),B=z.measuredBounds,c.cd(B),r.push(B);else{var C=z.segmentIndex,D=z.segmentFraction,J=z.alignmentFocus;J.kc()&&(J=Kc);var U=z.segmentOrientation,aa=z.segmentOffset;if(isNaN(C)){var Y=k.ya;B=Na();Y.Ru(D,B);var W=K.allocAt(B[0],B[1]);W.add(k.i(0));Y.type=== +N.j?W.offset(-Y.startX,-Y.startY):(Y=Y.figures.first(),null!==Y&&W.offset(-Y.startX,-Y.startY));Y=B[2];if(U!==mg){var Q=k.computeAngle(z,U,Y);z.Lb=Q}Q=W.x-b.x;var la=W.y-b.y;K.free(W);Pa(B)}else if(C<-n||C>=n)B=K.alloc(),k.yg(),k.computeMidPoint(B),Y=k.midAngle,U!==mg&&(Q=k.computeAngle(z,U,Y),z.Lb=Q),Q=B.x-b.x,la=B.y-b.y,K.free(B);else{Q=0;0<=C?(la=m.N(C),B=C<n-1?m.N(C+1):la):(Q=n+C,la=m.N(Q),B=0<Q?m.N(Q-1):la);if(la.fb(B)){0<=C?(Y=0<C?m.N(C-1):la,Q=C<n-2?m.N(C+2):B):(Y=Q<n-1?m.N(Q+1):la,Q=1<Q?m.N(Q- +2):B);W=Y.Df(la);var fa=B.Df(Q);Y=W>fa+10?0<=C?Y.cb(la):la.cb(Y):fa>W+10?0<=C?B.cb(Q):Q.cb(B):0<=C?Y.cb(Q):Q.cb(Y)}else Y=0<=C?la.cb(B):B.cb(la);U!==mg&&(Q=k.computeAngle(z,U,Y),z.Lb=Q);Q=la.x+(B.x-la.x)*D-b.x;la=la.y+(B.y-la.y)*D-b.y}z.measure(Infinity,Infinity,0,0);B=z.measuredBounds;W=z.naturalBounds;var za=0;z instanceof Qf&&(za=z.strokeWidth);fa=W.width+za;var Ma=W.height+za;q.reset();q.translate(-B.x,-B.y);q.scale(z.scale,z.scale);q.rotate(U===mg?z.angle:Y,fa/2,Ma/2);U!==an&&U!==bn||q.rotate(90, +fa/2,Ma/2);U!==cn&&U!==dn||q.rotate(-90,fa/2,Ma/2);U===en&&(45<Y&&135>Y||225<Y&&315>Y)&&q.rotate(-Y,fa/2,Ma/2);W=new M(0,0,fa,Ma);u.Ci(W,J);q.La(u);J=-u.x+za/2*z.scale;z=-u.y+za/2*z.scale;x.assign(aa);za=isNaN(aa.x);var sb=isNaN(aa.y);if(za||sb){fa=fa/2+3;Ma=Ma/2+3;var wb=45<=Y&&135>=Y,Wb=225<=Y&&315>=Y;U===mg&&(wb||Wb)?(x.x=sb?fa:aa.y,x.y=za?Ma:aa.x,wb?0<=C||isNaN(C)&&.5>D||!za||(x.y=-Ma):Wb&&((0<=C||isNaN(C)&&.5>D)&&za&&(x.y=-Ma),sb&&(x.x=-fa))):(za&&(x.x=0<=C||isNaN(C)&&.5>D?fa:-fa),sb&&(x.y=-Ma), +x.rotate(Y))}else x.rotate(Y);Q+=x.x;la+=x.y;W.set(B);W.h(Q+J,la+z,B.width,B.height);r.push(W);c.cd(W)}}if(null!==g)for(d=g.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.ng=c;a.position.h(b.x+c.x,b.y+c.y);a.location.h(NaN,NaN);bc(e,c.width||0,c.height||0);Jb.free(q);K.free(u);K.free(x)}}}}; +Zm.prototype.arrange=function(a,b){var c=b.length;if(a instanceof Ce||a instanceof R){var d=a,e=null;a instanceof Ce&&(e=a,d=e.adornedPart);var f=a instanceof Ce?null:d.path,g=a.j;if(0!==g.length){var h=0;if(null!==f&&h<g.length){var k=g[h];h++;f.arrange(k.x-a.ng.x,k.y-a.ng.y,k.width,k.height)}for(k=0;k<c;k++){var l=b[k];if(l!==f&&h<g.length){var m=g[h];h++;l.arrange(m.x-a.ng.x,m.y-a.ng.y,m.width,m.height)}}}b=d.points;c=b.count;if(2<=c&&a instanceof R)for(f=a.labelNodes;f.next();){var n=a;g=f.value; +h=g.segmentIndex;k=g.segmentFraction;var p=g.alignmentFocus;l=g.segmentOrientation;m=g.segmentOffset;if(isNaN(h)){var r=n.ya;var q=Na();r.Ru(k,q);var u=K.allocAt(q[0],q[1]);u.add(n.i(0));r.type===N.j?u.offset(-r.startX,-r.startY):(r=r.figures.first(),u.offset(-r.startX,-r.startY));r=q[2];l!==mg&&(n=n.computeAngle(g,l,r),g.angle=n);n=u.x;var x=u.y;K.free(u);Pa(q)}else if(h<-c||h>=c)q=K.alloc(),r=n,x=q,r.yg(),r.computeMidPoint(x),r=n.midAngle,l!==mg&&(n=n.computeAngle(g,l,r),g.angle=n),n=q.x,x=q.y, +K.free(q);else{u=0;0<=h?(q=b.s[h],x=h<c-1?b.s[h+1]:q):(u=c+h,q=b.s[u],x=0<u?b.s[u-1]:q);if(q.fb(x)){0<=h?(r=0<h?b.s[h-1]:q,u=h<c-2?b.s[h+2]:x):(r=u<c-1?b.s[u+1]:q,u=1<u?b.s[u-2]:x);var y=r.Df(q),z=x.Df(u);r=y>z+10?0<=h?r.cb(q):q.cb(r):z>y+10?0<=h?x.cb(u):u.cb(x):0<=h?r.cb(u):u.cb(r)}else r=0<=h?q.cb(x):x.cb(q);l!==mg&&(n=n.computeAngle(g,l,r),g.angle=n);n=q.x+(x.x-q.x)*k;x=q.y+(x.y-q.y)*k}if(p.No())g.location=new K(n,x);else{p.kc()&&(p=Kc);q=Jb.alloc();q.reset();q.scale(g.scale,g.scale);q.rotate(g.angle, +0,0);var B=g.naturalBounds;u=M.allocAt(0,0,B.width,B.height);y=K.alloc();y.Ci(u,p);q.La(y);p=-y.x;z=-y.y;var C=B.width,D=B.height;B=K.alloc();B.assign(m);var J=isNaN(m.x),U=isNaN(m.y);if(J||U){C=C/2+3;D=D/2+3;var aa=45<=r&&135>=r,Y=225<=r&&315>=r;l===mg&&(aa||Y)?(B.x=U?C:m.y,B.y=J?D:m.x,aa?0<=h||isNaN(h)&&.5>k||!J||(B.y=-D):Y&&((0<=h||isNaN(h)&&.5>k)&&J&&(B.y=-D),U&&(B.x=-C))):(J&&(B.x=0<=h||isNaN(h)&&.5>k?C:-C),U&&(B.y=-D),B.rotate(r))}else B.rotate(r);n+=B.x;x+=B.y;q.fp(u);p+=u.x;z+=u.y;h=K.allocAt(n+ +p,x+z);g.move(h);K.free(h);K.free(B);K.free(y);M.free(u);Jb.free(q)}}null!==e?e.ck(!1):d.ck(!1)}}; +function $m(a,b,c,d){if(!1!==Bj(d)){var e=d.strokeWidth;0===e&&a instanceof Ce&&a.type===V.Link&&a.adornedObject instanceof Qf&&(e=a.adornedObject.strokeWidth);e*=d.Ea;a instanceof R&&null!==a.ya?(a=a.ya.bounds,d.Ge(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof Ce&&null!==a.adornedPart.ya?(a=a.adornedPart.ya.bounds,d.Ge(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):d.Ge(-(e/2),-(e/2),b+e,c+e);e=d.desiredSize;e.u()||null===d.ya?d.gc.h(0,0,e.width,e.height):d.gc.assign(d.ya.bounds);wj(d,!1)}} +function fn(){this.Ca="Base"}na(fn,Zl); +fn.prototype.measure=function(a,b,c,d,e,f,g){var h=a.Ab();a.graduatedBounds=[];var k=h.margin,l=k.right+k.left,m=k.top+k.bottom;h.measure(b,c,f,g);var n=h.measuredBounds,p=new M(-k.left,-k.top,Math.max(n.width+l,0),Math.max(n.height+m,0));a.graduatedBounds.push(p);e.assign(p);for(var r=h.geometry,q=h.strokeWidth,u=r.flattenedSegments,x=r.flattenedLengths,y=r.flattenedTotalLength,z=u.length,B=0,C=0,D=Na(),J=0;J<z;J++){var U=u[J],aa=[];C=B=0;for(var Y=U.length,W=0;W<Y;W+=2){var Q=U[W],la=U[W+1];if(0!== +W){var fa=180*Math.atan2(la-C,Q-B)/Math.PI;0>fa&&(fa+=360);aa.push(fa)}B=Q;C=la}D.push(aa)}if(null===a.graduatedIntervals){for(var za=[],Ma=a.U.s,sb=Ma.length,wb=0;wb<sb;wb++){var Wb=Ma[wb],tb=[];za.push(tb);if(Wb.visible){var Ye=Wb.interval;if(!(0>Ye))for(var jb=0;jb<sb;jb++)if(jb!==wb){var Ed=Ma[jb];if(Ed.visible&&Wb.constructor===Ed.constructor){var Xb=Ed.interval;Xb>Ye&&tb.push(Xb)}}}}a.graduatedIntervals=za}var Ze=a.graduatedIntervals;var Ic=a.U.s,bd=Ic.length,Ac=0,tc=0,zf=y;a.graduatedMarks= +[];for(var Fd,Sh=0;Sh<bd;Sh++){var Bc=Ic[Sh];Fd=[];if(Bc.visible&&Bc!==h){var Yb=Math.abs(Bc.interval),Zi=a.graduatedTickUnit;if(!(2>Zi*Yb*y/a.graduatedRange&&null===Bc.graduatedSkip)){var Mg=x[0][0],Rd=0,uc=0;tc=y*Bc.graduatedStart-1E-4;zf=y*Bc.graduatedEnd+1E-4;var dg=Zi*Yb,Cc=a.graduatedTickBase;if(Cc<a.graduatedMin){var Af=(a.graduatedMin-Cc)/dg;Af=0===Af%1?Af:Math.floor(Af+1);Cc+=Af*dg}else Cc>a.graduatedMin+dg&&(Cc-=Math.floor((Cc-a.graduatedMin)/dg)*dg);for(var Hk=Ze[Sh],$i=Cc,fo=1E-6*a.graduatedMax, +ce=1;Cc<=a.graduatedMax+fo;ce++){a:{for(var De=Hk.length,Ng=0;Ng<De;Ng++){var Bf=(Cc-a.graduatedTickBase)%(Hk[Ng]*a.graduatedTickUnit),Th=1E-6*a.graduatedTickUnit;if(Bf<Th&&Bf>-Th){var Cf=!1;break a}}Cf=!0}if(Cf&&(Cc>a.graduatedMax&&(Cc=a.graduatedMax),null===Bc.graduatedSkip||Bc instanceof ch&&!Bc.graduatedSkip(Cc,Bc)||Bc instanceof Qf&&!Bc.graduatedSkip(Cc,Bc))&&(Ac=(Cc-a.graduatedMin)*y/a.graduatedRange,Ac>y&&(Ac=y),tc<=Ac&&Ac<=zf)){for(var de=D[Rd][uc],$e=x[Rd][uc];Rd<x.length;){for(;Ac>Mg&&uc< +x[Rd].length-1;)uc++,de=D[Rd][uc],$e=x[Rd][uc],Mg+=$e;if(Ac<=Mg)break;Rd++;uc=0;de=D[Rd][uc];$e=x[Rd][uc];Mg+=$e}var vc=u[Rd],Sd=vc[2*uc],Ik=vc[2*uc+1],Ee=(Ac-(Mg-$e))/$e,Uh=new K(Sd+(vc[2*uc+2]-Sd)*Ee+q/2-r.bounds.x,Ik+(vc[2*uc+3]-Ik)*Ee+q/2-r.bounds.y);Uh.scale(h.scale,h.scale);a:{var Gd=de,eg=D[Rd];if(!(.5005>Ee&&.4995<Ee)){var Td=Gd;.5>Ee?0<uc?Td=eg[uc-1]:L.ha(vc[0],vc[vc.length-2])&&L.ha(vc[1],vc[vc.length-1])&&(Td=eg[eg.length-1]):.5<Ee&&(uc+1<eg.length?Td=eg[uc+1]:L.ha(vc[0],vc[vc.length-2])&& +L.ha(vc[1],vc[vc.length-1])&&(Td=eg[0]));if(Gd!==Td){var Og=Math.abs(Gd-Td);180<Og&&(Gd<Td?Gd+=360:Td+=360,Og=Math.abs(Gd-Td));if(5E-4>Ee||.9995<Ee){de=(Gd+Td)/2%360;break a}if(10>Og){var Vh=1-Math.abs(.5-Ee);de=(Gd*Vh+Td*(1-Vh))%360;break a}}}de=Gd}if(Bc instanceof ch){var nd="";null!==Bc.graduatedFunction?(nd=Bc.graduatedFunction(Cc,Bc),nd=null!==nd&&void 0!==nd?nd.toString():""):nd=(+Cc.toFixed(2)).toString();""!==nd&&Fd.push({Vl:Uh,angle:de,text:nd})}else Fd.push({Vl:Uh,angle:de})}Cc=$i+ce*dg}}}a.graduatedMarks.push(Fd)}Pa(D); +var xb=a.graduatedMarks;if(null!==xb)for(var aj=d.length,jc=0;jc<aj;jc++){var kb=d[jc],kc=xb[jc];if(kb.visible&&kb!==h&&0!==kc.length){if(kb instanceof Qf){var Fe=a,af=e,fg=kb.alignmentFocus;fg.kc()&&(fg=Gc);var go=kb.angle;kb.Lb=0;kb.measure(Infinity,Infinity,0,0);kb.Lb=go;var Jk=kb.measuredBounds,Wh=Jk.width,gg=Jk.height,Pg=M.allocAt(0,0,Wh,gg),wc=K.alloc();wc.Ci(Pg,fg);M.free(Pg);for(var Ud=-wc.x,Hd=-wc.y,Pc=new M,Df=kc.length,Xh=0;Xh<Df;Xh++)for(var Ef=kc[Xh],Kk=Ef.Vl.x,Yh=Ef.Vl.y,cb=Ef.angle, +od=0;4>od;od++){switch(od){case 0:wc.h(Ud,Hd);break;case 1:wc.h(Ud+Wh,Hd);break;case 2:wc.h(Ud,Hd+gg);break;case 3:wc.h(Ud+Wh,Hd+gg)}wc.rotate(cb+kb.angle);wc.offset(Kk,Yh);0===Xh&&0===od?Pc.h(wc.x,wc.y,0,0):Pc.Ze(wc);wc.offset(-Kk,-Yh);wc.rotate(-cb-kb.angle)}K.free(wc);null!==Fe.graduatedBounds&&Fe.graduatedBounds.push(Pc);lc(af,Pc.x,Pc.y,Pc.width,Pc.height)}else if(kb instanceof ch){var cd=a,Lk=e;null===cd.temporaryTextBlock&&(cd.temporaryTextBlock=new ch);var Dc=cd.temporaryTextBlock;gn(Dc,kb); +var bf=kb.alignmentFocus;bf.kc()&&(bf=Gc);for(var dd=kb.segmentOrientation,Zh=kb.segmentOffset,Ff=new M,bj=0,$h=0,Vd=0,hg=0,Gf=0,ai=kc.length,cf=0;cf<ai;cf++){var ee=kc[cf];bj=ee.Vl.x;$h=ee.Vl.y;Vd=ee.angle;Gf=hg=kb.angle;dd!==mg&&(Gf=dd===hn||dd===jn?Vd+kb.angle:Vd,hg=R.computeAngle(dd,Gf));Dc.Lb=hg;Dc.text=ee.text||"";Dc.measure(Infinity,Infinity,0,0);var df=Dc.measuredBounds,Ge=Dc.naturalBounds,ef=Ge.width,ff=Ge.height,Id=Jb.alloc();Id.reset();Id.translate(-df.x,-df.y);Id.scale(Dc.scale,Dc.scale); +Id.rotate(Gf,ef/2,ff/2);dd!==an&&dd!==bn||Id.rotate(90,ef/2,ff/2);dd!==cn&&dd!==dn||Id.rotate(-90,ef/2,ff/2);dd===en&&(45<Vd&&135>Vd||225<Vd&&315>Vd)&&Id.rotate(-Vd,ef/2,ff/2);var Qg=M.allocAt(0,0,ef,ff),gf=K.alloc();gf.Ci(Qg,bf);Id.La(gf);var Rg=-gf.x,ho=-gf.y,He=K.alloc();He.assign(Zh);isNaN(He.x)&&(He.x=ef/2+3);isNaN(He.y)&&(He.y=-(ff/2+3));He.rotate(Vd);bj+=He.x+Rg;$h+=He.y+ho;var ig=new M(bj,$h,df.width,df.height),cj=new M(df.x,df.y,df.width,df.height),dj=new M(Ge.x,Ge.y,Ge.width,Ge.height); +ee.Tz=hg;ee.lineCount=Dc.lineCount;ee.lines=[Dc.Db,Dc.Lh,Dc.ef,Dc.Le,Dc.Pc,Dc.ac,Dc.Ae];ee.actualBounds=ig;ee.measuredBounds=cj;ee.naturalBounds=dj;0===cf?Ff.assign(ig):Ff.cd(ig);K.free(He);K.free(gf);M.free(Qg);Jb.free(Id)}null!==cd.graduatedBounds&&cd.graduatedBounds.push(Ff);lc(Lk,Ff.x,Ff.y,Ff.width,Ff.height)}wj(kb,!1)}}}; +fn.prototype.arrange=function(a,b,c){if(null!==a.graduatedBounds){var d=a.Ab(),e=a.graduatedMarks;if(null!==e){var f=a.graduatedBounds,g=0,h=f[g];g++;null!==d&&d.arrange(h.x-c.x,h.y-c.y,h.width,h.height);for(var k=b.length,l=0;l<k;l++){var m=b[l];h=e[l];m.visible&&m!==d&&0!==h.length&&(h=f[g],g++,m.arrange(h.x-c.x,h.y-c.y,h.width,h.height))}a.graduatedBounds=null}}}; +fn.prototype.zc=function(a,b,c){var d=c.hj;c.hj=!0;var e=a.naturalBounds,f=e.width;e=e.height;b.save();b.beginPath();b.rect(-1,-1,f+1,e+1);b.clip();f=a.Ab();f.zc(b,c);e=a.Gf()*c.scale;0>=e&&(e=1);for(var g=f.actualBounds,h=a.U.s,k=a.graduatedMarks,l=h.length,m=0;m<l;m++){var n=h[m],p=k[m],r=p.length;if(n.visible&&n!==f&&0!==p.length)if(n instanceof Qf){if(!(2>a.graduatedTickUnit*n.interval*f.geometry.flattenedTotalLength/a.graduatedRange*e&&null===n.graduatedSkip)){var q=n.measuredBounds,u=n.strokeWidth* +n.scale,x=n.alignmentFocus;x.kc()&&(x=Gc);for(var y=0;y<r;y++){var z=p[y].Vl,B=p[y].angle,C=x,D=n.Gb;D.reset();D.translate(z.x+g.x,z.y+g.y);D.rotate(B+n.angle,0,0);D.translate(-q.width*C.x+C.offsetX+u/2,-q.height*C.y+C.offsetY+u/2);D.scale(n.scale,n.scale);Ml(n,!1);n.wh.set(n.Gb);n.Lk=n.scale;Nl(n,!1);n.zc(b,c);n.Gb.reset()}}}else if(n instanceof ch)for(null===a.temporaryTextBlock&&(a.temporaryTextBlock=new ch),q=a.temporaryTextBlock,gn(q,n),n=0;n<r;n++)u=p[n],u.actualBounds&&u.measuredBounds&&u.naturalBounds&& +(q.hc=u.text||"",q.Lb=u.Tz||0,q.kd=u.lineCount||0,x=u.lines,void 0!==x&&(q.Db=x[0],q.Lh=x[1],q.ef=x[2],q.Le=x[3],q.Pc=x[4],q.ac=x[5],q.Ae=x[6]),u.naturalBounds&&(q.gc=u.naturalBounds),u.actualBounds&&(x=u.actualBounds,q.arrange(x.x,x.y,x.width,x.height)),x=u.actualBounds,q.arrange(x.x,x.y,x.width,x.height),y=u.measuredBounds,u=u.naturalBounds,z=q.Gb,z.reset(),z.translate(x.x+g.x,x.y+g.y),z.translate(-y.x,-y.y),q.bo(z,u.x,u.y,u.width,u.height),Ml(q,!1),q.wh.set(q.Gb),q.Lk=q.scale,Nl(q,!1),q.zc(b,c))}c.hj= +d;b.restore();b.Uc(!0)}; +function V(a,b){O.call(this);this.wa=null;if(void 0===a)this.wa=V.Position;else if("string"===typeof a){var c=Yl.L(a);null!==c&&(this.wa=c)}else a instanceof Zl?this.wa=a:a&&(this.wa=V.Position,b=a);null===this.wa&&v("Panel type not specified or PanelLayout not loaded: "+a);this.o=this.o|4194304|(this.wa===V.Grid?1048576:0);this.U=new H;this.zb=yc;this.Om=hd;this.Wf=kl;this.ah=null;this.af="";this.ng=new M(NaN,NaN,NaN,NaN);this.W=this.G=null;this.no=Ag;this.bn=Tb;this.cn=zb;this.vb=this.ua=null;this.sn= +NaN;this.fe=this.Jh=null;b&&Object.assign(this,b)}na(V,O);V.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.wa=this.wa;a.zb=this.zb.M();a.Om=this.Om.M();a.Wf=this.Wf;a.af=this.af;a.ng.assign(this.ng);null!==this.W&&(a.W=this.W.copy(a));a.no=this.no;a.bn=this.bn.M();a.cn=this.cn.M();null!==this.ua&&(a.ua=this.ua.copy());a.vb=this.vb;a.sn=this.sn;a.Jh=this.Jh}; +V.prototype.Cf=function(a){O.prototype.Cf.call(this,a);a.U=this.U;for(var b=a.U.s,c=b.length,d=0;d<c;d++)b[d].fg=a;a.ah=null};V.prototype.copy=function(){var a=O.prototype.copy.call(this);if(null!==a){for(var b=this.U.s,c=b.length,d=0;d<c;d++){var e=b[d].copy();e.Bi(a);e.wj=null;var f=a.U,g=f.count;f.Hb(g,e);f=a.part;if(null!==f){f.Wh=null;null!==e.portId&&f instanceof T&&(f.Ue=!0);var h=a.diagram;null!==h&&h.undoManager.isUndoingRedoing||f.ib(se,"elements",a,null,e,null,g)}}return a}return null}; +t=V.prototype;t.toString=function(){return"Panel("+this.type.name+")#"+lb(this)};t.In=function(a){O.prototype.In.call(this,a);for(var b=this.U.s,c=b.length,d=0;d<c;d++)b[d].In(a)}; +t.mi=function(a,b){if(this.wa===V.Grid)a.Vc(),this.wa.zc(this,a,b);else if(this.wa===V.Graduated)a.Vc(),this.wa.zc(this,a,b);else{if(this.wa===V.Table){a.Vc();a.lineCap="butt";var c=0<this.rowCount?this.rowDefs:null,d=0<this.columnCount?this.colDefs:null;null!==c&&kn(this,a,!0,c,!0);null!==d&&kn(this,a,!1,d,!0);null!==c&&ln(this,a,!0,c);null!==d&&ln(this,a,!1,d);null!==c&&kn(this,a,!0,c,!1);null!==d&&kn(this,a,!1,d,!1)}(c=this.isClipping&&this.wa===V.Spot)&&a.save();d=this.Ab();for(var e=this.U.s, +f=e.length,g=0;g<f;g++){var h=e[g];c&&h===d&&(a.clipInsteadOfFill=!0);h.zc(a,b);c&&h===d&&(a.clipInsteadOfFill=!1)}c&&(a.restore(),a.Uc(!0))}}; +function ln(a,b,c,d){for(var e=d.length,f=a.actualBounds,g=a.naturalBounds,h=!0,k=0;k<e;k++){var l=d[k];if(void 0!==l&&0!==l.actual)if(h)h=!1;else{if(c){if(l.position>f.height)continue}else if(l.position>f.width)continue;var m=l.separatorStrokeWidth;isNaN(m)&&(m=c?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var n=l.separatorStroke;null===n&&(n=c?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke);if(0!==m&&null!==n){ti(a,b,n,!1,!1,g,f);n=!1;var p=l.separatorDashArray; +null===p&&(p=c?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray);null!==p&&(n=!0,b.Tr(p,0));b.beginPath();p=l.position+m;c?p>f.height&&(m-=p-f.height):p>f.width&&(m-=p-f.width);l=l.position+m/2;b.lineWidth=m;m=a.zb;c?(l+=m.top,p=f.width-m.right,b.moveTo(m.left,l),b.lineTo(p,l)):(l+=m.left,p=f.height-m.bottom,b.moveTo(l,m.top),b.lineTo(l,p));b.stroke();n&&b.Rr()}}}} +function kn(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=mn(a,!0),l=mn(a,!1),m=0;m<f;m++){var n=d[m];if(void 0!==n&&null!==n.background&&n.coversSeparators!==e&&0!==n.actual){var p=c?g.height:g.width;if(!(n.position>p)){var r=n.Wc(),q=n.separatorStrokeWidth;isNaN(q)&&(q=c?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var u=n.separatorStroke;null===u&&(u=c?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke);if(null===u||n.index===(c?k:l))q=0;r-= +q;q=n.position+q;r+=n.actual;q+r>p&&(r=p-q);0>=r||(p=a.zb,ti(a,b,n.background,!0,!1,h,g),c?b.fillRect(p.left,q+p.top,g.width-(p.left+p.right),r):b.fillRect(q+p.left,p.top,r,g.height-(p.top+p.bottom)))}}}}function mn(a,b){for(var c=b?a.rowCount:a.columnCount,d=0;d<c;d++){var e=b?a.rowDefs[d]:a.colDefs[d];if(void 0!==e)return e.index}return 0}function gk(a){return"LineV"===a||"BarV"===a} +t.Xj=function(a,b,c,d,e){var f=this.se(),g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),r=h*(g.m12*g.dx-g.m11*g.dy);if(null!==this.areaBackground)return g=this.actualBounds,L.If(g.left,g.top,g.right,g.bottom,a,b,c,d,e);if(null!==this.background)return f=a*k+b*m+p,h=a*l+b*n+r,a=c*k+d*m+p,k=c*l+d*n+r,e.h(0,0),c=this.naturalBounds,f=L.If(0,0,c.width,c.height,f,h,a,k,e),e.transform(g),f;f||(k=1,m=l=0,n=1,r=p=0);h=a*k+b*m+p;a=a*l+b* +n+r;k=c*k+d*m+p;c=c*l+d*n+r;e.h(k,c);d=(k-h)*(k-h)+(c-a)*(c-a);l=!1;n=this.U.s;r=n.length;m=K.alloc();p=null;b=Infinity;var q=null,u=this.isClipping&&this.wa===V.Spot;u&&(q=K.alloc(),p=this.Ab(),(l=p.Xj(h,a,k,c,q))&&(b=(h-q.x)*(h-q.x)+(a-q.y)*(a-q.y)));for(var x=0;x<r;x++){var y=n[x];y.visible&&y!==p&&y.Xj(h,a,k,c,m)&&(l=!0,y=(h-m.x)*(h-m.x)+(a-m.y)*(a-m.y),y<d&&(d=y,e.set(m)))}u&&(b>d&&e.set(q),K.free(q));K.free(m);f&&e.transform(g);return l}; +t.w=function(a){if(!Bj(this)){O.prototype.w.call(this,a);a=null;if(this.wa===V.Auto||this.wa===V.Link)a=this.Ab();for(var b=this.U.s,c=b.length,d=0;d<c;d++){var e=b[d];(e===a||e.isPanelMain)&&e.w(!0);if(!e.desiredSize.u()){var f=wl(e,!1);(e instanceof wg||e instanceof V||e instanceof ch||f!==yg)&&e.w(!0)}}}};t.Zj=function(){if(!Bj(this)){wj(this,!0);xl(this,!0);for(var a=this.U.s,b=a.length,c=0;c<b;c++)a[c].Zj()}}; +t.Wk=function(){if(0!==(this.o&2048)===!1){Ml(this,!0);Nl(this,!0);for(var a=this.U.s,b=a.length,c=0;c<b;c++)a[c].Xu()}};t.Xu=function(){Nl(this,!0);for(var a=this.U.s,b=a.length,c=0;c<b;c++)a[c].Xu()}; +t.Sl=function(a,b,c,d){var e=this.ng;e.h(0,0,0,0);var f=this.desiredSize,g=this.minSize;void 0===c&&(c=g.width,d=g.height);c=Math.max(c,g.width);d=Math.max(d,g.height);var h=this.maxSize;isNaN(f.width)||(a=Math.min(f.width,h.width));isNaN(f.height)||(b=Math.min(f.height,h.height));a=Math.max(c,a);b=Math.max(d,b);var k=this.zb;a=Math.max(a-k.left-k.right,0);b=Math.max(b-k.top-k.bottom,0);var l=this.U.s;0!==l.length&&this.wa.measure(this,a,b,l,e,c,d);a=e.width+k.left+k.right;k=e.height+k.top+k.bottom; +isFinite(f.width)&&(a=f.width);isFinite(f.height)&&(k=f.height);a=Math.min(h.width,a);k=Math.min(h.height,k);a=Math.max(g.width,a);k=Math.max(g.height,k);a=Math.max(c,a);k=Math.max(d,k);bc(e,a,k);bc(this.naturalBounds,a,k);this.Ge(0,0,a,k)};t.Ab=function(){if(null===this.ah){var a=this.U.s,b=a.length;if(0===b)return null;for(var c=0;c<b;c++){var d=a[c];if(!0===d.isPanelMain)return this.ah=d}this.ah=a[0]}return this.ah};function Jm(a){return null!==a.part?a.part.locationObject:null} +t.gh=function(a,b,c,d){var e=this.U.s;this.actualBounds.h(a,b,c,d);if(0!==e.length){if(!this.desiredSize.u()){a=wl(this,!0);var f=this.measuredBounds;b=f.width;f=f.height;var g=this.Mg,h=g.left+g.right;g=g.top+g.bottom;b===c&&f===d&&(a=yg);switch(a){case yg:if(b>c||f>d)this.w(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case Bd:this.w(!0);this.measure(c+h,d+g,0,0);break;case il:this.w(!0);this.measure(c+h,f+g,0,0);break;case jl:this.w(!0),this.measure(b+h,d+g,0,0)}}this.wa.arrange(this,e,this.ng)}}; +t.ih=function(a){var b=this.naturalBounds,c=Jm(this);if(mc(0,0,b.width,b.height,a.x,a.y)){b=this.U.s;for(var d=b.length,e=K.allocAt(0,0);d--;){var f=b[d];if(f.visible||f===c)if(Kb(e.set(a),f.transform),f.ga(e))return K.free(e),!0}K.free(e);return null===this.cc&&null===this.areaBackground?!1:!0}return!1};t.Ur=function(a){if(this.bindingId===a)return this;for(var b=this.U.s,c=b.length,d=0;d<c;d++){var e=b[d].Ur(a);if(null!==e)return e}return null}; +t.nk=function(a,b){b(this,a);if(a instanceof V){a=a.U.s;for(var c=a.length,d=0;d<c;d++)this.nk(a[d],b)}};function Oj(a,b){nn(a,a,b)}function nn(a,b,c){c(b);b=b.U.s;for(var d=b.length,e=0;e<d;e++){var f=b[e];f instanceof V&&nn(a,f,c)}}function on(a,b){pn(a,a,b)}function pn(a,b,c){c(b);if(b instanceof V){b=b.U.s;for(var d=b.length,e=0;e<d;e++)pn(a,b[e],c)}}t.Jl=function(a){return qn(this,this,a)}; +function qn(a,b,c){if(c(b))return b;if(b instanceof V){b=b.U.s;for(var d=b.length,e=0;e<d;e++){var f=qn(a,b[e],c);if(null!==f)return f}}return null}t.lb=function(a){if(this.name===a)return this;var b=this.U.s,c=b.length;null===this.Jh&&null===this.itemTemplateMap||(c=rn(this));for(var d=0;d<c;d++){var e=b[d];if(e instanceof V){var f=e.lb(a);if(null!==f)return f}if(e.name===a)return e}return null}; +function sn(a){a=a.U.s;for(var b=a.length,c=0,d=0;d<b;d++){var e=a[d];e instanceof V?c=Math.max(c,sn(e)):e instanceof Qf&&(c=Math.max(c,e.mg/2*e.strokeMiterLimit*e.Gf()))}return c}t.se=function(){return!(this.type===V.TableRow||this.type===V.TableColumn)}; +t.jc=function(a,b,c){if(!1===this.pickable)return null;void 0===b&&(b=null);void 0===c&&(c=null);if(Cj(this))return null;var d=this.naturalBounds,e=1/this.Gf(),f=this.se(),g=f?a:Kb(K.allocAt(a.x,a.y),this.transform),h=this.diagram,k=10,l=5;null!==h&&(k=h.Ml("extraTouchArea"),l=k/2);if(mc(-(l*e),-(l*e),d.width+k*e,d.height+k*e,g.x,g.y)){if(!this.isAtomic){e=this.U.s;var m=e.length;h=K.alloc();l=(k=this.isClipping&&this.wa===V.Spot)?this.Ab():null;if(k&&(l.se()?Kb(h.set(a),l.transform):h.set(a),!l.ga(h)))return K.free(h), +f||K.free(g),null;for(var n=Jm(this);m--;){var p=e[m];if(p.visible||p===n)if(p.se()?Kb(h.set(a),p.transform):h.set(a),!k||p!==l){var r=null;p instanceof V?r=p.jc(h,b,c):!0===p.pickable&&p.ga(h)&&(r=p);if(null!==r&&(null!==b&&(r=b(r)),null!==r&&(null===c||c(r))))return K.free(h),f||K.free(g),r}}K.free(h)}if(null===this.background&&null===this.areaBackground)return f||K.free(g),null;a=mc(0,0,d.width,d.height,g.x,g.y)?this:null;f||K.free(g);return a}f||K.free(g);return null}; +t.pi=function(a,b,c,d){if(!1===this.pickable)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var e=this.naturalBounds,f=this.se(),g=f?a:Kb(K.allocAt(a.x,a.y),this.transform),h=this.type===V.TableRow||this.type===V.TableColumn;e=mc(0,0,e.width,e.height,g.x,g.y);if(h||e){if(!this.isAtomic){h=this.U.s;for(var k=h.length,l=K.alloc(),m=Jm(this);k--;){var n=h[k];if(n.visible||n===m){n.se()?Kb(l.set(a),n.transform):l.set(a);var p=n;n=n instanceof V?n:null;(null!==n?n.pi(l,b,c,d):p.ga(l))&&!1!==p.pickable&& +(null!==b&&(p=b(p)),null===p||null!==c&&!c(p)||d.add(p))}}K.free(l)}f||K.free(g);return e&&(null!==this.background||null!==this.areaBackground)}f||K.free(g);return!1}; +t.Ff=function(a,b,c,d,e,f){if(!1===this.pickable)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var g=f;void 0===f&&(g=Jb.alloc(),g.reset());g.multiply(this.transform);if(this.hh(a,g))return tn(this,b,c,e),void 0===f&&Jb.free(g),!0;if(this.Yc(a,g)){if(!this.isAtomic)for(var h=Jm(this),k=this.U.s,l=k.length;l--;){var m=k[l];if(m.visible||m===h){var n=m.actualBounds,p=this.naturalBounds;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=m;m=m instanceof V?m:null;p=Jb.alloc();p.set(g); +if(null!==m?m.Ff(a,b,c,d,e,p):vl(n,a,d,p))null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);Jb.free(p)}}}void 0===f&&Jb.free(g);return d}void 0===f&&Jb.free(g);return!1};function tn(a,b,c,d){for(var e=a.U.s,f=e.length;f--;){var g=e[f];if(g.visible){var h=g.actualBounds,k=a.naturalBounds;h.x>k.width||h.y>k.height||0>h.x+h.width||0>h.y+h.height||(g instanceof V&&tn(g,b,c,d),null!==b&&(g=b(g)),null===g||null!==c&&!c(g)||d.add(g))}}} +t.tg=function(a,b,c,d,e,f){if(!1===this.pickable)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var g=this.naturalBounds,h=this.se(),k=h?a:Kb(K.allocAt(a.x,a.y),this.transform),l=h?b:Kb(K.allocAt(b.x,b.y),this.transform),m=k.Df(l),n=0<k.x&&k.x<g.width&&0<k.y&&k.y<g.height||Lb(k.x,k.y,0,0,0,g.height)<=m||Lb(k.x,k.y,0,g.height,g.width,g.height)<=m||Lb(k.x,k.y,g.width,g.height,g.width,0)<=m||Lb(k.x,k.y,g.width,0,0,0)<=m;g=k.zd(0,0)<=m&&k.zd(0,g.height)<=m&&k.zd(g.width,0)<=m&&k.zd(g.width,g.height)<= +m;h||(K.free(k),K.free(l));if(n){if(!this.isAtomic){k=K.alloc();l=K.alloc();m=Jm(this);for(var p=this.U.s,r=p.length;r--;){var q=p[r];if(q.visible||q===m){var u=q.actualBounds,x=this.naturalBounds;if(!h||!(u.x>x.width||u.y>x.height||0>u.x+u.width||0>u.y+u.height))if(q.se()?(u=q.transform,Kb(k.set(a),u),Kb(l.set(b),u)):(k.set(a),l.set(b)),u=q,q=q instanceof V?q:null,null!==q?q.tg(k,l,c,d,e,f):u.mx(k,l,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||f.add(u)}}K.free(k);K.free(l)}return e?n:g}return!1}; +function Pm(a){var b=null;a instanceof Qf&&(b=a.spot1,b===hd&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot1));null===b&&(b=Fc);return b}function Qm(a){var b=null;a instanceof Qf&&(b=a.spot2,b===hd&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot2));null===b&&(b=Oc);return b}t.add=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];for(c=0;c<b.length;c++)this.Hb(this.U.count,b[c]);return this};t.N=function(a){return this.U.N(a)}; +t.Hb=function(a,b){b instanceof S&&v("Cannot add a Part to a Panel: "+b+"; use a Panel instead");if(this===b||this.vg(b))this===b&&v("Cannot make a Panel contain itself: "+this.toString()),v("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.panel;null!==c&&c!==this&&v("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+b.toString()+", already contained by "+c.toString()+", cannot be shared by this Panel: "+this.toString()); +this.wa!==V.Grid||b instanceof Qf||v("Can only add Shapes to a Grid Panel, not: "+b);this.wa!==V.Graduated||b instanceof Qf||b instanceof ch||v("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.Bi(this);b.wj=null;if(null!==this.itemArray){var d=b.data;null!==d&&"object"===typeof d&&(null===this.fe&&(this.fe=new yb),this.fe.add(d,b))}var e=this.U;d=-1;if(c===this){for(var f=-1,g=this.U.s,h=g.length,k=0;k<h;k++)if(g[k]===b){f=k;break}if(-1!==f){if(f===a||f+1>=e.count&&a>=e.count)return; +e.sb(f);d=f}else v("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Hb(a,b);if(0===a||b.isPanelMain)this.ah=null;Bj(this)||this.w();b.w(!1);null!==b.portId?this.Ue=!0:b instanceof V&&!0===b.Ue&&(this.Ue=!0);this.graduatedIntervals=null;this.Kf()||un(this,b,!1);c=this.part;null!==c&&(c.Wh=null,c.dg=NaN,this.Ue&&c instanceof T&&(c.Ue=!0),c.Ue&&c instanceof T&&(c.yc=null),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||(-1!==d&& +c.ib(te,"elements",this,b,null,d,null),c.ib(se,"elements",this,null,b,null,a)))};function vn(a,b){a.o=b?a.o|16777216:a.o&-16777217}t.remove=function(a){w(a,O,V,"remove:element");for(var b=this.U.s,c=b.length,d=-1,e=0;e<c;e++)if(b[e]===a){d=e;break}-1!==d&&this.rc(d,!0)};t.sb=function(a){G&&E(a,V,"removeAt:idx");0<=a&&this.rc(a,!0)}; +t.rc=function(a,b){var c=this.U,d=c.N(a);d.wj=null;d.Bi(null);if(null!==this.fe){var e=d.data;"object"===typeof e&&this.fe.remove(e)}c.sb(a);wj(this,!1);this.w();this.ah===d&&(this.ah=null);this.graduatedIntervals=null;var f=this.part;null!==f&&(f.Wh=null,f.dg=NaN,f.Xb(),f instanceof T&&(d instanceof V?d.nk(d,function(a,c){dm(f,c,b)}):dm(f,d,b)),c=this.diagram,null!==c&&c.undoManager.isUndoingRedoing||f.ib(te,"elements",this,d,null,a,null))}; +V.prototype.getRowDefinition=function(a){G&&E(a,V,"getRowDefinition:idx");0>a&&Ba(a,">= 0",V,"getRowDefinition:idx");a=Math.round(a);var b=this.rowDefs;if(void 0===b[a]){var c=new ck;c.Bi(this);c.isRow=!0;c.index=a;b[a]=c;this.ib(se,"rowdefs",this,null,c,null,a)}return b[a]}; +V.prototype.nA=function(a){G&&E(a,V,"removeRowDefinition:idx");0>a&&Ba(a,">= 0",V,"removeRowDefinition:idx");if(0!==this.rowCount){a=Math.round(a);var b=this.rowDefs,c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.ib(te,"rowdefs",this,c,null,a,null);this.w()}}};function dk(a,b,c){var d=a.rowDefs;if(!(0>b)){d[b]=c instanceof ck?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.w()}} +V.prototype.getColumnDefinition=function(a){G&&E(a,V,"getColumnDefinition:idx");0>a&&Ba(a,">= 0",V,"getColumnDefinition:idx");a=Math.round(a);var b=this.colDefs;if(void 0===b[a]){var c=new ck;c.Bi(this);c.isRow=!1;c.index=a;b[a]=c;this.ib(se,"coldefs",this,null,c,null,a)}return b[a]};t=V.prototype; +t.iA=function(a){G&&E(a,V,"removeColumnDefinition:idx");0>a&&Ba(a,">= 0",V,"removeColumnDefinition:idx");if(0!==this.columnCount){a=Math.round(a);var b=this.colDefs,c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.ib(te,"coldefs",this,c,null,a,null);this.w()}}};function ek(a,b,c){var d=a.colDefs;if(!(0>b)){d[b]=c instanceof ck?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.w()}} +t.oz=function(a){if(0>a||this.type!==V.Table||0===this.rowCount)return-1;for(var b=0,c=this.rowDefs,d=c.length,e=this.topIndex;e<d;e++){var f=c[e];if(void 0!==f&&(b+=f.total,a<b))break}return e};t.gz=function(a){if(0>a||this.type!==V.Table||0===this.columnCount)return-1;for(var b=0,c=this.colDefs,d=c.length,e=this.leftIndex;e<d;e++){var f=c[e];if(void 0!==f&&(b+=f.total,a<b))break}return e}; +t.Gz=function(a,b){void 0===b&&(b=new K(NaN,NaN));if(this.type!==V.Graduated)return b.h(NaN,NaN),b;a=Math.min(Math.max(a,this.graduatedMin),this.graduatedMax);var c=this.Ab();c.geometry.Qu((a-this.graduatedMin)/this.graduatedRange,b);return c.transform.La(b)};t.Hz=function(a){if(this.type!==V.Graduated)return NaN;var b=this.Ab();b.transform.Rd(a);return b.geometry.qx(a)*this.graduatedRange+this.graduatedMin};function Ul(a){a=a.allBindings;return null!==a&&a._isFrozen} +function xg(a){var b=a.allBindings;if(null===b)null!==a.data&&v("Template cannot have .data be non-null: "+a),a.allBindings=b=new H;else if(b._isFrozen)return;var c=new H;vn(a,!1);a.nk(a,function(a,d){d.th();var e=d.localBindings;if(null!==e)for(Rl(d,!1),e=e.iterator;e.next();){var f=e.value;f.mode===wn&&Rl(d,!0);var g=f.sourceName;null!==g&&("/"===g&&vn(a,!0),g=ul(f,a,d),null!==g&&(c.add(g),null===g.srcBindings&&(g.srcBindings=new H),g.srcBindings.add(f)));b.add(f)}if(d instanceof V&&d.type===V.Table){if(0< +d.rowCount)for(a=d.rowDefs,e=a.length,f=0;f<e;f++)if(g=a[f],void 0!==g&&null!==g.ae)for(var h=g.ae.iterator;h.next();){var k=h.value;k.yd=g;k.jo=2;k.yl=g.index;b.add(k)}if(0<d.columnCount)for(d=d.colDefs,a=d.length,e=0;e<a;e++)if(f=d[e],void 0!==f&&null!==f.ae)for(g=f.ae.iterator;g.next();)h=g.value,h.yd=f,h.jo=1,h.yl=f.index,b.add(h)}});for(var d=c.iterator;d.next();){var e=d.value;if(null!==e.srcBindings){Rl(e,!0);for(var f=e.srcBindings.iterator;f.next();){var g=f.value;null===e.localBindings&& +(e.localBindings=new H);e.localBindings.add(g)}}e.srcBindings=null}for(var h=b.iterator;h.next();)if(d=h.value,e=d.yd,null!==e){d.yd=null;g=d.targetProperty;var k=g.indexOf(".");0<k&&e instanceof V&&(f=g.substring(0,k),g=g.substr(k+1),k=e.lb(f),null!==k?(e=k,d.targetProperty=g):Fa('Warning: unable to find GraphObject named "'+f+'" for Binding: '+d.toString()));e instanceof ck?(f=lb(e.panel),d.Gi=void 0===f?-1:f,e.panel.bindingId=d.Gi):e instanceof O?(f=lb(e),d.Gi=void 0===f?-1:f,e.bindingId=d.Gi): +v("Unknown type of binding target: "+e)}b.freeze();a instanceof S&&(a.Zc()&&a.eb(),G&&!xn&&a.nk(a,function(a,c){if(c instanceof V&&(c.type===V.Auto||c.type===V.Spot||c.type===V.Graduated)&&1>=c.elements.count&&!(c instanceof S)){var d=!1;if(1===c.elements.count&&(d=null!==c.itemArray,!d))for(h=b.iterator;h.next();)if("itemArray"===h.value.targetProperty){d=!0;break}d||(Fa("Auto, Spot, or Graduated Panel should not have zero or one elements: "+c.toString()+" in "+a.toString()),xn=!0)}}))} +t.Sy=function(a){void 0===a&&(a=!1);var b=this.copy();on(b,function(a){a instanceof V&&(a.allBindings=null,a.vb=null);var b=a.localBindings;null!==b&&(a.localBindings=null,b.each(function(b){a.bind(b.copy())}));b=a.animationTriggers;null!==b&&(a.animationTriggers=null,b.each(function(b){a.Av(b.value.copy())}))});a&&xg(b);return b}; +t.Pa=function(a){var b=this.allBindings;if(null!==b)for(void 0===a&&(a=""),b=b.iterator;b.next();){var c=b.value,d=c.sourceProperty;if(""===a||""===d||d===a)if(d=c.targetProperty,null!==c.converter||""!==d){d=this.data;var e=c.sourceName;if(null!==e)if(""===e)d=this;else if("/"===e)d=this;else if("."===e)d=this;else if(".."===e)d=this;else{if(d=this.lb(e),null===d){G&&Fa("Binding error: missing GraphObject named "+e+" in "+this.toString());continue}}else if(c.isToModel)if(d=this.diagram,null!==d)d= +d.model.modelData;else continue;var f=this,g=c.Gi;if(-1!==g){if(f=this.Ur(g),null===f)continue}else null!==c.yd&&(f=c.yd);"/"===e?d=f.part:"."===e?d=f:".."===e&&(d=f.panel);e=c.jo;if(0!==e){if(!(f instanceof V))continue;1===e?f=f.getColumnDefinition(c.yl):2===e&&(f=f.getRowDefinition(c.yl))}void 0!==f&&c.Dv(f,d)}}};t.lx=function(a){if(void 0===a||null===a||null===this.fe)return null;A(a,"object",V,"findItemPanelForData");return this.fe.L(a)}; +function yn(a,b){a=a.U.s;for(var c=a.length,d=b.length,e=0,f=null;e<c&&!(f=a[e],f instanceof V&&null!==f.data);)e++,f=a[e];if(c-e!==d)return!0;if(null===f)return 0<d;for(var g=0;e<c&&g<d;){f=a[e];if(!(f instanceof V)||f.data!==b[g])return!0;e++;g++}return!1} +function rn(a){if(a.type===V.Spot||a.type===V.Auto)return Math.min(a.U.length,1);if(a.type===V.Link){a=a.U;for(var b=a.length,c=0;c<b;c++){var d=a.N(c);if(!(d instanceof Qf&&d.isPanelMain))break}return c}return a.type===V.Table&&0<a.U.length&&(a=a.U.N(0),a.isPanelMain&&a instanceof V&&(a.type===V.TableRow||a.type===V.TableColumn))?1:0}t.iv=function(){for(var a=rn(this);this.U.length>a;)this.rc(this.U.length-1,!1);zn(this,this.itemArray)}; +function zn(a,b){var c=rn(a);if(null===b||0===b.length)for(;a.U.length>c;)a.rc(a.U.length-1,!1);else if(a.U.length<=c){c=b.length;for(var d=0;d<c;d++)An(a,b[d],d,!0)}else{d=c;for(var e=0;e<b.length;e++,d++){var f=b[e],g=d<a.U.length?a.U.N(d):null;if(g instanceof V){if(g.data!==f){var h=Bn(a,g.data),k=Bn(a,f),l=k!==h;l||(h=Cn(a,h),l=Cn(a,k)!==h);l?(a.rc(d,!1),An(a,f,e,!1)):g.data=f}}else An(a,f,e,!1)}for(;d<a.U.length;)a.rc(d,!1);a.ah=null;Dn(a,c,0);Bj(a)||a.w();a.graduatedIntervals=null;a.Kf()||un(a, +a,!1);b=a.part;null!==b&&(b.Wh=null,b.dg=NaN,a.Ue&&b instanceof T&&(b.Ue=!0),b.Ue&&b instanceof T&&(b.yc=null))}}function An(a,b,c,d){if(!(void 0===b||null===b||0>c)){var e=Bn(a,b);e=Cn(a,e);if(null!==e){xg(e);e=e.copy();if(0!==(e.o&16777216)){var f=a.jh();null!==f&&vn(f,!0)}"object"===typeof b&&(null===a.fe&&(a.fe=new yb),a.fe.add(b,e));f=c+rn(a);a.Hb(f,e);d&&(e.vb=b,Dn(a,f,c),e.vb=null);e.data=b}}} +function Dn(a,b,c){for(a=a.U;b<a.length;){var d=a.N(b);if(d instanceof V){var e=b,f=c;d.type===V.TableRow?d.row=e:d.type===V.TableColumn&&(d.column=e);d.itemIndex=f}b++;c++}}function Bn(a,b){if(null===b)return"";a=a.itemCategoryProperty;if("function"===typeof a)a=a(b);else if("string"===typeof a&&"object"===typeof b){if(""===a)return"";a=En(b,a)}else return"";if(void 0===a)return"";if("string"===typeof a)return a;v("Panel.getCategoryForItemData found a non-string category for "+b+": "+a)} +function Cn(a,b){var c=a.itemTemplateMap,d=null;null!==c&&(d=c.L(b));null===d&&(null!==c&&(d=c.L("")),null===d&&(Fn||(Fn=!0,Fa('No item template Panel found for category "'+b+'" on '+a),Fa(" Using default item template."),a=new V,b=new ch,b.bind(new Ji("text","",Ra)),a.add(b),Gn=a),d=Gn));return d}function un(a,b,c){var d=b.enabledChanged;null!==d&&d(b,c);if(b instanceof V){b=b.U.s;d=b.length;for(var e=0;e<d;e++){var f=b[e];c&&f instanceof V&&!f.isEnabled||un(a,f,c)}}} +function Hn(a,b){b.name=a;Yl.add(a,b)} +oa.Object.defineProperties(V.prototype,{type:{configurable:!0,get:function(){return this.wa},set:function(a){var b=this.wa;b!==a&&(this.wa=a,this.isAtomic=this.wa===V.Grid,this.w(),this.g("type",b,a))}},elements:{configurable:!0,get:function(){return this.U.iterator}},naturalBounds:{configurable:!0,get:function(){return this.gc}},padding:{configurable:!0,get:function(){return this.zb},set:function(a){"number"===typeof a?(0>a&&Ba(a,">= 0",V,"padding"), +a=new gc(a)):(w(a,gc,V,"padding"),0>a.left&&Ba(a.left,">= 0",V,"padding:value.left"),0>a.right&&Ba(a.right,">= 0",V,"padding:value.right"),0>a.top&&Ba(a.top,">= 0",V,"padding:value.top"),0>a.bottom&&Ba(a.bottom,">= 0",V,"padding:value.bottom"));var b=this.zb;b.D(a)||(this.zb=a=a.M(),this.w(),this.g("padding",b,a))}},defaultAlignment:{configurable:!0,get:function(){return this.Om},set:function(a){var b=this.Om;b.D(a)||(G&&w(a,Ib,V,"defaultAlignment"),this.Om=a=a.M(),this.w(),this.g("defaultAlignment", +b,a))}},defaultStretch:{configurable:!0,get:function(){return this.Wf},set:function(a){var b=this.Wf;b!==a&&(ab(a,O,V,"defaultStretch"),this.Wf=a,this.w(),this.g("defaultStretch",b,a))}},defaultSeparatorPadding:{configurable:!0,get:function(){return null!==this.W?this.W.Hp:yc},set:function(a){"number"===typeof a?a=new gc(a):G&&w(a,gc,V,"defaultSeparatorPadding");var b=this.defaultSeparatorPadding;b.D(a)||(a=a.M(),null===this.W&&(this.W=new In),this.W.Hp=a,this.w(),this.g("defaultSeparatorPadding", +b,a))}},defaultRowSeparatorStroke:{configurable:!0,get:function(){return null!==this.W?this.W.ma:null},set:function(a){var b=this.defaultRowSeparatorStroke;b!==a&&(null===a||"string"===typeof a||a instanceof Bl)&&(a instanceof Bl&&a.freeze(),null===this.W&&(this.W=new In),this.W.ma=a,this.R(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{configurable:!0,get:function(){return null!==this.W?this.W.Ma:1},set:function(a){var b=this.defaultRowSeparatorStrokeWidth; +b!==a&&isFinite(a)&&0<=a&&(null===this.W&&(this.W=new In),this.W.Ma=a,this.w(),this.g("defaultRowSeparatorStrokeWidth",b,a))}},defaultRowSeparatorDashArray:{configurable:!0,get:function(){return null!==this.W?this.W.$:null},set:function(a){var b=this.defaultRowSeparatorDashArray;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",V,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];"number"===typeof f&&0<=f&&isFinite(f)||v("defaultRowSeparatorDashArray value "+ +f+" at index "+e+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}null===this.W&&(this.W=new In);this.W.$=a;this.R();this.g("defaultRowSeparatorDashArray",b,a)}}},defaultColumnSeparatorStroke:{configurable:!0,get:function(){return null!==this.W?this.W.v:null},set:function(a){var b=this.defaultColumnSeparatorStroke;b!==a&&(null===a||"string"===typeof a||a instanceof Bl)&&(a instanceof Bl&&a.freeze(),null===this.W&&(this.W=new In),this.W.v=a,this.R(),this.g("defaultColumnSeparatorStroke", +b,a))}},defaultColumnSeparatorStrokeWidth:{configurable:!0,get:function(){return null!==this.W?this.W.G:1},set:function(a){var b=this.defaultColumnSeparatorStrokeWidth;b!==a&&isFinite(a)&&0<=a&&(null===this.W&&(this.W=new In),this.W.G=a,this.w(),this.g("defaultColumnSeparatorStrokeWidth",b,a))}},defaultColumnSeparatorDashArray:{configurable:!0,get:function(){return null!==this.W?this.W.m:null},set:function(a){var b=this.defaultColumnSeparatorDashArray;if(b!==a){null=== +a||Array.isArray(a)||Aa(a,"Array",V,"defaultColumnSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];"number"===typeof f&&0<=f&&isFinite(f)||v("defaultColumnSeparatorDashArray value "+f+" at index "+e+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}null===this.W&&(this.W=new In);this.W.m=a;this.R();this.g("defaultColumnSeparatorDashArray",b,a)}}},inRowsCols:{configurable:!0,get:function(){return null!==this.W?this.W.ob: +null},set:function(a){null===this.W&&(this.W=new In);this.W.ob=a}},viewboxStretch:{configurable:!0,get:function(){return this.no},set:function(a){var b=this.no;b!==a&&(ab(a,O,V,"viewboxStretch"),this.no=a,this.w(),this.g("viewboxStretch",b,a))}},gridCellSize:{configurable:!0,get:function(){return this.bn},set:function(a){var b=this.bn;if(!b.D(a)){w(a,Hb,V,"gridCellSize");a.u()&&0!==a.width&&0!==a.height||v("Invalid Panel.gridCellSize: "+a);this.bn=a.M();var c=this.diagram; +null!==c&&this===c.grid&&xj(c);this.R();this.g("gridCellSize",b,a)}}},gridOrigin:{configurable:!0,get:function(){return this.cn},set:function(a){var b=this.cn;if(!b.D(a)){w(a,K,V,"gridOrigin");a.u()||v("Invalid Panel.gridOrigin: "+a);this.cn=a.M();var c=this.diagram;null!==c&&this===c.grid&&xj(c);this.R();this.g("gridOrigin",b,a)}}},graduatedMin:{configurable:!0,get:function(){return null!==this.ua?this.ua.$p:0},set:function(a){E(a,V,"graduatedMin");var b=this.graduatedMin; +b!==a&&(null===this.ua&&(this.ua=new Jn),this.ua.$p=a,this.w(),this.g("graduatedMin",b,a),sl(this)&&(a=this.part,null!==a&&tl(this,a,"graduatedRange")))}},graduatedMax:{configurable:!0,get:function(){return null!==this.ua?this.ua.G:100},set:function(a){E(a,V,"graduatedMax");var b=this.graduatedMax;b!==a&&(null===this.ua&&(this.ua=new Jn),this.ua.G=a,this.w(),this.g("graduatedMax",b,a),sl(this)&&(a=this.part,null!==a&&tl(this,a,"graduatedRange")))}},graduatedRange:{configurable:!0, +get:function(){return this.graduatedMax-this.graduatedMin}},graduatedTickUnit:{configurable:!0,get:function(){return null!==this.ua?this.ua.ma:10},set:function(a){E(a,V,"graduatedTickUnit");var b=this.graduatedTickUnit;b!==a&&0<a&&(null===this.ua&&(this.ua=new Jn),this.ua.ma=a,this.w(),this.g("graduatedTickUnit",b,a))}},graduatedTickBase:{configurable:!0,get:function(){return null!==this.ua?this.ua.$:0},set:function(a){E(a,V,"graduatedTickBase");var b=this.graduatedTickBase; +b!==a&&(null===this.ua&&(this.ua=new Jn),this.ua.$=a,this.w(),this.g("graduatedTickBase",b,a))}},graduatedMarks:{configurable:!0,get:function(){return null!==this.ua?this.ua.v:null},set:function(a){null!==this.ua?this.ua.v=a:null!==a&&(this.ua=new Jn,this.ua.v=a)}},graduatedBounds:{configurable:!0,get:function(){return null!==this.ua?this.ua.j:null},set:function(a){null!==this.ua?this.ua.j=a:null!==a&&(this.ua=new Jn,this.ua.j=a)}},graduatedIntervals:{configurable:!0, +get:function(){return null!==this.ua?this.ua.m:null},set:function(a){null!==this.ua?this.ua.m=a:null!==a&&(this.ua=new Jn,this.ua.m=a)}},temporaryTextBlock:{configurable:!0,get:function(){return null!==this.ua?this.ua.di:null},set:function(a){null!==this.ua?this.ua.di=a:null!==a&&(this.ua=new Jn,this.ua.di=a)}},panelLayoutState:{configurable:!0,get:function(){return this.G},set:function(a){this.G=a}},Ue:{configurable:!0,get:function(){return 0!==(this.o&8388608)}, +set:function(a){0!==(this.o&8388608)!==a&&(this.o^=8388608)}},rowDefs:{configurable:!0,get:function(){null===this.W&&(this.W=new In);return this.W.Oc}},rowCount:{configurable:!0,get:function(){return null===this.W?0:this.rowDefs.length}},colDefs:{configurable:!0,get:function(){null===this.W&&(this.W=new In);return this.W.Nc}},columnCount:{configurable:!0,get:function(){return null===this.W?0:this.colDefs.length}},rowSizing:{configurable:!0, +get:function(){return null!==this.W?this.W.tb:Kn},set:function(a){var b=this.rowSizing;b!==a&&(G&&a!==Kn&&a!==Tm&&v("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),null===this.W&&(this.W=new In),this.W.tb=a,this.w(),this.g("rowSizing",b,a))}},columnSizing:{configurable:!0,get:function(){return null!==this.W?this.W.j:Kn},set:function(a){var b=this.columnSizing;b!==a&&(G&&a!==Kn&&a!==Tm&&v("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+ +a),null===this.W&&(this.W=new In),this.W.j=a,this.w(),this.g("columnSizing",b,a))}},topIndex:{configurable:!0,get:function(){return null!==this.W?this.W.Ib:0},set:function(a){var b=this.topIndex;b!==a&&((!isFinite(a)||0>a)&&v("Panel.topIndex must be greater than zero and a real number, not: "+a),null===this.W&&(this.W=new In),this.W.Ib=a,this.w(),this.g("topIndex",b,a))}},leftIndex:{configurable:!0,get:function(){return null!==this.W?this.W.jb:0},set:function(a){var b= +this.leftIndex;b!==a&&((!isFinite(a)||0>a)&&v("Panel.leftIndex must be greater than zero and a real number, not: "+a),null===this.W&&(this.W=new In),this.W.jb=a,this.w(),this.g("leftIndex",b,a))}},data:{configurable:!0,get:function(){return this.vb},set:function(a){var b=this.vb;if(b!==a){var c=this instanceof S&&!(this instanceof Ce);c&&A(a,"object",V,"data");xg(this);this.vb=a;var d=this.diagram;null!==d&&(c?(c=d.partManager,this instanceof R?(null!==b&&c.cf.remove(b),null!==a&&c.cf.add(a, +this)):this instanceof S&&(null!==b&&c.df.remove(b),null!==a&&c.df.add(a,this))):(c=this.panel,null!==c&&null!==c.fe&&(null!==b&&c.fe.remove(b),null!==a&&c.fe.add(a,this))));this.g("data",b,a);null!==d&&d.undoManager.isUndoingRedoing||null!==a&&this.Pa()}}},itemIndex:{configurable:!0,get:function(){return this.sn},set:function(a){var b=this.sn;b!==a&&(this.sn=a,this.g("itemIndex",b,a))}},allBindings:{configurable:!0,get:function(){return null!==this.B?this.B.ob:null},set:function(a){this.localBindings!== +a&&(null===this.B&&(this.B=new ql),this.B.ob=a)}},itemArray:{configurable:!0,get:function(){return this.Jh},set:function(a){G&&null!==a&&!Array.isArray(a)&&v("Panel.itemArray must be an Array-like object or null, not: "+a);var b=this.Jh;if(b!==a||null!==a&&yn(this,a)){var c=this.diagram;b!==a&&(null!==c&&null!==b&&Tj(c.partManager,this,c),this.Jh=a,null!==c&&null!==a&&Qj(c.partManager,this));this.g("itemArray",b,a);null!==c&&c.undoManager.isUndoingRedoing||zn(this,a)}}},itemTemplate:{configurable:!0, +enumerable:!0,get:function(){return null===this.itemTemplateMap?null:this.itemTemplateMap.L("")},set:function(a){if(null===this.itemTemplateMap){if(null===a)return;this.itemTemplateMap=new yb}var b=this.itemTemplateMap.L("");b!==a&&(w(a,V,V,"itemTemplate"),(a instanceof S||a.isPanelMain)&&v("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.itemTemplateMap.add("",a),this.g("itemTemplate",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.iv())}},itemTemplateMap:{configurable:!0, +enumerable:!0,get:function(){return null!==this.B?this.B.ue:null},set:function(a){var b=this.itemTemplateMap;if(b!==a){w(a,yb,V,"itemTemplateMap");for(var c=a.iterator;c.next();){var d=c.value;G&&(d instanceof S||d.isPanelMain)&&v("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}pl(this);this.B.ue=a;this.g("itemTemplateMap",b,a);a=this.diagram;null!==a&&a.undoManager.isUndoingRedoing||this.iv()}}},itemCategoryProperty:{configurable:!0,get:function(){return null!== +this.B?this.B.Oc:"category"},set:function(a){var b=this.itemCategoryProperty;b!==a&&("string"!==typeof a&&"function"!==typeof a&&Aa(a,"string or function",V,"itemCategoryProperty"),pl(this),this.B.Oc=a,this.g("itemCategoryProperty",b,a))}},isAtomic:{configurable:!0,get:function(){return 0!==(this.o&1048576)},set:function(a){var b=0!==(this.o&1048576);b!==a&&(A(a,"boolean",V,"isAtomic"),this.o^=1048576,this.g("isAtomic",b,a))}},isClipping:{configurable:!0,get:function(){return 0!== +(this.o&2097152)},set:function(a){var b=0!==(this.o&2097152);b!==a&&(G&&(A(a,"boolean",V,"isClipping"),!a||this.type===V.Spot||this instanceof wf||Fa("Warning: Panel.isClipping set on non-Spot Panel: "+this.toString())),this.o^=2097152,this instanceof wf&&(this.pb=null),this.w(),this.g("isClipping",b,a))}},isOpposite:{configurable:!0,get:function(){return 0!==(this.o&33554432)},set:function(a){var b=0!==(this.o&33554432);b!==a&&(A(a,"boolean",V,"isOpposite"),this.o^=33554432,this.w(), +this.g("isOpposite",b,a))}},isEnabled:{configurable:!0,get:function(){return 0!==(this.o&4194304)},set:function(a){var b=0!==(this.o&4194304);if(b!==a){A(a,"boolean",V,"isEnabled");var c=null===this.panel||this.panel.Kf();this.o^=4194304;this.g("isEnabled",b,a);b=this.diagram;null!==b&&b.undoManager.isUndoingRedoing||c&&un(this,this,a)}}},alignmentFocusName:{configurable:!0,get:function(){return this.af},set:function(a){var b=this.af;b!==a&&(G&&A(a,"string",V,"alignmentFocusName"), +this.af=a,this.w(),this.g("alignmentFocusName",b,a))}}}); +oa.Object.defineProperties(V,{Position:{configurable:!0,get:function(){return Yl.L("Position")}},Horizontal:{configurable:!0,get:function(){return Yl.L("Horizontal")}},Vertical:{configurable:!0,get:function(){return Yl.L("Vertical")}},Spot:{configurable:!0,get:function(){return Yl.L("Spot")}},Auto:{configurable:!0,get:function(){return Yl.L("Auto")}},Table:{configurable:!0,get:function(){return Yl.L("Table")}},Viewbox:{configurable:!0, +enumerable:!0,get:function(){return Yl.L("Viewbox")}},TableRow:{configurable:!0,get:function(){return Yl.L("TableRow")}},TableColumn:{configurable:!0,get:function(){return Yl.L("TableColumn")}},Link:{configurable:!0,get:function(){return Yl.L("Link")}},Grid:{configurable:!0,get:function(){return Yl.L("Grid")}},Graduated:{configurable:!0,get:function(){return Yl.L("Graduated")}}});V.prototype.rebuildItemElements=V.prototype.iv; +V.prototype.findItemPanelForData=V.prototype.lx;V.prototype.updateTargetBindings=V.prototype.Pa;V.prototype.copyTemplate=V.prototype.Sy;V.prototype.graduatedValueForPoint=V.prototype.Hz;V.prototype.graduatedPointForValue=V.prototype.Gz;V.prototype.findColumnForLocalX=V.prototype.gz;V.prototype.findRowForLocalY=V.prototype.oz;V.prototype.removeColumnDefinition=V.prototype.iA;V.prototype.removeRowDefinition=V.prototype.nA;V.prototype.removeAt=V.prototype.sb;V.prototype.remove=V.prototype.remove; +V.prototype.insertAt=V.prototype.Hb;V.prototype.elt=V.prototype.N;V.prototype.add=V.prototype.add;V.prototype.findObject=V.prototype.lb;V.prototype.findInVisualTree=V.prototype.Jl;V.prototype.walkVisualTreeFrom=V.prototype.nk;V.prototype.findMainElement=V.prototype.Ab;var xn=!1,Fn=!1,Gn=null,Yl=new yb;V.className="Panel";V.definePanelLayout=Hn;Hn("Position",new Im);Hn("Vertical",new Lm);Hn("Auto",new Om);Hn("Link",new Zm); +function Jn(){this.$p=0;this.G=100;this.ma=10;this.$=0;this.di=this.m=this.j=this.v=null}Jn.prototype.copy=function(){var a=new Jn;a.$p=this.$p;a.G=this.G;a.ma=this.ma;a.$=this.$;a.v=this.v;a.j=this.j;a.m=this.m;a.di=this.di;return a};Jn.className="GradPanelSettings";function In(){this.Oc=[];this.Nc=[];this.j=this.tb=Kn;this.jb=this.Ib=0;this.Hp=yc;this.Ma=1;this.$=this.ma=null;this.G=1;this.ob=this.m=this.v=null} +In.prototype.copy=function(a){for(var b=new In,c=this.Oc,d=c.length,e=b.Oc,f=0;f<d;f++)if(void 0!==c[f]){var g=c[f].copy();g.Bi(a);e[f]=g}c=this.Nc;d=c.length;e=b.Nc;for(f=0;f<d;f++)void 0!==c[f]&&(g=c[f].copy(),g.Bi(a),e[f]=g);b.tb=this.tb;b.j=this.j;b.Ib=this.Ib;b.jb=this.jb;b.Hp=this.Hp.M();b.Ma=this.Ma;b.ma=this.ma;b.$=this.$;b.G=this.G;b.v=this.v;b.m=this.m;b.ob=this.ob;return b};In.className="TablePanelSettings"; +function ck(){Za(this);this.fg=null;this.jq=!0;this.bb=0;this.Hc=NaN;this.rj=0;this.pj=Infinity;this.Kb=hd;this.va=this.pc=this.sa=0;this.ae=null;this.co=Ln;this.lg=kl;this.$n=this.hg=null;this.ao=NaN;this.cc=this.Bj=null;this.Km=!1} +ck.prototype.copy=function(){var a=new ck;a.jq=this.jq;a.bb=this.bb;a.Hc=this.Hc;a.rj=this.rj;a.pj=this.pj;a.Kb=this.Kb;a.sa=this.sa;a.pc=this.pc;a.va=this.va;a.lg=this.lg;a.co=this.co;null===this.hg?a.hg=null:a.hg=this.hg.M();a.$n=this.$n;a.ao=this.ao;a.Bj=null;null!==this.Bj&&(a.separatorDashArray=Ja(this.separatorDashArray));a.cc=this.cc;a.Km=this.Km;a.ae=this.ae;return a};t=ck.prototype;t.ub=function(a){a.classType===ck?this.sizing=a:Ea(this,a)}; +t.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+lb(this)};t.Bi=function(a){this.fg=a}; +t.yo=function(a){var b=0,c=this.fg;this.index!==a&&(a=this.separatorStroke,null===a&&null!==c&&(a=this.isRow?c.defaultRowSeparatorStroke:c.defaultColumnSeparatorStroke),null!==a&&(b=this.separatorStrokeWidth,isNaN(b)&&(null!==c?b=this.isRow?c.defaultRowSeparatorStrokeWidth:c.defaultColumnSeparatorStrokeWidth:b=0)));a=this.hg;if(null===a)if(null!==c)a=c.defaultSeparatorPadding;else return b;return b+(this.isRow?a.top:a.left)}; +t.Wc=function(){var a=0,b=this.fg,c=0,d=this.isRow;if(null!==b&&b.type===V.Table)for(var e=d?b.rowDefs.length:b.colDefs.length,f=0;f<e;f++){var g=d?b.rowDefs[f]:b.colDefs[f];if(void 0!==g&&0!==g.sa){c=g.index;break}}this.index!==c&&(c=this.separatorStroke,null===c&&null!==b&&(c=d?b.defaultRowSeparatorStroke:b.defaultColumnSeparatorStroke),null!==c&&(a=this.separatorStrokeWidth,isNaN(a)&&(null!==b?a=d?b.defaultRowSeparatorStrokeWidth:b.defaultColumnSeparatorStrokeWidth:a=0)));d=this.hg;if(null===d)if(null!== +b)d=b.defaultSeparatorPadding;else return a;return a+(this.isRow?d.top+d.bottom:d.left+d.right)};t.Pb=function(a,b,c){var d=this.fg;if(null!==d&&(d.ib(qe,a,this,b,c,void 0,void 0),null!==this.ae&&(b=d.diagram,null!==b&&!b.skipsModelSourceBindings&&(d=d.jh(),null!==d&&(b=d.data,null!==b)))))for(c=this.ae.iterator;c.next();)c.value.ip(this,b,a,d)};function Sm(a){if(a.sizing===Ln){var b=a.fg;return a.isRow?b.rowSizing:b.columnSizing}return a.sizing} +t.bind=function(a,b,c,d){var e=null;"string"===typeof a?e=new Ji(a,b,c,d):e=a;e.yd=this;a=this.panel;null!==a&&(b=a.jh(),null!==b&&Ul(b)&&v("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+e+" on "+a));null===this.ae&&(this.ae=new H);this.ae.add(e);return this}; +oa.Object.defineProperties(ck.prototype,{panel:{configurable:!0,get:function(){return this.fg}},isRow:{configurable:!0,get:function(){return this.jq},set:function(a){this.jq=a}},index:{configurable:!0,get:function(){return this.bb},set:function(a){this.bb=a}},height:{configurable:!0,get:function(){return this.Hc},set:function(a){var b=this.Hc;b!==a&&(G&&A(a,"number",ck,"height"),0>a&&Ba(a,">= 0",ck,"height"),this.Hc=a,this.actual=this.sa,null!== +this.panel&&this.panel.w(),this.Pb("height",b,a))}},width:{configurable:!0,get:function(){return this.Hc},set:function(a){var b=this.Hc;b!==a&&(G&&A(a,"number",ck,"width"),0>a&&Ba(a,">= 0",ck,"width"),this.Hc=a,this.actual=this.sa,null!==this.panel&&this.panel.w(),this.Pb("width",b,a))}},minimum:{configurable:!0,get:function(){return this.rj},set:function(a){var b=this.rj;b!==a&&(G&&A(a,"number",ck,"minimum"),(0>a||!isFinite(a))&&Ba(a,">= 0",ck,"minimum"),this.rj=a,this.actual= +this.sa,null!==this.panel&&this.panel.w(),this.Pb("minimum",b,a))}},maximum:{configurable:!0,get:function(){return this.pj},set:function(a){var b=this.pj;b!==a&&(G&&A(a,"number",ck,"maximum"),0>a&&Ba(a,">= 0",ck,"maximum"),this.pj=a,this.actual=this.sa,null!==this.panel&&this.panel.w(),this.Pb("maximum",b,a))}},alignment:{configurable:!0,get:function(){return this.Kb},set:function(a){var b=this.Kb;b.D(a)||(G&&w(a,Ib,ck,"alignment"),this.Kb=a.M(),null!==this.panel&&this.panel.w(), +this.Pb("alignment",b,a))}},stretch:{configurable:!0,get:function(){return this.lg},set:function(a){var b=this.lg;b!==a&&(G&&ab(a,O,ck,"stretch"),this.lg=a,null!==this.panel&&this.panel.w(),this.Pb("stretch",b,a))}},separatorPadding:{configurable:!0,get:function(){return this.hg},set:function(a){"number"===typeof a?a=new gc(a):null!==a&&G&&w(a,gc,ck,"separatorPadding");var b=this.hg;null!==a&&null!==b&&b.D(a)||(null!==a&&(a=a.M()),this.hg=a,null!==this.panel&&this.panel.w(), +this.Pb("separatorPadding",b,a))}},separatorStroke:{configurable:!0,get:function(){return this.$n},set:function(a){var b=this.$n;b!==a&&(null!==a&&cm(a,"RowColumnDefinition.separatorStroke"),a instanceof Bl&&a.freeze(),this.$n=a,null!==this.panel&&this.panel.w(),this.Pb("separatorStroke",b,a))}},separatorStrokeWidth:{configurable:!0,get:function(){return this.ao},set:function(a){var b=this.ao;b!==a&&(this.ao=a,null!==this.panel&&this.panel.w(),this.Pb("separatorStrokeWidth", +b,a))}},separatorDashArray:{configurable:!0,get:function(){return this.Bj},set:function(a){var b=this.Bj;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",ck,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];"number"===typeof f&&0<=f&&isFinite(f)||v("separatorDashArray value "+f+" at index "+e+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}this.Bj=a;null!==this.panel&&this.panel.R();this.Pb("separatorDashArray", +b,a)}}},background:{configurable:!0,get:function(){return this.cc},set:function(a){var b=this.cc;b!==a&&(null!==a&&cm(a,"RowColumnDefinition.background"),a instanceof Bl&&a.freeze(),this.cc=a,null!==this.panel&&this.panel.R(),this.Pb("background",b,a))}},coversSeparators:{configurable:!0,get:function(){return this.Km},set:function(a){var b=this.Km;b!==a&&(A(a,"boolean",ck,"coversSeparators"),this.Km=a,null!==this.panel&&this.panel.R(),this.Pb("coversSeparators",b,a))}}, +sizing:{configurable:!0,get:function(){return this.co},set:function(a){var b=this.co;b!==a&&(G&&ab(a,ck,ck,"sizing"),this.co=a,null!==this.panel&&this.panel.w(),this.Pb("sizing",b,a))}},actual:{configurable:!0,get:function(){return this.sa},set:function(a){this.sa=isNaN(this.Hc)?Math.max(Math.min(this.pj,a),this.rj):Math.max(Math.min(this.pj,this.Hc),this.rj)}},measured:{configurable:!0,get:function(){return this.pc},set:function(a){this.pc=a}},total:{configurable:!0, +enumerable:!0,get:function(){return this.sa+this.Wc()}},position:{configurable:!0,get:function(){return this.va},set:function(a){this.va=a}}});ck.prototype.computeEffectiveSpacing=ck.prototype.Wc;ck.prototype.computeEffectiveSpacingTop=ck.prototype.yo;var Ln=new F(ck,"Default",0),Tm=new F(ck,"None",1),Kn=new F(ck,"ProportionalExtra",2);ck.className="RowColumnDefinition";ck.Default=Ln;ck.None=Tm;ck.ProportionalExtra=Kn; +function Qf(a,b){O.call(this);this.Od=this.ya=null;this.Wm="None";this.Tc=this.Nk="black";this.mg=1;this.Sa=this.Zg=null;this.Pn=this.On=NaN;this.ka=null;"string"===typeof a?this.figure=a:a&&Object.assign(this,a);b&&Object.assign(this,b)}na(Qf,O); +Qf.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.ya=this.ya;a.Od=this.Od;a.Wm=this.Wm;a.Nk=this.Nk;a.Tc=this.Tc;a.mg=this.mg;null!==this.Zg&&(a.Zg=Ja(this.Zg));null!==this.Sa&&(a.Sa=this.Sa.oc?this.Sa:this.Sa.copy());a.On=this.On;a.Pn=this.Pn;null!==this.ka&&(a.ka=this.ka.copy())};function Mn(a){null===a.Sa?a.Sa=new Nn:a.Sa.oc&&(a.Sa=a.Sa.copy())}t=Qf.prototype;t.th=function(){O.prototype.th.call(this);null!==this.Sa&&(this.Sa.oc=!0)}; +t.ub=function(a){a===yg||a===Ag||a===ll||a===kl?this.geometryStretch=a:O.prototype.ub.call(this,a)};t.toString=function(){return"Shape("+("None"!==this.figure?this.figure:"None"!==this.toArrow?this.toArrow:this.fromArrow)+")#"+lb(this)}; +function On(a,b,c,d){var e=c.length;if(!(4>e)){var f=d.measuredBounds,g=Math.max(1,f.width);f=f.height;for(var h=c[0],k=c[1],l,m,n,p,r,q,u=0,x=Na(),y=2;y<e;y+=2)l=c[y],m=c[y+1],n=l-h,h=m-k,0===n&&(n=.001),p=h/n,r=Math.atan2(h,n),q=Math.sqrt(n*n+h*h),x.push([n,r,p,q]),u+=q,h=l,k=m;h=c[0];k=c[1];n=d.measuredBounds.width;d instanceof Qf&&(n-=d.strokeWidth);1>n&&(n=1);e=c=n;l=g/2;m=0===l?!1:!0;y=0;q=x[y];n=q[0];r=q[1];p=q[2];q=q[3];for(var z=0;.1<=u;){0===z&&(m?(e=c,e-=l,u-=l,m=!1):e=c,0===e&&(e=1)); +if(e>u){Pa(x);return}e>q?(z=e-q,e=q):z=0;var B=Math.sqrt(e*e/(1+p*p));0>n&&(B=-B);h+=B;k+=p*B;a.translate(h,k);a.rotate(r);a.translate(-(g/2),-(f/2));0===z&&d.mi(a,b);a.translate(g/2,f/2);a.rotate(-r);a.translate(-h,-k);u-=e;q-=e;if(0!==z){y++;if(y===x.length){Pa(x);return}q=x[y];n=q[0];r=q[1];p=q[2];q=q[3];e=z}}Pa(x)}} +t.mi=function(a,b){var c=this.Tc,d=this.Nk;if(null!==c||null!==d){var e=this.ya;if(null!==e){a.Vc();var f=this.actualBounds,g=this.naturalBounds;null!==d&&ti(this,a,d,!0,!1,g,f);var h=this.part,k=this.mg;null===c||0!==k||null===h||!this.isPanelMain&&h.Ab()!==this||(k=h.type===V.Link&&h instanceof Ce&&"Selection"===h.category&&h.adornedObject instanceof Qf&&h.adornedPart.Ab()===h.adornedObject?h.adornedObject.strokeWidth:0);0===k&&(c=null);null!==c&&0!==k&&(ti(this,a,c,!1,!1,g,f),a.lineWidth=k,a.lineJoin= +this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit);f=!1;h&&b.Te("drawShadows")&&(f=h.isShadowed);h=!0;null===c||null!==d&&"transparent"!==d||(h=!1);g=!1;k=this.strokeDashArray;null!==k&&(g=!0,a.Tr(k,this.strokeDashOffset));if(e.type===N.j)a.beginPath(),a.moveTo(e.startX,e.startY),a.lineTo(e.endX,e.endY),null!==c&&a.Fi();else if(e.type===N.v){var l=e.startX;k=e.startY;var m=e.endX,n=e.endY;e=Math.min(l,m);var p=Math.min(k,n);l=Math.abs(m-l);k=Math.abs(n-k);a.beginPath();a.rect(e, +p,l,k);null!==d&&a.Ef(d);if(null!==c){h&&f&&Fl(a);if(0===l||0===k)a.beginPath(),a.rect(e,p,Math.max(l,.1),Math.max(k,.1));a.Fi();h&&f&&El(a)}}else if(e.type===N.G)l=e.startX,k=e.startY,m=e.endX,n=e.endY,e=Math.abs(m-l)/2,p=Math.abs(n-k)/2,l=Math.min(l,m)+e,k=Math.min(k,n)+p,a.beginPath(),a.moveTo(l,k-p),a.bezierCurveTo(l+L.zg*e,k-p,l+e,k-L.zg*p,l+e,k),a.bezierCurveTo(l+e,k+L.zg*p,l+L.zg*e,k+p,l,k+p),a.bezierCurveTo(l-L.zg*e,k+p,l-e,k+L.zg*p,l-e,k),a.bezierCurveTo(l-e,k-L.zg*p,l-L.zg*e,k-p,l,k-p), +a.closePath(),null!==d&&a.Ef(d),null!==c&&(h&&f?(Fl(a),a.Fi(),El(a)):a.Fi());else if(e.type===N.m)for(e=e.figures,k=e.length,p=0;p<k;p++){l=e.s[p];a.beginPath();a.moveTo(l.startX,l.startY);m=l.segments.s;n=m.length;for(var r=null,q=0;q<n;q++){var u=m[q];switch(u.type){case Wd:a.moveTo(u.endX,u.endY);break;case Dd:a.lineTo(u.endX,u.endY);break;case Xd:a.bezierCurveTo(u.point1X,u.point1Y,u.point2X,u.point2Y,u.endX,u.endY);break;case Yd:a.quadraticCurveTo(u.point1X,u.point1Y,u.endX,u.endY);break;case Zd:if(u.radiusX=== +u.radiusY){var x=Math.PI/180;a.arc(u.point1X,u.point1Y,u.radiusX,u.startAngle*x,(u.startAngle+u.sweepAngle)*x,0>u.sweepAngle,null!==r?r.endX:l.startX,null!==r?r.endY:l.startY)}else if(r=ae(u,l),x=r.length,0===x)a.lineTo(u.centerX,u.centerY);else for(var y=0;y<x;y++){var z=r[y];0===y&&a.lineTo(z[0],z[1]);a.bezierCurveTo(z[2],z[3],z[4],z[5],z[6],z[7])}break;case $d:y=x=0;if(null!==r&&r.type===Zd){r=ae(r,l);z=r.length;if(0===z){a.lineTo(u.endX,u.endY);break}r=r[z-1]||null;null!==r&&(x=r[6],y=r[7])}else x= +null!==r?r.endX:l.startX,y=null!==r?r.endY:l.startY;r=be(u,l,x,y);x=r.length;if(0===x){a.lineTo(u.endX,u.endY);break}for(y=0;y<x;y++)z=r[y],a.bezierCurveTo(z[2],z[3],z[4],z[5],z[6],z[7]);break;default:v("Segment not of valid type: "+u.type)}u.isClosed&&a.closePath();r=u}m=l.isFilled;f?l.isShadowed?(!0===m&&"transparent"!==d&&null!==d&&a.Ef(d),null!==c&&(m&&h&&Fl(a),a.Fi(),m&&h&&El(a))):(Fl(a),m&&"transparent"!==d&&null!==d&&a.Ef(d),null!==c&&a.Fi(),El(a)):(m&&null!==d&&a.Ef(d),null!==c&&a.Fi())}g&& +a.Rr();if(null!==this.pathPattern){c=this.pathPattern;c.measure(Infinity,Infinity);d=c.measuredBounds;c.arrange(0,0,d.width,d.height);f=this.geometry;a.save();a.beginPath();d=Na();if(f.type===N.j)d.push(f.startX),d.push(f.startY),d.push(f.endX),d.push(f.endY),On(a,b,d,c);else if(f.type===N.m)for(f=f.figures.iterator;f.next();){h=f.value;d.length=0;d.push(h.startX);d.push(h.startY);g=h.startX;e=h.startY;k=g;p=e;l=h.segments.s;m=l.length;for(n=0;n<m;n++){q=l[n];switch(q.type){case Wd:On(a,b,d,c);d.length= +0;d.push(q.endX);d.push(q.endY);g=q.endX;e=q.endY;k=g;p=e;break;case Dd:d.push(q.endX);d.push(q.endY);g=q.endX;e=q.endY;break;case Xd:L.Qe(g,e,q.point1X,q.point1Y,q.point2X,q.point2Y,q.endX,q.endY,.5,d);g=q.endX;e=q.endY;break;case Yd:L.To(g,e,q.point1X,q.point1Y,q.endX,q.endY,.5,d);g=q.endX;e=q.endY;break;case Zd:u=ae(q,h);r=u.length;if(0===r){d.push(q.centerX);d.push(q.centerY);g=q.centerX;e=q.centerY;break}for(x=0;x<r;x++)y=u[x],L.Qe(g,e,y[2],y[3],y[4],y[5],y[6],y[7],.5,d),g=y[6],e=y[7];break; +case $d:u=be(q,h,g,e);r=u.length;if(0===r){d.push(q.endX);d.push(q.endY);g=q.endX;e=q.endY;break}for(x=0;x<r;x++)y=u[x],L.Qe(g,e,y[2],y[3],y[4],y[5],y[6],y[7],.5,d),g=y[6],e=y[7];break;default:v("Segment not of valid type: "+q.type)}q.isClosed&&(d.push(k),d.push(p),On(a,b,d,c))}On(a,b,d,c)}else if(f.type===N.v)d.push(f.startX),d.push(f.startY),d.push(f.endX),d.push(f.startY),d.push(f.endX),d.push(f.endY),d.push(f.startX),d.push(f.endY),d.push(f.startX),d.push(f.startY),On(a,b,d,c);else if(f.type=== +N.G){e=new je;e.startX=f.endX;e.startY=(f.startY+f.endY)/2;g=new ke(Zd);g.startAngle=0;g.sweepAngle=360;g.centerX=(f.startX+f.endX)/2;g.centerY=(f.startY+f.endY)/2;g.radiusX=Math.abs(f.startX-f.endX)/2;g.radiusY=Math.abs(f.startY-f.endY)/2;e.add(g);f=ae(g,e);h=f.length;if(0===h)d.push(g.centerX),d.push(g.centerY);else for(g=e.startX,e=e.startY,k=0;k<h;k++)p=f[k],L.Qe(g,e,p[2],p[3],p[4],p[5],p[6],p[7],.5,d),g=p[6],e=p[7];On(a,b,d,c)}Pa(d);a.restore();a.Uc(!1)}}}}; +t.oa=function(a,b){void 0===b&&(b=new K);if(a instanceof Ib){a.kc()&&v("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.naturalBounds,d=this.strokeWidth;b.h(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY)}else b.set(a);this.oe.La(b);return b}; +t.ti=function(a){void 0===a&&(a=new M);var b=this.naturalBounds,c=this.oe;b=M.allocAt(b.x,b.y,b.width,b.height);var d=this.strokeWidth;b.Bc(d/2,d/2);d=K.allocAt(b.x,b.y).transform(c);a.h(d.x,d.y,0,0);d.h(b.right,b.y).transform(c);lc(a,d.x,d.y,0,0);d.h(b.right,b.bottom).transform(c);lc(a,d.x,d.y,0,0);d.h(b.x,b.bottom).transform(c);lc(a,d.x,d.y,0,0);M.free(b);K.free(d);return a}; +t.ih=function(a,b){var c=this.geometry;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.bounds,e=this.strokeWidth/2;c.type!==N.j||b||(e+=2);var f=M.alloc();f.assign(d);f.Bc(e+2,e+2);if(!f.ga(a))return M.free(f),!1;d=e+1E-4;if(c.type===N.j){if(null===this.stroke)return!1;d=(c.endX-c.startX)*(a.x-c.startX)+(c.endY-c.startY)*(a.y-c.startY);if(0>(c.startX-c.endX)*(a.x-c.endX)+(c.startY-c.endY)*(a.y-c.endY)||0>d)return!1;M.free(f);return L.Yb(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type=== +N.v){b=c.startX;var g=c.startY,h=c.endX;c=c.endY;f.x=Math.min(b,h);f.y=Math.min(g,c);f.width=Math.abs(h-b);f.height=Math.abs(c-g);if(null===this.fill){f.Bc(-d,-d);if(f.ga(a))return M.free(f),!1;f.Bc(d,d)}null!==this.stroke&&f.Bc(e,e);a=f.ga(a);M.free(f);return a}if(c.type===N.G){g=c.startX;e=c.startY;h=c.endX;var k=c.endY;c=Math.min(g,h);b=Math.min(e,k);g=Math.abs(h-g)/2;e=Math.abs(k-e)/2;c=a.x-(c+g);b=a.y-(b+e);if(null===this.fill){g-=d;e-=d;if(0>=g||0>=e||1>=c*c/(g*g)+b*b/(e*e))return M.free(f), +!1;g+=d;e+=d}null!==this.stroke&&(g+=d,e+=d);M.free(f);return 0>=g||0>=e?!1:1>=c*c/(g*g)+b*b/(e*e)}if(c.type===N.m)return M.free(f),null===this.fill?he(c,a.x,a.y,e):fe(c,a,e,1<this.strokeWidth,b);v("Unknown Geometry type: "+c.type)}; +t.Sl=function(a,b,c,d){var e=this.desiredSize,f=this.mg;a=Math.max(a,0);b=Math.max(b,0);if(null!==this.Od)var g=this.geometry.bounds;else{var h=this.figure,k=Pn[h];if(void 0===k){var l=L.te[h];"string"===typeof l&&(l=L.te[l]);"function"===typeof l?(k=l(null,100,100),Pn[h]=k):v("Unsupported Figure: "+h)}g=k.bounds}h=g.width;k=g.height;l=g.width;var m=g.height;switch(wl(this,!0)){case yg:d=c=0;break;case Bd:l=Math.max(a-f,0);m=Math.max(b-f,0);break;case il:l=Math.max(a-f,0);d=0;break;case jl:c=0,m= +Math.max(b-f,0)}isFinite(e.width)&&(l=e.width);isFinite(e.height)&&(m=e.height);g=this.maxSize;var n=this.minSize;c=Math.max(c-f,n.width);d=Math.max(d-f,n.height);l=Math.min(g.width,l);m=Math.min(g.height,m);l=isFinite(l)?Math.max(c,l):Math.max(h,c);m=isFinite(m)?Math.max(d,m):Math.max(k,d);c=zg(this);switch(c){case yg:break;case Bd:h=l;k=m;break;case Ag:c=Math.min(l/h,m/k);isFinite(c)||(c=1);h*=c;k*=c;break;default:v(c+" is not a valid geometryStretch.")}null!==this.Od?(0===h&&(h=.001),0===k&&(k= +.001),c=null!==this.Od?this.Od:this.ya,g=c.bounds,d=h/g.width,g=k/g.height,isFinite(d)||(d=1),isFinite(g)||(g=1),c=1===d&&1===g?c:c.copy().scale(d,g),G&&c.freeze(),this.ya=c):null!==this.ya&&L.ha(this.ya.Uk,a-f)&&L.ha(this.ya.Tk,b-f)||(this.ya=Qf.makeGeometry(this,h,k));g=this.ya.bounds;Infinity===a||Infinity===b?this.Ge(g.x-f/2,g.y-f/2,0===a&&0===h?0:g.width+f,0===b&&0===k?0:g.height+f):this.Ge(-(f/2),-(f/2),l+f,m+f);e.u()?this.gc.h(0,0,e.width,e.height):this.gc.assign(g)}; +function zg(a){var b=a.geometryStretch;return null!==a.Od?b===kl?Bd:b:b===kl?Pn[a.figure].defaultStretch:b}t.gh=function(a,b,c,d){yl(this,a,b,c,d)};t.bs=function(a,b,c){return this.Xj(a.x,a.y,b.x,b.y,c)}; +t.Xj=function(a,b,c,d,e){var f=this.transform,g=1/(f.m11*f.m22-f.m12*f.m21),h=f.m22*g,k=-f.m12*g,l=-f.m21*g,m=f.m11*g,n=g*(f.m21*f.dy-f.m22*f.dx),p=g*(f.m12*f.dx-f.m11*f.dy);f=a*h+b*l+n;g=a*k+b*m+p;h=c*h+d*l+n;k=c*k+d*m+p;n=this.mg/2;l=this.ya;null===l&&(this.measure(Infinity,Infinity),l=this.ya);var r=l.bounds;m=!1;if(l.type===N.j)if(1.5>=this.strokeWidth)m=L.We(l.startX,l.startY,l.endX,l.endY,f,g,h,k,e);else{l.startX===l.endX?(d=n,m=0):(b=(l.endY-l.startY)/(l.endX-l.startX),m=n/Math.sqrt(1+b*b), +d=m*b);b=Na();a=new K;L.We(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new K;L.We(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new K;L.We(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new K;L.We(l.endX+d,l.endY+m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);h=b.length;if(0===h)return Pa(b),!1;m=!0;k=Infinity;for(d=0;d<h;d++)a=b[d],c=(a.x-f)*(a.x-f)+(a.y-g)*(a.y-g),c<k&&(k=c,e.x=a.x,e.y=a.y);Pa(b)}else if(l.type===N.v)m=L.If(r.x-n,r.y-n,r.x+r.width+ +n,r.y+r.height+n,f,g,h,k,e);else if(l.type===N.G){b=M.allocAt(r.x,r.y,r.width,r.height).Bc(n,n);a:if(0===b.width)m=L.We(b.x,b.y,b.x,b.y+b.height,f,g,h,k,e);else if(0===b.height)m=L.We(b.x,b.y,b.x+b.width,b.y,f,g,h,k,e);else{a=b.width/2;l=b.height/2;d=b.x+a;m=b.y+l;c=9999;f!==h&&(c=(g-k)/(f-h));if(9999>Math.abs(c)){k=g-m-c*(f-d);if(0>a*a*c*c+l*l-k*k){e.x=NaN;e.y=NaN;m=!1;break a}n=Math.sqrt(a*a*c*c+l*l-k*k);h=(-(a*a*c*k)+a*l*n)/(l*l+a*a*c*c)+d;a=(-(a*a*c*k)-a*l*n)/(l*l+a*a*c*c)+d;l=c*(h-d)+k+m;k=c* +(a-d)+k+m;Math.abs((f-h)*(f-h))+Math.abs((g-l)*(g-l))<Math.abs((f-a)*(f-a))+Math.abs((g-k)*(g-k))?(e.x=h,e.y=l):(e.x=a,e.y=k)}else{h=l*l;k=f-d;h-=h/(a*a)*k*k;if(0>h){e.x=NaN;e.y=NaN;m=!1;break a}k=Math.sqrt(h);h=m+k;k=m-k;Math.abs(h-g)<Math.abs(k-g)?(e.x=f,e.y=h):(e.x=f,e.y=k)}m=!0}M.free(b)}else if(l.type===N.m){p=K.alloc();var q=h-f;var u=k-g,x=q*q+u*u,y=f,z=g;if(0<x&&r.contains(y,z)&&(p.x=y,p.y=z,this.ga(p)))for(0!==q&&.5>Math.abs(q)?(u*=.5/q,q=.5):0!==u&&.5>Math.abs(u)&&(q*=.5/u,u=.5),y-=q,z-= +u;r.contains(y,z);)y-=q,z-=u;e.x=h;e.y=k;for(u=0;u<l.figures.count;u++){var B=l.figures.s[u],C=B.isFilled?y:f,D=B.isFilled?z:g,J=B.segments;r=B.startX;q=B.startY;for(var U=r,aa=q,Y=0;Y<J.count;Y++){var W=J.s[Y],Q=W.type;var la=W.endX;var fa=W.endY;var za=!1;switch(Q){case Wd:U=la;aa=fa;break;case Dd:za=Qn(r,q,la,fa,C,D,h,k,p);break;case Xd:za=L.uo(r,q,W.point1X,W.point1Y,W.point2X,W.point2Y,la,fa,C,D,h,k,.6,p);break;case Yd:za=L.uo(r,q,r+2/3*(W.point1X-r),q+2/3*(W.point1Y-q),la+2/3*(W.point1X-la), +fa+2/3*(W.point1Y-fa),la,fa,C,D,h,k,.6,p);break;case Zd:case $d:Q=W.type===Zd?ae(W,B):be(W,B,r,q);var Ma=Q.length;if(0===Ma){za=Qn(r,q,W.type===Zd?W.centerX:W.endX,W.type===Zd?W.centerY:W.endY,C,D,h,k,p);break}fa=null;for(la=0;la<Ma;la++){fa=Q[la];if(0===la&&Qn(r,q,fa[0],fa[1],C,D,h,k,p)){var sb=Rn(C,D,p,x,e);sb<x&&(x=sb,m=!0)}L.uo(fa[0],fa[1],fa[2],fa[3],fa[4],fa[5],fa[6],fa[7],C,D,h,k,.6,p)&&(sb=Rn(C,D,p,x,e),sb<x&&(x=sb,m=!0))}la=fa[6];fa=fa[7];break;default:v("Unknown Segment type: "+Q)}r=la; +q=fa;za&&(za=Rn(C,D,p,x,e),za<x&&(x=za,m=!0));W.isClosed&&(la=U,fa=aa,Qn(r,q,la,fa,C,D,h,k,p)&&(W=Rn(C,D,p,x,e),W<x&&(x=W,m=!0)))}}f=c-a;g=d-b;h=Math.sqrt(f*f+g*g);0!==h&&(f/=h,g/=h);e.x-=f*n;e.y-=g*n;K.free(p)}else v("Unknown Geometry type: "+l.type);if(!m)return!1;this.transform.La(e);return!0};function Rn(a,b,c,d,e){a=c.x-a;b=c.y-b;b=a*a+b*b;return b<d?(e.x=c.x,e.y=c.y,b):d} +function Qn(a,b,c,d,e,f,g,h,k){var l=!1,m=(e-g)*(b-d)-(f-h)*(a-c);if(0===m)return!1;k.x=((e*h-f*g)*(a-c)-(e-g)*(a*d-b*c))/m;k.y=((e*h-f*g)*(b-d)-(f-h)*(a*d-b*c))/m;(a>c?a-c:c-a)<(b>d?b-d:d-b)?(a=b<d?b:d,b=b<d?d:b,(k.y>a||L.ha(k.y,a))&&(k.y<b||L.ha(k.y,b))&&(l=!0)):(b=a<c?a:c,a=a<c?c:a,(k.x>b||L.ha(k.x,b))&&(k.x<a||L.ha(k.x,a))&&(l=!0));return l} +t.hh=function(a,b){if(void 0===b)return a.Re(this.actualBounds);var c=this.ya;null===c&&(this.measure(Infinity,Infinity),c=this.ya);c=c.bounds;var d=this.strokeWidth/2,e=!1,f=K.alloc();f.h(c.x-d,c.y-d);a.ga(b.La(f))&&(f.h(c.x-d,c.bottom+d),a.ga(b.La(f))&&(f.h(c.right+d,c.bottom+d),a.ga(b.La(f))&&(f.h(c.right+d,c.y-d),a.ga(b.La(f))&&(e=!0))));K.free(f);return e}; +t.Yc=function(a,b){if(this.hh(a,b)||void 0===b&&(b=this.transform,a.Re(this.actualBounds)))return!0;var c=Jb.alloc();c.set(b);c.gs();var d=a.left,e=a.right,f=a.top;a=a.bottom;var g=K.alloc();g.h(d,f);c.La(g);if(this.ih(g,!0))return K.free(g),!0;g.h(e,f);c.La(g);if(this.ih(g,!0))return K.free(g),!0;g.h(d,a);c.La(g);if(this.ih(g,!0))return K.free(g),!0;g.h(e,a);c.La(g);if(this.ih(g,!0))return K.free(g),!0;var h=K.alloc(),k=K.alloc();c.set(b);c.bv(this.transform);c.gs();h.x=e;h.y=f;h.transform(c);g.x= +d;g.y=f;g.transform(c);b=!1;Sn(this,g,h,k)?b=!0:(g.x=e,g.y=a,g.transform(c),Sn(this,g,h,k)?b=!0:(h.x=d,h.y=a,h.transform(c),Sn(this,g,h,k)?b=!0:(g.x=d,g.y=f,g.transform(c),Sn(this,g,h,k)&&(b=!0))));K.free(g);Jb.free(c);K.free(h);K.free(k);return b};function Sn(a,b,c,d){if(!a.bs(b,c,d))return!1;a=b.x;b=b.y;var e=c.x,f=c.y;c=d.x;d=d.y;if(a===e)return b<f?(a=b,b=f):a=f,d>=a&&d<=b;a<e?(d=a,a=e):d=e;return c>=d&&c<=a} +t.mx=function(a,b,c){function d(a,b){for(var c=a.length,d=0;d<c;d+=2)if(b.zd(a[d],a[d+1])>e)return!0;return!1}if(c&&null!==this.fill&&this.ih(a,!0))return!0;var e=a.Df(b),f=e;1.5<this.strokeWidth&&(e=this.strokeWidth/2+Math.sqrt(e),e*=e);b=this.ya;if(null===b&&(this.measure(Infinity,Infinity),b=this.ya,null===b))return!1;if(!c){var g=b.bounds,h=g.x,k=g.y,l=g.x+g.width;g=g.y+g.height;if(Mb(a.x,a.y,h,k)<=e&&Mb(a.x,a.y,l,k)<=e&&Mb(a.x,a.y,h,g)<=e&&Mb(a.x,a.y,l,g)<=e)return!0}h=b.startX;k=b.startY;l= +b.endX;g=b.endY;if(b.type===N.j){if(c=Lb(a.x,a.y,h,k,l,g),b=(h-l)*(a.x-l)+(k-g)*(a.y-g),c<=(0<=(l-h)*(a.x-h)+(g-k)*(a.y-k)&&0<=b?e:f))return!0}else{if(b.type===N.v)return b=!1,c&&(b=Lb(a.x,a.y,h,k,h,g)<=e||Lb(a.x,a.y,h,k,l,k)<=e||Lb(a.x,a.y,l,k,l,g)<=e||Lb(a.x,a.y,h,g,l,g)<=e),b;if(b.type===N.G){b=a.x-(h+l)/2;f=a.y-(k+g)/2;var m=Math.abs(l-h)/2,n=Math.abs(g-k)/2;if(0===m||0===n)return Lb(a.x,a.y,h,k,l,g)<=e?!0:!1;if(c){if(a=L.Yy(m,n,b,f),a*a<=e)return!0}else return Mb(b,f,-m,0)>=e||Mb(b,f,0,-n)>= +e||Mb(b,f,0,n)>=e||Mb(b,f,m,0)>=e?!1:!0}else if(b.type===N.m){l=b.bounds;f=l.x;h=l.y;k=l.x+l.width;l=l.y+l.height;if(a.x>k&&a.x<f&&a.y>l&&a.y<h&&Lb(a.x,a.y,f,h,f,l)>e&&Lb(a.x,a.y,f,h,k,h)>e&&Lb(a.x,a.y,k,l,f,l)>e&&Lb(a.x,a.y,k,l,k,h)>e)return!1;f=Math.sqrt(e);if(c){if(null===this.fill?he(b,a.x,a.y,f):fe(b,a,f,!0,!1))return!0}else{c=b.figures;for(b=0;b<c.count;b++){f=c.s[b];g=f.startX;m=f.startY;if(a.zd(g,m)>e)return!1;h=f.segments.s;k=h.length;for(l=0;l<k;l++)switch(n=h[l],n.type){case Wd:case Dd:g= +n.endX;m=n.endY;if(a.zd(g,m)>e)return!1;break;case Xd:var p=Na();L.Qe(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Pa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.zd(g,m)>e)return!1;break;case Yd:p=Na();L.To(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Pa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.zd(g,m)>e)return!1;break;case Zd:case $d:p=n.type===Zd?ae(n,f):be(n,f,g,m);var r=p.length;if(0===r){g=n.type===Zd?n.centerX:n.endX;m=n.type===Zd?n.centerY:n.endY;if(a.zd(g,m)> +e)return!1;break}n=null;for(var q=Na(),u=0;u<r;u++)if(n=p[u],q.length=0,L.Qe(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],.8,q),d(q,a))return Pa(q),!1;Pa(q);null!==n&&(g=n[6],m=n[7]);break;default:v("Unknown Segment type: "+n.type)}}return!0}}}return!1};t.sc=function(){this.ya=null};t.fw=function(){return this.mg}; +function Tn(a){var b=a.diagram;null!==b&&b.undoManager.isUndoingRedoing||(a.segmentOrientation=hn,"None"!==a.toArrow?(a.segmentIndex=-1,a.alignmentFocus=qd):"None"!==a.fromArrow&&(a.segmentIndex=0,a.alignmentFocus=new Ib(1-qd.x,qd.y)))} +Qf.makeGeometry=function(a,b,c){if("None"!==a.toArrow)var d=Un[a.toArrow];else"None"!==a.fromArrow?d=Un[a.fromArrow]:(d=L.te[a.figure],"string"===typeof d&&(d=L.te[d]),void 0===d&&v("Unknown Shape.figure: "+a.figure),d=d(a,b,c),d.Uk=b,d.Tk=c);if(null===d){var e=L.te.Rectangle;"function"===typeof e&&(d=e(a,b,c))}G&&(d.bounds.width>b+1E-5||d.bounds.height>c+1E-5)&&v('Geometry made with figure "'+a.figure+'" has bounds '+d.bounds.toString()+" that are too large for the given size ("+b+","+c+"). See documentation for Shape.defineFigureGenerator."); +return d};function Vn(a){var b=Un[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=Un[c];if(void 0===b){var d=null,e;for(e in L.qm)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=N.parse(L.qm[d],!1),Un[d]=a,c!==d&&(Un[c]=d),d}}return"string"===typeof b?b:b instanceof N?a:null} +oa.Object.defineProperties(Qf.prototype,{geometry:{configurable:!0,get:function(){return null!==this.ya?this.ya:this.Od},set:function(a){var b=this.ya,c=this.Od;if(b!==a){null!==a?(G&&w(a,N,Qf,"geometry"),this.Od=this.ya=a.freeze()):this.Od=this.ya=null;var d=this.part;null!==d&&(d.dg=NaN);this.w();this.g("geometry",b||c,a);sl(this)&&(a=this.part,null!==a&&tl(this,a,"geometryString"))}}},geometryString:{configurable:!0,get:function(){return null===this.geometry?"":this.geometry.toString()}, +set:function(a){a=N.parse(a);var b=a.normalize();this.geometry=a;this.position=a=K.allocAt(-b.x,-b.y);K.free(a)}},isGeometryPositioned:{configurable:!0,get:function(){return 0!==(this.o&1048576)},set:function(a){G&&A(a,"boolean",Qf,"isGeometryPositioned");var b=0!==(this.o&1048576);b!==a&&(G&&A(a,"boolean",Qf,"isGeometryPositioned"),this.o^=1048576,this.w(),this.g("isGeometryPositioned",b,a))}},fill:{configurable:!0,get:function(){return this.Nk},set:function(a){var b= +this.Nk;b!==a&&(null!==a&&cm(a,"Shape.fill"),a instanceof Bl&&a.freeze(),this.Nk=a,this.R(),this.g("fill",b,a))}},stroke:{configurable:!0,get:function(){return this.Tc},set:function(a){var b=this.Tc;b!==a&&(null!==a&&cm(a,"Shape.stroke"),a instanceof Bl&&a.freeze(),this.Tc=a,this.R(),this.g("stroke",b,a))}},strokeWidth:{configurable:!0,get:function(){return this.mg},set:function(a){var b=this.mg;if(b!==a)if(G&&E(a,Qf,"strokeWidth"),0<=a){this.mg=a;this.w();var c=this.part; +null!==c&&(c.dg=NaN);this.g("strokeWidth",b,a)}else Ba(a,"value >= 0",Qf,"strokeWidth:value")}},strokeCap:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.rr:"butt"},set:function(a){var b=this.strokeCap;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?Ba(a,'"butt", "round", or "square"',Qf,"strokeCap"):(Mn(this),this.Sa.rr=a,this.R(),this.g("strokeCap",b,a)))}},strokeJoin:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.sr:"miter"}, +set:function(a){var b=this.strokeJoin;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?Ba(a,'"miter", "bevel", or "round"',Qf,"strokeJoin"):(Mn(this),this.Sa.sr=a,this.R(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.tr:10},set:function(a){var b=this.strokeMiterLimit;if(b!==a)if(G&&E(a,Qf,"strokeMiterLimit"),1<=a){Mn(this);this.Sa.tr=a;this.R();var c=this.part;null!==c&&(c.dg=NaN);this.g("strokeMiterLimit", +b,a)}else G&&Ba(a,"value >= 1",Qf,"strokeWidth:value")}},strokeDashArray:{configurable:!0,get:function(){return this.Zg},set:function(a){var b=this.Zg;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",Qf,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];(!G||"number"===typeof f)&&0<=f&&isFinite(f)||v("strokeDashArray:value "+f+" at index "+e+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}this.Zg=a;this.R();this.g("strokeDashArray", +b,a)}}},strokeDashOffset:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.Cj:0},set:function(a){var b=this.strokeDashOffset;b!==a&&(G&&E(a,Qf,"strokeDashOffset"),0<=a&&(Mn(this),this.Sa.Cj=a,this.R(),this.g("strokeDashOffset",b,a)))}},figure:{configurable:!0,get:function(){return this.Wm},set:function(a){var b=this.Wm;if(b!==a){G&&A(a,"string",Qf,"figure");var c=L.te[a];"function"===typeof c?c=a:(c=L.te[a.toLowerCase()])||v("Unknown Shape.figure: "+a);b!== +c&&(a=this.part,null!==a&&(a.dg=NaN),this.Wm=c,this.Od=null,this.sc(),this.w(),this.g("figure",b,c))}}},toArrow:{configurable:!0,get:function(){return null!==this.Wa?this.Wa.$:"None"},set:function(a){var b=this.toArrow;!0===a?a="Standard":!1===a&&(a="");if(b!==a){G&&A(a,"string",Qf,"toArrow");var c=Vn(a);null===c?v("Unknown Shape.toArrow: "+a):b!==c&&(null===this.Wa&&(this.Wa=new bm),this.Wa.$=c,this.Od=null,this.sc(),this.w(),Tn(this),this.g("toArrow",b,c))}}},fromArrow:{configurable:!0, +enumerable:!0,get:function(){return null!==this.Wa?this.Wa.j:"None"},set:function(a){var b=this.fromArrow;!0===a?a="Standard":!1===a&&(a="");if(b!==a){G&&A(a,"string",Qf,"fromArrow");var c=Vn(a);null===c?v("Unknown Shape.fromArrow: "+a):b!==c&&(null===this.Wa&&(this.Wa=new bm),this.Wa.j=c,this.Od=null,this.sc(),this.w(),Tn(this),this.g("fromArrow",b,c))}}},spot1:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.jg:hd},set:function(a){w(a,Ib,Qf,"spot1");var b=this.spot1;b.D(a)|| +(a=a.M(),Mn(this),this.Sa.jg=a,this.w(),this.g("spot1",b,a))}},spot2:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.kg:hd},set:function(a){w(a,Ib,Qf,"spot2");var b=this.spot2;b.D(a)||(a=a.M(),Mn(this),this.Sa.kg=a,this.w(),this.g("spot2",b,a))}},parameter1:{configurable:!0,get:function(){return this.On},set:function(a){var b=this.On;b!==a&&(this.On=a,this.sc(),this.w(),this.g("parameter1",b,a))}},parameter2:{configurable:!0,get:function(){return this.Pn}, +set:function(a){var b=this.Pn;b!==a&&(this.Pn=a,this.sc(),this.w(),this.g("parameter2",b,a))}},naturalBounds:{configurable:!0,get:function(){return this.gc}},pathPattern:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.Nq:null},set:function(a){var b=this.pathPattern;b!==a&&(G&&null!==a&&w(a,O,Qf,"pathPattern"),Mn(this),this.Sa.Nq=a,this.R(),this.g("pathPattern",b,a))}},geometryStretch:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.Zp: +kl},set:function(a){var b=this.geometryStretch;b!==a&&(ab(a,O,Qf,"geometryStretch"),Mn(this),this.Sa.Zp=a,this.w(),this.g("geometryStretch",b,a))}},interval:{configurable:!0,get:function(){return null!==this.ka?this.ka.Vk:1},set:function(a){var b=this.interval;G&&E(a,Qf,"interval");a=Math.round(a);if(b!==a&&0!==a&&isFinite(a)){null===this.ka&&(this.ka=new Wn);this.ka.Vk=a;var c=this.diagram;null!==c&&this.panel===c.grid&&xj(c);this.w();c=this.panel;null!==c&&(c.graduatedIntervals=null); +this.g("interval",b,a)}}},graduatedStart:{configurable:!0,get:function(){return null!==this.ka?this.ka.v:0},set:function(a){var b=this.graduatedStart;G&&E(a,Qf,"graduatedStart");b!==a&&(0>a?a=0:1<a&&(a=1),null===this.ka&&(this.ka=new Wn),this.ka.v=a,this.w(),this.g("graduatedStart",b,a))}},graduatedEnd:{configurable:!0,get:function(){return null!==this.ka?this.ka.j:1},set:function(a){var b=this.graduatedEnd;G&&E(a,Qf,"graduatedEnd");b!==a&&(0>a?a=0:1<a&&(a=1),null===this.ka&& +(this.ka=new Wn),this.ka.j=a,this.w(),this.g("graduatedEnd",b,a))}},graduatedSkip:{configurable:!0,get:function(){return null!==this.ka?this.ka.m:null},set:function(a){var b=this.graduatedSkip;b!==a&&(null!==a&&A(a,"function",Qf,"graduatedSkip"),null===this.ka&&(this.ka=new Wn),this.ka.m=a,this.w(),this.g("graduatedSkip",b,a))}}});Qf.prototype.intersectsRect=Qf.prototype.Yc;Qf.prototype.containedInRect=Qf.prototype.hh;Qf.prototype.getNearestIntersectionPoint=Qf.prototype.bs; +Qf.prototype.getDocumentBounds=Qf.prototype.ti;Qf.prototype.getDocumentPoint=Qf.prototype.oa;var Un=new db,Pn=new db;Qf.className="Shape";Qf.getFigureGenerators=function(){var a=new yb,b;for(b in L.te)b!==b.toLowerCase()&&a.add(b,L.te[b]);a.freeze();return a}; +Qf.defineFigureGenerator=function(a,b){A(a,"string",Qf,"defineFigureGenerator:name");"string"===typeof b?!G||""!==b&&L.te[b]||v("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+b):A(b,"function",Qf,"defineFigureGenerator:func");var c=a.toLowerCase();!G||""!==a&&a!==c||v("Shape.defineFigureGenerator name must not be empty or all-lower-case: "+a);var d=L.te;d[a]=b;d[c]=a}; +Qf.getArrowheadGeometries=function(){var a=new yb;for(d in L.qm)if(void 0===Un[d]){var b=N.parse(L.qm[d],!1);Un[d]=b;b=d.toLowerCase();b!==d&&(Un[b]=d)}for(var c in Un)if(c!==c.toLowerCase()){var d=Un[c];d instanceof N&&a.add(c,d)}a.freeze();return a}; +Qf.defineArrowheadGeometry=function(a,b){A(a,"string",Qf,"defineArrowheadGeometry:name");"string"===typeof b?(A(b,"string",Qf,"defineArrowheadGeometry:pathstr"),b=N.parse(b,!1)):w(b,N,Qf,"defineArrowheadGeometry:pathstr");var c=a.toLowerCase();(G&&""===a||"none"===c||a===c)&&v("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var d=Un;d[a]=b;d[c]=a}; +function Nn(){this.oc=!1;this.rr="butt";this.sr="miter";this.tr=10;this.Cj=0;this.Nq=null;this.Zp=kl;this.kg=this.jg=hd}Nn.prototype.copy=function(){var a=new Nn;a.rr=this.rr;a.sr=this.sr;a.tr=this.tr;a.Cj=this.Cj;a.Nq=this.Nq;a.Zp=this.Zp;a.jg=this.jg.M();a.kg=this.kg.M();return a}; +function ch(a,b){O.call(this);Xn||(Yn=ah?(new Dk(null)).context:null,Xn=!0);this.o|=2097152;this.hc="";this.Tc="black";this.Be="13px sans-serif";this.xq=this.Db=this.kd=0;this.ia=this.ka=this.Bm=this.Et=this.Ft=null;this.Lh=0;this.ef=null;this.Le=0;this.Ae=this.ac=this.Pc=null;"string"===typeof a?this.text=a:a&&Object.assign(this,a);b&&Object.assign(this,b);return this}na(ch,O); +ch.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.hc=this.hc;a.Tc=this.Tc;a.Be=this.Be;a.kd=this.kd;a.Db=this.Db;a.xq=this.xq;a.Ft=this.Ft;a.Et=this.Et;a.Bm=this.Bm;null!==this.ka&&(a.ka=this.ka.copy());null!==this.ia&&(a.ia=this.ia.oc?this.ia:this.ia.copy());a.Lh=this.Lh;a.ef=this.ef;a.Le=this.Le;a.Pc=this.Pc;a.ac=this.ac;a.Ae=this.Ae};function Zn(a){null===a.ia?a.ia=new $n:a.ia.oc&&(a.ia=a.ia.copy())}t=ch.prototype; +t.th=function(){O.prototype.th.call(this);null!==this.ia&&(this.ia.oc=!0)}; +function gn(a,b){a.o=b.o|6144;a.yb=b.opacity;a.cc=b.background;a.areaBackground=b.areaBackground;a.fd=b.desiredSize.M();a.minSize=b.minSize.M();a.maxSize=b.maxSize.M();null!==b.Nb?a.Nb=b.Nb.copy():a.Nb=null;a.Ea=b.scale;a.Lb=b.angle;a.stretch=b.stretch;a.Mg=b.margin.M();a.Kb=b.alignment.M();a.tk=b.alignmentFocus.M();a.segmentFraction=b.segmentFraction;a.segmentOffset=b.segmentOffset.M();a.segmentOrientation=b.segmentOrientation;null!==b.pb&&(a.pb=b.pb.copy());a.shadowVisible=b.shadowVisible;a.hc= +b.hc;a.Tc=b.Tc;a.Be=b.Be;null!==a.ka&&(a.ka=b.ka.copy());null!==b.ia&&(a.ia=b.ia.oc?b.ia:b.ia.copy());a.Lh=b.Lh}t.ub=function(a){a.classType===ch?this.wrap=a:O.prototype.ub.call(this,a)};t.toString=function(){return 22<this.hc.length?'TextBlock("'+this.hc.substring(0,20)+'"...)':'TextBlock("'+this.hc+'")'};t.w=function(){O.prototype.w.call(this);this.Et=this.Ft=null}; +function ao(a){Xn||(Yn=ah?(new Dk(null)).context:null,Xn=!0);if(null===Yn)return!0;var b=Yn.font;if(a===b||"10px sans-serif"===a)return!0;Yn.font="10px sans-serif";Yn.font=a;var c=Yn.font;if("10px sans-serif"!==c)return Yn.font=b,!0;Yn.font="19px serif";var d=Yn.font;Yn.font=a;c=Yn.font;Yn.font=b;return c!==d} +t.mi=function(a,b){if(null!==this.Tc&&0!==this.hc.length&&null!==this.Be){var c=this.naturalBounds,d=this.actualBounds,e=c.width,f=c.height,g=bo(this),h=a.textAlign=this.textAlign,k=b.mn;"start"===h?h=k?"right":"left":"end"===h&&(h=k?"left":"right");k=this.isUnderline;var l=this.isStrikethrough;ti(this,a,this.Tc,!0,!1,c,d);(k||l)&&ti(this,a,this.Tc,!1,!1,c,d);d=0;c=!1;var m=this.oe,n=m.dx-(g*m.m21+m.dx);m=m.dy-(g*m.m22+m.dy);var p=b.scale;8>(n*n+m*m)*p*p&&(c=!0);b.dc!==a&&(c=!1);!1===b.Te("textGreeking")&& +(c=!1);b=this.spacingAbove;n=this.spacingBelow;switch(this.flip){case nl:a.translate(e,0);a.scale(-1,1);break;case ml:a.translate(0,f);a.scale(1,-1);break;case ol:a.translate(e,f),a.scale(-1,-1)}a.Vc();m=this.kd;p=(b+g+n)*m;f>p&&(d=this.verticalAlignment,d=d.y*f-d.y*p+d.offsetY);if(1===m&&null!==this.Ae)n=this.Db,n>e&&(n=e),this.li(this.Ae,a,0,d+b,e,g,n,c,h,k,l);else if(null!==this.Pc&&null!==this.ac)for(p=0;p<m;p++){var r=this.Pc[p];r>e&&(r=e);d+=b;this.li(this.ac[p],a,0,d,e,g,r,c,h,k,l);d+=g+n}switch(this.flip){case nl:a.scale(-1, +1);a.translate(-e,0);break;case ml:a.scale(1,-1);a.translate(0,-f);break;case ol:a.scale(-1,-1),a.translate(-e,-f)}}}; +t.li=function(a,b,c,d,e,f,g,h,k,l,m){var n=0;h?("left"===k?n=0:"right"===k?n=e-g:"center"===k&&(n=(e-g)/2),b.fillRect(c+n,d+.25*f,g,1)):("left"===k?n=0:"right"===k?n=e:"center"===k&&(n=e/2),e=null!==co?co(this,f):.75*f,b.fillText(a,c+n,d+e),a=f/20|0,0===a&&(a=1),"right"===k?n-=g:"center"===k&&(n-=g/2),l&&(k=null!==eo?eo(this,f):.8*f,b.beginPath(),b.lineWidth=a,b.moveTo(c+n,d+k),b.lineTo(c+n+g,d+k),b.stroke()),m&&(b.beginPath(),b.lineWidth=a,d=d+f-f/2.2|0,0!==a%2&&(d+=.5),b.moveTo(c+n,d),b.lineTo(c+ +n+g,d),b.stroke()))}; +t.Sl=function(a,b,c,d){this.Lh=a;var e=this.Be;null!==Yn&&lo!==e&&(lo=Yn.font=e);this.Db=this.Le=0;this.Ae=this.ac=this.Pc=this.ef=null;var f;if(isNaN(this.desiredSize.width)){e=this.hc.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===e.length)e=0;else if(this.isMultiline){for(var g=f=0,h=!1;!h;){var k=e.indexOf("\n",g);-1===k&&(k=e.length,h=!0);g=e.substr(g,k-g);this.formatting===mo&&(g=g.trim());f=Math.max(f,no(g));g=k+1}e=f}else f=e.indexOf("\n",0),0<=f&&(e=e.substr(0,f)),e=no(e);e=Math.min(e, +a/this.scale);e=Math.max(8,e)}else e=this.desiredSize.width;null!==this.panel&&(e=Math.min(e,this.panel.maxSize.width));f=oo(this,e);isNaN(this.desiredSize.height)?f=Math.min(f,b/this.scale):f=this.desiredSize.height;h=f;if(0!==this.Db&&null!==this.Pc&&null!==this.ac&&this.overflow===po&&(b=this.Be,b=this.overflow===po?qo(b):0,k=this.spacingAbove+this.spacingBelow,k=Math.max(0,bo(this)+k),h=Math.min(this.maxLines-1,Math.max(Math.floor(h/k+.01)-1,0)),!(h+1>=this.ac.length))){k=this.ac[h];for(b=Math.max(1, +a-b);no(k)>b&&1<k.length;)k=k.substr(0,k.length-1);k+=ro;b=no(k);this.ac[h]=k;this.ac=this.ac.slice(0,h+1);this.Pc[h]=b;this.Pc=this.Pc.slice(0,h+1);this.Le=this.ac.length;this.Db=Math.max(this.Db,b);this.kd=this.Le;1===this.kd&&(this.Ae=this.ac[0])}if(this.wrap===so||isNaN(this.desiredSize.width))e=isNaN(a)?this.Db:Math.min(a,this.Db),isNaN(this.desiredSize.width)&&(e=Math.max(8,e));e=Math.max(c,e);f=Math.max(d,f);bc(this.gc,e,f);this.Ge(0,0,e,f)};t.gh=function(a,b,c,d){yl(this,a,b,c,d)}; +function to(a,b,c){if(null===a.Ae)a.Ae=b,a.Db=c;else{if(null===a.ac||null===a.Pc)a.ac=[],a.Pc=[],a.ac.push(a.Ae),a.Pc.push(a.Db);a.ac.push(b);a.Pc.push(c)}} +function uo(a,b,c,d){var e=a.formatting===mo;e&&(b=b.trim());var f=0,g=a.Be,h=a.spacingAbove+a.spacingBelow;h=Math.max(0,bo(a)+h);var k=a.overflow===po?qo(g):0;if(a.kd>=a.maxLines)null!==d&&d.h(0,h);else if(g=b,a.wrap===vo){a.Le=1;var l=no(b);if(0===k||l<=c)a.Db=Math.max(a.Db,l),to(a,b,a.Db),null!==d&&d.h(l,h);else{f=wo(a,g);g=g.substr(f.length);b=wo(a,g);for(l=no(f+b);0<b.length&&l<=c;)f+=b,g=g.substr(b.length),b=wo(a,g),l=f+b,e&&(l=l.trim()),l=no(l);e&&(b=b.trim());f+=b;for(c=Math.max(1,c-k);no(f)> +c&&1<f.length;)f=f.substr(0,f.length-1);f+=ro;var m=no(f);a.Db=m;to(a,f,m);null!==d&&d.h(m,h)}}else{k=0;0===g.length&&(k=1,to(a,g,0));for(;0<g.length;){b=wo(a,g);for(g=g.substr(b.length);no(b)>c;){var n=1;l=no(b.substr(0,n));for(m=0;l<=c;)n++,m=l,l=no(b.substr(0,n));if(1===n){var p=l;f=Math.max(f,l)}else p=m,f=Math.max(f,m);n--;1>n&&(n=1);to(a,b.substr(0,n),p);k++;b=b.substr(n);if(a.kd+k>a.maxLines)break}m=wo(a,g);for(l=no(b+m);0<m.length&&l<=c;)b+=m,g=g.substr(m.length),m=wo(a,g),l=b+m,e&&(l=l.trim()), +l=no(l);e&&(b=b.trim());if(""!==b&&("\u00ad"===b[b.length-1]&&(b=b.substring(0,b.length-1)+"\u2010"),0===m.length?(n=l,f=Math.max(f,l)):(n=m=no(b),f=Math.max(f,m)),to(a,b,n),k++,a.kd+k>a.maxLines))break}a.Le=Math.min(a.maxLines,k);a.Db=Math.max(a.Db,f);null!==d&&d.h(a.Db,h*a.Le)}} +function wo(a,b){if(a.wrap===xo)return b.substr(0,1);for(var c=b.length,d=0,e=yo;d<c&&!e.test(b.charAt(d));)d++;for(a.formatting===zo&&(c=Math.min(c,d+1));d<c&&e.test(b.charAt(d));)d++;return d>=b.length?b:b.substr(0,d)}function no(a){return null===Yn?8*a.length:Yn.measureText(a).width}function bo(a){if(null!==a.ef)return a.ef;var b=a.Be;if(null===Yn){var c=16;return a.ef=c}void 0!==Ao[b]&&5E3>Bo?c=Ao[b]:(c=1.3*Yn.measureText("M").width,Ao[b]=c,Bo++);return a.ef=c} +function qo(a){if(null===Yn)return 6;if(void 0!==Co[a]&&5E3>Do)var b=Co[a];else b=Yn.measureText(ro).width,Co[a]=b,Do++;return b} +function oo(a,b){var c=a.hc.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),d=a.spacingAbove+a.spacingBelow;d=Math.max(0,bo(a)+d);if(0===c.length)return a.Db=0,a.kd=1,d;if(!a.isMultiline){var e=c.indexOf("\n",0);0<=e&&(c=c.substr(0,e))}e=0;for(var f=a.kd=0,g,h=!1;!h;){g=c.indexOf("\n",f);-1===g&&(g=c.length,h=!0);if(f<=g){f=c.substr(f,g-f);if(a.wrap!==vo){a.Le=0;var k=Hb.alloc();uo(a,f,b,k);e+=k.height;Hb.free(k);a.kd+=a.Le}else uo(a,f,b,null),e+=d,a.kd++;a.kd===a.maxLines&&(h=!0)}f=g+1}return a.xq=e} +oa.Object.defineProperties(ch.prototype,{font:{configurable:!0,get:function(){return this.Be},set:function(a){var b=this.Be;b!==a&&(G&&(A(a,"string",ch,"font"),ao(a)||v('Not a valid font: "'+a+'"')),this.Be=a,this.ef=null,this.w(),this.g("font",b,a))}},text:{configurable:!0,get:function(){return this.hc},set:function(a){var b=this.hc;null!==a&&void 0!==a?a=a.toString():a="";b!==a&&(this.hc=a,this.w(),this.g("text",b,a))}},textAlign:{configurable:!0,get:function(){return null!== +this.ia?this.ia.Ar:"start"},set:function(a){var b=this.textAlign;b!==a&&(G&&A(a,"string",ch,"textAlign"),"start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(Zn(this),this.ia.Ar=a,this.R(),this.g("textAlign",b,a)):G&&Ba(a,'"start", "end", "left", "right", or "center"',ch,"textAlign"))}},flip:{configurable:!0,get:function(){return null!==this.ia?this.ia.Zf:yg},set:function(a){var b=this.flip;b!==a&&(ab(a,O,ch,"flip"),Zn(this),this.ia.Zf=a,this.R(),this.g("flip",b,a))}},verticalAlignment:{configurable:!0, +enumerable:!0,get:function(){return null!==this.ia?this.ia.Kr:kd},set:function(a){var b=this.verticalAlignment;b.D(a)||(G&&(w(a,Ib,ch,"verticalAlignment"),a.kc()&&v("TextBlock.verticalAlignment for "+this+" must be a real Spot, not:"+a)),a=a.M(),Zn(this),this.ia.Kr=a,Ol(this),this.g("verticalAlignment",b,a))}},naturalBounds:{configurable:!0,get:function(){if(!this.gc.u()){var a=Hb.alloc();uo(this,this.hc,999999,a);var b=a.width;Hb.free(a);a=oo(this,b);var c=this.desiredSize;isNaN(c.width)|| +(b=c.width);isNaN(c.height)||(a=c.height);bc(this.gc,b,a)}return this.gc}},isMultiline:{configurable:!0,get:function(){return 0!==(this.o&2097152)},set:function(a){var b=0!==(this.o&2097152);b!==a&&(G&&A(a,"boolean",ch,"isMultiline"),this.o^=2097152,this.w(),this.g("isMultiline",b,a))}},isUnderline:{configurable:!0,get:function(){return 0!==(this.o&4194304)},set:function(a){var b=0!==(this.o&4194304);b!==a&&(G&&A(a,"boolean",ch,"isUnderline"),this.o^=4194304,this.R(),this.g("isUnderline", +b,a))}},isStrikethrough:{configurable:!0,get:function(){return 0!==(this.o&8388608)},set:function(a){var b=0!==(this.o&8388608);b!==a&&(G&&A(a,"boolean",ch,"isStrikethrough"),this.o^=8388608,this.R(),this.g("isStrikethrough",b,a))}},wrap:{configurable:!0,get:function(){return null!==this.ia?this.ia.Nr:Eo},set:function(a){var b=this.wrap;b!==a&&(G&&ab(a,ch,ch,"wrap"),Zn(this),this.ia.Nr=a,this.w(),this.g("wrap",b,a))}},overflow:{configurable:!0,get:function(){return null!== +this.ia?this.ia.Lq:Fo},set:function(a){var b=this.overflow;b!==a&&(G&&ab(a,ch,ch,"overflow"),Zn(this),this.ia.Lq=a,this.w(),this.g("overflow",b,a))}},stroke:{configurable:!0,get:function(){return this.Tc},set:function(a){var b=this.Tc;b!==a&&(null!==a&&cm(a,"TextBlock.stroke"),a instanceof Bl&&a.freeze(),this.Tc=a,this.R(),this.g("stroke",b,a))}},lineCount:{configurable:!0,get:function(){return this.kd}},lineHeight:{configurable:!0,get:function(){return bo(this)}}, +editable:{configurable:!0,get:function(){return 0!==(this.o&1048576)},set:function(a){var b=0!==(this.o&1048576);b!==a&&(G&&A(a,"boolean",ch,"editable"),this.o^=1048576,this.g("editable",b,a))}},textEditor:{configurable:!0,get:function(){return null!==this.ia?this.ia.Cr:null},set:function(a){var b=this.textEditor;b!==a&&(!G||a instanceof Me||v("TextBlock.textEditor must be an HTMLInfo."),Zn(this),this.ia.Cr=a,this.g("textEditor",b,a))}},errorFunction:{configurable:!0, +get:function(){return null!==this.ia?this.ia.Fd:null},set:function(a){var b=this.errorFunction;b!==a&&(null!==a&&A(a,"function",ch,"errorFunction"),Zn(this),this.ia.Fd=a,this.g("errorFunction",b,a))}},interval:{configurable:!0,get:function(){return null!==this.ka?this.ka.Vk:1},set:function(a){var b=this.interval;G&&E(a,ch,"interval");a=Math.round(a);if(b!==a&&0!==a&&isFinite(a)){null===this.ka&&(this.ka=new Wn);this.ka.Vk=a;this.w();var c=this.panel;null!==c&&(c.graduatedIntervals=null); +this.g("interval",b,a)}}},graduatedStart:{configurable:!0,get:function(){return null!==this.ka?this.ka.v:0},set:function(a){var b=this.graduatedStart;G&&E(a,ch,"graduatedStart");b!==a&&(0>a?a=0:1<a&&(a=1),null===this.ka&&(this.ka=new Wn),this.ka.v=a,this.w(),this.g("graduatedStart",b,a))}},graduatedEnd:{configurable:!0,get:function(){return null!==this.ka?this.ka.j:1},set:function(a){var b=this.graduatedEnd;G&&E(a,ch,"graduatedEnd");b!==a&&(0>a?a=0:1<a&&(a=1),null===this.ka&& +(this.ka=new Wn),this.ka.j=a,this.w(),this.g("graduatedEnd",b,a))}},graduatedFunction:{configurable:!0,get:function(){return null!==this.ka?this.ka.G:null},set:function(a){var b=this.graduatedFunction;b!==a&&(null!==a&&A(a,"function",ch,"graduatedFunction"),null===this.ka&&(this.ka=new Wn),this.ka.G=a,this.w(),this.g("graduatedFunction",b,a))}},graduatedSkip:{configurable:!0,get:function(){return null!==this.ka?this.ka.m:null},set:function(a){var b=this.graduatedSkip;b!== +a&&(null!==a&&A(a,"function",ch,"graduatedSkip"),null===this.ka&&(this.ka=new Wn),this.ka.m=a,this.w(),this.g("graduatedSkip",b,a))}},textValidation:{configurable:!0,get:function(){return null!==this.ia?this.ia.Dj:null},set:function(a){var b=this.textValidation;b!==a&&(null!==a&&A(a,"function",ch,"textValidation"),Zn(this),this.ia.Dj=a,this.g("textValidation",b,a))}},textEdited:{configurable:!0,get:function(){return null!==this.ia?this.ia.Br:null},set:function(a){var b= +this.textEdited;b!==a&&(null!==a&&A(a,"function",ch,"textEdited"),Zn(this),this.ia.Br=a,this.g("textEdited",b,a))}},spacingAbove:{configurable:!0,get:function(){return null!==this.ia?this.ia.mr:0},set:function(a){var b=this.spacingAbove;b!==a&&(G&&A(a,"number",ch,"spacingAbove"),Zn(this),this.ia.mr=a,this.w(),this.g("spacingAbove",b,a))}},spacingBelow:{configurable:!0,get:function(){return null!==this.ia?this.ia.nr:0},set:function(a){var b=this.spacingBelow;b!==a&&(G&& +A(a,"number",ch,"spacingBelow"),Zn(this),this.ia.nr=a,this.w(),this.g("spacingBelow",b,a))}},formatting:{configurable:!0,get:function(){return null!==this.ia?this.ia.Wp:mo},set:function(a){var b=this.formatting;b!==a&&(ab(a,ch,ch,"formatting"),Zn(this),this.ia.Wp=a,this.w(),this.g("formatting",b,a))}},maxLines:{configurable:!0,get:function(){return null!==this.ia?this.ia.vq:Infinity},set:function(a){var b=this.maxLines;b!==a&&(G&&A(a,"number",ch,"maxLines"),a=Math.floor(a), +0>=a&&Ba(a,"> 0",ch,"maxLines"),Zn(this),this.ia.vq=a,this.w(),this.g("maxLines",b,a))}},metrics:{configurable:!0,get:function(){return{arrSize:null!==this.Pc?this.Pc:[this.Db],arrText:null!==this.ac?this.ac:[this.Ae],maxLineWidth:this.Db,fontHeight:this.ef}}},choices:{configurable:!0,get:function(){return this.Bm},set:function(a){var b=this.Bm;b!==a&&(G&&null!==a&&!Array.isArray(a)&&Aa(a,"Array",ch,"choices:value"),this.Bm=a,this.g("choices",b,a))}}}); +var co=null,eo=null,vo=new F(ch,"None",0),so=new F(ch,"WrapFit",1),Eo=new F(ch,"WrapDesiredSize",2),xo=new F(ch,"WrapBreakAll",3),Fo=new F(ch,"OverflowClip",0),po=new F(ch,"OverflowEllipsis",1),mo=new F(ch,"FormatTrim",0),zo=new F(ch,"FormatNone",0),yo=/[ \u200b\u00ad]/,Ao=new db,Bo=0,Co=new db,Do=0,ro="...",lo="",Yn=null,Xn=!1;ch.className="TextBlock"; +function $n(){this.oc=!1;this.Fd=null;this.Zf=yg;this.Wp=mo;this.vq=Infinity;this.Lq=Fo;this.nr=this.mr=0;this.Ar="start";this.Dj=this.Cr=this.Br=null;this.Kr=kd;this.Nr=Eo}$n.prototype.copy=function(){var a=new $n;a.Fd=this.Fd;a.Zf=this.Zf;a.Wp=this.Wp;a.vq=this.vq;a.Lq=this.Lq;a.mr=this.mr;a.nr=this.nr;a.Ar=this.Ar;a.Br=this.Br;a.Cr=this.Cr;a.Dj=this.Dj;a.Kr=this.Kr;a.Nr=this.Nr;return a};ch.getEllipsis=function(){return ro};ch.setEllipsis=function(a){ro=a;Co=new db;Do=0};ch.getBaseline=function(){return co}; +ch.setBaseline=function(a){co=a};ch.getUnderline=function(){return eo};ch.setUnderline=function(a){eo=a};ch.isValidFont=ao;ch.FormatNone=zo;ch.FormatTrim=mo;ch.None=vo;ch.OverflowClip=Fo;ch.OverflowEllipsis=po;ch.WrapBreakAll=xo;ch.WrapDesiredSize=Eo;ch.WrapFit=so;function Wn(){this.Vk=1;this.v=0;this.j=1;this.m=this.G=null}Wn.prototype.copy=function(){var a=new Wn;a.Vk=this.Vk;a.v=this.v;a.j=this.j;a.G=this.G;a.m=this.m;return a};Wn.className="GradElementSettings"; +function kk(a,b){O.call(this);this.Hg=null;this.fo="";this.Yg=qc;this.Pk=Bd;this.$g=this.Fd=null;this.Ok=Kc;this.Zf=yg;this.xl=null;this.jn=!1;this.Gh=!0;this.cl=!1;this.tl=null;"string"===typeof a?this.source=a:a&&Object.assign(this,a);b&&Object.assign(this,b)}var Go;na(kk,O);kk.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.fo=this.fo;a.element=this.Hg;a.Yg=this.Yg.M();a.Pk=this.Pk;a.Zf=this.Zf;a.Fd=this.Fd;a.$g=this.$g;a.Ok=this.Ok.M();a.Gh=this.Gh;a.tl=this.tl}; +kk.prototype.ub=function(a){a===yg||a===Ag||a===ll?this.imageStretch=a:O.prototype.ub.call(this,a)};kk.prototype.toString=function(){return"Picture("+this.source+")#"+lb(this)};function Oi(a){void 0===a&&(a="");A(a,"string",kk,"clearCache:url");""!==a?Go[a]&&(delete Go[a],Ho--):(Go=new db,Ho=0)} +function Io(a,b){b.oy||(b.sq=function(c){b.hq=!0;b.dn=!1;var d=b.Eg.copy();if(null!==d&&void 0!==d){for(d=d.iterator;d.next();){var e=d.value;var f=b.getAttribute("src")||"";var g=e.Qg.L(f);if(null!==g)for(var h=g.length,k=0;k<h;k++)f=g[k],e.Rn.add(f),e.Sb(),b.an&&(void 0===b.Xt&&(b.Xt=c),null!==f.$g&&f.$g(f,c))}b.Eg.clear()}a.desiredSize.u()||(wj(a,!1),a.w())},b.Op=function(a){b.dn=a;var c=b.Eg.copy();if(null!==c&&void 0!==c){for(c=c.iterator;c.next();){var e=c.value,f=b.getAttribute("src")||""; +var g=e.Qg.L(f);if(null!==g){e=g.length;f=Na();for(var h=0;h<e;h++)f.push(g[h]);if(b.an)for(h=0;h<e;h++)g=f[h],null!==g.Fd&&g.Fd(g,a);Pa(f)}}b.Eg.clear()}},b.addEventListener("load",b.sq),b.addEventListener("error",b.Op),b.oy=!0)}kk.prototype.gA=function(){if(""!==this.source){Oi(this.source);var a=this.source;this.source="";this.source=a}};kk.prototype.redraw=function(){this.R()}; +kk.prototype.mi=function(a,b){var c=this.Hg;if(null!==c){var d=c.getAttribute("src");if(!(c instanceof HTMLImageElement&&(null===d||""===d)||c.dn instanceof Event&&a instanceof Jl)){d=this.naturalBounds;var e=0,f=0,g=this.jn,h=g?+c.width:c.naturalWidth;g=g?+c.height:c.naturalHeight;void 0===h&&c.videoWidth&&(h=c.videoWidth);void 0===g&&c.videoHeight&&(g=c.videoHeight);h=h||d.width;g=g||d.height;if(0!==h&&0!==g){var k=h,l=g;this.sourceRect.u()&&(e=this.Yg.x,f=this.Yg.y,h=this.Yg.width,g=this.Yg.height); +var m=h,n=g,p=this.Pk,r=this.Ok;switch(p){case yg:if(this.sourceRect.u())break;m>=d.width&&(e=e+r.offsetX+(m*r.x-d.width*r.x));n>=d.height&&(f=f+r.offsetY+(n*r.y-d.height*r.y));h=Math.min(d.width,m);g=Math.min(d.height,n);break;case Bd:m=d.width;n=d.height;break;case Ag:case ll:p===Ag?(p=Math.min(d.height/n,d.width/m),m*=p,n*=p):p===ll&&(p=Math.max(d.height/n,d.width/m),m*=p,n*=p,m>=d.width&&(e=(e+r.offsetX+(m*r.x-d.width*r.x)/m)*h),n>=d.height&&(f=(f+r.offsetY+(n*r.y-d.height*r.y)/n)*g),h*=1/(m/ +d.width),g*=1/(n/d.height),m=d.width,n=d.height)}p=this.Gf()*b.scale;var q=m*p*n*p,u=h*g/q,x=c.__goCache;p=null;var y=Jo;if(c.hq&&void 0!==x&&4<q&&u>y*y)for(null===x.ki&&(Ko(x,4,k,l,c),Ko(x,16,k,l,c)),k=x.ki,l=k.length,q=0;q<l;q++)if(k[q].ratio*k[q].ratio<u)p=k[q];else break;if(!b.Sm){if(null===this.xl)if(null===this.Hg)this.xl=!1;else{k=(new Dk(null)).context;try{k.drawImage(this.Hg,0,0)}catch(z){G&&this.Gh&&Fa(z.toString()),this.Gh=!1}try{k.getImageData(0,0,1,1).data[3]&&(this.xl=!1),this.xl=!1}catch(z){this.xl= +!0}}if(this.xl)return}k=0;m<d.width&&(k=r.offsetX+(d.width*r.x-m*r.x));l=0;n<d.height&&(l=r.offsetY+(d.height*r.y-n*r.y));switch(this.flip){case nl:a.translate(Math.min(d.width,m),0);a.scale(-1,1);break;case ml:a.translate(0,Math.min(d.height,n));a.scale(1,-1);break;case ol:a.translate(Math.min(d.width,m),Math.min(d.height,n)),a.scale(-1,-1)}a.Vc();if(b.Te("pictureRatioOptimization")&&!b.hj&&void 0!==x&&null!==p&&1!==p.ratio){a.save();b=p.ratio;try{a.drawImage(p.source,e/b,f/b,Math.min(p.source.width, +h/b),Math.min(p.source.height,g/b),k,l,Math.min(d.width,m),Math.min(d.height,n))}catch(z){G&&this.Gh&&Fa(z.toString()),this.Gh=!1}a.restore()}else try{a.drawImage(c,e,f,h,g,k,l,Math.min(d.width,m),Math.min(d.height,n))}catch(z){G&&this.Gh&&Fa(z.toString()),this.Gh=!1}switch(this.flip){case nl:a.scale(-1,1);a.translate(-Math.min(d.width,m),0);break;case ml:a.scale(1,-1);a.translate(0,-Math.min(d.height,n));break;case ol:a.scale(-1,-1),a.translate(-Math.min(d.width,m),-Math.min(d.height,n))}}}}}; +kk.prototype.Sl=function(a,b,c,d){var e=this.desiredSize,f=wl(this,!0),g=this.Hg,h=this.jn;if(h||!this.cl&&g&&g.complete)this.cl=!0;null===g&&(isFinite(e.width)||(a=0),isFinite(e.height)||(b=0));isFinite(e.width)||f===Bd||f===il?(isFinite(a)||(this.sourceRect.u()?a=this.sourceRect.width:null!==g&&(a=h?+g.width:g.naturalWidth)),c=0):null!==g&&!1!==this.cl&&(a=this.sourceRect.u()?this.sourceRect.width:h?+g.width:g.naturalWidth);isFinite(e.height)||f===Bd||f===jl?(isFinite(b)||(this.sourceRect.u()?b= +this.sourceRect.height:null!==g&&(b=h?+g.height:g.naturalHeight)),d=0):null!==g&&!1!==this.cl&&(b=this.sourceRect.u()?this.sourceRect.height:h?+g.height:g.naturalHeight);isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);e=this.maxSize;f=this.minSize;c=Math.max(c||0,f.width);d=Math.max(d||0,f.height);a=Math.min(e.width,a);b=Math.min(e.height,b);a=Math.max(c,a);b=Math.max(d,b);null===g||g.complete||(isFinite(a)||(a=0),isFinite(b)||(b=0));bc(this.gc,a,b);this.Ge(0,0,a,b)}; +kk.prototype.gh=function(a,b,c,d){yl(this,a,b,c,d)}; +oa.Object.defineProperties(kk.prototype,{element:{configurable:!0,get:function(){return this.Hg},set:function(a){var b=this.Hg;if(b!==a){this.jn=a instanceof HTMLCanvasElement;var c=a instanceof HTMLImageElement;null===a||c||a instanceof HTMLVideoElement||this.jn||v("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);var d=this.diagram;null!==d&&lk(d,this);this.Hg=a;null!==a&&c&&void 0===a.Eg&&(a.Eg=new I);null!==d&&c&&jk(d,this);null!==a&&(this.jn||!0===a.complete? +(a.an&&(a.dn instanceof Event&&null!==this.Fd?this.Fd(this,a.dn):!0===a.hq&&!a.dn&&null!==this.$g&&a.Xt&&this.$g(this,a.Xt)),a.hq=!0,this.desiredSize.u()||(wj(this,!1),this.w())):c&&Io(this,a));this.g("element",b,a);this.R()}}},source:{configurable:!0,get:function(){return this.fo},set:function(a){var b=this.fo;if(b!==a){A(a,"string",kk,"source");this.fo=a;var c=Go;if(ah){if(void 0!==c[a])var d=c[a];else if(""!==a){30<Ho&&(Oi(),c=Go);d=wa("img");d.an=!0;Io(this,d);var e=this.tl;null!== +e&&(d.crossOrigin=e(this));d.src=a;c[a]=d;Ho++}this.element=d;null!==d&&void 0===d.__goCache&&(d.__goCache=new Lo);this.w();this.R()}this.g("source",b,a)}}},sourceCrossOrigin:{configurable:!0,get:function(){return this.tl},set:function(a){if(this.tl!==a&&(null!==a&&A(a,"function",kk,"sourceCrossOrigin"),this.tl=a,null!==this.element)){var b=this.element.getAttribute("src");null===a&&"string"===typeof b?this.element.crossOrigin=null:null!==a&&(this.element.crossOrigin=a(this));this.element.src= +b}}},sourceRect:{configurable:!0,get:function(){return this.Yg},set:function(a){var b=this.Yg;b.D(a)||(w(a,M,kk,"sourceRect"),this.Yg=a=a.M(),this.R(),this.g("sourceRect",b,a))}},imageStretch:{configurable:!0,get:function(){return this.Pk},set:function(a){var b=this.Pk;b!==a&&(ab(a,O,kk,"imageStretch"),this.Pk=a,this.R(),this.g("imageStretch",b,a))}},flip:{configurable:!0,get:function(){return this.Zf},set:function(a){var b=this.Zf;b!==a&&(ab(a,O,kk,"flip"), +this.Zf=a,this.R(),this.g("flip",b,a))}},imageAlignment:{configurable:!0,get:function(){return this.Ok},set:function(a){w(a,Ib,kk,"imageAlignment");var b=this.Ok;b.D(a)||(this.Ok=a=a.M(),this.R(),this.g("imageAlignment",b,a))}},errorFunction:{configurable:!0,get:function(){return this.Fd},set:function(a){var b=this.Fd;b!==a&&(null!==a&&A(a,"function",kk,"errorFunction"),this.Fd=a,this.g("errorFunction",b,a))}},successFunction:{configurable:!0,get:function(){return this.$g}, +set:function(a){var b=this.$g;b!==a&&(null!==a&&A(a,"function",kk,"successFunction"),this.$g=a,this.g("successFunction",b,a))}},naturalBounds:{configurable:!0,get:function(){return this.gc}}});kk.prototype.redraw=kk.prototype.redraw;kk.prototype.reloadSource=kk.prototype.gA;var Ho=0,Jo=4;kk.className="Picture";Go=new db;kk.clearCache=Oi;function Lo(){this.ki=null} +function Ko(a,b,c,d,e){null===a.ki&&(a.ki=[]);var f=new Dk(null),g=f.context,h=1/b;f.width=c/b;f.height=d/b;0!==f.width&&0!==f.height&&(b=new Mo(f.Xa,b),c=1,0<a.ki.length&&(c=a.ki[a.ki.length-1],e=c.source,c=c.ratio),g.setTransform(h*c,0,0,h*c,0,0),g.Vc(),g.drawImage(e,0,0),a.ki.push(b))}Lo.className="PictureCacheArray";function Mo(a,b){this.source=a;this.ratio=b}Mo.className="PictureCacheInstance";function No(){this.Yr=new N;this.vc=null} +No.prototype.reset=function(a){null!==a?(a.pa(),this.Yr=a,a.figures.clear()):this.Yr=new N;this.vc=null};function Kd(a,b,c,d,e){a.vc=new je;a.vc.startX=b;a.vc.startY=c;a.vc.isFilled=d;a.Yr.figures.add(a.vc);void 0!==e&&(a.vc.isShadowed=e)}function Od(a){var b=a.vc.segments.length;0<b&&a.vc.segments.N(b-1).close()}No.prototype.km=function(a){this.vc.isShadowed=a};No.prototype.moveTo=function(a,b,c){void 0===c&&(c=!1);var d=new ke(Wd);d.endX=a;d.endY=b;c&&d.close();this.vc.segments.add(d)}; +No.prototype.lineTo=function(a,b,c){void 0===c&&(c=!1);var d=new ke(Dd);d.endX=a;d.endY=b;c&&d.close();this.vc.segments.add(d)};function Ld(a,b,c,d,e,f,g){var h;void 0===h&&(h=!1);var k=new ke(Xd);k.point1X=b;k.point1Y=c;k.point2X=d;k.point2Y=e;k.endX=f;k.endY=g;h&&k.close();a.vc.segments.add(k)}function Md(a,b,c,d,e){var f;void 0===f&&(f=!1);var g=new ke(Yd);g.point1X=b;g.point1Y=c;g.endX=d;g.endY=e;f&&g.close();a.vc.segments.add(g)} +No.prototype.arcTo=function(a,b,c,d,e,f,g){void 0===f&&(f=0);void 0===g&&(g=!1);var h=new ke(Zd);h.startAngle=a;h.sweepAngle=b;h.centerX=c;h.centerY=d;h.radiusX=e;h.radiusY=0!==f?f:e;g&&h.close();this.vc.segments.add(h)};function Nd(a,b,c,d,e,f,g,h){var k;void 0===k&&(k=!1);b=new ke($d,g,h,b,c,d,e,f);k&&b.close();a.vc.segments.add(b)}function Jd(a){var b=Pd;if(null!==b)return Pd=null,b.reset(a),b;b=new No;b.reset(a);return b}var Pd=null;No.className="StreamGeometryContext"; +function Oo(a,b){var c=a.toLowerCase(),d=L.te;d[a]=b;d[c]=a}Oo("Rectangle",function(a,b,c){a="r"+b+","+c;var d=L.Pf[a];if(void 0!==d)return d;d=new N(N.v);d.endX=b;d.endY=c;L.Qf<L.rm&&(L.Pf[a]=d,L.Qf++);return d});Oo("Square",function(a,b,c){a="s"+b+","+c;var d=L.Pf[a];if(void 0!==d)return d;d=new N(N.v);d.endX=b;d.endY=c;d.defaultStretch=Ag;L.Qf<L.rm&&(L.Pf[a]=d,L.Qf++);return d}); +Oo("RoundedRectangle",function(a,b,c){a=a?a.parameter1:NaN;if(isNaN(a)||0>a)a=5;a=Math.min(a,b/3);a=Math.min(a,c/3);var d="rr"+b+","+c+","+a,e=L.Pf[d];if(void 0!==e)return e;var f=a*L.zg;e=(new N).add((new je(a,0,!0)).add(new ke(Dd,b-a,0)).add(new ke(Xd,b,a,b-f,0,b,f)).add(new ke(Dd,b,c-a)).add(new ke(Xd,b-a,c,b,c-f,b-f,c)).add(new ke(Dd,a,c)).add(new ke(Xd,0,c-a,f,c,0,c-f)).add(new ke(Dd,0,a)).add((new ke(Xd,a,0,0,f,f,0)).close()));1<f&&(e.spot1=new Ib(0,0,f,f),e.spot2=new Ib(1,1,-f,-f));L.Qf<L.rm&& +(L.Pf[d]=e,L.Qf++);return e});Oo("Border","RoundedRectangle");Oo("Ellipse",function(a,b,c){a="e"+b+","+c;var d=L.Pf[a];if(void 0!==d)return d;d=new N(N.G);d.endX=b;d.endY=c;d.spot1=sd;d.spot2=td;L.Qf<L.rm&&(L.Pf[a]=d,L.Qf++);return d});Oo("Circle",function(a,b,c){a="c"+b+","+c;var d=L.Pf[a];if(void 0!==d)return d;d=new N(N.G);d.endX=b;d.endY=c;d.spot1=sd;d.spot2=td;d.defaultStretch=Ag;L.Qf<L.rm&&(L.Pf[a]=d,L.Qf++);return d}); +Oo("TriangleRight",function(a,b,c){return(new N).add((new je(0,0)).add(new ke(Dd,b,.5*c)).add((new ke(Dd,0,c)).close())).lm(0,.25,.5,.75)});Oo("TriangleDown",function(a,b,c){return(new N).add((new je(0,0)).add(new ke(Dd,b,0)).add((new ke(Dd,.5*b,c)).close())).lm(.25,0,.75,.5)});Oo("TriangleLeft",function(a,b,c){return(new N).add((new je(b,c)).add(new ke(Dd,0,.5*c)).add((new ke(Dd,b,0)).close())).lm(.5,.25,1,.75)}); +Oo("TriangleUp",function(a,b,c){return(new N).add((new je(b,c)).add(new ke(Dd,0,c)).add((new ke(Dd,.5*b,0)).close())).lm(.25,.5,.75,1)});Oo("Triangle","TriangleUp");Oo("Diamond",function(a,b,c){return(new N).add((new je(.5*b,0)).add(new ke(Dd,0,.5*c)).add(new ke(Dd,.5*b,c)).add((new ke(Dd,b,.5*c)).close())).lm(.25,.25,.75,.75)});Oo("LineH",function(a,b,c){a=new N(N.j);a.startX=0;a.startY=c/2;a.endX=b;a.endY=c/2;return a}); +Oo("LineV",function(a,b,c){a=new N(N.j);a.startX=b/2;a.startY=0;a.endX=b/2;a.endY=c;return a});Oo("None","Rectangle");Oo("BarH","Rectangle");Oo("BarV","Rectangle");Oo("MinusLine","LineH");Oo("PlusLine",function(a,b,c){return(new N).add((new je(0,c/2,!1)).add(new ke(Dd,b,c/2)).add(new ke(Wd,b/2,0)).add(new ke(Dd,b/2,c)))});Oo("XLine",function(a,b,c){return(new N).add((new je(0,c,!1)).add(new ke(Dd,b,0)).add(new ke(Wd,0,0)).add(new ke(Dd,b,c)))}); +Oo("LineRight",function(a,b,c){return(new N).add((new je(.25*b,0,!1)).add(new ke(Dd,.75*b,.5*c)).add(new ke(Dd,.25*b,c)))});Oo("LineDown",function(a,b,c){return(new N).add((new je(0,.25*c,!1)).add(new ke(Dd,.5*b,.75*c)).add(new ke(Dd,b,.25*c)))});Oo("LineLeft",function(a,b,c){return(new N).add((new je(.75*b,0,!1)).add(new ke(Dd,.25*b,.5*c)).add(new ke(Dd,.75*b,c)))});Oo("LineUp",function(a,b,c){return(new N).add((new je(0,.75*c,!1)).add(new ke(Dd,.5*b,.25*c)).add(new ke(Dd,b,.75*c)))}); +L.qm={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8", +BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4", +BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8", +TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4", +BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z", +DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z", +TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z", +OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8", +OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"}; +function Po(){this.oc=!1;this.cr=this.Bp=this.mq=null;this.er="";this.Rq=this.cq=this.dr=null;this.Tq="";this.Sq=Vb;this.Uq=null;this.Vq="";this.Xq=hd;this.tq="";this.uq=Fc;this.Bq=Ab;this.wq=Bb;this.Lp=null;this.pq=127;this.ir=Cb;this.hr="gray";this.Wg=4} +Po.prototype.copy=function(){var a=new Po;a.mq=this.mq;a.Bp=this.Bp;a.cr=this.cr;a.er=this.er;a.dr=this.dr;a.cq=this.cq;a.Rq=this.Rq;a.Tq=this.Tq;a.Sq=this.Sq.M();a.Uq=this.Uq;a.Vq=this.Vq;a.Xq=this.Xq.M();a.tq=this.tq;a.uq=this.uq.M();a.Bq=this.Bq.M();a.wq=this.wq.M();a.Lp=this.Lp;a.pq=this.pq;a.ir=this.ir.M();a.hr=this.hr;a.Wg=this.Wg;return a}; +function S(a,b){void 0===a||a instanceof Zl||"string"===typeof a?V.call(this,a):(V.call(this),a&&(b=a));this.I=2408959;this.Vf="";this.S=null;this.Lg="";this.Tf=this.Vg=null;this.hc="";this.Ah=this.Mh=null;this.je=(new K(NaN,NaN)).freeze();this.nf=null;this.ro=NaN;this.ow=-1;this.ny=new M;this.Wh=null;this.dg=NaN;b&&Object.assign(this,b)}na(S,V); +S.prototype.cloneProtected=function(a){V.prototype.cloneProtected.call(this,a);a.I=this.I&-4097|49152;a.Vf=this.Vf;null!==this.S&&(a.S=this.S.oc?this.S:this.S.copy());a.Lg=this.Lg;a.Tf=null;a.hc=this.hc;a.je.assign(this.je);a.ro=this.ro};t=S.prototype;t.Cf=function(a){V.prototype.Cf.call(this,a);a.oh();a.Vg=null;a.nf=null;a.Wh=null};t.toString=function(){var a=Qa(this.constructor)+"#"+lb(this);null!==this.data&&(a+="("+Ra(this.data)+")");return a}; +function Qo(a){null===a.S?a.S=new Po:a.S.oc&&(a.S=a.S.copy())}t.th=function(){V.prototype.th.call(this);null!==this.S&&(this.S.oc=!0)};t.lk=function(a,b,c,d,e,f,g){var h=this.diagram;null!==h&&(a===se&&"elements"===b?e instanceof V?Oj(e,function(a){Qj(h.partManager,a);Pj(h,a)}):jk(h,e):a===te&&"elements"===b&&(e instanceof V?Oj(e,function(a){Tj(h.partManager,a,h)}):lk(h,e)),h.ib(a,b,c,d,e,f,g))}; +t.Pa=function(a){V.prototype.Pa.call(this,a);if(null!==this.data){for(var b=this.U.s,c=b.length,d=0;d<c;d++){var e=b[d];e instanceof V&&Oj(e,function(a){null!==a.data&&a.Pa()})}for(b=this.adornments;b.next();)b.value.Pa(a)}};S.prototype.updateRelationshipsFromData=function(){var a;null!==this.data&&(null===(a=this.diagram)||void 0===a?void 0:a.partManager.updateRelationshipsFromData(this))};S.prototype.Uj=function(a){G&&A(a,"string",S,"findAdornment:category");var b=this.Tf;return null===b?null:b.L(a)}; +S.prototype.eh=function(a,b){if(null!==b){G&&(A(a,"string",S,"addAdornment:category"),w(b,Ce,S,"addAdornment:ad"));var c=null,d=this.Tf;null!==d&&(c=d.L(a));if(c!==b){if(null!==c){var e=c.diagram;null!==e&&e.remove(c)}null===d&&(this.Tf=d=new yb);b.Vf!==a&&(b.category=a);d.add(a,b);a=this.diagram;null!==a&&(a.add(b),a=b.adornedObject,null!==a&&(a=a.jh(),null!==a&&(b.data=a.data)))}}}; +S.prototype.Mf=function(a){G&&A(a,"string",S,"removeAdornment:category");var b=this.Tf;if(null!==b){var c=b.L(a);if(null!==c){var d=c.diagram;null!==d&&d.remove(c)}b.remove(a);0===b.count&&(this.Tf=null)}};S.prototype.Mj=function(){var a=this.Tf;if(null!==a){var b=Na();for(a=a.iterator;a.next();)b.push(a.key);a=b.length;for(var c=0;c<a;c++)this.Mf(b[c]);Pa(b)}}; +S.prototype.updateAdornments=function(){var a=this.diagram;if(null!==a){for(var b=this.adornments;b.next();){var c=b.value;c.w();c.placeholder&&c.placeholder.w()}a:{if(this.isSelected&&this.selectionAdorned&&(b=this.selectionObject,null!==b&&this.actualBounds.u()&&this.isVisible()&&b.Lf()&&b.actualBounds.u())){c=this.Uj("Selection");if(null===c){c=this.selectionAdornmentTemplate;null===c&&(c=this.ph()?a.linkSelectionAdornmentTemplate:this instanceof wf?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate); +if(!(c instanceof Ce))break a;xg(c);c=c.copy();null!==c&&(this.ph()&&this.selectionObject===this.path&&(c.type=V.Link),c.adornedObject=b)}if(null!==c){c.type===V.Link&&c.w();this.eh("Selection",c);break a}}this.Mf("Selection")}Ro(this,a);for(b=this.adornments;b.next();)b.value.Pa()}};S.prototype.Xb=function(){var a=this.diagram;null!==a&&(Wi(a),0!==(this.I&16384)!==!0&&(this.I|=16384,a.Sb()))};function ri(a){0!==(a.I&16384)!==!1&&(a.updateAdornments(),a.I&=-16385)} +function Ro(a,b){b.toolManager.mouseDownTools.each(function(b){b.isEnabled&&b.updateAdornments(a)});b.toolManager.updateAdornments(a)}function So(a){if(!1===Dj(a)){To(a,!0);a.Wk();var b=a.diagram;null!==b&&(b.De.add(a),b.Sb())}}function Uo(a){a.I|=2097152;if(!1!==Dj(a)){var b=a.position,c=a.location;c.u()&&b.u()||Vo(a,b,c);c=a.Jb;var d=M.alloc().assign(c);c.pa();c.x=b.x;c.y=b.y;c.freeze();a.Tl(d,c);M.free(d);To(a,!1)}} +S.prototype.Ge=function(a,b,c,d){var e=this.wc;e.h(a,b,c,d);null===this.Nb&&(this.Nb=new Jb);var f=this.Nb;f.reset();this.bo(f,a,b,c,d);this.Nb=f;f.js()||f.fp(e)}; +S.prototype.bo=function(a,b,c,d,e){1!==this.Ea&&a.scale(this.Ea);if(0!==this.Lb){var f=Kc;this.locationSpot.mb()&&(f=this.locationSpot);var g=K.alloc();if(this.locationObject!==this)for(b=this.locationObject,c=b.naturalBounds,g.Di(c.x,c.y,c.width,c.height,f),null!==b.Nb&&b.Nb.La(g),g.offset(-b.measuredBounds.x,-b.measuredBounds.y),f=b.panel;null!==f&&f!==this;)null!==f.Nb&&f.Nb.La(g),g.offset(-f.measuredBounds.x,-f.measuredBounds.y),f=f.panel;else g.Di(b,c,d,e,f);a.rotate(this.Lb,g.x,g.y);K.free(g)}}; +S.prototype.move=function(a,b){!0===b?this.location=a:this.position=a};S.prototype.moveTo=function(a,b,c){a=K.allocAt(a,b);this.move(a,c);K.free(a)};S.prototype.isVisible=function(){if(!this.visible)return!1;var a=this.layer;if(null!==a){if(!a.visible)return!1;a=a.diagram;if(null!==a&&a.animationManager.ss(this))return!0}a=this.containingGroup;return null===a||a.isSubGraphExpanded&&a.isVisible()?!0:!1}; +S.prototype.Zb=function(a){var b=this.diagram;a?(this.F(4),this.Xb(),null!==b&&b.De.add(this)):(this.F(8),this.Mj());this.oh();null!==b&&(b.ab(),b.R())};S.prototype.lb=function(a){if(this.name===a)return this;var b=this.Wh;null===b&&(this.Wh=b=new yb);if(null!==b.L(a))return b.L(a);var c=V.prototype.lb.call(this,a);if(null!==c)return b.set(a,c),c;b.set(a,null);return null}; +function Wo(a,b,c,d){void 0===d&&(d=new K);c=c.kc()?Kc:c;var e=b.naturalBounds;d.h(e.width*c.x+c.offsetX,e.height*c.y+c.offsetY);if(null===b||b===a)return d;b.transform.La(d);for(b=b.panel;null!==b&&b!==a;)b.transform.La(d),b=b.panel;null!==a.Nb&&a.Nb.La(d);d.offset(-a.wc.x,-a.wc.y);return d}S.prototype.ti=function(a){void 0===a&&(a=new M);return a.assign(this.actualBounds)};S.prototype.eb=function(){!0===Bj(this)&&this.measure(Infinity,Infinity);this.arrange()}; +function Mj(a,b){var c=a.ny;isNaN(a.dg)&&(a.dg=sn(a));var d=a.dg;var e=2*d;if(!a.isShadowed)return c.h(b.x-1-d,b.y-1-d,b.width+2+e,b.height+2+e),c;d=b.x;e=b.y;var f=b.width;b=b.height;var g=a.shadowBlur;a=a.shadowOffset;f+=g;b+=g;d-=g/2;e-=g/2;0<a.x?f+=a.x:(d+=a.x,f-=a.x);0<a.y?b+=a.y:(e+=a.y,b-=a.y);c.h(d-1,e-1,f+2,b+2);return c} +S.prototype.arrange=function(){if(!1===Cj(this))Uo(this);else{xl(this,!1);var a=this.Jb,b=M.alloc();b.assign(a);var c=vg(this);this.gh(0,0,this.wc.width,this.wc.height);var d=this.position;Vo(this,d,this.location);a.pa();a.x=d.x;a.y=d.y;a.freeze();this.Tl(b,a);b.D(a)?this.Vd(c):!this.Zc()||L.C(b.width,a.width)&&L.C(b.height,a.height)||0<=this.ow&&this.F(16);M.free(b);To(this,!1)}};t=S.prototype; +t.Tl=function(a,b){var c=this.diagram;if(null!==c){var d=!1;if(!1===c.ej&&a.u()){var e=M.alloc();e.assign(c.documentBounds);e.xv(c.padding);a.x>e.x&&a.y>e.y&&a.right<e.right&&a.bottom<e.bottom&&b.x>e.x&&b.y>e.y&&b.right<e.right&&b.bottom<e.bottom&&(d=!0);M.free(e)}0!==(this.I&65536)!==!0&&a.D(b)||Rj(this,d,c);c.R();!a.u()&&!b.u()||ec(a,b)||(this instanceof T&&!c.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}}; +t.tv=function(a,b,c){if(this.ph()||!a.u())return!1;var d=this.diagram;null!==d&&Xo(this,d,a,b,c);this.va=a;this.I&=-2097153;!this.je.u()||null!==d&&!d.animationManager.isTicking&&d.undoManager.isUndoingRedoing||(d=this.je,this.je=new K(d.x+(a.x-b),d.y+(a.y-c)),this.g("location",d,this.je.copy()));!1===Dj(this)&&!1===Cj(this)&&(So(this),Uo(this));return!0};function Xo(a,b,c,d,e){null===b||a instanceof Ce||(b=b.animationManager,b.Eb&&Kh(b,a,new K(d,e),c))} +t.hm=function(a,b,c){var d=this.je,e=this.va;if(c){if(d.x===a&&d.y===b)return;Dj(this)||Cj(this)?e.h(NaN,NaN):e.h(e.x+a-d.x,e.y+b-d.y);d.h(a,b)}else{if(e.x===a&&e.y===b)return;Dj(this)||Cj(this)?this.As():d.h(d.x+a-e.x,d.y+b-e.y);e.h(a,b)}So(this)};t.As=function(){this.I&=-2097153;So(this)}; +function Vo(a,b,c){var d=K.alloc(),e=a.locationObject,f=e.naturalBounds,g=e instanceof Qf?e.strokeWidth:0;d.Di(0,0,f.width+g,f.height+g,a.locationSpot);if(e!==a)for(d.offset(-g/2,-g/2),e.transform.La(d),e=e.panel;null!==e&&e!==a;)e.transform.La(d),e=e.panel;null!==a.Nb&&a.Nb.La(d);d.offset(-a.wc.x,-a.wc.y);e=a.diagram;f=c.u();g=b.u();f&&g?0!==(a.I&2097152)?Yo(a,b,c,e,d):Zo(a,b,c,e,d):f?Yo(a,b,c,e,d):g&&Zo(a,b,c,e,d);a.I|=2097152;K.free(d);a.Wk()} +function Yo(a,b,c,d,e){var f=b.x,g=b.y;b.h(c.x-e.x,c.y-e.y);null!==d&&(c=d.animationManager,(d=c.defaultAnimation.isAnimating)||!c.Eb||a instanceof Ce||Kh(c,a,new K(f,g),b),d||b.x===f&&b.y===g||a.g("position",new K(f,g),b.copy()))}function Zo(a,b,c,d,e){var f=c.copy();c.h(b.x+e.x,b.y+e.y);c.D(f)||null===d||a.g("location",f,c.copy())} +function Rj(a,b,c){zl(a,!1);a instanceof T&&yk(c,a);a.layer.isTemporary||b||c.ab();b=a.Jb;var d=c.viewportBounds;d.u()?vg(a)?(ic(b,d)||a.Vd(!1),a.updateAdornments()):b.Yc(d)?(a.Vd(!0),a.updateAdornments()):a.Xb():c.gj=!0}t.Ai=function(){return!0};t.Zc=function(){return!0};t.ph=function(){return!1};t.zi=function(){return!0}; +function $o(a,b,c,d){b.constructor===a.constructor||ap||(ap=!0,Fa('Should not change the class of the Part when changing category from "'+c+'" to "'+d+'"'),Fa(" Old class: "+Qa(a.constructor)+", new class: "+Qa(b.constructor)+", part: "+a.toString()));a.Mj();var e=a.data;c=a.layerName;var f=a.isSelected,g=a.isHighlighted,h=!0,k=!0,l=!1;a instanceof T&&(h=a.isTreeLeaf,k=a.isTreeExpanded,l=a.wasTreeExpanded);b.Cf(a);b.cloneProtected(a);a.Vf=d;a.w();a.R();b=a.diagram;d=!0;null!==b&&(d=b.skipsUndoManager, +b.skipsUndoManager=!0);a.vb=e;a.I=f?a.I|4096:a.I&-4097;a.I=g?a.I|524288:a.I&-524289;a instanceof T&&(a.Y=h?a.Y|4:a.Y&-5,a.Y=k?a.Y|1:a.Y&-2,a.Y=l?a.Y|2:a.Y&-3);null!==e&&a.Pa();e=a.layerName;e!==c&&(a.Lg=c,a.layerName=e);null!==b&&(b.skipsUndoManager=d);a.Zc()&&a.F(64)}S.prototype.canCopy=function(){if(!this.copyable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowCopy)return!1;a=a.diagram;return null===a?!0:a.allowCopy?!0:!1}; +S.prototype.canDelete=function(){if(!this.deletable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowDelete)return!1;a=a.diagram;return null===a?!0:a.allowDelete?!0:!1};S.prototype.canEdit=function(){if(!this.textEditable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowTextEdit)return!1;a=a.diagram;return null===a?!0:a.allowTextEdit?!0:!1}; +S.prototype.canGroup=function(){if(!this.groupable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowGroup)return!1;a=a.diagram;return null===a?!0:a.allowGroup?!0:!1};S.prototype.canMove=function(){if(!this.movable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowMove)return!1;a=a.diagram;return null===a?!0:a.allowMove?!0:!1}; +S.prototype.canReshape=function(){if(!this.reshapable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowReshape)return!1;a=a.diagram;return null===a?!0:a.allowReshape?!0:!1};S.prototype.canResize=function(){if(!this.resizable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowResize)return!1;a=a.diagram;return null===a?!0:a.allowResize?!0:!1}; +S.prototype.canRotate=function(){if(!this.rotatable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowRotate)return!1;a=a.diagram;return null===a?!0:a.allowRotate?!0:!1};S.prototype.canSelect=function(){if(!this.selectable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowSelect)return!1;a=a.diagram;return null===a?!0:a.allowSelect?!0:!1};function Dj(a){return 0!==(a.I&32768)}function To(a,b){a.I=b?a.I|32768:a.I&-32769}function zl(a,b){a.I=b?a.I|65536:a.I&-65537} +function vg(a){return 0!==(a.I&131072)}t=S.prototype;t.Vd=function(a){this.I=a?this.I|131072:this.I&-131073};function bp(a,b){a.I=b?a.I|1048576:a.I&-1048577}t.oh=function(){var a=this.containingGroup;null!==a&&(a.w(),null!==a.placeholder&&a.placeholder.w(),a.Bd())};t.R=function(){var a=this.diagram;null!==a&&!Cj(this)&&!Dj(this)&&this.isVisible()&&this.Jb.u()&&a.R(Mj(this,this.Jb))}; +t.w=function(){V.prototype.w.call(this);var a=this.diagram;null!==a&&(a.De.add(this),this instanceof T&&null!==this.labeledLink&&Ol(this.labeledLink),a.Sb(!0))};t.Ko=function(a){a||(a=this.Ah,null!==a&&cp(a,this))};t.Lo=function(a){a||(a=this.Ah,null!==a&&dp(a,this))};t.Sj=function(){var a=this.data;if(null!==a){var b=this.diagram;null!==b&&(b=b.model,null!==b&&b.Yl(a))}};t.pz=function(){return ep(this,this)}; +function ep(a,b){var c=b.containingGroup;return null!==c?1+ep(a,c):b instanceof T&&(b=b.labeledLink,null!==b)?ep(a,b):0}t.uz=function(){return fp(this,this)};function fp(a,b){var c=b.containingGroup;return null!==c||b instanceof T&&(c=b.labeledLink,null!==c)?fp(a,c):b}t.Sd=function(a){return a instanceof wf?gp(this,this,a):!1};function gp(a,b,c){if(b===c||null===c)return!1;var d=b.containingGroup;return null===d||d!==c&&!gp(a,d,c)?b instanceof T&&(b=b.labeledLink,null!==b)?gp(a,b,c):!1:!0} +t.jx=function(a){if(null===a)return null;G&&w(a,S,S,"findCommonContainingGroup:other");if(this===a)return this.containingGroup;for(var b=this;null!==b;){b instanceof wf&&bp(b,!0);if(b instanceof T){var c=b.labeledLink;null!==c&&(b=c)}b=b.containingGroup}c=null;for(b=a;null!==b;){if(0!==(b.I&1048576)){c=b;break}b instanceof T&&(a=b.labeledLink,null!==a&&(b=a));b=b.containingGroup}for(b=this;null!==b;)b instanceof wf&&bp(b,!1),b instanceof T&&(a=b.labeledLink,null!==a&&(b=a)),b=b.containingGroup;return c}; +S.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return null!==a&&a.isTemporary||this instanceof T&&this.isLinkLabel?!1:!0}; +S.prototype.F=function(a){void 0===a&&(a=16777215);if(this.isLayoutPositioned&&0!==(a&this.layoutConditions)){var b=this.layer;null!==b&&b.isTemporary||this instanceof T&&this.isLinkLabel?b=!1:(b=this.diagram,b=null!==b&&b.undoManager.isUndoingRedoing?!1:!0)}else b=!1;if(b)if(b=this.Ah,null!==b){var c=b.layout;null!==c?c.F():b.F(a)}else a=this.diagram,null!==a&&(a=a.layout,null!==a&&a.F())};function Sj(a){if(!a.isVisible())return!1;a=a.layer;return null!==a&&a.isTemporary?!1:!0} +function fl(a,b,c,d,e,f){void 0===f&&(f=null);if(!(a.contains(b)||null!==f&&!f(b)||b instanceof Ce))if(a.add(b),b instanceof T){if(c&&b instanceof wf)for(var g=b.memberParts;g.next();)fl(a,g.value,c,d,e,f);if(!1!==e)for(g=b.linksConnected;g.next();){var h=g.value;if(!a.contains(h)){var k=h.fromNode,l=h.toNode;k=null===k||a.contains(k);l=null===l||a.contains(l);(e?k&&l:k||l)&&fl(a,h,c,d,e,f)}}if(1<d)for(b=b.Pu();b.next();)fl(a,b.value,c,d-1,e,f)}else if(b instanceof R)for(b=b.labelNodes;b.next();)fl(a, +b.value,c,d,e,f)} +oa.Object.defineProperties(S.prototype,{key:{configurable:!0,get:function(){var a=this.diagram;if(null!==a)return a.model.Ba(this.data)}},adornments:{configurable:!0,get:function(){return null===this.Tf?fb:this.Tf.iteratorValues}},layer:{configurable:!0,get:function(){return this.Mh}},diagram:{configurable:!0,get:function(){var a=this.Mh;return null===a||void 0===a?null:a.diagram}},layerName:{configurable:!0,get:function(){return this.Lg},set:function(a){var b= +this.Lg;if(b!==a){A(a,"string",S,"layerName");var c=this.diagram;if(null===c||null!==c.Vj(a)&&!c.partManager.addsToTemporaryLayer)if(this.Lg=a,null!==c&&c.ab(),this.g("layerName",b,a),b=this.layer,null!==b&&b.name!==a&&(c=b.diagram,null!==c&&(a=c.Vj(a),null!==a&&a!==b))){var d=b.rc(-1,this,!0);0<=d&&c.ib(te,"parts",b,this,null,d,!0);d=a.vi(99999999,this,!0);b.visible!==a.visible&&this.Zb(a.visible);0<=d&&c.ib(se,"parts",a,null,this,!0,d);d=this.layerChanged;if(null!==d){var e=c.ca;c.ca=!0;d(this, +b,a);c.ca=e}}}}},layerChanged:{configurable:!0,get:function(){return null!==this.S?this.S.mq:null},set:function(a){var b=this.layerChanged;b!==a&&(null!==a&&A(a,"function",S,"layerChanged"),Qo(this),this.S.mq=a,this.g("layerChanged",b,a))}},zOrder:{configurable:!0,get:function(){return this.ro},set:function(a){var b=this.ro;if(b!==a){A(a,"number",S,"zOrder");this.ro=a;var c=this.layer;null!==c&&ui(c,-1,this);this.g("zOrder",b,a);a=this.diagram;null!==a&&a.R()}}},locationObject:{configurable:!0, +enumerable:!0,get:function(){if(null===this.nf){var a=this.locationObjectName;""!==a?(a=this.lb(a),null!==a?this.nf=a:this.nf=this):this instanceof Ce?this.type!==V.Link&&null!==this.placeholder?this.nf=this.placeholder:this.nf=this:this.nf=this}return this.nf.visible?this.nf:this}},minLocation:{configurable:!0,get:function(){return null!==this.S?this.S.Bq:Ab},set:function(a){var b=this.minLocation;b.D(a)||(G&&w(a,K,S,"minLocation"),a=a.M(),Qo(this),this.S.Bq=a,this.g("minLocation", +b,a))}},maxLocation:{configurable:!0,get:function(){return null!==this.S?this.S.wq:Bb},set:function(a){var b=this.maxLocation;b.D(a)||(G&&w(a,K,S,"maxLocation"),a=a.M(),Qo(this),this.S.wq=a,this.g("maxLocation",b,a))}},locationObjectName:{configurable:!0,get:function(){return null!==this.S?this.S.tq:""},set:function(a){var b=this.locationObjectName;b!==a&&(G&&A(a,"string",S,"locationObjectName"),Qo(this),this.S.tq=a,this.nf=null,this.w(),this.g("locationObjectName",b,a))}}, +locationSpot:{configurable:!0,get:function(){return null!==this.S?this.S.uq:Fc},set:function(a){var b=this.locationSpot;b.D(a)||(G&&(w(a,Ib,S,"locationSpot"),a.mb()||v("Part.locationSpot must be a specific Spot value, not: "+a)),a=a.M(),Qo(this),this.S.uq=a,this.w(),this.g("locationSpot",b,a))}},location:{configurable:!0,get:function(){return this.je},set:function(a){G&&w(a,K,S,"location");var b=a.x,c=a.y,d=this.je;if(!(d.x===b||isNaN(d.x)&&isNaN(b))||!(d.y===c||isNaN(d.y)&& +isNaN(c))){a=a.copy();b=a;if(this.ph())b=!1;else{this.je=b;this.I|=2097152;if(!1===Cj(this)&&(So(this),c=this.va,c.u())){var e=this.diagram;if(null===e||e.animationManager.isTicking||!e.undoManager.isUndoingRedoing){var f=c.copy();c.h(c.x+(b.x-d.x),c.y+(b.y-d.y));Xo(this,e,c,f.x,f.y);this.g("position",f,c.copy())}}b=!0}b&&this.g("location",d,a.copy())}}},category:{configurable:!0,get:function(){return this.Vf},set:function(a){var b=this.Vf;if(b!==a){A(a,"string",S,"category");var c= +this.diagram,d=this.data,e=null;if(null!==c&&null!==d&&!(this instanceof Ce)){var f=c.model.undoManager;f.isEnabled&&!f.isUndoingRedoing&&(e=this.clone(),e.U.addAll(this.U))}this.Vf=a;this.g("category",b,a);null===c||null===d||this instanceof Ce?this instanceof Ce&&(e=this.adornedPart,null!==e&&(a=e.Tf,null!==a&&a.remove(b),e.eh(this.category,this))):(f=c.model,f.undoManager.isUndoingRedoing||(this.ph()?(c.partManager.setLinkCategoryForData(d,a),c=c.partManager.findLinkTemplateForCategory(a),null!== +c&&(xg(c),c=c.copy(),null!==c&&$o(this,c,b,a))):(null!==f&&f.em(d,a),c=hp(c.partManager,d,a),null!==c&&(xg(c),c=c.copy(),null===c||c instanceof R||(d=this.location.copy(),$o(this,c,b,a),this.location.u()||(this.location=d)))),null!==e&&(b=this.clone(),b.U.addAll(this.U),this.g("self",e,b))))}}},self:{configurable:!0,get:function(){return this},set:function(a){$o(this,a,this.category,a.category)}},copyable:{configurable:!0,get:function(){return 0!==(this.I&1)},set:function(a){var b= +0!==(this.I&1);b!==a&&(G&&A(a,"boolean",S,"copyable"),this.I^=1,this.g("copyable",b,a))}},deletable:{configurable:!0,get:function(){return 0!==(this.I&2)},set:function(a){var b=0!==(this.I&2);b!==a&&(G&&A(a,"boolean",S,"deletable"),this.I^=2,this.g("deletable",b,a))}},textEditable:{configurable:!0,get:function(){return 0!==(this.I&4)},set:function(a){var b=0!==(this.I&4);b!==a&&(G&&A(a,"boolean",S,"textEditable"),this.I^=4,this.g("textEditable",b,a),this.Xb())}},groupable:{configurable:!0, +enumerable:!0,get:function(){return 0!==(this.I&8)},set:function(a){var b=0!==(this.I&8);b!==a&&(G&&A(a,"boolean",S,"groupable"),this.I^=8,this.g("groupable",b,a))}},movable:{configurable:!0,get:function(){return 0!==(this.I&16)},set:function(a){var b=0!==(this.I&16);b!==a&&(G&&A(a,"boolean",S,"movable"),this.I^=16,this.g("movable",b,a))}},selectionAdorned:{configurable:!0,get:function(){return 0!==(this.I&32)},set:function(a){var b=0!==(this.I&32);b!==a&&(G&&A(a,"boolean", +S,"selectionAdorned"),this.I^=32,this.g("selectionAdorned",b,a),this.Xb())}},isInDocumentBounds:{configurable:!0,get:function(){return 0!==(this.I&64)},set:function(a){var b=0!==(this.I&64);if(b!==a){G&&A(a,"boolean",S,"isInDocumentBounds");this.I^=64;var c=this.diagram;null!==c&&c.ab();this.g("isInDocumentBounds",b,a)}}},isLayoutPositioned:{configurable:!0,get:function(){return 0!==(this.I&128)},set:function(a){var b=0!==(this.I&128);b!==a&&(G&&A(a,"boolean",S,"isLayoutPositioned"), +this.I^=128,this.g("isLayoutPositioned",b,a),this.F(a?4:8))}},selectable:{configurable:!0,get:function(){return 0!==(this.I&256)},set:function(a){var b=0!==(this.I&256);b!==a&&(G&&A(a,"boolean",S,"selectable"),this.I^=256,this.g("selectable",b,a),this.Xb())}},reshapable:{configurable:!0,get:function(){return 0!==(this.I&512)},set:function(a){var b=0!==(this.I&512);b!==a&&(G&&A(a,"boolean",S,"reshapable"),this.I^=512,this.g("reshapable",b,a),this.Xb())}},resizable:{configurable:!0, +enumerable:!0,get:function(){return 0!==(this.I&1024)},set:function(a){var b=0!==(this.I&1024);b!==a&&(G&&A(a,"boolean",S,"resizable"),this.I^=1024,this.g("resizable",b,a),this.Xb())}},rotatable:{configurable:!0,get:function(){return 0!==(this.I&2048)},set:function(a){var b=0!==(this.I&2048);b!==a&&(G&&A(a,"boolean",S,"rotatable"),this.I^=2048,this.g("rotatable",b,a),this.Xb())}},isSelected:{configurable:!0,get:function(){return 0!==(this.I&4096)},set:function(a){var b= +0!==(this.I&4096);if(b!==a){G&&A(a,"boolean",S,"isSelected");var c=this.diagram;if(!a||this.canSelect()&&!(null!==c&&c.selection.count>=c.maxSelectionCount)){this.I^=4096;var d=!1;if(null!==c){d=c.skipsUndoManager;c.skipsUndoManager=!0;var e=c.selection;e.pa();a?e.add(this):e.remove(this);e.freeze()}this.g("isSelected",b,a);this.Xb();a=this.selectionChanged;null!==a&&a(this);null!==c&&(c.Sb(),c.skipsUndoManager=d)}}}},isHighlighted:{configurable:!0,get:function(){return 0!==(this.I& +524288)},set:function(a){var b=0!==(this.I&524288);if(b!==a){G&&A(a,"boolean",S,"isHighlighted");this.I^=524288;var c=this.diagram;null!==c&&(c=c.highlighteds,c.pa(),a?c.add(this):c.remove(this),c.freeze());this.g("isHighlighted",b,a);this.R();a=this.highlightedChanged;null!==a&&a(this)}}},isShadowed:{configurable:!0,get:function(){return 0!==(this.I&8192)},set:function(a){var b=0!==(this.I&8192);b!==a&&(G&&A(a,"boolean",S,"isShadowed"),this.I^=8192,this.g("isShadowed",b,a),this.R())}}, +isAnimated:{configurable:!0,get:function(){return 0!==(this.I&262144)},set:function(a){var b=0!==(this.I&262144);b!==a&&(G&&A(a,"boolean",S,"isAnimated"),this.I^=262144,this.g("isAnimated",b,a))}},highlightedChanged:{configurable:!0,get:function(){return null!==this.S?this.S.cq:null},set:function(a){var b=this.highlightedChanged;b!==a&&(null!==a&&A(a,"function",S,"highlightedChanged"),Qo(this),this.S.cq=a,this.g("highlightedChanged",b,a))}},selectionObjectName:{configurable:!0, +enumerable:!0,get:function(){return null!==this.S?this.S.er:""},set:function(a){var b=this.selectionObjectName;b!==a&&(G&&A(a,"string",S,"selectionObjectName"),Qo(this),this.S.er=a,this.Vg=null,this.g("selectionObjectName",b,a))}},selectionAdornmentTemplate:{configurable:!0,get:function(){return null!==this.S?this.S.cr:null},set:function(a){var b=this.selectionAdornmentTemplate;b!==a&&(G&&w(a,Ce,S,"selectionAdornmentTemplate"),Qo(this),this.S.cr=a,this.g("selectionAdornmentTemplate", +b,a))}},selectionObject:{configurable:!0,get:function(){if(null===this.Vg){var a=this.selectionObjectName;null!==a&&""!==a?(a=this.lb(a),null!==a?this.Vg=a:this.Vg=this):this instanceof R?(a=this.path,null!==a?this.Vg=a:this.Vg=this):this.Vg=this}return this.Vg}},selectionChanged:{configurable:!0,get:function(){return null!==this.S?this.S.dr:null},set:function(a){var b=this.selectionChanged;b!==a&&(null!==a&&A(a,"function",S,"selectionChanged"),Qo(this),this.S.dr=a,this.g("selectionChanged", +b,a))}},resizeAdornmentTemplate:{configurable:!0,get:function(){return null!==this.S?this.S.Rq:null},set:function(a){var b=this.resizeAdornmentTemplate;b!==a&&(G&&w(a,Ce,S,"resizeAdornmentTemplate"),Qo(this),this.S.Rq=a,this.g("resizeAdornmentTemplate",b,a))}},resizeObjectName:{configurable:!0,get:function(){return null!==this.S?this.S.Tq:""},set:function(a){var b=this.resizeObjectName;b!==a&&(G&&A(a,"string",S,"resizeObjectName"),Qo(this),this.S.Tq=a,this.g("resizeObjectName", +b,a))}},resizeObject:{configurable:!0,get:function(){var a=this.resizeObjectName;return""!==a&&(a=this.lb(a),null!==a)?a:this}},resizeCellSize:{configurable:!0,get:function(){return null!==this.S?this.S.Sq:Vb},set:function(a){var b=this.resizeCellSize;b.D(a)||(G&&w(a,Hb,S,"resizeCellSize"),a=a.M(),Qo(this),this.S.Sq=a,this.g("resizeCellSize",b,a))}},rotateAdornmentTemplate:{configurable:!0,get:function(){return null!==this.S?this.S.Uq:null},set:function(a){var b= +this.rotateAdornmentTemplate;b!==a&&(G&&w(a,Ce,S,"rotateAdornmentTemplate"),Qo(this),this.S.Uq=a,this.g("rotateAdornmentTemplate",b,a))}},rotateObjectName:{configurable:!0,get:function(){return null!==this.S?this.S.Vq:""},set:function(a){var b=this.rotateObjectName;b!==a&&(G&&A(a,"string",S,"rotateObjectName"),Qo(this),this.S.Vq=a,this.g("rotateObjectName",b,a))}},rotateObject:{configurable:!0,get:function(){var a=this.rotateObjectName;return""!==a&&(a=this.lb(a),null!== +a)?a:this}},rotationSpot:{configurable:!0,get:function(){return null!==this.S?this.S.Xq:hd},set:function(a){var b=this.rotationSpot;b.D(a)||(G&&(w(a,Ib,S,"rotationSpot"),a===hd||a.mb()||v("Part.rotationSpot must be a specific Spot value or Spot.Default, not: "+a)),a=a.M(),Qo(this),this.S.Xq=a,this.g("rotationSpot",b,a))}},text:{configurable:!0,get:function(){return this.hc},set:function(a){var b=this.hc;b!==a&&(G&&A(a,"string",S,"text"),this.hc=a,this.g("text",b,a))}}, +containingGroup:{configurable:!0,get:function(){return this.Ah},set:function(a){if(this.Zc()){var b=this.Ah;if(b!==a){G&&null!==a&&w(a,wf,S,"containingGroup");null===a||this!==a&&!a.Sd(this)||(this===a&&v("Cannot make a Group a member of itself: "+this.toString()),v("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.F(2);var c=this.diagram;null!==b?dp(b,this):this instanceof wf&&null!==c&&c.fi.remove(this);this.Ah=a;null!==a?cp(a, +this):this instanceof wf&&null!==c&&c.fi.add(this);this.F(1);if(null!==c&&c.ca){var d=this.data,e=c.model;if(null!==d&&e.wi()){var f=e.Ba(null!==a?a.data:null);e.bp(d,f)}}d=this.containingGroupChanged;null!==d&&(e=!0,null!==c&&(e=c.ca,c.ca=!0),d(this,b,a),null!==c&&(c.ca=e));if(this instanceof wf)for(c=new I,fl(c,this,!0,0,!0),c=c.iterator;c.next();)if(d=c.value,d instanceof T)for(d=d.linksConnected;d.next();)ip(d.value);if(this instanceof T){for(c=this.linksConnected;c.next();)ip(c.value);c=this.labeledLink; +null!==c&&ip(c)}this.g("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&ui(b,-1,a))}}else v("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{configurable:!0,get:function(){return null!==this.S?this.S.Bp:null},set:function(a){var b=this.containingGroupChanged;b!==a&&(null!==a&&A(a,"function",S,"containingGroupChanged"),Qo(this),this.S.Bp=a,this.g("containingGroupChanged",b,a))}},isTopLevel:{configurable:!0,get:function(){return null!== +this.containingGroup||this instanceof T&&null!==this.labeledLink?!1:!0}},layoutConditions:{configurable:!0,get:function(){return null!==this.S?this.S.pq:127},set:function(a){var b=this.layoutConditions;b!==a&&(G&&A(a,"number",S,"layoutConditions"),Qo(this),this.S.pq=a,this.g("layoutConditions",b,a))}},dragComputation:{configurable:!0,get:function(){return null!==this.S?this.S.Lp:null},set:function(a){var b=this.dragComputation;b!==a&&(null!==a&&A(a,"function",S,"dragComputation"), +Qo(this),this.S.Lp=a,this.g("dragComputation",b,a))}},shadowOffset:{configurable:!0,get:function(){return null!==this.S?this.S.ir:Cb},set:function(a){var b=this.shadowOffset;b.D(a)||(G&&w(a,K,S,"shadowOffset"),a=a.M(),Qo(this),this.S.ir=a,this.R(),this.g("shadowOffset",b,a))}},shadowColor:{configurable:!0,get:function(){return null!==this.S?this.S.hr:"gray"},set:function(a){var b=this.shadowColor;b!==a&&(G&&A(a,"string",S,"shadowColor"),Qo(this),this.S.hr=a,this.R(),this.g("shadowColor", +b,a))}},shadowBlur:{configurable:!0,get:function(){return null!==this.S?this.S.Wg:4},set:function(a){var b=this.shadowBlur;b!==a&&(G&&A(a,"number",S,"shadowBlur"),Qo(this),this.S.Wg=a,this.R(),this.g("shadowBlur",b,a))}}});S.prototype.invalidateLayout=S.prototype.F;S.prototype.findCommonContainingGroup=S.prototype.jx;S.prototype.isMemberOf=S.prototype.Sd;S.prototype.findTopLevelPart=S.prototype.uz;S.prototype.findSubGraphLevel=S.prototype.pz;S.prototype.ensureBounds=S.prototype.eb; +S.prototype.getDocumentBounds=S.prototype.ti;S.prototype.findObject=S.prototype.lb;S.prototype.moveTo=S.prototype.moveTo;S.prototype.invalidateAdornments=S.prototype.Xb;S.prototype.clearAdornments=S.prototype.Mj;S.prototype.removeAdornment=S.prototype.Mf;S.prototype.addAdornment=S.prototype.eh;S.prototype.findAdornment=S.prototype.Uj;S.prototype.updateTargetBindings=S.prototype.Pa;var ap=!1;S.className="Part";S.LayoutNone=0;S.LayoutAdded=1;S.LayoutRemoved=2;S.LayoutShown=4;S.LayoutHidden=8; +S.LayoutNodeSized=16;S.LayoutGroupLayout=32;S.LayoutNodeReplaced=64;S.LayoutStandard=127;S.LayoutAll=16777215;function Ce(a,b){void 0===a||a instanceof Zl||"string"===typeof a?S.call(this,a):(S.call(this),a&&(b=a));this.I&=-257;this.Lg="Adornment";this.ve=null;this.sw=0;this.Mw=!1;this.j=this.Ya=null;b&&Object.assign(this,b)}na(Ce,S);Ce.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(null!==a?a.toString():"")};Ce.prototype.updateRelationshipsFromData=function(){}; +Ce.prototype.ck=function(a){var b=this.adornedObject,c=null===b||void 0===b?void 0:b.part;if(c instanceof R&&b instanceof Qf){b=c.path;c.ck(a);a=b.geometry;c=this.U.s;b=c.length;for(var d=0;d<b;d++){var e=c[d];e.isPanelMain&&e instanceof Qf&&(e.ya=a)}}};Ce.prototype.Ai=function(){var a=this.ve;if(null===a)return!0;a=a.part;return null===a||!Cj(a)};Ce.prototype.Zc=function(){return!1}; +Ce.prototype.lk=function(a,b,c,d,e,f,g){if(a===se&&"elements"===b)if(e instanceof wg)null===this.Ya?this.Ya=e:G&&this.Ya!==e&&v("Cannot insert a second Placeholder into the visual tree of an Adornment.");else{if(e instanceof V){var h=e.Jl(function(a){return a instanceof wg});h instanceof wg&&(null===this.Ya?this.Ya=h:G&&this.Ya!==h&&v("Cannot insert a second Placeholder into the visual tree of an Adornment."))}}else a===te&&"elements"===b&&null!==this.Ya&&(d===this.Ya?this.Ya=null:d instanceof V&& +this.Ya.vg(d)&&(this.Ya=null));S.prototype.lk.call(this,a,b,c,d,e,f,g)};Ce.prototype.updateAdornments=function(){};Ce.prototype.Sj=function(){}; +oa.Object.defineProperties(Ce.prototype,{placeholder:{configurable:!0,get:function(){return this.Ya}},adornedObject:{configurable:!0,get:function(){return this.ve},set:function(a){G&&null!==a&&w(a,O,S,"adornedObject:value");var b=this.adornedPart,c=null;null!==a&&(c=a.part);null===b||null!==a&&b===c||b.Mf(this.category);this.ve=a;null!==c&&c.eh(this.category,this)}},adornedPart:{configurable:!0,get:function(){var a=this.ve;return null!==a?a.part:null}},containingGroup:{configurable:!0, +enumerable:!0,get:function(){return null}}});Ce.className="Adornment";function jp(){this.oc=!1;this.Hr=this.oj=this.rq=this.qq=null;this.op=zc;this.Qq=kp;this.ur=this.qj=this.zq=this.yq=null}jp.prototype.copy=function(){var a=new jp;a.qq=this.qq;a.rq=this.rq;a.oj=this.oj;a.Hr=this.Hr;a.op=this.op.M();a.Qq=this.Qq;a.yq=this.yq;a.zq=this.zq;a.qj=this.qj;a.ur=this.ur;return a}; +function T(a,b){void 0===a||a instanceof Zl||"string"===typeof a?S.call(this,a):(S.call(this),a&&(b=a));this.Y=13;this.Fa=null;this.qb=new H;this.yc=this.bf=this.$k=null;this.bh=!1;b&&Object.assign(this,b)}na(T,S);T.prototype.cloneProtected=function(a){S.prototype.cloneProtected.call(this,a);a.Y=this.Y;null!==this.Fa&&(a.Fa=this.Fa.oc?this.Fa:this.Fa.copy())};t=T.prototype;t.Cf=function(a){S.prototype.Cf.call(this,a);a.Bd();a.bf=this.bf;a.yc=null}; +function lp(a){null===a.Fa?a.Fa=new jp:a.Fa.oc&&(a.Fa=a.Fa.copy())}t.th=function(){S.prototype.th.call(this);null!==this.Fa&&(this.Fa.oc=!0)};function mp(a,b){null!==b&&(null===a.bf&&(a.bf=new I),a.bf.add(b))}function np(a,b,c,d){if(null===b||null===a.bf)return null;for(var e=a.bf.iterator;e.next();){var f=e.value;if(f.qs===a&&f.cv===b&&f.Mx===c&&f.Nx===d||f.qs===b&&f.cv===a&&f.Mx===d&&f.Nx===c)return f}return null} +t.Nz=function(a,b,c){if(void 0===b||null===b)b="";if(void 0===c||null===c)c="";a=np(this,a,b,c);null!==a&&a.Ol()};t.lk=function(a,b,c,d,e,f,g){a===se&&"elements"===b?this.yc=null:a===te&&"elements"===b&&(this.yc=null);S.prototype.lk.call(this,a,b,c,d,e,f,g)};t.Bd=function(a){for(var b=this.linksConnected;b.next();){var c=b.value;void 0!==a&&a.contains(c)||(op(c.fromPort),op(c.toPort),c.gb())}}; +function Al(a,b){for(a=a.linksConnected;a.next();){var c=a.value;if(c.fromPort===b||c.toPort===b)op(c.fromPort),op(c.toPort),c.gb()}}function op(a){if(null!==a){var b=a.Tn;null!==b&&b.Ol();a=a.part;b=a.containingGroup;null===b||a.isVisible()||op(b.port)}}t.Ai=function(){return!0};T.prototype.getAvoidableRect=function(a){a.set(this.actualBounds);a.so(this.avoidableMargin);return a};T.prototype.findVisibleNode=function(){for(var a=this;null!==a&&!a.isVisible();)a=a.containingGroup;return a}; +T.prototype.isVisible=function(){if(!S.prototype.isVisible.call(this))return!1;var a=!0,b=Ii,c=this.diagram;if(null!==c){if(c.animationManager.ss(this))return!0;a=c.isTreePathToChildren;b=c.treeCollapsePolicy}if(b===Ii){if(a=this.ug(),null!==a&&!a.isTreeExpanded)return!1}else if(b===Gk){if(a=a?this.Mu():this.Nu(),0<a.count&&a.all(function(a){return!a.isTreeExpanded}))return!1}else if(b===Pk&&(a=a?this.Mu():this.Nu(),0<a.count&&a.any(function(a){return!a.isTreeExpanded})))return!1;a=this.labeledLink; +return null!==a?a.isVisible():!0};T.prototype.Zb=function(a){S.prototype.Zb.call(this,a);for(var b=this.linksConnected;b.next();){var c=b.value;if(a&&null!==this.containingGroup){var d=c.Io(this);null===d||d.Sd(this.containingGroup)||c.gb()}c.Zb(a)}};T.prototype.kx=function(){var a=new I,b=new I;pp(this,this,a,b);return b.iterator}; +function pp(a,b,c,d){if(null!==b&&!c.has(b)){c.add(b);var e=!0,f=a.diagram;null!==f&&(e=f.isTreePathToChildren);b.linksConnected.each(function(f){f.isTreeLink?(e?f.fromNode===b:f.toNode===b)&&pp(a,e?f.toNode:f.fromNode,c,d):d.add(f)})}} +T.prototype.findLinksConnected=function(a){void 0===a&&(a=null);if(null===a)return this.qb.iterator;G&&A(a,"string",T,"findLinksConnected:pid");var b=new hb(this.qb),c=this;b.predicate=function(b){return b.fromNode===c&&b.fromPortId===a||b.toNode===c&&b.toPortId===a};return b};t=T.prototype;t.Do=function(a){void 0===a&&(a=null);G&&null!==a&&A(a,"string",T,"findLinksOutOf:pid");var b=new hb(this.qb),c=this;b.predicate=function(b){return b.fromNode!==c?!1:null===a?!0:b.fromPortId===a};return b}; +t.Qd=function(a){void 0===a&&(a=null);G&&null!==a&&A(a,"string",T,"findLinksInto:pid");var b=new hb(this.qb),c=this;b.predicate=function(b){return b.toNode!==c?!1:null===a?!0:b.toPortId===a};return b}; +t.Lu=function(a){void 0===a&&(a=null);G&&null!==a&&A(a,"string",T,"findNodesConnected:pid");for(var b=null,c=null,d=this.qb.iterator;d.next();){var e=d.value;if(e.fromNode===this){if(null===a||e.fromPortId===a)e=e.toNode,null!==b?b.add(e):null!==c&&c!==e?(b=new I,b.add(c),b.add(e)):c=e}else e.toNode!==this||null!==a&&e.toPortId!==a||(e=e.fromNode,null!==b?b.add(e):null!==c&&c!==e?(b=new I,b.add(c),b.add(e)):c=e)}return null!==b?b.iterator:null!==c?new gb(c):fb}; +t.Nu=function(a){void 0===a&&(a=null);G&&null!==a&&A(a,"string",T,"findNodesOutOf:pid");for(var b=null,c=null,d=this.qb.iterator;d.next();){var e=d.value;e.fromNode!==this||null!==a&&e.fromPortId!==a||(e=e.toNode,null!==b?b.add(e):null!==c&&c!==e?(b=new I,b.add(c),b.add(e)):c=e)}return null!==b?b.iterator:null!==c?new gb(c):fb}; +t.Mu=function(a){void 0===a&&(a=null);G&&null!==a&&A(a,"string",T,"findNodesInto:pid");for(var b=null,c=null,d=this.qb.iterator;d.next();){var e=d.value;e.toNode!==this||null!==a&&e.toPortId!==a||(e=e.fromNode,null!==b?b.add(e):null!==c&&c!==e?(b=new I,b.add(c),b.add(e)):c=e)}return null!==b?b.iterator:null!==c?new gb(c):fb}; +t.kz=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);G&&(w(a,T,T,"findLinksBetween:othernode"),null!==b&&A(b,"string",T,"findLinksBetween:pid"),null!==c&&A(c,"string",T,"findLinksBetween:otherpid"));var d=new hb(this.qb),e=this;d.predicate=function(d){return(d.fromNode!==e||d.toNode!==a||null!==b&&d.fromPortId!==b||null!==c&&d.toPortId!==c)&&(d.fromNode!==a||d.toNode!==e||null!==c&&d.fromPortId!==c||null!==b&&d.toPortId!==b)?!1:!0};return d}; +t.lz=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);G&&(w(a,T,T,"findLinksTo:othernode"),null!==b&&A(b,"string",T,"findLinksTo:pid"),null!==c&&A(c,"string",T,"findLinksTo:otherpid"));var d=new hb(this.qb),e=this;d.predicate=function(d){return d.fromNode!==e||d.toNode!==a||null!==b&&d.fromPortId!==b||null!==c&&d.toPortId!==c?!1:!0};return d}; +function qp(a,b,c){op(c);var d=a.qb.contains(b);d||a.qb.add(b);if(!d||b.fromNode===b.toNode){var e=a.linkConnected;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.ca,g.ca=!0);e(a,b,c);null!==g&&(g.ca=f)}}!d&&b.isTreeLink&&(c=b.fromNode,b=b.toNode,null!==c&&null!==b&&c!==b&&(d=!0,a=a.diagram,null!==a&&(d=a.isTreePathToChildren),e=d?b:c,f=d?c:b,e.bh||(e.bh=f),!f.isTreeLeaf||null!==a&&a.undoManager.isUndoingRedoing||(d?c===f&&(f.isTreeLeaf=!1):b===f&&(f.isTreeLeaf=!1))))} +function rp(a,b,c){op(c);var d=a.qb.remove(b),e=null;if(d||b.toNode===b.fromNode){var f=a.linkDisconnected;e=a.diagram;if(null!==f){var g=!0;null!==e&&(g=e.ca,e.ca=!0);f(a,b,c);null!==e&&(e.ca=g)}}d&&b.isTreeLink&&(c=!0,null!==e&&(c=e.isTreePathToChildren),a=c?b.toNode:b.fromNode,b=c?b.fromNode:b.toNode,null!==a&&(a.bh=!1),null===b||b.isTreeLeaf||(0===b.qb.count?(b.bh=null,null!==e&&e.undoManager.isUndoingRedoing||(b.isTreeLeaf=!0)):Fk(b)))} +function Fk(a){a.bh=!1;if(0!==a.qb.count){var b=!0,c=a.diagram;if(null===c||!c.undoManager.isUndoingRedoing){null!==c&&(b=c.isTreePathToChildren);for(c=a.qb.iterator;c.next();){var d=c.value;if(d.isTreeLink)if(b){if(d.fromNode===a){a.isTreeLeaf=!1;return}}else if(d.toNode===a){a.isTreeLeaf=!1;return}}a.isTreeLeaf=!0}}}T.prototype.updateRelationshipsFromData=function(){var a=this.diagram;null!==a&&a.partManager.updateRelationshipsFromData(this)};t=T.prototype; +t.Ko=function(a){S.prototype.Ko.call(this,a);a||(Fk(this),a=this.$k,null!==a&&sp(a,this))};t.Lo=function(a){S.prototype.Lo.call(this,a);a||(a=this.$k,null!==a&&null!==a.xd&&(a.xd.remove(this),a.w()))}; +t.Sj=function(){if(0<this.qb.count){var a=this.diagram;if(null!==a)for(var b=null!==a.commandHandler?a.commandHandler.deletesConnectedLinks:!0,c=this.qb.copy().iterator;c.next();){var d=c.value;b?a.remove(d):(d.fromNode===this&&(d.fromNode=null),d.toNode===this&&(d.toNode=null))}}this.labeledLink=null;S.prototype.Sj.call(this)}; +t.Xr=function(a){G&&A(a,"string",T,"findPort:pid");if(null===this.yc){if(""===a&&!1===this.Ue)return this;tp(this)}var b=this.yc.L(a);return null!==b||""!==a&&(b=this.yc.L(""),null!==b)?b:this};function tp(a){null===a.yc?a.yc=new yb:a.yc.clear();a.nk(a,function(a,c){em(a,c)});0===a.yc.count&&a.yc.add("",a)}function em(a,b){var c=b.portId;null!==c&&null!==a.yc&&a.yc.add(c,b)} +function dm(a,b,c){var d=b.portId;if(null!==d&&(null!==a.yc&&a.yc.remove(d),b=a.diagram,null!==b&&c)){c=null;for(a=a.findLinksConnected(d);a.next();)d=a.value,null===c&&(c=Na()),c.push(d);if(null!==c){for(a=0;a<c.length;a++)b.remove(c[a]);Pa(c)}}} +t.Pz=function(a){if(null===a||a===this)return!1;var b=!0,c=this.diagram;null!==c&&(b=c.isTreePathToChildren);c=this;if(b)for(;c!==a;){b=null;for(var d=c.qb.iterator;d.next();){var e=d.value;if(e.isTreeLink&&(b=e.fromNode,b!==c&&b!==this))break}if(b===this||null===b||b===c)return!1;c=b}else for(;c!==a;){b=null;for(d=c.qb.iterator;d.next()&&(e=d.value,!e.isTreeLink||(b=e.toNode,b===c||b===this)););if(b===this||null===b||b===c)return!1;c=b}return!0}; +t.yz=function(){var a=!0,b=this.diagram;null!==b&&(a=b.isTreePathToChildren);b=this;if(a)for(;;){a=null;for(var c=b.qb.iterator;c.next();){var d=c.value;if(d.isTreeLink&&(a=d.fromNode,a!==b&&a!==this))break}if(a===this)return this;if(null===a||a===b)return b;b=a}else for(;;){a=null;for(c=b.qb.iterator;c.next()&&(d=c.value,!d.isTreeLink||(a=d.toNode,a===b||a===this)););if(a===this)return this;if(null===a||a===b)return b;b=a}}; +t.hz=function(a){if(null===a)return null;G&&w(a,T,T,"findCommonTreeParent:other");if(this===a)return this;for(var b=this;null!==b;)bp(b,!0),b=b.ug();var c=null;for(b=a;null!==b;){if(0!==(b.I&1048576)){c=b;break}b=b.ug()}for(b=this;null!==b;)bp(b,!1),b=b.ug();return c}; +t.lh=function(){var a=!0,b=this.diagram;null!==b&&(a=b.isTreePathToChildren);b=this.qb.iterator;if(a)for(;b.next();){if(a=b.value,a.isTreeLink&&a.fromNode!==this)return a}else for(;b.next();)if(a=b.value,a.isTreeLink&&a.toNode!==this)return a;return null}; +t.ug=function(){var a=this.bh;if(null===a)return null;if(a instanceof T)return a;var b=!0;a=this.diagram;null!==a&&(b=a.isTreePathToChildren);a=this.qb.iterator;if(b)for(;a.next();){if(b=a.value,b.isTreeLink&&(b=b.fromNode,b!==this))return this.bh=b}else for(;a.next();)if(b=a.value,b.isTreeLink&&(b=b.toNode,b!==this))return this.bh=b;return this.bh=null};t.wz=function(){function a(b,d){d.add(b);var c=b.lh();null!==c&&(d.add(c),b=b.ug(),null!==b&&a(b,d))}var b=new I;a(this,b);return b}; +t.vz=function(){return up(this,this)};function up(a,b){b=b.ug();return null===b?0:1+up(a,b)}t.Fo=function(){var a=!0,b=this.diagram;null!==b&&(a=b.isTreePathToChildren);b=new hb(this.qb);var c=this;b.predicate=a?function(a){return a.isTreeLink&&a.fromNode===c?!0:!1}:function(a){return a.isTreeLink&&a.toNode===c?!0:!1};return b}; +t.Pu=function(){var a=!0,b=this.diagram;null!==b&&(a=b.isTreePathToChildren);var c=b=null,d=this.qb.iterator;if(a)for(;d.next();)a=d.value,a.isTreeLink&&a.fromNode===this&&(a=a.toNode,null!==b?b.add(a):null!==c&&c!==a?(b=new H,b.add(c),b.add(a)):c=a);else for(;d.next();)a=d.value,a.isTreeLink&&a.toNode===this&&(a=a.fromNode,null!==b?b.add(a):null!==c&&c!==a?(b=new H,b.add(c),b.add(a)):c=a);return null!==b?b.iterator:null!==c?new gb(c):fb}; +t.xz=function(a){void 0===a&&(a=Infinity);A(a,"number",T,"findTreeParts:level");var b=new I;fl(b,this,!1,a,!0);return b};T.prototype.collapseTree=function(a){void 0===a&&(a=1);E(a,T,"collapseTree:level");1>a&&(a=1);var b=this.diagram;if(null!==b&&!b.Ve){b.Ve=!0;var c=new I;c.add(this);vp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===Ii);b.Ve=!1}}; +function vp(a,b,c,d,e,f,g){if(1<d)for(var h=c?a.Do():a.Qd();h.next();){var k=h.value;k.isTreeLink&&(k=k.Io(a),null===k||k===a||b.contains(k)||(b.add(k),vp(k,b,c,d-1,e,f,g)))}else wp(a,b,c,e,f,g)} +function wp(a,b,c,d,e,f){for(var g=e===a?!0:a.isTreeExpanded,h=c?a.Do():a.Qd();h.next();){var k=h.value;if(k.isTreeLink&&(k=k.Io(a),null!==k&&k!==a)){var l=b.contains(k);l||b.add(k);g&&(f&&d.Ij(k,e),k.oh(),k.Zb(!1));k.isTreeExpanded&&(k.wasTreeExpanded=k.isTreeExpanded,l||wp(k,b,c,d,e,f))}}a.isTreeExpanded=!1} +T.prototype.expandTree=function(a){void 0===a&&(a=2);E(a,T,"expandTree:level");2>a&&(a=2);var b=this.diagram;if(null!==b&&!b.Ve){b.Ve=!0;var c=new I;c.add(this);xp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===Ii);b.Ve=!1}}; +function xp(a,b,c,d,e,f,g){for(var h=f===a?!1:a.isTreeExpanded,k=c?a.Do():a.Qd();k.next();){var l=k.value;l.isTreeLink&&(h||l.Dd||l.gb(),l=l.Io(a),null!==l&&l!==a&&!b.contains(l)&&(b.add(l),h||(l.Zb(!0),l.oh(),g&&e.Kj(l,f)),2<d||l.wasTreeExpanded))&&(l.wasTreeExpanded=!1,xp(l,b,c,d-1,e,f,g))}a.isTreeExpanded=!0} +oa.Object.defineProperties(T.prototype,{portSpreading:{configurable:!0,get:function(){return null!==this.Fa?this.Fa.Qq:kp},set:function(a){var b=this.portSpreading;b!==a&&(G&&a!==yp&&a!==kp&&a!==zp&&v("Node.portSpreading can only be set to Node.SpreadingNone, Node.SpreadingEvenly, or Node.SpreadingPacked, not: "+a),lp(this),this.Fa.Qq=a,this.g("portSpreading",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.Bd())}},avoidable:{configurable:!0,get:function(){return 0!== +(this.Y&8)},set:function(a){var b=0!==(this.Y&8);if(b!==a){G&&A(a,"boolean",T,"avoidable");this.Y^=8;var c=this.diagram;null!==c&&yk(c,this);this.g("avoidable",b,a)}}},avoidableMargin:{configurable:!0,get:function(){return null!==this.Fa?this.Fa.op:zc},set:function(a){"number"===typeof a?a=new gc(a):w(a,gc,T,"avoidableMargin");var b=this.avoidableMargin;if(!b.D(a)){a=a.M();lp(this);this.Fa.op=a;var c=this.diagram;null!==c&&yk(c,this);this.g("avoidableMargin",b,a)}}},linksConnected:{configurable:!0, +enumerable:!0,get:function(){return this.qb.iterator}},linkConnected:{configurable:!0,get:function(){return null!==this.Fa?this.Fa.qq:null},set:function(a){var b=this.linkConnected;b!==a&&(null!==a&&A(a,"function",T,"linkConnected"),lp(this),this.Fa.qq=a,this.g("linkConnected",b,a))}},linkDisconnected:{configurable:!0,get:function(){return null!==this.Fa?this.Fa.rq:null},set:function(a){var b=this.linkDisconnected;b!==a&&(null!==a&&A(a,"function",T,"linkDisconnected"), +lp(this),this.Fa.rq=a,this.g("linkDisconnected",b,a))}},linkValidation:{configurable:!0,get:function(){return null!==this.Fa?this.Fa.oj:null},set:function(a){var b=this.linkValidation;b!==a&&(null!==a&&A(a,"function",T,"linkValidation"),lp(this),this.Fa.oj=a,this.g("linkValidation",b,a))}},isLinkLabel:{configurable:!0,get:function(){return null!==this.$k}},labeledLink:{configurable:!0,get:function(){return this.$k},set:function(a){var b=this.$k;if(b!==a){G&& +null!==a&&w(a,R,T,"labeledLink");var c=this.diagram,d=this.data;if(null!==b){null!==b.xd&&(b.xd.remove(this),b.w());if(null!==c&&null!==d&&!c.undoManager.isUndoingRedoing){var e=b.data,f=c.model;if(null!==e&&f.yi()){var g=f.Ba(d);void 0!==g&&f.Ox(e,g)}}this.containingGroup=null}this.$k=a;null!==a&&(sp(a,this),null===c||null===d||c.undoManager.isUndoingRedoing||(e=a.data,c=c.model,null!==e&&c.yi()&&(d=c.Ba(d),void 0!==d&&c.uu(e,d))),this.containingGroup=a.containingGroup);Ol(this);this.g("labeledLink", +b,a)}}},port:{configurable:!0,get:function(){return this.Xr("")}},ports:{configurable:!0,get:function(){null===this.yc&&tp(this);return this.yc.iteratorValues}},isTreeExpanded:{configurable:!0,get:function(){return 0!==(this.Y&1)},set:function(a){var b=0!==(this.Y&1);if(b!==a){G&&A(a,"boolean",T,"isTreeExpanded");this.Y^=1;var c=this.diagram;this.g("isTreeExpanded",b,a);b=this.treeExpandedChanged;if(null!==b){var d=!0;null!==c&&(d=c.ca,c.ca=!0);b(this);null!== +c&&(c.ca=d)}null!==c&&c.undoManager.isUndoingRedoing?this.Zb(a):a?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{configurable:!0,get:function(){return 0!==(this.Y&2)},set:function(a){var b=0!==(this.Y&2);b!==a&&(G&&A(a,"boolean",T,"wasTreeExpanded"),this.Y^=2,this.g("wasTreeExpanded",b,a))}},treeExpandedChanged:{configurable:!0,get:function(){return null!==this.Fa?this.Fa.Hr:null},set:function(a){var b=this.treeExpandedChanged;b!==a&&(null!==a&&A(a,"function", +T,"treeExpandedChanged"),lp(this),this.Fa.Hr=a,this.g("treeExpandedChanged",b,a))}},isTreeLeaf:{configurable:!0,get:function(){return 0!==(this.Y&4)},set:function(a){var b=0!==(this.Y&4);b!==a&&(G&&A(a,"boolean",T,"isTreeLeaf"),this.Y^=4,this.g("isTreeLeaf",b,a))}}});T.prototype.expandTree=T.prototype.expandTree;T.prototype.collapseTree=T.prototype.collapseTree;T.prototype.findTreeParts=T.prototype.xz;T.prototype.findTreeChildrenNodes=T.prototype.Pu; +T.prototype.findTreeChildrenLinks=T.prototype.Fo;T.prototype.findTreeLevel=T.prototype.vz;T.prototype.findTreeParentChain=T.prototype.wz;T.prototype.findTreeParentNode=T.prototype.ug;T.prototype.findTreeParentLink=T.prototype.lh;T.prototype.findCommonTreeParent=T.prototype.hz;T.prototype.findTreeRoot=T.prototype.yz;T.prototype.isInTreeOf=T.prototype.Pz;T.prototype.findPort=T.prototype.Xr;T.prototype.findLinksTo=T.prototype.lz;T.prototype.findLinksBetween=T.prototype.kz;T.prototype.findNodesInto=T.prototype.Mu; +T.prototype.findNodesOutOf=T.prototype.Nu;T.prototype.findNodesConnected=T.prototype.Lu;T.prototype.findLinksInto=T.prototype.Qd;T.prototype.findLinksOutOf=T.prototype.Do;T.prototype.findExternalTreeLinksConnected=T.prototype.kx;T.prototype.invalidateConnectedLinks=T.prototype.Bd;T.prototype.invalidateLinkBundle=T.prototype.Nz;var yp=new F(T,"SpreadingNone",10),kp=new F(T,"SpreadingEvenly",11),zp=new F(T,"SpreadingPacked",12);T.className="Node";T.SpreadingNone=yp;T.SpreadingEvenly=kp; +T.SpreadingPacked=zp;function wf(a,b){void 0===a||a instanceof Zl||"string"===typeof a?T.call(this,a):(T.call(this),a&&(b=a));this.Y|=4608;this.An=new I;this.Ya=null;this.Qc=new Di;this.Qc.group=this;this.hl=new I;this.pb=this.Qp=null;b&&Object.assign(this,b)}na(wf,T); +wf.prototype.cloneProtected=function(a){T.prototype.cloneProtected.call(this,a);this.Y=this.Y&-32769;var b=a.Jl(function(a){return a instanceof wg});b instanceof wg?a.Ya=b:a.Ya=null;null!==this.Qc?(a.Qc=this.Qc.copy(),a.Qc.group=a):(null!==a.Qc&&(a.Qc.group=null),a.Qc=null);null!==this.pb&&(a.pb=this.pb.copy())};t=wf.prototype; +t.Cf=function(a){T.prototype.Cf.call(this,a);var b=a.Wj();for(a=a.memberParts;a.next();){var c=a.value;c.w();c.F(8);c.Mj();if(c instanceof T)c.Bd(b);else if(c instanceof R)for(c=c.labelNodes;c.next();)c.value.Bd(b)}}; +t.lk=function(a,b,c,d,e,f,g){if(a===se&&"elements"===b)if(e instanceof wg)null===this.Ya?this.Ya=e:this.Ya!==e&&v("Cannot insert a second Placeholder into the visual tree of a Group.");else{if(e instanceof V){var h=e.Jl(function(a){return a instanceof wg});h instanceof wg&&(null===this.Ya?this.Ya=h:this.Ya!==h&&v("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===te&&"elements"===b&&null!==this.Ya&&(d===this.Ya?this.Ya=null:d instanceof V&&this.Ya.vg(d)&&(this.Ya=null)); +T.prototype.lk.call(this,a,b,c,d,e,f,g)};t.Tl=function(a,b){T.prototype.Tl.call(this,a,b);this.isClipping&&this.type!==V.Spot&&this.isSubGraphExpanded&&(a=this.resizeObject,a instanceof V&&(a=a.Ab()),null===this.pb&&(this.pb=new M),a.ti(this.pb),a instanceof Qf&&this.pb.Bc(-a.strokeWidth,-a.strokeWidth))};t.gh=function(a,b,c,d){this.nf=this.Ya;T.prototype.gh.call(this,a,b,c,d)}; +t.eb=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(b){!a.computesBoundsIncludingLinks&&b instanceof R||b.eb()});T.prototype.eb.call(this)};t.Ai=function(){if(!T.prototype.Ai.call(this))return!1;for(var a=this.memberParts;a.next();){var b=a.value;if(b instanceof T){if(b.isVisible()&&Cj(b))return!1}else if(b instanceof R&&b.isVisible()&&Cj(b)&&b.fromNode!==this&&b.toNode!==this)return!1}return!0}; +function cp(a,b){if(a.An.add(b)){b instanceof wf&&a.hl.add(b);var c=a.memberAdded;if(null!==c){var d=!0,e=a.diagram;null!==e&&(d=e.ca,e.ca=!0);c(a,b);null!==e&&(e.ca=d)}a.isVisible()&&a.isSubGraphExpanded||b.Zb(!1)}b instanceof R&&!a.computesBoundsIncludingLinks||(b=a.Ya,null===b&&(b=a),b.w())} +function dp(a,b){if(a.An.remove(b)){b instanceof wf&&a.hl.remove(b);var c=a.memberRemoved;if(null!==c){var d=!0,e=a.diagram;null!==e&&(d=e.ca,e.ca=!0);c(a,b);null!==e&&(e.ca=d)}a.isVisible()&&a.isSubGraphExpanded||b.Zb(!0)}b instanceof R&&!a.computesBoundsIncludingLinks||(b=a.Ya,null===b&&(b=a),b.w())}t.Sj=function(){if(0<this.An.count){var a=this.diagram;if(null!==a)for(var b=this.An.copy().iterator;b.next();)a.remove(b.value)}T.prototype.Sj.call(this)}; +wf.prototype.canAddMembers=function(a){var b=this.diagram;if(null===b)return!1;b=b.commandHandler;for(a=hl(a).iterator;a.next();)if(!b.isValidMember(this,a.value))return!1;return!0};wf.prototype.addMembers=function(a,b){var c=this.diagram;if(null===c)return!1;c=c.commandHandler;var d=!0;for(a=hl(a).iterator;a.next();){var e=a.value;!b||c.isValidMember(this,e)?e.containingGroup=this:d=!1}return d}; +wf.prototype.canUngroup=function(){if(!this.ungroupable)return!1;var a=this.layer;if(null===a||!a.allowUngroup)return!1;a=a.diagram;return null===a||a.allowUngroup?!0:!1};t=wf.prototype; +t.Bd=function(a){var b=0!==(this.Y&65536);T.prototype.Bd.call(this,a);if(!b)for(0!==(this.Y&65536)!==!0&&(this.Y=this.Y^65536),b=this.Ku();b.next();){var c=b.value;if(void 0===a||!a.contains(c)){var d=c.fromNode;null!==d&&d!==this&&d.Sd(this)&&!d.isVisible()?(op(c.fromPort),op(c.toPort),c.gb()):(d=c.toNode,null!==d&&d!==this&&d.Sd(this)&&!d.isVisible()&&(op(c.fromPort),op(c.toPort),c.gb()))}}}; +t.Ku=function(){var a=null!==this.diagram&&this.diagram.Hw;if(a&&null!==this.Qp)return this.Qp.iterator;var b=this.Wj();b.add(this);for(var c=new I,d=b.iterator;d.next();){var e=d.value;if(e instanceof T)for(e=e.linksConnected;e.next();){var f=e.value;b.contains(f)||c.add(f)}}a&&(this.Qp=c);return c.iterator}; +t.jz=function(){var a=this.Wj();a.add(this);for(var b=new I,c=a.iterator;c.next();){var d=c.value;if(d instanceof T)for(d=d.linksConnected;d.next();){var e=d.value,f=e.fromNode;null===f||a.contains(f)&&f!==this||b.add(f);e=e.toNode;null===e||a.contains(e)&&e!==this||b.add(e)}}return b.iterator};t.iz=function(){function a(b,d){null!==b&&(d.add(b),a(b.containingGroup,d))}var b=new I;a(this,b);return b};t.Wj=function(){var a=new I;fl(a,this,!0,0,!0);a.remove(this);return a}; +t.Zb=function(a){T.prototype.Zb.call(this,a);for(var b=this.memberParts;b.next();)b.value.Zb(a)};wf.prototype.collapseSubGraph=function(){var a=this.diagram;if(null!==a&&!a.Ve){a.Ve=!0;var b=this.Wj();Ap(this,b,a,this);a.Ve=!1}}; +function Ap(a,b,c,d){for(var e=a.memberParts;e.next();){var f=e.value;f.Zb(!1);f instanceof wf&&f.isSubGraphExpanded&&(f.wasSubGraphExpanded=f.isSubGraphExpanded,Ap(f,b,c,d));if(f instanceof T)f.Bd(b),c.Ij(f,d);else if(f instanceof R)for(f=f.labelNodes;f.next();)f.value.Bd(b)}a.isSubGraphExpanded=!1}wf.prototype.expandSubGraph=function(){var a=this.diagram;if(null!==a&&!a.Ve){a.Ve=!0;var b=this.Wj();Bp(this,b,a,this);a.Ve=!1}}; +function Bp(a,b,c,d){for(var e=a.memberParts;e.next();){var f=e.value;f.Zb(!0);f instanceof wf&&f.wasSubGraphExpanded&&(f.wasSubGraphExpanded=!1,Bp(f,b,c,d));if(f instanceof T)f.Bd(b),c.Kj(f,d);else if(f instanceof R)for(f=f.labelNodes;f.next();)f.value.Bd(b)}a.isSubGraphExpanded=!0} +wf.prototype.move=function(a,b){void 0===b&&(b=!1);var c=b?this.location:this.position,d=c.x;c=c.y;var e=a.x,f=a.y;if(!(d===e||isNaN(d)&&isNaN(e))||!(c===f||isNaN(c)&&isNaN(f))){d=e-(isNaN(d)?0:d);c=f-(isNaN(c)?0:c);f=K.alloc();T.prototype.move.call(this,a,b);a=new I;for(b=this.Wj().iterator;b.next();)if(e=b.value,e instanceof R&&(e.suspendsRouting&&a.add(e),e.Dd||e.fromNode!==this&&e.toNode!==this))e.suspendsRouting=!0;for(b.reset();b.next();)if(e=b.value,!(e.ph()||e instanceof T&&e.isLinkLabel)){var g= +e.position,h=e.location;g.u()?(f.x=g.x+d,f.y=g.y+c,e.position=f):h.u()&&(f.x=h.x+d,f.y=h.y+c,e.location=f)}for(b.reset();b.next();)if(e=b.value,e instanceof R&&(e.suspendsRouting=a.contains(e),e.Dd||e.fromNode!==this&&e.toNode!==this))g=e.position,f.x=g.x+d,f.y=g.y+c,f.u()?e.move(f):e.gb(),Zj(e)&&e.gb();K.free(f)}}; +oa.Object.defineProperties(wf.prototype,{placeholder:{configurable:!0,get:function(){return this.Ya}},computesBoundsAfterDrag:{configurable:!0,get:function(){return 0!==(this.Y&2048)},set:function(a){var b=0!==(this.Y&2048);b!==a&&(A(a,"boolean",wf,"computesBoundsAfterDrag"),this.Y^=2048,this.g("computesBoundsAfterDrag",b,a))}},computesBoundsIncludingLinks:{configurable:!0,get:function(){return 0!==(this.Y&4096)},set:function(a){A(a,"boolean",wf,"computesBoundsIncludingLinks"); +var b=0!==(this.Y&4096);b!==a&&(this.Y^=4096,this.g("computesBoundsIncludingLinks",b,a))}},computesBoundsIncludingLocation:{configurable:!0,get:function(){return 0!==(this.Y&8192)},set:function(a){A(a,"boolean",wf,"computesBoundsIncludingLocation");var b=0!==(this.Y&8192);b!==a&&(this.Y^=8192,this.g("computesBoundsIncludingLocation",b,a))}},handlesDragDropForMembers:{configurable:!0,get:function(){return 0!==(this.Y&16384)},set:function(a){A(a,"boolean",wf,"handlesDragDropForMembers"); +var b=0!==(this.Y&16384);b!==a&&(this.Y^=16384,this.g("handlesDragDropForMembers",b,a))}},memberParts:{configurable:!0,get:function(){return this.An.iterator}},layout:{configurable:!0,get:function(){return this.Qc},set:function(a){var b=this.Qc;if(b!==a){null!==a&&(w(a,Di,wf,"layout"),null!==a.diagram&&a.diagram.layout===a&&v("A layout cannot be both the Diagram.layout and a Group.layout: "+a));null!==b&&(b.diagram=null,b.group=null);this.Qc=a;var c=this.diagram;null!== +a&&(a.diagram=c,a.group=this);null!==c&&(c.xh=!0);this.g("layout",b,a);null!==c&&c.Sb()}}},memberAdded:{configurable:!0,get:function(){return null!==this.Fa?this.Fa.yq:null},set:function(a){var b=this.memberAdded;b!==a&&(null!==a&&A(a,"function",wf,"memberAdded"),lp(this),this.Fa.yq=a,this.g("memberAdded",b,a))}},memberRemoved:{configurable:!0,get:function(){return null!==this.Fa?this.Fa.zq:null},set:function(a){var b=this.memberRemoved;b!==a&&(null!==a&&A(a,"function", +wf,"memberRemoved"),lp(this),this.Fa.zq=a,this.g("memberRemoved",b,a))}},memberValidation:{configurable:!0,get:function(){return null!==this.Fa?this.Fa.qj:null},set:function(a){var b=this.memberValidation;b!==a&&(null!==a&&A(a,"function",wf,"memberValidation"),lp(this),this.Fa.qj=a,this.g("memberValidation",b,a))}},ungroupable:{configurable:!0,get:function(){return 0!==(this.Y&256)},set:function(a){var b=0!==(this.Y&256);b!==a&&(A(a,"boolean",wf,"ungroupable"),this.Y^= +256,this.g("ungroupable",b,a))}},isSubGraphExpanded:{configurable:!0,get:function(){return 0!==(this.Y&512)},set:function(a){var b=0!==(this.Y&512);if(b!==a){A(a,"boolean",wf,"isSubGraphExpanded");this.Y^=512;var c=this.diagram;this.g("isSubGraphExpanded",b,a);b=this.subGraphExpandedChanged;if(null!==b){var d=!0;null!==c&&(d=c.ca,c.ca=!0);b(this);null!==c&&(c.ca=d)}null!==c&&c.undoManager.isUndoingRedoing?(null!==this.Ya&&this.Ya.w(),this.memberParts.each(function(a){a.updateAdornments()})): +a?this.expandSubGraph():this.collapseSubGraph()}}},wasSubGraphExpanded:{configurable:!0,get:function(){return 0!==(this.Y&1024)},set:function(a){var b=0!==(this.Y&1024);b!==a&&(A(a,"boolean",wf,"wasSubGraphExpanded"),this.Y^=1024,this.g("wasSubGraphExpanded",b,a))}},subGraphExpandedChanged:{configurable:!0,get:function(){return null!==this.Fa?this.Fa.ur:null},set:function(a){var b=this.subGraphExpandedChanged;b!==a&&(null!==a&&A(a,"function",wf,"subGraphExpandedChanged"), +lp(this),this.Fa.ur=a,this.g("subGraphExpandedChanged",b,a))}},rh:{configurable:!0,get:function(){return 0!==(this.Y&32768)},set:function(a){0!==(this.Y&32768)!==a&&(this.Y^=32768)}}});wf.prototype.expandSubGraph=wf.prototype.expandSubGraph;wf.prototype.collapseSubGraph=wf.prototype.collapseSubGraph;wf.prototype.findSubGraphParts=wf.prototype.Wj;wf.prototype.findContainingGroupChain=wf.prototype.iz;wf.prototype.findExternalNodesConnected=wf.prototype.jz; +wf.prototype.findExternalLinksConnected=wf.prototype.Ku;wf.prototype.ensureBounds=wf.prototype.eb;wf.className="Group";function wg(a){O.call(this);this.zb=yc;this.Zn=new M(NaN,NaN,NaN,NaN);a&&Object.assign(this,a)}na(wg,O);wg.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.zb=this.zb.M();a.Zn=this.Zn.copy()};wg.prototype.ih=function(a){if(null===this.background&&null===this.areaBackground)return!1;var b=this.naturalBounds;return mc(0,0,b.width,b.height,a.x,a.y)}; +wg.prototype.Sl=function(){var a=this.part;null!==a&&(a instanceof wf||a instanceof Ce)||v("Placeholder is not inside a Group or Adornment.");if(a instanceof wf){var b=this.computeBorder(this.Zn),c=this.minSize,d=this.gc;bc(d,(isFinite(c.width)?Math.max(c.width,b.width):b.width)||0,(isFinite(c.height)?Math.max(c.height,b.height):b.height)||0);this.Ge(0,0,d.width,d.height);d=a.memberParts;for(c=!1;d.next();)if(d.value.isVisible()){c=!0;break}d=a.diagram;!c||null===d||d.animationManager.Yu(a)||isNaN(b.x)|| +isNaN(b.y)||(c=K.alloc(),c.Ci(b,a.locationSpot),c.D(a.location)||(a.location=c),K.free(c))}else{b=this.gc;c=this.zb;d=c.left+c.right;var e=c.top+c.bottom,f=a.adornedObject;a.angle=f.si();var g=0;f instanceof Qf&&(g=f.strokeWidth);var h=f.Gf(),k=f.naturalBounds,l=(k.width+g)*h;g=(k.height+g)*h;a.type!==V.Link&&(h=f.oa("Selection"===a.category?Fc:a.locationSpot,K.alloc()),a.location=h,K.free(h));isNaN(l)||isNaN(g)?(a=f.oa(Fc,K.alloc()),l=M.allocAt(a.x,a.y,0,0),l.Ze(f.oa(Oc,a)),l.Ze(f.oa(Hc,a)),l.Ze(f.oa(Mc, +a)),bc(b,l.width+d||0,l.height+e||0),this.Ge(-c.left,-c.top,b.width,b.height),K.free(a),M.free(l)):(bc(b,l+d||0,g+e||0),this.Ge(-c.left,-c.top,b.width,b.height))}};wg.prototype.gh=function(a,b,c,d){this.actualBounds.h(a,b,c,d)}; +wg.prototype.computeBorder=function(a){var b=this.part,c=b.diagram;if(null!==c&&b instanceof wf&&!b.layer.isTemporary&&b.computesBoundsAfterDrag&&this.Zn.u()){var d=c.toolManager.findTool("Dragging");if(d===c.currentTool&&(c=d.computeBorder(b,this.Zn,a),null!==c))return c}c=M.alloc();d=this.computeMemberBounds(c);var e=this.zb;b instanceof wf&&!b.isSubGraphExpanded?a.h(d.x-e.left,d.y-e.top,0,0):a.h(d.x-e.left,d.y-e.top,Math.max(d.width+e.left+e.right,0),Math.max(d.height+e.top+e.bottom,0));M.free(c); +b instanceof wf&&b.computesBoundsIncludingLocation&&b.location.u()&&a.Ze(b.location);return a}; +wg.prototype.computeMemberBounds=function(a){if(!(this.part instanceof wf))return a.h(0,0,0,0),a;for(var b=this.part,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=b.memberParts;g.next();){var h=g.value;if(h.isVisible()){if(h instanceof R){if(!b.computesBoundsIncludingLinks)continue;if(Bj(h))continue;if(h.fromNode===b||h.toNode===b)continue}h=h.actualBounds;h.left<c&&(c=h.left);h.top<d&&(d=h.top);h.right>e&&(e=h.right);h.bottom>f&&(f=h.bottom)}}isFinite(c)&&isFinite(d)?a.h(c,d,e-c,f-d):(b=b.location, +a.h(b.x,b.y,0,0));return a};oa.Object.defineProperties(wg.prototype,{padding:{configurable:!0,get:function(){return this.zb},set:function(a){"number"===typeof a?a=new gc(a):w(a,gc,wg,"padding");var b=this.zb;b.D(a)||(this.zb=a=a.M(),this.g("padding",b,a),this.w())}}});wg.className="Placeholder"; +function R(a){S.call(this,V.Link);this.Ta=8;this.ff=null;this.gf="";this.vf=this.$m=null;this.wf="";this.ko=null;this.rk=mg;this.Jm=0;this.Lm=mg;this.Mm=NaN;this.xj=Cp;this.eo=.5;this.xd=null;this.Ob=(new H).freeze();this.sf=this.Sc=null;this.ol=new M;this.ya=new N;this.v=this.m=this.Uf=this.Yf=null;this.ku=new K;this.Tp=this.Ew=this.Dw=null;this.kt=NaN;this.ea=null;this.j=[];a&&Object.assign(this,a)}na(R,S); +R.prototype.cloneProtected=function(a){S.prototype.cloneProtected.call(this,a);a.Ta=this.Ta&-113;a.gf=this.gf;a.$m=this.$m;a.wf=this.wf;a.ko=this.ko;a.rk=this.rk;a.Jm=this.Jm;a.Lm=this.Lm;a.Mm=this.Mm;a.xj=this.xj;a.eo=this.eo;null!==this.ea&&(a.ea=this.ea.copy())};t=R.prototype;t.Cf=function(a){S.prototype.Cf.call(this,a);this.gf=a.gf;this.wf=a.wf;a.Sc=null;a.gb();a.Uf=this.Uf;var b=a.fromPort;null!==b&&op(b);a=a.toPort;null!==a&&op(a)}; +t.ub=function(a){a.classType===R?2===(a.value&2)?this.routing=a:a===pg||a===lg||a===kg?this.curve=a:a===Dp||a===Ep||a===Fp?this.adjusting=a:a!==Cp&&a!==mg&&v("Unknown Link enum value for a Link property: "+a):S.prototype.ub.call(this,a)};t.Xc=function(){null===this.ea&&(this.ea=new rl)};t.Ai=function(){var a=this.fromNode;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(Cj(a)||Dj(a))return!1}a=this.toNode;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),Cj(a)||Dj(a))?!1:!0};t.tv=function(){return!1}; +t.As=function(){};t.Zc=function(){return!1};R.prototype.computeAngle=function(a,b,c){return R.computeAngle(b,c)};R.computeAngle=function(a,b){switch(a){default:case mg:a=0;break;case hn:a=b;break;case an:a=b+90;break;case cn:a=b-90;break;case Gp:a=b+180;break;case jn:a=L.Ro(b);90<a&&270>a&&(a-=180);break;case bn:a=L.Ro(b+90);90<a&&270>a&&(a-=180);break;case dn:a=L.Ro(b-90);90<a&&270>a&&(a-=180);break;case en:a=L.Ro(b);if(45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return L.Ro(a)}; +function ip(a){var b=a.fromNode,c=a.toNode,d=null;null!==b?d=null!==c?b.jx(c):b.containingGroup:null!==c?d=c.containingGroup:d=null;b=d;c=a.Ah;if(c!==b){null!==c&&dp(c,a);a.Ah=b;null!==b&&cp(b,a);var e=a.containingGroupChanged;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.ca,g.ca=!0);e(a,c,b);null!==g&&(g.ca=f)}!a.Dd||a.Dw!==c&&a.Ew!==c||a.gb()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=R.prototype; +t.oh=function(){var a=this.containingGroup;null!==a&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&S.prototype.oh.call(this)};t.Io=function(a){G&&w(a,T,R,"getOtherNode:node");var b=this.fromNode;return a===b?this.toNode:b};t.Dz=function(a){G&&w(a,O,R,"getOtherPort:port");var b=this.fromPort;return a===b?this.toPort:b};function sp(a,b){null===a.xd&&(a.xd=new I);a.xd.add(b);a.w()} +t.Ko=function(a){S.prototype.Ko.call(this,a);Hp(this)&&this.Mo(this.actualBounds);if(!a){a=this.ff;var b=null;null!==a&&(b=this.fromPort,qp(a,this,b));var c=this.vf;if(null!==c){var d=this.toPort;c===a&&d===b||qp(c,this,d)}Ip(this)}};t.Lo=function(a){S.prototype.Lo.call(this,a);Hp(this)&&this.Mo(this.actualBounds);if(!a){a=this.ff;var b=null;null!==a&&(b=this.fromPort,rp(a,this,b));var c=this.vf;if(null!==c){var d=this.toPort;c===a&&d===b||rp(c,this,d)}Jp(this)}}; +t.Sj=function(){this.Dd=!0;if(null!==this.xd){var a=this.diagram;if(null!==a)for(var b=this.xd.copy().iterator;b.next();)a.remove(b.value)}null!==this.data&&(a=this.diagram,null!==a&&a.partManager.removeDataForLink(this))};R.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var a=this.diagram;null!==a&&a.partManager.updateRelationshipsFromData(this)}}; +R.prototype.move=function(a,b){var c=b?this.location:this.position,d=c.x;isNaN(d)&&(d=0);var e=c.y;isNaN(e)&&(e=0);d=a.x-d;e=a.y-e;!0===b?S.prototype.move.call(this,a,!1):(a=K.allocAt(c.x+d,c.y+e),S.prototype.move.call(this,a,!1),K.free(a));rf(this,d,e);for(a=this.labelNodes;a.next();)b=a.value,c=b.position,b.moveTo(c.x+d,c.y+e)}; +R.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowRelink)return!1;a=a.diagram;return null===a||a.allowRelink?!0:!1};R.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowRelink)return!1;a=a.diagram;return null===a||a.allowRelink?!0:!1}; +R.prototype.computeMidPoint=function(a){var b=this.pointsCount;if(0===b)return a.assign(Db),a;if(1===b)return a.assign(this.i(0)),a;if(2===b){var c=this.i(0),d=this.i(1);a.h((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===pg))return this.ya.Qu(.5,a),a.add(this.i(0)),c=this.ya.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()===pg){if(3===b){c=this.i(0);d=this.i(1);var e=this.i(2);L.Uw(c.x,c.y,d.x,d.y,d.x,d.y,e.x,e.y,a); +return a}d=(b-1)/3|0;c=3*(d/2|0);if(1===d%2){d=this.i(c);e=this.i(c+1);var f=this.i(c+2);c=this.i(c+3);L.Uw(d.x,d.y,e.x,e.y,f.x,f.y,c.x,c.y,a)}else a.assign(this.i(c));return a}var g=this.flattenedLengths;c=this.flattenedTotalLength;for(e=f=d=0;d<c/2&&f<b;){e=g[f];if(d+e>c/2)break;d+=e;f++}b=this.i(f);f=this.i(f+1);1>Math.abs(b.x-f.x)?b.y>f.y?a.h(b.x,b.y-(c/2-d)):a.h(b.x,b.y+(c/2-d)):1>Math.abs(b.y-f.y)?b.x>f.x?a.h(b.x-(c/2-d),b.y):a.h(b.x+(c/2-d),b.y):(c=(c/2-d)/e,a.h(b.x+c*(f.x-b.x),b.y+c*(f.y- +b.y)));return a}; +R.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(2===a)return this.i(0).cb(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===pg))return this.ya.px(.5);if(this.computeCurve()===pg&&4<=a){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){c=Math.floor(c);a=this.i(c);b=this.i(c+1);var d=this.i(c+2);c=this.i(c+3);return L.Ky(a.x,a.y,b.x,b.y,d.x,d.y,c.x,c.y)}if(0<c&&c+1<a)return this.i(c-1).cb(this.i(c+1))}b=this.flattenedLengths;d=this.flattenedTotalLength; +var e=0;c=0;for(var f;e<d/2&&c<a;){f=b[c];if(e+f>d/2)break;e+=f;c++}b=this.i(c);d=this.i(c+1);if(1>Math.abs(b.x-d.x)&&1>Math.abs(b.y-d.y)){if(0<c&&c+2<a)return this.i(c-1).cb(this.i(c+2))}else{if(1>Math.abs(b.x-d.x))return b.y>d.y?270:90;if(1>Math.abs(b.y-d.y))return b.x>d.x?180:0}return b.cb(d)};t=R.prototype;t.i=function(a){return this.Ob.s[a]}; +t.bd=function(a,b){G&&(w(b,K,R,"setPoint"),b.u()||v("Link.setPoint called with a Point that does not have real numbers: "+b.toString()));G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.ad(a,b)};t.P=function(a,b,c){G&&(E(b,R,"setPointAt:x"),E(c,R,"setPointAt:y"));G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.ad(a,new K(b,c))}; +t.Mz=function(a,b){G&&(w(b,K,R,"insertPoint"),b.u()||v("Link.insertPoint called with a Point that does not have real numbers: "+b.toString()));G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.Hb(a,b)};t.l=function(a,b,c){G&&(E(b,R,"insertPointAt:x"),E(c,R,"insertPointAt:y"));G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.Hb(a,new K(b,c))}; +t.ne=function(a){G&&(w(a,K,R,"addPoint"),a.u()||v("Link.addPoint called with a Point that does not have real numbers: "+a.toString()));G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.add(a)};t.zf=function(a,b){G&&(E(a,R,"insertPointAt:x"),E(b,R,"insertPointAt:y"));G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.add(new K(a,b))}; +t.lv=function(a){G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.sb(a)};t.Nj=function(){G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.clear()}; +function rf(a,b,c){if(0!==b||0!==c)if(0===a.pointsCount)a.defaultFromPoint&&a.defaultFromPoint.offset(b,c),a.defaultToPoint&&a.defaultToPoint.offset(b,c);else{for(var d=a.Dd,e=new H,f=a.Ob.iterator;f.next();){var g=f.value;e.add((new K(g.x+b,g.y+c)).freeze())}e.freeze();f=a.Ob;a.Ob=e;g=a.diagram;isNaN(b)||isNaN(c)||null!==g&&g.animationManager.Eb?a.w():(a.je.h(a.je.x+b,a.je.y+c),a.va.h(a.va.x+b,a.va.y+c),Ol(a));d?Kp(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint= +a.i(a.pointsCount-1)));null!==g&&g.animationManager.Eb&&(b=g.animationManager,a.sf=e,b.ql.add(a));a.g("points",f,e)}}t.uh=function(){null===this.Sc&&(this.Sc=this.Ob,this.Ob=this.Ob.copy())}; +t.Bf=function(){if(null!==this.Sc){for(var a=this.Sc,b=this.Ob,c=Infinity,d=Infinity,e=a.s,f=e.length,g=0;g<f;g++){var h=e[g];c=Math.min(h.x,c);d=Math.min(h.y,d)}h=g=Infinity;for(var k=b.s,l=k.length,m=0;m<l;m++){var n=k[m];g=Math.min(n.x,g);h=Math.min(n.y,h);n.freeze()}b.freeze();if(l===f)for(f=0;f<l;f++){if(m=e[f],n=k[f],m.x-c!==n.x-g||m.y-d!==n.y-h){this.sc(!0);break}}else this.sc(!0);this.Sc=null;c=this.diagram;null!==c&&c.animationManager.Eb&&(c=c.animationManager,this.sf=b,c.ql.add(this));Kp(this); +this.g("points",a,b)}};t.nv=function(){null!==this.Sc&&(this.Ob=this.Sc,this.Sc=null)};function Kp(a){0===a.Ob.count?a.Dd=!1:(a.Dd=!0,a.Tp=null,a.kt=NaN,a.defaultFromPoint=a.i(0),a.defaultToPoint=a.i(a.pointsCount-1),Lp(a,!1))} +t.gb=function(){if(!this.suspendsRouting){var a=this.diagram;if(a){if(a.ns.contains(this)||a.undoManager.isUndoingRedoing)return;a=a.animationManager;if(a.isTicking&&!a.isAnimating)return;null!==this.sf&&!a.isTicking&&a.isAnimating&&(this.sf=null)}a=this.path;null!==a&&(this.Dd=!1,this.w(),a.w())}}; +t.yg=function(){if(!this.Dd&&!this.computingPoints){var a=!0;try{this.computingPoints=!0,this.uh(),a=this.computePoints()}catch(b){this.computingPoints=!1,this.nv()}finally{this.computingPoints=!1,a?this.Bf():this.nv()}}}; +R.prototype.computePoints=function(){if(null===this.diagram)return!1;var a=this.fromNode,b=null;null===a?(Mp||(Mp=new T,Mp.desiredSize=Pb,Mp.eb()),this.defaultFromPoint&&(Mp.location=this.defaultFromPoint,Mp.eb(),b=a=Mp)):b=this.fromPort;if(null!==b&&!a.isVisible()){var c=a.findVisibleNode();null!==c&&c!==a?(a=c,b=c.port):a=c}this.Dw=a;if(null===a||!a.location.u())return!1;for(;!(null===b||b.actualBounds.u()&&b.Lf());)b=b.panel;if(null===b)return!1;var d=this.toNode,e=null;null===d?(Np||(Np=new T, +Np.desiredSize=Pb,Np.eb()),this.defaultToPoint&&(Np.location=this.defaultToPoint,Np.eb(),e=d=Np)):e=this.toPort;null===e||d.isVisible()||(c=d.findVisibleNode(),null!==c&&c!==d?(d=c,e=c.port):d=c);this.Ew=d;if(null===d||!d.location.u())return!1;for(;!(null===e||e.actualBounds.u()&&e.Lf());)e=e.panel;if(null===e)return!1;var f=this.pointsCount,g=this.computeSpot(!0,b);c=this.computeSpot(!1,e);var h=Op(g),k=Op(c),l=b===e&&null!==b,m=this.isOrthogonal,n=this.curve===pg;this.Yf=l&&!m?n=!0:!1;var p=this.computeAdjusting()=== +mg||l;if(!m&&!l&&h&&k){if(h=!1,!p&&3<=f&&(p=this.getLinkPoint(a,b,g,!0,!1,d,e),k=this.getLinkPoint(d,e,c,!1,!1,a,b),h=this.adjustPoints(0,p,f-1,k))&&(p=this.getLinkPoint(a,b,g,!0,!1,d,e),k=this.getLinkPoint(d,e,c,!1,!1,a,b),this.adjustPoints(0,p,f-1,k)),!h)if(this.Nj(),n){f=this.getLinkPoint(a,b,g,!0,!1,d,e);p=this.getLinkPoint(d,e,c,!1,!1,a,b);h=p.x-f.x;k=p.y-f.y;l=this.computeCurviness();n=m=0;var r=f.x+h/3,q=f.y+k/3,u=r,x=q;L.C(k,0)?x=0<h?x-l:x+l:(m=-h/k,n=Math.sqrt(l*l/(m*m+1)),0>l&&(n=-n),u= +(0>k?-1:1)*n+r,x=m*(u-r)+q);r=f.x+2*h/3;q=f.y+2*k/3;var y=r,z=q;L.C(k,0)?z=0<h?z-l:z+l:(y=(0>k?-1:1)*n+r,z=m*(y-r)+q);this.Nj();this.ne(f);this.zf(u,x);this.zf(y,z);this.ne(p);this.bd(0,this.getLinkPoint(a,b,g,!0,!1,d,e));this.bd(3,this.getLinkPoint(d,e,c,!1,!1,a,b))}else if(f=d,p=e,d=this.getLinkPoint(a,b,g,!0,!1,f,p),e=this.getLinkPoint(f,p,c,!1,!1,a,b),this.hasCurviness())p=e.x-d.x,c=e.y-d.y,g=this.computeCurviness(),a=d.x+p/2,b=d.y+c/2,f=a,h=b,L.C(c,0)?h=0<p?h-g:h+g:(p=-p/c,f=Math.sqrt(g*g/(p* +p+1)),0>g&&(f=-f),f=(0>c?-1:1)*f+a,h=p*(f-a)+b),this.ne(d),this.zf(f,h),this.ne(e);else{this.ne(d);this.ne(e);h=M.alloc();b.ti(h);k=h.ga(e);p.ti(h);l=h.ga(d);if(k||l)g=b.oa(Pp(g),new K),this.bd(0,this.getLinkPointFromPoint(a,b,g,e,!0,g)),c=p.oa(Pp(c),new K),this.bd(1,this.getLinkPointFromPoint(f,p,c,d,!1,c));M.free(h)}}else{n=this.isAvoiding;p&&(m&&n||l)&&this.Nj();var B=l?this.computeCurviness():0;n=this.getLinkPoint(a,b,g,!0,m,d,e);r=u=q=0;if(m||!h||l)x=this.computeEndSegmentLength(a,b,g,!0),r= +this.getLinkDirection(a,b,n,g,!0,m,d,e),l&&(h||g.D(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(r-=m?90:30,0>B&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),l&&(x+=Math.abs(B)*(m?1:2)),0===r?q=x:90===r?u=x:180===r?q=-x:270===r?u=-x:(q=x*Math.cos(r*Math.PI/180),u=x*Math.sin(r*Math.PI/180)),g.kc()&&l&&(x=b.oa(Kc,K.alloc()),y=K.allocAt(x.x+1E3*q,x.y+1E3*u),this.getLinkPointFromPoint(a,b,x,y,!0,n),K.free(x),K.free(y));x=this.getLinkPoint(d,e,c,!1,m,a,b);var C=z=y=0;if(m||!k||l){var D=this.computeEndSegmentLength(d,e, +c,!1);C=this.getLinkDirection(d,e,x,c,!1,m,a,b);l&&(k||g.D(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(C+=m?0:30,0>B&&(C+=180));0>C?C+=360:360<=C&&(C-=360);l&&(D+=Math.abs(B)*(m?1:2));0===C?y=D:90===C?z=D:180===C?y=-D:270===C?z=-D:(y=D*Math.cos(C*Math.PI/180),z=D*Math.sin(C*Math.PI/180));c.kc()&&l&&(c=e.oa(Kc,K.alloc()),g=K.allocAt(c.x+1E3*y,c.y+1E3*z),this.getLinkPointFromPoint(d,e,c,g,!1,x),K.free(c),K.free(g))}c=n;if(m||!h||l)c=new K(n.x+q,n.y+u);g=x;if(m||!k||l)g=new K(x.x+y,x.y+z);!p&&!m&&h&&3<f&&this.adjustPoints(0, +n,f-2,g)?this.bd(f-1,x):!p&&!m&&k&&3<f&&this.adjustPoints(1,c,f-1,x)?this.bd(0,n):!p&&(m?6<=f:4<f)&&this.adjustPoints(1,c,f-2,g)?(this.bd(0,n),this.bd(f-1,x)):(this.Nj(),this.ne(n),(m||!h||l)&&this.ne(c),m&&this.addOrthoPoints(c,r,g,C,a,d),(m||!k||l)&&this.ne(g),this.ne(x))}return!0};function Qp(a,b){Math.abs(b.x-a.x)>Math.abs(b.y-a.y)?(b.x>=a.x?b.x=a.x+9E9:b.x=a.x-9E9,b.y=a.y):(b.y>=a.y?b.y=a.y+9E9:b.y=a.y-9E9,b.x=a.x);return b} +R.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new K);if(null===a||null===b)return f.assign(c),f;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));a=null;e=b.panel;null===e||e.se()||(e=e.panel);if(null===e){e=d.x;d=d.y;var g=c.x;c=c.y}else{a=e.oe;e=1/(a.m11*a.m22-a.m12*a.m21);g=a.m22*e;var h=-a.m12*e,k=-a.m21*e,l=a.m11*e,m=e*(a.m21*a.dy-a.m22*a.dx),n=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*g+d.y*k+m;d=d.x*h+d.y*l+n;g=c.x*g+c.y*k+m;c=c.x*h+c.y*l+n}b.Xj(e,d,g,c,f);null!== +a&&f.transform(a);return f};function Rp(a,b){var c=b.Tn;null===c&&(c=new Sp,c.port=b,c.node=b.part,b.Tn=c);return Tp(c,a)} +R.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0===h&&(h=new K);if(c.mb()&&!Op(c))return b.oa(c,h),h;if(c.$c()){var k=Rp(this,b);if(null!==k){h.assign(k.Po);if(e&&this.routing===Up){var l=Rp(this,g);if(null!==l&&k.Hl<l.Hl){k=K.alloc();l=K.alloc();var m=new M(b.oa(Fc,k),b.oa(Oc,l)),n=this.computeSpot(!d,g);a=this.getLinkPoint(f,g,n,!d,e,a,b,l);(c.Jf(Rc)||c.Jf(Sc))&&a.y>=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.Jf(Qc)||c.Jf(Tc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);K.free(k);K.free(l)}}return h}}c= +b.oa(Pp(c),K.alloc());this.pointsCount>(e?6:2)?(g=d?this.i(1):this.i(this.pointsCount-2),e&&(g=Qp(c,g.copy()))):(k=this.computeSpot(!d,g),f=K.alloc(),g=g.oa(Pp(k),f),e&&(g=Qp(c,g)),K.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);K.free(c);return h}; +R.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.mb())var k=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x<d.y?d.x>1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5<d.x?45:0;else{if(d.$c()&&(k=Rp(this,b),null!==k))switch(k.Mc){case 1:k=270;break a;case 2:k=180;break a;default:case 4:k=0;break a;case 8:k=90;break a}k=b.oa(Kc,K.alloc());this.pointsCount>(f?6:2)?(h=e?this.i(1):this.i(this.pointsCount-2),h=f?Qp(k,h.copy()):c):(c=K.alloc(),h=h.oa(Kc,c),K.free(c));c=Math.abs(h.x-k.x)>Math.abs(h.y-k.y)?h.x>= +k.x?0:180:h.y>=k.y?90:270;K.free(k);k=c}d.kc()&&g.Sd(a)&&(k+=180,360<=k&&(k-=360));if(Op(d))return k;a=b.si();if(0===a)return k;45<=a&&135>a?k+=90:135<=a&&225>a?k+=180:225<=a&&315>a&&(k+=270);360<=k&&(k-=360);return k};R.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.$c()&&(a=Rp(this,b),null!==a))return a.Iu;a=d?this.fromEndSegmentLength:this.toEndSegmentLength;null!==b&&isNaN(a)&&(a=d?b.fromEndSegmentLength:b.toEndSegmentLength);isNaN(a)&&(a=10);return a}; +R.prototype.computeSpot=function(a,b){void 0===b&&(b=null);a?(a=b?b:this.fromPort,null===a?a=Kc:(b=this.fromSpot,b.Rb()&&(b=a.fromSpot),a=b===hd?Ec:b)):(a=b?b:this.toPort,null===a?a=Kc:(b=this.toSpot,b.Rb()&&(b=a.toSpot),a=b===hd?Ec:b));return a};function Op(a){return a===Ec||.5===a.x&&.5===a.y}function Pp(a){return.5===a.x&&.5===a.y?a:Kc} +R.prototype.computeOtherPoint=function(a,b){if(this.computeAdjusting()!==mg&&4<this.pointsCount)return this.computeMidPoint(new K);a=b.Tn;a=null!==a?Tp(a,this):null;return null!==a?a.Po:b.oa(Kc)};R.prototype.computeShortLength=function(a){if(a){a=this.fromShortLength;if(isNaN(a)){var b=this.fromPort;null!==b&&(a=b.fromShortLength)}return isNaN(a)?0:a}a=this.toShortLength;isNaN(a)&&(b=this.toPort,null!==b&&(a=b.toShortLength));return isNaN(a)?0:a}; +R.prototype.Ff=function(a,b,c,d,e,f){if(!1===this.pickable)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var g=f;void 0===f&&(g=Jb.alloc(),g.reset());g.multiply(this.transform);if(this.hh(a,g))return tn(this,b,c,e),void 0===f&&Jb.free(g),!0;if(this.Yc(a,g)){var h=!1;if(!this.isAtomic)for(var k=this.U.s,l=k.length;l--;){var m=k[l];if(m.visible||m===this.locationObject){var n=m.actualBounds,p=this.naturalBounds;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=Jb.alloc();n.set(g); +if(m instanceof V)h=m.Ff(a,b,c,d,e,n);else if(this.path===m){if(m instanceof Qf)if(h=a,p=d,!1===m.pickable)h=!1;else if(n.multiply(m.transform),p)b:{var r=h,q=n;if(m.hh(r,q))h=!0;else{if(void 0===q&&(q=m.transform,r.Re(m.actualBounds))){h=!0;break b}h=r.left;p=r.right;var u=r.top;r=r.bottom;var x=K.alloc(),y=K.alloc(),z=K.alloc(),B=Jb.alloc();B.set(q);B.bv(m.transform);B.gs();y.x=p;y.y=u;y.transform(B);x.x=h;x.y=u;x.transform(B);q=!1;Sn(m,x,y,z)?q=!0:(x.x=p,x.y=r,x.transform(B),Sn(m,x,y,z)?q=!0:(y.x= +h,y.y=r,y.transform(B),Sn(m,x,y,z)?q=!0:(x.x=h,x.y=u,x.transform(B),Sn(m,x,y,z)&&(q=!0))));Jb.free(B);K.free(x);K.free(y);K.free(z);h=q}}else h=m.hh(h,n)}else h=vl(m,a,d,n);h&&(p=m,null!==b&&(p=b(m)),p&&(null===c||c(p))&&e.add(p));Jb.free(n)}}}void 0===f&&Jb.free(g);return h||null!==this.background||null!==this.areaBackground}void 0===f&&Jb.free(g);return!1}; +R.prototype.computeCurve=function(){if(null===this.Yf){var a=this.fromPort,b=this.isOrthogonal;this.Yf=null!==a&&a===this.toPort&&!b}return this.Yf?pg:this.curve};R.prototype.computeCorner=function(){if(this.curve===pg)return 0;var a=this.corner;if(isNaN(a)||0>a)a=10;return a}; +R.prototype.findMidLabel=function(){for(var a=this.path,b=this.U.s,c=b.length,d=0;d<c;d++){var e=b[d];if(e!==a&&!e.isPanelMain&&(-Infinity===e.segmentIndex||isNaN(e.segmentIndex)))return e}for(a=this.labelNodes;a.next();)if(b=a.value,-Infinity===b.segmentIndex||isNaN(b.segmentIndex))return b;return null}; +R.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a=Vp;a=Math.max(a,this.computeThickness());var b=this.fromPort,c=this.toPort;if(null!==b&&null!==c){var d=this.findMidLabel();if(null!==d){var e=d.naturalBounds,f=d.margin,g=isNaN(e.width)?30:e.width*d.scale+f.left+f.right;e=isNaN(e.height)?14:e.height*d.scale+f.top+f.bottom;d=d.segmentOrientation;d===hn||d===jn||d===Gp?a=Math.max(a,e):d===cn||d===dn||d===an||d===bn?a=Math.max(a,g):(b=b.oa(Kc).cb(c.oa(Kc))/180*Math.PI,a=Math.max(a, +Math.abs(Math.sin(b)*g)+Math.abs(Math.cos(b)*e)+1));this.curve===pg&&(a*=1.333)}}return a};R.prototype.arrangeBundledLinks=function(a,b){if(b)for(b=0;b<a.length;b++){var c=a[b];c.computeAdjusting()===mg&&c.gb()}}; +R.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=Wp;var b=this.Uf;if(null!==b){for(var c=Na(),d=0,e=b.links,f=0;f<e.length;f++){var g=e[f].computeSpacing();c.push(g);d+=g}d=-d/2;for(f=0;f<e.length;f++){if(e[f]===this){a=d+c[f]/2;break}d+=c[f]}b.qs===this.fromNode&&(a=-a);Pa(c)}}return a};R.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return null!==a?Math.max(a.strokeWidth,1):1}; +R.prototype.hasCurviness=function(){return!isNaN(this.curviness)||null!==this.Uf}; +R.prototype.adjustPoints=function(a,b,c,d){var e=this.computeAdjusting();if(this.isOrthogonal){if(e===Ep)return!1;e===Fp&&(e=Dp)}switch(e){case Ep:var f=this.i(a),g=this.i(c);if(!f.fb(b)||!g.fb(d)){e=f.x;f=f.y;var h=g.x-e,k=g.y-f,l=Math.sqrt(h*h+k*k);if(!L.ha(l,0)){if(L.ha(h,0))var m=0>k?-Math.PI/2:Math.PI/2;else m=Math.atan(k/Math.abs(h)),0>h&&(m=Math.PI-m);g=b.x;var n=b.y;h=d.x-g;var p=d.y-n;k=Math.sqrt(h*h+p*p);L.ha(h,0)?p=0>p?-Math.PI/2:Math.PI/2:(p=Math.atan(p/Math.abs(h)),0>h&&(p=Math.PI-p)); +l=k/l;m=p-m;this.bd(a,b);for(a+=1;a<c;a++)b=this.i(a),h=b.x-e,k=b.y-f,b=Math.sqrt(h*h+k*k),L.ha(b,0)||(L.ha(h,0)?k=0>k?-Math.PI/2:Math.PI/2:(k=Math.atan(k/Math.abs(h)),0>h&&(k=Math.PI-k)),h=k+m,b*=l,this.P(a,g+b*Math.cos(h),n+b*Math.sin(h)));this.bd(c,d)}}return!0;case Fp:f=this.i(a);n=this.i(c);if(!f.fb(b)||!n.fb(d)){e=f.x;f=f.y;g=n.x;n=n.y;l=(g-e)*(g-e)+(n-f)*(n-f);h=b.x;m=b.y;k=d.x;p=d.y;var r=1;if(0!==k-h){var q=(p-m)/(k-h);r=Math.sqrt(1+1/(q*q))}else q=9E9;this.bd(a,b);for(a+=1;a<c;a++){b=this.i(a); +var u=b.x,x=b.y,y=.5;0!==l&&(y=((e-u)*(e-g)+(f-x)*(f-n))/l);var z=e+y*(g-e),B=f+y*(n-f);b=Math.sqrt((u-z)*(u-z)+(x-B)*(x-B));x<q*(u-z)+B&&(b=-b);0<q&&(b=-b);u=h+y*(k-h);y=m+y*(p-m);0!==q?(b=u+b/r,this.P(a,b,y-(b-u)/q)):this.P(a,u,y+b)}this.bd(c,d)}return!0;case Dp:a:{if(this.isOrthogonal&&(e=this.i(a),f=this.i(a+1),g=this.i(a+2),h=f.x,m=f.y,n=h,l=m,L.C(e.y,f.y)?L.C(f.x,g.x)?m=b.y:L.C(f.y,g.y)&&(h=b.x):L.C(e.x,f.x)&&(L.C(f.y,g.y)?h=b.x:L.C(f.x,g.x)&&(m=b.y)),this.P(a+1,h,m),e=this.i(c),f=this.i(c- +1),g=this.i(c-2),h=f.x,m=f.y,k=h,p=m,L.C(e.y,f.y)?L.C(f.x,g.x)?m=d.y:L.C(f.y,g.y)&&(h=d.x):L.C(e.x,f.x)&&(L.C(f.y,g.y)?h=d.x:L.C(f.x,g.x)&&(m=d.y)),this.P(c-1,h,m),Zj(this))){this.P(a+1,n,l);this.P(c-1,k,p);c=!1;break a}this.bd(a,b);this.bd(c,d);c=!0}return c;default:return!1}}; +R.prototype.addOrthoPoints=function(a,b,c,d,e,f){0>b?b+=360:360<=b&&(b-=360);0>d?d+=360:360<=d&&(d-=360);var g=d;b=315<=b||45>b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=315<=d||45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.actualBounds.copy(),k=f.actualBounds.copy();if(h.u()&&k.u()){h.Bc(Xp,Xp);k.Bc(Xp,Xp);h.Ze(a);k.Ze(c);var l=K.alloc(),m=K.alloc();if(0===b)if(c.x>a.x||270===d&&c.y<a.y&&k.right>a.x||90===d&&c.y>a.y&&k.right>a.x)l.h(c.x,a.y),m.h(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x, +a.y,c.x,c.y,!1),m.x=l.x,m.y=c.y):270===d&&c.y<a.y||90===d&&c.y>a.y?(l.x=a.x<k.left?this.computeMidOrthoPosition(a.x,a.y,k.left,c.y,!1):a.x<k.right&&(270===d&&a.y<k.top||90===d&&a.y>k.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.x<k.left&&a.y>k.top&&a.y<k.bottom&&(l.x=a.x,l.y=a.y<c.y?Math.min(c.y,k.top):Math.max(c.y,k.bottom),m.y=l.y);else{l.h(a.x,c.y);m.h((a.x+c.x)/2,c.y);if(180===d||90===d&&c.y<h.top||270===d&&c.y>h.bottom)180===d&&(k.ga(a)||h.ga(c))? +l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.y<a.y&&(180===d||90===d)?l.y=this.computeMidOrthoPosition(a.x,h.top,c.x,Math.max(c.y,k.bottom),!0):c.y>a.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,c.x,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y<h.bottom)if(c.x>=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l.h(Math.max((a.x+c.x)/2,a.x),a.y),m.h(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.y<a.y?Math.min(c.y,0===d?h.top:Math.min(h.top, +k.top)):Math.max(c.y,0===d?h.bottom:Math.max(h.bottom,k.bottom)),m.x=c.x,m.y=l.y}else if(180===b)if(c.x<a.x||270===d&&c.y<a.y&&k.left<a.x||90===d&&c.y>a.y&&k.left<a.x)l.h(c.x,a.y),m.h(c.x,(a.y+c.y)/2),0===d?(l.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1),m.x=l.x,m.y=c.y):270===d&&c.y<a.y||90===d&&c.y>a.y?(l.x=a.x>k.right?this.computeMidOrthoPosition(a.x,a.y,k.right,c.y,!1):a.x>k.left&&(270===d&&a.y<k.top||90===d&&a.y>k.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):k.left,m.x=l.x, +m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.y<k.bottom&&(l.x=a.x,l.y=a.y<c.y?Math.min(c.y,k.top):Math.max(c.y,k.bottom),m.y=l.y);else{l.h(a.x,c.y);m.h((a.x+c.x)/2,c.y);if(0===d||90===d&&c.y<h.top||270===d&&c.y>h.bottom)0===d&&(k.ga(a)||h.ga(c))?l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.y<a.y&&(0===d||90===d)?l.y=this.computeMidOrthoPosition(a.x,h.top,c.x,Math.max(c.y,k.bottom),!0):c.y>a.y&&(0===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,c.x,Math.min(c.y,k.top),!0)),m.x= +c.x,m.y=l.y;if(l.y>h.top&&l.y<h.bottom)if(c.x<=h.right&&c.x>=a.x||a.x>=k.left&&a.x<=c.x){if(90===d||270===d)l.h(Math.min((a.x+c.x)/2,a.x),a.y),m.h(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.y<a.y?Math.min(c.y,180===d?h.top:Math.min(h.top,k.top)):Math.max(c.y,180===d?h.bottom:Math.max(h.bottom,k.bottom)),m.x=c.x,m.y=l.y}else if(90===b)if(c.y>a.y||180===d&&c.x<a.x&&k.bottom>a.y||0===d&&c.x>a.x&&k.bottom>a.y)l.h(a.x,c.y),m.h((a.x+c.x)/2,c.y),270===d?(l.y=this.computeMidOrthoPosition(a.x,a.y,c.x, +c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.x<a.x||0===d&&c.x>a.x?(l.y=a.y<k.top?this.computeMidOrthoPosition(a.x,a.y,c.x,k.top,!0):a.y<k.bottom&&(180===d&&a.x<k.left||0===d&&a.x>k.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):k.bottom,m.x=c.x,m.y=l.y):90===d&&a.y<k.top&&a.x>k.left&&a.x<k.right&&(l.x=a.x<c.x?Math.min(c.x,k.left):Math.max(c.x,k.right),l.y=a.y,m.x=l.x);else{l.h(c.x,a.y);m.h(c.x,(a.y+c.y)/2);if(270===d||0===d&&c.x<h.left||180===d&&c.x>h.right)270===d&&(k.ga(a)||h.ga(c))?l.x=this.computeMidOrthoPosition(a.x, +a.y,c.x,c.y,!1):c.x<a.x&&(270===d||0===d)?l.x=this.computeMidOrthoPosition(h.left,a.y,Math.max(c.x,k.right),c.y,!1):c.x>a.x&&(270===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,a.y,Math.min(c.x,k.left),c.y,!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x<h.right)if(c.y>=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l.h(a.x,Math.max((a.y+c.y)/2,a.y)),m.h(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x<a.x?Math.min(c.x,90===d?h.left:Math.min(h.left,k.left)):Math.max(c.x,90===d?h.right: +Math.max(h.right,k.right)),m.x=l.x,m.y=c.y}else if(c.y<a.y||180===d&&c.x<a.x&&k.top<a.y||0===d&&c.x>a.x&&k.top<a.y)l.h(a.x,c.y),m.h((a.x+c.x)/2,c.y),90===d?(l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.x<a.x||0===d&&c.x>=a.x?(l.y=a.y>k.bottom?this.computeMidOrthoPosition(a.x,a.y,c.x,k.bottom,!0):a.y>k.top&&(180===d&&a.x<k.left||0===d&&a.x>k.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.x<k.right&& +(l.x=a.x<c.x?Math.min(c.x,k.left):Math.max(c.x,k.right),l.y=a.y,m.x=l.x);else{l.h(c.x,a.y);m.h(c.x,(a.y+c.y)/2);if(90===d||0===d&&c.x<h.left||180===d&&c.x>h.right)90===d&&(k.ga(a)||h.ga(c))?l.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):c.x<a.x&&(90===d||0===d)?l.x=this.computeMidOrthoPosition(h.left,a.y,Math.max(c.x,k.right),c.y,!1):c.x>a.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,a.y,Math.min(c.x,k.left),c.y,!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x<h.right)if(c.y<=h.bottom&& +c.y>=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l.h(a.x,Math.min((a.y+c.y)/2,a.y)),m.h(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x<a.x?Math.min(c.x,270===d?h.left:Math.min(h.left,k.left)):Math.max(c.x,270===d?h.right:Math.max(h.right,k.right)),m.x=l.x,m.y=c.y}var n=c;if(this.isAvoiding){var p=this.diagram;if(null===p||e===f||this.layer.isTemporary||!qk(p)||h.ga(n)&&!f.Sd(e)||k.ga(a)&&!e.Sd(f))b=!1;else{var r=rk(p,!0,this.containingGroup,null);if(17!==this.segmentIndex&&r.ak(Math.min(a.x,l.x), +Math.min(a.y,l.y),Math.abs(a.x-l.x),Math.abs(a.y-l.y))&&r.ak(Math.min(l.x,m.x),Math.min(l.y,m.y),Math.abs(l.x-m.x),Math.abs(l.y-m.y))&&r.ak(Math.min(m.x,n.x),Math.min(m.y,n.y),Math.abs(m.x-n.x),Math.abs(m.y-n.y)))b=!1;else{e=a;f=n;var q=c=null;if(p.isVirtualized){p=r.bounds.copy();p.Bc(-r.xo,-r.wo);var u=K.alloc();wk(r,a.x,a.y)||(L.If(p.x,p.y,p.x+p.width,p.y+p.height,a.x,a.y,l.x,l.y,u)?(c=a=u.copy(),b=u.cb(l)):L.If(p.x,p.y,p.x+p.width,p.y+p.height,l.x,l.y,m.x,m.y,u)?(c=a=u.copy(),b=u.cb(m)):L.If(p.x, +p.y,p.x+p.width,p.y+p.height,m.x,m.y,n.x,n.y,u)&&(c=a=u.copy(),b=u.cb(n)));wk(r,n.x,n.y)||(L.If(p.x,p.y,p.x+p.width,p.y+p.height,n.x,n.y,m.x,m.y,u)?(q=n=u.copy(),d=m.cb(u)):L.If(p.x,p.y,p.x+p.width,p.y+p.height,m.x,m.y,l.x,l.y,u)?(q=n=u.copy(),d=l.cb(u)):L.If(p.x,p.y,p.x+p.width,p.y+p.height,l.x,l.y,a.x,a.y,u)&&(q=n=u.copy(),d=a.cb(u)));K.free(u)}h=h.copy().cd(k);h.Bc(r.xo*r.Cs,r.wo*r.Cs);Yp(r,a,b,n,d,h,!0);k=Zp(r,n.x,n.y);!r.abort&&k>=$p&&(vk(r),h.Bc(r.xo*r.Ex,r.wo*r.Fx),Yp(r,a,b,n,d,h,!1),k=Zp(r, +n.x,n.y));if(!r.abort&&k<$p&&Zp(r,n.x,n.y)!==xk){aq(this,r,n.x,n.y,d,!0,g);h=this.i(2);if(4>this.pointsCount)0===b||180===b?(h.x=a.x,h.y=n.y):(h.x=n.x,h.y=a.y),this.P(2,h.x,h.y),this.l(3,h.x,h.y);else if(g=this.i(3),0===b||180===b)L.C(h.x,g.x)?(h=0===b?Math.max(h.x,a.x):Math.min(h.x,a.x),this.P(2,h,a.y),this.P(3,h,g.y)):L.C(h.y,g.y)?(Math.abs(a.y-h.y)<=r.wo/2&&(this.P(2,h.x,a.y),this.P(3,g.x,a.y)),this.l(2,h.x,a.y)):this.P(2,a.x,h.y);else if(90===b||270===b)L.C(h.y,g.y)?(h=90===b?Math.max(h.y,a.y): +Math.min(h.y,a.y),this.P(2,a.x,h),this.P(3,g.x,h)):L.C(h.x,g.x)?(Math.abs(a.x-h.x)<=r.xo/2&&(this.P(2,a.x,h.y),this.P(3,a.x,g.y)),this.l(2,a.x,h.y)):this.P(2,h.x,a.y);null!==c&&(a=this.i(1),g=this.i(2),a.x!==g.x&&a.y!==g.y?0===b||180===b?this.l(2,a.x,g.y):this.l(2,g.x,a.y):0===b||180===b?this.l(2,e.x,c.y):this.l(2,c.x,e.y));null!==q&&(0===d||180===d?this.zf(f.x,q.y):this.zf(q.x,f.y));b=!0}else b=!1}}}else b=!1;b||(this.ne(l.copy()),this.ne(m.copy()));K.free(l);K.free(m)}}; +R.prototype.computeMidOrthoPosition=function(a,b,c,d,e){var f=0;!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(f=this.computeCurviness());return e?(b+d)/2+f:(a+c)/2+f}; +function Zj(a){if(null===a.diagram||!a.isAvoiding||!qk(a.diagram))return!1;var b=a.points.s,c=b.length;if(4>c)return!1;a=rk(a.diagram,!0,a.containingGroup,null);for(var d=1;d<c-2;d++){var e=b[d],f=b[d+1];if(!a.ak(Math.min(e.x,f.x),Math.min(e.y,f.y),Math.abs(e.x-f.x),Math.abs(e.y-f.y)))return!0}return!1} +function aq(a,b,c,d,e,f,g){var h=b.xo,k=b.wo,l=Zp(b,c,d),m=c,n=d;0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k;e!==g&&l>bq&&Zp(b,m,n)!==l-1&&(Zp(b,c-h,d)===l-1?(e=180,m=c-h,n=d):Zp(b,c+h,d)===l-1?(e=0,m=c+h,n=d):Zp(b,c,d-k)===l-1?(e=270,m=c,n=d-k):Zp(b,c,d+k)===l-1&&(e=90,m=c,n=d+k));for(;l>bq&&Zp(b,m,n)===l-1;)c=m,d=n,0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k,--l;if(f){if(l>bq)if(180===e||0===e)c=Math.floor(c/h)*h+h/2;else if(90===e||270===e)d=Math.floor(d/k)*k+k/2}else c=Math.floor(c/h)*h+h/2,d=Math.floor(d/ +k)*k+k/2;l>bq&&(f=e,g=c,m=d,0===e?(f=90,m+=k):90===e?(f=180,g-=h):180===e?(f=270,m-=k):270===e&&(f=0,g+=h),Zp(b,g,m)===l-1?aq(a,b,g,m,f,!1,f):(g=c,m=d,0===e?(f=270,m-=k):90===e?(f=0,g+=h):180===e?(f=90,m+=k):270===e&&(f=180,g-=h),Zp(b,g,m)===l-1&&aq(a,b,g,m,f,!1,f)));a.zf(c,d)} +R.prototype.fz=function(a){G&&w(a,K,R,"findClosestSegment:p");var b=a.x;a=a.y;for(var c=this.i(0),d=this.i(1),e=Lb(b,a,c.x,c.y,d.x,d.y),f=0,g=1;g<this.pointsCount-1;g++){c=this.i(g+1);var h=Lb(b,a,d.x,d.y,c.x,c.y);d=c;h<e&&(f=g,e=h)}return f};R.prototype.sc=function(a){this.mm=!1;a&&this.w()}; +R.prototype.ck=function(a){if(!a){if(!1===this.Dd)return;a=this.Ab();if(this.mm&&(null===a||null!==a.geometry))return}this.ya=this.makeGeometry();a=this.path;if(null!==a){a.ya=this.ya;for(var b=this.U.s,c=b.length,d=0;d<c;d++){var e=b[d];e!==a&&e.isPanelMain&&e instanceof Qf&&(e.ya=this.ya)}}}; +R.prototype.makeGeometry=function(){var a=this.ya,b=this.pointsCount;if(2>b)return a.type=N.j,this.mm=!0,a;var c=!1,d=this.diagram;null!==d&&Hp(this)&&d.Eh.contains(this)&&(0!==this.ol.width||0!==this.ol.height)&&(c=!0);var e=this.i(0).copy(),f=e.copy();d=this.Ob.s;var g=this.computeCurve();if(g===pg&&3<=b&&!L.ha(this.smoothness,0))if(3===b){var h=this.i(1);d=Math.min(e.x,h.x);var k=Math.min(e.y,h.y);h=this.i(2);d=Math.min(d,h.x);k=Math.min(k,h.y)}else{if(this.isOrthogonal)for(k=0;k<b;k++)h=d[k], +f.x=Math.min(h.x,f.x),f.y=Math.min(h.y,f.y);else for(d=3;d<b;d+=3)d+3>=b&&(d=b-1),k=this.i(d),f.x=Math.min(k.x,f.x),f.y=Math.min(k.y,f.y);d=f.x;k=f.y}else{for(k=0;k<b;k++)h=d[k],f.x=Math.min(h.x,f.x),f.y=Math.min(h.y,f.y);d=f.x;k=f.y}d-=this.ku.x;k-=this.ku.y;e.x-=d;e.y-=k;if(2!==b||Hp(this)){a.type=N.m;h=Jd(a);0!==this.computeShortLength(!0)&&(e=cq(this,e,!0,f));Kd(h,e.x,e.y,!1);if(g===pg&&3<=b&&!L.ha(this.smoothness,0))if(3===b)c=this.i(1),b=c.x-d,c=c.y-k,e=this.i(2).copy(),e.x-=d,e.y-=k,0!==this.computeShortLength(!1)&& +(e=cq(this,e,!1,f)),Ld(h,b,c,b,c,e.x,e.y);else if(this.isOrthogonal){b=K.allocAt(d,k);c=K.alloc();c.assign(this.i(1));f=K.allocAt(d,k);e=K.allocAt(d,k);g=this.i(0);for(var l,m=this.smoothness/3,n=1;n<this.pointsCount-1;n++){l=this.i(n);var p=g,r=l,q=this.i(dq(this,l,n,!1));if(!L.ha(p.x,r.x)||!L.ha(r.x,q.x))if(!L.ha(p.y,r.y)||!L.ha(r.y,q.y)){var u=m;isNaN(u)&&(u=this.smoothness/3);var x=p.x;p=p.y;var y=r.x;r=r.y;var z=q.x;q=q.y;var B=u*eq(x,p,y,r);u*=eq(y,r,z,q);L.ha(p,r)&&L.ha(y,z)&&(y>x?q>r?(f.x= +y-B,f.y=r-B,e.x=y+u,e.y=r+u):(f.x=y-B,f.y=r+B,e.x=y+u,e.y=r-u):q>r?(f.x=y+B,f.y=r-B,e.x=y-u,e.y=r+u):(f.x=y+B,f.y=r+B,e.x=y-u,e.y=r-u));L.ha(x,y)&&L.ha(r,q)&&(r>p?(z>y?(f.x=y-B,f.y=r-B,e.x=y+u):(f.x=y+B,f.y=r-B,e.x=y-u),e.y=r+u):(z>y?(f.x=y-B,f.y=r+B,e.x=y+u):(f.x=y+B,f.y=r+B,e.x=y-u),e.y=r-u));if(L.ha(x,y)&&L.ha(y,z)||L.ha(p,r)&&L.ha(r,q))x=.5*(x+z),p=.5*(p+q),f.x=x,f.y=p,e.x=x,e.y=p;1===n?(c.x=.5*(g.x+l.x),c.y=.5*(g.y+l.y)):2===n&&L.ha(g.x,this.i(0).x)&&L.ha(g.y,this.i(0).y)&&(c.x=.5*(g.x+l.x), +c.y=.5*(g.y+l.y));Ld(h,c.x-d,c.y-k,f.x-d,f.y-k,l.x-d,l.y-k);b.set(f);c.set(e);g=l}}l=g.x;g=g.y;m=this.i(this.pointsCount-1);0!==this.computeShortLength(!1)&&(m=cq(this,m.copy(),!1,zb));l=.5*(l+m.x);g=.5*(g+m.y);Ld(h,e.x-d,e.y-k,l-d,g-k,m.x-d,m.y-k);K.free(b);K.free(c);K.free(f);K.free(e)}else for(c=3;c<b;c+=3)f=this.i(c-2),c+3>=b&&(c=b-1),e=this.i(c-1),g=this.i(c),c===b-1&&0!==this.computeShortLength(!1)&&(g=cq(this,g.copy(),!1,zb)),Ld(h,f.x-d,f.y-k,e.x-d,e.y-k,g.x-d,g.y-k);else{f=K.alloc();f.assign(this.i(0)); +e=K.alloc();e.assign(f);g=this.computeCorner();n=1;for(l=0;n<b;){n=dq(this,f,n,1<n);m=this.i(n);if(n>=b-1){if(!f.D(m))0!==this.computeShortLength(!1)&&(m=cq(this,m.copy(),!1,zb)),fq(this,h,-d,-k,f,m,c);else if(0===l)for(n=1;n<b;)e.assign(f),m=this.i(n++),fq(this,h,-d,-k,f,m,c),f.assign(m);break}l=dq(this,m,n+1,n<b-3);n=-d;x=-k;p=m;y=this.i(l);u=c;if(L.C(f.y,p.y)&&L.C(p.x,y.x))if(q=Math.min(g,Math.abs(p.x-e.x)/2),q=B=Math.min(q,Math.abs(y.y-p.y)/2),L.C(q,0))fq(this,h,n,x,f,p,u),f.assign(p);else{var C= +p.x,D=p.y;r=C;z=D;p.x>f.x?C=p.x-q:C=p.x+q;y.y>p.y?z=p.y+B:z=p.y-B;y=K.allocAt(C,D);fq(this,h,n,x,f,y,u);K.free(y);Md(h,p.x+n,p.y+x,r+n,z+x);f.h(r,z)}else L.C(f.x,p.x)&&L.C(p.y,y.y)?(q=Math.min(g,Math.abs(p.y-e.y)/2),q=B=Math.min(q,Math.abs(y.x-p.x)/2),L.C(B,0)?(fq(this,h,n,x,f,p,u),f.assign(p)):(C=p.x,D=p.y,r=C,z=D,p.y>f.y?D=p.y-q:D=p.y+q,y.x>p.x?r=p.x+B:r=p.x-B,y=K.allocAt(C,D),fq(this,h,n,x,f,y,u),K.free(y),Md(h,p.x+n,p.y+x,r+n,z+x),f.h(r,z))):(fq(this,h,n,x,f,p,u),f.assign(p));e.assign(m);n=l}K.free(f)}Pd= +h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=cq(this,e,!0,f)),0!==this.computeShortLength(!1)&&(h=cq(this,h,!1,f)),a.type=N.j,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.mm=!0;return a};function eq(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return L.ha(a,0)?b:L.ha(b,0)?a:Math.sqrt(a*a+b*b)} +function cq(a,b,c,d){var e=a.pointsCount;if(2>e)return b;if(c){var f=a.i(1);c=f.x-d.x;f=f.y-d.y;d=eq(b.x,b.y,c,f);if(0===d)return b;e=2===e?.5*d:d;a=a.computeShortLength(!0);a>e&&(a=e);e=a*(f-b.y)/d;b.x+=a*(c-b.x)/d;b.y+=e}else{f=a.i(e-2);c=f.x-d.x;f=f.y-d.y;d=eq(b.x,b.y,c,f);if(0===d)return b;e=2===e?.5*d:d;a=a.computeShortLength(!1);a>e&&(a=e);e=a*(b.y-f)/d;b.x-=a*(b.x-c)/d;b.y-=e}return b} +function dq(a,b,c,d){for(var e=a.pointsCount,f=b;L.ha(b.x,f.x)&&L.ha(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!L.ha(b.x,f.x)&&!L.ha(b.y,f.y))return c-1;for(var g=f;L.ha(b.x,f.x)&&L.ha(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||L.ha(b.y,f.y)&&L.ha(f.y,g.y)&&(!d||(b.x>=f.x?f.x>=g.x:f.x<=g.x));){if(c>=e)return e-1;g=a.i(c++)}return c-2}R.prototype.computeJumpLength=function(){return 10}; +function fq(a,b,c,d,e,f,g){if(!g&&Hp(a)){g=a.computeJumpLength();var h=g/2,k=[],l=0;a.isVisible()&&(l=gq(a,e,f,k));if(0<l)if(L.C(e.y,f.y))if(e.x<f.x)for(var m=0;m<l;){var n=Math.max(e.x,Math.min(k[m++]-h,f.x-g));b.lineTo(n+c,f.y+d);var p=n+c;for(var r=Math.min(n+g,f.x);m<l;)if(n=k[m],n<r+g)m++,r=Math.min(n+h,f.x);else break;n=f.y-g+d;r+=c;var q=f.y+d;a.curve===lg?Kd(b,r,q,!1):Ld(b,p,n,r,n,r,q)}else for(--l;0<=l;){m=Math.min(e.x,Math.max(k[l--]+h,f.x+g));b.lineTo(m+c,f.y+d);p=m+c;for(n=Math.max(m- +g,f.x);0<=l;)if(m=k[l],m>n-g)l--,n=Math.max(m-h,f.x);else break;m=f.y-g+d;n+=c;r=f.y+d;a.curve===lg?Kd(b,n,r,!1):Ld(b,p,m,n,m,n,r)}else if(L.C(e.x,f.x))if(e.y<f.y)for(m=0;m<l;){n=Math.max(e.y,Math.min(k[m++]-h,f.y-g));b.lineTo(f.x+c,n+d);p=n+d;for(n=Math.min(n+g,f.y);m<l;)if(r=k[m],r<n+g)m++,n=Math.min(r+h,f.y);else break;r=f.x-g+c;q=f.x+c;n+=d;a.curve===lg?Kd(b,q,n,!1):Ld(b,r,p,r,n,q,n)}else for(--l;0<=l;){m=Math.min(e.y,Math.max(k[l--]+h,f.y+g));b.lineTo(f.x+c,m+d);p=m+d;for(m=Math.max(m-g,f.y);0<= +l;)if(n=k[l],n>m-g)l--,m=Math.max(n-h,f.y);else break;n=f.x-g+c;r=f.x+c;m+=d;a.curve===lg?Kd(b,r,m,!1):Ld(b,n,p,n,m,r,m)}}b.lineTo(f.x+c,f.y+d)} +function gq(a,b,c,d){var e=a.diagram;if(null===e||b.D(c))return 0;for(e=e.layers;e.next();){var f=e.value;if(null!==f&&f.visible){f=f.Ra.s;for(var g=f.length,h=0;h<g;h++){var k=f[h];if(k instanceof R){if(k===a)return 0<d.length&&d.sort(function(a,b){return a-b}),d.length;if(k.isVisible()&&Hp(k)){var l=k.routeBounds;l.u()&&a.routeBounds.Yc(l)&&!a.usesSamePort(k)&&(l=k.path,null!==l&&l.Lf()&&hq(b,c,d,k))}}}}}0<d.length&&d.sort(function(a,b){return a-b});return d.length} +function hq(a,b,c,d){for(var e=L.C(a.y,b.y),f=d.pointsCount,g=d.i(0),h=K.alloc(),k=1;k<f;k++){var l=d.i(k);if(k<f-1){var m=d.i(k+1);if(g.y===l.y&&l.y===m.y){if(l.x>g.x&&m.x>=l.x||l.x<g.x&&m.x<=l.x)continue}else if(g.x===l.x&&l.x===m.x&&(l.y>g.y&&m.y>=l.y||l.y<g.y&&m.y<=l.y))continue}a:{m=a.x;var n=a.y,p=b.x,r=b.y,q=g.x;g=g.y;var u=l.x,x=l.y;if(!L.C(m,p)){if(L.C(n,r)&&L.C(q,u)&&Math.min(m,p)<q&&Math.max(m,p)>q&&Math.min(g,x)<n&&Math.max(g,x)>n&&!L.C(g,x)){h.x=q;h.y=n;m=!0;break a}}else if(!L.C(n,r)&& +L.C(g,x)&&Math.min(n,r)<g&&Math.max(n,r)>g&&Math.min(q,u)<m&&Math.max(q,u)>m&&!L.C(q,u)){h.x=m;h.y=g;m=!0;break a}h.x=0;h.y=0;m=!1}m&&(e?c.push(h.x):c.push(h.y));g=l}K.free(h)}function Hp(a){a=a.curve;return a===kg||a===lg}function Lp(a,b){if(b||Hp(a))b=a.diagram,null===b||b.animationManager.isTicking||b.Eh.contains(a)||0===a.ol.width&&0===a.ol.height||b.Eh.add(a,a.ol.copy())} +R.prototype.Mo=function(a){var b=this.layer;if(null!==b&&b.visible&&!b.isTemporary){var c=b.diagram;if(null!==c&&!c.animationManager.isTicking){var d=!1;for(c=c.layers;c.next();){var e=c.value;if(e.visible)if(e===b){d=!0;var f=!1;e=e.Ra.s;for(var g=e.length,h=0;h<g;h++){var k=e[h];k instanceof R&&(k===this?f=!0:f&&iq(this,k,a))}}else if(d)for(f=e.Ra.s,e=f.length,g=0;g<e;g++)h=f[g],h instanceof R&&iq(this,h,a)}}}}; +function iq(a,b,c){if(null!==b&&b.mm&&b.Dd&&Hp(b)){var d=b.routeBounds;d.u()&&(a.routeBounds.Yc(d)||c.Yc(d))&&(a.usesSamePort(b)||b.sc(!1))}}R.prototype.usesSamePort=function(a){var b=this.pointsCount,c=a.pointsCount;if(0<b&&0<c){var d=this.i(0),e=a.i(0);if(d.fb(e))return!0;b=this.i(b-1);a=a.i(c-1);if(b.fb(a)||d.fb(a)||b.fb(e))return!0}else if(this.fromNode===a.fromNode||this.toNode===a.toNode||this.fromNode===a.toNode||this.toNode===a.fromNode)return!0;return!1}; +R.prototype.isVisible=function(){if(!S.prototype.isVisible.call(this))return!1;var a=this.containingGroup,b=!0,c=this.diagram;null!==c&&(b=c.isTreePathToChildren);c=this.fromNode;if(null!==c){if(this.isTreeLink&&b&&!c.isTreeExpanded)return!1;if(c===a)return!0;for(var d=c;null!==d;){if(d.labeledLink===this)return!0;d=d.containingGroup}c=c.findVisibleNode();if(null===c||c===a)return!1}c=this.toNode;if(null!==c){if(this.isTreeLink&&!b&&!c.isTreeExpanded)return!1;if(c===a)return!0;for(b=c;null!==b;){if(b.labeledLink=== +this)return!0;b=b.containingGroup}b=c.findVisibleNode();if(null===b||b===a)return!1}return!0};R.prototype.Zb=function(a){S.prototype.Zb.call(this,a);null!==this.Uf&&this.Uf.Ol();if(null!==this.xd)for(var b=this.xd.iterator;b.next();)b.value.Zb(a)};R.prototype.computeAdjusting=function(){return this.isAvoiding&&null!==this.diagram&&this.diagram.animationManager.defaultAnimation.isAnimating?Dp:this.rk}; +function Ip(a){var b=a.ff;if(null!==b){var c=a.vf;if(null!==c&&isNaN(a.curviness)){for(var d=a.gf,e=a.wf,f=a=null,g=b.qb.s,h=g.length,k=0;k<h;k++){var l=g[k];if(l.ff===b&&l.gf===d&&l.vf===c&&l.wf===e||l.ff===c&&l.gf===e&&l.vf===b&&l.wf===d)null===f?f=l:(null===a&&(a=[],a.push(f)),a.push(l))}if(null!==a){f=np(b,c,d,e);null===f&&(f=new jq(b,d,c,e),mp(b,f),mp(c,f));f.links=a;for(b=0;b<a.length;b++)a[b].Uf=f;f.Ol()}}}} +function Jp(a){var b=a.Uf;null!==b&&isNaN(a.curviness)&&(a.Uf=null,a=b.links.indexOf(a),0<=a&&(La(b.links,a),b.Ol()))}R.prototype.ph=function(){return!0}; +oa.Object.defineProperties(R.prototype,{fromNode:{configurable:!0,get:function(){return this.ff},set:function(a){var b=this.ff;if(b!==a){G&&null!==a&&w(a,T,R,"fromNode");var c=this.fromPort;null!==b&&(this.vf!==b&&rp(b,this,c),Jp(this),this.F(2));this.ff=a;null!==a&&this.Zb(a.isVisible());this.Yf=null;this.gb();var d=this.diagram;null!==d&&d.ca&&d.partManager.setFromNodeForLink(this,a,b);var e=this.fromPort,f=this.fromPortChanged;if(null!==f){var g=!0;null!==d&&(g=d.ca,d.ca=!0);f(this, +c,e);null!==d&&(d.ca=g)}null!==a&&(this.vf!==a&&qp(a,this,e),Ip(this),this.F(1));this.g("fromNode",b,a);ip(this)}}},fromPortId:{configurable:!0,get:function(){return this.gf},set:function(a){var b=this.gf;if(b!==a){G&&A(a,"string",R,"fromPortId");var c=this.fromPort;null!==c&&op(c);Jp(this);this.gf=a;var d=this.fromPort;null!==d&&op(d);var e=this.diagram;if(null!==e){var f=this.data,g=e.model;null!==f&&g.yi()&&g.rv(f,a)}c!==d&&(this.Yf=null,this.gb(),f=this.fromPortChanged,null!==f&& +(g=!0,null!==e&&(g=e.ca,e.ca=!0),f(this,c,d),null!==e&&(e.ca=g)));Ip(this);this.g("fromPortId",b,a)}}},fromPort:{configurable:!0,get:function(){var a=this.ff;return null===a?null:a.Xr(this.gf)}},fromPortChanged:{configurable:!0,get:function(){return this.$m},set:function(a){var b=this.$m;b!==a&&(null!==a&&A(a,"function",R,"fromPortChanged"),this.$m=a,this.g("fromPortChanged",b,a))}},toNode:{configurable:!0,get:function(){return this.vf},set:function(a){var b= +this.vf;if(b!==a){G&&null!==a&&w(a,T,R,"toNode");var c=this.toPort;null!==b&&(this.ff!==b&&rp(b,this,c),Jp(this),this.F(2));this.vf=a;null!==a&&this.Zb(a.isVisible());this.Yf=null;this.gb();var d=this.diagram;null!==d&&d.ca&&d.partManager.setToNodeForLink(this,a,b);var e=this.toPort,f=this.toPortChanged;if(null!==f){var g=!0;null!==d&&(g=d.ca,d.ca=!0);f(this,c,e);null!==d&&(d.ca=g)}null!==a&&(this.ff!==a&&qp(a,this,e),Ip(this),this.F(1));this.g("toNode",b,a);ip(this)}}},toPortId:{configurable:!0, +enumerable:!0,get:function(){return this.wf},set:function(a){var b=this.wf;if(b!==a){G&&A(a,"string",R,"toPortId");var c=this.toPort;null!==c&&op(c);Jp(this);this.wf=a;var d=this.toPort;null!==d&&op(d);var e=this.diagram;if(null!==e){var f=this.data,g=e.model;null!==f&&g.yi()&&g.vv(f,a)}c!==d&&(this.Yf=null,this.gb(),f=this.toPortChanged,null!==f&&(g=!0,null!==e&&(g=e.ca,e.ca=!0),f(this,c,d),null!==e&&(e.ca=g)));Ip(this);this.g("toPortId",b,a)}}},toPort:{configurable:!0,get:function(){var a= +this.vf;return null===a?null:a.Xr(this.wf)}},toPortChanged:{configurable:!0,get:function(){return this.ko},set:function(a){var b=this.ko;b!==a&&(null!==a&&A(a,"function",R,"toPortChanged"),this.ko=a,this.g("toPortChanged",b,a))}},fromSpot:{configurable:!0,get:function(){return null!==this.ea?this.ea.cj:hd},set:function(a){var b=this.fromSpot;b.D(a)||(G&&w(a,Ib,R,"fromSpot"),a=a.M(),this.Xc(),this.ea.cj=a,this.g("fromSpot",b,a),(b.$c()||a.$c())&&null!==this.fromNode&&op(this.fromPort), +this.gb())}},fromEndSegmentLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.aj:NaN},set:function(a){var b=this.fromEndSegmentLength;b!==a&&(G&&A(a,"number",R,"fromEndSegmentLength"),0>a&&Ba(a,">= 0",R,"fromEndSegmentLength"),this.Xc(),this.ea.aj=a,this.g("fromEndSegmentLength",b,a),this.gb())}},fromShortLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.bj:NaN},set:function(a){var b=this.fromShortLength;b!==a&&(G&&A(a,"number",R,"fromShortLength"), +this.Xc(),this.ea.bj=a,this.sc(!0),this.g("fromShortLength",b,a))}},toSpot:{configurable:!0,get:function(){return null!==this.ea?this.ea.Gj:hd},set:function(a){var b=this.toSpot;b.D(a)||(G&&w(a,Ib,R,"toSpot"),a=a.M(),this.Xc(),this.ea.Gj=a,this.g("toSpot",b,a),(b.$c()||a.$c())&&null!==this.toNode&&op(this.toPort),this.gb())}},toEndSegmentLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.Ej:NaN},set:function(a){var b=this.toEndSegmentLength;b!==a&&(G&& +A(a,"number",R,"toEndSegmentLength"),0>a&&Ba(a,">= 0",R,"toEndSegmentLength"),this.Xc(),this.ea.Ej=a,this.g("toEndSegmentLength",b,a),this.gb())}},toShortLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.Fj:NaN},set:function(a){var b=this.toShortLength;b!==a&&(G&&A(a,"number",R,"toShortLength"),this.Xc(),this.ea.Fj=a,this.sc(!0),this.g("toShortLength",b,a))}},isLabeledLink:{configurable:!0,get:function(){return null===this.xd?!1:0<this.xd.count}},labelNodes:{configurable:!0, +enumerable:!0,get:function(){return null===this.xd?fb:this.xd.iterator}},relinkableFrom:{configurable:!0,get:function(){return 0!==(this.Ta&1)},set:function(a){var b=0!==(this.Ta&1);b!==a&&(G&&A(a,"boolean",R,"relinkableFrom"),this.Ta^=1,this.g("relinkableFrom",b,a),this.Xb())}},relinkableTo:{configurable:!0,get:function(){return 0!==(this.Ta&2)},set:function(a){var b=0!==(this.Ta&2);b!==a&&(G&&A(a,"boolean",R,"relinkableTo"),this.Ta^=2,this.g("relinkableTo",b,a),this.Xb())}}, +resegmentable:{configurable:!0,get:function(){return 0!==(this.Ta&4)},set:function(a){var b=0!==(this.Ta&4);b!==a&&(G&&A(a,"boolean",R,"resegmentable"),this.Ta^=4,this.g("resegmentable",b,a),this.Xb())}},isTreeLink:{configurable:!0,get:function(){return 0!==(this.Ta&8)},set:function(a){var b=0!==(this.Ta&8);b!==a&&(G&&A(a,"boolean",R,"isTreeLink"),this.Ta^=8,this.g("isTreeLink",b,a),null!==this.fromNode&&Fk(this.fromNode),null!==this.toNode&&Fk(this.toNode))}},path:{configurable:!0, +enumerable:!0,get:function(){var a=this.Ab();return a instanceof Qf?a:null}},routeBounds:{configurable:!0,get:function(){this.yg();var a=this.ol,b=Infinity,c=Infinity,d=this.pointsCount;if(0===d)a.h(NaN,NaN,0,0);else{if(1===d)d=this.i(0),b=Math.min(d.x,b),c=Math.min(d.y,c),a.h(d.x,d.y,0,0);else if(2===d){d=this.i(0);var e=this.i(1);b=Math.min(d.x,e.x);c=Math.min(d.y,e.y);a.h(d.x,d.y,0,0);a.Ze(e)}else if(this.computeCurve()===pg&&3<=d&&!this.isOrthogonal)if(e=this.i(0),b=e.x,c=e.y,a.h(b, +c,0,0),3===d){d=this.i(1);b=Math.min(d.x,b);c=Math.min(d.y,c);var f=this.i(2);b=Math.min(f.x,b);c=Math.min(f.y,c);L.Dl(e.x,e.y,d.x,d.y,d.x,d.y,f.x,f.y,.5,a)}else for(f=3;f<d;f+=3){var g=this.i(f-2);f+3>=d&&(f=d-1);var h=this.i(f-1),k=this.i(f);L.Dl(e.x,e.y,g.x,g.y,h.x,h.y,k.x,k.y,.5,a);b=Math.min(k.x,b);c=Math.min(k.y,c);e=k}else for(e=this.i(0),f=this.i(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y),a.h(e.x,e.y,0,0),a.Ze(f),e=2;e<d;e++)f=this.i(e),b=Math.min(f.x,b),c=Math.min(f.y,c),a.Ze(f);this.ku.h(b- +a.x,c-a.y)}return a}},midPoint:{configurable:!0,get:function(){this.yg();return this.computeMidPoint(new K)}},midAngle:{configurable:!0,get:function(){this.yg();return this.computeMidAngle()}},flattenedLengths:{configurable:!0,get:function(){if(null===this.Tp){this.Dd||Kp(this);for(var a=this.Tp=[],b=this.pointsCount,c=0;c<b-1;c++){var d=this.i(c);var e=this.i(c+1);L.ha(d.x,e.x)?(d=e.y-d.y,0>d&&(d=-d)):L.ha(d.y,e.y)?(d=e.x-d.x,0>d&&(d=-d)):d=Math.sqrt(d.Df(e)); +a.push(d)}}return this.Tp}},flattenedTotalLength:{configurable:!0,get:function(){var a=this.kt;if(isNaN(a)){for(var b=this.flattenedLengths,c=b.length,d=a=0;d<c;d++)a+=b[d];this.kt=a}return a}},points:{configurable:!0,get:function(){return this.Ob},set:function(a){var b=this.Ob;if(b!==a){var c=null;if(Array.isArray(a)){var d=0===a.length%2;if(d)for(var e=0;e<a.length;e++)if("number"!==typeof a[e]||isNaN(a[e])){d=!1;break}if(d)for(c=new H,d=0;d<a.length/2;d++)e=(new K(a[2* +d],a[2*d+1])).freeze(),c.add(e);else{d=!0;for(e=0;e<a.length;e++){var f=a[e];if(!Ga(f)||"number"!==typeof f.x||isNaN(f.x)||"number"!==typeof f.y||isNaN(f.y)){d=!1;break}}if(d)for(c=new H,d=0;d<a.length;d++)e=a[d],c.add((new K(e.x,e.y)).freeze());else G&&v("Link.points array must contain only an even number of numbers or objects with x and y properties, not: "+a)}}else if(a instanceof H)for(c=a.copy(),a=c.iterator;a.next();)a.value.freeze();else v("Link.points value is not an instance of List or Array: "+ +a);c.freeze();this.Ob=c;this.sc(!0);Kp(this);a=this.diagram;null!==a&&(a.xi||a.undoManager.isUndoingRedoing||a.ns.add(this),a.animationManager.Eb&&(a=a.animationManager,this.sf=c,a.ql.add(this)));this.g("points",b,c)}}},pointsCount:{configurable:!0,get:function(){return this.Ob.count}},Dd:{configurable:!0,get:function(){return 0!==(this.Ta&16)},set:function(a){0!==(this.Ta&16)!==a&&(this.Ta^=16)}},suspendsRouting:{configurable:!0,get:function(){return 0!== +(this.Ta&32)},set:function(a){0!==(this.Ta&32)!==a&&(this.Ta^=32)}},computingPoints:{configurable:!0,get:function(){return 0!==(this.Ta&64)},set:function(a){0!==(this.Ta&64)!==a&&(this.Ta^=64)}},defaultFromPoint:{configurable:!0,get:function(){return this.m},set:function(a){this.m=a.copy()}},defaultToPoint:{configurable:!0,get:function(){return this.v},set:function(a){this.v=a.copy()}},isOrthogonal:{configurable:!0,get:function(){return 2=== +(this.xj.value&2)}},isAvoiding:{configurable:!0,get:function(){return 4===(this.xj.value&4)}},mm:{configurable:!0,get:function(){return 0!==(this.Ta&128)},set:function(a){0!==(this.Ta&128)!==a&&(this.Ta^=128)}},geometry:{configurable:!0,get:function(){this.mm||(this.yg(),this.ya=this.makeGeometry());return this.ya}},firstPickIndex:{configurable:!0,get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!Op(this.computeSpot(!0))?1:0}}, +lastPickIndex:{configurable:!0,get:function(){var a=this.pointsCount;return 0===a?0:2>=a?a-1:this.isOrthogonal||!Op(this.computeSpot(!1))?a-2:a-1}},adjusting:{configurable:!0,get:function(){return this.rk},set:function(a){var b=this.rk;b!==a&&(G&&a!==mg&&a!==Dp&&a!==Ep&&a!==Fp&&v("Link.adjusting can only be set to Link.None, Link.End, LInk.Scale, or Link.Stretch, not: "+a),this.rk=a,this.g("adjusting",b,a))}},corner:{configurable:!0,get:function(){return this.Jm}, +set:function(a){var b=this.Jm;b!==a&&(G&&A(a,"number",R,"corner"),this.Jm=a,this.sc(!0),this.g("corner",b,a))}},curve:{configurable:!0,get:function(){return this.Lm},set:function(a){var b=this.Lm;b!==a&&(G&&a!==mg&&a!==pg&&a!==lg&&a!==kg&&v("Link.curve can only be set to Link.None, Link.Bezier, LInk.JumpGap, or Link.JumpOver, not: "+a),this.Lm=a,this.gb(),this.sc(!0),Lp(this,b===lg||b===kg||a===lg||a===kg),this.g("curve",b,a))}},curviness:{configurable:!0,get:function(){return this.Mm}, +set:function(a){var b=this.Mm;b!==a&&(G&&A(a,"number",R,"curviness"),this.Mm=a,this.gb(),this.sc(!1),this.g("curviness",b,a))}},routing:{configurable:!0,get:function(){return this.xj},set:function(a){var b=this.xj;b!==a&&(G&&a!==Cp&&a!==kq&&a!==lq&&a!==Up&&v("Link.routing can only be set to Link.Normal, Link.Orthogonal, LInk.AvoidsNodes, not: "+a),this.xj=a,this.Yf=null,this.gb(),Lp(this,2===(b.value&2)||2===(a.value&2)),this.g("routing",b,a))}},smoothness:{configurable:!0, +get:function(){return this.eo},set:function(a){var b=this.eo;b!==a&&(G&&A(a,"number",R,"smoothness"),this.eo=a,this.sc(!0),this.g("smoothness",b,a))}},key:{configurable:!0,get:function(){var a=this.diagram;if(null!==a&&a.model.yi())return a.model.Ac(this.data)}}});R.prototype.invalidateOtherJumpOvers=R.prototype.Mo;R.prototype.findClosestSegment=R.prototype.fz;R.prototype.updateRoute=R.prototype.yg;R.prototype.invalidateRoute=R.prototype.gb;R.prototype.rollbackRoute=R.prototype.nv; +R.prototype.commitRoute=R.prototype.Bf;R.prototype.startRoute=R.prototype.uh;R.prototype.clearPoints=R.prototype.Nj;R.prototype.removePoint=R.prototype.lv;R.prototype.addPointAt=R.prototype.zf;R.prototype.addPoint=R.prototype.ne;R.prototype.insertPointAt=R.prototype.l;R.prototype.insertPoint=R.prototype.Mz;R.prototype.setPointAt=R.prototype.P;R.prototype.setPoint=R.prototype.bd;R.prototype.getPoint=R.prototype.i;R.prototype.getOtherPort=R.prototype.Dz;R.prototype.getOtherNode=R.prototype.Io; +var Mp=null,Np=null,Cp=new F(R,"Normal",1),kq=new F(R,"Orthogonal",2),lq=new F(R,"AvoidsNodes",6),Up=new F(R,"AvoidsNodesStraight",7),mg=new F(R,"None",0),pg=new F(R,"Bezier",9),lg=new F(R,"JumpGap",10),kg=new F(R,"JumpOver",11),Dp=new F(R,"End",17),Ep=new F(R,"Scale",18),Fp=new F(R,"Stretch",19),hn=new F(R,"OrientAlong",21),an=new F(R,"OrientPlus90",22),cn=new F(R,"OrientMinus90",23),Gp=new F(R,"OrientOpposite",24),jn=new F(R,"OrientUpright",25),bn=new F(R,"OrientPlus90Upright",26),dn=new F(R,"OrientMinus90Upright", +27),en=new F(R,"OrientUpright45",28),Wp=16,Vp=14,Xp=8;R.className="Link";R.Normal=Cp;R.Orthogonal=kq;R.AvoidsNodes=lq;R.AvoidsNodesStraight=Up;R.None=mg;R.Bezier=pg;R.JumpGap=lg;R.JumpOver=kg;R.End=Dp;R.Scale=Ep;R.Stretch=Fp;R.OrientAlong=hn;R.OrientPlus90=an;R.OrientMinus90=cn;R.OrientOpposite=Gp;R.OrientUpright=jn;R.OrientPlus90Upright=bn;R.OrientMinus90Upright=dn;R.OrientUpright45=en;R.EndSegmentStep=8;R.CurvinessStart=Wp;R.SpacingMin=Vp;R.OrthoShortCut=Xp; +function jq(a,b,c,d){Za(this);this.Ee=this.fq=!1;this.qs=a;this.Mx=b;this.cv=c;this.Nx=d;this.links=[]}jq.prototype.Ol=function(){if(!this.fq){var a=this.links;0<a.length&&(a=a[0].diagram,null!==a&&(a.hw.add(this),this.Ee=a.undoManager.isUndoingRedoing))}this.fq=!0}; +jq.prototype.Fv=function(){if(this.fq){this.fq=!1;var a=this.links;if(0<a.length){var b=a[0],c=b.diagram;c=null===c||c.xi&&!this.Ee;this.Ee=!1;b.arrangeBundledLinks(a,c);1===a.length&&(b.Uf=null,a.length=0)}0===a.length&&(a=this.qs,null!==this&&null!==a.bf&&a.bf.remove(this),a=this.cv,null!==this&&null!==a.bf&&a.bf.remove(this))}};jq.className="LinkBundle"; +function sk(a){Za(this);this.Xx=this.group=null;this.fs=!0;this.abort=!1;this.Ld=this.Kd=1;this.yn=this.xn=-1;this.tc=a.width;this.uc=a.height;this.bc=null;this.ii=this.hi=0;this.Cs=11;this.Fx=this.Ex=22} +sk.prototype.initialize=function(a){if(!(0>=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.Kd=Math.floor((a.x-this.tc)/this.tc)*this.tc;this.Ld=Math.floor((b-this.uc)/this.uc)*this.uc;this.xn=Math.ceil((c+2*this.tc)/this.tc)*this.tc;this.yn=Math.ceil((d+2*this.uc)/this.uc)*this.uc;a=1+(Math.ceil((this.xn-this.Kd)/this.tc)|0);b=1+(Math.ceil((this.yn-this.Ld)/this.uc)|0);if(null===this.bc||this.hi<a-1||this.ii<b-1){c=[];for(d=0;d<=a;d++)c[d]=new Uint32Array(b);this.bc=c;this.hi= +a-1;this.ii=b-1}a=mq;if(null!==this.bc)for(b=0;b<=this.hi;b++)if(c=this.bc[b],c.fill)c.fill(a);else for(d=0;d<=this.ii;d++)c[d]=a}};function wk(a,b,c){return a.Kd<=b&&b<=a.xn&&a.Ld<=c&&c<=a.yn}function Zp(a,b,c){if(!wk(a,b,c))return mq;b-=a.Kd;b/=a.tc;c-=a.Ld;c/=a.uc;return a.bc[b|0][c|0]}function vk(a){if(null!==a.bc)for(var b=0;b<=a.hi;b++)for(var c=a.bc[b],d=0;d<=a.ii;d++)c[d]>=bq&&(c[d]=mq)} +sk.prototype.ak=function(a,b,c,d){if(a>this.xn||a+c<this.Kd||b>this.yn||b+d<this.Ld)return!0;a=(a-this.Kd)/this.tc|0;b=(b-this.Ld)/this.uc|0;c=Math.max(0,c)/this.tc+1|0;var e=Math.max(0,d)/this.uc+1|0;0>a&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.hi)|0;for(c=Math.min(b+e-1,this.ii)|0;a<=d;a++){e=this.bc[a];for(var f=b;f<=c;f++)if(e[f]===xk)return!1}return!0}; +function nq(a,b,c,d,e,f,g,h,k){if(!(b<f||b>g||c<h||c>k)){var l=b|0;var m=c|0;var n=a.bc[l][m];if(n>=bq&&n<$p)for(e?m+=d:l+=d,n+=1;f<=l&&l<=g&&h<=m&&m<=k&&!(n>=a.bc[l][m]);)a.bc[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0<d)for(c+=d;c<l;c+=d)nq(a,b,c,1,!e,f,g,h,k),nq(a,b,c,-1,!e,f,g,h,k);else for(c+=d;c>l;c+=d)nq(a,b,c,1,!e,f,g,h,k),nq(a,b,c,-1,!e,f,g,h,k);else if(0<d)for(b+=d;b<l;b+=d)nq(a,b,c,1,!e,f,g,h,k),nq(a,b,c,-1,!e,f,g,h,k);else for(b+=d;b>l;b+=d)nq(a,b,c,1,!e,f,g,h,k),nq(a,b,c,-1,!e,f,g,h, +k)}}function oq(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=xk,m=bq;for(a.bc[b][c]=m;l===xk&&b>f&&b<g&&c>h&&c<k;)m+=1,a.bc[b][c]=m,e?c+=d:b+=d,l=a.bc[b][c]}function pq(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=xk,m=$p;for(a.bc[b][c]=m;l===xk&&b>f&&b<g&&c>h&&c<k;)a.bc[b][c]=m,e?c+=d:b+=d,l=a.bc[b][c]} +function Yp(a,b,c,d,e,f,g){if(null!==a.bc){a.abort=!1;var h=b.x,k=b.y;if(wk(a,h,k)){h-=a.Kd;h/=a.tc;k-=a.Ld;k/=a.uc;var l=d.x,m=d.y;if(wk(a,l,m))if(l-=a.Kd,l/=a.tc,m-=a.Ld,m/=a.uc,1>=Math.abs(h-l)&&1>=Math.abs(k-m))a.abort=!0;else{var n=f.x;d=f.y;b=f.x+f.width;var p=f.y+f.height;n-=a.Kd;n/=a.tc;d-=a.Ld;d/=a.uc;b-=a.Kd;b/=a.tc;p-=a.Ld;p/=a.uc;f=Math.max(0,Math.min(a.hi,n|0));b=Math.min(a.hi,Math.max(0,b|0));n=Math.max(0,Math.min(a.ii,d|0));p=Math.min(a.ii,Math.max(0,p|0));d=a.bc;h|=0;k|=0;l|=0;m|= +0;var r=0===c||90===c?1:-1;c=90===c||270===c;d[h][k]===xk?(oq(a,h,k,r,c,f,b,n,p),oq(a,h,k,1,!c,f,b,n,p),oq(a,h,k,-1,!c,f,b,n,p)):oq(a,h,k,r,c,h,k,h,k);d[l][m]===xk?(pq(a,l,m,0===e||90===e?1:-1,90===e||270===e,f,b,n,p),pq(a,l,m,1,!(90===e||270===e),f,b,n,p),pq(a,l,m,-1,!(90===e||270===e),f,b,n,p)):pq(a,l,m,r,c,l,m,l,m);c=Na();if(g&&qq(a,l,m,e,h,k,c)){if(c[0]!==l||c[1]!==m)c.unshift(m),c.unshift(l);if(c[c.length-2]!==h||c[c.length-1]!==k)c.push(h),c.push(k);a=bq;e=c[c.length-2];g=c[c.length-1];d[e][g]= +a++;for(f=c.length-4;0<=f;f-=2)for(e=c[f+2],g=c[f+3],b=c[f],l=c[f+1];b>e?e++:b<e?e--:l>g?g++:l<g&&g--,d[e][g]=a++,e!==b||g!==l;);}else nq(a,h,k,1,!1,f,b,n,p),nq(a,h,k,-1,!1,f,b,n,p),nq(a,h,k,1,!0,f,b,n,p),nq(a,h,k,-1,!0,f,b,n,p);Pa(c)}}}} +function qq(a,b,c,d,e,f,g){for(var h=a.bc,k=b,l=c;;){if(k===e&&l===f)return!0;var m=k,n=l;if(0===d)if(m<e)m++;else break;else if(90===d)if(n<f)n++;else break;else if(180===d)if(m>e)m--;else break;else if(n>f)n--;else break;var p=h[m][n];if(0===p||p===rq)break;k=m;l=n}for(;;){m=d;n=k;p=l;0===d?p<f?(m=90,p++):p>f&&(m=270,p--):90===d?n<e?(m=0,n++):n>e&&(m=180,n--):180===d?p<f?(m=90,p++):p>f&&(m=270,p--):n<e?(m=0,n++):n>e&&(m=180,n--);n=h[n][p];if(m!==d&&0!==n&&n!==rq){g.push(k);g.push(l);if(qq(a,k,l, +m,e,f,g))return!0;g.pop();g.pop()}h[k][l]=rq;if(0===d){if(k===b)return!1;k--}else if(90===d){if(l===c)return!1;l--}else if(180===d){if(k===b)return!1;k++}else{if(l===c)return!1;l++}}} +oa.Object.defineProperties(sk.prototype,{bounds:{configurable:!0,get:function(){return new M(this.Kd,this.Ld,this.xn-this.Kd,this.yn-this.Ld)}},xo:{configurable:!0,get:function(){return this.tc},set:function(a){0<a&&a!==this.tc&&(this.tc=a,this.initialize(this.bounds))}},wo:{configurable:!0,get:function(){return this.uc},set:function(a){0<a&&a!==this.uc&&(this.uc=a,this.initialize(this.bounds))}}});var xk=0,bq=1,$p=999999,mq=$p+1,rq=$p+2;sk.className="PositionArray"; +function Sp(){Za(this);this.port=this.node=null;this.pe=[];this.Qo=!1}Sp.prototype.toString=function(){for(var a=this.pe,b=this.node.toString()+" "+a.length.toString()+":",c=0;c<a.length;c++){var d=a[c];null!==d&&(b+="\n "+d.toString())}return b}; +function sq(a,b,c,d){b=b.offsetY;switch(b){case 8:return 90;case 2:return 180;case 1:return 270;case 4:return 0}switch(b){case 9:return 180<c?270:90;case 6:return 90<c&&270>=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case 3:return c>a&&c<=180+a?180:270;case 5:return c>180-a&&c<=360-a?270:0;case 12:return c>a&&c<=180+a?90:0;case 10:return c>180-a&&c<=360-a?180:90;case 7:return 90<c&&c<=180+a?180:c>180+a&&c<=360-a?270:0;case 13:return 180<c&&c<=360-a?270:c>a&&180>=c?90:0;case 14:return c> +a&&c<=180-a?90:c>180-a&&270>=c?180:0;case 11:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&15!==b&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}Sp.prototype.Ol=function(){this.pe.length=0}; +function Tp(a,b){var c=a.pe;if(0===c.length){a:if(!a.Qo){c=a.Qo;a.Qo=!0;var d=null,e=a.node,f=e instanceof wf?e:null;if(null===f||f.isSubGraphExpanded)var g=e.isTreeExpanded?e.findLinksConnected(a.port.portId):e.kx();else{if(!f.actualBounds.u()){a.Qo=c;break a}d=f;g=d.Ku()}f=a.pe.length=0;var h=a.port.oa(Fc,K.alloc()),k=a.port.oa(Oc,K.alloc());e=M.allocAt(h.x,h.y,0,0);e.Ze(k);K.free(h);K.free(k);h=K.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.si();for(g=g.iterator;g.next();){var l=g.value;if(l.isVisible()&& +l.fromPort!==l.toPort){var m=l.fromPort===a.port||null!==l.fromNode&&l.fromNode.Sd(d),n=l.computeSpot(m,a.port);if(n.$c()&&(m=m?l.toPort:l.fromPort,null!==m)){var p=m.part;if(null!==p){var r=p.findVisibleNode();null!==r&&r!==p&&(p=r,m=p.port);m=l.computeOtherPoint(p,m);p=h.cb(m);p-=k;0>p?p+=360:360<=p&&(p-=360);n=sq(e,n,p,l.isOrthogonal);0===n?(n=4,180<p&&(p-=360)):90===n?(n=8,270<p&&(p-=360)):180===n?n=2:(n=1,90>p&&(p+=360));r=a.pe[f];void 0===r?(r=new tq(l,p,n),a.pe[f]=r):(r.link=l,r.angle=p,r.Mc= +n);r.ev.set(m);f++}}}}K.free(h);a.pe.sort(Sp.prototype.j);k=a.pe.length;d=-1;for(f=h=0;f<k;f++)g=a.pe[f],void 0!==g&&(g.Mc!==d&&(d=g.Mc,h=0),g.Jo=h,h++);d=-1;h=0;for(f=k-1;0<=f;f--)k=a.pe[f],void 0!==k&&(k.Mc!==d&&(d=k.Mc,h=k.Jo+1),k.Hl=h);f=a.pe;n=a.port;d=a.node.portSpreading;h=K.alloc();k=K.alloc();g=K.alloc();l=K.alloc();n.oa(Fc,h);n.oa(Hc,k);n.oa(Oc,g);n.oa(Mc,l);r=p=m=n=0;if(d===zp)for(var q=0;q<f.length;q++){var u=f[q];if(null!==u){var x=u.link.computeThickness();switch(u.Mc){case 8:p+=x;break; +case 2:r+=x;break;case 1:n+=x;break;default:case 4:m+=x}}}var y=q=0,z=1,B=u=0;for(x=0;x<f.length;x++){var C=f[x];if(null!==C){if(q!==C.Mc){q=C.Mc;switch(q){case 8:var D=g;y=l;break;case 2:D=l;y=h;break;case 1:D=h;y=k;break;default:case 4:D=k,y=g}u=y.x-D.x;B=y.y-D.y;switch(q){case 8:p>Math.abs(u)?(z=Math.abs(u)/p,p=Math.abs(u)):z=1;break;case 2:r>Math.abs(B)?(z=Math.abs(B)/r,r=Math.abs(B)):z=1;break;case 1:n>Math.abs(u)?(z=Math.abs(u)/n,n=Math.abs(u)):z=1;break;default:case 4:m>Math.abs(B)?(z=Math.abs(B)/ +m,m=Math.abs(B)):z=1}y=0}var J=C.Po;if(d===zp){C=C.link.computeThickness();C*=z;J.set(D);switch(q){case 8:J.x=D.x+u/2+p/2-y-C/2;break;case 2:J.y=D.y+B/2+r/2-y-C/2;break;case 1:J.x=D.x+u/2-n/2+y+C/2;break;default:case 4:J.y=D.y+B/2-m/2+y+C/2}y+=C}else{var U=.5;d===kp&&(U=(C.Jo+1)/(C.Hl+1));J.x=D.x+u*U;J.y=D.y+B*U}}}K.free(h);K.free(k);K.free(g);K.free(l);D=a.pe;for(f=0;f<D.length;f++)d=D[f],null!==d&&(d.Iu=a.computeEndSegmentLength(d));a.Qo=c;M.free(e)}c=a.pe}for(a=0;a<c.length;a++)if(e=c[a],null!== +e&&e.link===b)return e;return null}Sp.prototype.j=function(a,b){return a===b?0:null===a?-1:null===b?1:a.Mc<b.Mc?-1:a.Mc>b.Mc?1:a.angle<b.angle?-1:a.angle>b.angle?1:0}; +Sp.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,Ec,b.fromPort===this.port),d=a.Jo;if(0>d)return c;var e=a.Hl;if(1>=e||!b.isOrthogonal)return c;b=a.ev;var f=a.Po;if(2===a.Mc||8===a.Mc)d=e-1-d;return((a=2===a.Mc||4===a.Mc)?b.y<f.y:b.x<f.x)?c+8*d:(a?b.y===f.y:b.x===f.x)?c:c+8*(e-1-d)};Sp.className="Knot";function tq(a,b,c){this.link=a;this.angle=b;this.Mc=c;this.ev=new K;this.Hl=this.Jo=0;this.Po=new K;this.Iu=0} +tq.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.Mc.toString()+":"+this.Jo.toString()+"/"+this.Hl.toString()+" "+this.Po.toString()+" "+this.Iu.toString()+" "+this.ev.toString()};tq.className="LinkInfo"; +function Di(a){Za(this);this.m=this.H=null;this.Ih=this.ln=!0;this.rn=!1;this.vm=(new K(0,0)).freeze();this.on=!0;this.zm=this.nn=null;this.qn=!1;this.j=null;this.v=0;this.zn=this.oo=null;this.Mr=!1;this.pg=this.yj=null;this.wr=!1;a&&Object.assign(this,a)}Di.prototype.cloneProtected=function(a){a.ln=this.ln;a.Ih=this.Ih;a.rn=this.rn;a.vm.assign(this.vm);a.on=this.on;a.nn=this.nn;a.zm=this.zm;a.qn=!0;a.zn=this.zn;a.oo=this.oo}; +Di.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};Di.prototype.serializeLayoutProperties=function(a){a.arrangementOrigin={x:this.arrangementOrigin.x,y:this.arrangementOrigin.y};a.isRouting=this.isRouting};Di.prototype.deserializeLayoutProperties=function(a){null!==a&&(this.arrangementOrigin=new K(a.arrangementOrigin.x,a.arrangementOrigin.y),this.isRouting=a.isRouting)};Di.prototype.ub=function(a){Ea(this,a)}; +Di.prototype.toString=function(){var a=Qa(this.constructor);a+="(";null!==this.group&&(a+=" in "+this.group);null!==this.diagram&&(a+=" for "+this.diagram);return a+")"};Di.prototype.F=function(){if(this.isValidLayout){var a=this.diagram;if(null!==a&&!a.undoManager.isUndoingRedoing){var b=a.animationManager;!b.isTicking&&(b.defaultAnimation.isAnimating&&b.Cc(),this.isOngoing&&a.xi||this.isInitial&&!a.xi)&&(this.isValidLayout=!1,a.Sb())}}};Di.prototype.createNetwork=function(){return new uq(this)}; +Di.prototype.makeNetwork=function(a){var b=this.createNetwork();a instanceof P?(b.qg(a.nodes,!0),b.qg(a.links,!0)):a instanceof wf?b.qg(a.memberParts):b.qg(a.iterator);return b};Di.prototype.updateParts=function(){this.isValidLayout=!0;if(!this.workerLayout()){var a=this.diagram;if(null===a&&null!==this.network)for(var b=this.network.vertexes.iterator;b.next();){var c=b.value.node;if(null!==c&&(a=c.diagram,null!==a))break}try{null!==a&&a.Ja("Layout"),this.commitLayout()}finally{null!==a&&a.kb("Layout")}}}; +Di.prototype.commitLayout=function(){if(null!==this.network){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();if(this.isRouting)for(a=this.network.edges.iterator;a.next();)a.value.commit()}}; +Di.prototype.doLayout=function(a){G&&null===a&&v("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var b=new I;a instanceof P?(vq(this,b,a.nodes,!0,this.rh,!0,!1,!0),vq(this,b,a.parts,!0,this.rh,!0,!1,!0)):a instanceof wf?vq(this,b,a.memberParts,!1,this.rh,!0,!1,!0):b.addAll(a.iterator);0<b.count&&(a=this.diagram,null!==a&&a.Ja("Layout"),this.doMinimalNoNetworkLayout(b),null!==a&&a.kb("Layout"));this.isValidLayout=!0}; +Di.prototype.doMinimalNoNetworkLayout=function(a){var b=Math.ceil(Math.sqrt(a.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var c=this.arrangementOrigin.x,d=c,e=this.arrangementOrigin.y,f=0,g=0;for(a=a.iterator;a.next();){var h=a.value;wq(h);var k=h.measuredBounds,l=k.width;k=k.height;h.moveTo(d,e);h instanceof wf&&(h.rh=!1);d+=Math.max(l,50)+20;g=Math.max(g,Math.max(k,50));f>=b-1?(f=0,d=c,e+=g+20,g=0):f++}}; +Di.prototype.doMinimalNetworkLayout=function(){var a=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var b=this.arrangementOrigin.x,c=b,d=this.arrangementOrigin.y,e=0,f=0,g=this.network.vertexes.iterator;g.next();){var h=g.value.node;if(!(null===h||h instanceof R)&&(wq(h),this.rh(h))){var k=h.measuredBounds,l=k.width;k=k.height;h.moveTo(c,d);h instanceof wf&&(h.rh=!1);c+=Math.max(l,50)+20;f=Math.max(f,Math.max(k,50));e>=a-1?(e= +0,c=b,d+=f+20,f=0):e++}}};Di.prototype.rh=function(a){return!a.location.u()||a instanceof wf&&a.rh?!0:!1};function vq(a,b,c,d,e,f,g,h){for(c=c.iterator;c.next();){var k=c.value;d&&!k.isTopLevel||null!==e&&!e(k)||!k.canLayout()||(f&&k instanceof T?k.isLinkLabel||(k instanceof wf?null===k.layout?vq(a,b,k.memberParts,!1,e,f,g,h):(wq(k),b.add(k)):(wq(k),b.add(k))):g&&k instanceof R?b.add(k):!h||!k.Zc()||k instanceof T||(wq(k),b.add(k)))}} +function wq(a){var b=a.actualBounds;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.eb()}Di.prototype.ui=function(a,b){var c=this.boundsComputation;if(null!==c)return b||(b=new M),c(a,this,b);if(!b)return a.actualBounds;b.set(a.actualBounds);return b}; +Di.prototype.Ww=function(a){var b=new I;a instanceof P?(vq(this,b,a.nodes,!0,null,!0,!0,!0),vq(this,b,a.links,!0,null,!0,!0,!0),vq(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof wf?vq(this,b,a.memberParts,!1,null,!0,!0,!0):vq(this,b,a.iterator,!1,null,!0,!0,!0);return b}; +Di.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.oa(Fc),(isNaN(c.x)||isNaN(c.y))&&c.set(a),a=b.padding,c.x+=a.left,c.y+=a.top);return c}return a};Di.prototype.mayUseWorker=function(){return this.mayUseWorkerFunction?this.mayUseWorkerFunction(this):!1};Di.prototype.workerLayout=function(){return!1}; +function xq(a,b){if(null!==a.workerStateChanged){var c={key:a.group?a.group.key:null};void 0!==b&&(c.time=b);null!==a.yj&&(c.running=yq(a.yj));null!==a.pg&&(c.waiting=yq(a.pg));a.workerStateChanged(c,a)}}function yq(a){return{vertexes:a.vertexes.count,edges:a.edges.count}}Di.prototype.Ly=function(){var a=zq(this.constructor);a&&(null!==a.$e&&a.$e.terminate(),a.$e=null,a.Ql.iteratorValues.each(function(a){a.Mr=!1;a.yj=null;a.pg=null;a.wr=!1;xq(a)}),a.Ql.clear())}; +function Aq(a,b){var c=zq(a);if(c){if(b)for(var d in b)c[d]=b[d]}else throw Error("Unknown Layout class: "+a);}function zq(a){var b=null;if("function"===typeof a){if(b=Bq.get(a),!b){var c=Qa(a);b=Bq.get(c);b||(b=new Cq,b.Cu=a,b.name=c,b.j=a.name,b.xx=Dq,Bq.set(c,b),Bq.set(a,b),Bq.set(a.name,b))}}else"string"===typeof a&&(b=Bq.get(a));return b} +Di.prototype.Ev=function(){if("undefined"===typeof Worker||!Eq||"undefined"===typeof self||"undefined"!==typeof self.DedicatedWorkerGlobalScope)return!1;if(!this.mayUseWorker())return this.Mr&&(this.wr=!0,this.pg=this.yj=null,xq(this)),!1;var a=zq(this.constructor);if(null===a)return!1;null===a.$e&&(a.$e=new Worker(Eq),a.$e.onerror=function(a){a.preventDefault();Fa("Worker Error at: "+a.filename+" "+a.lineno+" "+a.colno+"\n "+a.message)},a.$e.j=function(a){Fa("Worker serialization error: "+a)},a.$e.onmessage= +function(b){var c=b.data;if("_GoJS"===c._GoJS)if(c.version&&P.version&&c.version!==P.version)Fa("Failure: GoJS v"+P.version+" Worker v"+c.version);else if(b=a.Ql.get(c.id)){a.Ql.remove(c.id);b.Mr=!1;b.yj=null;if(b.wr)b.wr=!1,b.pg=null;else{var d=Fq(b,c,!1);b.network=d;b.updateParts();b.network=null;b.isValidLayout=!0}xq(b,c.time);c=b.pg;if(null!==c)b.pg=null;else for(d=a.Ql.iteratorValues;d.next();){var e=d.value;c=e.pg;if(null!==c){e.pg=null;break}}null!==c&&Gq(b,c)}},a.$e.postMessage({_GoJS:"_GoJS", +url:a.xx}),Array.isArray(a.scripts)&&a.scripts.forEach(function(b){a.$e.postMessage({_GoJS:"_GoJS",url:b})}),a.$e.postMessage({_GoJS:"_GoJS",version:-1}));null!==this.yj?this.pg=this.network:Gq(this,this.network);xq(this);this.doMinimalNetworkLayout();this.network=null;return this.isValidLayout=!0};function Gq(a,b){a.Mr=!0;var c=zq(a.constructor),d=Hq(a,b,!0);d._GoJS="_GoJS";c.$e.postMessage(d);c.Ql.set(lb(a),a);a.yj=b} +function Hq(a,b,c){a.onNetworkSerialization(1,c,b,null);var d={};a.serializeLayoutProperties(d,c);var e=[];b.vertexes.each(function(a){var b={};a.serializeVertexProperties(b,c);e.push(b)});var f=[];b.edges.each(function(a){var b={};a.serializeEdgeProperties(b,c);f.push(b)});d={id:c?lb(a):a.id,layout:Qa(a.constructor),p:d,AA:e,dz:f};a.onNetworkSerialization(2,c,b,d);return d} +function Fq(a,b,c){c&&(a.id=b.id);var d=a.diagram,e=a.createNetwork();a.onNetworkSerialization(3,c,e,b);var f=b.AA,g=new yb;f&&f.forEach(function(a){var b=null;null===a.key||null===d||c||(b=d.Qb(a.key));null!==b?b=e.Lj(b):(b=e.createVertex(),e.rg(b));c&&null!==a.key&&(b.data={Kh:a.key});g.set(a.id,b)});var h=b.dz,k=new yb;h&&h.forEach(function(a){var b=null;null===a.key||null===d||c||(b=d.findLinkForKey(a.key));var f=e.createEdge();e.Bl(f);f.link=b;c&&null!==a.key&&(f.data={Kh:a.key});k.set(a.id, +f)});f&&f.forEach(function(a){var b=g.get(a.id);b&&b.deserializeVertexProperties(a,g,k,c)});h&&h.forEach(function(a){var b=k.get(a.id);b&&b.deserializeEdgeProperties(a,g,k,c)});a.deserializeLayoutProperties(b.p,g,k,c,e);a.onNetworkSerialization(4,c,e,b);return e}Di.prototype.onNetworkSerialization=function(){}; +oa.Object.defineProperties(Di.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){null!==a&&w(a,P,Di,"diagram");this.H=a}},group:{configurable:!0,get:function(){return this.m},set:function(a){this.m!==a&&(null!==a&&w(a,wf,Di,"group"),this.m=a,null!==a&&(this.H=a.diagram))}},isOngoing:{configurable:!0,get:function(){return this.ln},set:function(a){this.ln!==a&&(A(a,"boolean",Di,"isOngoing"),this.ln=a)}},isInitial:{configurable:!0, +enumerable:!0,get:function(){return this.Ih},set:function(a){A(a,"boolean",Di,"isInitial");this.Ih=a;a||(this.qn=!0)}},isViewportSized:{configurable:!0,get:function(){return this.rn},set:function(a){this.rn!==a&&(A(a,"boolean",Di,"isViewportSized"),(this.rn=a)&&this.F())}},isRouting:{configurable:!0,get:function(){return this.on},set:function(a){this.on!==a&&(A(a,"boolean",Di,"isRouting"),this.on=a)}},isRealtime:{configurable:!0,get:function(){return this.nn}, +set:function(a){this.nn!==a&&(null!==a&&A(a,"boolean",Di,"isRealtime"),this.nn=a)}},isValidLayout:{configurable:!0,get:function(){return this.qn},set:function(a){this.qn!==a&&(A(a,"boolean",Di,"isValidLayout"),this.qn=a,a||(a=this.diagram,null!==a&&(a.xh=!0)))}},network:{configurable:!0,get:function(){return this.j},set:function(a){this.j!==a&&(null!==a&&w(a,uq,Di,"network"),this.j=a,null!==a&&(a.layout=this))}},boundsComputation:{configurable:!0,get:function(){return this.zm}, +set:function(a){this.zm!==a&&(null!==a&&A(a,"function",Di,"boundsComputation"),this.zm=a,this.F())}},arrangementOrigin:{configurable:!0,get:function(){return this.vm},set:function(a){w(a,K,Di,"arrangementOrigin");this.vm.D(a)||(this.vm.assign(a),this.F())}},id:{configurable:!0,get:function(){return this.v},set:function(a){this.v=a}},mayUseWorkerFunction:{configurable:!0,get:function(){return this.zn},set:function(a){this.zn!==a&&(null!==a&&A(a,"function", +Di,"mayUseWorkerFunction"),this.zn=a)}},workerStateChanged:{configurable:!0,get:function(){return this.oo},set:function(a){this.oo!==a&&(null!==a&&A(a,"function",Di,"workerStateChanged"),this.oo=a)}}});Di.prototype.useWorker=Di.prototype.Ev;Di.declareWorkerLayout=Aq;Di.prototype.cancelWorker=Di.prototype.Ly;Di.prototype.collectParts=Di.prototype.Ww;Di.prototype.getLayoutBounds=Di.prototype.ui;Di.prototype.invalidateLayout=Di.prototype.F; +var Bq=new yb,Dq="object"===typeof sa.document&&sa.document.currentScript?sa.document.currentScript.src:"",Eq="undefined"!==typeof URL&&"function"===typeof URL.createObjectURL&&"function"===typeof Blob?URL.createObjectURL(new Blob(["self.onmessage=function(e){if(e.data.url){\nimportScripts(e.data.url);}}"],{type:"text/javascript"})):"";Di.className="Layout";Di.GoJSScriptURL=Dq;Di.declareWorkerLayout=Aq; +"undefined"!==typeof self&&"undefined"!==typeof self.DedicatedWorkerGlobalScope&&"undefined"!==typeof self&&"undefined"!==typeof self.DedicatedWorkerGlobalScope&&(self.onmessage=function(a){a=a.data;if("_GoJS"===a._GoJS)if(a.url)importScripts(a.url);else if(a.version)self.postMessage({_GoJS:"_GoJS",version:P.version},void 0);else{var b=performance.now(),c=null;a.layout&&(c=zq(a.layout));var d=null;c&&c.Cu&&(d=new c.Cu);if(!d)throw Error("no registered Worker Layout: "+a.layout);d.network=Fq(d,a,!0); +d.workerLayout=function(){var a=Hq(d,d.network,!1);a._GoJS="_GoJS";a.time=performance.now()-b;self.postMessage(a,void 0);return!0};d.doLayout(new H)}});function Cq(){this.Cu=null;this.xx=this.j=this.name="";this.scripts=[];this.$e=null;this.Ql=new yb}function uq(a){Za(this);G&&!a&&v("LayoutNetwork constructor requires non-null Layout argument");this.Qc=a;this.xf=new I;this.ze=new I;this.rs=new yb;this.ms=new yb} +uq.prototype.clear=function(){if(this.xf)for(var a=this.xf.iterator;a.next();)a.value.clear();if(this.ze)for(a=this.ze.iterator;a.next();)a.value.clear();this.xf=new I;this.ze=new I;this.rs=new yb;this.ms=new yb}; +uq.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.layout?"("+this.layout.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.xf.count+" edges: "+this.ze.count;if(1<a){for(var c=this.xf.iterator;c.next();)b+="\n "+c.value.toString(a-1);for(c=this.ze.iterator;c.next();)b+="\n "+c.value.toString(a-1)}return b};uq.prototype.createVertex=function(){return new Iq(this)};uq.prototype.createEdge=function(){return new Jq(this)}; +uq.prototype.qg=function(a,b,c){if(null!==a){void 0===b&&(b=!1);A(b,"boolean",uq,"addParts:toplevelonly");void 0===c&&(c=null);null===c&&(c=function(a){if(a instanceof T)return!a.isLinkLabel;if(a instanceof R){var b=a.fromNode;if(null===b||b.isLinkLabel)return!1;a=a.toNode;return null===a||a.isLinkLabel?!1:!0}return!1});for(a=a.iterator;a.next();){var d=a.value;if(d instanceof T&&(!b||d.isTopLevel)&&d.canLayout()&&c(d))if(d instanceof wf&&null===d.layout)this.qg(d.memberParts,!1);else if(null===this.ri(d)){var e= +this.createVertex();e.node=d;this.rg(e)}}for(a.reset();a.next();)if(d=a.value,d instanceof R&&(!b||d.isTopLevel)&&d.canLayout()&&c(d)&&null===this.Co(d)){var f=d.fromNode;e=d.toNode;null!==f&&null!==e&&f!==e&&(f=this.findGroupVertex(f),e=this.findGroupVertex(e),null!==f&&null!==e&&this.bk(f,e,d))}}}; +uq.prototype.findGroupVertex=function(a){if(null===a)return null;var b=a.findVisibleNode();if(null===b)return null;a=this.ri(b);if(null!==a)return a;for(b=b.containingGroup;null!==b;){a=this.ri(b);if(null!==a)return a;b=b.containingGroup}return null};t=uq.prototype;t.rg=function(a){if(null!==a){G&&w(a,Iq,uq,"addVertex:vertex");this.xf.add(a);var b=a.node;null!==b&&this.rs.add(b,a);a.network=this}}; +t.Lj=function(a){if(null===a)return null;G&&w(a,T,uq,"addNode:node");var b=this.ri(a);null===b&&(b=this.createVertex(),b.node=a,this.rg(b));return b};t.Fu=function(a){if(null!==a&&(G&&w(a,Iq,uq,"deleteVertex:vertex"),Kq(this,a))){for(var b=a.Cd,c=b.count-1;0<=c;c--){var d=b.N(c);this.Tj(d)}b=a.Pd;for(a=b.count-1;0<=a;a--)c=b.N(a),this.Tj(c)}};function Kq(a,b){if(null===b)return!1;var c=a.xf.remove(b);c&&(b=b.node,null!==b&&a.rs.remove(b));return c} +t.Xy=function(a){null!==a&&(G&&w(a,T,uq,"deleteNode:node"),a=this.ri(a),null!==a&&this.Fu(a))};t.ri=function(a){if(null===a)return null;G&&w(a,T,uq,"findVertex:node");return this.rs.L(a)};t.Bl=function(a){if(null!==a){G&&w(a,Jq,uq,"addEdge:edge");Lq(this,a);var b=a.toVertex;null!==b&&b.vu(a);b=a.fromVertex;null!==b&&b.tu(a)}};function Lq(a,b){if(null!==b){a.ze.add(b);var c=b.link;null!==c&&null===a.Co(c)&&a.ms.add(c,b);b.network=a}} +t.By=function(a){if(null===a)return null;G&&w(a,R,uq,"addLink:link");var b=a.fromNode,c=a.toNode,d=this.Co(a);null===d?(d=this.createEdge(),d.link=a,null!==b&&(d.fromVertex=this.Lj(b)),null!==c&&(d.toVertex=this.Lj(c)),this.Bl(d)):(null!==b?d.fromVertex=this.Lj(b):d.fromVertex=null,null!==c?d.toVertex=this.Lj(c):d.toVertex=null);return d};t.Tj=function(a){if(null!==a){G&&w(a,Jq,uq,"deleteEdge:edge");var b=a.toVertex;null!==b&&b.Eu(a);b=a.fromVertex;null!==b&&b.Du(a);Mq(this,a)}}; +function Mq(a,b){null!==b&&a.ze.remove(b)&&(b=b.link,null!==b&&a.ms.remove(b))}t.Wy=function(a){null!==a&&(G&&w(a,R,uq,"deleteLink:link"),a=this.Co(a),null!==a&&this.Tj(a))};t.Co=function(a){if(null===a)return null;G&&w(a,R,uq,"findEdge:link");return this.ms.L(a)}; +t.bk=function(a,b,c){if(null===a||null===b)return null;G&&(w(a,Iq,uq,"linkVertexes:fromVertex"),w(b,Iq,uq,"linkVertexes:toVertex"),null!==c&&w(c,R,uq,"linkVertexes:link"));if(a.network===this&&b.network===this){var d=this.createEdge();d.link=c;d.fromVertex=a;d.toVertex=b;this.Bl(d);return d}return null};t.bm=function(a){if(null!==a){G&&w(a,Jq,uq,"reverseEdge:edge");var b=a.fromVertex,c=a.toVertex;null!==b&&null!==c&&(b.Du(a),c.Eu(a),a.bm(),b.vu(a),c.tu(a))}}; +t.Ao=function(){for(var a=Na(),b=this.ze.iterator;b.next();){var c=b.value;c.fromVertex===c.toVertex&&a.push(c)}b=a.length;for(c=0;c<b;c++)this.Tj(a[c]);Pa(a)};uq.prototype.deleteArtificialVertexes=function(){for(var a=Na(),b=this.xf.iterator;b.next();){var c=b.value;null===c.node&&null===c.data&&a.push(c)}c=a.length;for(b=0;b<c;b++)this.Fu(a[b]);b=Na();for(c=this.ze.iterator;c.next();){var d=c.value;null===d.link&&null===d.data&&b.push(d)}c=b.length;for(d=0;d<c;d++)this.Tj(b[d]);Pa(a);Pa(b)}; +function Nq(a){for(var b=Na(),c=a.ze.iterator;c.next();){var d=c.value;null!==d.fromVertex&&null!==d.toVertex||b.push(d)}c=b.length;for(d=0;d<c;d++)a.Tj(b[d]);Pa(b)} +uq.prototype.Yx=function(a){void 0===a&&(a=!0);a&&(this.deleteArtificialVertexes(),Nq(this),this.Ao());a=new H;for(var b=!0;b;){b=!1;for(var c=this.xf.iterator;c.next();){var d=c.value;if(0<d.Cd.count||0<d.Pd.count){b=this.layout.createNetwork();a.add(b);Oq(this,b,d);b=!0;break}}}a.sort(function(a,b){return null===a||null===b||a===b?0:b.vertexes.count-a.vertexes.count});return a}; +function Oq(a,b,c){if(null!==c&&c.network!==b){Kq(a,c);b.rg(c);for(var d=c.sourceEdges;d.next();){var e=d.value;e.network!==b&&(Mq(a,e),Lq(b,e),Oq(a,b,e.fromVertex))}for(d=c.destinationEdges;d.next();)c=d.value,c.network!==b&&(Mq(a,c),Lq(b,c),Oq(a,b,c.toVertex))}}uq.prototype.ez=function(){for(var a=new I,b=this.xf.iterator;b.next();)a.add(b.value.node);for(b=this.ze.iterator;b.next();)a.add(b.value.link);return a}; +oa.Object.defineProperties(uq.prototype,{layout:{configurable:!0,get:function(){return this.Qc},set:function(a){null!==a&&(this.Qc=a)}},vertexes:{configurable:!0,get:function(){return this.xf}},edges:{configurable:!0,get:function(){return this.ze}}});uq.prototype.findAllParts=uq.prototype.ez;uq.prototype.splitIntoSubNetworks=uq.prototype.Yx;uq.prototype.deleteSelfEdges=uq.prototype.Ao;uq.prototype.reverseEdge=uq.prototype.bm;uq.prototype.linkVertexes=uq.prototype.bk; +uq.prototype.findEdge=uq.prototype.Co;uq.prototype.deleteLink=uq.prototype.Wy;uq.prototype.deleteEdge=uq.prototype.Tj;uq.prototype.addLink=uq.prototype.By;uq.prototype.addEdge=uq.prototype.Bl;uq.prototype.findVertex=uq.prototype.ri;uq.prototype.deleteNode=uq.prototype.Xy;uq.prototype.deleteVertex=uq.prototype.Fu;uq.prototype.addNode=uq.prototype.Lj;uq.prototype.addVertex=uq.prototype.rg;uq.prototype.addParts=uq.prototype.qg;uq.className="LayoutNetwork"; +function Iq(a){Za(this);G&&!a&&v("LayoutVertex constructor requires non-null LayoutNetwork argument");this.tb=a;this.j=(new M(0,0,10,10)).freeze();this.m=(new K(5,5)).freeze();this.Xh=this.vb=null;this.Cd=new H;this.Pd=new H} +Iq.prototype.serializeVertexProperties=function(a){a.id=lb(this);a.key=this.node?this.node.key:this.data?this.data.Kh:void 0;void 0===a.key&&(a.key=null);a.x=this.bounds.x;a.y=this.bounds.y;a.BA=this.bounds.width;a.Jz=this.bounds.height;a.fx=this.focus.x;a.fy=this.focus.y;var b=[];this.Cd.each(function(a){b.push(lb(a))});a.Wx=b;var c=[];this.Pd.each(function(a){c.push(lb(a))});a.bx=c}; +Iq.prototype.deserializeVertexProperties=function(a,b,c){if(null!==a){this.x=a.x;this.y=a.y;this.width=a.BA;this.height=a.Jz;this.focusX=a.fx;this.focusY=a.fy;var d=this;a.Wx&&a.Wx.forEach(function(a){(a=c.get(a))&&d.Cd.add(a)});a.bx&&a.bx.forEach(function(a){(a=c.get(a))&&d.Pd.add(a)})}};Iq.prototype.clear=function(){this.Xh=this.vb=null;this.Cd=new H;this.Pd=new H}; +Iq.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutVertex#"+lb(this);if(0<a&&(b+=null!==this.node?"("+this.node.toString()+")":"",1<a)){a="";for(var c=!0,d=this.Cd.iterator;d.next();){var e=d.value;c?c=!1:a+=",";a+=e.toString(0)}e="";c=!0;for(d=this.Pd.iterator;d.next();){var f=d.value;c?c=!1:e+=",";e+=f.toString(0)}b+=" sources: "+a+" destinations: "+e}return b}; +Iq.prototype.commit=function(){var a=this.vb;if(null!==a){var b=this.bounds,c=a.bounds;Ga(c)?(c.x=b.x,c.y=b.y,c.width=b.width,c.height=b.height):a.bounds=b.copy()}else if(a=this.node,null!==a){b=this.bounds;if(!(a instanceof wf)){c=M.alloc();var d=this.network.layout.ui(a,c),e=a.locationObject.oa(Kc);if(d.u()&&e.u()){a.moveTo(b.x+this.focusX-(e.x-d.x),b.y+this.focusY-(e.y-d.y));M.free(c);return}M.free(c)}a.moveTo(b.x,b.y)}}; +Iq.prototype.vu=function(a){null!==a&&(G&&w(a,Jq,Iq,"addSourceEdge:edge"),this.Cd.contains(a)||this.Cd.add(a))};Iq.prototype.Eu=function(a){null!==a&&(G&&w(a,Jq,Iq,"deleteSourceEdge:edge"),this.Cd.remove(a))};Iq.prototype.tu=function(a){null!==a&&(G&&w(a,Jq,Iq,"addDestinationEdge:edge"),this.Pd.contains(a)||this.Pd.add(a))};Iq.prototype.Du=function(a){null!==a&&(G&&w(a,Jq,Iq,"deleteDestinationEdge:edge"),this.Pd.remove(a))}; +function Pq(a,b){G&&w(a,Iq,Iq,"standardComparer:m");G&&w(b,Iq,Iq,"standardComparer:n");a=a.Xh;b=b.Xh;return a?b?(a=a.text,b=b.text,a<b?-1:a>b?1:0):1:null!==b?-1:0} +oa.Object.defineProperties(Iq.prototype,{sourceEdgesArrayAccess:{configurable:!0,get:function(){return this.Cd._dataArray}},destinationEdgesArrayAccess:{configurable:!0,get:function(){return this.Pd._dataArray}},data:{configurable:!0,get:function(){return this.vb},set:function(a){this.vb=a;if(null!==a&&a.bounds){var b=a.bounds;a=b.x;var c=b.y,d=b.width;b=b.height;this.m.h(d/2,b/2);this.j.h(a,c,d,b)}}},node:{configurable:!0,get:function(){return this.Xh}, +set:function(a){if(this.Xh!==a){G&&null!==a&&w(a,T,Iq,"node");this.Xh=a;a.eb();var b=this.network.layout,c=M.alloc(),d=b.ui(a,c);b=d.x;var e=d.y,f=d.width;d=d.height;isNaN(b)&&(b=0);isNaN(e)&&(e=0);this.j.h(b,e,f,d);M.free(c);if(!(a instanceof wf)&&(a=a.locationObject.oa(Kc),a.u())){this.m.h(a.x-b,a.y-e);return}this.m.h(f/2,d/2)}}},bounds:{configurable:!0,get:function(){return this.j},set:function(a){this.j.D(a)||(G&&w(a,M,Iq,"bounds"),this.j.assign(a))}},focus:{configurable:!0, +get:function(){return this.m},set:function(a){this.m.D(a)||(G&&w(a,K,Iq,"focus"),this.m.assign(a))}},centerX:{configurable:!0,get:function(){return this.j.x+this.m.x},set:function(a){var b=this.j;b.x+this.m.x!==a&&(G&&E(a,Iq,"centerX"),b.pa(),b.x=a-this.m.x,b.freeze())}},centerY:{configurable:!0,get:function(){return this.j.y+this.m.y},set:function(a){var b=this.j;b.y+this.m.y!==a&&(G&&E(a,Iq,"centerY"),b.pa(),b.y=a-this.m.y,b.freeze())}},focusX:{configurable:!0, +get:function(){return this.m.x},set:function(a){var b=this.m;b.x!==a&&(b.pa(),b.x=a,b.freeze())}},focusY:{configurable:!0,get:function(){return this.m.y},set:function(a){var b=this.m;b.y!==a&&(b.pa(),b.y=a,b.freeze())}},x:{configurable:!0,get:function(){return this.j.x},set:function(a){var b=this.j;b.x!==a&&(b.pa(),b.x=a,b.freeze())}},y:{configurable:!0,get:function(){return this.j.y},set:function(a){var b=this.j;b.y!==a&&(b.pa(),b.y=a,b.freeze())}},width:{configurable:!0, +enumerable:!0,get:function(){return this.j.width},set:function(a){var b=this.j;b.width!==a&&(b.pa(),b.width=a,b.freeze())}},height:{configurable:!0,get:function(){return this.j.height},set:function(a){var b=this.j;b.height!==a&&(b.pa(),b.height=a,b.freeze())}},network:{configurable:!0,get:function(){return this.tb},set:function(a){G&&w(a,uq,Iq,"network");this.tb=a}},sourceVertexes:{configurable:!0,get:function(){for(var a=new I,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex); +return a.iterator}},destinationVertexes:{configurable:!0,get:function(){for(var a=new I,b=this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},vertexes:{configurable:!0,get:function(){for(var a=new I,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);for(b=this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},sourceEdges:{configurable:!0,get:function(){return this.Cd.iterator}},destinationEdges:{configurable:!0, +enumerable:!0,get:function(){return this.Pd.iterator}},edges:{configurable:!0,get:function(){for(var a=new H,b=this.sourceEdges;b.next();)a.add(b.value);for(b=this.destinationEdges;b.next();)a.add(b.value);return a.iterator}},edgesCount:{configurable:!0,get:function(){return this.Cd.count+this.Pd.count}}});Iq.prototype.deleteDestinationEdge=Iq.prototype.Du;Iq.prototype.addDestinationEdge=Iq.prototype.tu;Iq.prototype.deleteSourceEdge=Iq.prototype.Eu; +Iq.prototype.addSourceEdge=Iq.prototype.vu;Iq.className="LayoutVertex";Iq.standardComparer=Pq; +Iq.smartComparer=function(a,b){G&&w(a,Iq,Iq,"smartComparer:m");G&&w(b,Iq,Iq,"smartComparer:n");if(null!==a){if(null!==b){a=a.Xh;var c=b.Xh;if(null!==a){if(null!==c){b=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);a=c.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);for(c=0;c<b.length;c++)if(""!==a[c]&&void 0!==a[c]){var d=parseFloat(b[c]),e=parseFloat(a[c]);if(isNaN(d))if(isNaN(e)){if(0!==b[c].localeCompare(a[c]))return b[c].localeCompare(a[c])}else return 1; +else{if(isNaN(e))return-1;if(0!==d-e)return d-e}}else if(""!==b[c])return 1;return""!==a[c]&&void 0!==a[c]?-1:0}return 1}return null!==c?-1:0}return 1}return null!==b?-1:0};function Jq(a){Za(this);G&&!a&&v("LayoutEdge constructor requires non-null LayoutNetwork argument");this.ob=a;this.pd=this.gd=this.bl=this.vb=null}Jq.prototype.clear=function(){this.pd=this.gd=this.bl=this.vb=null}; +Jq.prototype.serializeEdgeProperties=function(a){a.id=lb(this);a.key=this.link?this.link.key:this.data?this.data.Kh:void 0;void 0===a.key&&(a.key=null);a.from=this.fromVertex?lb(this.fromVertex):null;a.wA=this.toVertex?lb(this.toVertex):null};Jq.prototype.deserializeEdgeProperties=function(a,b){if(null!==a){var c=b.get(a.from);c&&(this.fromVertex=c);if(a=b.get(a.wA))this.toVertex=a}}; +Jq.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutEdge#"+lb(this);0<a&&(b+=null!==this.bl?"("+this.bl.toString()+")":"",1<a&&(b+=" "+(this.gd?this.gd.toString():"null")+" --\x3e "+(this.pd?this.pd.toString():"null")));return b};Jq.prototype.bm=function(){var a=this.gd;this.gd=this.pd;this.pd=a};Jq.prototype.commit=function(){};Jq.prototype.ux=function(a){G&&w(a,Iq,Jq,"getOtherVertex:v");return this.pd===a?this.gd:this.gd===a?this.pd:null}; +oa.Object.defineProperties(Jq.prototype,{network:{configurable:!0,get:function(){return this.ob},set:function(a){G&&w(a,uq,Jq,"network");this.ob=a}},data:{configurable:!0,get:function(){return this.vb},set:function(a){this.vb!==a&&(G&&null!==a&&A(a,"object",Jq,"data"),this.vb=a)}},link:{configurable:!0,get:function(){return this.bl},set:function(a){this.bl!==a&&(G&&null!==a&&w(a,R,Jq,"link"),this.bl=a)}},fromVertex:{configurable:!0,get:function(){return this.gd}, +set:function(a){this.gd!==a&&(G&&null!==a&&w(a,Iq,Jq,"fromVertex"),this.gd=a)}},toVertex:{configurable:!0,get:function(){return this.pd},set:function(a){this.pd!==a&&(G&&null!==a&&w(a,Iq,Jq,"toVertex"),this.pd=a)}}});Jq.prototype.getOtherVertex=Jq.prototype.ux;Jq.className="LayoutEdge"; +function $k(a){Di.call(this);this.isViewportSized=!0;this.po=this.qo=NaN;this.Bg=(new Hb(NaN,NaN)).freeze();this.uf=(new Hb(10,10)).freeze();this.Kb=Qq;this.Tb=Rq;this.md=Sq;this.ed=Tq;a&&Object.assign(this,a)}na($k,Di);$k.prototype.cloneProtected=function(a){Di.prototype.cloneProtected.call(this,a);a.qo=this.qo;a.po=this.po;a.Bg.assign(this.Bg);a.uf.assign(this.uf);a.Kb=this.Kb;a.Tb=this.Tb;a.md=this.md;a.ed=this.ed}; +$k.prototype.ub=function(a){a.classType===$k?a===Sq||a===Uq||a===Vq||a===Wq?this.sorting=a:a===Rq||a===Xq?this.arrangement=a:a===Qq||a===Yq?this.alignment=a:v("Unknown enum value: "+a):Di.prototype.ub.call(this,a)}; +$k.prototype.doLayout=function(a){G&&null===a&&v("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var b=this.Ww(a);a=this.diagram;for(var c=b.copy().iterator;c.next();){var d=c.value;if(!d.ph()||null===d.fromNode&&null===d.toNode){if(d.eb(),d instanceof wf)for(d=d.memberParts;d.next();)b.remove(d.value)}else b.remove(d)}var e=b.Ka();if(0!==e.length){switch(this.sorting){case Wq:e.reverse(); +break;case Sq:e.sort(this.comparer);break;case Uq:e.sort(this.comparer),e.reverse()}var f=this.wrappingColumn;isNaN(f)&&(f=0);var g=this.wrappingWidth;isNaN(g)&&null!==a?(b=a.padding,g=Math.max(a.viewportBounds.width-b.left-b.right,0)):g=Math.max(this.wrappingWidth,0);0>=f&&0>=g&&(f=1);b=this.spacing.width;isFinite(b)||(b=0);c=this.spacing.height;isFinite(c)||(c=0);null!==a&&a.Ja("Layout");d=[];switch(this.alignment){case Yq:var h=b,k=c,l=M.alloc(),m=Math.max(this.cellSize.width,1);if(!isFinite(m))for(var n= +m=0;n<e.length;n++){var p=this.ui(e[n],l);m=Math.max(m,p.width)}m=Math.max(m+h,1);n=Math.max(this.cellSize.height,1);if(!isFinite(n))for(p=n=0;p<e.length;p++){var r=this.ui(e[p],l);n=Math.max(n,r.height)}n=Math.max(n+k,1);p=this.arrangement;for(var q=r=this.arrangementOrigin.x,u=this.arrangementOrigin.y,x=0,y=0,z=0;z<e.length;z++){var B=e[z],C=this.ui(B,l),D=Math.ceil((C.width+h)/m)*m,J=Math.ceil((C.height+k)/n)*n;switch(p){case Xq:var U=Math.abs(q-C.width);break;default:U=q+C.width}if(0<f&&x>f-1|| +0<g&&0<x&&U-r>g)d.push(new M(0,u,g+h,y)),x=0,q=r,u+=y,y=0;y=Math.max(y,J);switch(p){case Xq:C=-C.width;break;default:C=0}B.moveTo(q+C,u);switch(p){case Xq:q-=D;break;default:q+=D}x++}d.push(new M(0,u,g+h,y));M.free(l);break;case Qq:k=g;m=f;n=b;p=c;g=M.alloc();r=Math.max(this.cellSize.width,1);f=u=l=0;h=K.alloc();for(q=0;q<e.length;q++)y=e[q],x=this.ui(y,g),y=Wo(y,y.locationObject,y.locationSpot,h),l=Math.max(l,y.x),u=Math.max(u,x.width-y.x),f=Math.max(f,y.y);q=this.arrangement;switch(q){case Xq:l+= +n;break;default:u+=n}r=isFinite(r)?Math.max(r+n,1):Math.max(l+u,1);var aa=y=this.arrangementOrigin.x;z=this.arrangementOrigin.y;u=0;k>=l&&(k-=l);l=B=0;D=Math.max(this.cellSize.height,1);C=f=0;J=!0;x=K.alloc();for(U=0;U<e.length;U++){var Y=e[U],W=this.ui(Y,g),Q=Wo(Y,Y.locationObject,Y.locationSpot,h);if(0<u)switch(q){case Xq:aa=(aa-y-(W.width-Q.x))/r;aa=L.ha(Math.round(aa),aa)?Math.round(aa):Math.floor(aa);aa=aa*r+y;break;default:aa=(aa-y+Q.x)/r,aa=L.ha(Math.round(aa),aa)?Math.round(aa):Math.ceil(aa), +aa=aa*r+y}else switch(q){case Xq:B=aa+Q.x+W.width;break;default:B=aa-Q.x}switch(q){case Xq:var la=-(aa+Q.x)+B;break;default:la=aa+W.width-Q.x-B}if(0<m&&u>m-1||0<k&&0<u&&la>k){d.push(new M(0,J?z-f:z,k+n,C+f+p));for(aa=0;aa<u&&U!==u;aa++){la=e[U-u+aa];var fa=Wo(la,la.locationObject,la.locationSpot,x);la.moveTo(la.position.x,la.position.y+f-fa.y)}C+=p;z=J?z+C:z+(C+f);u=C=f=0;aa=y;J=!1}aa===y&&(l=q===Xq?Math.max(l,W.width-Q.x):Math.min(l,-Q.x));f=Math.max(f,Q.y);C=Math.max(C,W.height-Q.y);isFinite(D)&& +(C=Math.max(C,Math.max(W.height,D)-Q.y));J?Y.moveTo(aa-Q.x,z-Q.y):Y.moveTo(aa-Q.x,z);switch(q){case Xq:aa-=Q.x+n;break;default:aa+=W.width-Q.x+n}u++}d.push(new M(0,z,k+n,(J?C:C+f)+p));if(e.length!==u)for(k=0;k<u;k++)m=e[e.length-u+k],n=Wo(m,m.locationObject,m.locationSpot,h),m.moveTo(m.position.x,m.position.y+f-n.y);K.free(h);K.free(x);if(q===Xq)for(e=0;e<d.length;e++)f=d[e],f.width+=l,f.x-=l;else for(e=0;e<d.length;e++)f=d[e],f.x>l&&(f.width+=f.x-l,f.x=l);M.free(g)}for(h=f=g=e=0;h<d.length;h++)k= +d[h],e=Math.min(e,k.x),g=Math.min(g,k.y),f=Math.max(f,k.x+k.width);this.arrangement===Xq?this.commitLayers(d,new K(e+b/2-(f+e),g-c/2)):this.commitLayers(d,new K(e-b/2,g-c/2));null!==a&&a.kb("Layout");this.isValidLayout=!0}};$k.prototype.commitLayers=function(){};function Tq(a,b){G&&w(a,S,$k,"standardComparer:a");G&&w(b,S,$k,"standardComparer:b");a=a.text;b=b.text;return a<b?-1:a>b?1:0} +oa.Object.defineProperties($k.prototype,{wrappingWidth:{configurable:!0,get:function(){return this.qo},set:function(a){this.qo!==a&&(A(a,"number",$k,"wrappingWidth"),0<a||isNaN(a))&&(this.qo=a,this.isViewportSized=isNaN(a),this.F())}},wrappingColumn:{configurable:!0,get:function(){return this.po},set:function(a){this.po!==a&&(A(a,"number",$k,"wrappingColumn"),0<a||isNaN(a))&&(this.po=a,this.F())}},cellSize:{configurable:!0,get:function(){return this.Bg},set:function(a){w(a, +Hb,$k,"cellSize");this.Bg.D(a)||(this.Bg.assign(a),this.F())}},spacing:{configurable:!0,get:function(){return this.uf},set:function(a){w(a,Hb,$k,"spacing");this.uf.D(a)||(this.uf.assign(a),this.F())}},alignment:{configurable:!0,get:function(){return this.Kb},set:function(a){this.Kb!==a&&(ab(a,$k,$k,"alignment"),a===Qq||a===Yq)&&(this.Kb=a,this.F())}},arrangement:{configurable:!0,get:function(){return this.Tb},set:function(a){this.Tb!==a&&(ab(a,$k,$k,"arrangement"), +a===Rq||a===Xq)&&(this.Tb=a,this.F())}},sorting:{configurable:!0,get:function(){return this.md},set:function(a){this.md!==a&&(ab(a,$k,$k,"sorting"),a===Vq||a===Wq||a===Sq||a===Uq)&&(this.md=a,this.F())}},comparer:{configurable:!0,get:function(){return this.ed},set:function(a){this.ed!==a&&(A(a,"function",$k,"comparer"),this.ed=a,this.F())}}}); +var Yq=new F($k,"Position",0),Qq=new F($k,"Location",1),Rq=new F($k,"LeftToRight",2),Xq=new F($k,"RightToLeft",3),Vq=new F($k,"Forward",4),Wq=new F($k,"Reverse",5),Sq=new F($k,"Ascending",6),Uq=new F($k,"Descending",7);$k.className="GridLayout";$k.standardComparer=Tq; +$k.smartComparer=function(a,b){G&&w(a,S,$k,"standardComparer:a");G&&w(b,S,$k,"standardComparer:b");if(null!==a){if(null!==b){a=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);b=b.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);for(var c=0;c<a.length;c++)if(""!==b[c]&&void 0!==b[c]){var d=parseFloat(a[c]),e=parseFloat(b[c]);if(isNaN(d))if(isNaN(e)){if(0!==a[c].localeCompare(b[c]))return a[c].localeCompare(b[c])}else return 1;else{if(isNaN(e))return-1; +if(0!==d-e)return d-e}}else if(""!==a[c])return 1;return""!==b[c]&&void 0!==b[c]?-1:0}return 1}return null!==b?-1:0};$k.Position=Yq;$k.Location=Qq;$k.LeftToRight=Rq;$k.RightToLeft=Xq;$k.Forward=Vq;$k.Reverse=Wq;$k.Ascending=Sq;$k.Descending=Uq;function zi(){this.Hn=new I;this.wn=new I;this.Ra=new I;this.df=new yb;this.cf=new yb;this.ij=new yb;this.H=null;this.kp=!1}t=zi.prototype;t.clear=function(){this.Hn.clear();this.wn.clear();this.Ra.clear();this.df.clear();this.cf.clear();this.ij.clear()}; +t.Ye=function(a){G&&null!==a&&w(a,P,zi,"setDiagram");this.H=a};t.vi=function(a){if(a instanceof T){if(this.Hn.add(a),a instanceof wf){var b=a.containingGroup;null===b?this.H.fi.add(a):b.hl.add(a);b=a.layout;null!==b&&(b.diagram=this.H)}}else a instanceof R?this.wn.add(a):a instanceof Ce||this.Ra.add(a);b=a.data;null===b||a instanceof Ce||(a instanceof R?this.cf.add(b,a):this.df.add(b,a))}; +t.rc=function(a){a.Mj();if(a instanceof T){if(this.Hn.remove(a),a instanceof wf){var b=a.containingGroup;null===b?this.H.fi.remove(a):b.hl.remove(a);b=a.layout;null!==b&&(b.diagram=null)}}else a instanceof R?this.wn.remove(a):a instanceof Ce||this.Ra.remove(a);b=a.data;null===b||a instanceof Ce||(a instanceof R?this.cf.remove(b):this.df.remove(b))}; +t.Ud=function(){var a=this.H;if(null!==a){for(var b=a.nodeTemplateMap.iterator;b.next();){var c=b.value,d=b.key;(!c.Zc()||c instanceof wf)&&v('Invalid node template in Diagram.nodeTemplateMap: template for "'+d+'" must be a Node or a simple Part, not a Group or Link: '+c)}for(b=a.groupTemplateMap.iterator;b.next();)c=b.value,d=b.key,c instanceof wf||v('Invalid group template in Diagram.groupTemplateMap: template for "'+d+'" must be a Group, not a normal Node or Link: '+c);for(b=a.linkTemplateMap.iterator;b.next();)c= +b.value,d=b.key,c instanceof R||v('Invalid link template in Diagram.linkTemplateMap: template for "'+d+'" must be a Link, not a normal Node or simple Part: '+c);b=Na();for(c=a.selection.iterator;c.next();)(d=c.value.data)&&b.push(d);c=Na();for(a=a.highlighteds.iterator;a.next();)(d=a.value.data)&&c.push(d);a=Na();for(d=this.nodes.iterator;d.next();){var e=d.value;null!==e.data&&(a.push(e.data),a.push(e.location))}for(d=this.links.iterator;d.next();)e=d.value,null!==e.data&&(a.push(e.data),a.push(e.location)); +for(d=this.parts.iterator;d.next();)e=d.value,null!==e.data&&(a.push(e.data),a.push(e.location));this.removeAllModeledParts();this.addAllModeledParts();for(d=0;d<b.length;d++)e=this.Lc(b[d]),null!==e&&(e.isSelected=!0);for(d=0;d<c.length;d++)e=this.Lc(c[d]),null!==e&&(e.isHighlighted=!0);for(d=0;d<a.length;d+=2)e=this.Lc(a[d]),null!==e&&(e.location=a[d+1]);Pa(b);Pa(c);Pa(a)}};zi.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)}; +zi.prototype.addModeledParts=function(a,b){var c=this,d=this.diagram.model;a.forEach(function(a){d.hb(a)&&Zq(c,a,!1)});a.forEach(function(a){d.hb(a)&&c.resolveReferencesForData(a)});!1!==b&&mk(this.diagram,!1)}; +function Zq(a,b,c){if(void 0!==b&&null!==b&&!a.diagram.undoManager.isUndoingRedoing&&!a.df.contains(b)){void 0===c&&(c=!0);a:{if(void 0!==b&&null!==b&&!a.H.undoManager.isUndoingRedoing&&!a.df.contains(b)){var d=a.Go(b);var e=hp(a,b,d);if(null!==e&&(xg(e),e=e.copy(),null!==e)){var f=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0;e.Vf=d;e.vb=b;a.kp&&(e.Lg="Tool");a.diagram.add(e);e.vb=null;e.data=b;a.diagram.skipsModelSourceBindings=f;d=e;break a}}d=null}null!==d&&c&&a.resolveReferencesForData(b)}} +zi.prototype.insertLink=function(){return null};zi.prototype.resolveReferencesForData=function(){};zi.prototype.Go=function(a){return this.H.model.Go(a)}; +function hp(a,b,c){a=a.H;var d=a.model;d.wi()&&d.hs(b)?(b=a.groupTemplateMap.L(c),null===b&&(b=a.groupTemplateMap.L(""),null===b&&($q||($q=!0,Fa('No Group template found for category "'+c+'"'),Fa(" Using default group template")),b=a.jy))):(b=a.nodeTemplateMap.L(c),null===b&&(b=a.nodeTemplateMap.L(""),null===b&&(ar||(ar=!0,Fa('No Node template found for category "'+c+'"'),Fa(" Using default node template")),b=a.ly)));return b}zi.prototype.getLinkCategoryForData=function(){return""}; +zi.prototype.setLinkCategoryForData=function(){};zi.prototype.setFromNodeForLink=function(){};zi.prototype.setToNodeForLink=function(){};zi.prototype.findLinkTemplateForCategory=function(a){var b=this.H,c=b.linkTemplateMap.L(a);null===c&&(c=b.linkTemplateMap.L(""),null===c&&(br||(br=!0,Fa('No Link template found for category "'+a+'"'),Fa(" Using default link template")),c=b.ky));return c};zi.prototype.removeAllModeledParts=function(){this.us(this.diagram.model.nodeDataArray)}; +zi.prototype.us=function(a){var b=this;a.forEach(function(a){b.Yo(a)})};zi.prototype.Yo=function(a){a=this.Lc(a);null!==a&&(Uj(this.diagram,a,!1),this.unresolveReferencesForPart(a))};zi.prototype.unresolveReferencesForPart=function(){};zi.prototype.removeDataForLink=function(){};zi.prototype.findPartForKey=function(a){if(null===a||void 0===a)return null;a=this.H.model.ic(a);return null!==a?this.df.L(a):null}; +zi.prototype.Qb=function(a){if(null===a||void 0===a)return null;a=this.H.model.ic(a);if(null===a)return null;a=this.df.L(a);return a instanceof T?a:null};zi.prototype.findLinkForKey=function(){return null};t=zi.prototype;t.Lc=function(a){if(null===a)return null;var b=this.df.L(a);return null!==b?b:b=this.cf.L(a)};t.oi=function(a){if(null===a)return null;a=this.df.L(a);return a instanceof T?a:null};t.Kc=function(a){return null===a?null:this.cf.L(a)}; +t.Wr=function(a){for(var b=0;b<arguments.length;++b);b=new I;for(var c=this.Hn.iterator;c.next();){var d=c.value,e=d.data;if(null!==e)for(var f=0;f<arguments.length;f++){var g=arguments[f];if(Ga(g)&&cr(this,e,g)){b.add(d);break}}}return b.iterator};t.Vr=function(a){for(var b=0;b<arguments.length;++b);b=new I;for(var c=this.wn.iterator;c.next();){var d=c.value,e=d.data;if(null!==e)for(var f=0;f<arguments.length;f++){var g=arguments[f];if(Ga(g)&&cr(this,e,g)){b.add(d);break}}}return b.iterator}; +function cr(a,b,c){for(var d in c){var e=b[d],f=c[d];if(Ha(f)){if(!Ha(e)||e.length<f.length)return!1;for(var g=0;g<e.length;g++){var h=f[g];if(void 0!==h&&!dr(a,e[g],h))return!1}}else if(!dr(a,e,f))return!1}return!0}function dr(a,b,c){if("function"===typeof c){if(!c(b))return!1}else if(c instanceof RegExp){if(!b||!c.test(b.toString()))return!1}else if(Ga(b)&&Ga(c)){if(!cr(a,b,c))return!1}else if(b!==c)return!1;return!0} +zi.prototype.doModelChanged=function(a){if(this.H){var b=this.H;if(a.model===b.model){var c=a.change;b.doModelChanged(a);if(b.ca){b.ca=!1;try{var d=a.modelChange;if(""!==d)if(c===qe){if("nodeCategory"===d){var e=this.Lc(a.object),f=a.newValue;null!==e&&"string"===typeof f&&(e.category=f)}else"nodeDataArray"===d&&(this.us(a.oldValue),this.addModeledParts(a.newValue));b.isModified=!0}else if(c===se){var g=a.newValue;"nodeDataArray"===d&&Ga(g)&&Zq(this,g);b.isModified=!0}else if(c===te){var h=a.oldValue; +"nodeDataArray"===d&&Ga(h)&&this.Yo(h);b.isModified=!0}else c===re&&("SourceChanged"===d?null!==a.object?this.updateDataBindings(a.object,a.propertyName):(this.hp(),this.updateAllTargetBindings()):"ModelDisplaced"===d&&this.Ud());else if(c===qe){var k=a.propertyName,l=a.object;if(l===b.model){if("nodeKeyProperty"===k||"nodeCategoryProperty"===k)b.undoManager.isUndoingRedoing||this.Ud()}else this.updateDataBindings(l,k);b.isModified=!0}else if(c===se||c===te){var m=a.change===se,n=m?a.newParam:a.oldParam, +p=m?a.newValue:a.oldValue,r=this.ij.L(a.object);if(Array.isArray(r))for(a=0;a<r.length;a++){var q=r[a];if(m)An(q,p,n,!0);else if(!(0>n)){var u=n+rn(q);q.rc(u,!0);Dn(q,u,n)}}b.isModified=!0}}finally{b.ca=!0}}}}};zi.prototype.updateAllTargetBindings=function(a){void 0===a&&(a="");for(var b=this.parts.iterator;b.next();)b.value.Pa(a);for(b=this.nodes.iterator;b.next();)b.value.Pa(a);for(b=this.links.iterator;b.next();)b.value.Pa(a)}; +zi.prototype.hp=function(){for(var a=this.H.model,b=new I,c=a.nodeDataArray,d=0;d<c.length;d++)b.add(c[d]);var e=[];this.nodes.each(function(a){null===a.data||b.contains(a.data)||e.push(a.data)});this.parts.each(function(a){null===a.data||b.contains(a.data)||e.push(a.data)});e.forEach(function(b){er(a,b,!1)});for(d=0;d<c.length;d++){var f=c[d];null===this.Lc(f)&&fr(a,f,!1)}this.refreshDataBoundLinks();for(c=this.parts.iterator;c.next();)c.value.updateRelationshipsFromData();for(c=this.nodes.iterator;c.next();)c.value.updateRelationshipsFromData(); +for(c=this.links.iterator;c.next();)c.value.updateRelationshipsFromData()};zi.prototype.refreshDataBoundLinks=function(){};zi.prototype.updateRelationshipsFromData=function(){}; +zi.prototype.updateDataBindings=function(a,b){if("string"===typeof b){var c=this.Lc(a);if(null!==c)c.Pa(b);else{c=null;for(var d=this.ij.iterator;d.next();){for(var e=d.value,f=0;f<e.length;f++){var g=e[f].lx(a);null!==g&&(null===c&&(c=Na()),c.push(g))}if(null!==c)break}if(null!==c){for(d=0;d<c.length;d++)c[d].Pa(b);Pa(c)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(b)}}; +function Qj(a,b){var c=b.Jh;if(Ha(c)){var d=a.ij.L(c);if(null===d)d=[],d.push(b),a.ij.add(c,d);else{for(a=0;a<d.length;a++)if(d[a]===b)return;d.push(b)}}}function Tj(a,b,c){Oj(b,function(a){a=a.U.s;for(var b=a.length,d=0;d<b;d++)lk(c,a[d])});var d=b.Jh;if(Ha(d)){var e=a.ij.L(d);if(null!==e)for(var f=0;f<e.length;f++)if(e[f]===b){e.splice(f,1);0===e.length&&a.ij.remove(d);break}}} +zi.prototype.Rj=function(a,b,c){void 0===c&&(c=!1);var d=new yb;if(Ha(a))for(var e=0;e<a.length;e++)gr(this,a[e],b,d,c);else for(a=a.iterator;a.next();)gr(this,a.value,b,d,c);if(null!==b){c=b.model;a=b.toolManager.findTool("Dragging");a=null!==a?a.dragOptions.dragsLink:b.Rm.dragsLink;e=new I;for(var f=new yb,g=d.iterator;g.next();){var h=g.value;if(h instanceof R)a||null!==h.fromNode&&null!==h.toNode||e.add(h);else if(h instanceof T&&null!==h.data&&c.Pl()){var k=h;h=g.key;var l=h.ug();null!==l&&(l= +d.L(l),null!==l?(c.qe(k.data,c.Ba(l.data)),k=b.Kc(k.data),h=h.lh(),null!==h&&null!==k&&f.add(h,k)):c.qe(k.data,void 0))}}0<e.count&&b.vs(e,!1);if(0<f.count)for(c=f.iterator;c.next();)d.add(c.key,c.value)}if(null!==b&&null!==this.H&&(b=b.model,c=b.afterCopyFunction,null!==c)){var m=new yb;d.each(function(a){null!==a.key.data&&m.add(a.key.data,a.value.data)});c(m,b,this.H.model)}for(b=d.iterator;b.next();)b.value.Pa();return d}; +function gr(a,b,c,d,e){if(null===b||e&&!b.canCopy())return null;if(d.contains(b))return d.L(b);var f=a.copyPartData(b,c);if(!(f instanceof S))return null;f.isSelected=!1;f.isHighlighted=!1;d.add(b,f);if(b instanceof T){for(var g=b.linksConnected;g.next();){var h=g.value;if(h.fromNode===b){var k=d.L(h);null!==k&&(k.fromNode=f)}h.toNode===b&&(h=d.L(h),null!==h&&(h.toNode=f))}if(b instanceof wf&&f instanceof wf)for(b=b.memberParts;b.next();)g=gr(a,b.value,c,d,e),g instanceof R||null===g||(g.containingGroup= +f)}else if(b instanceof R&&f instanceof R)for(g=b.fromNode,null!==g&&(g=d.L(g),null!==g&&(f.fromNode=g)),g=b.toNode,null!==g&&(g=d.L(g),null!==g&&(f.toNode=g)),b=b.labelNodes;b.next();)g=gr(a,b.value,c,d,e),null!==g&&g instanceof T&&(g.labeledLink=f);return f} +zi.prototype.copyPartData=function(a,b){var c=null,d=a.data;if(null!==d&&null!==b){var e=b.model;a instanceof R||(d=e.copyNodeData(d),Ga(d)&&(e.yf(d),c=b.Lc(d)))}else xg(a),c=a.copy(),null!==c&&(e=this.H,null!==b?b.add(c):null!==d&&null!==e&&null!==e.commandHandler&&e.commandHandler.copiesClipboardData&&(b=e.model,e=null,c instanceof R||(e=b.copyNodeData(d)),Ga(e)&&(c.data=e)));return c}; +oa.Object.defineProperties(zi.prototype,{nodes:{configurable:!0,get:function(){return this.Hn}},links:{configurable:!0,get:function(){return this.wn}},parts:{configurable:!0,get:function(){return this.Ra}},diagram:{configurable:!0,get:function(){return this.H}},addsToTemporaryLayer:{configurable:!0,get:function(){return this.kp},set:function(a){A(a,"boolean",zi,"addsToTemporaryLayer");this.kp=a}}}); +zi.prototype.updateAllRelationshipsFromData=zi.prototype.hp;zi.prototype.findLinksByExample=zi.prototype.Vr;zi.prototype.findNodesByExample=zi.prototype.Wr;zi.prototype.findLinkForData=zi.prototype.Kc;zi.prototype.findNodeForData=zi.prototype.oi;zi.prototype.findPartForData=zi.prototype.Lc;zi.prototype.findNodeForKey=zi.prototype.Qb;zi.prototype.removeModeledPart=zi.prototype.Yo;zi.prototype.removeModeledParts=zi.prototype.us;zi.prototype.rebuildParts=zi.prototype.Ud;var ar=!1,$q=!1,br=!1; +zi.className="PartManager";function hr(a){zi.apply(this,arguments)}na(hr,zi);hr.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray);ir(this,a.linkDataArray)};hr.prototype.addModeledParts=function(a){zi.prototype.addModeledParts.call(this,a,!1);for(a=this.links.iterator;a.next();)ip(a.value);mk(this.diagram,!1)};function ir(a,b){b.forEach(function(b){jr(a,b)});mk(a.diagram,!1)} +function jr(a,b){if(void 0!==b&&null!==b&&!a.diagram.undoManager.isUndoingRedoing&&!a.cf.contains(b)){var c=a.getLinkCategoryForData(b),d=a.findLinkTemplateForCategory(c);if(null!==d){xg(d);var e=d.copy();if(null!==e){d=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0;e.Vf=c;e.vb=b;c=a.diagram.model;var f=kr(c,b,!0);""!==f&&(e.fromPortId=f);f=lr(c,b,!0);void 0!==f&&(f=a.Qb(f),f instanceof T&&(e.fromNode=f));f=kr(c,b,!1);""!==f&&(e.toPortId=f);f=lr(c,b,!1);void 0!==f&&(f=a.Qb(f), +f instanceof T&&(e.toNode=f));c=c.Hf(b);Array.isArray(c)&&c.forEach(function(b){b=a.Qb(b);null!==b&&(b.labeledLink=e)});a.kp&&(e.Lg="Tool");a.diagram.add(e);e.vb=null;e.data=b;a.diagram.skipsModelSourceBindings=d}}}}hr.prototype.removeAllModeledParts=function(){var a=this.diagram.model;mr(this,a.linkDataArray);this.us(a.nodeDataArray)};function mr(a,b){b.forEach(function(b){a.Yo(b)})}hr.prototype.getLinkCategoryForData=function(a){return this.diagram.model.Zr(a)}; +hr.prototype.setLinkCategoryForData=function(a,b){return this.diagram.model.ap(a,b)};hr.prototype.setFromNodeForLink=function(a,b){var c=this.diagram.model;c.qv(a.data,c.Ba(null!==b?b.data:null))};hr.prototype.setToNodeForLink=function(a,b){var c=this.diagram.model;c.uv(a.data,c.Ba(null!==b?b.data:null))};hr.prototype.removeDataForLink=function(a){this.diagram.model.Xl(a.data)}; +hr.prototype.findPartForKey=function(a){var b=zi.prototype.findPartForKey.call(this,a);return null===b&&(a=this.diagram.model.kh(a),null!==a)?this.cf.L(a):b};hr.prototype.findLinkForKey=function(a){if(null===a||void 0===a)return null;a=this.diagram.model.kh(a);return null!==a?this.cf.L(a):null}; +hr.prototype.doModelChanged=function(a){var b=this;zi.prototype.doModelChanged.call(this,a);if(this.diagram){var c=this.diagram;if(a.model===c.model){var d=a.change;if(c.ca){c.ca=!1;try{var e=a.modelChange;if(""!==e)if(d===qe){if("linkFromKey"===e){var f=this.Kc(a.object);if(null!==f){var g=this.Qb(a.newValue);f.fromNode=g}}else if("linkToKey"===e){var h=this.Kc(a.object);if(null!==h){var k=this.Qb(a.newValue);h.toNode=k}}else if("linkFromPortId"===e){var l=this.Kc(a.object);if(null!==l){var m=a.newValue; +"string"===typeof m&&(l.fromPortId=m)}}else if("linkToPortId"===e){var n=this.Kc(a.object);if(null!==n){var p=a.newValue;"string"===typeof p&&(n.toPortId=p)}}else if("nodeGroupKey"===e){var r=this.Lc(a.object);if(null!==r){var q=a.newValue;if(void 0!==q){var u=this.Qb(q);u instanceof wf?r.containingGroup=u:r.containingGroup=null}else r.containingGroup=null}}else if("linkLabelKeys"===e){var x=this.Kc(a.object);if(null!==x){var y=a.oldValue,z=a.newValue;Array.isArray(y)&&y.forEach(function(a){0<=z.indexOf(a)|| +(a=b.Qb(a),null!==a&&(a.labeledLink=null))});Array.isArray(z)&&z.forEach(function(a){a=b.Qb(a);null!==a&&(a.labeledLink=x)})}}else if("linkCategory"===e){var B=this.Kc(a.object),C=a.newValue;null!==B&&"string"===typeof C&&(B.category=C)}else"linkDataArray"===e&&(mr(this,a.oldValue),ir(this,a.newValue));c.isModified=!0}else if(d===se){var D=a.newValue;if("linkDataArray"===e&&"object"===typeof D&&null!==D)jr(this,D);else if("linkLabelKeys"===e&&nr(D)){var J=this.Kc(a.object),U=this.Qb(D);null!==J&& +null!==U&&(U.labeledLink=J)}c.isModified=!0}else{if(d===te){var aa=a.oldValue;if("linkDataArray"===e&&"object"===typeof aa&&null!==aa)this.Yo(aa);else if("linkLabelKeys"===e&&nr(aa)){var Y=this.Qb(aa);null!==Y&&(Y.labeledLink=null)}c.isModified=!0}}else if(d===qe){var W=a.propertyName;a.object!==c.model||"linkFromKeyProperty"!==W&&"linkToKeyProperty"!==W&&"linkFromPortIdProperty"!==W&&"linkToPortIdProperty"!==W&&"linkLabelKeysProperty"!==W&&"nodeIsGroupProperty"!==W&&"nodeGroupKeyProperty"!==W&&"linkCategoryProperty"!== +W||c.undoManager.isUndoingRedoing||this.Ud();c.isModified=!0}}finally{c.ca=!0}}}}};hr.prototype.refreshDataBoundLinks=function(){var a=this,b=this.diagram.model,c=new I,d=b.linkDataArray;d.forEach(function(a){c.add(a)});var e=[];this.links.each(function(a){null===a.data||c.contains(a.data)||e.push(a.data)});e.forEach(function(a){or(b,a,!1)});d.forEach(function(c){null===a.Kc(c)&&pr(b,c,!1)})}; +hr.prototype.updateRelationshipsFromData=function(a){var b=a.data;if(null!==b){var c=a.diagram;if(null!==c){var d=c.model;if(a instanceof R){var e=lr(d,b,!0);e=c.Qb(e);a.fromNode=e;e=lr(d,b,!1);e=c.Qb(e);a.toNode=e;b=d.Hf(b);if(0<b.length||0<a.labelNodes.count){if(1===b.length&&1===a.labelNodes.count){e=b[0];var f=a.labelNodes.first();if(d.Ba(f.data)===e)return}e=(new I).addAll(b);var g=new I;a.labelNodes.each(function(a){null!==a.data&&(a=d.Ba(a.data),void 0!==a&&g.add(a))});b=g.copy();b.Xo(e);e= +e.copy();e.Xo(g);if(0<b.count||0<e.count)b.each(function(b){b=c.Qb(b);null!==b&&b.labeledLink===a&&(b.labeledLink=null)}),e.each(function(b){b=c.Qb(b);null!==b&&b.labeledLink!==a&&(b.labeledLink=a)})}}else!(a instanceof Ce)&&(b=d.mh(b),b=c.findPartForKey(b),null===b||b instanceof wf)&&(a.containingGroup=b)}}}; +hr.prototype.resolveReferencesForData=function(a){var b=this.diagram.model,c=b.Ba(a);if(void 0!==c){var d=qr(b,c),e=this.Lc(a);if(null!==d&&null!==e){d=d.iterator;for(var f={};d.next();){var g=d.value;b.hb(g)?e instanceof wf&&b.mh(g)===c&&(g=this.Lc(g),null!==g&&(g.containingGroup=e)):(f.link=this.Kc(g),null!==f.link&&e instanceof T&&(lr(b,g,!0)===c&&(f.link.fromNode=e),lr(b,g,!1)===c&&(f.link.toNode=e),g=b.Hf(g),Array.isArray(g)&&g.some(function(a){return function(b){return b===c?(e.labeledLink= +a.link,!0):!1}}(f))));f={link:f.link}}rr(b,c)}a=b.mh(a);void 0!==a&&(a=this.Qb(a),a instanceof wf&&(e.containingGroup=a))}};hr.prototype.unresolveReferencesForPart=function(a){var b=this.diagram.model;if(a instanceof T){var c=b.Ba(a.data);if(void 0!==c){for(var d=a.linksConnected;d.next();)sr(b,c,d.value.data);a.isLinkLabel&&(d=a.labeledLink,null!==d&&sr(b,c,d.data));if(a instanceof wf)for(a=a.memberParts;a.next();)d=a.value.data,b.hb(d)&&sr(b,c,d)}}}; +hr.prototype.copyPartData=function(a,b){var c=zi.prototype.copyPartData.call(this,a,b);if(a instanceof R)if(a=a.data,null!==a&&null!==b){var d=b.model;a=d.zo(a);"object"===typeof a&&null!==a&&(d.ji(a),c=b.Kc(a))}else null!==c&&(b=this.diagram,null!==a&&null!==b&&null!==b.commandHandler&&b.commandHandler.copiesClipboardData&&(b=b.model.zo(a),"object"===typeof b&&null!==b&&(c.data=b)));return c}; +hr.prototype.insertLink=function(a,b,c,d){var e=this.diagram,f=e.model,g=e.toolManager.findTool("Linking"),h="";null!==a&&(null===b&&(b=a),h=b.portId,null===h&&(h=""));b="";null!==c&&(null===d&&(d=c),b=d.portId,null===b&&(b=""));d=g.archetypeLinkData;if(d instanceof R){if(xg(d),f=d.copy(),null!==f)return f.fromNode=a,f.fromPortId=h,f.toNode=c,f.toPortId=b,e.add(f),a=g.archetypeLabelNodeData,a instanceof T&&(xg(a),a=a.copy(),null!==a&&(a.labeledLink=f,e.add(a))),f}else if(null!==d&&(d=f.zo(d),"object"=== +typeof d&&null!==d))return null!==a&&tr(f,d,f.Ba(a.data),!0),ur(f,d,h,!0),null!==c&&tr(f,d,f.Ba(c.data),!1),ur(f,d,b,!1),f.ji(d),a=g.archetypeLabelNodeData,null===a||a instanceof T||(a=f.copyNodeData(a),"object"===typeof a&&null!==a&&(f.yf(a),a=f.Ba(a),void 0!==a&&f.uu(d,a))),e.Kc(d);return null};hr.prototype.findLinkForKey=hr.prototype.findLinkForKey;hr.prototype.findPartForKey=hr.prototype.findPartForKey;hr.prototype.removeAllModeledParts=hr.prototype.removeAllModeledParts; +hr.prototype.addModeledParts=hr.prototype.addModeledParts;hr.prototype.addAllModeledParts=hr.prototype.addAllModeledParts;hr.className="GraphLinksPartManager";function vr(){zi.apply(this,arguments);this.Ug=null}na(vr,zi); +function wr(a,b,c){if(null!==b&&null!==c&&null===c.lh()){var d=a.diagram.toolManager.findTool("Linking"),e=b,f=c;a.diagram.isTreePathToChildren||(e=c,f=b);if(null===d||!Uf(d,e,f,null,!0))if(b=a.getLinkCategoryForData(c.data),d=a.findLinkTemplateForCategory(b),null!==d&&(xg(d),d=d.copy(),null!==d)){var g=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0;d.Vf=b;d.vb=c.data;d.fromNode=e;d.toNode=f;a.diagram.add(d);d.vb=null;d.data=c.data;a.diagram.skipsModelSourceBindings=g}}} +vr.prototype.getLinkCategoryForData=function(a){return this.diagram.model.cs(a)};vr.prototype.setLinkCategoryForData=function(a,b){this.diagram.model.zs(a,b)};vr.prototype.setFromNodeForLink=function(a,b,c){var d=this.diagram.model;void 0===c&&(c=null);b=null!==b?b.data:null;if(this.diagram.isTreePathToChildren)d.qe(a.data,d.Ba(b));else{var e=this.Ug;this.Ug=a;null!==c&&d.qe(c.data,void 0);d.qe(b,d.Ba(null!==a.toNode?a.toNode.data:null));this.Ug=e}}; +vr.prototype.setToNodeForLink=function(a,b,c){var d=this.diagram.model;void 0===c&&(c=null);b=null!==b?b.data:null;if(this.diagram.isTreePathToChildren){var e=this.Ug;this.Ug=a;null!==c&&d.qe(c.data,void 0);d.qe(b,d.Ba(null!==a.fromNode?a.fromNode.data:null));this.Ug=e}else d.qe(a.data,d.Ba(b))};vr.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)}; +vr.prototype.findLinkForKey=function(a){if(null===a||void 0===a)return null;a=this.diagram.model.ic(a);return null!==a?this.cf.L(a):null}; +vr.prototype.doModelChanged=function(a){zi.prototype.doModelChanged.call(this,a);if(this.diagram){var b=this.diagram;if(a.model===b.model){var c=a.change;if(b.ca){b.ca=!1;try{var d=a.modelChange;if(""!==d){if(c===qe){if("nodeParentKey"===d){var e=a.object,f=this.Qb(a.newValue),g=this.oi(e);if(null!==this.Ug)null!==f&&(this.Ug.data=e,this.Ug.category=this.getLinkCategoryForData(e));else if(null!==g){var h=g.lh();null!==h?null===f?b.remove(h):b.isTreePathToChildren?h.fromNode=f:h.toNode=f:wr(this,f, +g)}}else if("parentLinkCategory"===d){var k=this.oi(a.object),l=a.newValue;if(null!==k&&"string"===typeof l){var m=k.lh();null!==m&&(m.category=l)}}b.isModified=!0}}else if(c===qe){var n=a.propertyName;a.object===b.model&&"nodeParentKeyProperty"===n&&(b.undoManager.isUndoingRedoing||this.Ud());b.isModified=!0}}finally{b.ca=!0}}}}}; +vr.prototype.updateRelationshipsFromData=function(a){var b=a.data;if(null!==b){var c=a.diagram;if(null!==c){var d=c.model;a instanceof T&&(b=d.nh(b),b=c.Qb(b),d=a.ug(),b!==d&&(d=a.lh(),null!==b?null!==d?c.isTreePathToChildren?d.fromNode=b:d.toNode=b:wr(this,b,a):null!==d&&Uj(c,d,!1)))}}};vr.prototype.updateDataBindings=function(a,b){zi.prototype.updateDataBindings.call(this,a,b);"string"===typeof b&&null!==this.Lc(a)&&(a=this.Kc(a),null!==a&&a.Pa(b))}; +vr.prototype.resolveReferencesForData=function(a){var b=this.diagram.model,c=b.Ba(a);if(void 0!==c){var d=qr(b,c),e=this.Lc(a);if(null!==d&&null!==e){for(d=d.iterator;d.next();){var f=d.value;b.hb(f)&&e instanceof T&&b.nh(f)===c&&wr(this,e,this.oi(f))}rr(b,c)}a=b.nh(a);void 0!==a&&e instanceof T&&(a=this.Qb(a),wr(this,a,e))}}; +vr.prototype.unresolveReferencesForPart=function(a){var b=this.diagram.model;if(a instanceof T){var c=b.Ba(a.data),d=this.Kc(a.data);if(null!==d){d.isSelected=!1;d.isHighlighted=!1;var e=d.layer;if(null!==e){var f=e.rc(-1,d,!1);0<=f&&this.diagram.ib(te,"parts",e,d,null,f,null);f=d.layerChanged;null!==f&&f(d,e,null)}}d=this.diagram.isTreePathToChildren;for(a=a.linksConnected;a.next();)e=a.value,e=(d?e.toNode:e.fromNode).data,b.hb(e)&&sr(b,c,e)}}; +vr.prototype.insertLink=function(a,b,c){b=this.diagram.model;var d=a,e=c;this.diagram.isTreePathToChildren||(d=c,e=a);return null!==d&&null!==e?(b.qe(e.data,b.Ba(d.data)),e.lh()):null};vr.prototype.findLinkForKey=vr.prototype.findLinkForKey;vr.className="TreePartManager"; +function X(a,b){this.ll=new I;this.jl=new I;this.Ov=',\n "insertedNodeKeys": ';this.hy=',\n "modifiedNodeData": ';this.Qv=',\n "removedNodeKeys": ';this.vh=null;Za(this);this.Nm=this.Ca="";this.Jg=!1;this.j={};this.Gc=[];this.rb=new yb;this.Yh="key";this.Ck=this.dl=null;this.Em=this.Fm=!1;this.Hm=!0;this.sm=null;this.tj="category";this.Xf=new yb;this.Bt=new H;this.Xg=!1;this.m=null;this.undoManager=new ve;void 0!==a&&(Ha(a)?this.nodeDataArray=a:Object.assign(this,a));b&&Object.assign(this,b)} +X.prototype.cloneProtected=function(a){a.Ca=this.Ca;a.Nm=this.Nm;a.Jg=this.Jg;a.Yh=this.Yh;a.dl=this.dl;a.Ck=this.Ck;a.Fm=this.Fm;a.Em=this.Em;a.Hm=this.Hm;a.sm=this.sm;a.tj=this.tj};X.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};X.prototype.clear=function(){this.Gc=[];this.rb.clear();this.Xf.clear();this.undoManager.clear()}; +X.prototype.toString=function(a){void 0===a&&(a=0);if(1<a)return this.cp();var b=(""!==this.name?this.name:"")+" Model";if(0<a){b+="\n node data:";a=this.nodeDataArray;for(var c=a.length,d=0;d<c;d++){var e=a[d];b+=" "+this.Ba(e)+":"+Ra(e)}}return b}; +X.prototype.xA=function(a){w(a,pe,X,"toIncrementalData:e");a.change!==re&&v("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var b=a.object;if(!(a.isTransactionFinished&&b instanceof ue))return null;xr(this,b);a=this.Iv(b,"FinishedUndo"===a.propertyName);this.vh=null;return a}; +X.prototype.Iv=function(a,b){var c=this,d=!1,e=new I,f=new I,g=new I,h=this.vh;a.changes.each(function(a){a.model===c&&("nodeDataArray"===a.modelChange?a.change===se?e.add(a.newValue):a.change===te&&g.add(a.oldValue):c.hb(a.object)?f.add(a.object):a.change!==qe||c.modelData!==a.object&&"modelData"!==a.propertyName?null!==a.object&&(h&&h.contains(a.object)?h.get(a.object).each(function(a){c.hb(a)&&f.add(a)}):a.object instanceof X||c.yi()&&c.Jc(a.object)||yr(c,a.object).each(function(a){f.add(a)})): +d=!0)});var k=this.jl;k.clear();e.each(function(a){k.add(c.Ba(a));b||f.add(a)});var l=this.ll;l.clear();g.each(function(a){l.add(c.Ba(a));b&&f.add(a)});a=c.cloneDeep(f.Ka());var m=null;d&&(null===m&&(m={}),m.modelData=this.cloneDeep(this.modelData));0<k.count&&(null===m&&(m={}),b?m.removedNodeKeys=k.Ka():m.insertedNodeKeys=k.Ka());0<a.length&&(null===m&&(m={}),m.modifiedNodeData=a);0<l.count&&(null===m&&(m={}),b?m.insertedNodeKeys=l.Ka():m.removedNodeKeys=l.Ka());l.clear();k.clear();return m}; +X.prototype.cloneDeep=function(a){return zr(this,a,!0)}; +function zr(a,b,c,d,e,f){function g(a,c){h?(void 0===a.__gohashid&&f.push(a),d.set(a,c)):(a=pb++,d.set(a,c),e.set(a,b))}if(!Ga(b))return b;f||(f=[]);var h=Object.isExtensible(b);d||(d=new yb);if(h){var k=d.get(b);if(k)return k}else for(e||(e=new yb),k=e.iterator;k.next();){var l=k.key;if(k.value===b&&(l=d.get(l)))return l}if(Array.isArray(b)){k=[];g(b,k);for(var m=0;m<b.length;m++)k.push(zr(a,b[m],!1,d,e,f))}else if(b instanceof K||b instanceof Hb||b instanceof M||b instanceof gc||b instanceof Ib)k= +b.copy(),g(b,k);else{if(b instanceof Bl||b instanceof N||b instanceof F)return b;if(b instanceof H)k=(new H).addAll(zr(a,b.Ka(),!1,d,e,f)),g(b,k);else if(b instanceof I)k=(new I).addAll(zr(a,b.Ka(),!1,d,e,f)),g(b,k);else if(b instanceof yb)k=(new yb).addAll(zr(a,b.Ka(),!1,d,e,f)),g(b,k);else if(b instanceof Date)k=new Date(b.getTime()),g(b,k);else if(b instanceof RegExp)k=new RegExp(b),g(b,k),k.lastIndex=b.lastIndex;else if("function"===typeof b.copy)k=b.copy(),g(b,k);else for(m in k={},g(b,k),b)"__gohashid"!== +m&&(k[m]=zr(a,b[m],!1,d,e,f))}c&&f.forEach(function(a){delete a.__gohashid});return k}t=X.prototype;t.quote=function(a){return JSON.stringify(a).replace(/[\u007F-\uFFFF]/g,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).substr(-4)})}; +t.nm=function(){var a="";""!==this.name&&(a+=',\n "name": '+this.quote(this.name));""!==this.dataFormat&&(a+=',\n "dataFormat": '+this.quote(this.dataFormat));this.isReadOnly&&(a+=',\n "isReadOnly": '+this.isReadOnly);"key"!==this.nodeKeyProperty&&"string"===typeof this.nodeKeyProperty&&(a+=',\n "nodeKeyProperty": '+this.quote(this.nodeKeyProperty));this.copiesArrays&&(a+=',\n "copiesArrays": true');this.copiesArrayObjects&&(a+=',\n "copiesArrayObjects": true');this.copiesKey||(a+=',\n "copiesKey": false'); +"category"!==this.nodeCategoryProperty&&"string"===typeof this.nodeCategoryProperty&&(a+=',\n "nodeCategoryProperty": '+this.quote(this.nodeCategoryProperty));return a}; +t.Vo=function(a){a.name&&(this.name=a.name);a.dataFormat&&(this.dataFormat=a.dataFormat);a.isReadOnly&&(this.isReadOnly=!0);a.nodeKeyProperty&&(this.nodeKeyProperty=a.nodeKeyProperty);a.copiesArrays&&(this.copiesArrays=!0);a.copiesArrayObjects&&(this.copiesArrayObjects=!0);!1===a.copiesKey&&(this.copiesKey=!1);a.nodeCategoryProperty&&(this.nodeCategoryProperty=a.nodeCategoryProperty)};function Ar(a,b){b=b.modelData;Ga(b)&&(a.Zl(b),a.modelData=b)} +t.Jv=function(){var a=this.modelData,b=!1,c;for(c in a)if(!Br(c,a[c])){b=!0;break}a="";b&&(a=',\n "modelData": '+Cr(this,this.modelData));return a+',\n "nodeDataArray": '+Dr(this,this.nodeDataArray,!0)};t.hv=function(a){Ar(this,a);a=a.nodeDataArray;Ha(a)&&(this.Zl(a),this.nodeDataArray=a)}; +function xr(a,b){function c(a,b){if(b=b.part)if(b=b.data,a!==b){var c=d.get(a);null===c?(c=new I,c.add(b),d.add(a,c)):c.add(b)}}var d=a.vh;null===d&&(d=new yb,b.changes.each(function(a){if(null!==a.diagram){var b=a.change;if(b===qe)(a=a.object.panel)&&(b=a.data)&&c(b,a);else if(b===se||b===te)a=a.object,(b=a.itemArray)&&c(b,a)}}),a.vh=d)}function yr(a,b){for(var c=new I,d=0;d<a.nodeDataArray.length;d++){var e=a.nodeDataArray[d];Er(a,b,e,e,c)}return c} +function Er(a,b,c,d,e){if(Array.isArray(c))for(var f=0;f<c.length;f++){var g=c[f];if(g===b)return e.add(d),!0;if(Er(a,b,g,d,e))return!0}else if(Ga(c)&&Object.getPrototypeOf(c)===Object.prototype)for(f in c){g=c[f];if(g===b)return e.add(d),!0;if(Er(a,b,g,d,e))return!0}return!1} +t.Hv=function(a,b){var c=this,d=!1,e=new I,f=new I,g=new I,h=this.vh;a.changes.each(function(a){a.model===c&&("nodeDataArray"===a.modelChange?a.change===se?e.add(a.newValue):a.change===te&&g.add(a.oldValue):c.hb(a.object)?f.add(a.object):a.change!==qe||c.modelData!==a.object&&"modelData"!==a.propertyName?null!==a.object&&(h&&h.contains(a.object)?h.get(a.object).each(function(a){c.hb(a)&&f.add(a)}):a.object instanceof X||c.yi()&&c.Jc(a.object)||yr(c,a.object).each(function(a){f.add(a)})):d=!0)});var k= +this.jl;k.clear();e.each(function(a){k.add(c.Ba(a));b||f.add(a)});var l=this.ll;l.clear();g.each(function(a){l.add(c.Ba(a));b&&f.add(a)});a="";d&&(a+=',\n "modelData": '+Cr(this,this.modelData));0<k.count&&(a+=(b?this.Qv:this.Ov)+Dr(this,k.Ka(),!0));0<f.count&&(a+=this.hy+Dr(this,f.Ka(),!0));0<l.count&&(a+=(b?this.Ov:this.Qv)+Dr(this,l.Ka(),!0));l.clear();k.clear();return a}; +t.Uo=function(a){(void 0!==a.name&&a.name!==this.name||void 0!==a.dataFormat&&a.dataFormat!==this.dataFormat||void 0!==a.isReadOnly&&a.isReadOnly!==this.isReadOnly||void 0!==a.nodeKeyProperty&&a.nodeKeyProperty!==this.nodeKeyProperty||void 0!==a.copiesArrays&&a.copiesArrays!==this.copiesArrays||void 0!==a.copiesArrayObjects&&a.copiesArrayObjects!==this.copiesArrayObjects||void 0!==a.copiesKey&&a.copiesKey!==this.copiesKey||void 0!==a.nodeCategoryProperty&&a.nodeCategoryProperty!==this.nodeCategoryProperty)&& +v("applyIncrementalJson cannot change Model properties");Ar(this,a);var b=a.insertedNodeKeys,c=a.modifiedNodeData,d=new yb;if(Array.isArray(c))for(var e=0;e<c.length;e++){var f=c[e],g=this.Ba(f);void 0!==g&&null!==g&&d.set(g,f)}if(Array.isArray(b))for(e=b.length,f=0;f<e;f++){g=b[f];var h=this.ic(g);null===h&&(h=(h=d.get(g))?h:this.copyNodeData({}),this.fm(h,g),this.yf(h))}if(Array.isArray(c))for(b=c.length,d=0;d<b;d++)if(e=c[d],f=this.Ba(e),f=this.ic(f),null!==f){for(var k in e)"__gohashid"===k|| +k===this.nodeKeyProperty||this.$j()&&k===this.nodeIsGroupProperty||this.setDataProperty(f,k,e[k]);this.gm(e,f)}a=a.removedNodeKeys;if(Array.isArray(a))for(c=a.length,k=0;k<c;k++)b=this.ic(a[k]),null!==b&&this.Yl(b)}; +t.Zx=function(a,b){w(a,pe,X,"toIncrementalJson:e");a.change!==re&&v("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var c=a.object;if(!(a.isTransactionFinished&&c instanceof ue))return'{ "incremental": 0 }';void 0===b&&(b=Fr(this,this));xr(this,c);a=this.Hv(c,"FinishedUndo"===a.propertyName);this.vh=null;return"2"===b?'{ "incremental": 2'+a+"}":'{ "class": '+this.quote(b)+', "incremental": 1'+this.nm()+a+"}"};t.yA=function(a,b){return this.Zx(a,b)}; +t.cp=function(a){void 0===a&&(a=Fr(this,this));return'{ "class": '+this.quote(a)+this.nm()+this.Jv()+"}"};t.toJSON=function(a){return this.cp(a)};t.Rw=function(a){var b=null;if("string"===typeof a)try{b=sa.JSON.parse(a)}catch(d){G&&Fa("JSON.parse error: "+d.toString())}else"object"===typeof a?b=a:v("Unable to modify a Model from: "+a);var c=b.incremental;"number"!==typeof c&&v("Unable to apply non-incremental changes to Model: "+a);0!==c&&(this.Ja("applyIncrementalJson"),this.Uo(b),this.kb("applyIncrementalJson"))}; +t.Hy=function(a){return this.Rw(a)};X.constructGraphLinksModel=function(){G&&v("Unable to construct a Model. Provided JSON requires GraphLinksModel, which is not loaded.");return new X};t=X.prototype; +t.Zl=function(a){if(Ha(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];if(Ga(d)){var e=c;d=this.Zl(d);Array.isArray(a)?a[e]=d:v("Cannot replace an object in an HTMLCollection or NodeList at "+e)}}else if(Ga(a)){for(b in a)if(c=a[b],Ga(c)&&(c=this.Zl(c),a[b]=c,"points"===b&&Array.isArray(c))){e=0===c.length%2;for(d=0;d<c.length;d++)if("number"!==typeof c[d]){e=!1;break}if(e){e=new H;for(d=0;d<c.length/2;d++)e.add(new K(c[2*d],c[2*d+1]));e.freeze();a[b]=e}}return Gr(a)}return a}; +t.om=function(a){return void 0===a?"undefined":null===a?"null":!0===a?"true":!1===a?"false":"string"===typeof a?this.quote(a):"number"===typeof a?Infinity===a?"9e9999":-Infinity===a?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.om(a.valueOf()):Ha(a)?Dr(this,a):Ga(a)?Cr(this,a):"function"===typeof a?"null":a.toString()}; +function Dr(a,b,c){void 0===c&&(c=!1);var d=b.length;if(0>=d)return"[]";var e=new bb;e.add("[");c&&1<d&&e.add("\n");for(var f=0;f<d;f++){var g=b[f];void 0!==g&&(0<f&&(e.add(","),c&&e.add("\n")),e.add(a.om(g)))}c&&1<d&&e.add("\n");e.add("]");return e.toString()}function Br(a,b){return void 0===b||"__gohashid"===a||"_"===a[0]||"function"===typeof b?!0:!1}function Hr(a){return isNaN(a)?"NaN":Infinity===a?"9e9999":-Infinity===a?"-9e9999":a} +function Cr(a,b){var c=b;if(c instanceof K)b={"class":"go.Point",x:Hr(c.x),y:Hr(c.y)};else if(c instanceof Hb)b={"class":"go.Size",width:Hr(c.width),height:Hr(c.height)};else if(c instanceof M)b={"class":"go.Rect",x:Hr(c.x),y:Hr(c.y),width:Hr(c.width),height:Hr(c.height)};else if(c instanceof gc)b={"class":"go.Margin",top:Hr(c.top),right:Hr(c.right),bottom:Hr(c.bottom),left:Hr(c.left)};else if(c instanceof Ib)c.mb()?b={"class":"go.Spot",x:Hr(c.x),y:Hr(c.y),offsetX:Hr(c.offsetX),offsetY:Hr(c.offsetY)}: +b={"class":"go.Spot","enum":c.toString()};else if(c instanceof Bl){b={"class":"go.Brush",type:c.type.name};if(c.type===Il)b.color=c.color;else if(c.type===Ll||c.type===Cl)b.start=c.start,b.end=c.end,c.type===Cl&&(0!==c.startRadius&&(b.startRadius=Hr(c.startRadius)),isNaN(c.endRadius)||(b.endRadius=Hr(c.endRadius)));if(null!==c.colorStops){var d={};for(c=c.colorStops.iterator;c.next();)d[c.key]=c.value;b.colorStops=d}}else if(c instanceof N)b={"class":"go.Geometry",type:c.type.name},0!==c.startX&& +(b.startX=Hr(c.startX)),0!==c.startY&&(b.startY=Hr(c.startY)),0!==c.endX&&(b.endX=Hr(c.endX)),0!==c.endY&&(b.endY=Hr(c.endY)),c.spot1.D(Fc)||(b.spot1=c.spot1),c.spot2.D(Oc)||(b.spot2=c.spot2),c.type===N.m&&(b.path=N.ma(c));else if(c instanceof F)b={"class":"go.EnumValue",classType:Fr(a,c.classType),name:c.name};else if(G&&null!==Ir(Fr(a,c)))return Fa("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager or other unknown data into JSON text: "+c.toString()),"{}"; +d="{";c=!0;for(var e in b){var f=En(b,e);if(!Br(e,f))if(c?c=!1:d+=",",d+=a.quote(e)+":","points"===e&&f instanceof H){var g="[";for(f=f.iterator;f.next();){var h=f.value;1<g.length&&(g+=",");g+=a.om(h.x);g+=",";g+=a.om(h.y)}g+="]";d+=g}else d+=a.om(f)}return d+"}"}function Jr(a){return"number"===typeof a?a:"NaN"===a?NaN:"9e9999"===a?Infinity:"-9e9999"===a?-Infinity:parseFloat(a)} +function Gr(a){if("object"!==typeof a)return a;var b=a["class"]||"";if("NaN"===b)return NaN;if("Date"===b)return new Date(a.value);if(0!==b.indexOf("go."))return a;b=b.substr(3);var c=a;if("Point"===b)c=new K(Jr(a.x),Jr(a.y));else if("Size"===b)c=new Hb(Jr(a.width),Jr(a.height));else if("Rect"===b)c=new M(Jr(a.x),Jr(a.y),Jr(a.width),Jr(a.height));else if("Margin"===b)c=new gc(Jr(a.top),Jr(a.right),Jr(a.bottom),Jr(a.left));else if("Spot"===b)"string"===typeof a["enum"]?c=xd(a["enum"]):c=new Ib(Jr(a.x), +Jr(a.y),Jr(a.offsetX),Jr(a.offsetY));else if("Brush"===b){if(c=new Bl,c.type=$a(Bl,a.type),"string"===typeof a.color&&(c.color=a.color),a.start instanceof Ib&&(c.start=a.start),a.end instanceof Ib&&(c.end=a.end),"number"===typeof a.startRadius&&(c.startRadius=Jr(a.startRadius)),"number"===typeof a.endRadius&&(c.endRadius=Jr(a.endRadius)),a=a.colorStops,Ga(a))for(var d in a)c.addColorStop(parseFloat(d),a[d])}else"Geometry"===b?(c=null,"string"===typeof a.path?c=N.parse(a.path):c=new N,c.type=$a(N, +a.type),"number"===typeof a.startX&&(c.startX=Jr(a.startX)),"number"===typeof a.startY&&(c.startY=Jr(a.startY)),"number"===typeof a.endX&&(c.endX=Jr(a.endX)),"number"===typeof a.endY&&(c.endY=Jr(a.endY)),a.spot1 instanceof Ib&&(c.spot1=a.spot1),a.spot2 instanceof Ib&&(c.spot2=a.spot2)):"EnumValue"===b&&(d=a.classType,0===d.indexOf("go.")&&(d=d.substr(3)),d=Ir(d),"function"===typeof d&&(c=$a(d,a.name)));return c}t.fh=function(a){A(a,"function",X,"addChangedListener:listener");this.Bt.add(a);return this}; +t.mk=function(a){A(a,"function",X,"removeChangedListener:listener");this.Bt.remove(a)};t.Pr=function(a){this.skipsUndoManager||this.undoManager.Uu(a);for(var b=this.Bt,c=b.length,d=0;d<c;d++)b.N(d)(a)};t.ib=function(a,b,c,d,e,f,g){Lr(this,"",a,b,c,d,e,f,g)};t.g=function(a,b,c,d,e){Lr(this,"",qe,a,this,b,c,d,e)};t.ts=function(a,b,c,d,e,f){Lr(this,"",qe,b,a,c,d,e,f)}; +function Lr(a,b,c,d,e,f,g,h,k){void 0===h&&(h=null);void 0===k&&(k=null);var l=new pe;l.model=a;l.change=c;l.modelChange=b;l.propertyName=d;l.object=e;l.oldValue=f;l.oldParam=h;l.newValue=g;l.newParam=k;a.Pr(l)} +X.prototype.changeState=function(a,b){if(null!==a&&a.model===this)if(a.change===qe){var c=a.object,d=a.propertyName,e=a.L(b);d===this.nodeKeyProperty&&this.hb(c)&&(b=a.L(!b),void 0!==b&&this.rb.remove(b),void 0!==e&&this.rb.add(e,c));bk(c,d,e)}else a.change===se?(c=a.newParam,"nodeDataArray"===a.modelChange?(a=a.newValue,Ga(a)&&"number"===typeof c&&(d=this.Ba(a),b?(this.Gc[c]===a&&La(this.Gc,c),void 0!==d&&this.rb.remove(d)):(this.Gc[c]!==a&&Ka(this.Gc,c,a),void 0!==d&&this.rb.add(d,a)))):""===a.modelChange? +((d=a.object)&&!Ha(d)&&a.propertyName&&(d=En(a.object,a.propertyName)),Ha(d)&&"number"===typeof c&&(a=a.newValue,b?La(d,c):Ka(d,c,a))):v("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===te?(c=a.oldParam,"nodeDataArray"===a.modelChange?(a=a.oldValue,Ga(a)&&"number"===typeof c&&(d=this.Ba(a),b?(this.Gc[c]!==a&&Ka(this.Gc,c,a),void 0!==d&&this.rb.add(d,a)):(this.Gc[c]===a&&La(this.Gc,c),void 0!==d&&this.rb.remove(d)))):""===a.modelChange?((d=a.object)&&!Ha(d)&&a.propertyName&&(d= +En(a.object,a.propertyName)),Ha(d)&&"number"===typeof c&&(a=a.oldValue,b?Ka(d,c,a):La(d,c))):v("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==re&&v("unknown ChangedEvent: "+a.toString())};X.prototype.Ja=function(a){return this.undoManager.Ja(a)};X.prototype.kb=function(a){return this.undoManager.kb(a)};X.prototype.Nf=function(){return this.undoManager.Nf()}; +X.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.Ja(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.kb(b):this.undoManager.Nf(),this.skipsUndoManager=c}};t=X.prototype;t.Pa=function(a,b){void 0===b&&(b="");Lr(this,"SourceChanged",re,b,a,null,null)};function Mr(a,b,c){"string"!==typeof a&&"function"!==typeof a&&Aa(a,"string or function",b,c)} +t.Ba=function(a){if(null!==a){var b=this.Yh;if(""!==b&&(b=En(a,b),void 0!==b)){if(nr(b))return b;v("Key value for node data "+a+" is not a number or a string: "+b)}}}; +t.fm=function(a,b){void 0!==b&&null!==b&&nr(b)||Aa(b,"number or string",X,"setKeyForNodeData:key");if(null!==a){var c=this.Yh;if(""!==c)if(this.hb(a)){var d=En(a,c);d!==b&&null===this.ic(b)&&(bk(a,c,b),void 0!==d&&this.rb.remove(d),this.rb.add(b,a),Lr(this,"nodeKey",qe,c,a,d,b),"string"===typeof c&&this.Pa(a,c),this.Zo(d,b))}else bk(a,c,b)}};function nr(a){return"number"===typeof a||"string"===typeof a}t.hb=function(a){var b=this.Ba(a);return void 0===b?!1:this.rb.L(b)===a}; +t.ic=function(a){null===a&&v("Model.findNodeDataForKey:key must not be null");return void 0!==a&&nr(a)?this.rb.L(a):null}; +t.$u=function(a){if(null!==a){var b=this.Yh;if(""!==b){var c=this.Ba(a);if(void 0===c||this.rb.contains(c)){var d=this.dl;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.rb.contains(c))){bk(a,b,c);return}if("string"===typeof c){for(d=2;this.rb.contains(c+d);)d++;bk(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.rb.count-1;this.rb.contains(c);)c--;bk(a,b,c)}else G&&v("Model.getKeyForNodeData returned something other than a string or a number: "+c)}}}}; +t.yf=function(a){null!==a&&(nb(a),this.hb(a)||fr(this,a,!0))};function fr(a,b,c){var d=a.Ba(b);if(void 0===d||a.rb.L(d)!==b)a.$u(b),d=a.Ba(b),void 0===d&&v("Model.makeNodeDataKeyUnique failed on "+b+". Data not added to Model."),a.rb.add(d,b),d=null,c&&(d=a.Gc.length,Ka(a.Gc,d,b)),Lr(a,"nodeDataArray",se,"nodeDataArray",a,null,b,null,d),a.am(b),a.$l(b)}t.Dy=function(a){if(Ha(a))for(var b=a.length,c=0;c<b;c++)this.yf(a[c]);else for(a=a.iterator;a.next();)this.yf(a.value)}; +t.Yl=function(a){null!==a&&er(this,a,!0)};function er(a,b,c){var d=a.Ba(b);void 0!==d&&a.rb.remove(d);d=null;if(c){a:if(c=a.Gc,Array.isArray(c))d=c.indexOf(b);else{d=c.length;for(var e=0;e<d;e++)if(c[e]===b){d=e;break a}d=-1}if(0>d)return;La(a.Gc,d)}Lr(a,"nodeDataArray",te,"nodeDataArray",a,b,null,d,null);a.gp(b)}t.mA=function(a){if(Ha(a))for(var b=a.length,c=0;c<b;c++)this.Yl(a[c]);else for(a=a.iterator;a.next();)this.Yl(a.value)}; +t.$z=function(a){if(a!==this.nodeDataArray&&Ha(a)){var b=this.ll;b.clear();b.addAll(this.rb.iteratorKeys);var c=this.jl;c.clear();for(var d=a.length,e=0;e<d;e++){var f=a[e],g=this.Ba(f);if(void 0!==g){c.add(g);var h=this.ic(g);h!==f&&(null!==h?(this.to(h,f),this.gm(f,h)):(f=this.cloneDeep(f),this.fm(f,g),this.yf(f)))}else g=this.cloneDeep(f),this.yf(g),c.add(this.Ba(g))}for(a=b.iterator;a.next();)d=a.value,c.contains(d)||(d=this.ic(d))&&this.Yl(d);b.clear();c.clear()}}; +t.Zo=function(a,b){void 0!==b&&(a=qr(this,a),a instanceof I&&this.Xf.add(b,a))};t.Cv=function(){};t.am=function(){};t.$l=function(){};t.gp=function(){};function sr(a,b,c){if(void 0!==b){var d=a.Xf.L(b);null===d&&(d=new I,a.Xf.add(b,d));d.add(c)}}function rr(a,b,c){if(void 0!==b){var d=a.Xf.L(b);d instanceof I&&(void 0===c||null===c?a.Xf.remove(b):(d.remove(c),0===d.count&&a.Xf.remove(b)))}}function qr(a,b){if(void 0===b)return null;a=a.Xf.L(b);return a instanceof I?a:null} +t.Oy=function(a){void 0===a?this.Xf.clear():this.Xf.remove(a)};X.prototype.copyNodeData=function(a){if(null===a)return null;var b=this.Ck;a=null!==b?b(a,this):Nr(this,a,!0);Ga(a)&&Za(a);return a}; +function Nr(a,b,c){if(a.copiesArrays&&Array.isArray(b)){var d=[];for(c=0;c<b.length;c++){var e=Nr(a,b[c],a.copiesArrayObjects);d.push(e)}Za(d);return d}if(c&&Ga(b)){c=(c=b.constructor)?new c:{};e=a.copiesKey||"string"!==typeof a.nodeKeyProperty?null:a.nodeKeyProperty;for(d in b)if("__gohashid"===d)c.__gohashid=void 0;else if(d===e)c[e]=void 0;else{var f=En(b,d);var g=Fr(a,f);"GraphObject"===g||"Diagram"===g||"Layer"===g||"RowColumnDefinition"===g||"AnimationManager"===g||"Tool"===g||"CommandHandler"=== +g||"Layout"===g||"InputEvent"===g||"DiagramEvent"===g?(G&&"_"!==d[0]&&Fa('Warning: found GraphObject or Diagram reference when copying model data on property "'+d+'" of data object: '+b.toString()+" \nModel data should not have any references to a Diagram or any part of a diagram, such as: "+f.toString()),g=!0):g=f instanceof X||f instanceof ve||f instanceof ue||f instanceof pe?!0:!1;g?bk(c,d,f):(f=Nr(a,f,!1),bk(c,d,f))}Za(c);return c}return b instanceof K?b.copy():b instanceof Hb?b.copy():b instanceof +M?b.copy():b instanceof Ib?b.copy():b instanceof gc?b.copy():b} +X.prototype.setDataProperty=function(a,b,c){G&&(A(a,"object",X,"setDataProperty:data"),A(b,"string",X,"setDataProperty:propname"),""===b&&v("Model.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.hb(a)){if(b===this.nodeKeyProperty){this.fm(a,c);return}if(b===this.nodeCategoryProperty){this.em(a,c);return}}else!Or&&a instanceof O&&(Or=!0,Fa('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),Fa(" Is that really your intent?"));var d= +En(a,b);d!==c&&(bk(a,b,c),this.ts(a,b,d,c))};t=X.prototype;t.set=function(a,b,c){this.setDataProperty(a,b,c)};t.to=function(a,b){if(b){var c=this.hb(a),d;for(d in b)"__gohashid"===d||c&&d===this.nodeKeyProperty||this.setDataProperty(a,d,b[d])}};t.zy=function(a,b){this.ds(a,-1,b)}; +t.ds=function(a,b,c){G&&(Ia(a,X,"insertArrayItem:arr"),E(b,X,"insertArrayItem:idx"),a===this.Gc&&v("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray"));0>b&&(b=a.length);Ka(a,b,c);Lr(this,"",se,"",a,null,c,null,b)}; +t.kv=function(a,b){void 0===b&&(b=-1);G&&(Ia(a,X,"removeArrayItem:arr"),E(b,X,"removeArrayItem:idx"));a===this.Gc&&v("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=a.length-1);var c=a[b];La(a,b);Lr(this,"",te,"",a,c,null,b,null)};t.Go=function(a){if(null===a)return"";var b=this.tj;if(""===b)return"";b=En(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v("getCategoryForNodeData found a non-string category for "+a+": "+b)}; +t.em=function(a,b){A(b,"string",X,"setCategoryForNodeData:cat");if(null!==a){var c=this.tj;if(""!==c)if(this.hb(a)){var d=En(a,c);void 0===d&&(d="");d!==b&&(bk(a,c,b),Lr(this,"nodeCategory",qe,c,a,d,b))}else bk(a,c,b)}};t.gm=function(a,b){this.em(b,this.Go(a))};t.Pl=function(){return!1};t.$j=function(){return!1};t.yi=function(){return!1};t.ks=function(){return!1};t.wi=function(){return!1};function Bi(){return new X} +function Fr(a,b){if("function"===typeof b){if(b.className)return b.className;if(b.name)return b.name}else if("object"===typeof b&&null!==b&&b.constructor)return Fr(a,b.constructor);return typeof b}function Ir(a){return Pr[a]?Pr[a]:void 0!==sa.go&&sa.go[a]?sa.go[a]:null}function En(a,b){if(!a||!b)return null;try{if("function"===typeof b)var c=b(a);else"function"===typeof a.getAttribute?(c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){G&&Fa("property get error: "+d.toString())}return c} +function bk(a,b,c){if(a&&b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d){G&&Fa("property set error: "+d.toString())}} +oa.Object.defineProperties(X.prototype,{name:{configurable:!0,get:function(){return this.Ca},set:function(a){var b=this.Ca;b!==a&&(A(a,"string",X,"name"),this.Ca=a,this.g("name",b,a))}},dataFormat:{configurable:!0,get:function(){return this.Nm},set:function(a){var b=this.Nm;b!==a&&(A(a,"string",X,"dataFormat"),this.Nm=a,this.g("dataFormat",b,a))}},isReadOnly:{configurable:!0,get:function(){return this.Jg},set:function(a){var b=this.Jg;b!==a&&(A(a,"boolean", +X,"isReadOnly"),this.Jg=a,this.g("isReadOnly",b,a))}},modelData:{configurable:!0,get:function(){return this.j},set:function(a){var b=this.j;b!==a&&(A(a,"object",X,"modelData"),this.j=a,this.g("modelData",b,a),this.Pa(a))}},undoManager:{configurable:!0,get:function(){return this.m},set:function(a){var b=this.m;b!==a&&(w(a,ve,X,"undoManager"),null!==b&&b.Px(this),this.m=a,null!==a&&a.Pw(this))}},skipsUndoManager:{configurable:!0,get:function(){return this.Xg}, +set:function(a){A(a,"boolean",X,"skipsUndoManager");this.Xg=a}},nodeKeyProperty:{configurable:!0,get:function(){return this.Yh},set:function(a){var b=this.Yh;b!==a&&(Mr(a,X,"nodeKeyProperty"),""===a&&v("Model.nodeKeyProperty may not be the empty string"),0<this.rb.count&&v("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Yh=a,this.g("nodeKeyProperty",b,a))}},makeUniqueKeyFunction:{configurable:!0,get:function(){return this.dl},set:function(a){var b= +this.dl;b!==a&&(null!==a&&A(a,"function",X,"makeUniqueKeyFunction"),this.dl=a,this.g("makeUniqueKeyFunction",b,a))}},nodeDataArray:{configurable:!0,get:function(){return this.Gc},set:function(a){var b=this.Gc;if(b!==a){Ia(a,X,"nodeDataArray");this.rb.clear();this.Cv();for(var c=a.length,d=0;d<c;d++){var e=a[d];Ga(e)||v("Model.nodeDataArray must only contain Objects, not: "+e);nb(e)}this.Gc=a;d=new H;for(e=0;e<c;e++){var f=a[e],g=this.Ba(f);void 0===g?d.add(f):null!==this.rb.L(g)?d.add(f): +this.rb.add(g,f)}for(d=d.iterator;d.next();)e=d.value,this.$u(e),f=this.Ba(e),void 0!==f&&this.rb.add(f,e);Lr(this,"nodeDataArray",qe,"nodeDataArray",this,b,a);for(b=0;b<c;b++)d=a[b],this.am(d),this.$l(d);Array.isArray(a)||(this.isReadOnly=!0)}}},copyNodeDataFunction:{configurable:!0,get:function(){return this.Ck},set:function(a){var b=this.Ck;b!==a&&(null!==a&&A(a,"function",X,"copyNodeDataFunction"),this.Ck=a,this.g("copyNodeDataFunction",b,a))}},copiesArrays:{configurable:!0, +get:function(){return this.Fm},set:function(a){var b=this.Fm;b!==a&&(null!==a&&A(a,"boolean",X,"copiesArrays"),this.Fm=a,this.g("copiesArrays",b,a))}},copiesArrayObjects:{configurable:!0,get:function(){return this.Em},set:function(a){var b=this.Em;b!==a&&(null!==a&&A(a,"boolean",X,"copiesArrayObjects"),this.Em=a,this.g("copiesArrayObjects",b,a))}},copiesKey:{configurable:!0,get:function(){return this.Hm},set:function(a){var b=this.Hm;b!==a&&(null!==a&&A(a,"boolean",X,"copiesKey"), +this.Hm=a,this.g("copiesKey",b,a))}},afterCopyFunction:{configurable:!0,get:function(){return this.sm},set:function(a){var b=this.sm;b!==a&&(null!==a&&A(a,"function",X,"afterCopyFunction"),this.sm=a,this.g("afterCopyFunction",b,a))}},nodeCategoryProperty:{configurable:!0,get:function(){return this.tj},set:function(a){var b=this.tj;b!==a&&(Mr(a,X,"nodeCategoryProperty"),this.tj=a,this.g("nodeCategoryProperty",b,a))}},type:{configurable:!0,get:function(){return"Model"}}}); +X.prototype.setCategoryForNodeData=X.prototype.em;X.prototype.getCategoryForNodeData=X.prototype.Go;X.prototype.removeArrayItem=X.prototype.kv;X.prototype.insertArrayItem=X.prototype.ds;X.prototype.addArrayItem=X.prototype.zy;X.prototype.assignAllDataProperties=X.prototype.to;X.prototype.set=X.prototype.set;X.prototype.clearUnresolvedReferences=X.prototype.Oy;X.prototype.mergeNodeDataArray=X.prototype.$z;X.prototype.removeNodeDataCollection=X.prototype.mA;X.prototype.removeNodeData=X.prototype.Yl; +X.prototype.addNodeDataCollection=X.prototype.Dy;X.prototype.addNodeData=X.prototype.yf;X.prototype.makeNodeDataKeyUnique=X.prototype.$u;X.prototype.findNodeDataForKey=X.prototype.ic;X.prototype.containsNodeData=X.prototype.hb;X.prototype.setKeyForNodeData=X.prototype.fm;X.prototype.getKeyForNodeData=X.prototype.Ba;X.prototype.updateTargetBindings=X.prototype.Pa;X.prototype.commit=X.prototype.commit;X.prototype.rollbackTransaction=X.prototype.Nf;X.prototype.commitTransaction=X.prototype.kb; +X.prototype.startTransaction=X.prototype.Ja;X.prototype.raiseDataChanged=X.prototype.ts;X.prototype.raiseChanged=X.prototype.g;X.prototype.raiseChangedEvent=X.prototype.ib;X.prototype.removeChangedListener=X.prototype.mk;X.prototype.addChangedListener=X.prototype.fh;X.prototype.writeJsonValue=X.prototype.om;X.prototype.replaceJsonObjects=X.prototype.Zl;X.prototype.applyIncrementalJSON=X.prototype.Hy;X.prototype.applyIncrementalJson=X.prototype.Rw;X.prototype.toJSON=X.prototype.toJSON; +X.prototype.toJson=X.prototype.cp;X.prototype.toIncrementalJSON=X.prototype.yA;X.prototype.toIncrementalJson=X.prototype.Zx;X.prototype.toIncrementalData=X.prototype.xA;X.prototype.clear=X.prototype.clear;var Or=!1,Pr={};X.className="Model"; +X.fromJSON=X.fromJson=function(a,b){void 0===b&&(b=null);null!==b&&w(b,X,X,"fromJson:model");var c=null;if("string"===typeof a)try{c=sa.JSON.parse(a)}catch(f){G&&Fa("JSON.parse error: "+f.toString())}else"object"===typeof a?c=a:v("Unable to construct a Model from: "+a);if(null===b){a=null;var d=c["class"];if("string"===typeof d)try{var e=null;0===d.indexOf("go.")?(d=d.substr(3),e=Ir(d)):(e=Ir(d),null===e&&(e=sa[d]));"function"===typeof e&&(a=new e)}catch(f){}null===a||a instanceof X?b=a:v("Unable to construct a Model of declared class: "+ +c["class"])}null===b&&(b=X.constructGraphLinksModel());b.Vo(c);b.hv(c);return b};X.safePropertyValue=En;X.safePropertySet=bk;Pr.Brush=Bl;Pr.ChangedEvent=pe;Pr.Geometry=N;Pr.Margin=gc;Pr.Panel=V;Pr.Point=K;Pr.Rect=M;Pr.Size=Hb;Pr.Spot=Ib;Pr.Transaction=ue;Pr.UndoManager=ve; +function Ji(a,b,c,d){Za(this);this._isFrozen=!1;void 0===a?a="":A(a,"string",Ji,"constructor:targetprop");void 0===b?b=a:A(b,"string",Ji,"constructor:sourceprop");void 0===c?c=null:null!==c&&A(c,"function",Ji,"constructor:conv");this.j=-1;this.yd=null;this.zl=a;this.yl=this.jo=0;this.lr=null;this.pn=!1;this.ul=b;this.Dm=c;void 0===d?(this.gl=Qr,this.xk=null):(this.gl=wn,this.xk=d);this.ht=new I} +Ji.prototype.copy=function(){var a=new Ji;a.zl=this.zl;a.jo=this.jo;a.yl=this.yl;a.lr=this.lr;a.pn=this.pn;a.ul=this.ul;a.Dm=this.Dm;a.gl=this.gl;a.xk=this.xk;return a};t=Ji.prototype;t.ub=function(a){a.classType===Ji?this.mode=a:Ea(this,a)};t.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(-1!==this.Gi?" "+this.Gi:"")+" "+this.mode.name+")"};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){this._isFrozen=!1;return this}; +t.Hx=function(a){void 0===a&&(a=null);null!==a&&A(a,"function",Ji,"makeTwoWay");this.mode=wn;this.backConverter=a;return this};t.So=function(a){void 0===a&&(a="");G&&A(a,"string",Ji,"ofObject:srcname");this.sourceName=a;this.isToModel=!1;return this};t.cA=function(){this.sourceName=null;this.isToModel=!0;return this};function ul(a,b,c){a=a.sourceName;return null===a||""===a?b:"/"===a?c.part:"."===a?c:".."===a?c.panel:b.lb(a)} +t.Dv=function(a,b,c){var d=this.ul;if(void 0===c||""===d||d===c){c=this.zl;var e=this.Dm;if(null===e&&""===c)Fa("Binding error: target property is the empty string: "+this.toString());else{G&&"string"===typeof c&&("function"!==typeof a.setAttribute&&0<c.length&&"_"!==c[0]&&!Sa(a,c)?Fa("Binding error: undefined target property: "+c+" on "+a.toString()):"name"===c&&a instanceof O&&Fa("Binding error: cannot modify GraphObject.name on "+a.toString()));var f=b;""!==d&&(f=En(b,d));if(void 0!==f)if(null=== +e)""!==c&&bk(a,c,f);else try{if(""!==c){var g=e(f,a);G&&void 0===g&&Fa('Binding warning: conversion function returned undefined when setting target property "'+c+'" on '+a.toString()+", function is: "+e);bk(a,c,g)}else e(f,a)}catch(h){G&&Fa("Binding error: "+h.toString()+' setting target property "'+c+'" on '+a.toString()+" with conversion function: "+e)}}}}; +t.ip=function(a,b,c,d){if(this.gl===wn){var e=this.zl;if(void 0===c||e===c){c=this.ul;var f=this.xk,g=a;""!==e&&(g=En(a,e));if(void 0!==g&&!this.ht.contains(a))try{this.ht.add(a);var h=null!==d?d.diagram:null,k=null!==h?h.model:null;if(null===f)if(""!==c)null!==k?(G&&k.nodeKeyProperty===c&&k.hb(b)&&Fa("Binding error: cannot have TwoWay Binding on node data key property: "+this.toString()),k.setDataProperty(b,c,g)):bk(b,c,g);else{if(null!==k&&null!==d&&0<=d.itemIndex&&null!==d.panel&&Array.isArray(d.panel.itemArray)){var l= +d.itemIndex,m=d.panel.itemArray;k.kv(m,l);k.ds(m,l,g)}}else try{if(""!==c){var n=f(g,b,k);null!==k?(G&&(k.nodeKeyProperty===c&&k.hb(b)&&Fa("Binding error: cannot have TwoWay Binding on node data key property: "+this.toString()),void 0===n&&Fa('Binding warning: conversion function returned undefined when setting source property "'+c+'" on '+b.toString()+", function is: "+f)),k.setDataProperty(b,c,n)):bk(b,c,n)}else{var p=f(g,b,k);if(void 0!==p&&null!==k&&null!==d&&0<=d.itemIndex&&null!==d.panel&&Array.isArray(d.panel.itemArray)){var r= +d.itemIndex,q=d.panel.itemArray;k.kv(q,r);k.ds(q,r,p)}}}catch(u){G&&Fa("Binding error: "+u.toString()+' setting source property "'+c+'" on '+b.toString()+" with conversion function: "+f)}}finally{this.ht.remove(a)}}}}; +oa.Object.defineProperties(Ji.prototype,{Gi:{configurable:!0,get:function(){return this.j},set:function(a){this._isFrozen&&xa(this);A(a,"number",Ji,"targetId");this.j=a}},targetProperty:{configurable:!0,get:function(){return this.zl},set:function(a){this._isFrozen&&xa(this);A(a,"string",Ji,"targetProperty");this.zl=a}},sourceName:{configurable:!0,get:function(){return this.lr},set:function(a){this._isFrozen&&xa(this);null!==a&&A(a,"string",Ji,"sourceName"); +this.lr=a;null!==a&&(this.pn=!1)}},isToModel:{configurable:!0,get:function(){return this.pn},set:function(a){this._isFrozen&&xa(this);A(a,"boolean",Ji,"isToModel");this.pn=a}},sourceProperty:{configurable:!0,get:function(){return this.ul},set:function(a){this._isFrozen&&xa(this);A(a,"string",Ji,"sourceProperty");this.ul=a}},converter:{configurable:!0,get:function(){return this.Dm},set:function(a){this._isFrozen&&xa(this);null!==a&&A(a,"function",Ji,"converter"); +this.Dm=a}},backConverter:{configurable:!0,get:function(){return this.xk},set:function(a){this._isFrozen&&xa(this);null!==a&&A(a,"function",Ji,"backConverter");this.xk=a}},mode:{configurable:!0,get:function(){return this.gl},set:function(a){this._isFrozen&&xa(this);ab(a,Ji,Ji,"mode");this.gl=a}}});Ji.prototype.updateSource=Ji.prototype.ip;Ji.prototype.updateTarget=Ji.prototype.Dv;Ji.prototype.ofModel=Ji.prototype.cA;Ji.prototype.ofObject=Ji.prototype.So; +Ji.prototype.makeTwoWay=Ji.prototype.Hx;var Xk="Binding",Qr=new F(Ji,"OneWay",1),wn=new F(Ji,"TwoWay",2);Ji.className="Binding";Ji.parseEnum=function(a,b){A(a,"function",Ji,"parseEnum:ctor");ab(b,a,Ji,"parseEnum:defval");return function(c){c=$a(a,c);return null===c?b:c}};Ji.toString=Ra;Ji.OneWay=Qr;Ji.TwoWay=wn; +function Rr(a,b,c){X.call(this);this.Nv=',\n "insertedLinkKeys": ';this.gy=',\n "modifiedLinkData": ';this.Pv=',\n "removedLinkKeys": ';this.ld=[];this.cg=new I;this.wb=new yb;this.Nh="";this.Yi=this.Bk=this.el=null;this.lf="from";this.mf="to";this.nj=this.mj="";this.lj="category";this.ie="";this.kl="isGroup";this.Je="group";this.Gm=!1;void 0!==b&&(this.linkDataArray=b);void 0!==a&&(Ha(a)?this.nodeDataArray=a:Object.assign(this,a));c&&Object.assign(this,c)}na(Rr,X); +Rr.constructGraphLinksModel=X.constructGraphLinksModel;Rr.prototype.cloneProtected=function(a){X.prototype.cloneProtected.call(this,a);a.Nh=this.Nh;a.el=this.el;a.Bk=this.Bk;a.lf=this.lf;a.mf=this.mf;a.mj=this.mj;a.nj=this.nj;a.lj=this.lj;a.ie=this.ie;a.kl=this.kl;a.Je=this.Je;a.Gm=this.Gm};t=Rr.prototype;t.clear=function(){X.prototype.clear.call(this);this.ld=[];this.wb.clear();this.cg.clear()}; +t.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.cp();var b=(""!==this.name?this.name:"")+" GraphLinksModel";if(0<a){b+="\n node data:";a=this.nodeDataArray;var c=a.length,d;for(d=0;d<c;d++){var e=a[d];b+=" "+this.Ba(e)+":"+Ra(e)}b+="\n link data:";a=this.linkDataArray;c=a.length;for(d=0;d<c;d++)e=a[d],b+=" "+lr(this,e,!0)+"--\x3e"+lr(this,e,!1)}return b}; +t.Iv=function(a,b){""===this.linkKeyProperty&&v("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var c=X.prototype.Iv.call(this,a,b),d=this,e=new I,f=new I,g=new I,h=this.vh;a.changes.each(function(a){a.model===d&&("linkDataArray"===a.modelChange?a.change===se?e.add(a.newValue):a.change===te&&g.add(a.oldValue):d.Jc(a.object)?f.add(a.object):null!==a.object&&(null!==a.object&&h&&h.contains(a.object)?h.get(a.object).each(function(a){d.Jc(a)&&f.add(a)}): +a.object instanceof X||d.hb(a.object)||Sr(d,a.object).each(function(a){f.add(a)})))});var k=this.jl;k.clear();e.each(function(a){k.add(d.Ac(a));b||f.add(a)});var l=this.ll;l.clear();g.each(function(a){l.add(d.Ac(a));b&&f.add(a)});a=d.cloneDeep(f.Ka());0<k.count&&(null===c&&(c={}),b?c.removedLinkKeys=k.Ka():c.insertedLinkKeys=k.Ka());0<a.length&&(null===c&&(c={}),c.modifiedLinkData=a);0<l.count&&(null===c&&(c={}),b?c.insertedLinkKeys=l.Ka():c.removedLinkKeys=l.Ka());l.clear();k.clear();return c}; +t.nm=function(){var a=X.prototype.nm.call(this),b="";"category"!==this.linkCategoryProperty&&"string"===typeof this.linkCategoryProperty&&(b+=',\n "linkCategoryProperty": '+this.quote(this.linkCategoryProperty));""!==this.linkKeyProperty&&"string"===typeof this.linkKeyProperty&&(b+=',\n "linkKeyProperty": '+this.quote(this.linkKeyProperty));"from"!==this.linkFromKeyProperty&&"string"===typeof this.linkFromKeyProperty&&(b+=',\n "linkFromKeyProperty": '+this.quote(this.linkFromKeyProperty));"to"!== +this.linkToKeyProperty&&"string"===typeof this.linkToKeyProperty&&(b+=',\n "linkToKeyProperty": '+this.quote(this.linkToKeyProperty));""!==this.linkFromPortIdProperty&&"string"===typeof this.linkFromPortIdProperty&&(b+=',\n "linkFromPortIdProperty": '+this.quote(this.linkFromPortIdProperty));""!==this.linkToPortIdProperty&&"string"===typeof this.linkToPortIdProperty&&(b+=',\n "linkToPortIdProperty": '+this.quote(this.linkToPortIdProperty));""!==this.linkLabelKeysProperty&&"string"===typeof this.linkLabelKeysProperty&& +(b+=',\n "linkLabelKeysProperty": '+this.quote(this.linkLabelKeysProperty));"isGroup"!==this.nodeIsGroupProperty&&"string"===typeof this.nodeIsGroupProperty&&(b+=',\n "nodeIsGroupProperty": '+this.quote(this.nodeIsGroupProperty));"group"!==this.nodeGroupKeyProperty&&"string"===typeof this.nodeGroupKeyProperty&&(b+=',\n "nodeGroupKeyProperty": '+this.quote(this.nodeGroupKeyProperty));return a+b}; +t.Vo=function(a){X.prototype.Vo.call(this,a);a.linkKeyProperty&&(this.linkKeyProperty=a.linkKeyProperty);a.linkFromKeyProperty&&(this.linkFromKeyProperty=a.linkFromKeyProperty);a.linkToKeyProperty&&(this.linkToKeyProperty=a.linkToKeyProperty);a.linkFromPortIdProperty&&(this.linkFromPortIdProperty=a.linkFromPortIdProperty);a.linkToPortIdProperty&&(this.linkToPortIdProperty=a.linkToPortIdProperty);a.linkCategoryProperty&&(this.linkCategoryProperty=a.linkCategoryProperty);a.linkLabelKeysProperty&&(this.linkLabelKeysProperty= +a.linkLabelKeysProperty);a.nodeIsGroupProperty&&(this.nodeIsGroupProperty=a.nodeIsGroupProperty);a.nodeGroupKeyProperty&&(this.nodeGroupKeyProperty=a.nodeGroupKeyProperty)};t.Jv=function(){var a=X.prototype.Jv.call(this),b=',\n "linkDataArray": '+Dr(this,this.linkDataArray,!0);return a+b};t.hv=function(a){X.prototype.hv.call(this,a);a=a.linkDataArray;Array.isArray(a)&&(this.Zl(a),this.linkDataArray=a)}; +function Sr(a,b){for(var c=new I,d=0;d<a.linkDataArray.length;d++){var e=a.linkDataArray[d];Er(a,b,e,e,c)}return c} +t.Hv=function(a,b){""===this.linkKeyProperty&&v("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var c=X.prototype.Hv.call(this,a,b),d=this,e=new I,f=new I,g=new I,h=this.vh;a.changes.each(function(a){a.model===d&&("linkDataArray"===a.modelChange?a.change===se?e.add(a.newValue):a.change===te&&g.add(a.oldValue):d.Jc(a.object)?f.add(a.object):null!==a.object&&(null!==a.object&&h&&h.contains(a.object)?h.get(a.object).each(function(a){d.Jc(a)&&f.add(a)}): +a.object instanceof X||d.hb(a.object)||Sr(d,a.object).each(function(a){f.add(a)})))});var k=this.jl;k.clear();e.each(function(a){k.add(d.Ac(a));b||f.add(a)});var l=this.ll;l.clear();g.each(function(a){l.add(d.Ac(a));b&&f.add(a)});a=c;0<k.count&&(a+=(b?this.Pv:this.Nv)+Dr(this,k.Ka(),!0));0<f.count&&(a+=this.gy+Dr(this,f.Ka(),!0));0<l.count&&(a+=(b?this.Nv:this.Pv)+Dr(this,l.Ka(),!0));l.clear();k.clear();return a}; +t.Uo=function(a){(void 0!==a.linkCategoryProperty&&a.linkCategoryProperty!==this.linkCategoryProperty||void 0!==a.linkKeyProperty&&a.linkKeyProperty!==this.linkKeyProperty||void 0!==a.linkFromKeyProperty&&a.linkFromKeyProperty!==this.linkFromKeyProperty||void 0!==a.linkToKeyProperty&&a.linkToKeyProperty!==this.linkToKeyProperty||void 0!==a.linkFromPortIdProperty&&a.linkFromPortIdProperty!==this.linkFromPortIdProperty||void 0!==a.linkToPortIdProperty&&a.linkToPortIdProperty!==this.linkToPortIdProperty|| +void 0!==a.linkLabelKeysProperty&&a.linkLabelKeysProperty!==this.linkLabelKeysProperty||void 0!==a.nodeIsGroupProperty&&a.nodeIsGroupProperty!==this.nodeIsGroupProperty||void 0!==a.nodeGroupKeyProperty&&a.nodeGroupKeyProperty!==this.nodeGroupKeyProperty)&&v("applyIncrementalJson cannot change Model properties");X.prototype.Uo.call(this,a);var b=a.insertedLinkKeys;if(Array.isArray(b))for(var c=b.length,d=0;d<c;d++){var e=b[d],f=this.kh(e);null===f&&(f=this.zo({}),this.xs(f,e),this.ji(f))}b=a.modifiedLinkData; +if(Array.isArray(b))for(c=b.length,d=0;d<c;d++)if(e=b[d],f=this.Ac(e),f=this.kh(f),null!==f){for(var g in e)"__gohashid"!==g&&g!==this.linkKeyProperty&&this.setDataProperty(f,g,e[g]);Tr(this,e,f)}a=a.removedLinkKeys;if(Array.isArray(a))for(g=a.length,b=0;b<g;b++)c=this.kh(a[b]),null!==c&&this.Xl(c)}; +Rr.prototype.changeState=function(a,b){if(null!==a&&a.model===this){if(a.change===qe){var c=a.object,d=a.propertyName;if(d===this.linkKeyProperty&&this.Jc(c)){var e=a.L(b);b=a.L(!b);void 0!==b&&this.wb.remove(b);void 0!==e&&this.wb.add(e,c);bk(c,d,e);return}}else if(a.change===se){c=a.newParam;if("linkDataArray"===a.modelChange){a=a.newValue;Ga(a)&&"number"===typeof c&&(d=this.Ac(a),b?(this.cg.remove(a),this.ld[c]===a&&this.ld.splice(c,1),void 0!==d&&this.wb.remove(d)):(this.cg.add(a),this.ld[c]!== +a&&this.ld.splice(c,0,a),void 0!==d&&this.wb.add(d,a)));return}if("linkLabelKeys"===a.modelChange){d=this.Hf(a.object);Array.isArray(d)&&"number"===typeof c&&(b?(c=d.indexOf(a.newValue),0<=c&&d.splice(c,1)):0>d.indexOf(a.newValue)&&d.splice(c,0,a.newValue));return}}else if(a.change===te){c=a.oldParam;if("linkDataArray"===a.modelChange){a=a.oldValue;Ga(a)&&"number"===typeof c&&(d=this.Ac(a),b?(this.cg.add(a),this.ld[c]!==a&&this.ld.splice(c,0,a),void 0!==d&&this.wb.add(d,a)):(this.cg.remove(a),this.ld[c]=== +a&&this.ld.splice(c,1),void 0!==d&&this.wb.remove(d)));return}if("linkLabelKeys"===a.modelChange){d=this.Hf(a.object);Array.isArray(d)&&"number"===typeof c&&(b?0>d.indexOf(a.newValue)&&d.splice(c,0,a.newValue):(c=d.indexOf(a.newValue),0<=c&&d.splice(c,1)));return}}X.prototype.changeState.call(this,a,b)}};t=Rr.prototype;t.Rl=function(a){if(void 0!==a){var b=this.Yi;if(null!==b){var c=this.ic(a);null===c&&(c=this.copyNodeData(b),bk(c,this.nodeKeyProperty,a),this.yf(c))}return a}}; +t.sx=function(a){return lr(this,a,!0)};t.qv=function(a,b){tr(this,a,b,!0)};t.vx=function(a){return lr(this,a,!1)};t.uv=function(a,b){tr(this,a,b,!1)};function lr(a,b,c){if(null!==b&&(a=c?a.lf:a.mf,""!==a&&(a=En(b,a),void 0!==a))){if(nr(a))return a;v((c?"FromKey":"ToKey")+" value for link data "+b+" is not a number or a string: "+a)}} +function tr(a,b,c,d){null===c&&(c=void 0);void 0===c||nr(c)||Aa(c,"number or string",Rr,d?"setFromKeyForLinkData:key":"setToKeyForLinkData:key");if(null!==b){var e=d?a.lf:a.mf;if(""!==e)if(c=a.Rl(c),a.Jc(b)){var f=En(b,e);f!==c&&(rr(a,f,b),bk(b,e,c),null===a.ic(c)&&sr(a,c,b),Lr(a,d?"linkFromKey":"linkToKey",qe,e,b,f,c),"string"===typeof e&&a.Pa(b,e))}else bk(b,e,c)}}t.tx=function(a){return kr(this,a,!0)};t.rv=function(a,b){ur(this,a,b,!0)};t.wx=function(a){return kr(this,a,!1)}; +t.vv=function(a,b){ur(this,a,b,!1)};function kr(a,b,c){if(null===b)return"";a=c?a.mj:a.nj;if(""===a)return"";b=En(b,a);return void 0===b?"":b}function ur(a,b,c,d){A(c,"string",Rr,d?"setFromPortIdForLinkData:portname":"setToPortIdForLinkData:portname");if(null!==b){var e=d?a.mj:a.nj;if(""!==e)if(a.Jc(b)){var f=En(b,e);void 0===f&&(f="");f!==c&&(bk(b,e,c),Lr(a,d?"linkFromPortId":"linkToPortId",qe,e,b,f,c),"string"===typeof e&&a.Pa(b,e))}else bk(b,e,c)}} +t.Hf=function(a){if(null===a)return Ur;var b=this.ie;if(""===b)return Ur;a=En(a,b);return void 0===a?Ur:a};t.ys=function(a,b){Ia(b,Rr,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.ie;if(""!==c)if(this.Jc(a)){var d=En(a,c);void 0===d&&(d=Ur);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;f<e;f++)rr(this,d[f],a);bk(a,c,b);e=b.length;for(f=0;f<e;f++){var g=b[f];null===this.ic(g)&&sr(this,g,a)}Lr(this,"linkLabelKeys",qe,c,a,d,b);"string"===typeof c&&this.Pa(a,c)}}else bk(a,c,b)}}; +t.uu=function(a,b){if(null!==b&&void 0!==b&&(nr(b)||Aa(b,"number or string",Rr,"addLabelKeyForLinkData:key"),null!==a)){var c=this.ie;if(""!==c){var d=En(a,c);if(void 0===d)c=[],c.push(b),this.ys(a,c);else if(Array.isArray(d)){var e=d.indexOf(b);0<=e||(e=d.length,d.push(b),this.Jc(a)&&(null===this.ic(b)&&sr(this,b,a),Lr(this,"linkLabelKeys",se,c,a,null,b,null,e)))}else v(c+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}}; +t.Ox=function(a,b){if(null!==b&&void 0!==b&&(nr(b)||Aa(b,"number or string",Rr,"removeLabelKeyForLinkData:key"),null!==a)){var c=this.ie;if(""!==c){var d=En(a,c);if(Array.isArray(d)){var e=d.indexOf(b);0>e||(d.splice(e,1),this.Jc(a)&&(rr(this,b,a),Lr(this,"linkLabelKeys",te,c,a,b,null,e,null)))}else void 0!==d&&v(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}}; +t.Ac=function(a){if(null!==a){var b=this.Nh;if(""!==b&&(b=En(a,b),void 0!==b)){if(nr(b))return b;v("Key value for link data "+a+" is not a number or a string: "+b)}}};t.xs=function(a,b){void 0!==b&&null!==b&&nr(b)||Aa(b,"number or string",Rr,"setKeyForLinkData:key");if(null!==a){var c=this.Nh;if(""!==c)if(this.Jc(a)){var d=En(a,c);d!==b&&null===this.kh(b)&&(bk(a,c,b),void 0!==d&&this.wb.remove(d),this.wb.add(b,a),Lr(this,"linkKey",qe,c,a,d,b),"string"===typeof c&&this.Pa(a,c))}else bk(a,c,b)}}; +t.kh=function(a){null===a&&v("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&nr(a)?this.wb.L(a):null}; +t.os=function(a){if(null!==a){var b=this.Nh;if(""!==b){var c=this.Ac(a);if(void 0===c||this.wb.contains(c)){var d=this.el;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.wb.contains(c))){bk(a,b,c);return}if("string"===typeof c){for(d=2;this.wb.contains(c+d);)d++;bk(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.wb.count-1;this.wb.contains(c);)c--;bk(a,b,c)}else G&&v("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+c)}}}}; +t.Jc=function(a){return null===a?!1:this.cg.contains(a)};t.ji=function(a){null!==a&&(nb(a),this.Jc(a)||pr(this,a,!0))};function pr(a,b,c){if(""!==a.linkKeyProperty){var d=a.Ac(b);if(void 0!==d&&a.wb.L(d)===b)return;a.os(b);d=a.Ac(b);void 0===d&&v("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");a.wb.add(d,b)}a.cg.add(b);d=null;c&&(d=a.ld.length,a.ld.splice(d,0,b));Lr(a,"linkDataArray",se,"linkDataArray",a,null,b,null,d);Vr(a,b)} +t.Cy=function(a){if(Array.isArray(a))for(var b=a.length,c=0;c<b;c++)this.ji(a[c]);else for(a=a.iterator;a.next();)this.ji(a.value)};t.Xl=function(a){null!==a&&or(this,a,!0)};function or(a,b,c){a.cg.remove(b);var d=a.Ac(b);void 0!==d&&a.wb.remove(d);d=null;if(c){d=a.ld.indexOf(b);if(0>d)return;a.ld.splice(d,1)}Lr(a,"linkDataArray",te,"linkDataArray",a,b,null,d,null);c=lr(a,b,!0);rr(a,c,b);c=lr(a,b,!1);rr(a,c,b);d=a.Hf(b);if(Array.isArray(d))for(var e=d.length,f=0;f<e;f++)c=d[f],rr(a,c,b)} +t.kA=function(a){if(Array.isArray(a))for(var b=a.length,c=0;c<b;c++)this.Xl(a[c]);else for(a=a.iterator;a.next();)this.Xl(a.value)}; +t.Zz=function(a){""===this.linkKeyProperty&&v("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed.");if(a!==this.linkDataArray&&Ha(a)){var b=this.ll;b.clear();b.addAll(this.wb.iteratorKeys);var c=this.jl;c.clear();for(var d=a.length,e=0;e<d;e++){var f=a[e],g=this.Ac(f);if(void 0!==g){c.add(g);var h=this.kh(g);h!==f&&(null!==h?(this.to(h,f),Tr(this,f,h)):(f=this.cloneDeep(f),this.xs(f,g),this.ji(f)))}else g=this.cloneDeep(f),this.ji(g),c.add(this.Ac(g))}for(a= +b.iterator;a.next();)d=a.value,c.contains(d)||(d=this.kh(d))&&this.Xl(d);b.clear();c.clear()}};function Vr(a,b){var c=lr(a,b,!0);c=a.Rl(c);null===a.ic(c)&&sr(a,c,b);c=lr(a,b,!1);c=a.Rl(c);null===a.ic(c)&&sr(a,c,b);var d=a.Hf(b);if(Array.isArray(d))for(var e=d.length,f=0;f<e;f++)c=d[f],null===a.ic(c)&&sr(a,c,b)} +t.zo=function(a){if(null===a)return null;var b=this.Bk;a=null!==b?b(a,this):Nr(this,a,!0);Ga(a)&&(Za(a),""!==this.lf&&bk(a,this.lf,void 0),""!==this.mf&&bk(a,this.mf,void 0),""!==this.ie&&bk(a,this.ie,[]));return a};t.hs=function(a){if(null===a)return!1;var b=this.kl;return""===b?!1:En(a,b)?!0:!1};t.mh=function(a){if(null!==a){var b=this.Je;if(""!==b&&(b=En(a,b),void 0!==b)){if(nr(b))return b;v("GroupKey value for node data "+a+" is not a number or a string: "+b)}}}; +t.bp=function(a,b){null===b&&(b=void 0);void 0===b||nr(b)||Aa(b,"number or string",Rr,"setGroupKeyForNodeData:key");if(null!==a){var c=this.Je;if(""!==c)if(this.hb(a)){var d=En(a,c);d!==b&&(rr(this,d,a),bk(a,c,b),null===this.ic(b)&&sr(this,b,a),Lr(this,"nodeGroupKey",qe,c,a,d,b),"string"===typeof c&&this.Pa(a,c))}else bk(a,c,b)}}; +Rr.prototype.copyNodeData=function(a){if(null===a)return null;a=X.prototype.copyNodeData.call(this,a);this.Pj||""===this.Je||void 0===En(a,this.Je)||bk(a,this.Je,void 0);return a}; +Rr.prototype.setDataProperty=function(a,b,c){G&&(A(a,"object",Rr,"setDataProperty:data"),A(b,"string",Rr,"setDataProperty:propname"),""===b&&v("GraphLinksModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.hb(a)){if(b===this.nodeKeyProperty){this.fm(a,c);return}if(b===this.nodeCategoryProperty){this.em(a,c);return}if(b===this.nodeGroupKeyProperty){this.bp(a,c);return}G&&b===this.nodeIsGroupProperty&&v("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: "+ +b)}else if(this.Jc(a)){if(b===this.linkFromKeyProperty){tr(this,a,c,!0);return}if(b===this.linkToKeyProperty){tr(this,a,c,!1);return}if(b===this.linkFromPortIdProperty){ur(this,a,c,!0);return}if(b===this.linkToPortIdProperty){ur(this,a,c,!1);return}if(b===this.linkKeyProperty){this.xs(a,c);return}if(b===this.linkCategoryProperty){this.ap(a,c);return}if(b===this.linkLabelKeysProperty){this.ys(a,c);return}}var d=En(a,b);d!==c&&(bk(a,b,c),this.ts(a,b,d,c))};t=Rr.prototype; +t.to=function(a,b){if(b){var c=this.hb(a),d=this.Jc(a),e;for(e in b)"__gohashid"===e||c&&e===this.nodeKeyProperty||c&&e===this.nodeIsGroupProperty&&En(a,e)===b[e]||d&&e===this.linkKeyProperty||this.setDataProperty(a,e,b[e])}}; +t.Zo=function(a,b){X.prototype.Zo.call(this,a,b);for(var c=this.rb.iterator;c.next();)this.mv(c.value,a,b);for(c=this.cg.iterator;c.next();){var d=c.value,e=a,f=b;if(lr(this,d,!0)===e){var g=this.lf;bk(d,g,f);Lr(this,"linkFromKey",qe,g,d,e,f);"string"===typeof g&&this.Pa(d,g)}lr(this,d,!1)===e&&(g=this.mf,bk(d,g,f),Lr(this,"linkToKey",qe,g,d,e,f),"string"===typeof g&&this.Pa(d,g));g=this.Hf(d);if(Array.isArray(g))for(var h=g.length,k=this.ie,l=0;l<h;l++)g[l]===e&&(g[l]=f,Lr(this,"linkLabelKeys",se, +k,d,e,f,l,l))}};t.mv=function(a,b,c){if(this.mh(a)===b){var d=this.Je;bk(a,d,c);Lr(this,"nodeGroupKey",qe,d,a,b,c);"string"===typeof d&&this.Pa(a,d)}};t.Cv=function(){X.prototype.Cv.call(this);for(var a=this.linkDataArray,b=a.length,c=0;c<b;c++)Vr(this,a[c])}; +t.am=function(a){X.prototype.am.call(this,a);a=this.Ba(a);var b=qr(this,a);if(null!==b){var c=Na();for(b=b.iterator;b.next();){var d=b.value;if(this.hb(d)){if(this.mh(d)===a){var e=this.Je;Lr(this,"nodeGroupKey",qe,e,d,a,a);"string"===typeof e&&this.Pa(d,e);c.push(d)}}else if(lr(this,d,!0)===a&&(e=this.lf,Lr(this,"linkFromKey",qe,e,d,a,a),"string"===typeof e&&this.Pa(d,e),c.push(d)),lr(this,d,!1)===a&&(e=this.mf,Lr(this,"linkToKey",qe,e,d,a,a),"string"===typeof e&&this.Pa(d,e),c.push(d)),e=this.Hf(d), +Array.isArray(e))for(var f=e.length,g=this.ie,h=0;h<f;h++)e[h]===a&&(Lr(this,"linkLabelKeys",se,g,d,a,a,h,h),c.push(d))}for(b=0;b<c.length;b++)rr(this,a,c[b]);Pa(c)}};t.$l=function(a){X.prototype.$l.call(this,a);var b=this.mh(a);null===this.ic(b)&&sr(this,b,a)};t.gp=function(a){X.prototype.gp.call(this,a);var b=this.mh(a);rr(this,b,a)}; +t.Zr=function(a){if(null===a)return"";var b=this.lj;if(""===b)return"";b=En(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v("getCategoryForLinkData found a non-string category for "+a+": "+b)};Rr.prototype.getLinkCategoryForData=function(a){return this.Zr(a)}; +Rr.prototype.ap=function(a,b){A(b,"string",Rr,"setCategoryForLinkData:cat");if(null!==a){var c=this.lj;if(""!==c)if(this.Jc(a)){var d=En(a,c);void 0===d&&(d="");d!==b&&(bk(a,c,b),Lr(this,"linkCategory",qe,c,a,d,b),"string"===typeof c&&this.Pa(a,c))}else bk(a,c,b)}};Rr.prototype.setLinkCategoryForData=function(a,b){this.ap(a,b)};t=Rr.prototype;t.gm=function(a,b){X.prototype.gm.call(this,a,b);this.bp(b,this.mh(a))}; +function Tr(a,b,c){a.ap(c,a.Zr(b));a.qv(c,a.sx(b));a.uv(c,a.vx(b));a.ys(c,a.Hf(b));a.rv(c,a.tx(b));a.vv(c,a.wx(b))}t.$j=function(){return!0};t.yi=function(){return!0};t.ks=function(){return!0};t.wi=function(){return!0}; +oa.Object.defineProperties(Rr.prototype,{archetypeNodeData:{configurable:!0,get:function(){return this.Yi},set:function(a){var b=this.Yi;b!==a&&(null!==a&&A(a,"object",Rr,"archetypeNodeData"),this.Yi=a,this.g("archetypeNodeData",b,a))}},linkFromKeyProperty:{configurable:!0,get:function(){return this.lf},set:function(a){var b=this.lf;b!==a&&(Mr(a,Rr,"linkFromKeyProperty"),this.lf=a,this.g("linkFromKeyProperty",b,a))}},linkToKeyProperty:{configurable:!0,get:function(){return this.mf}, +set:function(a){var b=this.mf;b!==a&&(Mr(a,Rr,"linkToKeyProperty"),this.mf=a,this.g("linkToKeyProperty",b,a))}},linkFromPortIdProperty:{configurable:!0,get:function(){return this.mj},set:function(a){var b=this.mj;b!==a&&(Mr(a,Rr,"linkFromPortIdProperty"),!G||a!==this.linkFromKeyProperty&&a!==this.linkToKeyProperty||v("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.mj=a,this.g("linkFromPortIdProperty",b,a))}}, +linkToPortIdProperty:{configurable:!0,get:function(){return this.nj},set:function(a){var b=this.nj;b!==a&&(Mr(a,Rr,"linkToPortIdProperty"),!G||a!==this.linkFromKeyProperty&&a!==this.linkToKeyProperty||v("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.nj=a,this.g("linkToPortIdProperty",b,a))}},linkLabelKeysProperty:{configurable:!0,get:function(){return this.ie},set:function(a){var b=this.ie;b!== +a&&(Mr(a,Rr,"linkLabelKeysProperty"),this.ie=a,this.g("linkLabelKeysProperty",b,a))}},linkDataArray:{configurable:!0,get:function(){return this.ld},set:function(a){var b=this.ld;if(b!==a){Ia(a,Rr,"linkDataArray");this.wb.clear();for(var c=a.length,d=0;d<c;d++){var e=a[d];Ga(e)||v("GraphLinksModel.linkDataArray must only contain Objects, not: "+e);nb(e)}this.ld=a;if(""!==this.linkKeyProperty){d=new H;for(e=0;e<c;e++){var f=a[e],g=this.Ac(f);void 0===g?d.add(f):null!==this.wb.L(g)?d.add(f): +this.wb.add(g,f)}for(d=d.iterator;d.next();)e=d.value,this.os(e),f=this.Ac(e),void 0!==f&&this.wb.add(f,e)}d=new I;for(e=0;e<c;e++)d.add(a[e]);this.cg=d;Lr(this,"linkDataArray",qe,"linkDataArray",this,b,a);for(b=0;b<c;b++)Vr(this,a[b])}}},linkKeyProperty:{configurable:!0,get:function(){return this.Nh},set:function(a){var b=this.Nh;if(b!==a){Mr(a,Rr,"linkKeyProperty");this.Nh=a;this.wb.clear();for(var c=this.linkDataArray.length,d=0;d<c;d++){var e=this.linkDataArray[d],f=this.Ac(e);void 0=== +f&&(this.os(e),f=this.Ac(e));void 0!==f&&this.wb.add(f,e)}this.g("linkKeyProperty",b,a)}}},makeUniqueLinkKeyFunction:{configurable:!0,get:function(){return this.el},set:function(a){var b=this.el;b!==a&&(null!==a&&A(a,"function",Rr,"makeUniqueLinkKeyFunction"),this.el=a,this.g("makeUniqueLinkKeyFunction",b,a))}},copyLinkDataFunction:{configurable:!0,get:function(){return this.Bk},set:function(a){var b=this.Bk;b!==a&&(null!==a&&A(a,"function",Rr,"copyLinkDataFunction"),this.Bk= +a,this.g("copyLinkDataFunction",b,a))}},nodeIsGroupProperty:{configurable:!0,get:function(){return this.kl},set:function(a){var b=this.kl;b!==a&&(Mr(a,Rr,"nodeIsGroupProperty"),this.kl=a,this.g("nodeIsGroupProperty",b,a))}},nodeGroupKeyProperty:{configurable:!0,get:function(){return this.Je},set:function(a){var b=this.Je;b!==a&&(Mr(a,Rr,"nodeGroupKeyProperty"),this.Je=a,this.g("nodeGroupKeyProperty",b,a))}},Pj:{configurable:!0,get:function(){return this.Gm}, +set:function(a){this.Gm!==a&&(A(a,"boolean",Rr,"copiesGroupKeyOfNodeData"),this.Gm=a)}},linkCategoryProperty:{configurable:!0,get:function(){return this.lj},set:function(a){var b=this.lj;b!==a&&(Mr(a,Rr,"linkCategoryProperty"),this.lj=a,this.g("linkCategoryProperty",b,a))}},type:{configurable:!0,get:function(){return"GraphLinksModel"}}});Rr.prototype.setCategoryForLinkData=Rr.prototype.ap;Rr.prototype.getCategoryForLinkData=Rr.prototype.Zr; +Rr.prototype.assignAllDataProperties=Rr.prototype.to;Rr.prototype.setGroupKeyForNodeData=Rr.prototype.bp;Rr.prototype.getGroupKeyForNodeData=Rr.prototype.mh;Rr.prototype.isGroupForNodeData=Rr.prototype.hs;Rr.prototype.copyLinkData=Rr.prototype.zo;Rr.prototype.mergeLinkDataArray=Rr.prototype.Zz;Rr.prototype.removeLinkDataCollection=Rr.prototype.kA;Rr.prototype.removeLinkData=Rr.prototype.Xl;Rr.prototype.addLinkDataCollection=Rr.prototype.Cy;Rr.prototype.addLinkData=Rr.prototype.ji; +Rr.prototype.containsLinkData=Rr.prototype.Jc;Rr.prototype.makeLinkDataKeyUnique=Rr.prototype.os;Rr.prototype.findLinkDataForKey=Rr.prototype.kh;Rr.prototype.setKeyForLinkData=Rr.prototype.xs;Rr.prototype.getKeyForLinkData=Rr.prototype.Ac;Rr.prototype.removeLabelKeyForLinkData=Rr.prototype.Ox;Rr.prototype.addLabelKeyForLinkData=Rr.prototype.uu;Rr.prototype.setLabelKeysForLinkData=Rr.prototype.ys;Rr.prototype.getLabelKeysForLinkData=Rr.prototype.Hf;Rr.prototype.setToPortIdForLinkData=Rr.prototype.vv; +Rr.prototype.getToPortIdForLinkData=Rr.prototype.wx;Rr.prototype.setFromPortIdForLinkData=Rr.prototype.rv;Rr.prototype.getFromPortIdForLinkData=Rr.prototype.tx;Rr.prototype.setToKeyForLinkData=Rr.prototype.uv;Rr.prototype.getToKeyForLinkData=Rr.prototype.vx;Rr.prototype.setFromKeyForLinkData=Rr.prototype.qv;Rr.prototype.getFromKeyForLinkData=Rr.prototype.sx;Rr.prototype.clear=Rr.prototype.clear;var Ur=Object.freeze([]);Rr.className="GraphLinksModel";Pr.GraphLinksModel=Rr; +X.constructGraphLinksModel=X.constructGraphLinksModel=function(){return new Rr};X.initDiagramModel=Bi=function(){return new Rr};function Wr(a,b){X.call(this);this.Ke="parent";this.Im=!1;this.vj="parentLinkCategory";void 0!==a&&(Ha(a)?this.nodeDataArray=a:Object.assign(this,a));b&&Object.assign(this,b)}na(Wr,X);Wr.constructGraphLinksModel=X.constructGraphLinksModel;Wr.prototype.cloneProtected=function(a){X.prototype.cloneProtected.call(this,a);a.Ke=this.Ke;a.Im=this.Im;a.vj=this.vj};t=Wr.prototype; +t.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.cp();var b=(""!==this.name?this.name:"")+" TreeModel";if(0<a){b+="\n node data:";a=this.nodeDataArray;for(var c=a.length,d=0;d<c;d++){var e=a[d];b+=" "+this.Ba(e)+":"+Ra(e)}}return b};t.nm=function(){var a=X.prototype.nm.call(this),b="";"parent"!==this.nodeParentKeyProperty&&"string"===typeof this.nodeParentKeyProperty&&(b+=',\n "nodeParentKeyProperty": '+this.quote(this.nodeParentKeyProperty));return a+b}; +t.Vo=function(a){X.prototype.Vo.call(this,a);a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)};t.Uo=function(a){void 0!==a.nodeParentKeyProperty&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&v("applyIncrementalJson cannot change Model properties");X.prototype.Uo.call(this,a)};t.Rl=function(a){return a}; +t.nh=function(a){if(null!==a){var b=this.Ke;if(""!==b&&(b=En(a,b),void 0!==b)){if(nr(b))return b;v("ParentKey value for node data "+a+" is not a number or a string: "+b)}}}; +t.qe=function(a,b){null===b&&(b=void 0);void 0===b||nr(b)||Aa(b,"number or string",Wr,"setParentKeyForNodeData:key");if(null!==a){var c=this.Ke;if(""!==c)if(b=this.Rl(b),this.hb(a)){var d=En(a,c);d!==b&&(rr(this,d,a),bk(a,c,b),null===this.ic(b)&&sr(this,b,a),Lr(this,"nodeParentKey",qe,c,a,d,b),"string"===typeof c&&this.Pa(a,c))}else bk(a,c,b)}}; +t.cs=function(a){if(null===a)return"";var b=this.vj;if(""===b)return"";b=En(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+b);return""};Wr.prototype.getLinkCategoryForData=function(a){return this.cs(a)}; +Wr.prototype.zs=function(a,b){A(b,"string",Wr,"setParentLinkCategoryForNodeData:cat");if(null!==a){var c=this.vj;if(""!==c)if(this.hb(a)){var d=En(a,c);void 0===d&&(d="");d!==b&&(bk(a,c,b),Lr(this,"parentLinkCategory",qe,c,a,d,b),"string"===typeof c&&this.Pa(a,c))}else bk(a,c,b)}};Wr.prototype.setLinkCategoryForData=function(a,b){this.zs(a,b)}; +Wr.prototype.copyNodeData=function(a){if(null===a)return null;a=X.prototype.copyNodeData.call(this,a);this.Qj||""===this.Ke||void 0===En(a,this.Ke)||bk(a,this.Ke,void 0);return a}; +Wr.prototype.setDataProperty=function(a,b,c){G&&(A(a,"object",Wr,"setDataProperty:data"),A(b,"string",Wr,"setDataProperty:propname"),""===b&&v("TreeModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.hb(a)){if(b===this.nodeKeyProperty){this.fm(a,c);return}if(b===this.nodeCategoryProperty){this.em(a,c);return}if(b===this.nodeParentKeyProperty){this.qe(a,c);return}}var d=En(a,b);d!==c&&(bk(a,b,c),this.ts(a,b,d,c))};t=Wr.prototype; +t.Zo=function(a,b){X.prototype.Zo.call(this,a,b);for(var c=this.rb.iterator;c.next();)this.mv(c.value,a,b)};t.mv=function(a,b,c){if(this.nh(a)===b){var d=this.Ke;bk(a,d,c);Lr(this,"nodeParentKey",qe,d,a,b,c);"string"===typeof d&&this.Pa(a,d)}}; +t.am=function(a){X.prototype.am.call(this,a);a=this.Ba(a);var b=qr(this,a);if(null!==b){var c=Na();for(b=b.iterator;b.next();){var d=b.value;if(this.hb(d)&&this.nh(d)===a){var e=this.Ke;Lr(this,"nodeParentKey",qe,e,d,a,a);"string"===typeof e&&this.Pa(d,e);c.push(d)}}for(b=0;b<c.length;b++)rr(this,a,c[b]);Pa(c)}};t.$l=function(a){X.prototype.$l.call(this,a);var b=this.nh(a);b=this.Rl(b);null===this.ic(b)&&sr(this,b,a)};t.gp=function(a){X.prototype.gp.call(this,a);var b=this.nh(a);rr(this,b,a)}; +t.gm=function(a,b){X.prototype.gm.call(this,a,b);this.zs(b,this.cs(a));this.qe(b,this.nh(a))};t.Pl=function(){return!0};t.ks=function(){return!0}; +oa.Object.defineProperties(Wr.prototype,{nodeParentKeyProperty:{configurable:!0,get:function(){return this.Ke},set:function(a){var b=this.Ke;b!==a&&(Mr(a,Wr,"nodeParentKeyProperty"),this.Ke=a,this.g("nodeParentKeyProperty",b,a))}},Qj:{configurable:!0,get:function(){return this.Im},set:function(a){this.Im!==a&&(A(a,"boolean",Wr,"copiesParentKeyOfNodeData"),this.Im=a)}},parentLinkCategoryProperty:{configurable:!0,get:function(){return this.vj},set:function(a){var b= +this.vj;b!==a&&(Mr(a,Wr,"parentLinkCategoryProperty"),this.vj=a,this.g("parentLinkCategoryProperty",b,a))}},linkCategoryProperty:{configurable:!0,get:function(){return this.parentLinkCategoryProperty},set:function(a){this.parentLinkCategoryProperty=a}},type:{configurable:!0,get:function(){return"TreeModel"}}});Wr.prototype.setParentLinkCategoryForNodeData=Wr.prototype.zs;Wr.prototype.getParentLinkCategoryForNodeData=Wr.prototype.cs; +Wr.prototype.setParentKeyForNodeData=Wr.prototype.qe;Wr.prototype.getParentKeyForNodeData=Wr.prototype.nh;Wr.className="TreeModel";Pr.TreeModel=Wr;function Xr(a){Di.call(this);this.dw=this.Um=this.nc=0;this.Mp=360;this.cw=Yr;this.$i=0;this.Rv=new K;this.Ap=this.me=0;this.Jr=new Zr;this.Vs=this.uj=0;this.sy=600;this.Un=NaN;this.xm=1;this.ho=0;this.wl=360;this.Tb=Yr;this.O=$r;this.md=as;this.ed=Pq;this.uf=6;this.Gn=bs;a&&Object.assign(this,a)}na(Xr,Di); +Xr.prototype.cloneProtected=function(a){Di.prototype.cloneProtected.call(this,a);a.Un=this.Un;a.xm=this.xm;a.ho=this.ho;a.wl=this.wl;a.Tb=this.Tb;a.O=this.O;a.md=this.md;a.ed=this.ed;a.uf=this.uf;a.Gn=this.Gn}; +Xr.prototype.ub=function(a){if(a.classType===Xr)if(a===cs||a===ds||a===es||a===fs||a===as)this.sorting=a;else if(a===gs||a===hs||a===$r||a===is)this.direction=a;else if(a===js||a===ks||a===Yr||a===ls)this.arrangement=a;else{if(a===ms||a===bs)this.nodeDiameterFormula=a}else Di.prototype.ub.call(this,a)};Xr.prototype.createNetwork=function(){return new ns(this)}; +Xr.prototype.doLayout=function(a){G&&null===a&&v("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);a=this.network.vertexes;if(1>=a.count)1===a.count&&(a=a.first(),a.centerX=0,a.centerY=0);else{var b=new H;b.addAll(a.iterator);a=new H;var c=new H;var d=this.sort(b);var e,f,g=this.Ap;var h=this.arrangement;var k=this.nodeDiameterFormula; +var l=this.radius;if(!isFinite(l)||0>=l)l=NaN;var m=this.aspectRatio;if(!isFinite(m)||0>=m)m=1;var n=this.startAngle;isFinite(n)||(n=0);var p=this.sweepAngle;if(!isFinite(p)||360<p||1>p)p=360;b=this.spacing;isFinite(b)||(b=NaN);h===ls&&k===ms?h=Yr:h===ls&&k!==ms&&(h=this.arrangement);if((this.direction===gs||this.direction===hs)&&this.sorting!==as){for(k=0;!(k>=d.length);k+=2){a.add(d.N(k));if(k+1>=d.length)break;c.add(d.N(k+1))}this.direction===gs?(this.arrangement===ls&&a.reverse(),d=new H,d.addAll(a), +d.addAll(c)):(this.arrangement===ls&&c.reverse(),d=new H,d.addAll(c),d.addAll(a))}k=d.length;for(var r=f=e=0;r<d.length;r++){var q=n+p*f*(this.direction===$r?1:-1)/k,u=d.N(r).diameter;isNaN(u)&&(u=os(d.N(r),q));360>p&&(0===r||r===d.length-1)&&(u/=2);e+=u;f++}if(isNaN(l)||h===ls){isNaN(b)&&(b=6);if(h!==Yr&&h!==ls){f=-Infinity;for(g=0;g<k;g++)r=d.N(g),e=d.N(g===k-1?0:g+1),isNaN(r.diameter)&&os(r,0),isNaN(e.diameter)&&os(e,0),f=Math.max(f,(r.diameter+e.diameter)/2);g=f+b;h===js?l=(f+b)/(2*Math.PI/k): +l=ps(this,g*(360<=p?k:k-1),m,n*Math.PI/180,p*Math.PI/180)}else l=ps(this,e+(360<=p?k:k-1)*(h!==ls?b:1.6*b),m,n*Math.PI/180,p*Math.PI/180);f=l*m}else if(f=l*m,r=qs(this,l,f,n*Math.PI/180,p*Math.PI/180),isNaN(b)){if(h===Yr||h===ls)b=(r-e)/(360<=p?k:k-1)}else if(h===Yr||h===ls)r=(r-e)/(360<=p?k:k-1),r<b?(l=ps(this,e+b*(360<=p?k:k-1),m,n*Math.PI/180,p*Math.PI/180),f=l*m):b=r;else{g=-Infinity;for(e=0;e<k;e++)q=d.N(e),u=d.N(e===k-1?0:e+1),isNaN(q.diameter)&&os(q,0),isNaN(u.diameter)&&os(u,0),g=Math.max(g, +(q.diameter+u.diameter)/2);g+=b;e=ps(this,g*(360<=p?k:k-1),m,n*Math.PI/180,p*Math.PI/180);e>l?(l=e,f=l*m):g=r/(360<=p?k:k-1)}this.cw=h;this.nc=l;this.Um=m;this.dw=n;this.Mp=p;this.$i=b;this.me=f;this.Ap=g;b=d;d=this.cw;h=this.nc;l=this.dw;m=this.Mp;n=this.$i;p=this.me;k=this.Ap;if(this.direction!==gs&&this.direction!==hs||d!==ls)if(this.direction===gs||this.direction===hs){g=0;switch(d){case ks:g=180*rs(this,h,p,l,k)/Math.PI;break;case Yr:k=b=0;g=a.first();null!==g&&(b=os(g,Math.PI/2));g=c.first(); +null!==g&&(k=os(g,Math.PI/2));g=180*rs(this,h,p,l,n+(b+k)/2)/Math.PI;break;case js:g=m/b.length}if(this.direction===gs){switch(d){case ks:ss(this,a,l,is);break;case Yr:ts(this,a,l,is);break;case js:us(this,a,m/2,l,is)}switch(d){case ks:ss(this,c,l+g,$r);break;case Yr:ts(this,c,l+g,$r);break;case js:us(this,c,m/2,l+g,$r)}}else{switch(d){case ks:ss(this,c,l,is);break;case Yr:ts(this,c,l,is);break;case js:us(this,c,m/2,l,is)}switch(d){case ks:ss(this,a,l+g,$r);break;case Yr:ts(this,a,l+g,$r);break;case js:us(this, +a,m/2,l+g,$r)}}}else switch(d){case ks:ss(this,b,l,this.direction);break;case Yr:ts(this,b,l,this.direction);break;case js:us(this,b,m,l,this.direction);break;case ls:vs(this,b,m,l,this.direction)}else vs(this,b,m,l-m/2,$r)}this.updateParts();this.network=null;this.isValidLayout=!0}; +function us(a,b,c,d,e){var f=a.Mp,g=a.nc;a=a.me;d=d*Math.PI/180;c=c*Math.PI/180;for(var h=b.length,k=0;k<h;k++){var l=d+(e===$r?k*c/(360<=f?h:h-1):-(k*c)/h),m=b.N(k),n=g*Math.tan(l)/a;n=Math.sqrt((g*g+a*a*n*n)/(1+n*n));m.centerX=n*Math.cos(l);m.centerY=n*Math.sin(l);m.actualAngle=180*l/Math.PI}} +function ts(a,b,c,d){var e=a.nc,f=a.me,g=a.$i;c=c*Math.PI/180;for(var h=b.length,k=0;k<h;k++){var l=b.N(k),m=b.N(k===h-1?0:k+1),n=f*Math.sin(c);l.centerX=e*Math.cos(c);l.centerY=n;l.actualAngle=180*c/Math.PI;isNaN(l.diameter)&&os(l,0);isNaN(m.diameter)&&os(m,0);l=rs(a,e,f,d===$r?c:-c,(l.diameter+m.diameter)/2+g);c+=d===$r?l:-l}} +function ss(a,b,c,d){var e=a.nc,f=a.me,g=a.Ap;c=c*Math.PI/180;for(var h=b.length,k=0;k<h;k++){var l=b.N(k);l.centerX=e*Math.cos(c);l.centerY=f*Math.sin(c);l.actualAngle=180*c/Math.PI;l=rs(a,e,f,d===$r?c:-c,g);c+=d===$r?l:-l}}function vs(a,b,c,d,e){var f=a.Mp;a.uj=0;a.Jr=new Zr;if(360>c){for(f=d+(e===$r?f:-f);0>f;)f+=360;f%=360;180<f&&(f-=360);f*=Math.PI/180;a.Vs=f;ws(a,b,c,d,e)}else xs(a,b,c,d,e);a.Jr.commit(b)} +function xs(a,b,c,d,e){var f=a.nc,g=a.$i,h=a.Um,k=f*Math.cos(d*Math.PI/180),l=a.me*Math.sin(d*Math.PI/180),m=b.Ka();if(3===m.length)m[0].centerX=f,m[0].centerY=0,m[1].centerX=m[0].centerX-m[0].width/2-m[1].width/2-g,m[1].y=m[0].y,m[2].centerX=(m[0].centerX+m[1].centerX)/2,m[2].y=m[0].y-m[2].height-g;else if(4===m.length)m[0].centerX=f,m[0].centerY=0,m[2].centerX=-m[0].centerX,m[2].centerY=m[0].centerY,m[1].centerX=0,m[1].y=Math.min(m[0].y,m[2].y)-m[1].height-g,m[3].centerX=0,m[3].y=Math.max(m[0].y+ +m[0].height+g,m[2].y+m[2].height+g);else{f=K.alloc();for(var n=0;n<m.length;n++){m[n].centerX=k;m[n].centerY=l;if(n>=m.length-1)break;ys(a,k,l,m,n,e,f)||zs(a,k,l,m,n,e,f);k=f.x;l=f.y}K.free(f);a.uj++;if(!(23<a.uj)){k=m[0].centerX;l=m[0].centerY;f=m[m.length-1].centerX;n=m[m.length-1].centerY;var p=Math.abs(k-f)-((m[0].width+m[m.length-1].width)/2+g),r=Math.abs(l-n)-((m[0].height+m[m.length-1].height)/2+g);g=0;1>Math.abs(r)?Math.abs(k-f)<(m[0].width+m[m.length-1].width)/2&&(g=0):g=0<r?r:1>Math.abs(p)? +0:p;k=Math.abs(f)>Math.abs(n)?0<f!==l>n:0<n!==k<f;if(k=e===$r?k:!k)g=-Math.abs(g),g=Math.min(g,-m[m.length-1].width),g=Math.min(g,-m[m.length-1].height);a.Jr.compare(g,m);1<Math.abs(g)&&(a.nc=8>a.uj?a.nc-g/(2*Math.PI):5>m.length&&10<g?a.nc/2:a.nc-(0<g?1.7:-2.3),a.me=a.nc*h,xs(a,b,c,d,e))}}} +function ws(a,b,c,d,e){for(var f=a.nc,g=a.me,h=a.Um,k=f*Math.cos(d*Math.PI/180),l=g*Math.sin(d*Math.PI/180),m=K.alloc(),n=b.Ka(),p=0;p<n.length;p++){n[p].centerX=k;n[p].centerY=l;if(p>=n.length-1)break;ys(a,k,l,n,p,e,m)||zs(a,k,l,n,p,e,m);k=m.x;l=m.y}K.free(m);a.uj++;if(!(23<a.uj)){k=Math.atan2(l,k);k=e===$r?a.Vs-k:k-a.Vs;k=Math.abs(k)<Math.abs(k-2*Math.PI)?k:k-2*Math.PI;f=k*(f+g)/2;g=a.Jr;if(Math.abs(f)<Math.abs(g.Ll))for(g.Ll=f,g.pk=[],g.pm=[],k=0;k<n.length;k++)g.pk[k]=n[k].bounds.x,g.pm[k]=n[k].bounds.y; +1<Math.abs(f)&&(a.nc=8>a.uj?a.nc-f/(2*Math.PI):a.nc-(0<f?1.7:-2.3),a.me=a.nc*h,ws(a,b,c,d,e))}}function ys(a,b,c,d,e,f,g){var h=a.nc,k=a.me,l=0;a=(d[e].width+d[e+1].width)/2+a.$i;var m=!1;if(0<=c!==(f===$r)){if(f=b+a,f>h){f=b-a;if(f<-h)return g.x=f,g.y=l,!1;m=!0}}else if(f=b-a,f<-h){f=b+a;if(f>h)return g.x=f,g.y=l,!1;m=!0}l=Math.sqrt(1-Math.min(1,f*f/(h*h)))*k;0>c!==m&&(l=-l);if(Math.abs(c-l)>(d[e].height+d[e+1].height)/2)return g.x=f,g.y=l,!1;g.x=f;g.y=l;return!0} +function zs(a,b,c,d,e,f,g){var h=a.nc,k=a.me,l=0;a=(d[e].height+d[e+1].height)/2+a.$i;d=!1;if(0<=b!==(f===$r)){if(f=c-a,f<-k){f=c+a;if(f>k){g.x=l;g.y=f;return}d=!0}}else if(f=c+a,f>k){f=c-a;if(f<-k){g.x=l;g.y=f;return}d=!0}l=Math.sqrt(1-Math.min(1,f*f/(k*k)))*h;0>b!==d&&(l=-l);g.x=l;g.y=f}Xr.prototype.commitLayout=function(){this.commitNodes();this.isRouting&&this.commitLinks()}; +Xr.prototype.commitNodes=function(){var a=null!==this.group&&null!==this.group.placeholder&&this.group.isSubGraphExpanded,b=a?this.group.location.copy():null,c=this.actualCenter;a?c=new K(0,0):(c.x=this.arrangementOrigin.x+this.nc,c.y=this.arrangementOrigin.y+this.me);for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;e.x+=c.x;e.y+=c.y;e.commit()}a&&(this.group.eb(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.re(c.re(a)),this.group.move(b),this.Rv=b.re(a))}; +Xr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function qs(a,b,c,d,e){var f=a.sy;if(.001>Math.abs(a.Um-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;var g=0;var h=void 0!==d&&void 0!==e?e/(f+1):Math.PI/(2*(f+1));for(var k=0,l=0;l<=f;l++){void 0!==d&&void 0!==e?k=d+l*e/f:k=l*Math.PI/(2*f);var m=Math.sin(k);g+=Math.sqrt(1-a*a*m*m)*h}return void 0!==d&&void 0!==e?(b>c?b:c)*g:4*(b>c?b:c)*g} +function ps(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?qs(a,1,c,d,e):qs(a,1,c))}function rs(a,b,c,d,e){if(.001>Math.abs(a.Um-1))return e/b;var f=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,g=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var h=0;;h++){var k=Math.sin(d+h*a);g+=(b>c?b:c)*Math.sqrt(1-f*f*k*k)*a;if(g>=e)return h*a}} +Xr.prototype.sort=function(a){switch(this.sorting){case es:break;case fs:a.reverse();break;case cs:a.sort(this.comparer);break;case ds:a.sort(this.comparer);a.reverse();break;case as:return this.gk(As(a));default:v("Invalid sorting type.")}return a}; +function As(a){for(var b=[],c=0;c<a.length;c++)b.push(0);c=new H;for(var d=0;d<a.length;d++){var e=-1,f=-1;if(0===d)for(var g=0;g<a.length;g++){var h=a.N(g).edgesCount;h>e&&(e=h,f=g)}else for(g=0;g<a.length;g++)h=b[g],h>e&&(e=h,f=g);c.add(a.N(f));b[f]=-1;f=a.N(f);for(g=f.sourceEdges;g.next();)e=a.indexOf(g.value.fromVertex),0>e||0<=b[e]&&b[e]++;for(f=f.destinationEdges;f.next();)e=a.indexOf(f.value.toVertex),0>e||0<=b[e]&&b[e]++}return c} +Xr.prototype.gk=function(a){for(var b=[],c=0;c<a.length;c++){var d=a.N(c);b[c]=[];for(var e,f=d.destinationEdges;f.next();)e=a.indexOf(f.value.toVertex),e!==c&&0>b[c].indexOf(e)&&b[c].push(e);for(d=d.sourceEdges;d.next();)e=a.indexOf(d.value.fromVertex),e!==c&&0>b[c].indexOf(e)&&b[c].push(e)}f=[];for(c=0;c<b.length;c++)f[c]=0;c=[];var g=[],h=[];d=[];e=new H;for(var k=0,l=0;l<b.length;l++){var m=b[l].length;if(1===m)d.push(l);else if(0===m)e.add(a.N(l));else{if(0===k)c.push(l);else{for(var n=m=Infinity, +p=-1,r=[],q=0;q<c.length;q++)0>b[c[q]].indexOf(c[q===c.length-1?0:q+1])&&r.push(q===c.length-1?0:q+1);if(0===r.length)for(q=0;q<c.length;q++)r.push(q);for(q=0;q<r.length;q++){for(var u=r[q],x=b[l],y=0,z=0;z<g.length;z++){var B=f[g[z]],C=f[h[z]];if(B<C){var D=B;B=C}else D=C;if(D<u&&u<=B)for(C=0;C<x.length;C++){var J=x[C];0>c.indexOf(J)||D<f[J]&&f[J]<B||D===f[J]||B===f[J]||y++}else for(C=0;C<x.length;C++)J=x[C],0>c.indexOf(J)||D<f[J]&&f[J]<B&&D!==f[J]&&B!==f[J]&&y++}x=y;for(z=y=0;z<b[l].length;z++)D= +c.indexOf(b[l][z]),0<=D&&(D=Math.abs(u-(D>=u?D+1:D)),y+=D<c.length+1-D?D:c.length+1-D);for(z=0;z<g.length;z++)D=f[g[z]],B=f[h[z]],D>=u&&D++,B>=u&&B++,D>B&&(C=B,B=D,D=C),B-D<(c.length+2)/2===(D<u&&u<=B)&&y++;if(x<m||x===m&&y<n)m=x,n=y,p=u}c.splice(p,0,l);for(m=0;m<c.length;m++)f[c[m]]=m;for(m=0;m<b[l].length;m++)n=b[l][m],0<=c.indexOf(n)&&(g.push(l),h.push(n))}k++}}for(g=c.length;;){f=!0;for(h=0;h<d.length;h++)if(k=d[h],l=b[k][0],m=c.indexOf(l),0<=m){for(p=n=0;p<b[l].length;p++)r=c.indexOf(b[l][p]), +0>r||r===m||(q=r>m?r-m:m-r,n+=r<m!==q>g-q?1:-1);c.splice(0>n?m:m+1,0,k);d.splice(h,1);h--}else f=!1;if(f)break;else c.push(d[0]),d.splice(0,1)}for(b=0;b<c.length;b++)e.add(a.N(c[b]));return e}; +oa.Object.defineProperties(Xr.prototype,{radius:{configurable:!0,get:function(){return this.Un},set:function(a){this.Un!==a&&(A(a,"number",Xr,"radius"),0<a||isNaN(a))&&(this.Un=a,this.F())}},aspectRatio:{configurable:!0,get:function(){return this.xm},set:function(a){this.xm!==a&&(A(a,"number",Xr,"aspectRatio"),0<a&&(this.xm=a,this.F()))}},startAngle:{configurable:!0,get:function(){return this.ho},set:function(a){this.ho!==a&&(A(a,"number",Xr,"startAngle"), +this.ho=a,this.F())}},sweepAngle:{configurable:!0,get:function(){return this.wl},set:function(a){this.wl!==a&&(A(a,"number",Xr,"sweepAngle"),0<a&&360>=a?this.wl=a:this.wl=360,this.F())}},arrangement:{configurable:!0,get:function(){return this.Tb},set:function(a){this.Tb!==a&&(ab(a,Xr,Xr,"arrangement"),a===ls||a===Yr||a===ks||a===js)&&(this.Tb=a,this.F())}},direction:{configurable:!0,get:function(){return this.O},set:function(a){this.O!==a&&(ab(a,Xr,Xr,"direction"), +a===$r||a===is||a===gs||a===hs)&&(this.O=a,this.F())}},sorting:{configurable:!0,get:function(){return this.md},set:function(a){this.md!==a&&(ab(a,Xr,Xr,"sorting"),a===es||a===fs||a===cs||ds||a===as)&&(this.md=a,this.F())}},comparer:{configurable:!0,get:function(){return this.ed},set:function(a){this.ed!==a&&(A(a,"function",Xr,"comparer"),this.ed=a,this.F())}},spacing:{configurable:!0,get:function(){return this.uf},set:function(a){this.uf!==a&&(A(a,"number", +Xr,"spacing"),this.uf=a,this.F())}},nodeDiameterFormula:{configurable:!0,get:function(){return this.Gn},set:function(a){this.Gn!==a&&(ab(a,Xr,Xr,"nodeDiameterFormula"),a===bs||a===ms)&&(this.Gn=a,this.F())}},actualXRadius:{configurable:!0,get:function(){return this.nc}},actualYRadius:{configurable:!0,get:function(){return this.me}},actualSpacing:{configurable:!0,get:function(){return this.$i}},actualCenter:{configurable:!0,get:function(){return this.Rv}}}); +var Yr=new F(Xr,"ConstantSpacing",0),ks=new F(Xr,"ConstantDistance",1),js=new F(Xr,"ConstantAngle",2),ls=new F(Xr,"Packed",3),$r=new F(Xr,"Clockwise",4),is=new F(Xr,"Counterclockwise",5),gs=new F(Xr,"BidirectionalLeft",6),hs=new F(Xr,"BidirectionalRight",7),es=new F(Xr,"Forwards",8),fs=new F(Xr,"Reverse",9),cs=new F(Xr,"Ascending",10),ds=new F(Xr,"Descending",11),as=new F(Xr,"Optimized",12),bs=new F(Xr,"Pythagorean",13),ms=new F(Xr,"Circular",14);Xr.className="CircularLayout";Xr.ConstantSpacing=Yr; +Xr.ConstantDistance=ks;Xr.ConstantAngle=js;Xr.Packed=ls;Xr.Clockwise=$r;Xr.Counterclockwise=is;Xr.BidirectionalLeft=gs;Xr.BidirectionalRight=hs;Xr.Forwards=es;Xr.Reverse=fs;Xr.Ascending=cs;Xr.Descending=ds;Xr.Optimized=as;Xr.Pythagorean=bs;Xr.Circular=ms;function Zr(){this.Ll=-Infinity;this.pm=this.pk=null} +Zr.prototype.compare=function(a,b){if(0<a&&0>this.Ll||Math.abs(a)<Math.abs(this.Ll)&&!(0>a&&0<this.Ll))for(this.Ll=a,this.pk=[],this.pm=[],a=0;a<b.length;a++)this.pk[a]=b[a].bounds.x,this.pm[a]=b[a].bounds.y};Zr.prototype.commit=function(a){if(null!==this.pk&&null!==this.pm)for(var b=0;b<this.pk.length;b++){var c=a.N(b);c.x=this.pk[b];c.y=this.pm[b]}};Zr.className="VertexArrangement";function ns(a){uq.call(this,a)}na(ns,uq);ns.prototype.createVertex=function(){return new Bs(this)}; +ns.prototype.createEdge=function(){return new Cs(this)};ns.className="CircularNetwork";function Bs(a){Iq.call(this,a);this.v=this.Zi=NaN}na(Bs,Iq); +function os(a,b){var c=a.network;if(null===c)return NaN;c=c.layout;if(null===c)return NaN;if(c.arrangement===ls)if(c.nodeDiameterFormula===ms)a.Zi=Math.max(a.width,a.height);else{c=Math.abs(Math.sin(b));b=Math.abs(Math.cos(b));if(0===c)return a.width;if(0===b)return a.height;a.Zi=Math.min(a.height/c,a.width/b)}else a.Zi=c.nodeDiameterFormula===ms?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.Zi} +oa.Object.defineProperties(Bs.prototype,{diameter:{configurable:!0,get:function(){return this.Zi},set:function(a){this.Zi!==a&&(A(a,"number",Bs,"diameter"),this.Zi=a)}},actualAngle:{configurable:!0,get:function(){return this.v},set:function(a){this.v!==a&&(A(a,"number",Bs,"actualAngle"),this.v=a)}}});Bs.className="CircularVertex";function Cs(a){Jq.call(this,a)}na(Cs,Jq);Cs.className="CircularEdge"; +function Ds(a){Di.call(this);this.dh=null;this.tn=0;this.Zd=(new Hb(100,100)).freeze();this.wm=!1;this.tf=!0;this.ud=!1;this.fl=100;this.Vm=1;this.ag=1E3;this.Bn=10;this.Vn=Math;this.Ik=.05;this.Hk=50;this.Fk=150;this.Gk=0;this.Qm=10;this.Pm=5;a&&Object.assign(this,a)}na(Ds,Di); +Ds.prototype.cloneProtected=function(a){Di.prototype.cloneProtected.call(this,a);a.Zd.assign(this.Zd);a.wm=this.wm;a.tf=this.tf;a.ud=this.ud;a.fl=this.fl;a.Vm=this.Vm;a.ag=this.ag;a.Bn=this.Bn;a.Vn=this.Vn;a.Ik=this.Ik;a.Hk=this.Hk;a.Fk=this.Fk;a.Gk=this.Gk;a.Qm=this.Qm;a.Pm=this.Pm}; +Ds.prototype.serializeLayoutProperties=function(a,b){Di.prototype.serializeLayoutProperties.call(this,a,b);a.arrangementSpacing={width:this.arrangementSpacing.width,height:this.arrangementSpacing.height};a.arrangesToOrigin=this.arrangesToOrigin;a.setsPortSpots=this.setsPortSpots;a.comments=this.comments;a.maxIterations=this.maxIterations;a.epsilonDistance=this.epsilonDistance;a.infinityDistance=this.infinityDistance;a.moveLimit=this.moveLimit;a.defaultSpringStiffness=this.defaultSpringStiffness;a.defaultSpringLength= +this.defaultSpringLength;a.defaultElectricalCharge=this.defaultElectricalCharge;a.defaultGravitationalMass=this.defaultGravitationalMass;a.defaultCommentSpringLength=this.defaultCommentSpringLength;a.defaultCommentElectricalCharge=this.defaultCommentElectricalCharge}; +Ds.prototype.deserializeLayoutProperties=function(a,b,c,d,e){Di.prototype.deserializeLayoutProperties.call(this,a,b,c,d,e);this.arrangementSpacing=new Hb(a.arrangementSpacing.width,a.arrangementSpacing.height);this.arrangesToOrigin=a.arrangesToOrigin;this.setsPortSpots=a.setsPortSpots;this.comments=a.comments;this.maxIterations=a.maxIterations;this.epsilonDistance=a.epsilonDistance;this.infinityDistance=a.infinityDistance;this.moveLimit=a.moveLimit;this.defaultSpringStiffness=a.defaultSpringStiffness; +this.defaultSpringLength=a.defaultSpringLength;this.defaultElectricalCharge=a.defaultElectricalCharge;this.defaultGravitationalMass=a.defaultGravitationalMass;this.defaultCommentSpringLength=a.defaultCommentSpringLength;this.defaultCommentElectricalCharge=a.defaultCommentElectricalCharge};Ds.prototype.createNetwork=function(){return new Es(this)}; +Ds.prototype.doLayout=function(a){G&&null===a&&v("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));if(!this.Ev()){a=this.maxIterations;if(0<this.network.vertexes.count){this.network.Ao();for(var b=this.network.vertexes.iterator;b.next();){var c=b.value;c.charge=this.electricalCharge(c);c.mass=this.gravitationalMass(c)}for(b=this.network.edges.iterator;b.next();)c=b.value,c.stiffness=this.springStiffness(c), +c.length=this.springLength(c);this.wu();this.tn=0;if(this.needsClusterLayout()){b=this.network;c=b.Yx();for(var d=c.iterator;d.next();){this.network=d.value;for(var e=this.network.vertexes.iterator;e.next();){var f=e.value;f.Td=f.vertexes.count;f.sh=1;f.Oj=null;f.Xe=null}Fs(this,0,a)}this.network=b;var g=d=c.iterator;G&&w(b,Es,Ds,"arrangeConnectedGraphs:singletons");d=this.arrangementSpacing;var h=g.count,k=!0;f=e=0;for(var l=Na(),m=0;m<h+b.vertexes.count+2;m++)l[m]=null;h=0;g.reset();for(var n=M.alloc();g.next();)if(m= +g.value,this.computeBounds(m,n),k)k=!1,e=n.x+n.width/2,f=n.y+n.height/2,l[0]=new K(n.x+n.width+d.width,n.y),l[1]=new K(n.x,n.y+n.height+d.height),h=2;else{var p=Gs(l,h,e,f,n.width,n.height,d),r=l[p],q=new K(r.x+n.width+d.width,r.y),u=new K(r.x,r.y+n.height+d.height);p+1<h&&l.splice(p+1,0,null);l[p]=q;l[p+1]=u;h++;p=r.x-n.x;r=r.y-n.y;for(m=m.vertexes.iterator;m.next();)q=m.value,q.centerX+=p,q.centerY+=r}M.free(n);for(m=b.vertexes.iterator;m.next();)g=m.value,p=g.bounds,2>h?(e=p.x+p.width/2,f=p.y+ +p.height/2,l[0]=new K(p.x+p.width+d.width,p.y),l[1]=new K(p.x,p.y+p.height+d.height),h=2):(k=Gs(l,h,e,f,p.width,p.height,d),n=l[k],r=new K(n.x+p.width+d.width,n.y),p=new K(n.x,n.y+p.height+d.height),k+1<h&&l.splice(k+1,0,null),l[k]=r,l[k+1]=p,h++,g.centerX=n.x+g.width/2,g.centerY=n.y+g.height/2);Pa(l);for(d=c.iterator;d.next();){c=d.value;for(e=c.vertexes.iterator;e.next();)b.rg(e.value);for(c=c.edges.iterator;c.next();)b.Bl(c.value)}}Hs(this,a);this.updateParts()}this.fl=a;this.network=null;this.isValidLayout= +!0}};Ds.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().bounds,d=this.network.vertexes.iterator;d.next();){if(d.value.bounds.Yc(c)&&(a++,2<a))return!0;if(10<b)break;b++}return!1};Ds.prototype.computeBounds=function(a,b){var c=!0;for(a=a.vertexes.iterator;a.next();){var d=a.value;c?(c=!1,b.set(d.bounds)):b.cd(d.bounds)}return b}; +function Is(a,b,c){G&&(E(b,Ds,"computeClusterLayoutIterations:level"),E(c,Ds,"computeClusterLayoutIterations:maxiter"));return Math.max(Math.min(a.network.vertexes.count,c*(b+1)/11),10)} +function Fs(a,b,c){G&&(E(b,Ds,"layoutClusters:level"),E(c,Ds,"layoutClusters:maxiter"));if(Js(a,b)){var d=a.ag;a.ag*=1+1/(b+1);var e=Ks(a,b),f=Math.max(0,Is(a,b,c));a.maxIterations+=f;Fs(a,b+1,c);Hs(a,f);Ls(a,e,b);c=e.vertexes.Ka();c.sort(function(a,b){return null===a||null===b||a===b?0:b.Td-a.Td});for(e=0;e<c.length;e++)Ms(a,c[e],b);a.ag=d}} +function Js(a,b){G&&E(b,Ds,"hasClusters:level");if(10<b||3>a.network.vertexes.count)return!1;a.dh=a.network.vertexes.Ka();a=a.dh;a.sort(function(a,b){return null===a||null===b||a===b?0:b.Td-a.Td});for(b=a.length-1;0<=b&&1>=a[b].Td;)b--;return 1<a.length-b} +function Ks(a,b){G&&E(b,Ds,"pushSubNetwork:level");for(var c=a.network,d=new Es(a),e=0;e<a.dh.length;e++){var f=a.dh[e];if(1<f.Td){d.rg(f);var g=new Ns;g.Gs=f.Td;g.Hs=f.width;g.Fs=f.height;g.Kv=f.focus.x;g.Lv=f.focus.y;null===f.Xe&&(f.Xe=new H);f.Xe.add(g);f.ov=f.Xe.count-1}else break}for(f=c.edges.iterator;f.next();){var h=f.value;e=h.fromVertex;g=h.toVertex;e.network===d&&g.network===d?d.Bl(h):e.network===d?(h=e.Oj,null===h&&(h=new H,e.Oj=h),h.add(g),e.Td--,e.sh+=g.sh):g.network===d&&(h=g.Oj,null=== +h&&(h=new H,g.Oj=h),h.add(e),g.Td--,g.sh+=e.sh)}for(e=d.edges.iterator;e.next();)f=e.value,f.length*=Math.max(1,L.sqrt((f.fromVertex.sh+f.toVertex.sh)/(4*b+1)));for(b=d.vertexes.iterator;b.next();){e=b.value;var k=e.Oj;if(null!==k&&0<k.count&&(g=e.Xe.N(e.Xe.count-1).Gs-e.Td,!(0>=g))){for(var l=h=0,m=k.count-g;m<k.count;m++){var n=k.N(m),p=null;for(f=n.edges.iterator;f.next();){var r=f.value;if(r.ux(n)===e){p=r;break}}null!==p&&(l+=p.length,h+=n.width*n.height)}f=e.centerX;k=e.centerY;m=e.width;n= +e.height;p=e.focus;r=m*n;1>r&&(r=1);h=L.sqrt((h+r+l*l*4/(g*g))/r);g=(h-1)*m/2;h=(h-1)*n/2;e.bounds=new M(f-p.x-g,k-p.y-h,m+2*g,n+2*h);e.focus=new K(p.x+g,p.y+h)}}a.network=d;return c} +function Ls(a,b,c){G&&(w(b,Es,Ds,"popNetwork:oldnet"),E(c,Ds,"popNetwork:level"));for(c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!==d.Xe){var e=d.Xe.N(d.ov);d.Td=e.Gs;var f=e.Kv,g=e.Lv;d.bounds=new M(d.centerX-f,d.centerY-g,e.Hs,e.Fs);d.focus=new K(f,g);d.ov--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b} +function Ms(a,b,c){G&&(w(b,Os,Ds,"surroundNode:oldnet"),E(c,Ds,"surroundNode:level"));var d=b.Oj;if(null!==d&&0!==d.count){c=b.centerX;var e=b.centerY,f=b.width,g=b.height;null!==b.Xe&&0<b.Xe.count&&(g=b.Xe.N(0),f=g.Hs,g=g.Fs);f=L.sqrt(f*f+g*g)/2;for(var h=!1,k=g=0,l=0,m=b.vertexes.iterator;m.next();){var n=m.value;1>=n.Td?k++:(h=!0,l++,g+=Math.atan2(b.centerY-n.centerY,b.centerX-n.centerX))}if(0!==k)for(0<l&&(g/=l),l=b=0,b=h?2*Math.PI/(k+1):2*Math.PI/k,0===k%2&&(l=b/2),1<d.count&&d.sort(function(a, +b){return null===a||null===b||a===b?0:b.width*b.height-a.width*a.height}),h=0===k%2?0:1,d=d.iterator;d.next();)if(k=d.value,!(1<k.Td||a.isFixed(k))){m=null;for(n=k.edges.iterator;n.next();){m=n.value;break}n=k.width;var p=k.height;n=L.sqrt(n*n+p*p)/2;m=f+m.length+n;n=g+(b*(h/2>>1)+l)*(0===h%2?1:-1);k.centerX=c+m*Math.cos(n);k.centerY=e+m*Math.sin(n);h++}}} +function Gs(a,b,c,d,e,f,g){var h=9E19,k=-1,l=0;a:for(;l<b;l++){var m=a[l],n=m.x-c,p=m.y-d;n=n*n+p*p;if(n<h){for(p=l-1;0<=p;p--)if(a[p].y>m.y&&a[p].x-m.x<e+g.width)continue a;for(p=l+1;p<b;p++)if(a[p].x>m.x&&a[p].y-m.y<f+g.height)continue a;k=l;h=n}}return k}Ds.prototype.wu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)}; +Ds.prototype.addComments=function(a){var b=a.node;if(null!==b)for(b=b.Lu();b.next();){var c=b.value;if("Comment"===c.category&&c.isVisible()){var d=this.network.ri(c);null===d&&(d=this.network.Lj(c));d.charge=this.defaultCommentElectricalCharge;c=null;for(var e=d.destinationEdges;e.next();){var f=e.value;if(f.toVertex===a){c=f;break}}if(null===c)for(e=d.sourceEdges;e.next();)if(f=e.value,f.fromVertex===a){c=f;break}null===c&&(c=this.network.bk(a,d,null));c.length=this.defaultCommentSpringLength}}}; +function Ps(a,b){G&&(w(a,Os,Ds,"getNodeDistance:vertexA"),w(b,Os,Ds,"getNodeDistance:vertexB"));var c=a.bounds,d=c.x;a=c.y;var e=c.width;c=c.height;var f=b.bounds,g=f.x;b=f.y;var h=f.width;f=f.height;return d+e<g?a>b+f?(c=d+e-g,a=a-b-f,L.sqrt(c*c+a*a)):a+c<b?(d=d+e-g,a=a+c-b,L.sqrt(d*d+a*a)):g-(d+e):d>g+h?a>b+f?(c=d-g-h,a=a-b-f,L.sqrt(c*c+a*a)):a+c<b?(d=d-g-h,a=a+c-b,L.sqrt(d*d+a*a)):d-(g+h):a>b+f?a-(b+f):a+c<b?b-(a+c):.1} +function Hs(a,b){G&&E(b,Ds,"performIterations:num");a.dh=null;for(b=a.tn+b;a.tn<b&&(a.tn++,Qs(a)););a.dh=null} +function Qs(a){null===a.dh&&(a.dh=a.network.vertexes.Ka());var b=a.dh;if(0>=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.centerX,e=d,f=c=c.centerY,g=1;g<b.length;g++){var h=b[g];h.forceX=0;h.forceY=0;var k=h.centerX;h=h.centerY;d=Math.min(d,k);e=Math.max(e,k);c=Math.min(c,h);f=Math.max(f,h)}(e=e-d>f-c)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.centerX-b.centerX}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.centerY-b.centerY});c=a.ag;var l=d=h=0;for(f= +0;f<b.length;f++){g=b[f];d=g.bounds;h=g.focus;k=d.x+h.x;var m=d.y+h.y;d=g.charge*a.electricalFieldX(k,m);l=g.charge*a.electricalFieldY(k,m);d+=g.mass*a.gravitationalFieldX(k,m);l+=g.mass*a.gravitationalFieldY(k,m);g.forceX+=d;g.forceY+=l;for(var n=f+1;n<b.length;n++){var p=b[n];if(p!==g){d=p.bounds;h=p.focus;l=d.x+h.x;var r=d.y+h.y;if(k-l>c||l-k>c){if(e)break}else if(m-r>c||r-m>c){if(!e)break}else{var q=Ps(g,p);1>q?(d=a.randomNumberGenerator,null===d&&(a.randomNumberGenerator=d=new Rs),q=d.random(), +h=d.random(),k>l?(d=Math.abs(p.bounds.right-g.bounds.x),d=(1+d)*q):k<l?(d=Math.abs(p.bounds.x-g.bounds.right),d=-(1+d)*q):(d=Math.max(p.width,g.width),d=(1+d)*q-d/2),m>r?(l=Math.abs(p.bounds.bottom-g.bounds.y),l=(1+l)*h):k<l?(l=Math.abs(p.bounds.y-g.bounds.bottom),l=-(1+l)*h):(l=Math.max(p.height,g.height),l=(1+l)*h-l/2)):(h=-(g.charge*p.charge)/(q*q),d=(l-k)/q*h,l=(r-m)/q*h);g.forceX+=d;g.forceY+=l;p.forceX-=d;p.forceY-=l}}}}for(e=a.network.edges.iterator;e.next();)h=e.value,c=h.fromVertex,f=h.toVertex, +g=c.bounds,k=c.focus,d=g.x+k.x,g=g.y+k.y,m=f.bounds,n=f.focus,k=m.x+n.x,m=m.y+n.y,n=Ps(c,f),1>n?(n=a.randomNumberGenerator,null===n&&(a.randomNumberGenerator=n=new Rs),h=n.random(),n=n.random(),d=(d>k?1:-1)*(1+(f.width>c.width?f.width:c.width))*h,l=(g>m?1:-1)*(1+(f.height>c.height?f.height:c.height))*n):(h=h.stiffness*(n-h.length),d=(k-d)/n*h,l=(m-g)/n*h),c.forceX+=d,c.forceY+=l,f.forceX-=d,f.forceY-=l;for(e=d=0;e<b.length;e++)c=b[e],a.isFixed(c)?a.moveFixedVertex(c):d=Math.max(d,a.moveVertex(c)|| +0);return d>a.epsilonDistance*a.epsilonDistance}Ds.prototype.moveVertex=function(a){var b=a.forceX,c=a.forceY,d=this.moveLimit;b<-d?b=-d:b>d&&(b=d);c<-d?c=-d:c>d&&(c=d);a.centerX+=b;a.centerY+=c;return b*b+c*c};Ds.prototype.moveFixedVertex=function(){};Ds.prototype.commitLayout=function(){this.sv();this.commitNodes();this.isRouting&&this.commitLinks()}; +Ds.prototype.sv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var b=a.value.link;null!==b&&(b.fromSpot=hd,b.toSpot=hd)}};Ds.prototype.commitNodes=function(){var a=0,b=0;if(this.arrangesToOrigin){var c=M.alloc();this.computeBounds(this.network,c);b=this.arrangementOrigin;a=b.x-c.x;b=b.y-c.y;M.free(c)}c=M.alloc();for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.bounds),c.x+=a,c.y+=b,e.bounds=c;e.commit()}M.free(c)}; +Ds.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};Ds.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Ik:a};Ds.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Hk:a};Ds.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Fk:a};Ds.prototype.electricalFieldX=function(){return 0};Ds.prototype.electricalFieldY=function(){return 0}; +Ds.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Gk:a};Ds.prototype.gravitationalFieldX=function(){return 0};Ds.prototype.gravitationalFieldY=function(){return 0};Ds.prototype.isFixed=function(a){return a.isFixed}; +oa.Object.defineProperties(Ds.prototype,{currentIteration:{configurable:!0,get:function(){return this.tn}},arrangementSpacing:{configurable:!0,get:function(){return this.Zd},set:function(a){w(a,Hb,Ds,"arrangementSpacing");this.Zd.D(a)||(this.Zd.assign(a),this.F())}},arrangesToOrigin:{configurable:!0,get:function(){return this.wm},set:function(a){this.wm!==a&&(A(a,"boolean",Ds,"arrangesToOrigin"),this.wm=a,this.F())}},setsPortSpots:{configurable:!0, +get:function(){return this.tf},set:function(a){this.tf!==a&&(A(a,"boolean",Ds,"setsPortSpots"),this.tf=a,this.F())}},comments:{configurable:!0,get:function(){return this.ud},set:function(a){this.ud!==a&&(A(a,"boolean",Ds,"comments"),this.ud=a,this.F())}},maxIterations:{configurable:!0,get:function(){return this.fl},set:function(a){this.fl!==a&&(A(a,"number",Ds,"maxIterations"),0<=a&&(this.fl=a,this.F()))}},epsilonDistance:{configurable:!0,get:function(){return this.Vm}, +set:function(a){this.Vm!==a&&(A(a,"number",Ds,"epsilonDistance"),0<a&&(this.Vm=a,this.F()))}},infinityDistance:{configurable:!0,get:function(){return this.ag},set:function(a){this.ag!==a&&(A(a,"number",Ds,"infinityDistance"),1<a&&(this.ag=a,this.F()))}},moveLimit:{configurable:!0,get:function(){return this.Bn},set:function(a){this.Bn!==a&&(A(a,"number",Ds,"moveLimit"),1<a&&(this.Bn=a,this.F()))}},randomNumberGenerator:{configurable:!0,get:function(){return this.Vn}, +set:function(a){this.Vn!==a&&(null!==a&&"function"!==typeof a.random&&v('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+a),this.Vn=a)}},defaultSpringStiffness:{configurable:!0,get:function(){return this.Ik},set:function(a){this.Ik!==a&&(A(a,"number",Ds,"defaultSpringStiffness"),this.Ik=a,this.F())}},defaultSpringLength:{configurable:!0,get:function(){return this.Hk},set:function(a){this.Hk!==a&&(A(a,"number",Ds,"defaultSpringLength"), +this.Hk=a,this.F())}},defaultElectricalCharge:{configurable:!0,get:function(){return this.Fk},set:function(a){this.Fk!==a&&(A(a,"number",Ds,"defaultElectricalCharge"),this.Fk=a,this.F())}},defaultGravitationalMass:{configurable:!0,get:function(){return this.Gk},set:function(a){this.Gk!==a&&(A(a,"number",Ds,"defaultGravitationalMass"),this.Gk=a,this.F())}},defaultCommentSpringLength:{configurable:!0,get:function(){return this.Qm},set:function(a){this.Qm!== +a&&(A(a,"number",Ds,"defaultCommentSpringLength"),this.Qm=a,this.F())}},defaultCommentElectricalCharge:{configurable:!0,get:function(){return this.Pm},set:function(a){this.Pm!==a&&(A(a,"number",Ds,"defaultCommentElectricalCharge"),this.Pm=a,this.F())}}});Ds.className="ForceDirectedLayout";function Ns(){this.Lv=this.Kv=this.Fs=this.Hs=this.Gs=0}Ns.className="ForceDirectedSubnet";function Es(a){uq.call(this,a)}na(Es,uq);Es.prototype.createVertex=function(){return new Os(this)}; +Es.prototype.createEdge=function(){return new Ss(this)};Es.className="ForceDirectedNetwork";function Os(a){Iq.call(this,a);this.ma=!1;this.Ma=this.v=NaN;this.sh=this.Td=this.$=this.G=0;this.Xe=this.Oj=null;this.ov=0}na(Os,Iq);Os.prototype.serializeVertexProperties=function(a,b){Iq.prototype.serializeVertexProperties.call(this,a,b);a.isFixed=this.isFixed;a.charge=this.charge;a.mass=this.mass}; +Os.prototype.deserializeVertexProperties=function(a,b,c,d){Iq.prototype.deserializeVertexProperties.call(this,a,b,c,d);this.isFixed=a.isFixed;this.charge=a.charge;this.mass=a.mass}; +oa.Object.defineProperties(Os.prototype,{isFixed:{configurable:!0,get:function(){return this.ma},set:function(a){this.ma!==a&&(A(a,"boolean",Os,"isFixed"),this.ma=a)}},charge:{configurable:!0,get:function(){return this.v},set:function(a){this.v!==a&&(A(a,"number",Os,"charge"),this.v=a)}},mass:{configurable:!0,get:function(){return this.Ma},set:function(a){this.Ma!==a&&(A(a,"number",Os,"mass"),this.Ma=a)}},forceX:{configurable:!0,get:function(){return this.G}, +set:function(a){this.G!==a&&(A(a,"number",Os,"forceX"),this.G=a)}},forceY:{configurable:!0,get:function(){return this.$},set:function(a){this.$!==a&&(A(a,"number",Os,"forceY"),this.$=a)}}});Os.className="ForceDirectedVertex";function Ss(a){Jq.call(this,a);this.j=this.m=NaN}na(Ss,Jq);Ss.prototype.serializeEdgeProperties=function(a,b){Jq.prototype.serializeEdgeProperties.call(this,a,b);a.stiffness=this.stiffness;a.length=this.length}; +Ss.prototype.deserializeEdgeProperties=function(a,b,c,d){Jq.prototype.deserializeEdgeProperties.call(this,a,b,c,d);this.stiffness=a.stiffness;this.length=a.length};oa.Object.defineProperties(Ss.prototype,{stiffness:{configurable:!0,get:function(){return this.m},set:function(a){this.m!==a&&(A(a,"number",Ss,"stiffness"),this.m=a)}},length:{configurable:!0,get:function(){return this.j},set:function(a){this.j!==a&&(A(a,"number",Ss,"length"),this.j=a)}}});Ss.className="ForceDirectedEdge"; +function Rs(){var a=0;void 0===a&&(a=42);this.seed=a;this.$x=48271;this.by=2147483647;this.Q=44488.07041494893;this.ey=3399;this.ay=1/2147483647;this.random()}Rs.prototype.random=function(){var a=this.seed%this.Q*this.$x-this.seed/this.Q*this.ey;0<a?this.seed=a:this.seed=a+this.by;return this.seed*this.ay};Rs.className="RandomNumberGenerator"; +function Ts(a){Di.call(this);this.mc=this.he=25;this.O=0;this.Ek=Us;this.al=Vs;this.Sk=Ws;this.jj=4;this.sk=Xs;this.eg=15;this.tf=!0;this.vn=4;this.Oa=this.Ph=this.Da=-1;this.Fc=this.Ng=0;this.Va=this.Hd=this.Jd=this.ge=this.Mb=null;this.Og=0;this.Cn=this.sj=null;this.Rc=0;this.Dn=null;this.dd=new K;this.He=[];this.He.length=100;a&&Object.assign(this,a)}na(Ts,Di); +Ts.prototype.cloneProtected=function(a){Di.prototype.cloneProtected.call(this,a);a.he=this.he;a.mc=this.mc;a.O=this.O;a.Ek=this.Ek;a.al=this.al;a.Sk=this.Sk;a.jj=this.jj;a.sk=this.sk;a.eg=this.eg;a.tf=this.tf;a.vn=this.vn}; +Ts.prototype.serializeLayoutProperties=function(a,b){Di.prototype.serializeLayoutProperties.call(this,a,b);a.layerSpacing=this.layerSpacing;a.columnSpacing=this.columnSpacing;a.direction=this.direction;a.cycleRemoveOption=this.cycleRemoveOption.name;a.layeringOption=this.layeringOption.name;a.initializeOption=this.initializeOption.name;a.iterations=this.iterations;a.aggressiveOption=this.aggressiveOption.name;a.packOption=this.packOption;a.setsPortSpots=this.setsPortSpots;a.linkSpacing=this.linkSpacing; +a.Da=this.Da;a.Ph=this.Ph;a.Oa=this.Oa;a.Ng=this.Ng;a.Fc=this.Fc;a.Mb=this.Mb;a.Og=this.Og;a.Rc=this.Rc;a.dd={x:this.dd.x,y:this.dd.y}}; +Ts.prototype.deserializeLayoutProperties=function(a,b,c,d,e){Di.prototype.deserializeLayoutProperties.call(this,a,b,c,d,e);this.layerSpacing=a.layerSpacing;this.columnSpacing=a.columnSpacing;this.direction=a.direction;this.cycleRemoveOption=$a(Ts,a.cycleRemoveOption);this.layeringOption=$a(Ts,a.layeringOption);this.initializeOption=$a(Ts,a.initializeOption);this.iterations=a.iterations;this.aggressiveOption=$a(Ts,a.aggressiveOption);this.packOption=a.packOption;this.setsPortSpots=a.setsPortSpots; +this.linkSpacing=a.linkSpacing;this.Da=a.Da;this.Ph=a.Ph;this.Oa=a.Oa;this.Ng=a.Ng;this.Fc=a.Fc;this.Mb=a.Mb;this.Og=a.Og;this.Rc=a.Rc;this.dd=new K(this.dd.x,this.dd.y);e&&!d&&e.edges.each(function(a){if(!a.link&&a.fromVertex&&a.toVertex&&(null===a.fromVertex.node||null===a.toVertex.node)){for(var b=a.fromVertex;null!==b&&null===b.node&&0<b.Cd.count;){var c=b.Cd.N(0);if(c.link){a.link=c.link;break}b=c.fromVertex}if(!a.link){for(c=a.toVertex;null!==c&&null===c.node&&0<c.Pd.count;){var d=c.Pd.N(0); +if(d.link){a.link=d.link;break}c=d.toVertex}if(!a.link)for(c=c.Cd.iterator;c.next();)if(d=c.value,d.link&&d.fromVertex===b){a.link=d.link;break}}}})};Ts.prototype.ub=function(a){a.classType===Ts?0===a.name.indexOf("Aggressive")?this.aggressiveOption=a:0===a.name.indexOf("Cycle")?this.cycleRemoveOption=a:0===a.name.indexOf("Init")?this.initializeOption=a:0===a.name.indexOf("Layer")?this.layeringOption=a:v("Unknown enum value: "+a):Di.prototype.ub.call(this,a)};Ts.prototype.createNetwork=function(){return new Ys(this)}; +Ts.prototype.doLayout=function(a){G&&null===a&&v("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);this.Ph=-1;this.Fc=this.Ng=0;this.Dn=this.Cn=this.sj=null;for(a=0;a<this.He.length;a++)this.He[a]=null;if(0<this.network.vertexes.count){this.network.Ao();if(this.Ev())return;this.cycleRemoveOption!==Zs&&this.removeCycles();for(a= +this.network.vertexes.iterator;a.next();)a.value.layer=-1;this.Da=-1;this.assignLayers();for(a.reset();a.next();)this.Da=Math.max(this.Da,a.value.layer);this.cycleRemoveOption===Zs&&this.removeCycles();a=this.network;for(var b=[],c=a.edges.iterator;c.next();){var d=c.value;d.valid=!1;b.push(d)}for(c=0;c<b.length;c++){d=b[c];var e=d.fromVertex,f=d.toVertex;if(!(d.valid||(null===e.node&&null===e.data||null===f.node&&null===f.data)&&e.layer===f.layer)){var g=0,h=0,k=0,l=0;if(null!==d.link){h=d.link; +if(null===h)continue;var m=e.node;g=f.node;if(null===m||null===g)continue;var n=h.fromNode;k=h.toNode;var p=h.fromPort;h=h.toPort;if(d.rev){l=n;var r=p;n=k;p=h;k=l;h=r}var q=e.focus;l=f.focus;var u=d.rev?f.bounds:e.bounds;r=K.alloc();m!==n?u.u()&&n.isVisible()?n.actualBounds.u()?(Wo(n,p,Kc,r),r.x+=n.actualBounds.x-u.x,r.y+=n.actualBounds.y-u.y):(Wo(n,p,Kc,r),r.u()||r.assign(q)):r.assign(q):u.u()?(Wo(n,p,Kc,r),r.u()||r.assign(q)):r.assign(q);n=d.rev?e.bounds:f.bounds;m=K.alloc();g!==k?n.u()&&k.isVisible()? +k.actualBounds.u()?(Wo(k,h,Kc,m),m.x+=k.actualBounds.x-n.x,m.y+=k.actualBounds.y-n.y):(Wo(k,h,Kc,m),m.u()||m.assign(l)):m.assign(l):n.u()?(Wo(k,h,Kc,m),m.u()||m.assign(l)):m.assign(l);90===this.O||270===this.O?(g=Math.round((r.x-q.x)/this.mc),k=r.x,h=Math.round((m.x-l.x)/this.mc),l=m.x):(g=Math.round((r.y-q.y)/this.mc),k=r.y,h=Math.round((m.y-l.y)/this.mc),l=m.y);K.free(r);K.free(m);d.portFromColOffset=g;d.portFromPos=k;d.portToColOffset=h;d.portToPos=l}else d.portFromColOffset=0,d.portFromPos=0, +d.portToColOffset=0,d.portToPos=0;r=e.layer;m=f.layer;n=0;u=d.link;if(null!==u){var x=u.fromPort,y=u.toPort;if(null!==x&&null!==y){var z=u.fromNode;p=u.toNode;if(null!==z&&null!==p){var B=$s(this,!0),C=$s(this,!1),D=this.setsPortSpots?B:u.computeSpot(!0,x);q=this.setsPortSpots?C:u.computeSpot(!1,y);var J=u.isOrthogonal;D.$c()&&D.Jf(C)&&q.$c()&&q.Jf(B)?n=0:(B=u.getLinkPoint(z,x,D,!0,J,p,y,K.alloc()),C=u.getLinkDirection(z,x,B,D,!0,J,p,y),K.free(B),D.No()||C!==at(this,d,!0)?this.setsPortSpots&&null!== +z&&1===z.ports.count&&d.rev&&(n+=1):n+=1,D=u.getLinkPoint(p,y,q,!1,J,z,x,K.alloc()),u=u.getLinkDirection(p,y,D,q,!1,J,z,x),K.free(D),q.No()||u!==at(this,d,!1)?this.setsPortSpots&&null!==p&&1===p.ports.count&&d.rev&&(n+=2):n+=2)}}}p=n;n=1===p||3===p?!0:!1;if(p=2===p||3===p?!0:!1)q=a.createVertex(),q.node=null,q.Af=1,q.layer=r,q.near=e,a.rg(q),e=a.bk(e,q,d.link),e.valid=!1,e.rev=d.rev,e.portFromColOffset=g,e.portToColOffset=0,e.portFromPos=k,e.portToPos=0,e=q;u=1;n&&u--;if(r-m>u&&0<r){d.valid=!1;q= +a.createVertex();q.node=null;q.Af=2;q.layer=r-1;a.rg(q);e=a.bk(e,q,d.link);e.valid=!0;e.rev=d.rev;e.portFromColOffset=p?0:g;e.portToColOffset=0;e.portFromPos=p?0:k;e.portToPos=0;e=q;for(r--;r-m>u&&0<r;)q=a.createVertex(),q.node=null,q.Af=3,q.layer=r-1,a.rg(q),e=a.bk(e,q,d.link),e.valid=!0,e.rev=d.rev,e.portFromColOffset=0,e.portToColOffset=0,e.portFromPos=0,e.portToPos=0,e=q,r--;e=a.bk(q,f,d.link);e.valid=!n;n&&(q.near=f);e.rev=d.rev;e.portFromColOffset=0;e.portToColOffset=h;e.portFromPos=0;e.portToPos= +l}else d.valid=!0}}a=this.Mb=[];for(b=0;b<=this.Da;b++)a[b]=0;for(b=this.network.vertexes.iterator;b.next();)b.value.index=-1;this.initializeIndices();this.Ph=-1;for(c=this.Fc=this.Ng=0;c<=this.Da;c++)a[c]>a[this.Fc]&&(this.Ph=a[c]-1,this.Fc=c),a[c]<a[this.Ng]&&(this.Ng=c);this.Dn=[];for(c=0;c<a.length;c++)this.Dn[c]=[];for(b.reset();b.next();)a=b.value,this.Dn[a.layer][a.index]=a;this.Oa=-1;for(a=0;a<=this.Da;a++){b=bt(this,a);c=0;d=this.Mb[a];for(f=0;f<d;f++)e=b[f],c+=this.nodeMinColumnSpace(e, +!0),e.column=c,c+=1,c+=this.nodeMinColumnSpace(e,!1);this.Oa=Math.max(this.Oa,c-1);ct(this,a,b)}this.reduceCrossings();this.straightenAndPack();this.updateParts()}this.network=null;this.isValidLayout=!0};Ts.prototype.linkMinLength=function(){return 1};function dt(a){var b=a.fromVertex.node||a.fromVertex.data;a=a.toVertex.node||a.toVertex.data;return null===b&&null===a?8:null===b||null===a?4:1} +Ts.prototype.nodeMinLayerSpace=function(a,b){return null===a.node&&null===a.data?0:90===this.O||270===this.O?b?a.focus.y+10:a.bounds.height-a.focus.y+10:b?a.focus.x+10:a.bounds.width-a.focus.x+10};Ts.prototype.nodeMinColumnSpace=function(a,b){if(null===a.node&&null===a.data)return 0;var c=b?a.fk:a.ek;if(null!==c)return c;c=this.O;return 90===c||270===c?b?a.fk=a.focus.x/this.mc+1|0:a.ek=(a.bounds.width-a.focus.x)/this.mc+1|0:b?a.fk=a.focus.y/this.mc+1|0:a.ek=(a.bounds.height-a.focus.y)/this.mc+1|0}; +function et(a){null===a.sj&&(a.sj=[]);for(var b=0,c=a.network.vertexes.iterator;c.next();){var d=c.value;a.sj[b]=d.layer;b++;a.sj[b]=d.column;b++;a.sj[b]=d.index;b++}return a.sj}function ft(a,b){var c=0;for(a=a.network.vertexes.iterator;a.next();){var d=a.value;d.layer=b[c];c++;d.column=b[c];c++;d.index=b[c];c++}} +function gt(a,b,c){G&&(E(b,Ts,"crossingMatrix:unfixedLayer"),E(c,Ts,"crossingMatrix:direction"));var d=bt(a,b),e=a.Mb[b];if(null===a.Cn||a.Cn.length<e*e)a.Cn=[];for(var f=a.Cn,g=0;g<e;g++){var h=0,k=d[g],l=k.near;if(null!==l&&l.layer===k.layer)if(k=l.index,k>g)for(var m=g+1;m<k;m++){var n=d[m];n.near===l&&n.Af===l.Af||h++}else for(m=g-1;m>k;m--)n=d[m],n.near===l&&n.Af===l.Af||h++;var p;if(0<=c)for(k=d[g].sourceEdgesArrayAccess,l=0;l<k.length;l++){var r=k[l];if(r.valid&&r.fromVertex.layer!==b)for(n= +r.fromVertex.index,m=r.portToPos,r=r.portFromPos,p=l+1;p<k.length;p++){var q=k[p];if(q.valid&&q.fromVertex.layer!==b){var u=q.fromVertex.index;var x=q.portToPos;q=q.portFromPos;m<x&&(n>u||n===u&&r>q)&&h++;x<m&&(u>n||u===n&&q>r)&&h++}}}if(0>=c)for(k=d[g].destinationEdgesArrayAccess,l=0;l<k.length;l++)if(r=k[l],r.valid&&r.toVertex.layer!==b)for(n=r.toVertex.index,m=r.portToPos,r=r.portFromPos,p=l+1;p<k.length;p++)q=k[p],q.valid&&q.toVertex.layer!==b&&(u=q.toVertex.index,x=q.portToPos,q=q.portFromPos, +r<q&&(n>u||n===u&&m>x)&&h++,q<r&&(u>n||u===n&&x>m)&&h++);f[g*e+g]=h;for(k=g+1;k<e;k++){var y=0,z=0;if(0<=c){h=d[g].sourceEdgesArrayAccess;var B=d[k].sourceEdgesArrayAccess;for(l=0;l<h.length;l++)if(r=h[l],r.valid&&r.fromVertex.layer!==b)for(n=r.fromVertex.index,r=r.portFromPos,p=0;p<B.length;p++)q=B[p],q.valid&&q.fromVertex.layer!==b&&(u=q.fromVertex.index,q=q.portFromPos,(n<u||n===u&&r<q)&&z++,(u<n||u===n&&q<r)&&y++)}if(0>=c)for(h=d[g].destinationEdgesArrayAccess,B=d[k].destinationEdgesArrayAccess, +l=0;l<h.length;l++)if(r=h[l],r.valid&&r.toVertex.layer!==b)for(n=r.toVertex.index,m=r.portToPos,p=0;p<B.length;p++)q=B[p],q.valid&&q.toVertex.layer!==b&&(u=q.toVertex.index,x=q.portToPos,(n<u||n===u&&m<x)&&z++,(u<n||u===n&&x<m)&&y++);f[g*e+k]=y;f[k*e+g]=z}}ct(a,b,d);return f}Ts.prototype.countCrossings=function(){for(var a=0,b=0;b<=this.Da;b++)for(var c=gt(this,b,1),d=this.Mb[b],e=0;e<d;e++)for(var f=e;f<d;f++)a+=c[e*d+f];return a}; +function ht(a){for(var b=0,c=0;c<=a.Da;c++){for(var d=a,e=c,f=bt(d,e),g=d.Mb[e],h=0,k=0;k<g;k++){var l=f[k].destinationEdgesArrayAccess;if(null!==l)for(var m=0;m<l.length;m++){var n=l[m];if(n.valid&&n.toVertex.layer!==e){var p=n.fromVertex.column+n.portFromColOffset;var r=n.toVertex.column+n.portToColOffset;h+=(Math.abs(p-r)+1)*dt(n)}}}ct(d,e,f);b+=h}return b} +Ts.prototype.normalize=function(){var a=Infinity;this.Oa=-1;for(var b=this.network.vertexes.iterator;b.next();){var c=b.value;a=Math.min(a,c.column-this.nodeMinColumnSpace(c,!0));this.Oa=Math.max(this.Oa,c.column+this.nodeMinColumnSpace(c,!1))}for(b.reset();b.next();)b.value.column-=a;this.Oa-=a}; +function it(a,b,c){G&&(E(b,Ts,"barycenters:unfixedLayer"),E(c,Ts,"barycenters:direction"));for(var d=bt(a,b),e=a.Mb[b],f=[],g=0;g<e;g++){var h=d[g],k=null;0>=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=0,p=h.near;null!==p&&p.layer===h.layer&&(m+=p.column-1,n++);if(null!==k)for(p=0;p<k.length;p++){h=k[p];var r=h.fromVertex;h.valid&&!h.rev&&r.layer!==b&&(m+=r.column,n++)}if(null!==l)for(k=0;k<l.length;k++)h=l[k],p=h.toVertex,h.valid&&!h.rev&&p.layer!== +b&&(m+=p.column,n++);f[g]=0===n?-1:m/n}ct(a,b,d);return f} +function jt(a,b,c){G&&(E(b,Ts,"medians:unfixedLayer"),E(c,Ts,"medians:direction"));for(var d=bt(a,b),e=a.Mb[b],f=[],g=0;g<e;g++){var h=d[g],k=null;0>=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=[],p=h.near;null!==p&&p.layer===h.layer&&(n[m]=p.column-1,m++);h=void 0;if(null!==k)for(p=0;p<k.length;p++){h=k[p];var r=h.fromVertex;h.valid&&!h.rev&&r.layer!==b&&(n[m]=r.column+h.portFromColOffset,m++)}if(null!==l)for(k=0;k<l.length;k++)h=l[k],p=h.toVertex, +h.valid&&!h.rev&&p.layer!==b&&(n[m]=p.column+h.portToColOffset,m++);0===m?f[g]=-1:(n.sort(function(a,b){return a-b}),l=m>>1,f[g]=0!==(m&1)?n[l]:n[l-1]+n[l]>>1)}ct(a,b,d);return f} +function kt(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();){var h=g.value;var k=h.toVertex;var l=b.layer-k.layer;h=a.linkMinLength(h);l===h&&kt(a,k,c,d,e,f)}if(f)for(g=b.sourceEdges;g.next();)h=g.value,k=h.fromVertex,l=k.layer-b.layer,h=a.linkMinLength(h),l===h&&kt(a,k,c,d,e,f)}} +function lt(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();)lt(a,g.value.toVertex,c,d,e,f);if(f)for(b=b.sourceEdges;b.next();)lt(a,b.value.fromVertex,c,d,e,f)}} +Ts.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Ek){default:case mt:a=this.network;var b=0,c=a.vertexes.count-1,d=[];d.length=c+1;for(var e=a.vertexes.iterator;e.next();)e.value.valid=!0;for(;null!==nt(a);){for(e=ot(a);null!==e;)d[c]=e,c--,e.valid=!1,e=ot(a);for(e=pt(a);null!==e;)d[b]=e,b++,e.valid=!1,e=pt(a);e=null;for(var f=0,g=this.network.vertexes.iterator;g.next();){var h=g.value;if(h.valid){for(var k=0,l=h.destinationEdges;l.next();)l.value.toVertex.valid&& +k++;l=0;for(var m=h.sourceEdges;m.next();)m.value.fromVertex.valid&&l++;if(null===e||f<k-l)e=h,f=k-l}}null!==e&&(d[b]=e,b++,e.valid=!1)}for(b=0;b<a.vertexes.count;b++)d[b].index=b;for(d=a.edges.iterator;d.next();)b=d.value,b.fromVertex.index>b.toVertex.index&&(a.bm(b),b.rev=!0);break;case Us:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.sg=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.Og=0;for(d.reset();d.next();)b=d.value,0===b.sourceEdges.count&& +qt(this,b);for(d.reset();d.next();)b=d.value,-1===b.sg&&qt(this,b);for(a.reset();a.next();)d=a.value,d.forest||(b=d.fromVertex,c=b.finish,e=d.toVertex,f=e.finish,e.sg<b.sg&&c<f&&(this.network.bm(d),d.rev=!0));break;case Zs:a=this.network;b=a.vertexes.iterator;for(d=Infinity;b.next();)d=Math.min(d,b.value.layer);if(Infinity>d){if(0>d)for(b.reset();b.next();)b.value.layer-=d;d=[];for(b.reset();b.next();)c=b.value,e=d[c.layer],void 0===e?d[c.layer]=[c]:e.push(c);for(c=b=0;c<d.length;c++)if(e=d[c],!e|| +0===e.length)b++;else if(0<c)for(f=0;f<e.length;f++)e[f].layer-=b;for(d=a.edges.iterator;d.next();)b=d.value,b.fromVertex.layer<b.toVertex.layer&&(a.bm(b),b.rev=!0)}}};function nt(a){for(a=a.vertexes.iterator;a.next();){var b=a.value;if(b.valid)return b}return null}function ot(a){for(a=a.vertexes.iterator;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.destinationEdges;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null} +function pt(a){for(a=a.vertexes.iterator;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.sourceEdges;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function qt(a,b){b.sg=a.Og;a.Og++;for(var c=b.destinationEdges;c.next();){var d=c.value,e=d.toVertex;-1===e.sg&&(d.forest=!0,qt(a,e))}b.finish=a.Og;a.Og++} +Ts.prototype.assignLayers=function(){switch(this.al){case rt:st(this);break;case tt:for(var a,b=this.network.vertexes.iterator;b.next();)a=ut(this,b.value),this.Da=Math.max(a,this.Da);for(b.reset();b.next();)a=b.value,a.layer=this.Da-a.layer;break;default:case Vs:st(this);for(b=this.network.vertexes.iterator;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.sourceEdges.count&&vt(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.Da=-1;for(b.reset();b.next();){var c= +b.value;c.layer-=a;this.Da=Math.max(this.Da,c.layer)}}};function st(a){for(var b=a.network.vertexes.iterator;b.next();){var c=wt(a,b.value);a.Da=Math.max(c,a.Da)}}function wt(a,b){var c=0;if(-1===b.layer){for(var d=b.destinationEdges;d.next();){var e=d.value,f=e.toVertex;e=a.linkMinLength(e);c=Math.max(c,wt(a,f)+e)}b.layer=c}else c=b.layer;return c} +function ut(a,b){var c=0;if(-1===b.layer){for(var d=b.sourceEdges;d.next();){var e=d.value,f=e.fromVertex;e=a.linkMinLength(e);c=Math.max(c,ut(a,f)+e)}b.layer=c}else c=b.layer;return c} +function vt(a,b){if(!b.valid){b.valid=!0;for(var c=b.destinationEdges;c.next();)vt(a,c.value.toVertex);for(c=a.network.vertexes.iterator;c.next();)c.value.component=-1;for(var d=b.sourceEdgesArrayAccess,e=d.length,f=0;f<e;f++){var g=d[f],h=g.fromVertex,k=g.toVertex;g=a.linkMinLength(g);h.layer-k.layer>g&&kt(a,h,0,-1,!0,!1)}for(kt(a,b,1,-1,!0,!0);0!==b.component;){f=0;d=Infinity;h=0;k=null;for(g=a.network.vertexes.iterator;g.next();){var l=g.value;if(1===l.component){var m=0,n=!1,p=l.sourceEdgesArrayAccess; +e=p.length;for(var r=0;r<e;r++){var q=p[r],u=q.fromVertex;m+=1;1!==u.component&&(f+=1,u=u.layer-l.layer,q=a.linkMinLength(q),d=Math.min(d,u-q))}p=l.destinationEdgesArrayAccess;e=p.length;for(r=0;r<e;r++)q=p[r].toVertex,--m,1!==q.component?--f:n=!0;(null===k||m<h)&&!n&&(k=l,h=m)}}if(0<f){for(c.reset();c.next();)e=c.value,1===e.component&&(e.layer+=d);b.component=0}else k.component=0}for(c=a.network.vertexes.iterator;c.next();)c.value.component=-1;for(kt(a,b,1,-1,!0,!1);0!==b.component;){d=0;e=Infinity; +f=0;h=null;for(k=a.network.vertexes.iterator;k.next();)if(g=k.value,1===g.component){l=0;m=!1;p=g.sourceEdgesArrayAccess;n=p.length;for(r=0;r<n;r++)q=p[r].fromVertex,l+=1,1!==q.component?d+=1:m=!0;p=g.destinationEdgesArrayAccess;n=p.length;for(r=0;r<n;r++)q=p[r],u=q.toVertex,--l,1!==u.component&&(--d,u=g.layer-u.layer,q=a.linkMinLength(q),e=Math.min(e,u-q));(null===h||l>f)&&!m&&(h=g,f=l)}if(0>d){for(c.reset();c.next();)d=c.value,1===d.component&&(d.layer-=e);b.component=0}else h.component=0}}} +function at(a,b,c){return 90===a.O?c&&!b.rev||!c&&b.rev?270:90:180===a.O?c&&!b.rev||!c&&b.rev?0:180:270===a.O?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} +Ts.prototype.initializeIndices=function(){switch(this.Sk){default:case xt:for(var a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;b.index=this.Mb[c];this.Mb[c]++}break;case Ws:a=this.network.vertexes.iterator;for(b=this.Da;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&yt(this,c);break;case zt:for(a=this.network.vertexes.iterator,b=0;b<=this.Da;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&At(this,c)}}; +function yt(a,b){var c=b.layer;b.index=a.Mb[c];a.Mb[c]++;b=b.destinationEdgesArrayAccess;for(c=!0;c;){c=!1;for(var d=0;d<b.length-1;d++){var e=b[d],f=b[d+1];e.portFromColOffset>f.portFromColOffset&&(c=!0,b[d]=f,b[d+1]=e)}}for(c=0;c<b.length;c++)d=b[c],d.valid&&(d=d.toVertex,-1===d.index&&yt(a,d))} +function At(a,b){var c=b.layer;b.index=a.Mb[c];a.Mb[c]++;b=b.sourceEdgesArrayAccess;for(var d=!0;d;)for(d=!1,c=0;c<b.length-1;c++){var e=b[c],f=b[c+1];e.portToColOffset>f.portToColOffset&&(d=!0,b[c]=f,b[c+1]=e)}for(c=0;c<b.length;c++)d=b[c],d.valid&&(d=d.fromVertex,-1===d.index&&At(a,d))} +Ts.prototype.reduceCrossings=function(){var a=this.countCrossings(),b=et(this),c,d;for(c=0;c<this.jj;c++){for(d=0;d<=this.Da;d++)Bt(this,d,1),Ct(this,d,1);var e=this.countCrossings();e<a&&(a=e,b=et(this));for(d=this.Da;0<=d;d--)Bt(this,d,-1),Ct(this,d,-1);e=this.countCrossings();e<a&&(a=e,b=et(this))}ft(this,b);for(c=0;c<this.jj;c++){for(d=0;d<=this.Da;d++)Bt(this,d,0),Ct(this,d,0);e=this.countCrossings();e<a&&(a=e,b=et(this));for(d=this.Da;0<=d;d--)Bt(this,d,0),Ct(this,d,0);e=this.countCrossings(); +e<a&&(a=e,b=et(this))}ft(this,b);var f,g,h;switch(this.sk){case Dt:break;case Et:for(h=a+1;(d=this.countCrossings())<h;)for(h=d,c=this.Da;0<=c;c--)for(g=0;g<=c;g++){for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ct(this,d,-1)||f;e=this.countCrossings();e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ct(this,d,1)||f;e=this.countCrossings();e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ct(this,d,1)||f;e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f= +Ct(this,d,-1)||f;e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ct(this,d,0)||f;e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ct(this,d,0)||f;e>=a?ft(this,b):(a=e,b=et(this))}break;default:case Xs:for(c=this.Da,g=0,h=a+1;(d=this.countCrossings())<h;){h=d;for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ct(this,d,-1)||f;e=this.countCrossings();e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ct(this,d,1)||f;e=this.countCrossings();e>=a?ft(this,b): +(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ct(this,d,1)||f;e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ct(this,d,-1)||f;e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ct(this,d,0)||f;e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ct(this,d,0)||f;e>=a?ft(this,b):(a=e,b=et(this))}}ft(this,b)}; +function Bt(a,b,c){G&&(E(b,Ts,"medianBarycenterCrossingReduction:unfixedLayer"),E(c,Ts,"medianBarycenterCrossingReduction:direction"));var d=bt(a,b),e=a.Mb[b],f=jt(a,b,c),g=it(a,b,c);for(c=0;c<e;c++)-1===g[c]&&(g[c]=d[c].column),-1===f[c]&&(f[c]=d[c].column);for(var h=!0,k;h;)for(h=!1,c=0;c<e-1;c++)if(f[c+1]<f[c]||f[c+1]===f[c]&&g[c+1]<g[c])h=!0,k=f[c],f[c]=f[c+1],f[c+1]=k,k=g[c],g[c]=g[c+1],g[c+1]=k,k=d[c],d[c]=d[c+1],d[c+1]=k;for(c=f=0;c<e;c++)k=d[c],k.index=c,f+=a.nodeMinColumnSpace(k,!0),k.column= +f,f+=1,f+=a.nodeMinColumnSpace(k,!1);ct(a,b,d)} +function Ct(a,b,c){var d=bt(a,b),e=a.Mb[b];c=gt(a,b,c);var f;var g=[];for(f=0;f<e;f++)g[f]=-1;var h=[];for(f=0;f<e;f++)h[f]=-1;for(var k=!1,l=!0;l;)for(l=!1,f=0;f<e-1;f++){var m=c[d[f].index*e+d[f+1].index],n=c[d[f+1].index*e+d[f].index],p=0,r=0,q=d[f].column,u=d[f+1].column,x=a.nodeMinColumnSpace(d[f],!0),y=a.nodeMinColumnSpace(d[f],!1),z=a.nodeMinColumnSpace(d[f+1],!0),B=a.nodeMinColumnSpace(d[f+1],!1);x=q-x+z;y=u-y+B;var C=d[f].sourceEdges.iterator;for(C.reset();C.next();)if(z=C.value,B=z.fromVertex, +z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;z<f&&(p+=2*(f-z),r+=2*(f+1-z));z===f+1&&(p+=1);z>f+1&&(p+=4*(z-f),r+=4*(z-(f+1)))}C=d[f].destinationEdges.iterator;for(C.reset();C.next();)if(z=C.value,B=z.toVertex,z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;z===f+1&&(r+=1)}C=d[f+1].sourceEdges.iterator;for(C.reset();C.next();)if(z=C.value,B=z.fromVertex,z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;z<f&&(p+=2*(f+1-z),r+=2*(f-z));z===f&&(r+=1);z>f+1&&(p+=4*(z-(f+1)),r+=4*(z-f))}C=d[f+1].destinationEdges.iterator; +for(C.reset();C.next();)if(z=C.value,B=z.toVertex,z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;z===f&&(p+=1)}z=B=0;C=g[d[f].index];var D=h[d[f].index],J=g[d[f+1].index],U=h[d[f+1].index];-1!==C&&(B+=Math.abs(C-q),z+=Math.abs(C-y));-1!==D&&(B+=Math.abs(D-q),z+=Math.abs(D-y));-1!==J&&(B+=Math.abs(J-u),z+=Math.abs(J-x));-1!==U&&(B+=Math.abs(U-u),z+=Math.abs(U-x));if(r<p-.5||r===p&&n<m-.5||r===p&&n===m&&z<B-.5)l=k=!0,d[f].column=y,d[f+1].column=x,m=d[f],d[f]=d[f+1],d[f+1]=m}for(f=0;f<e;f++)d[f].index= +f;ct(a,b,d);return k} +Ts.prototype.straightenAndPack=function(){var a=0!==(this.eg&1);var b=0!==(this.eg&Ft);1E3<this.network.edges.count&&b&&(a=!1);if(a){var c=[];for(b=0;b<=this.Da;b++)c[b]=0;for(var d,e=this.network.vertexes.iterator;e.next();){var f=e.value;b=f.layer;d=f.column;f=this.nodeMinColumnSpace(f,!1);c[b]=Math.max(c[b],d+f)}for(e.reset();e.next();)f=e.value,b=f.layer,d=f.column,f.column=(8*(this.Oa-c[b])>>1)+8*d;this.Oa*=8}if(0!==(this.eg&2))for(c=!0;c;){c=!1;for(b=this.Fc+1;b<=this.Da;b++)c=Gt(this,b,1)|| +c;for(b=this.Fc-1;0<=b;b--)c=Gt(this,b,-1)||c;c=Gt(this,this.Fc,0)||c}if(0!==(this.eg&4)){for(b=this.Fc+1;b<=this.Da;b++)Ht(this,b,1);for(b=this.Fc-1;0<=b;b--)Ht(this,b,-1);Ht(this,this.Fc,0)}a&&(It(this,-1),It(this,1));if(0!==(this.eg&2))for(c=!0;c;){c=!1;c=Gt(this,this.Fc,0)||c;for(b=this.Fc+1;b<=this.Da;b++)c=Gt(this,b,0)||c;for(b=this.Fc-1;0<=b;b--)c=Gt(this,b,0)||c}}; +function Gt(a,b,c){G&&(E(b,Ts,"bendStraighten:unfixedLayer"),E(c,Ts,"bendStraighten:direction"));for(var d=!1;Jt(a,b,c);)d=!0;return d} +function Jt(a,b,c){G&&(E(b,Ts,"shiftbendStraighten:unfixedLayer"),E(c,Ts,"shiftbendStraighten:direction"));var d,e=bt(a,b),f=a.Mb[b],g=it(a,b,-1);if(0<c)for(d=0;d<f;d++)g[d]=-1;var h=it(a,b,1);if(0>c)for(d=0;d<f;d++)h[d]=-1;for(var k=!1,l=!0;l;)for(l=!1,d=0;d<f;d++){var m=e[d].column,n=a.nodeMinColumnSpace(e[d],!0),p=a.nodeMinColumnSpace(e[d],!1),r=0;0>d-1||m-e[d-1].column-1>n+a.nodeMinColumnSpace(e[d-1],!1)?r=m-1:r=m;n=d+1>=f||e[d+1].column-m-1>p+a.nodeMinColumnSpace(e[d+1],!0)?m+1:m;var q=p=0,u= +0;if(0>=c)for(var x=e[d].sourceEdges.iterator;x.next();){var y=x.value;var z=y.fromVertex;if(y.valid&&z.layer!==b){var B=dt(y);var C=y.portFromColOffset;y=y.portToColOffset;z=z.column;p+=(Math.abs(m+y-(z+C))+1)*B;q+=(Math.abs(r+y-(z+C))+1)*B;u+=(Math.abs(n+y-(z+C))+1)*B}}if(0<=c)for(x=e[d].destinationEdges.iterator;x.next();)y=x.value,z=y.toVertex,y.valid&&z.layer!==b&&(B=dt(y),C=y.portFromColOffset,y=y.portToColOffset,z=z.column,p+=(Math.abs(m+C-(z+y))+1)*B,q+=(Math.abs(r+C-(z+y))+1)*B,u+=(Math.abs(n+ +C-(z+y))+1)*B);y=C=B=0;x=g[e[d].index];z=h[e[d].index];-1!==x&&(B+=Math.abs(x-m),C+=Math.abs(x-r),y+=Math.abs(x-n));-1!==z&&(B+=Math.abs(z-m),C+=Math.abs(z-r),y+=Math.abs(z-n));if(q<p||q===p&&C<B)l=k=!0,e[d].column=r;else if(u<p||u===p&&y<B)l=k=!0,e[d].column=n}ct(a,b,e);a.normalize();return k} +function Ht(a,b,c){G&&(E(b,Ts,"medianStraighten:unfixedLayer"),E(c,Ts,"medianStraighten:direction"));var d=bt(a,b),e=a.Mb[b],f=jt(a,b,c),g=[];for(c=0;c<e;c++)g[c]=f[c];for(f=!0;f;)for(f=!1,c=0;c<e;c++){var h=d[c].column,k=a.nodeMinColumnSpace(d[c],!0),l=a.nodeMinColumnSpace(d[c],!1),m=0;if(-1===g[c])if(0===c&&c===e-1)m=h;else if(0===c){var n=d[c+1].column;n-h===l+a.nodeMinColumnSpace(d[c+1],!0)?m=h-1:m=h}else c===e-1?(n=d[c-1].column,m=h-n===k+a.nodeMinColumnSpace(d[c-1],!1)?h+1:h):(n=d[c-1].column, +k=n+a.nodeMinColumnSpace(d[c-1],!1)+k+1,n=d[c+1].column,l=n-a.nodeMinColumnSpace(d[c+1],!0)-l-1,m=(k+l)/2|0);else 0===c&&c===e-1?m=g[c]:0===c?(n=d[c+1].column,l=n-a.nodeMinColumnSpace(d[c+1],!0)-l-1,m=Math.min(g[c],l)):c===e-1?(n=d[c-1].column,k=n+a.nodeMinColumnSpace(d[c-1],!1)+k+1,m=Math.max(g[c],k)):(n=d[c-1].column,k=n+a.nodeMinColumnSpace(d[c-1],!1)+k+1,n=d[c+1].column,l=n-a.nodeMinColumnSpace(d[c+1],!0)-l-1,k<g[c]&&g[c]<l?m=g[c]:k>=g[c]?m=k:l<=g[c]&&(m=l));m!==h&&(f=!0,d[c].column=m)}ct(a,b, +d);a.normalize()}function Kt(a,b){G&&(E(b,Ts,"packAux:column"),E(1,Ts,"packAux:direction"));for(var c=!0,d=a.network.vertexes.iterator;d.next();){var e=d.value,f=a.nodeMinColumnSpace(e,!0),g=a.nodeMinColumnSpace(e,!1);if(e.column-f<=b&&e.column+g>=b){c=!1;break}}a=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(--c.column,a=!0);return a} +function Lt(a,b){G&&(E(b,Ts,"tightPackAux:column"),E(1,Ts,"tightPackAux:direction"));var c=b+1;var d,e=[],f=[];for(d=0;d<=a.Da;d++)e[d]=!1,f[d]=!1;for(var g=a.network.vertexes.iterator;g.next();){d=g.value;var h=d.column-a.nodeMinColumnSpace(d,!0),k=d.column+a.nodeMinColumnSpace(d,!1);h<=b&&k>=b&&(e[d.layer]=!0);h<=c&&k>=c&&(f[d.layer]=!0)}h=!0;c=!1;for(d=0;d<=a.Da;d++)h=h&&!(e[d]&&f[d]);if(h)for(g.reset();g.next();)a=g.value,a.column>b&&(--a.column,c=!0);return c} +function It(a,b){G&&E(b,Ts,"componentPack:direction");for(var c=0;c<=a.Oa;c++)for(;Kt(a,c););a.normalize();for(c=0;c<a.Oa;c++)for(;Lt(a,c););a.normalize();var d;if(0<b)for(c=0;c<=a.Oa;c++){var e=et(a);var f=ht(a);for(d=f+1;f<d;){d=f;Mt(a,c,1);var g=ht(a);g>f?ft(a,e):g<f&&(f=g,e=et(a))}}if(0>b)for(c=a.Oa;0<=c;c--)for(e=et(a),f=ht(a),d=f+1;f<d;)d=f,Mt(a,c,-1),g=ht(a),g>f?ft(a,e):g<f&&(f=g,e=et(a));a.normalize()} +function Mt(a,b,c){a.Rc=0;for(var d=a.network.vertexes.iterator;d.next();)d.value.component=-1;if(0<c)for(d.reset();d.next();){var e=d.value;e.column-a.nodeMinColumnSpace(e,!0)<=b&&(e.component=a.Rc)}if(0>c)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Rc);a.Rc++;for(d.reset();d.next();)b=d.value,-1===b.component&&(lt(a,b,a.Rc,-1,!0,!0),a.Rc++);var f;b=[];for(f=0;f<a.Rc*a.Rc;f++)b[f]=!1;e=[];for(f=0;f<(a.Da+1)*(a.Oa+1);f++)e[f]=-1;for(d.reset();d.next();){f= +d.value;for(var g=f.layer,h=Math.max(0,f.column-a.nodeMinColumnSpace(f,!0)),k=Math.min(a.Oa,f.column+a.nodeMinColumnSpace(f,!1));h<=k;h++)e[g*(a.Oa+1)+h]=f.component}for(f=0;f<=a.Da;f++){if(0<c)for(g=0;g<a.Oa;g++)-1!==e[f*(a.Oa+1)+g]&&-1!==e[f*(a.Oa+1)+g+1]&&e[f*(a.Oa+1)+g]!==e[f*(a.Oa+1)+g+1]&&(b[e[f*(a.Oa+1)+g]*a.Rc+e[f*(a.Oa+1)+g+1]]=!0);if(0>c)for(g=a.Oa;0<g;g--)-1!==e[f*(a.Oa+1)+g]&&-1!==e[f*(a.Oa+1)+g-1]&&e[f*(a.Oa+1)+g]!==e[f*(a.Oa+1)+g-1]&&(b[e[f*(a.Oa+1)+g]*a.Rc+e[f*(a.Oa+1)+g-1]]=!0)}e= +[];for(f=0;f<a.Rc;f++)e[f]=!0;g=[];for(g.push(0);0!==g.length;)if(k=g[g.length-1],g.pop(),e[k])for(e[k]=!1,f=0;f<a.Rc;f++)b[k*a.Rc+f]&&g.splice(0,0,f);if(0<c)for(d.reset();d.next();)a=d.value,e[a.component]&&--a.column;if(0>c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} +Ts.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=$s(this,!0),b=$s(this,!1),c=this.network.edges.iterator;c.next();){var d=c.value.link;null!==d&&(d.fromSpot=a,d.toSpot=b)}this.commitNodes();this.Au();this.isRouting&&this.commitLinks()};function $s(a,b){return 270===a.O?b?md:rd:90===a.O?b?rd:md:180===a.O?b?pd:qd:b?qd:pd} +Ts.prototype.commitNodes=function(){this.ge=[];this.Jd=[];this.Hd=[];this.Va=[];for(var a=0;a<=this.Da;a++)this.ge[a]=0,this.Jd[a]=0,this.Hd[a]=0,this.Va[a]=0;for(a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;this.ge[c]=Math.max(this.ge[c],this.nodeMinLayerSpace(b,!0));this.Jd[c]=Math.max(this.Jd[c],this.nodeMinLayerSpace(b,!1))}b=0;c=this.he;for(var d=0;d<=this.Da;d++){var e=c;0>=this.ge[d]+this.Jd[d]&&(e=0);0<d&&(b+=e/2);90===this.O||0===this.O?(b+=this.Jd[d],this.Hd[d]=b, +b+=this.ge[d]):(b+=this.ge[d],this.Hd[d]=b,b+=this.Jd[d]);d<this.Da&&(b+=e/2);this.Va[d]=b}c=b;b=this.arrangementOrigin;for(d=0;d<=this.Da;d++)270===this.O?this.Hd[d]=b.y+this.Hd[d]:90===this.O?(this.Hd[d]=b.y+c-this.Hd[d],this.Va[d]=c-this.Va[d]):180===this.O?this.Hd[d]=b.x+this.Hd[d]:(this.Hd[d]=b.x+c-this.Hd[d],this.Va[d]=c-this.Va[d]);a.reset();for(c=d=Infinity;a.next();){e=a.value;var f=e.layer,g=e.column|0;if(270===this.O||90===this.O){var h=b.x+this.mc*g;f=this.Hd[f]}else h=this.Hd[f],f=b.y+ +this.mc*g;e.centerX=h;e.centerY=f;d=Math.min(e.x,d);c=Math.min(e.y,c)}d=b.x-d;b=b.y-c;this.dd=new K(d,b);for(a.reset();a.next();)c=a.value,c.x+=d,c.y+=b,c.commit()}; +Ts.prototype.Au=function(){for(var a=0,b=this.he,c=0;c<=this.Da;c++)a+=this.ge[c],a+=this.Jd[c];a+=this.Da*b;b=[];c=this.mc*this.Oa;for(var d=this.maxLayer;0<=d;d--)270===this.O?0===d?b.push(new M(0,0,c,Math.abs(this.Va[0]))):b.push(new M(0,this.Va[d-1],c,Math.abs(this.Va[d-1]-this.Va[d]))):90===this.O?0===d?b.push(new M(0,this.Va[0],c,Math.abs(this.Va[0]-a))):b.push(new M(0,this.Va[d],c,Math.abs(this.Va[d-1]-this.Va[d]))):180===this.O?0===d?b.push(new M(0,0,Math.abs(this.Va[0]),c)):b.push(new M(this.Va[d- +1],0,Math.abs(this.Va[d-1]-this.Va[d]),c)):0===d?b.push(new M(this.Va[0],0,Math.abs(this.Va[0]-a),c)):b.push(new M(this.Va[d],0,Math.abs(this.Va[d-1]-this.Va[d]),c));this.commitLayers(b,this.dd)};Ts.prototype.commitLayers=function(){}; +Ts.prototype.commitLinks=function(){for(var a=this.network.edges.iterator,b;a.next();)b=a.value.link,null!==b&&(b.uh(),b.Nj(),b.Bf());for(a.reset();a.next();)b=a.value.link,null!==b&&b.yg();for(a.reset();a.next();){var c=a.value;b=c.link;if(null!==b){b.uh();var d=b,e=d.fromNode,f=d.toNode,g=d.fromPort,h=d.toPort;if(null!==e){var k=e.findVisibleNode();null!==k&&k!==e&&(e=k,g=k.port)}null!==f&&(k=f.findVisibleNode(),null!==k&&k!==f&&(f=k,h=k.port));var l=b.computeSpot(!0,g);k=b.computeSpot(!1,h);var m= +c.fromVertex,n=c.toVertex;if(c.valid){if(b.curve===pg&&4===b.pointsCount)if(m.column===n.column)c=b.getLinkPoint(e,g,l,!0,!1,f,h),g=b.getLinkPoint(f,h,k,!1,!1,e,g),c.u()||c.set(e.actualBounds.center),g.u()||g.set(f.actualBounds.center),b.Nj(),b.zf(c.x,c.y),b.zf((2*c.x+g.x)/3,(2*c.y+g.y)/3),b.zf((c.x+2*g.x)/3,(c.y+2*g.y)/3),b.zf(g.x,g.y);else{var p=!1,r=!1;null!==g&&l===Ec&&(p=!0);null!==h&&k===Ec&&(r=!0);if(p||r){var q=b.i(0).x;c=b.i(0).y;m=b.i(3).x;d=b.i(3).y;if(p){if(90===this.O||270===this.O){p= +q;var u=(c+d)/2}else p=(q+m)/2,u=c;b.P(1,p,u);l=b.getLinkPoint(e,g,l,!0,!1,f,h);l.u()||l.set(e.actualBounds.center);b.P(0,l.x,l.y)}r&&(90===this.O||270===this.O?(l=m,c=(c+d)/2):(l=(q+m)/2,c=d),b.P(2,l,c),e=b.getLinkPoint(f,h,k,!1,!1,e,g),e.u()||e.set(f.actualBounds.center),b.P(3,e.x,e.y))}}b.Bf()}else if(m.layer===n.layer)b.Bf();else{p=r=!1;u=this.he;q=b.firstPickIndex+1;if(b.isOrthogonal){p=!0;var x=b.pointsCount;4<x&&b.points.removeRange(2,x-3)}else if(b.curve===pg)r=!0,x=b.pointsCount,4<x&&b.points.removeRange(2, +x-3),4===x&&(q=2);else{x=b.pointsCount;var y=l===Ec,z=k===Ec;2<x&&y&&z?b.points.removeRange(1,x-2):3<x&&y&&!z?b.points.removeRange(1,x-3):3<x&&!y&&z?b.points.removeRange(2,x-2):4<x&&!y&&!z&&b.points.removeRange(2,x-3)}if(c.rev){for(;null!==n&&m!==n;){var B=x=null;for(y=n.sourceEdges.iterator;y.next()&&(z=y.value,z.link!==c.link||(x=z.fromVertex,B=z.toVertex,null!==x.node)););if(null===x)break;if(x!==m){y=b.i(q-1).x;z=b.i(q-1).y;var C=x.centerX;var D=x.centerY;if(p)180===this.O||0===this.O?q===b.firstPickIndex+ +1?(b.l(q++,y,z),b.l(q++,y,D)):(null!==B?B.centerY:z)!==D&&(B=this.Va[x.layer-1]+this.dd.x,b.l(q++,B,z),b.l(q++,B,D)):q===b.firstPickIndex+1?(b.l(q++,y,z),b.l(q++,C,z)):(null!==B?B.centerX:y)!==C&&(B=this.Va[x.layer-1]+this.dd.y,b.l(q++,y,B),b.l(q++,C,B));else if(q===b.firstPickIndex+1){B=Math.max(10,this.ge[n.layer]);var J=Math.max(10,this.Jd[n.layer]);if(r)180===this.O?C<=n.bounds.x?(n=n.bounds.x,b.l(q++,n-B,D),b.l(q++,n,D),b.l(q++,n+J,D)):(b.l(q++,C-B,D),b.l(q++,C,D),b.l(q++,C+J,D)):90===this.O? +D>=n.bounds.bottom?(n=n.bounds.y+n.bounds.height,b.l(q++,C,n+J),b.l(q++,C,n),b.l(q++,C,n-B)):(b.l(q++,C,D+J),b.l(q++,C,D),b.l(q++,C,D-B)):270===this.O?D<=n.bounds.y?(n=n.bounds.y,b.l(q++,C,n-B),b.l(q++,C,n),b.l(q++,C,n+J)):(b.l(q++,C,D-B),b.l(q++,C,D),b.l(q++,C,D+J)):0===this.O&&(C>=n.bounds.right?(n=n.bounds.x+n.bounds.width,b.l(q++,n+J,D),b.l(q++,n,D),b.l(q++,n-B,D)):(b.l(q++,C+J,D),b.l(q++,C,D),b.l(q++,C-B,D)));else{b.l(q++,y,z);var U=0;if(180===this.O||0===this.O){if(180===this.O?C>=n.bounds.right: +C<=n.bounds.x)U=(0===this.O?-B:J)/2;b.l(q++,y+U,D)}else{if(270===this.O?D>=n.bounds.bottom:D<=n.bounds.y)U=(90===this.O?-B:J)/2;b.l(q++,C,z+U)}b.l(q++,C,D)}}else B=Math.max(10,this.ge[x.layer]),J=Math.max(10,this.Jd[x.layer]),r?180===this.O?(b.l(q++,C-B-u,D),b.l(q++,Math.min(C-B+u/2,C),D),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,Math.max(C+J-u/2,C),D),b.l(q++,C+J+u,D)):90===this.O?(b.l(q++,C,D+J+u),b.l(q++,C,Math.max(D+J-u/2,D)),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,C,Math.min(D-B+u/2,D)),b.l(q++,C,D-B-u)): +270===this.O?(b.l(q++,C,D-B-u),b.l(q++,C,Math.min(D-B+u/2,D)),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,C,Math.max(D+J-u/2,D)),b.l(q++,C,D+J+u)):(b.l(q++,C+J+u,D),b.l(q++,Math.max(C+J-u/2,C),D),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,Math.min(C-B+u/2,C),D),b.l(q++,C-B-u,D)):b.l(q++,C,D)}n=x}if(null===h||l!==Ec||p)if(y=b.i(q-1).x,z=b.i(q-1).y,C=b.i(q).x,D=b.i(q).y,p)u=this.Jd[m.layer],180===this.O||0===this.O?(p=z,p>=m.bounds.y&&p<=m.bounds.bottom&&(180===this.O?C>=m.bounds.x:C<=m.bounds.right)&&(n=m.centerX+(180=== +this.O?-u:u),p<m.bounds.y+m.bounds.height/2?p=m.bounds.y-this.mc/2:p=m.bounds.bottom+this.mc/2,b.l(q++,n,z),b.l(q++,n,p)),b.l(q++,C,p)):(p=y,p>=m.bounds.x&&p<=m.bounds.right&&(270===this.O?D>=m.bounds.y:D<=m.bounds.bottom)&&(n=m.centerY+(270===this.O?-u:u),p<m.bounds.x+m.bounds.width/2?p=m.bounds.x-this.mc/2:p=m.bounds.right+this.mc/2,b.l(q++,y,n),b.l(q++,p,n)),b.l(q++,p,D)),b.l(q++,C,D);else if(r)B=Math.max(10,this.ge[m.layer]),J=Math.max(10,this.Jd[m.layer]),180===this.O&&C>=m.bounds.x?(n=m.bounds.x+ +m.bounds.width,b.P(q-2,n,z),b.P(q-1,n+J,z)):90===this.O&&D<=m.bounds.bottom?(n=m.bounds.y,b.P(q-2,y,n),b.P(q-1,y,n-B)):270===this.O&&D>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.P(q-2,y,n),b.P(q-1,y,n+J)):0===this.O&&C<=m.bounds.right&&(n=m.bounds.x,b.P(q-2,n,z),b.P(q-1,n-B,z));else{B=Math.max(10,this.ge[m.layer]);J=Math.max(10,this.Jd[m.layer]);p=0;if(180===this.O||0===this.O){if(180===this.O?C<=m.bounds.x:C>=m.bounds.right)p=(0===this.O?J:-B)/2;b.l(q++,C+p,z)}else{if(270===this.O?D<=m.bounds.y: +D>=m.bounds.bottom)p=(90===this.O?J:-B)/2;b.l(q++,y,D+p)}b.l(q++,C,D)}}else{for(;null!==m&&m!==n;){B=x=null;for(m=m.destinationEdges.iterator;m.next()&&(y=m.value,y.link!==c.link||(x=y.toVertex,B=y.fromVertex,null!==B.node&&(B=null),null!==x.node)););if(null===x)break;x!==n&&(y=b.i(q-1).x,z=b.i(q-1).y,C=x.centerX,D=x.centerY,p?180===this.O||0===this.O?(null!==B?B.centerY:z)!==D&&(B=this.Va[x.layer]+this.dd.x,q===b.firstPickIndex+1&&(B=0===this.O?Math.max(B,y):Math.min(B,y)),b.l(q++,B,z),b.l(q++,B, +D)):(null!==B?B.centerX:y)!==C&&(B=this.Va[x.layer]+this.dd.y,q===b.firstPickIndex+1&&(B=90===this.O?Math.max(B,z):Math.min(B,z)),b.l(q++,y,B),b.l(q++,C,B)):(B=Math.max(10,this.ge[x.layer]),J=Math.max(10,this.Jd[x.layer]),r?180===this.O?(b.l(q++,C+J+u,D),b.l(q++,Math.max(C+J-u/2,C),D),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,Math.min(C-B+u/2,C),D),b.l(q++,C-B-u,D)):90===this.O?(b.l(q++,C,D-B-u),b.l(q++,C,Math.min(D-B+u/2,D)),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,C,Math.max(D+J-u/2,D)),b.l(q++,C,D+J+u)):270=== +this.O?(b.l(q++,C,D+J+u),b.l(q++,C,Math.max(D+J-u/2,D)),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,C,Math.min(D-B+u/2,D)),b.l(q++,C,D-B-u)):(b.l(q++,C-B-u,D),b.l(q++,Math.min(C-B+u/2,C),D),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,Math.max(C+J-u/2,C),D),b.l(q++,C+J+u,D)):180===this.O?(b.l(q++,C+J,D),b.l(q++,C-B,D)):90===this.O?(b.l(q++,C,D-B),b.l(q++,C,D+J)):270===this.O?(b.l(q++,C,D+J),b.l(q++,C,D-B)):(b.l(q++,C-B,D),b.l(q++,C+J,D))));m=x}p&&(y=b.i(q-1).x,z=b.i(q-1).y,C=b.i(q).x,D=b.i(q).y,180===this.O||0===this.O? +z!==D&&(B=0===this.O?Math.min(Math.max((C+y)/2,this.Va[n.layer]+this.dd.x),C):Math.max(Math.min((C+y)/2,this.Va[n.layer]+this.dd.x),C),b.l(q++,B,z),b.l(q++,B,D)):y!==C&&(B=90===this.O?Math.min(Math.max((D+z)/2,this.Va[n.layer]+this.dd.y),D):Math.max(Math.min((D+z)/2,this.Va[n.layer]+this.dd.y),D),b.l(q++,y,B),b.l(q++,C,B)))}null!==d&&r&&(null!==g&&(l===Ec&&(l=b.i(0),d=b.i(2),l.D(d)||b.P(1,(l.x+d.x)/2,(l.y+d.y)/2)),l=b.getLinkPoint(e,g,Ec,!0,!1,f,h),l.u()||l.set(e.actualBounds.center),b.P(0,l.x,l.y)), +null!==h&&(k===Ec&&(k=b.i(b.pointsCount-1),l=b.i(b.pointsCount-3),k.D(l)||b.P(b.pointsCount-2,(k.x+l.x)/2,(k.y+l.y)/2)),e=b.getLinkPoint(f,h,Ec,!1,!1,e,g),e.u()||e.set(f.actualBounds.center),b.P(b.pointsCount-1,e.x,e.y)));b.Bf();c.commit()}}}this.avoidOrthogonalOverlaps()}; +Ts.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new H,b=this.network.edges.iterator;b.next();){var c=b.value.link;null!==c&&c.isOrthogonal&&!a.contains(c)&&a.add(c)}if(0<a.count)if(90===this.O||270===this.O){b=0;c=[];for(a=a.iterator;a.next();){var d=a.value;if(null!==d&&d.isOrthogonal)for(var e=2;e<d.pointsCount-3;e++){var f=d.i(e);var g=d.i(e+1);if(this.C(f.y,g.y)&&!this.C(f.x,g.x)){var h=new Nt;h.layer=Math.floor(f.y/2);var k=d.i(0),l=d.i(d.pointsCount-1);h.first= +k.x*k.x+k.y;h.lc=l.x*l.x+l.y;h.rd=Math.min(f.x,g.x);h.Ic=Math.max(f.x,g.x);h.index=e;h.link=d;if(e+2<d.pointsCount){k=d.i(e-1);l=d.i(e+2);var m=0;k.y<f.y?m=l.y<f.y?3:f.x<g.x?2:1:k.y>f.y&&(m=l.y>f.y?0:g.x<f.x?2:1);h.j=m}c.push(h)}}}if(1<c.length)for(c.sort(this.Tx),a=0;a<c.length;){f=c[a].layer;for(d=a+1;d<c.length&&c[d].layer===f;)d++;if(1<d-a)for(f=a;f<d;){g=c[f].Ic;for(e=a+1;e<d&&c[e].rd<g;)g=Math.max(g,c[e].Ic),e++;g=e-f;if(1<g){this.Ei(c,this.ws,f,f+g);m=1;h=c[f].lc;for(k=f;k<e;k++)l=c[k],l.lc!== +h&&(m++,h=l.lc);this.Ei(c,this.Sx,f,f+g);var n=1;h=c[f].first;for(k=f;k<e;k++)l=c[k],l.first!==h&&(n++,h=l.first);k=!0;l=n;m<n?(k=!1,l=m,h=c[f].lc,this.Ei(c,this.ws,f,f+g)):h=c[f].first;m=0;for(n=f;n<e;n++){var p=c[n];(k?p.first:p.lc)!==h&&(m++,h=k?p.first:p.lc);var r=p.link;f=r.i(p.index);g=r.i(p.index+1);var q=this.linkSpacing*(m-(l-1)/2);b++;r.uh();r.P(p.index,f.x,f.y+q);r.P(p.index+1,g.x,g.y+q);r.Bf()}}f=e}a=d}}else{b=0;c=[];for(a=a.iterator;a.next();)if(d=a.value,null!==d&&d.isOrthogonal)for(e= +2;e<d.pointsCount-3;e++)f=d.i(e),g=d.i(e+1),this.C(f.x,g.x)&&!this.C(f.y,g.y)&&(h=new Nt,h.layer=Math.floor(f.x/2),k=d.i(0),l=d.i(d.pointsCount-1),h.first=k.x+k.y*k.y,h.lc=l.x+l.y*l.y,h.rd=Math.min(f.y,g.y),h.Ic=Math.max(f.y,g.y),h.index=e,h.link=d,e+2<d.pointsCount&&(k=d.i(e-1),l=d.i(e+2),m=0,k.x<f.x?m=l.x<f.x?3:f.y<g.y?2:1:k.x>f.x&&(m=l.x>f.x?0:g.y<f.y?2:1),h.j=m),c.push(h));if(1<c.length)for(c.sort(this.Tx),a=0;a<c.length;){f=c[a].layer;for(d=a+1;d<c.length&&c[d].layer===f;)d++;if(1<d-a)for(f= +a;f<d;){g=c[f].Ic;for(e=a+1;e<d&&c[e].rd<g;)g=Math.max(g,c[e].Ic),e++;g=e-f;if(1<g){this.Ei(c,this.ws,f,f+g);m=1;h=c[f].lc;for(k=f;k<e;k++)l=c[k],l.lc!==h&&(m++,h=l.lc);this.Ei(c,this.Sx,f,f+g);n=1;h=c[f].first;for(k=f;k<e;k++)l=c[k],l.first!==h&&(n++,h=l.first);k=!0;l=n;m<n?(k=!1,l=m,h=c[f].lc,this.Ei(c,this.ws,f,f+g)):h=c[f].first;m=0;for(n=f;n<e;n++)p=c[n],(k?p.first:p.lc)!==h&&(m++,h=k?p.first:p.lc),r=p.link,f=r.i(p.index),g=r.i(p.index+1),q=this.linkSpacing*(m-(l-1)/2),b++,r.uh(),r.P(p.index, +f.x+q,f.y),r.P(p.index+1,g.x+q,g.y),r.Bf()}f=e}a=d}}}};t=Ts.prototype;t.Tx=function(a,b){return a instanceof Nt&&b instanceof Nt&&a!==b?a.layer<b.layer?-1:a.layer>b.layer?1:a.rd<b.rd?-1:a.rd>b.rd?1:a.Ic<b.Ic?-1:a.Ic>b.Ic?1:0:0};t.Sx=function(a,b){return a instanceof Nt&&b instanceof Nt&&a!==b?a.first<b.first?-1:a.first>b.first||a.j<b.j?1:a.j>b.j||a.rd<b.rd?-1:a.rd>b.rd?1:a.Ic<b.Ic?-1:a.Ic>b.Ic?1:0:0}; +t.ws=function(a,b){return a instanceof Nt&&b instanceof Nt&&a!==b?a.lc<b.lc?-1:a.lc>b.lc||a.j<b.j?1:a.j>b.j||a.rd<b.rd?-1:a.rd>b.rd?1:a.Ic<b.Ic?-1:a.Ic>b.Ic?1:0:0};t.C=function(a,b){G&&(E(a,Ts,"isApprox:a"),E(b,Ts,"isApprox:b"));a-=b;return-1<a&&1>a}; +t.Ei=function(a,b,c,d){var e=a.length,f=d-c;if(!(1>=f))if((0>c||c>=e-1)&&v("not in range 0 <= from < length: "+c),2===f)d=a[c],e=a[c+1],0<b(d,e)&&(a[c]=e,a[c+1]=d);else if(0===c)if(d>=e)a.sort(b);else for(c=a.slice(0,d),c.sort(b),b=0;b<d;b++)a[b]=c[b];else if(d>=e)for(d=a.slice(c),d.sort(b),b=c;b<e;b++)a[b]=d[b-c];else for(e=a.slice(c,d),e.sort(b),b=c;b<d;b++)a[b]=e[b-c]}; +function bt(a,b){var c=a.Mb[b];if(c>=a.He.length){var d=[];for(var e=0;e<a.He.length;e++)d[e]=a.He[e];a.He=d}void 0===a.He[c]||null===a.He[c]?d=[]:(d=a.He[c],a.He[c]=null);a=a.Dn[b];for(b=0;b<a.length;b++)c=a[b],d[c.index]=c;return d}function ct(a,b,c){a.He[a.Mb[b]]=c} +oa.Object.defineProperties(Ts.prototype,{layerSpacing:{configurable:!0,get:function(){return this.he},set:function(a){this.he!==a&&(A(a,"number",Ts,"layerSpacing"),0<=a&&(this.he=a,this.F()))}},columnSpacing:{configurable:!0,get:function(){return this.mc},set:function(a){this.mc!==a&&(A(a,"number",Ts,"columnSpacing"),0<a&&(this.mc=a,this.F()))}},direction:{configurable:!0,get:function(){return this.O},set:function(a){this.O!==a&&(A(a,"number",Ts,"direction"), +0===a||90===a||180===a||270===a?(this.O=a,this.F()):v("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{configurable:!0,get:function(){return this.Ek},set:function(a){this.Ek!==a&&(ab(a,Ts,Ts,"cycleRemoveOption"),a===mt||a===Us||a===Zs)&&(this.Ek=a,this.F())}},layeringOption:{configurable:!0,get:function(){return this.al},set:function(a){this.al!==a&&(ab(a,Ts,Ts,"layeringOption"),a===Vs||a===rt||a===tt)&&(this.al=a,this.F())}},initializeOption:{configurable:!0, +enumerable:!0,get:function(){return this.Sk},set:function(a){this.Sk!==a&&(ab(a,Ts,Ts,"initializeOption"),a===Ws||a===zt||a===xt)&&(this.Sk=a,this.F())}},iterations:{configurable:!0,get:function(){return this.jj},set:function(a){this.jj!==a&&(E(a,Ys,"iterations"),0<=a&&(this.jj=a,this.F()))}},aggressiveOption:{configurable:!0,get:function(){return this.sk},set:function(a){this.sk!==a&&(ab(a,Ts,Ts,"aggressiveOption"),a===Dt||a===Xs||a===Et)&&(this.sk=a,this.F())}},packOption:{configurable:!0, +enumerable:!0,get:function(){return this.eg},set:function(a){this.eg!==a&&(A(a,"number",Ts,"packOption"),0<=a&&8>a&&(this.eg=a,this.F()))}},setsPortSpots:{configurable:!0,get:function(){return this.tf},set:function(a){this.tf!==a&&(A(a,"boolean",Ts,"setsPortSpots"),this.tf=a,this.F())}},linkSpacing:{configurable:!0,get:function(){return this.vn},set:function(a){this.vn!==a&&(A(a,"number",Ts,"linkSpacing"),0<=a&&(this.vn=a,this.F()))}},maxLayer:{configurable:!0, +get:function(){return this.Da}},maxIndex:{configurable:!0,get:function(){return this.Ph}},maxColumn:{configurable:!0,get:function(){return this.Oa}},minIndexLayer:{configurable:!0,get:function(){return this.Ng}},maxIndexLayer:{configurable:!0,get:function(){return this.Fc}}}); +var Us=new F(Ts,"CycleDepthFirst",0),mt=new F(Ts,"CycleGreedy",1),Zs=new F(Ts,"CycleFromLayers",2),Vs=new F(Ts,"LayerOptimalLinkLength",0),rt=new F(Ts,"LayerLongestPathSink",1),tt=new F(Ts,"LayerLongestPathSource",2),Ws=new F(Ts,"InitDepthFirstOut",0),zt=new F(Ts,"InitDepthFirstIn",1),xt=new F(Ts,"InitNaive",2),Dt=new F(Ts,"AggressiveNone",0),Xs=new F(Ts,"AggressiveLess",1),Et=new F(Ts,"AggressiveMore",2),Ft=8;Ts.className="LayeredDigraphLayout";Ts.CycleDepthFirst=Us;Ts.CycleGreedy=mt; +Ts.CycleFromLayers=Zs;Ts.LayerOptimalLinkLength=Vs;Ts.LayerLongestPathSink=rt;Ts.LayerLongestPathSource=tt;Ts.InitDepthFirstOut=Ws;Ts.InitDepthFirstIn=zt;Ts.InitNaive=xt;Ts.AggressiveNone=Dt;Ts.AggressiveLess=Xs;Ts.AggressiveMore=Et;Ts.PackNone=0;Ts.PackExpand=1;Ts.PackStraighten=2;Ts.PackMedian=4;Ts.PackAll=15;function Nt(){this.index=this.Ic=this.rd=this.lc=this.first=this.layer=0;this.link=null;this.j=0}Nt.className="SegInfo";function Ys(a){uq.call(this,a)}na(Ys,uq);Ys.prototype.createVertex=function(){return new Ot(this)}; +Ys.prototype.createEdge=function(){return new Pt(this)};Ys.className="LayeredDigraphNetwork";function Ot(a){Iq.call(this,a);this.bb=this.Dg=this.Mh=-1;this.v=NaN;this.G=null;this.valid=!1;this.finish=this.sg=NaN;this.Af=0;this.ek=this.fk=null}na(Ot,Iq); +Ot.prototype.serializeVertexProperties=function(a,b){Iq.prototype.serializeVertexProperties.call(this,a,b);a.layer=this.layer;a.column=this.column;a.index=this.index;a.component=this.component;a.near=this.near?lb(this.near):null;a.valid=this.valid;a.sg=this.sg;a.finish=this.finish;a.Af=this.Af;a.fk=this.fk;a.ek=this.ek}; +Ot.prototype.deserializeVertexProperties=function(a,b,c,d){Iq.prototype.deserializeVertexProperties.call(this,a,b,c,d);this.layer=a.layer;this.column=a.column;this.index=a.index;this.component=a.component;if(b=b.get(a.near))this.near=b;this.valid=a.valid;this.sg=a.sg;this.finish=a.finish;this.Af=a.Af;this.fk=a.fk;this.ek=a.ek}; +oa.Object.defineProperties(Ot.prototype,{layer:{configurable:!0,get:function(){return this.Mh},set:function(a){this.Mh!==a&&(A(a,"number",Ot,"layer"),this.Mh=a)}},column:{configurable:!0,get:function(){return this.Dg},set:function(a){this.Dg!==a&&(A(a,"number",Ot,"column"),this.Dg=a)}},index:{configurable:!0,get:function(){return this.bb},set:function(a){this.bb!==a&&(A(a,"number",Ot,"index"),this.bb=a)}},component:{configurable:!0,get:function(){return this.v}, +set:function(a){this.v!==a&&(A(a,"number",Ot,"component"),this.v=a)}},near:{configurable:!0,get:function(){return this.G},set:function(a){this.G!==a&&(G&&null!==a&&w(a,Ot,Ot,"near"),this.G=a)}}});Ot.className="LayeredDigraphVertex";function Pt(a){Jq.call(this,a);this.j=this.ma=this.Ma=!1;this.$=this.v=NaN;this.G=this.m=0}na(Pt,Jq); +Pt.prototype.serializeEdgeProperties=function(a,b){Jq.prototype.serializeEdgeProperties.call(this,a,b);a.valid=this.valid;a.rev=this.rev;a.forest=this.forest;a.portFromPos=this.portFromPos;a.portToPos=this.portToPos;a.portFromColOffset=this.portFromColOffset;a.portToColOffset=this.portToColOffset}; +Pt.prototype.deserializeEdgeProperties=function(a,b,c,d){Jq.prototype.deserializeEdgeProperties.call(this,a,b,c,d);this.valid=a.valid;this.rev=a.rev;this.forest=a.forest;this.portFromPos=a.portFromPos;this.portToPos=a.portToPos;this.portFromColOffset=a.portFromColOffset;this.portToColOffset=a.portToColOffset}; +oa.Object.defineProperties(Pt.prototype,{fromVertex:{configurable:!0,get:function(){return this.gd},set:function(a){this.gd!==a&&(G&&null!==a&&w(a,Ot,Pt,"fromVertex"),this.gd=a)}},toVertex:{configurable:!0,get:function(){return this.pd},set:function(a){this.pd!==a&&(G&&null!==a&&w(a,Ot,Pt,"toVertex"),this.pd=a)}},valid:{configurable:!0,get:function(){return this.Ma},set:function(a){this.Ma!==a&&(A(a,"boolean",Pt,"valid"),this.Ma=a)}},rev:{configurable:!0, +enumerable:!0,get:function(){return this.ma},set:function(a){this.ma!==a&&(A(a,"boolean",Pt,"rev"),this.ma=a)}},forest:{configurable:!0,get:function(){return this.j},set:function(a){this.j!==a&&(A(a,"boolean",Pt,"forest"),this.j=a)}},portFromPos:{configurable:!0,get:function(){return this.v},set:function(a){this.v!==a&&(A(a,"number",Pt,"portFromPos"),this.v=a)}},portToPos:{configurable:!0,get:function(){return this.$},set:function(a){this.$!==a&&(A(a,"number", +Pt,"portToPos"),this.$=a)}},portFromColOffset:{configurable:!0,get:function(){return this.m},set:function(a){this.m!==a&&(A(a,"number",Pt,"portFromColOffset"),this.m=a)}},portToColOffset:{configurable:!0,get:function(){return this.G},set:function(a){this.G!==a&&(A(a,"number",Pt,"portToColOffset"),this.G=a)}}});Pt.className="LayeredDigraphEdge"; +function Z(a){Di.call(this);this.Wb=new I;this.Qn=Qt;this.wd=Rt;this.lo=St;this.oq=Tt;this.Sv=[];this.ud=!0;this.Tb=Ut;this.Zd=(new Hb(10,10)).freeze();var b=new Vt(this);this.Z=new Wt(b);this.aa=new Wt(b);this.ju=[];a&&Object.assign(this,a)}na(Z,Di);Z.prototype.cloneProtected=function(a){Di.prototype.cloneProtected.call(this,a);a.Qn=this.Qn;a.lo=this.lo;a.oq=this.oq;a.ud=this.ud;a.Tb=this.Tb;a.Zd.assign(this.Zd);a.Z.copyInheritedPropertiesFrom(this.Z);a.aa.copyInheritedPropertiesFrom(this.aa)}; +Z.prototype.ub=function(a){a.classType===Z?0===a.name.indexOf("Alignment")?this.alignment=a:0===a.name.indexOf("Arrangement")?this.arrangement=a:0===a.name.indexOf("Compaction")?this.compaction=a:0===a.name.indexOf("Path")?this.path=a:0===a.name.indexOf("Sorting")?this.sorting=a:0===a.name.indexOf("Style")?this.treeStyle=a:v("Unknown enum value: "+a):Di.prototype.ub.call(this,a)};Z.prototype.createNetwork=function(){return new Vt(this)}; +Z.prototype.makeNetwork=function(a){function b(a){if(a instanceof T)return!a.isLinkLabel&&"Comment"!==a.category;if(a instanceof R){var b=a.fromNode;if(null===b||b.isLinkLabel||"Comment"===b.category)return!1;a=a.toNode;return null===a||a.isLinkLabel||"Comment"===a.category?!1:!0}return!1}var c=this.createNetwork();a instanceof P?(c.qg(a.nodes,!0,b),c.qg(a.links,!0,b)):a instanceof wf?c.qg(a.memberParts,!1,b):c.qg(a.iterator,!1,b);return c}; +Z.prototype.doLayout=function(a){G&&null===a&&v("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.arrangement!==Xt&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var b=this.diagram;null===b&&a instanceof P&&(b=a);this.path===Qt&&null!==b?this.wd=b.isTreePathToChildren?Rt:Yt:this.wd=this.path===Qt?Rt:this.path;if(0<this.network.vertexes.count){this.network.Ao(); +for(a=this.network.vertexes.iterator;a.next();)b=a.value,b.initialized=!1,b.level=0,b.parent=null,b.children=[];if(0<this.Wb.count){a=new I;for(b=this.Wb.iterator;b.next();){var c=b.value;c instanceof T?(c=this.network.ri(c),null!==c&&a.add(c)):c instanceof Wt&&a.add(c)}this.Wb=a}0===this.Wb.count&&this.findRoots();for(a=this.Wb.copy().iterator;a.next();)b=a.value,b.initialized||(b.initialized=!0,Zt(this,b));b=this.network.vertexes;for(a=null;a=$t(b),0<a.count;)b=au(this,a),null!==b&&this.Wb.add(b), +b.initialized=!0,Zt(this,b),b=a;for(a=this.Wb.iterator;a.next();)b=a.value,b instanceof Wt&&bu(this,b);for(a=this.Wb.iterator;a.next();)b=a.value,b instanceof Wt&&cu(this,b);for(a=this.Wb.iterator;a.next();)b=a.value,b instanceof Wt&&du(this,b);this.wu();if(this.layerStyle===eu){a=[];for(b=this.network.vertexes.iterator;b.next();){c=b.value;var d=c.parent;null===d&&(d=c);d=0===d.angle||180===d.angle;var e=a[c.level];void 0===e&&(e=0);a[c.level]=Math.max(e,d?c.width:c.height)}for(b=0;b<a.length;b++)void 0=== +a[b]&&(a[b]=0);this.Sv=a;for(b=this.network.vertexes.iterator;b.next();)c=b.value,d=c.parent,null===d&&(d=c),0===d.angle||180===d.angle?(180===d.angle&&(c.focusX+=a[c.level]-c.width),c.width=a[c.level]):(270===d.angle&&(c.focusY+=a[c.level]-c.height),c.height=a[c.level])}else if(this.layerStyle===fu)for(a=this.network.vertexes.iterator;a.next();){b=a.value;c=0===b.angle||180===b.angle;d=-1;for(e=0;e<b.children.length;e++){var f=b.children[e];d=Math.max(d,c?f.width:f.height)}if(0<=d)for(e=0;e<b.children.length;e++)f= +b.children[e],c?(180===b.angle&&(f.focusX+=d-f.width),f.width=d):(270===b.angle&&(f.focusY+=d-f.height),f.height=d)}for(a=this.Wb.iterator;a.next();)b=a.value,b instanceof Wt&&this.layoutTree(b);this.arrangeTrees();this.updateParts()}this.network=null;this.Wb=new I;this.isValidLayout=!0};function $t(a){var b=new I;for(a=a.iterator;a.next();){var c=a.value;c.initialized||b.add(c)}return b} +Z.prototype.findRoots=function(){for(var a=this.network.vertexes,b=a.iterator;b.next();){var c=b.value;switch(this.wd){case Rt:0===c.sourceEdges.count&&this.Wb.add(c);break;case Yt:0===c.destinationEdges.count&&this.Wb.add(c);break;default:v("Unhandled path value "+this.wd.toString())}}0===this.Wb.count&&(a=au(this,a),null!==a&&this.Wb.add(a))}; +function au(a,b){var c=999999,d=null;for(b=b.iterator;b.next();){var e=b.value;switch(a.wd){case Rt:e.sourceEdges.count<c&&(c=e.sourceEdges.count,d=e);break;case Yt:e.destinationEdges.count<c&&(c=e.destinationEdges.count,d=e);break;default:v("Unhandled path value "+a.wd.toString())}}return d} +function Zt(a,b){if(null!==b){G&&w(b,Wt,Z,"walkTree:v");switch(a.wd){case Rt:if(0<b.destinationEdges.count){for(var c=new H,d=b.destinationVertexes;d.next();){var e=d.value;gu(a,b,e)&&c.add(e)}0<c.count&&(b.children=c.Ka())}break;case Yt:if(0<b.sourceEdges.count){c=new H;for(d=b.sourceVertexes;d.next();)e=d.value,gu(a,b,e)&&c.add(e);0<c.count&&(b.children=c.Ka())}break;default:v("Unhandled path value"+a.wd.toString())}c=b.children;d=c.length;for(e=0;e<d;e++){var f=c[e];f.initialized=!0;f.level=b.level+ +1;f.parent=b;a.Wb.remove(f)}for(b=0;b<d;b++)Zt(a,c[b])}}function gu(a,b,c){G&&w(b,Wt,Z,"walkOK:v");G&&w(c,Wt,Z,"walkOK:c");if(c.initialized){if(null===b)var d=!1;else{G&&w(c,Wt,Z,"isAncestor:a");G&&w(b,Wt,Z,"isAncestor:b");for(d=b.parent;null!==d&&d!==c;)d=d.parent;d=d===c}if(d||c.level>b.level)return!1;a.removeChild(c.parent,c)}return!0} +Z.prototype.removeChild=function(a,b){if(null!==a&&null!==b){G&&w(a,Wt,Z,"removeChild:p");G&&w(b,Wt,Z,"removeChild:c");for(var c=a.children,d=0,e=0;e<c.length;e++)c[e]===b&&d++;if(0<d){d=Array(c.length-d);for(var f=e=0;f<c.length;f++)c[f]!==b&&(d[e++]=c[f]);a.children=d}}}; +function bu(a,b){if(null!==b){G&&w(b,Wt,Z,"initializeTree:v");a.initializeTreeVertexValues(b);b.alignment===hu&&a.sortTreeVertexChildren(b);for(var c=0,d=b.childrenCount,e=0,f=b.children,g=f.length,h=0;h<g;h++){var k=f[h];bu(a,k);c+=k.descendantCount+1;d=Math.max(d,k.maxChildrenCount);e=Math.max(e,k.maxGenerationCount)}b.descendantCount=c;b.maxChildrenCount=d;b.maxGenerationCount=0<d?e+1:0}} +function iu(a,b){G&&w(b,Wt,Z,"mom:v");switch(a.lo){default:case St:return null!==b.parent?b.parent:a.Z;case ju:return null===b.parent?a.Z:null===b.parent.parent?a.aa:b.parent;case ku:return null!==b.parent?null!==b.parent.parent?b.parent.parent:a.aa:a.Z;case lu:var c=!0;if(0===b.childrenCount)c=!1;else for(var d=b.children,e=d.length,f=0;f<e;f++)if(0<d[f].childrenCount){c=!1;break}return c&&null!==b.parent?a.aa:null!==b.parent?b.parent:a.Z}} +Z.prototype.initializeTreeVertexValues=function(a){G&&w(a,Wt,Z,"initializeTreeVertexValues:v");var b=iu(this,a);a.copyInheritedPropertiesFrom(b);if(null!==a.parent&&a.parent.alignment===hu){b=a.angle;for(var c=a.parent.children,d=0;d<c.length&&a!==c[d];)d++;0===d%2?d!==c.length-1&&(b=90===b?180:180===b?270:270===b?180:270):b=90===b?0:180===b?90:270===b?0:90;a.angle=b}a.initialized=!0}; +function cu(a,b){if(null!==b){G&&w(b,Wt,Z,"assignTree:v");a.assignTreeVertexValues(b);b=b.children;for(var c=b.length,d=0;d<c;d++)cu(a,b[d])}}Z.prototype.assignTreeVertexValues=function(){};function du(a,b){if(null!==b){G&&w(b,Wt,Z,"sortTree:v");b.alignment!==hu&&a.sortTreeVertexChildren(b);b=b.children;for(var c=b.length,d=0;d<c;d++)du(a,b[d])}} +Z.prototype.sortTreeVertexChildren=function(a){G&&w(a,Wt,Z,"sortTreeVertexChildren:v");switch(a.sorting){case mu:break;case nu:a.children.reverse();break;case ou:a.children.sort(a.comparer);break;case pu:a.children.sort(a.comparer);a.children.reverse();break;default:v("Unhandled sorting value "+a.sorting.toString())}};Z.prototype.wu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)}; +Z.prototype.addComments=function(a){G&&w(a,Wt,Z,"addComments:v");var b=a.angle,c=a.parent,d=0;var e=!1;null!==c&&(d=c.angle,e=c.alignment,e=qu(e));b=90===b||270===b;d=90===d||270===d;c=0===a.childrenCount;var f=0,g=0,h=0,k=a.commentSpacing;if(null!==a.node)for(var l=a.node.Lu();l.next();){var m=l.value;"Comment"===m.category&&m.canLayout()&&(null===a.comments&&(a.comments=[]),a.comments.push(m),m.eb(),m=m.measuredBounds,b&&!c||!e&&!d&&c||e&&d&&c?(f=Math.max(f,m.width),g+=m.height+Math.abs(h)):(f+= +m.width+Math.abs(h),g=Math.max(g,m.height)),h=k)}null!==a.comments&&(b&&!c||!e&&!d&&c||e&&d&&c?(f+=Math.abs(a.commentMargin),g=Math.max(0,g-a.height)):(g+=Math.abs(a.commentMargin),f=Math.max(0,f-a.width)),e=M.allocAt(0,0,a.bounds.width+f,a.bounds.height+g),a.bounds=e,M.free(e))};function qu(a){return a===ru||a===hu||a===su||a===tu}function uu(a){return a===ru||a===hu} +function vu(a){G&&w(a,Wt,Z,"isLeftSideBus:v");var b=a.parent;if(null!==b){var c=b.alignment;if(qu(c)){if(uu(c)){b=b.children;for(c=0;c<b.length&&a!==b[c];)c++;return 0===c%2}if(c===su)return!0}}return!1} +Z.prototype.layoutComments=function(a){G&&w(a,Wt,Z,"layoutComments:v");if(null!==a.comments){var b=a.node.measuredBounds,c=a.parent,d=a.angle,e=0;var f=!1;null!==c&&(e=c.angle,f=c.alignment,f=qu(f));d=90===d||270===d;c=90===e||270===e;for(var g=0===a.childrenCount,h=vu(a),k=0,l=a.comments,m=l.length,n=K.alloc(),p=0;p<m;p++){var r=l[p],q=r.measuredBounds;if(d&&!g||!f&&!c&&g||f&&c&&g){if(135<e&&!f||c&&h)if(0<=a.commentMargin)for(n.h(a.bounds.x-a.commentMargin-q.width,a.bounds.y+k),r.move(n),r=r.Qd();r.next();){var u= +r.value;u.fromSpot=pd;u.toSpot=qd}else for(n.h(a.bounds.x+2*a.focus.x-a.commentMargin,a.bounds.y+k),r.move(n),r=r.Qd();r.next();)u=r.value,u.fromSpot=qd,u.toSpot=pd;else if(0<=a.commentMargin)for(n.h(a.bounds.x+2*a.focus.x+a.commentMargin,a.bounds.y+k),r.move(n),r=r.Qd();r.next();)u=r.value,u.fromSpot=qd,u.toSpot=pd;else for(n.h(a.bounds.x+a.commentMargin-q.width,a.bounds.y+k),r.move(n),r=r.Qd();r.next();)u=r.value,u.fromSpot=pd,u.toSpot=qd;k=0<=a.commentSpacing?k+(q.height+a.commentSpacing):k+(a.commentSpacing- +q.height)}else{if(135<e&&!f||!c&&h)if(0<=a.commentMargin)for(n.h(a.bounds.x+k,a.bounds.y-a.commentMargin-q.height),r.move(n),r=r.Qd();r.next();)u=r.value,u.fromSpot=md,u.toSpot=rd;else for(n.h(a.bounds.x+k,a.bounds.y+2*a.focus.y-a.commentMargin),r.move(n),r=r.Qd();r.next();)u=r.value,u.fromSpot=rd,u.toSpot=md;else if(0<=a.commentMargin)for(n.h(a.bounds.x+k,a.bounds.y+2*a.focus.y+a.commentMargin),r.move(n),r=r.Qd();r.next();)u=r.value,u.fromSpot=rd,u.toSpot=md;else for(n.h(a.bounds.x+k,a.bounds.y+ +a.commentMargin-q.height),r.move(n),r=r.Qd();r.next();)u=r.value,u.fromSpot=md,u.toSpot=rd;k=0<=a.commentSpacing?k+(q.width+a.commentSpacing):k+(a.commentSpacing-q.width)}}K.free(n);b=k-a.commentSpacing-(d?b.height:b.width);if(this.wd===Rt)for(a=a.destinationEdges;a.next();)e=a.value.link,null===e||e.isAvoiding||(e.fromEndSegmentLength=0<b?b:NaN);else for(a=a.sourceEdges;a.next();)e=a.value.link,null===e||e.isAvoiding||(e.toEndSegmentLength=0<b?b:NaN)}}; +Z.prototype.layoutTree=function(a){if(null!==a){G&&w(a,Wt,Z,"layoutTree:v");for(var b=a.children,c=b.length,d=0;d<c;d++)this.layoutTree(b[d]);switch(a.compaction){case wu:xu(this,a);break;case yu:if(a.alignment===hu)xu(this,a);else if(G&&w(a,Wt,Z,"layoutTreeBlock:v"),0===a.childrenCount)d=a.parent,c=!1,b=0,null!==d&&(b=d.angle,c=d.alignment,c=qu(c)),d=vu(a),a.V.h(0,0),a.Ia.h(a.width,a.height),null===a.parent||null===a.comments||(180!==b&&270!==b||c)&&!d?a.qa.h(0,0):180===b&&!c||(90===b||270===b)&& +d?a.qa.h(a.width-2*a.focus.x,0):a.qa.h(0,a.height-2*a.focus.y),a.Oo=null,a.$o=null;else{var e=zu(a);b=90===e||270===e;var f=0,g=a.children,h=g.length;for(c=0;c<h;c++)d=g[c],f=Math.max(f,b?d.Ia.width:d.Ia.height);var k=a.alignment;d=k===Au;var l=k===Bu,m=qu(k),n=Math.max(0,a.breadthLimit);c=Eu(a);var p=a.nodeSpacing,r=Fu(a),q=a.rowSpacing,u=0;if(d||l||a.cm||a.dm&&1===a.maxGenerationCount)u=Math.max(0,a.rowIndent);d=a.width;var x=a.height,y=0,z=0,B=0,C=null,D=null,J=0,U=0,aa=0,Y=0,W=0,Q=0,la=0,fa=0; +m&&!uu(k)&&135<e&&g.reverse();if(uu(k))if(1<h)for(var za=0;za<h;za++)0===za%2&&za!==h-1&&(fa=Math.max(fa,b?g[za].Ia.width:g[za].Ia.height));else 1===h&&(fa=b?g[0].Ia.width:g[0].Ia.height);if(m){switch(k){case ru:z=135>e?Gu(a,g,fa,y,z):Hu(a,g,fa,y,z);fa=z.x;y=z.width;z=z.height;break;case su:for(C=0;C<h;C++)D=g[C],n=D.Ia,B=0===Q?0:q,b?(D.V.h(f-n.width,Y+B),y=Math.max(y,n.width),z=Math.max(z,Y+B+n.height),Y+=B+n.height):(D.V.h(aa+B,f-n.height),y=Math.max(y,aa+B+n.width),z=Math.max(z,n.height),aa+=B+ +n.width),Q++;break;case tu:for(C=0;C<h;C++)D=g[C],f=D.Ia,n=0===Q?0:q,b?(D.V.h(p/2+a.focus.x,Y+n),y=Math.max(y,f.width),z=Math.max(z,Y+n+f.height),Y+=n+f.height):(D.V.h(aa+n,p/2+a.focus.y),y=Math.max(y,aa+n+f.width),z=Math.max(z,f.height),aa+=n+f.width),Q++}C=Iu(this,2);D=Iu(this,2);b?(C[0].h(0,0),C[1].h(0,z),D[0].h(y,0)):(C[0].h(0,0),C[1].h(y,0),D[0].h(0,z));D[1].h(y,z)}else for(za=0;za<h;za++){var Ma=g[za],sb=Ma.Ia;if(b){0<n&&0<Q&&aa+p+sb.width>n&&(aa<f&&Ju(a,k,f-aa,0,la,za-1),W++,Q=0,la=za,B=z, +aa=0,Y=135<e?-z-q:z+q);Ku(this,Ma,0,Y);var wb=0;if(0===Q){if(C=Ma.Oo,D=Ma.$o,J=sb.width,U=sb.height,null===C||null===D||e!==zu(Ma))C=Iu(this,2),D=Iu(this,2),C[0].h(0,0),C[1].h(0,U),D[0].h(J,0),D[1].h(J,U)}else{var Wb=Na();U=Lu(this,a,Ma,C,D,J,U,Wb);wb=U.x;C=Wb[0];D=Wb[1];J=U.width;U=U.height;Pa(Wb);aa<sb.width&&0>wb&&(Mu(a,-wb,0,la,za-1),Nu(C,-wb,0),Nu(D,-wb,0),wb=0)}Ma.V.h(wb,Y);y=Math.max(y,J);z=Math.max(z,B+(0===W?0:q)+sb.height);aa=J}else{0<n&&0<Q&&Y+p+sb.height>n&&(Y<f&&Ju(a,k,0,f-Y,la,za-1), +W++,Q=0,la=za,B=y,Y=0,aa=135<e?-y-q:y+q);Ku(this,Ma,aa,0);wb=0;if(0===Q){if(C=Ma.Oo,D=Ma.$o,J=sb.width,U=sb.height,null===C||null===D||e!==zu(Ma))C=Iu(this,2),D=Iu(this,2),C[0].h(0,0),C[1].h(J,0),D[0].h(0,U),D[1].h(J,U)}else Wb=Na(),U=Lu(this,a,Ma,C,D,J,U,Wb),wb=U.x,C=Wb[0],D=Wb[1],J=U.width,U=U.height,Pa(Wb),Y<sb.height&&0>wb&&(Mu(a,0,-wb,la,za-1),Nu(C,0,-wb),Nu(D,0,-wb),wb=0);Ma.V.h(aa,wb);z=Math.max(z,U);y=Math.max(y,B+(0===W?0:q)+sb.width);Y=U}Q++}0<W&&(b?(z+=Math.max(0,c),aa<y&&Ju(a,k,y-aa,0, +la,h-1),0<u&&(l||Mu(a,u,0,0,h-1),y+=u)):(y+=Math.max(0,c),Y<z&&Ju(a,k,0,z-Y,la,h-1),0<u&&(l||Mu(a,0,u,0,h-1),z+=u)));u=l=0;switch(k){case Ou:b?l+=y/2-a.focus.x-r/2:u+=z/2-a.focus.y-r/2;break;case Pu:0<W?b?l+=y/2-a.focus.x-r/2:u+=z/2-a.focus.y-r/2:b?(fa=g[0].V.x+g[0].qa.x,l+=fa+(g[h-1].V.x+g[h-1].qa.x+2*g[h-1].focus.x-fa)/2-a.focus.x-r/2):(fa=g[0].V.y+g[0].qa.y,u+=fa+(g[h-1].V.y+g[h-1].qa.y+2*g[h-1].focus.y-fa)/2-a.focus.y-r/2);break;case Au:b?(l-=r,y+=r):(u-=r,z+=r);break;case Bu:b?(l+=y-a.width+ +r,y+=r):(u+=z-a.height+r,z+=r);break;case ru:b?1<h?l+=fa+p/2-a.focus.x:l+=g[0].focus.x-a.focus.x+g[0].qa.x:1<h?u+=fa+p/2-a.focus.y:u+=g[0].focus.y-a.focus.y+g[0].qa.y;break;case su:b?l+=y+p/2-a.focus.x:u+=z+p/2-a.focus.y;break;case tu:break;default:v("Unhandled alignment value "+k.toString())}for(r=0;r<h;r++)fa=g[r],b?fa.V.h(fa.V.x+fa.qa.x-l,fa.V.y+(135<e?(m?-z:-fa.Ia.height)+fa.qa.y-c:x+c+fa.qa.y)):fa.V.h(fa.V.x+(135<e?(m?-y:-fa.Ia.width)+fa.qa.x-c:d+c+fa.qa.x),fa.V.y+fa.qa.y-u);h=g=0;m?b?(y=Qu(a, +y,l),0>l&&(l=0),135<e&&(u+=z+c),z+=x+c,k===tu&&(g+=p/2+a.focus.x),h+=x+c):(135<e&&(l+=y+c),y+=d+c,z=Ru(a,z,u),0>u&&(u=0),k===tu&&(h+=p/2+a.focus.y),g+=d+c):b?(null===a.comments?d>y&&(y=Su(k,d-y,0),g=y.x,h=y.y,y=d,l=0):y=Qu(a,y,l),0>l&&(g-=l,l=0),135<e&&(u+=z+c),z=Math.max(Math.max(z,x),z+x+c),h+=x+c):(135<e&&(l+=y+c),y=Math.max(Math.max(y,d),y+d+c),null===a.comments?x>z&&(z=Su(k,0,x-z),g=z.x,h=z.y,z=x,u=0):z=Ru(a,z,u),0>u&&(h-=u,u=0),g+=d+c);if(0<W)e=Iu(this,4),W=Iu(this,4),b?(e[2].h(0,x+c),e[3].h(e[2].x, +z),W[2].h(y,e[2].y),W[3].h(W[2].x,e[3].y)):(e[2].h(d+c,0),e[3].h(y,e[2].y),W[2].h(e[2].x,z),W[3].h(e[3].x,W[2].y));else{e=Iu(this,C.length+2);W=Iu(this,D.length+2);for(k=0;k<C.length;k++)m=C[k],e[k+2].h(m.x+g,m.y+h);for(k=0;k<D.length;k++)m=D[k],W[k+2].h(m.x+g,m.y+h)}b?(e[0].h(l,0),e[1].h(e[0].x,x),e[2].y<e[1].y&&(e[2].x>e[0].x?e[2].assign(e[1]):e[1].assign(e[2])),e[3].y<e[2].y&&(e[3].x>e[0].x?e[3].assign(e[2]):e[2].assign(e[3])),W[0].h(l+d,0),W[1].h(W[0].x,x),W[2].y<W[1].y&&(W[2].x<W[0].x?W[2].assign(W[1]): +W[1].assign(W[2])),W[3].y<W[2].y&&(W[3].x<W[0].x?W[3].assign(W[2]):W[2].assign(W[3])),e[2].y-=c/2,W[2].y-=c/2):(e[0].h(0,u),e[1].h(d,e[0].y),e[2].x<e[1].x&&(e[2].y>e[0].y?e[2].assign(e[1]):e[1].assign(e[2])),e[3].x<e[2].x&&(e[3].y>e[0].y?e[3].assign(e[2]):e[2].assign(e[3])),W[0].h(0,u+x),W[1].h(d,W[0].y),W[2].x<W[1].x&&(W[2].y<W[0].y?W[2].assign(W[1]):W[1].assign(W[2])),W[3].x<W[2].x&&(W[3].y<W[0].y?W[3].assign(W[2]):W[2].assign(W[3])),e[2].x-=c/2,W[2].x-=c/2);Tu(this,C);Tu(this,D);a.Oo=e;a.$o=W; +a.qa.h(l,u);a.Ia.h(y,z)}break;default:v("Unhandled compaction value "+a.compaction.toString())}}}; +function xu(a,b){G&&w(b,Wt,Z,"layoutTreeNone:v");if(0===b.childrenCount){var c=!1,d=0;null!==b.parent&&(d=b.parent.angle,c=b.parent.alignment,c=qu(c));var e=vu(b);b.V.h(0,0);b.Ia.h(b.width,b.height);null===b.parent||null===b.comments||(180!==d&&270!==d||c)&&!e?b.qa.h(0,0):180===d&&!c||(90===d||270===d)&&e?b.qa.h(b.width-2*b.focus.x,0):b.qa.h(0,b.height-2*b.focus.y)}else{d=zu(b);c=90===d||270===d;var f=0;e=b.children;for(var g=e.length,h=0;h<g;h++){var k=e[h];f=Math.max(f,c?k.Ia.width:k.Ia.height)}var l= +b.alignment,m=l===Au,n=l===Bu;h=qu(l);var p=Math.max(0,b.breadthLimit);k=Eu(b);var r=b.nodeSpacing,q=Fu(b),u=m||n?0:q/2,x=b.rowSpacing,y=0;if(m||n||b.cm||b.dm&&1===b.maxGenerationCount)y=Math.max(0,b.rowIndent);m=b.width;var z=b.height,B=0,C=0,D=0,J=0,U=0,aa=0,Y=0,W=0,Q=0,la=0;h&&!uu(l)&&135<d&&e.reverse();if(uu(l))if(1<g)for(var fa=0;fa<g;fa++){var za=e[fa],Ma=za.Ia;0===fa%2&&fa!==g-1?Q=Math.max(Q,(c?Ma.width:Ma.height)+Uu(za)-r):0!==fa%2&&(la=Math.max(la,(c?Ma.width:Ma.height)+Uu(za)-r))}else 1=== +g&&(Q=c?e[0].Ia.width:e[0].Ia.height);if(h)switch(l){case ru:case hu:C=135>d?Gu(b,e,Q,B,C):Hu(b,e,Q,B,C);Q=C.x;B=C.width;C=C.height;break;case su:for(a=0;a<g;a++)p=e[a],u=p.Ia,D=0===Y?0:x,c?(p.V.h(f-u.width,U+D),B=Math.max(B,u.width),C=Math.max(C,U+D+u.height),U+=D+u.height):(p.V.h(J+D,f-u.height),B=Math.max(B,J+D+u.width),C=Math.max(C,u.height),J+=D+u.width),Y++;break;case tu:for(f=0;f<g;f++)a=e[f],p=a.Ia,u=0===Y?0:x,c?(a.V.h(r/2+b.focus.x,U+u),B=Math.max(B,p.width),C=Math.max(C,U+u+p.height),U+= +u+p.height):(a.V.h(J+u,r/2+b.focus.y),B=Math.max(B,J+u+p.width),C=Math.max(C,p.height),J+=u+p.width),Y++}else for(la=0;la<g;la++)fa=e[la],za=fa.Ia,c?(0<p&&0<Y&&J+r+za.width>p&&(J<f&&Ju(b,l,f-J,0,W,la-1),aa++,Y=0,W=la,D=C,J=0,U=135<d?-C-x:C+x),Ma=0===Y?u:r,Ku(a,fa,0,U),fa.V.h(J+Ma,U),B=Math.max(B,J+Ma+za.width),C=Math.max(C,D+(0===aa?0:x)+za.height),J+=Ma+za.width):(0<p&&0<Y&&U+r+za.height>p&&(U<f&&Ju(b,l,0,f-U,W,la-1),aa++,Y=0,W=la,D=B,U=0,J=135<d?-B-x:B+x),Ma=0===Y?u:r,Ku(a,fa,J,0),fa.V.h(J,U+Ma), +C=Math.max(C,U+Ma+za.height),B=Math.max(B,D+(0===aa?0:x)+za.width),U+=Ma+za.height),Y++;0<aa&&(c?(C+=Math.max(0,k),J<B&&Ju(b,l,B-J,0,W,g-1),0<y&&(n||Mu(b,y,0,0,g-1),B+=y)):(B+=Math.max(0,k),U<C&&Ju(b,l,0,C-U,W,g-1),0<y&&(n||Mu(b,0,y,0,g-1),C+=y)));y=n=0;switch(l){case Ou:c?n+=B/2-b.focus.x-q/2:y+=C/2-b.focus.y-q/2;break;case Pu:0<aa?c?n+=B/2-b.focus.x-q/2:y+=C/2-b.focus.y-q/2:c?(l=e[0].V.x+e[0].qa.x,n+=l+(e[g-1].V.x+e[g-1].qa.x+2*e[g-1].focus.x-l)/2-b.focus.x-q/2):(l=e[0].V.y+e[0].qa.y,y+=l+(e[g- +1].V.y+e[g-1].qa.y+2*e[g-1].focus.y-l)/2-b.focus.y-q/2);break;case Au:c?(n-=q,B+=q):(y-=q,C+=q);break;case Bu:c?(n+=B-b.width+q,B+=q):(y+=C-b.height+q,C+=q);break;case ru:case hu:c?1<g?n+=Q+r/2-b.focus.x:n+=e[0].focus.x-b.focus.x+e[0].qa.x:1<g?y+=Q+r/2-b.focus.y:y+=e[0].focus.y-b.focus.y+e[0].qa.y;break;case su:c?n+=B+r/2-b.focus.x:y+=C+r/2-b.focus.y;break;case tu:break;default:v("Unhandled alignment value "+l.toString())}for(q=0;q<g;q++)l=e[q],c?l.V.h(l.V.x+l.qa.x-n,l.V.y+(135<d?(h?-C:-l.Ia.height)+ +l.qa.y-k:z+k+l.qa.y)):l.V.h(l.V.x+(135<d?(h?-B:-l.Ia.width)+l.qa.x-k:m+k+l.qa.x),l.V.y+l.qa.y-y);c?(B=Qu(b,B,n),0>n&&(n=0),135<d&&(y+=C+k),C=Math.max(Math.max(C,z),C+z+k)):(135<d&&(n+=B+k),B=Math.max(Math.max(B,m),B+m+k),C=Ru(b,C,y),0>y&&(y=0));b.qa.h(n,y);b.Ia.h(B,C)}} +function Gu(a,b,c,d,e){G&&w(a,Wt,Z,"layoutBusChildrenPosDir:v");var f=b.length;if(0===f)return new M(c,0,d,e);if(1===f)return a=b[0],d=a.Ia.width,e=a.Ia.height,new M(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=90===zu(a),l=0,m=0,n=0,p=0;p<f;p++)if(!(0!==p%2||1<f&&p===f-1)){var r=b[p],q=r.Ia,u=0===l?0:h;if(k){var x=Uu(r)-g;r.V.h(c-(q.width+x),n+u);d=Math.max(d,q.width+x);e=Math.max(e,n+u+q.height);n+=u+q.height}else x=Uu(r)-g,r.V.h(m+u,c-(q.height+x)),e=Math.max(e,q.height+x),d=Math.max(d,m+ +u+q.width),m+=u+q.width;l++}l=0;r=m;p=n;k?(m=c+g,n=0):(m=0,n=c+g);for(q=0;q<f;q++)if(0!==q%2){u=b[q];x=u.Ia;var y=0===l?0:h;if(k){var z=Uu(u)-g;u.V.h(m+z,n+y);d=Math.max(d,m+x.width+z);e=Math.max(e,n+y+x.height);n+=y+x.height}else z=Uu(u)-g,u.V.h(m+y,n+z),d=Math.max(d,m+y+x.width),e=Math.max(e,n+x.height+z),m+=y+x.width;l++}1<f&&1===f%2&&(b=b[f-1],f=b.Ia,h=Vu(b),k?(b.V.h(c+g/2-b.focus.x-b.qa.x,e+h),k=c+g/2-b.focus.x-b.qa.x,d=Math.max(d,k+f.width),0>k&&(d-=k),e=Math.max(e,Math.max(p,n)+h+f.height), +0>b.V.x&&(c=Wu(a,b.V.x,!1,c,g))):(b.V.h(d+h,c+g/2-b.focus.y-b.qa.y),d=Math.max(d,Math.max(r,m)+h+f.width),n=c+g/2-b.focus.y-b.qa.y,e=Math.max(e,n+f.height),0>n&&(e-=n),0>b.V.y&&(c=Wu(a,b.V.y,!0,c,g))));return new M(c,0,d,e)} +function Hu(a,b,c,d,e){G&&w(a,Wt,Z,"layoutBusChildrenNegDir:v");var f=b.length;if(0===f)return new M(c,0,d,e);if(1===f)return b=b[0],d=b.Ia.width,e=b.Ia.height,new M(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=270===zu(a),l=0,m=0,n=0,p=0;p<f;p++)if(!(0!==p%2||1<f&&p===f-1)){var r=b[p],q=r.Ia,u=0===l?0:h;if(k){var x=Uu(r)-g;n-=u+q.height;r.V.h(c-(q.width+x),n);d=Math.max(d,q.width+x);e=Math.max(e,Math.abs(n))}else x=Uu(r)-g,m-=u+q.width,r.V.h(m,c-(q.height+x)),e=Math.max(e,q.height+x),d=Math.max(d, +Math.abs(m));l++}l=0;r=m;p=n;k?(m=c+g,n=0):(m=0,n=c+g);for(q=0;q<f;q++)if(0!==q%2){u=b[q];x=u.Ia;var y=0===l?0:h;if(k){var z=Uu(u)-g;n-=y+x.height;u.V.h(m+z,n);d=Math.max(d,m+x.width+z);e=Math.max(e,Math.abs(n))}else z=Uu(u)-g,m-=y+x.width,u.V.h(m,n+z),e=Math.max(e,n+x.height+z),d=Math.max(d,Math.abs(m));l++}1<f&&1===f%2&&(h=b[f-1],l=h.Ia,q=Vu(h),k?(h.V.h(c+g/2-h.focus.x-h.qa.x,-e-l.height-q),m=c+g/2-h.focus.x-h.qa.x,d=Math.max(d,m+l.width),0>m&&(d-=m),e=Math.max(e,Math.abs(Math.min(p,n))+q+l.height), +0>h.V.x&&(c=Wu(a,h.V.x,!1,c,g))):(h.V.h(-d-l.width-q,c+g/2-h.focus.y-h.qa.y),d=Math.max(d,Math.abs(Math.min(r,m))+q+l.width),n=c+g/2-h.focus.y-h.qa.y,e=Math.max(e,n+l.height),0>n&&(e-=n),0>h.V.y&&(c=Wu(a,h.V.y,!0,c,g))));for(a=0;a<f;a++)g=b[a],k?g.V.h(g.V.x,g.V.y+e):g.V.h(g.V.x+d,g.V.y);return new M(c,0,d,e)}function Uu(a){G&&w(a,Wt,Z,"fixRelativePostions:child");return null===a.parent?0:a.parent.nodeSpacing} +function Vu(a){G&&w(a,Wt,Z,"fixRelativePostions:lastchild");return null===a.parent?0:a.parent.rowSpacing}function Wu(a,b,c,d,e){G&&w(a,Wt,Z,"fixRelativePostions:v");a=a.children;for(var f=a.length,g=0;g<f;g++)c?a[g].V.h(a[g].V.x,a[g].V.y-b):a[g].V.h(a[g].V.x-b,a[g].V.y);b=a[f-1];return Math.max(d,c?b.qa.y+b.focus.y-e/2:b.qa.x+b.focus.x-e/2)} +function Qu(a,b,c){G&&w(a,Wt,Z,"calculateSubwidth:v");switch(a.alignment){case Pu:case Ou:return c+a.width>b&&(b=c+a.width),0>c&&(b-=c),b;case Au:return a.width>b?a.width:b;case Bu:return 2*a.focus.x>b?a.width:b+a.width-2*a.focus.x;case ru:case hu:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case su:return a.width-a.focus.x+a.nodeSpacing/2+b;case tu:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}} +function Ru(a,b,c){G&&w(a,Wt,Z,"calculateSubheight:v");switch(a.alignment){case Pu:case Ou:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case Au:return a.height>b?a.height:b;case Bu:return 2*a.focus.y>b?a.height:b+a.height-2*a.focus.y;case ru:case hu:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case su:return a.height-a.focus.y+a.nodeSpacing/2+b;case tu:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}} +function Su(a,b,c){G&&w(a,F,Z,"alignOffset:align");switch(a){case Ou:b/=2;c/=2;break;case Pu:b/=2;c/=2;break;case Au:c=b=0;break;case Bu:break;default:v("Unhandled alignment value "+a.toString())}return new K(b,c)}function Ju(a,b,c,d,e,f){G&&w(a,Wt,Z,"shiftRelPosAlign:v");G&&w(b,F,Z,"shiftRelPosAlign:align");b=Su(b,c,d);Mu(a,b.x,b.y,e,f)}function Mu(a,b,c,d,e){G&&w(a,Wt,Z,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].V;f.x+=b;f.y+=c}} +function Ku(a,b,c,d){G&&(w(b,Wt,Z,"recordMidPoints:v"),A(c,"number",Z,"recordMidPoints:x"),A(d,"number",Z,"recordMidPoints:y"));var e=b.parent;switch(a.wd){case Rt:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex===e&&b.relativePoint.h(c,d);break;case Yt:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex===e&&b.relativePoint.h(c,d);break;default:v("Unhandled path value "+a.wd.toString())}}function Nu(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];e.x+=b;e.y+=c}} +function Lu(a,b,c,d,e,f,g,h){G&&w(b,Wt,Z,"mergeFringes:parent");G&&w(c,Wt,Z,"mergeFringes:child");var k=zu(b),l=90===k||270===k,m=b.nodeSpacing;b=d;var n=e;d=f;var p=g,r=c.Oo,q=c.$o;g=c.Ia;var u=l?Math.max(p,g.height):Math.max(d,g.width);if(null===r||k!==zu(c))r=Iu(a,2),q=Iu(a,2),l?(r[0].h(0,0),r[1].h(0,g.height),q[0].h(g.width,0),q[1].h(q[0].x,r[1].y)):(r[0].h(0,0),r[1].h(g.width,0),q[0].h(0,g.height),q[1].h(r[1].x,q[0].y));if(l){p=9999999;if(!(null===n||2>n.length||null===r||2>r.length))for(e=c= +0;c<n.length&&e<r.length;){f=n[c];var x=r[e];k=x.x;l=x.y;k+=d;var y=f;c+1<n.length&&(y=n[c+1]);var z=x;x=z.x;z=z.y;e+1<r.length&&(z=r[e+1],x=z.x,z=z.y,x+=d);var B=p;f.y===l?B=k-f.x:f.y>l&&f.y<z?B=k+(f.y-l)/(z-l)*(x-k)-f.x:l>f.y&&l<y.y&&(B=k-(f.x+(l-f.y)/(y.y-f.y)*(y.x-f.x)));B<p&&(p=B);y.y<=f.y?c++:z<=l?e++:(y.y<=z&&c++,z<=y.y&&e++)}p=d-p;p+=m;c=r;e=p;if(null===b||2>b.length||null===c||2>c.length)d=null;else{m=Iu(a,b.length+c.length);for(d=f=k=0;f<c.length&&c[f].y<b[0].y;)l=c[f++],m[d++].h(l.x+e, +l.y);for(;k<b.length;)l=b[k++],m[d++].h(l.x,l.y);for(k=b[b.length-1].y;f<c.length&&c[f].y<=k;)f++;for(;f<c.length&&c[f].y>k;)l=c[f++],m[d++].h(l.x+e,l.y);c=Iu(a,d);for(k=0;k<d;k++)c[k].assign(m[k]);Tu(a,m);d=c}f=q;k=p;if(null===n||2>n.length||null===f||2>f.length)e=null;else{m=Iu(a,n.length+f.length);for(e=l=c=0;c<n.length&&n[c].y<f[0].y;)y=n[c++],m[e++].h(y.x,y.y);for(;l<f.length;)y=f[l++],m[e++].h(y.x+k,y.y);for(f=f[f.length-1].y;c<n.length&&n[c].y<=f;)c++;for(;c<n.length&&n[c].y>f;)k=n[c++],m[e++].h(k.x, +k.y);f=Iu(a,e);for(c=0;c<e;c++)f[c].assign(m[c]);Tu(a,m);e=f}f=Math.max(0,p)+g.width;g=u;Tu(a,b);Tu(a,r);Tu(a,n);Tu(a,q);h[0]=d;h[1]=e;return new M(p,0,f,g)}d=9999999;if(!(null===n||2>n.length||null===r||2>r.length))for(e=c=0;c<n.length&&e<r.length;)f=n[c],x=r[e],k=x.x,l=x.y,l+=p,y=f,c+1<n.length&&(y=n[c+1]),z=x,x=z.x,z=z.y,e+1<r.length&&(z=r[e+1],x=z.x,z=z.y,z+=p),B=d,f.x===k?B=l-f.y:f.x>k&&f.x<x?B=l+(f.x-k)/(x-k)*(z-l)-f.y:k>f.x&&k<y.x&&(B=l-(f.y+(k-f.x)/(y.x-f.x)*(y.y-f.y))),B<d&&(d=B),y.x<=f.x? +c++:x<=k?e++:(y.x<=x&&c++,x<=y.x&&e++);p-=d;p+=m;c=r;e=p;if(null===b||2>b.length||null===c||2>c.length)d=null;else{m=Iu(a,b.length+c.length);for(d=f=k=0;f<c.length&&c[f].x<b[0].x;)l=c[f++],m[d++].h(l.x,l.y+e);for(;k<b.length;)l=b[k++],m[d++].h(l.x,l.y);for(k=b[b.length-1].x;f<c.length&&c[f].x<=k;)f++;for(;f<c.length&&c[f].x>k;)l=c[f++],m[d++].h(l.x,l.y+e);c=Iu(a,d);for(k=0;k<d;k++)c[k].assign(m[k]);Tu(a,m);d=c}f=q;k=p;if(null===n||2>n.length||null===f||2>f.length)e=null;else{m=Iu(a,n.length+f.length); +for(e=l=c=0;c<n.length&&n[c].x<f[0].x;)y=n[c++],m[e++].h(y.x,y.y);for(;l<f.length;)y=f[l++],m[e++].h(y.x,y.y+k);for(f=f[f.length-1].x;c<n.length&&n[c].x<=f;)c++;for(;c<n.length&&n[c].x>f;)k=n[c++],m[e++].h(k.x,k.y);f=Iu(a,e);for(c=0;c<e;c++)f[c].assign(m[c]);Tu(a,m);e=f}f=u;g=Math.max(0,p)+g.height;Tu(a,b);Tu(a,r);Tu(a,n);Tu(a,q);h[0]=d;h[1]=e;return new M(p,0,f,g)}function Iu(a,b){a=a.ju[b];if(void 0!==a&&(a=a.pop(),void 0!==a))return a;a=[];for(var c=0;c<b;c++)a[c]=new K;return a} +function Tu(a,b){var c=b.length,d=a.ju[c];void 0===d&&(d=[],a.ju[c]=d);d.push(b)} +Z.prototype.arrangeTrees=function(){if(this.Tb===Xt)for(var a=this.Wb.iterator;a.next();){var b=a.value;if(b instanceof Wt){var c=b.node;if(null!==c){var d=c.position;c=d.x;d=d.y;isFinite(c)||(c=0);isFinite(d)||(d=0);Xu(this,b,c,d)}}}else{a=[];for(b=this.Wb.iterator;b.next();)c=b.value,c instanceof Wt&&a.push(c);switch(this.sorting){case mu:break;case nu:a.reverse();break;case ou:a.sort(this.comparer);break;case pu:a.sort(this.comparer);a.reverse();break;default:v("Unhandled sorting value "+this.sorting.toString())}c= +this.arrangementOrigin;b=c.x;c=c.y;for(d=0;d<a.length;d++){var e=a[d];Xu(this,e,b+e.qa.x,c+e.qa.y);switch(this.Tb){case Ut:c+=e.Ia.height+this.Zd.height;break;case Yu:b+=e.Ia.width+this.Zd.width;break;default:v("Unhandled arrangement value "+this.Tb.toString())}}}};function Xu(a,b,c,d){if(null!==b){G&&w(b,Wt,Z,"assignAbsolutePositions:v");b.x=c;b.y=d;b=b.children;for(var e=b.length,f=0;f<e;f++){var g=b[f];Xu(a,g,c+g.V.x,d+g.V.y)}}} +Z.prototype.commitLayout=function(){this.sv();this.commitNodes();this.Au();this.isRouting&&this.commitLinks()};Z.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)}; +Z.prototype.Au=function(){if(this.layerStyle===eu){for(var a=this.Sv,b=[],c=null,d=this.network.vertexes.iterator;d.next();){var e=d.value;null===c?c=e.bounds.copy():c.cd(e.bounds);var f=b[e.level];void 0===f?f=Eu(e):f=Math.max(f,Eu(e));b[e.level]=f}for(d=0;d<b.length;d++)void 0===b[d]&&(b[d]=0);90===this.angle||270===this.angle?(c.Bc(this.nodeSpacing/2,this.layerSpacing),d=new K(-this.nodeSpacing/2,-this.layerSpacing/2)):(c.Bc(this.layerSpacing,this.nodeSpacing/2),d=new K(-this.layerSpacing/2,-this.nodeSpacing/ +2));e=[];c=90===this.angle||270===this.angle?c.width:c.height;f=0;if(180===this.angle||270===this.angle)for(var g=0;g<a.length;g++)f+=a[g]+b[g];for(g=0;g<a.length;g++){var h=a[g]+b[g];270===this.angle?(f-=h,e.push(new M(0,f,c,h))):90===this.angle?(e.push(new M(0,f,c,h)),f+=h):180===this.angle?(f-=h,e.push(new M(f,0,h,c))):(e.push(new M(f,0,h,c)),f+=h)}this.commitLayers(e,d)}};Z.prototype.commitLayers=function(){};Z.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()}; +Z.prototype.sv=function(){for(var a=this.Wb.iterator;a.next();){var b=a.value;b instanceof Wt&&Zu(this,b)}};function Zu(a,b){if(null!==b){G&&w(b,Wt,Z,"setPortSpotsTree:v");a.setPortSpots(b);b=b.children;for(var c=b.length,d=0;d<c;d++)Zu(a,b[d])}} +Z.prototype.setPortSpots=function(a){G&&w(a,Wt,Z,"setPortSpots:v");var b=a.alignment;if(qu(b)){G&&w(a,Wt,Z,"setPortSpotsBus:v");G&&w(b,F,Z,"setPortSpots:align");var c=this.wd===Rt,d=zu(a);switch(d){case 0:var e=qd;break;case 90:e=rd;break;case 180:e=pd;break;default:e=md}var f=a.children,g=f.length;switch(b){case ru:case hu:for(b=0;b<g;b++){var h=f[b];h=(c?h.sourceEdges:h.destinationEdges).first();if(null!==h&&(h=h.link,null!==h)){var k=90===d||270===d?pd:md;if(1===g||b===g-1&&1===g%2)switch(d){case 0:k= +pd;break;case 90:k=md;break;case 180:k=qd;break;default:k=rd}else 0===b%2&&(k=90===d||270===d?qd:rd);c?(a.setsPortSpot&&(h.fromSpot=e),a.setsChildPortSpot&&(h.toSpot=k)):(a.setsPortSpot&&(h.fromSpot=k),a.setsChildPortSpot&&(h.toSpot=e))}}break;case su:d=90===d||270===d?qd:rd;for(f=c?a.destinationEdges:a.sourceEdges;f.next();)g=f.value.link,null!==g&&(c?(a.setsPortSpot&&(g.fromSpot=e),a.setsChildPortSpot&&(g.toSpot=d)):(a.setsPortSpot&&(g.fromSpot=d),a.setsChildPortSpot&&(g.toSpot=e)));break;case tu:for(d= +90===d||270===d?pd:md,f=c?a.destinationEdges:a.sourceEdges;f.next();)g=f.value.link,null!==g&&(c?(a.setsPortSpot&&(g.fromSpot=e),a.setsChildPortSpot&&(g.toSpot=d)):(a.setsPortSpot&&(g.fromSpot=d),a.setsChildPortSpot&&(g.toSpot=e)))}}else if(c=zu(a),this.wd===Rt)for(e=a.destinationEdges;e.next();){if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.Rb())switch(c){case 0:d.fromSpot=qd;break;case 90:d.fromSpot=rd;break;case 180:d.fromSpot=pd;break;default:d.fromSpot=md}else d.fromSpot=a.portSpot; +if(a.setsChildPortSpot)if(a.childPortSpot.Rb())switch(c){case 0:d.toSpot=pd;break;case 90:d.toSpot=md;break;case 180:d.toSpot=qd;break;default:d.toSpot=rd}else d.toSpot=a.childPortSpot}}else for(e=a.sourceEdges;e.next();)if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.Rb())switch(c){case 0:d.toSpot=qd;break;case 90:d.toSpot=rd;break;case 180:d.toSpot=pd;break;default:d.toSpot=md}else d.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Rb())switch(c){case 0:d.fromSpot=pd;break; +case 90:d.fromSpot=md;break;case 180:d.fromSpot=qd;break;default:d.fromSpot=rd}else d.fromSpot=a.childPortSpot}};function zu(a){a=a.angle;return 45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}function Eu(a){G&&w(a,Wt,Z,"computeLayerSpacing:v");var b=zu(a);b=90===b||270===b;var c=a.layerSpacing;if(0<a.layerSpacingParentOverlap){var d=Math.min(1,a.layerSpacingParentOverlap);c-=b?a.height*d:a.width*d}c<(b?-a.height:-a.width)&&(c=b?-a.height:-a.width);return c} +function Fu(a){G&&w(a,Wt,Z,"computeNodeIndent:v");var b=zu(a),c=a.nodeIndent;if(0<a.nodeIndentPastParent){var d=Math.min(1,a.nodeIndentPastParent);c+=90===b||270===b?a.width*d:a.height*d}return c=Math.max(0,c)} +oa.Object.defineProperties(Z.prototype,{roots:{configurable:!0,get:function(){return this.Wb},set:function(a){this.Wb!==a&&(w(a,I,Z,"roots"),this.Wb=a,this.F())}},path:{configurable:!0,get:function(){return this.Qn},set:function(a){this.Qn!==a&&(ab(a,Z,Z,"path"),this.Qn=a,this.F())}},treeStyle:{configurable:!0,get:function(){return this.lo},set:function(a){this.Tb!==a&&(ab(a,Z,Z,"treeStyle"),a===St||a===ku||a===lu||a===ju)&&(this.lo=a,this.F())}},layerStyle:{configurable:!0, +enumerable:!0,get:function(){return this.oq},set:function(a){this.Tb!==a&&(ab(a,Z,Z,"layerStyle"),a===Tt||a===fu||a===eu)&&(this.oq=a,this.F())}},comments:{configurable:!0,get:function(){return this.ud},set:function(a){this.ud!==a&&(A(a,"boolean",Z,"comments"),this.ud=a,this.F())}},arrangement:{configurable:!0,get:function(){return this.Tb},set:function(a){this.Tb!==a&&(ab(a,Z,Z,"arrangement"),a===Ut||a===Yu||a===Xt)&&(this.Tb=a,this.F())}},arrangementSpacing:{configurable:!0, +enumerable:!0,get:function(){return this.Zd},set:function(a){w(a,Hb,Z,"arrangementSpacing");this.Zd.D(a)||(this.Zd.assign(a),this.F())}},rootDefaults:{configurable:!0,get:function(){return this.Z},set:function(a){this.Z!==a&&(w(a,Wt,Z,"rootDefaults"),this.Z=a,this.F())}},alternateDefaults:{configurable:!0,get:function(){return this.aa},set:function(a){this.aa!==a&&(w(a,Wt,Z,"alternateDefaults"),this.aa=a,this.F())}},sorting:{configurable:!0,get:function(){return this.Z.sorting}, +set:function(a){this.Z.sorting!==a&&(ab(a,Z,Z,"sorting"),a===mu||a===nu||a===ou||pu)&&(this.Z.sorting=a,this.F())}},comparer:{configurable:!0,get:function(){return this.Z.comparer},set:function(a){this.Z.comparer!==a&&(A(a,"function",Z,"comparer"),this.Z.comparer=a,this.F())}},angle:{configurable:!0,get:function(){return this.Z.angle},set:function(a){this.Z.angle!==a&&(A(a,"number",Z,"angle"),0===a||90===a||180===a||270===a?(this.Z.angle=a,this.F()):v("TreeLayout.angle must be 0, 90, 180, or 270"))}}, +alignment:{configurable:!0,get:function(){return this.Z.alignment},set:function(a){this.Z.alignment!==a&&(ab(a,Z,Z,"alignment"),this.Z.alignment=a,this.F())}},nodeIndent:{configurable:!0,get:function(){return this.Z.nodeIndent},set:function(a){this.Z.nodeIndent!==a&&(A(a,"number",Z,"nodeIndent"),0<=a&&(this.Z.nodeIndent=a,this.F()))}},nodeIndentPastParent:{configurable:!0,get:function(){return this.Z.nodeIndentPastParent},set:function(a){this.Z.nodeIndentPastParent!== +a&&(A(a,"number",Z,"nodeIndentPastParent"),0<=a&&1>=a&&(this.Z.nodeIndentPastParent=a,this.F()))}},nodeSpacing:{configurable:!0,get:function(){return this.Z.nodeSpacing},set:function(a){this.Z.nodeSpacing!==a&&(A(a,"number",Z,"nodeSpacing"),this.Z.nodeSpacing=a,this.F())}},layerSpacing:{configurable:!0,get:function(){return this.Z.layerSpacing},set:function(a){this.Z.layerSpacing!==a&&(A(a,"number",Z,"layerSpacing"),this.Z.layerSpacing=a,this.F())}},layerSpacingParentOverlap:{configurable:!0, +enumerable:!0,get:function(){return this.Z.layerSpacingParentOverlap},set:function(a){this.Z.layerSpacingParentOverlap!==a&&(A(a,"number",Z,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.Z.layerSpacingParentOverlap=a,this.F()))}},compaction:{configurable:!0,get:function(){return this.Z.compaction},set:function(a){this.Z.compaction!==a&&(ab(a,Z,Z,"compaction"),a===wu||a===yu)&&(this.Z.compaction=a,this.F())}},breadthLimit:{configurable:!0,get:function(){return this.Z.breadthLimit}, +set:function(a){this.Z.breadthLimit!==a&&(A(a,"number",Z,"breadthLimit"),0<=a&&(this.Z.breadthLimit=a,this.F()))}},rowSpacing:{configurable:!0,get:function(){return this.Z.rowSpacing},set:function(a){this.Z.rowSpacing!==a&&(A(a,"number",Z,"rowSpacing"),this.Z.rowSpacing=a,this.F())}},rowIndent:{configurable:!0,get:function(){return this.Z.rowIndent},set:function(a){this.Z.rowIndent!==a&&(A(a,"number",Z,"rowIndent"),0<=a&&(this.Z.rowIndent=a,this.F()))}},commentSpacing:{configurable:!0, +enumerable:!0,get:function(){return this.Z.commentSpacing},set:function(a){this.Z.commentSpacing!==a&&(A(a,"number",Z,"commentSpacing"),this.Z.commentSpacing=a,this.F())}},commentMargin:{configurable:!0,get:function(){return this.Z.commentMargin},set:function(a){this.Z.commentMargin!==a&&(A(a,"number",Z,"commentMargin"),this.Z.commentMargin=a,this.F())}},setsPortSpot:{configurable:!0,get:function(){return this.Z.setsPortSpot},set:function(a){this.Z.setsPortSpot!==a&&(A(a, +"boolean",Z,"setsPortSpot"),this.Z.setsPortSpot=a,this.F())}},portSpot:{configurable:!0,get:function(){return this.Z.portSpot},set:function(a){w(a,Ib,Z,"portSpot");this.Z.portSpot.D(a)||(this.Z.portSpot=a,this.F())}},setsChildPortSpot:{configurable:!0,get:function(){return this.Z.setsChildPortSpot},set:function(a){this.Z.setsChildPortSpot!==a&&(A(a,"boolean",Z,"setsChildPortSpot"),this.Z.setsChildPortSpot=a,this.F())}},childPortSpot:{configurable:!0,get:function(){return this.Z.childPortSpot}, +set:function(a){w(a,Ib,Z,"childPortSpot");this.Z.childPortSpot.D(a)||(this.Z.childPortSpot=a,this.F())}},alternateSorting:{configurable:!0,get:function(){return this.aa.sorting},set:function(a){this.aa.sorting!==a&&(ab(a,Z,Z,"alternateSorting"),a===mu||a===nu||a===ou||pu)&&(this.aa.sorting=a,this.F())}},alternateComparer:{configurable:!0,get:function(){return this.aa.comparer},set:function(a){this.aa.comparer!==a&&(A(a,"function",Z,"alternateComparer"),this.aa.comparer= +a,this.F())}},alternateAngle:{configurable:!0,get:function(){return this.aa.angle},set:function(a){this.aa.angle!==a&&(A(a,"number",Z,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.aa.angle=a,this.F())}},alternateAlignment:{configurable:!0,get:function(){return this.aa.alignment},set:function(a){this.aa.alignment!==a&&(ab(a,Z,Z,"alternateAlignment"),this.aa.alignment=a,this.F())}},alternateNodeIndent:{configurable:!0,get:function(){return this.aa.nodeIndent}, +set:function(a){this.aa.nodeIndent!==a&&(A(a,"number",Z,"alternateNodeIndent"),0<=a&&(this.aa.nodeIndent=a,this.F()))}},alternateNodeIndentPastParent:{configurable:!0,get:function(){return this.aa.nodeIndentPastParent},set:function(a){this.aa.nodeIndentPastParent!==a&&(A(a,"number",Z,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.aa.nodeIndentPastParent=a,this.F()))}},alternateNodeSpacing:{configurable:!0,get:function(){return this.aa.nodeSpacing},set:function(a){this.aa.nodeSpacing!== +a&&(A(a,"number",Z,"alternateNodeSpacing"),this.aa.nodeSpacing=a,this.F())}},alternateLayerSpacing:{configurable:!0,get:function(){return this.aa.layerSpacing},set:function(a){this.aa.layerSpacing!==a&&(A(a,"number",Z,"alternateLayerSpacing"),this.aa.layerSpacing=a,this.F())}},alternateLayerSpacingParentOverlap:{configurable:!0,get:function(){return this.aa.layerSpacingParentOverlap},set:function(a){this.aa.layerSpacingParentOverlap!==a&&(A(a,"number",Z,"alternateLayerSpacingParentOverlap"), +0<=a&&1>=a&&(this.aa.layerSpacingParentOverlap=a,this.F()))}},alternateCompaction:{configurable:!0,get:function(){return this.aa.compaction},set:function(a){this.aa.compaction!==a&&(ab(a,Z,Z,"alternateCompaction"),a===wu||a===yu)&&(this.aa.compaction=a,this.F())}},alternateBreadthLimit:{configurable:!0,get:function(){return this.aa.breadthLimit},set:function(a){this.aa.breadthLimit!==a&&(A(a,"number",Z,"alternateBreadthLimit"),0<=a&&(this.aa.breadthLimit=a,this.F()))}}, +alternateRowSpacing:{configurable:!0,get:function(){return this.aa.rowSpacing},set:function(a){this.aa.rowSpacing!==a&&(A(a,"number",Z,"alternateRowSpacing"),this.aa.rowSpacing=a,this.F())}},alternateRowIndent:{configurable:!0,get:function(){return this.aa.rowIndent},set:function(a){this.aa.rowIndent!==a&&(A(a,"number",Z,"alternateRowIndent"),0<=a&&(this.aa.rowIndent=a,this.F()))}},alternateCommentSpacing:{configurable:!0,get:function(){return this.aa.commentSpacing}, +set:function(a){this.aa.commentSpacing!==a&&(A(a,"number",Z,"alternateCommentSpacing"),this.aa.commentSpacing=a,this.F())}},alternateCommentMargin:{configurable:!0,get:function(){return this.aa.commentMargin},set:function(a){this.aa.commentMargin!==a&&(A(a,"number",Z,"alternateCommentMargin"),this.aa.commentMargin=a,this.F())}},alternateSetsPortSpot:{configurable:!0,get:function(){return this.aa.setsPortSpot},set:function(a){this.aa.setsPortSpot!==a&&(A(a,"boolean",Z,"alternateSetsPortSpot"), +this.aa.setsPortSpot=a,this.F())}},alternatePortSpot:{configurable:!0,get:function(){return this.aa.portSpot},set:function(a){w(a,Ib,Z,"alternatePortSpot");this.aa.portSpot.D(a)||(this.aa.portSpot=a,this.F())}},alternateSetsChildPortSpot:{configurable:!0,get:function(){return this.aa.setsChildPortSpot},set:function(a){this.aa.setsChildPortSpot!==a&&(A(a,"boolean",Z,"alternateSetsChildPortSpot"),this.aa.setsChildPortSpot=a,this.F())}},alternateChildPortSpot:{configurable:!0, +enumerable:!0,get:function(){return this.aa.childPortSpot},set:function(a){w(a,Ib,Z,"alternateChildPortSpot");this.aa.childPortSpot.D(a)||(this.aa.childPortSpot=a,this.F())}}}); +var Qt=new F(Z,"PathDefault",-1),Rt=new F(Z,"PathDestination",0),Yt=new F(Z,"PathSource",1),mu=new F(Z,"SortingForwards",10),nu=new F(Z,"SortingReverse",11),ou=new F(Z,"SortingAscending",12),pu=new F(Z,"SortingDescending",13),Ou=new F(Z,"AlignmentCenterSubtrees",20),Pu=new F(Z,"AlignmentCenterChildren",21),Au=new F(Z,"AlignmentStart",22),Bu=new F(Z,"AlignmentEnd",23),ru=new F(Z,"AlignmentBus",24),hu=new F(Z,"AlignmentBusBranching",25),su=new F(Z,"AlignmentTopLeftBus",26),tu=new F(Z,"AlignmentBottomRightBus", +27),wu=new F(Z,"CompactionNone",30),yu=new F(Z,"CompactionBlock",31),St=new F(Z,"StyleLayered",40),lu=new F(Z,"StyleLastParents",41),ku=new F(Z,"StyleAlternating",42),ju=new F(Z,"StyleRootOnly",43),Ut=new F(Z,"ArrangementVertical",50),Yu=new F(Z,"ArrangementHorizontal",51),Xt=new F(Z,"ArrangementFixedRoots",52),Tt=new F(Z,"LayerIndividual",60),fu=new F(Z,"LayerSiblings",61),eu=new F(Z,"LayerUniform",62);Z.className="TreeLayout";Z.PathDefault=Qt;Z.PathDestination=Rt;Z.PathSource=Yt; +Z.SortingForwards=mu;Z.SortingReverse=nu;Z.SortingAscending=ou;Z.SortingDescending=pu;Z.AlignmentCenterSubtrees=Ou;Z.AlignmentCenterChildren=Pu;Z.AlignmentStart=Au;Z.AlignmentEnd=Bu;Z.AlignmentBus=ru;Z.AlignmentBusBranching=hu;Z.AlignmentTopLeftBus=su;Z.AlignmentBottomRightBus=tu;Z.CompactionNone=wu;Z.CompactionBlock=yu;Z.StyleLayered=St;Z.StyleLastParents=lu;Z.StyleAlternating=ku;Z.StyleRootOnly=ju;Z.ArrangementVertical=Ut;Z.ArrangementHorizontal=Yu;Z.ArrangementFixedRoots=Xt;Z.LayerIndividual=Tt; +Z.LayerSiblings=fu;Z.LayerUniform=eu;function Vt(a){uq.call(this,a)}na(Vt,uq);Vt.prototype.createVertex=function(){return new Wt(this)};Vt.prototype.createEdge=function(){return new $u(this)};Vt.className="TreeNetwork"; +function Wt(a){Iq.call(this,a);this.$=!1;this.jb=null;this.v=[];this.ob=this.Ma=this.G=this.ma=0;this.ud=null;this.V=new K(0,0);this.Ia=new Hb(0,0);this.qa=new K(0,0);this.dm=this.cm=this.pA=!1;this.$o=this.Oo=null;this.md=mu;this.ed=Pq;this.Lb=0;this.Kb=Pu;this.Hq=this.Gq=0;this.Iq=20;this.he=50;this.nq=0;this.yp=yu;this.qp=0;this.Zq=25;this.xp=this.Yq=10;this.wp=20;this.gr=!0;this.Pq=hd;this.fr=!0;this.tp=hd}na(Wt,Iq); +Wt.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.md=a.sorting,this.ed=a.comparer,this.Lb=a.angle,this.Kb=a.alignment,this.Gq=a.nodeIndent,this.Hq=a.nodeIndentPastParent,this.Iq=a.nodeSpacing,this.he=a.layerSpacing,this.nq=a.layerSpacingParentOverlap,this.yp=a.compaction,this.qp=a.breadthLimit,this.Zq=a.rowSpacing,this.Yq=a.rowIndent,this.xp=a.commentSpacing,this.wp=a.commentMargin,this.gr=a.setsPortSpot,this.Pq=a.portSpot,this.fr=a.setsChildPortSpot,this.tp=a.childPortSpot)}; +oa.Object.defineProperties(Wt.prototype,{initialized:{configurable:!0,get:function(){return this.$},set:function(a){this.$!==a&&(A(a,"boolean",Wt,"initialized"),this.$=a)}},parent:{configurable:!0,get:function(){return this.jb},set:function(a){this.jb!==a&&(G&&null!==a&&w(a,Wt,Wt,"parent"),this.jb=a)}},children:{configurable:!0,get:function(){return this.v},set:function(a){if(this.v!==a){null===a||Array.isArray(a)||Aa(a,"Array",Wt,"children:value");if(null!== +a)for(var b=a.length,c=0;c<b;c++){var d=a[c];G&&w(d,Wt,Wt,"children")}this.v=a}}},level:{configurable:!0,get:function(){return this.ma},set:function(a){this.ma!==a&&(A(a,"number",Wt,"level"),this.ma=a)}},descendantCount:{configurable:!0,get:function(){return this.G},set:function(a){this.G!==a&&(A(a,"number",Wt,"descendantCount"),this.G=a)}},maxChildrenCount:{configurable:!0,get:function(){return this.Ma},set:function(a){this.Ma!==a&&(A(a,"number",Wt,"maxChildrenCount"), +this.Ma=a)}},maxGenerationCount:{configurable:!0,get:function(){return this.ob},set:function(a){this.ob!==a&&(A(a,"number",Wt,"maxGenerationCount"),this.ob=a)}},comments:{configurable:!0,get:function(){return this.ud},set:function(a){if(this.ud!==a){null===a||Array.isArray(a)||Aa(a,"Array",Wt,"comments:value");if(null!==a)for(var b=a.length,c=0;c<b;c++){var d=a[c];G&&w(d,T,Wt,"comments")}this.ud=a}}},sorting:{configurable:!0,get:function(){return this.md}, +set:function(a){this.md!==a&&(ab(a,Z,Wt,"sorting"),this.md=a)}},comparer:{configurable:!0,get:function(){return this.ed},set:function(a){this.ed!==a&&(A(a,"function",Wt,"comparer"),this.ed=a)}},angle:{configurable:!0,get:function(){return this.Lb},set:function(a){this.Lb!==a&&(A(a,"number",Wt,"angle"),this.Lb=a)}},alignment:{configurable:!0,get:function(){return this.Kb},set:function(a){this.Kb!==a&&(ab(a,Z,Wt,"alignment"),this.Kb=a)}},nodeIndent:{configurable:!0, +enumerable:!0,get:function(){return this.Gq},set:function(a){this.Gq!==a&&(A(a,"number",Wt,"nodeIndent"),this.Gq=a)}},nodeIndentPastParent:{configurable:!0,get:function(){return this.Hq},set:function(a){this.Hq!==a&&(A(a,"number",Wt,"nodeIndentPastParent"),this.Hq=a)}},nodeSpacing:{configurable:!0,get:function(){return this.Iq},set:function(a){this.Iq!==a&&(A(a,"number",Wt,"nodeSpacing"),this.Iq=a)}},layerSpacing:{configurable:!0,get:function(){return this.he}, +set:function(a){this.he!==a&&(A(a,"number",Wt,"layerSpacing"),this.he=a)}},layerSpacingParentOverlap:{configurable:!0,get:function(){return this.nq},set:function(a){this.nq!==a&&(A(a,"number",Wt,"layerSpacingParentOverlap"),this.nq=a)}},compaction:{configurable:!0,get:function(){return this.yp},set:function(a){this.yp!==a&&(ab(a,Z,Wt,"compaction"),this.yp=a)}},breadthLimit:{configurable:!0,get:function(){return this.qp},set:function(a){this.qp!==a&&(A(a,"number", +Wt,"breadthLimit"),this.qp=a)}},rowSpacing:{configurable:!0,get:function(){return this.Zq},set:function(a){this.Zq!==a&&(A(a,"number",Wt,"rowSpacing"),this.Zq=a)}},rowIndent:{configurable:!0,get:function(){return this.Yq},set:function(a){this.Yq!==a&&(A(a,"number",Wt,"rowIndent"),this.Yq=a)}},commentSpacing:{configurable:!0,get:function(){return this.xp},set:function(a){this.xp!==a&&(A(a,"number",Wt,"commentSpacing"),this.xp=a)}},commentMargin:{configurable:!0, +enumerable:!0,get:function(){return this.wp},set:function(a){this.wp!==a&&(A(a,"number",Wt,"commentMargin"),this.wp=a)}},setsPortSpot:{configurable:!0,get:function(){return this.gr},set:function(a){this.gr!==a&&(A(a,"boolean",Wt,"setsPortSpot"),this.gr=a)}},portSpot:{configurable:!0,get:function(){return this.Pq},set:function(a){w(a,Ib,Wt,"portSpot");this.Pq.D(a)||(this.Pq=a)}},setsChildPortSpot:{configurable:!0,get:function(){return this.fr},set:function(a){this.fr!== +a&&(A(a,"boolean",Wt,"setsChildPortSpot"),this.fr=a)}},childPortSpot:{configurable:!0,get:function(){return this.tp},set:function(a){w(a,Ib,Wt,"childPortSpot");this.tp.D(a)||(this.tp=a)}},childrenCount:{configurable:!0,get:function(){return this.children.length}},relativePosition:{configurable:!0,get:function(){return this.V},set:function(a){this.V.set(a)}},subtreeSize:{configurable:!0,get:function(){return this.Ia},set:function(a){this.Ia.set(a)}}, +subtreeOffset:{configurable:!0,get:function(){return this.qa},set:function(a){this.qa.set(a)}}});Wt.className="TreeVertex";function $u(a){Jq.call(this,a);this.St=new K(0,0)}na($u,Jq); +$u.prototype.commit=function(){var a=this.link;if(null!==a&&!a.isAvoiding){var b=this.network.layout,c=null,d=null;switch(b.wd){case Rt:c=this.fromVertex;d=this.toVertex;break;case Yt:c=this.toVertex;d=this.fromVertex;break;default:v("Unhandled path value "+b.wd.toString())}if(null!==c&&null!==d)if(b=this.St,0!==b.x||0!==b.y||c.pA){d=c.bounds;var e=zu(c),f=Eu(c),g=c.rowSpacing;a.yg();var h=a.curve===pg,k=a.isOrthogonal,l;a.uh();if(k||h){for(l=2;4<a.pointsCount;)a.lv(2);var m=a.i(1);var n=a.i(2)}else{for(l= +1;3<a.pointsCount;)a.lv(1);m=a.i(0);n=a.i(a.pointsCount-1)}var p=a.i(a.pointsCount-1);0===e?(c.alignment===Bu?(e=d.bottom+b.y,0===b.y&&m.y>p.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Fu(c))))):c.alignment===Au?(e=d.top+b.y,0===b.y&&m.y<p.y-c.rowIndent&&(e=Math.max(e,Math.min(m.y,e+Fu(c))))):e=c.cm||c.dm&&1===c.maxGenerationCount?d.top-c.qa.y+b.y:d.y+d.height/2+b.y,h?(a.l(l,m.x,e),l++,a.l(l,d.right+f,e),l++,a.l(l,d.right+f+(b.x-g)/3,e),l++,a.l(l,d.right+f+2*(b.x-g)/3,e),l++,a.l(l,d.right+f+(b.x- +g),e),l++,a.l(l,n.x,e)):(k&&(a.l(l,d.right+f/2,m.y),l++),a.l(l,d.right+f/2,e),l++,a.l(l,d.right+f+b.x-(k?g/2:g),e),l++,k&&a.l(l,a.i(l-1).x,n.y))):90===e?(c.alignment===Bu?(e=d.right+b.x,0===b.x&&m.x>p.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Fu(c))))):c.alignment===Au?(e=d.left+b.x,0===b.x&&m.x<p.x-c.rowIndent&&(e=Math.max(e,Math.min(m.x,e+Fu(c))))):e=c.cm||c.dm&&1===c.maxGenerationCount?d.left-c.qa.x+b.x:d.x+d.width/2+b.x,h?(a.l(l,e,m.y),l++,a.l(l,e,d.bottom+f),l++,a.l(l,e,d.bottom+f+(b.y-g)/ +3),l++,a.l(l,e,d.bottom+f+2*(b.y-g)/3),l++,a.l(l,e,d.bottom+f+(b.y-g)),l++,a.l(l,e,n.y)):(k&&(a.l(l,m.x,d.bottom+f/2),l++),a.l(l,e,d.bottom+f/2),l++,a.l(l,e,d.bottom+f+b.y-(k?g/2:g)),l++,k&&a.l(l,n.x,a.i(l-1).y))):180===e?(c.alignment===Bu?(e=d.bottom+b.y,0===b.y&&m.y>p.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Fu(c))))):c.alignment===Au?(e=d.top+b.y,0===b.y&&m.y<p.y-c.rowIndent&&(e=Math.max(e,Math.min(m.y,e+Fu(c))))):e=c.cm||c.dm&&1===c.maxGenerationCount?d.top-c.qa.y+b.y:d.y+d.height/2+b.y,h? +(a.l(l,m.x,e),l++,a.l(l,d.left-f,e),l++,a.l(l,d.left-f+(b.x+g)/3,e),l++,a.l(l,d.left-f+2*(b.x+g)/3,e),l++,a.l(l,d.left-f+(b.x+g),e),l++,a.l(l,n.x,e)):(k&&(a.l(l,d.left-f/2,m.y),l++),a.l(l,d.left-f/2,e),l++,a.l(l,d.left-f+b.x+(k?g/2:g),e),l++,k&&a.l(l,a.i(l-1).x,n.y))):270===e?(c.alignment===Bu?(e=d.right+b.x,0===b.x&&m.x>p.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Fu(c))))):c.alignment===Au?(e=d.left+b.x,0===b.x&&m.x<p.x-c.rowIndent&&(e=Math.max(e,Math.min(m.x,e+Fu(c))))):e=c.cm||c.dm&&1===c.maxGenerationCount? +d.left-c.qa.x+b.x:d.x+d.width/2+b.x,h?(a.l(l,e,m.y),l++,a.l(l,e,d.top-f),l++,a.l(l,e,d.top-f+(b.y+g)/3),l++,a.l(l,e,d.top-f+2*(b.y+g)/3),l++,a.l(l,e,d.top-f+(b.y+g)),l++,a.l(l,e,n.y)):(k&&(a.l(l,m.x,d.top-f/2),l++),a.l(l,e,d.top-f/2),l++,a.l(l,e,d.top-f+b.y+(k?g/2:g)),l++,k&&a.l(l,n.x,a.i(l-1).y))):v("Invalid angle "+e);a.Bf()}else b=d,G&&w(c,Wt,$u,"adjustRouteForAngleChange:parent"),G&&w(b,Wt,$u,"adjustRouteForAngleChange:child"),a=this.link,f=zu(c),f!==zu(b)&&(g=Eu(c),h=c.bounds,c=b.bounds,0=== +f&&c.left-h.right<g+1||90===f&&c.top-h.bottom<g+1||180===f&&h.left-c.right<g+1||270===f&&h.top-c.bottom<g+1||(a.yg(),c=a.curve===pg,b=a.isOrthogonal,d=qu(this.fromVertex.alignment),a.uh(),0===f?(f=h.right+g/2,c?4===a.pointsCount&&(c=a.i(3).y,a.P(1,f-20,a.i(1).y),a.l(2,f-20,c),a.l(3,f,c),a.l(4,f+20,c),a.P(5,a.i(5).x,c)):b?d?a.P(3,a.i(2).x,a.i(4).y):6===a.pointsCount&&(a.P(2,f,a.i(2).y),a.P(3,f,a.i(3).y)):4===a.pointsCount?a.l(2,f,a.i(2).y):3===a.pointsCount?a.P(1,f,a.i(2).y):2===a.pointsCount&&a.l(1, +f,a.i(1).y)):90===f?(f=h.bottom+g/2,c?4===a.pointsCount&&(c=a.i(3).x,a.P(1,a.i(1).x,f-20),a.l(2,c,f-20),a.l(3,c,f),a.l(4,c,f+20),a.P(5,c,a.i(5).y)):b?d?a.P(3,a.i(2).x,a.i(4).y):6===a.pointsCount&&(a.P(2,a.i(2).x,f),a.P(3,a.i(3).x,f)):4===a.pointsCount?a.l(2,a.i(2).x,f):3===a.pointsCount?a.P(1,a.i(2).x,f):2===a.pointsCount&&a.l(1,a.i(1).x,f)):180===f?(f=h.left-g/2,c?4===a.pointsCount&&(c=a.i(3).y,a.P(1,f+20,a.i(1).y),a.l(2,f+20,c),a.l(3,f,c),a.l(4,f-20,c),a.P(5,a.i(5).x,c)):b?d?a.P(3,a.i(2).x,a.i(4).y): +6===a.pointsCount&&(a.P(2,f,a.i(2).y),a.P(3,f,a.i(3).y)):4===a.pointsCount?a.l(2,f,a.i(2).y):3===a.pointsCount?a.P(1,f,a.i(2).y):2===a.pointsCount&&a.l(1,f,a.i(1).y)):270===f&&(f=h.top-g/2,c?4===a.pointsCount&&(c=a.i(3).x,a.P(1,a.i(1).x,f+20),a.l(2,c,f+20),a.l(3,c,f),a.l(4,c,f-20),a.P(5,c,a.i(5).y)):b?d?a.P(3,a.i(2).x,a.i(4).y):6===a.pointsCount&&(a.P(2,a.i(2).x,f),a.P(3,a.i(3).x,f)):4===a.pointsCount?a.l(2,a.i(2).x,f):3===a.pointsCount?a.P(1,a.i(2).x,f):2===a.pointsCount&&a.l(1,a.i(1).x,f)),a.Bf()))}}; +oa.Object.defineProperties($u.prototype,{fromVertex:{configurable:!0,get:function(){return this.gd},set:function(a){this.gd!==a&&(G&&null!==a&&w(a,Wt,$u,"fromVertex"),this.gd=a)}},toVertex:{configurable:!0,get:function(){return this.pd},set:function(a){this.pd!==a&&(G&&null!==a&&w(a,Wt,$u,"toVertex"),this.pd=a)}},relativePoint:{configurable:!0,get:function(){return this.St},set:function(a){this.St.set(a)}}});$u.className="TreeEdge"; +Ua.prototype.initializeStandardTools=function(){this.nb("Action",new Dg,this.mouseDownTools);this.nb("Relinking",new We,this.mouseDownTools);this.nb("LinkReshaping",new ng,this.mouseDownTools);this.nb("Rotating",new Bg,this.mouseDownTools);this.nb("Resizing",new ug,this.mouseDownTools);this.nb("Linking",new ag,this.mouseMoveTools);this.nb("Dragging",new Oe,this.mouseMoveTools);this.nb("DragSelecting",new Gg,this.mouseMoveTools);this.nb("Panning",new Hg,this.mouseMoveTools);this.nb("ContextMenu",new Jg, +this.mouseUpTools);this.nb("TextEditing",new bh,this.mouseUpTools);this.nb("ClickCreating",new Eg,this.mouseUpTools);this.nb("ClickSelecting",new Cg,this.mouseUpTools)};Hn("Horizontal",new Km);Hn("Spot",new Mm);Hn("Table",new Rm);Hn("Viewbox",new Wm);Hn("TableRow",new Um);Hn("TableColumn",new Vm);Hn("Graduated",new fn);Hn("Grid",new Xm);yi.add("GraphLinksModel",hr);yi.add("TreeModel",vr);Aq(Ds,null);Aq(Ts,null); +var av=sa.go,bv={get licenseKey(){return P.licenseKey},set licenseKey(a){P.licenseKey=a},get version(){return P.version},Group:wf,EnumValue:F,List:H,Set:I,Map:yb,Point:K,Size:Hb,Rect:M,Margin:gc,Spot:Ib,Geometry:N,PathFigure:je,PathSegment:ke,InputEvent:me,DiagramEvent:oe,ChangedEvent:pe,Model:X,GraphLinksModel:Rr,TreeModel:Wr,Binding:Ji,Transaction:ue,UndoManager:ve,CommandHandler:el,Tool:xe,DraggingTool:Oe,DraggingInfo:Xe,DraggingOptions:Pe,LinkingBaseTool:Pf,LinkingTool:ag,RelinkingTool:We,LinkReshapingTool:ng, +ResizingTool:ug,RotatingTool:Bg,ClickSelectingTool:Cg,ActionTool:Dg,ClickCreatingTool:Eg,HTMLInfo:Me,ContextMenuTool:Jg,DragSelectingTool:Gg,PanningTool:Hg,TextEditingTool:bh,ToolManager:Ua,Animation:xh,AnimationManager:th,AnimationTrigger:li,Layer:qi,Diagram:P,Palette:Yk,Overview:al,Brush:Bl,GraphObject:O,Panel:V,RowColumnDefinition:ck,Shape:Qf,TextBlock:ch,Picture:kk,Part:S,Adornment:Ce,Node:T,Link:R,Placeholder:wg,Layout:Di,LayoutNetwork:uq,LayoutVertex:Iq,LayoutEdge:Jq,GridLayout:$k,PanelLayout:Zl, +CircularLayout:Xr,CircularNetwork:ns,CircularVertex:Bs,CircularEdge:Cs,ForceDirectedLayout:Ds,ForceDirectedNetwork:Es,ForceDirectedVertex:Os,ForceDirectedEdge:Ss,LayeredDigraphLayout:Ts,LayeredDigraphNetwork:Ys,LayeredDigraphVertex:Ot,LayeredDigraphEdge:Pt,TreeLayout:Z,TreeNetwork:Vt,TreeVertex:Wt,TreeEdge:$u};"object"===typeof av&&av.version&&Fa("WARNING: a `go` object on the root object is already defined. "+("Debug"in av?"debug ":"")+"version: "+av.version+", replaced with version: "+bv.version); +P.prototype.go=bv;sa.go=bv;bv.Debug=G;G.Jy(bv); 'undefined'!==typeof module&&'object'===typeof module.exports&&(module.exports='undefined'!==typeof global?global.go:self.go); })(); + + "function"===typeof define&&define.amd&&define("undefined"!==typeof global?global.go:self.go); + \ No newline at end of file diff --git a/Web/js/jquery-3.2.1.js b/Web/js/jquery-3.2.1.js new file mode 100644 index 0000000000000000000000000000000000000000..d2d8ca4790e52b0537f3cbb7dcd766099b789583 --- /dev/null +++ b/Web/js/jquery-3.2.1.js @@ -0,0 +1,10253 @@ +/*! + * jQuery JavaScript Library v3.2.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2017-03-20T18:59Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var document = window.document; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var concat = arr.concat; + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + + + + function DOMEval( code, doc ) { + doc = doc || document; + + var script = doc.createElement( "script" ); + + script.text = code; + doc.head.appendChild( script ).parentNode.removeChild( script ); + } +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.2.1", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android <=4.0 only + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } + + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && Array.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isFunction: function( obj ) { + return jQuery.type( obj ) === "function"; + }, + + isWindow: function( obj ) { + return obj != null && obj === obj.window; + }, + + isNumeric: function( obj ) { + + // As of jQuery 3.0, isNumeric is limited to + // strings and numbers (primitives or objects) + // that can be coerced to finite numbers (gh-2662) + var type = jQuery.type( obj ); + return ( type === "number" || type === "string" ) && + + // parseFloat NaNs numeric-cast false positives ("") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + !isNaN( obj - parseFloat( obj ) ); + }, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + + /* eslint-disable no-unused-vars */ + // See https://github.com/eslint/eslint/issues/6125 + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; + }, + + // Evaluates a script in a global context + globalEval: function( code ) { + DOMEval( code ); + }, + + // Convert dashed to camelCase; used by the css and data modules + // Support: IE <=9 - 11, Edge 12 - 13 + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android <=4.0 only + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: Date.now, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.3 + * https://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-08-08 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + disabledAncestor = addCombinator( + function( elem ) { + return elem.disabled === true && ("form" in elem || "label" in elem); + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; + + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { + + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[i] = "#" + nid + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement("fieldset"); + + try { + return !!fn( el ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + disabledAncestor( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( preferredDoc !== document && + (subWindow = document.defaultView) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( el ) { + el.className = "i"; + return !el.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( el ) { + el.appendChild( document.createComment("") ); + return !el.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programmatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + }); + + // ID filter and find + if ( support.getById ) { + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; + } else { + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( (elem = elems[i++]) ) { + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See https://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( el ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // https://bugs.jquery.com/ticket/12359 + docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + + "<select id='" + expando + "-\r\\' msallowcapture=''>" + + "<option selected=''></option></select>"; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !el.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( el ) { + el.innerHTML = "<a href='' disabled='disabled'></a>" + + "<select disabled='disabled'><option/></select>"; + + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement("input"); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( el.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( el.querySelectorAll(":enabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll(":disabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + el.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( el ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( el, "*" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( el, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === document ? -1 : + b === document ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.escape = function( sel ) { + return (sel + "").replace( rcssescape, fcssescape ); +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + return false; + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( (oldCache = uniqueCache[ key ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ key ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + return false; + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context === document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context || document, xml) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( el ) { + // Should return 1, but returns 4 (following) + return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( el ) { + el.innerHTML = "<a href='#'></a>"; + return el.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( el ) { + el.innerHTML = "<input/>"; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( el ) { + return el.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; + + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +}; +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +var risSimple = /^.[^:#\[\.,]*$/; + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) !== not; + } ); + } + + // Single element + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + } + + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); + } + + // Simple selector that can be filtered directly, removing non-Elements + if ( risSimple.test( qualifier ) ) { + return jQuery.filter( qualifier, elements, not ); + } + + // Complex selector, compare the two sets, removing non-Elements + qualifier = jQuery.filter( qualifier, elements ); + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1; + } ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, ret, + len = this.length, + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + ret = this.pushStack( [] ); + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + return len > 1 ? jQuery.uniqueSort( ret ) : ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { + + // Inject the element directly into the jQuery object + this[ 0 ] = elem; + this.length = 1; + } + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + targets = typeof selectors !== "string" && jQuery( selectors ); + + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + if ( nodeName( elem, "iframe" ) ) { + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( jQuery.isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && jQuery.isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( jQuery.isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + jQuery.isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + jQuery.isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + jQuery.isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the master Deferred + master = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + master.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( master.state() === "pending" || + jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return master.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); + } + + return master.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ jQuery.camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ jQuery.camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( jQuery.camelCase ); + } else { + key = jQuery.camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + jQuery.contains( elem.ownerDocument, elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + +var swap = function( elem, options, callback, args ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.apply( elem, args || [] ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, + scale = 1, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + do { + + // If previous iteration zeroed out, double until we get *something*. + // Use string for doubling so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + initialInUnit = initialInUnit / scale; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // Break the loop if scale is unchanged or perfect, or if we've just had enough. + } while ( + scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations + ); + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); + +var rscriptType = ( /^$|\/(?:java|ecma)script/i ); + + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // Support: IE <=9 only + option: [ 1, "<select multiple='multiple'>", "</select>" ], + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting <tbody> or other required elements. + thead: [ 1, "<table>", "</table>" ], + col: [ 2, "<table><colgroup>", "</colgroup></table>" ], + tr: [ 2, "<table><tbody>", "</tbody></table>" ], + td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], + + _default: [ 0, "", "" ] +}; + +// Support: IE <=9 only +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, contains, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( jQuery.type( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = "<textarea>x</textarea>"; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; +} )(); +var documentElement = document.documentElement; + + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 only +// See #13393 for more info +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = {}; + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( nativeEvent ) { + + // Make a writable jQuery.Event from the native event object + var event = jQuery.event.fix( nativeEvent ); + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG <use> instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: jQuery.isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + this.focus(); + return false; + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + + which: function( event ) { + var button = event.button; + + // Add which for key events + if ( event.which == null && rkeyEvent.test( event.type ) ) { + return event.charCode != null ? event.charCode : event.keyCode; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { + if ( button & 1 ) { + return 1; + } + + if ( button & 2 ) { + return 3; + } + + if ( button & 4 ) { + return 2; + } + + return 0; + } + + return event.which; + } +}, jQuery.event.addProp ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + /* eslint-disable max-len */ + + // See https://github.com/eslint/eslint/issues/3229 + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, + + /* eslint-enable */ + + // Support: IE <=10 - 11, Edge 12 - 13 + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /<script|<style|<link/i, + + // checked="checked" or checked + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, + rscriptTypeMasked = /^true\/(.*)/, + rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( ">tbody", elem )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + + if ( match ) { + elem.type = match[ 1 ]; + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.access( src ); + pdataCur = dataPriv.set( dest, pdataOld ); + events = pdataOld.events; + + if ( events ) { + delete pdataCur.handle; + pdataCur.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( isFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), doc ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1></$2>" ); + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = jQuery.contains( elem.ownerDocument, elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rmargin = ( /^margin/ ); + +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + div.style.cssText = + "box-sizing:border-box;" + + "position:relative;display:block;" + + "margin:auto;border:1px;padding:1px;" + + "top:1%;width:50%"; + div.innerHTML = ""; + documentElement.appendChild( container ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = divStyle.marginLeft === "2px"; + boxSizingReliableVal = divStyle.width === "4px"; + + // Support: Android 4.0 - 4.3 only + // Some styles come back with percentage values, even though they shouldn't + div.style.marginRight = "50%"; + pixelMarginRightVal = divStyle.marginRight === "4px"; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + + "padding:0;margin-top:1px;position:absolute"; + container.appendChild( div ); + + jQuery.extend( support, { + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelMarginRight: function() { + computeStyleTests(); + return pixelMarginRightVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }, + + cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style; + +// Return a css property mapped to a potentially vendor prefixed property +function vendorPropName( name ) { + + // Shortcut for names that are not vendor prefixed + if ( name in emptyStyle ) { + return name; + } + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in emptyStyle ) { + return name; + } + } +} + +// Return a property mapped along what jQuery.cssProps suggests or to +// a vendor prefixed property. +function finalPropName( name ) { + var ret = jQuery.cssProps[ name ]; + if ( !ret ) { + ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name; + } + return ret; +} + +function setPositiveNumber( elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { + var i, + val = 0; + + // If we already have the right measurement, avoid augmentation + if ( extra === ( isBorderBox ? "border" : "content" ) ) { + i = 4; + + // Otherwise initialize for horizontal or vertical properties + } else { + i = name === "width" ? 1 : 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin, so add it if we want it + if ( extra === "margin" ) { + val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); + } + + if ( isBorderBox ) { + + // border-box includes padding, so remove it if we want content + if ( extra === "content" ) { + val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // At this point, extra isn't border nor margin, so remove border + if ( extra !== "margin" ) { + val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } else { + + // At this point, extra isn't content, so add padding + val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // At this point, extra isn't content nor padding, so add border + if ( extra !== "padding" ) { + val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + return val; +} + +function getWidthOrHeight( elem, name, extra ) { + + // Start with computed style + var valueIsBorderBox, + styles = getStyles( elem ), + val = curCSS( elem, name, styles ), + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // Computed unit is not pixels. Stop here and return. + if ( rnumnonpx.test( val ) ) { + return val; + } + + // Check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = isBorderBox && + ( support.boxSizingReliable() || val === elem.style[ name ] ); + + // Fall back to offsetWidth/Height when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + if ( val === "auto" ) { + val = elem[ "offset" + name[ 0 ].toUpperCase() + name.slice( 1 ) ]; + } + + // Normalize "", auto, and prepare for extra + val = parseFloat( val ) || 0; + + // Use the active box-sizing model to add/subtract irrelevant styles + return ( val + + augmentWidthOrHeight( + elem, + name, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: { + "float": "cssFloat" + }, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = jQuery.camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + if ( type === "number" ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = jQuery.camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( i, name ) { + jQuery.cssHooks[ name ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, name, extra ); + } ) : + getWidthOrHeight( elem, name, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = extra && getStyles( elem ), + subtract = extra && augmentWidthOrHeight( + elem, + name, + extra, + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + styles + ); + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ name ] = value; + value = jQuery.css( elem, name ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( !rmargin.test( prefix ) ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( Array.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + } +} ); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || jQuery.easing._default; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { + return tween.elem[ tween.prop ]; + } + + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. + result = jQuery.css( tween.elem, tween.prop, "" ); + + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.nodeType === 1 && + ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || + jQuery.cssHooks[ tween.prop ] ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 only +// Panic based approach to setting things on disconnected nodes +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + }, + _default: "swing" +}; + +jQuery.fx = Tween.prototype.init; + +// Back compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, inProgress, + rfxtypes = /^(?:toggle|show|hide)$/, + rrun = /queueHooks$/; + +function schedule() { + if ( inProgress ) { + if ( document.hidden === false && window.requestAnimationFrame ) { + window.requestAnimationFrame( schedule ); + } else { + window.setTimeout( schedule, jQuery.fx.interval ); + } + + jQuery.fx.tick(); + } +} + +// Animations created synchronously will run synchronously +function createFxNow() { + window.setTimeout( function() { + fxNow = undefined; + } ); + return ( fxNow = jQuery.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + i = 0, + attrs = { height: type }; + + // If we include width, step value is 1 to do all cssExpand values, + // otherwise step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { + + // We're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, + isBox = "width" in props || "height" in props, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHiddenWithinTree( elem ), + dataShow = dataPriv.get( elem, "fxshow" ); + + // Queue-skipping animations hijack the fx hooks + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always( function() { + + // Ensure the complete handler is called before this completes + anim.always( function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + } ); + } ); + } + + // Detect show/hide animations + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.test( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // Pretend to be hidden if this is a "show" and + // there is still data from a stopped show/hide + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + + // Ignore all other no-op show/hide data + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + // Bail out if this is a no-op like .hide().hide() + propTween = !jQuery.isEmptyObject( props ); + if ( !propTween && jQuery.isEmptyObject( orig ) ) { + return; + } + + // Restrict "overflow" and "display" styles during box animations + if ( isBox && elem.nodeType === 1 ) { + + // Support: IE <=9 - 11, Edge 12 - 13 + // Record all 3 overflow attributes because IE does not infer the shorthand + // from identically-valued overflowX and overflowY + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Identify a display type, preferring old show/hide data over the CSS cascade + restoreDisplay = dataShow && dataShow.display; + if ( restoreDisplay == null ) { + restoreDisplay = dataPriv.get( elem, "display" ); + } + display = jQuery.css( elem, "display" ); + if ( display === "none" ) { + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } + } + + // Animate inline elements as inline-block + if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { + if ( jQuery.css( elem, "float" ) === "none" ) { + + // Restore the original display value at the end of pure show/hide animations + if ( !propTween ) { + anim.done( function() { + style.display = restoreDisplay; + } ); + if ( restoreDisplay == null ) { + display = style.display; + restoreDisplay = display === "none" ? "" : display; + } + } + style.display = "inline-block"; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + anim.always( function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + } ); + } + + // Implement show/hide animations + propTween = false; + for ( prop in orig ) { + + // General show/hide setup for this element animation + if ( !propTween ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); + } + + // Store hidden/visible for toggle so `.stop().toggle()` "reverses" + if ( toggle ) { + dataShow.hidden = !hidden; + } + + // Show elements before animating them + if ( hidden ) { + showHide( [ elem ], true ); + } + + /* eslint-disable no-loop-func */ + + anim.done( function() { + + /* eslint-enable no-loop-func */ + + // The final step of a "hide" animation is actually hiding the element + if ( !hidden ) { + showHide( [ elem ] ); + } + dataPriv.remove( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + } ); + } + + // Per-property setup + propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = propTween.start; + if ( hidden ) { + propTween.end = propTween.start; + propTween.start = 0; + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = jQuery.camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( Array.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // Not quite $.extend, this won't overwrite existing keys. + // Reusing 'index' because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = Animation.prefilters.length, + deferred = jQuery.Deferred().always( function() { + + // Don't match elem in the :animated selector + delete tick.elem; + } ), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + + // Support: Android 2.3 only + // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ] ); + + // If there's more to do, yield + if ( percent < 1 && length ) { + return remaining; + } + + // If this was an empty animation, synthesize a final progress notification + if ( !length ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + } + + // Resolve the animation and report its conclusion + deferred.resolveWith( elem, [ animation ] ); + return false; + }, + animation = deferred.promise( { + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { + specialEasing: {}, + easing: jQuery.easing._default + }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + + // If we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // Resolve when we played the last frame; otherwise, reject + if ( gotoEnd ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + } ), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length; index++ ) { + result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + if ( jQuery.isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + jQuery.proxy( result.stop, result ); + } + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( jQuery.isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + // Attach callbacks from options + animation + .progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + } ) + ); + + return animation; +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweeners: { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ); + adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); + return tween; + } ] + }, + + tweener: function( props, callback ) { + if ( jQuery.isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.match( rnothtmlwhite ); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length; index++ ) { + prop = props[ index ]; + Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; + Animation.tweeners[ prop ].unshift( callback ); + } + }, + + prefilters: [ defaultPrefilter ], + + prefilter: function( callback, prepend ) { + if ( prepend ) { + Animation.prefilters.unshift( callback ); + } else { + Animation.prefilters.push( callback ); + } + } +} ); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + jQuery.isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing + }; + + // Go to the end state if fx are off + if ( jQuery.fx.off ) { + opt.duration = 0; + + } else { + if ( typeof opt.duration !== "number" ) { + if ( opt.duration in jQuery.fx.speeds ) { + opt.duration = jQuery.fx.speeds[ opt.duration ]; + + } else { + opt.duration = jQuery.fx.speeds._default; + } + } + } + + // Normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( jQuery.isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend( { + fadeTo: function( speed, to, easing, callback ) { + + // Show any hidden elements after setting opacity to 0 + return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() + + // Animate to the value specified + .end().animate( { opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || dataPriv.get( this, "finish" ) ) { + anim.stop( true ); + } + }; + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue && type !== false ) { + this.queue( type || "fx", [] ); + } + + return this.each( function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = dataPriv.get( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && + ( type == null || timers[ index ].queue === type ) ) { + + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // Start the next in the queue if the last step wasn't forced. + // Timers currently will call their complete callbacks, which + // will dequeue but only if they were gotoEnd. + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + } ); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each( function() { + var index, + data = dataPriv.get( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // Enable finishing flag on private data + data.finish = true; + + // Empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // Look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // Look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // Turn off finishing flag + delete data.finish; + } ); + } +} ); + +jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +} ); + +// Generate shortcuts for custom animations +jQuery.each( { + slideDown: genFx( "show" ), + slideUp: genFx( "hide" ), + slideToggle: genFx( "toggle" ), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +} ); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + i = 0, + timers = jQuery.timers; + + fxNow = jQuery.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + + // Run the timer and safely remove it when done (allowing for external removal) + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + jQuery.fx.start(); +}; + +jQuery.fx.interval = 13; +jQuery.fx.start = function() { + if ( inProgress ) { + return; + } + + inProgress = true; + schedule(); +}; + +jQuery.fx.stop = function() { + inProgress = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = window.setTimeout( next, time ); + hooks.stop = function() { + window.clearTimeout( timeout ); + }; + } ); +}; + + +( function() { + var input = document.createElement( "input" ), + select = document.createElement( "select" ), + opt = select.appendChild( document.createElement( "option" ) ); + + input.type = "checkbox"; + + // Support: Android <=4.3 only + // Default value for a checkbox should be "on" + support.checkOn = input.value !== ""; + + // Support: IE <=11 only + // Must access selectedIndex to make default options select + support.optSelected = opt.selected; + + // Support: IE <=11 only + // An input loses its value after becoming a radio + input = document.createElement( "input" ); + input.value = "t"; + input.type = "radio"; + support.radioValue = input.value === "t"; +} )(); + + +var boolHook, + attrHandle = jQuery.expr.attrHandle; + +jQuery.fn.extend( { + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each( function() { + jQuery.removeAttr( this, name ); + } ); + } +} ); + +jQuery.extend( { + attr: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set attributes on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + // Attribute hooks are determined by the lowercase version + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + hooks = jQuery.attrHooks[ name.toLowerCase() ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); + } + + if ( value !== undefined ) { + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + } + + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + elem.setAttribute( name, value + "" ); + return value; + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? undefined : ret; + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && + nodeName( elem, "input" ) ) { + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + removeAttr: function( elem, value ) { + var name, + i = 0, + + // Attribute names can contain non-HTML whitespace characters + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 + attrNames = value && value.match( rnothtmlwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( ( name = attrNames[ i++ ] ) ) { + elem.removeAttribute( name ); + } + } + } +} ); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + elem.setAttribute( name, name ); + } + return name; + } +}; + +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = function( elem, name, isXML ) { + var ret, handle, + lowercaseName = name.toLowerCase(); + + if ( !isXML ) { + + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ lowercaseName ]; + attrHandle[ lowercaseName ] = ret; + ret = getter( elem, name, isXML ) != null ? + lowercaseName : + null; + attrHandle[ lowercaseName ] = handle; + } + return ret; + }; +} ); + + + + +var rfocusable = /^(?:input|select|textarea|button)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend( { + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each( function() { + delete this[ jQuery.propFix[ name ] || name ]; + } ); + } +} ); + +jQuery.extend( { + prop: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set properties on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + return ( elem[ name ] = value ); + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + return elem[ name ]; + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + + // Support: IE <=9 - 11 only + // elem.tabIndex doesn't always return the + // correct value when it hasn't been explicitly set + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + if ( tabindex ) { + return parseInt( tabindex, 10 ); + } + + if ( + rfocusable.test( elem.nodeName ) || + rclickable.test( elem.nodeName ) && + elem.href + ) { + return 0; + } + + return -1; + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + } +} ); + +// Support: IE <=11 only +// Accessing the selectedIndex property +// forces the browser to respect setting selected +// on the option +// The getter ensures a default option is selected +// when in an optgroup +// eslint rule "no-unused-expressions" is disabled for this code +// since it considers such accessions noop +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + }, + set: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }; +} + +jQuery.each( [ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +} ); + + + + + // Strip and collapse whitespace according to HTML spec + // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + +function getClass( elem ) { + return elem.getAttribute && elem.getAttribute( "class" ) || ""; +} + +jQuery.fn.extend( { + addClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( jQuery.isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( typeof value === "string" && value ) { + classes = value.match( rnothtmlwhite ) || []; + + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( jQuery.isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( !arguments.length ) { + return this.attr( "class", "" ); + } + + if ( typeof value === "string" && value ) { + classes = value.match( rnothtmlwhite ) || []; + + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) > -1 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value; + + if ( typeof stateVal === "boolean" && type === "string" ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( jQuery.isFunction( value ) ) { + return this.each( function( i ) { + jQuery( this ).toggleClass( + value.call( this, i, getClass( this ), stateVal ), + stateVal + ); + } ); + } + + return this.each( function() { + var className, i, self, classNames; + + if ( type === "string" ) { + + // Toggle individual class names + i = 0; + self = jQuery( this ); + classNames = value.match( rnothtmlwhite ) || []; + + while ( ( className = classNames[ i++ ] ) ) { + + // Check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( value === undefined || type === "boolean" ) { + className = getClass( this ); + if ( className ) { + + // Store className if set + dataPriv.set( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || "" + ); + } + } + } ); + }, + + hasClass: function( selector ) { + var className, elem, + i = 0; + + className = " " + selector + " "; + while ( ( elem = this[ i++ ] ) ) { + if ( elem.nodeType === 1 && + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { + return true; + } + } + + return false; + } +} ); + + + + +var rreturn = /\r/g; + +jQuery.fn.extend( { + val: function( value ) { + var hooks, ret, isFunction, + elem = this[ 0 ]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || + jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && + "get" in hooks && + ( ret = hooks.get( elem, "value" ) ) !== undefined + ) { + return ret; + } + + ret = elem.value; + + // Handle most common string cases + if ( typeof ret === "string" ) { + return ret.replace( rreturn, "" ); + } + + // Handle cases where value is null/undef or number + return ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each( function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + + } else if ( typeof val === "number" ) { + val += ""; + + } else if ( Array.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + } ); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + } ); + } +} ); + +jQuery.extend( { + valHooks: { + option: { + get: function( elem ) { + + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + + // Support: IE <=10 - 11 only + // option.text throws exceptions (#14686, #14858) + // Strip and collapse whitespace + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace + stripAndCollapse( jQuery.text( elem ) ); + } + }, + select: { + get: function( elem ) { + var value, option, i, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one", + values = one ? null : [], + max = one ? index + 1 : options.length; + + if ( index < 0 ) { + i = max; + + } else { + i = one ? index : 0; + } + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Support: IE <=9 only + // IE8-9 doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + + // Don't return options that are disabled or in a disabled optgroup + !option.disabled && + ( !option.parentNode.disabled || + !nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + /* eslint-disable no-cond-assign */ + + if ( option.selected = + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 + ) { + optionSet = true; + } + + /* eslint-enable no-cond-assign */ + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + } +} ); + +// Radios and checkboxes getter/setter +jQuery.each( [ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( Array.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + return elem.getAttribute( "value" ) === null ? "on" : elem.value; + }; + } +} ); + + + + +// Return jQuery for attributes-only inclusion + + +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; + +jQuery.extend( jQuery.event, { + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && + dataPriv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( ( !special._default || + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + elem[ type ](); + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + } + ); + + jQuery.event.trigger( e, null, elem ); + } + +} ); + +jQuery.fn.extend( { + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup contextmenu" ).split( " " ), + function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; +} ); + +jQuery.fn.extend( { + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +} ); + + + + +support.focusin = "onfocusin" in window; + + +// Support: Firefox <=44 +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = dataPriv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = dataPriv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + dataPriv.remove( doc, fix ); + + } else { + dataPriv.access( doc, fix, attaches ); + } + } + }; + } ); +} +var location = window.location; + +var nonce = jQuery.now(); + +var rquery = ( /\?/ ); + + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE 9 - 11 only + // IE throws on parseFromString with invalid input. + try { + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); + } catch ( e ) { + xml = undefined; + } + + if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; +}; + + +var + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( Array.isArray( obj ) ) { + + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + + // Item is non-scalar (array or object), encode its numeric index. + buildParams( + prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", + v, + traditional, + add + ); + } + } ); + + } else if ( !traditional && jQuery.type( obj ) === "object" ) { + + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, valueOrFunction ) { + + // If value is a function, invoke it and use its return value + var value = jQuery.isFunction( valueOrFunction ) ? + valueOrFunction() : + valueOrFunction; + + s[ s.length ] = encodeURIComponent( key ) + "=" + + encodeURIComponent( value == null ? "" : value ); + }; + + // If an array was passed in, assume that it is an array of form elements. + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + } ); + + } else { + + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ); +}; + +jQuery.fn.extend( { + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map( function() { + + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + } ) + .filter( function() { + var type = this.type; + + // Use .is( ":disabled" ) so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + } ) + .map( function( i, elem ) { + var val = jQuery( this ).val(); + + if ( val == null ) { + return null; + } + + if ( Array.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ).get(); + } +} ); + + +var + r20 = /%20/g, + rhash = /#.*$/, + rantiCache = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat( "*" ), + + // Anchor tag for parsing the document origin + originAnchor = document.createElement( "a" ); + originAnchor.href = location.href; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; + + if ( jQuery.isFunction( func ) ) { + + // For each dataType in the dataTypeExpression + while ( ( dataType = dataTypes[ i++ ] ) ) { + + // Prepend if requested + if ( dataType[ 0 ] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); + + // Otherwise append + } else { + ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && + !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + } ); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s.throws ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { + state: "parsererror", + error: conv ? e : "No conversion from " + prev + " to " + current + }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend( { + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: location.href, + type: "GET", + isLocal: rlocalProtocol.test( location.protocol ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": JSON.parse, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + + // URL without anti-cache param + cacheURL, + + // Response headers + responseHeadersString, + responseHeaders, + + // timeout handle + timeoutTimer, + + // Url cleanup var + urlAnchor, + + // Request state (becomes false upon send and true upon completion) + completed, + + // To know if global events are to be dispatched + fireGlobals, + + // Loop variable + i, + + // uncached part of the url + uncached, + + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + + // Callbacks context + callbackContext = s.context || s, + + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && + ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + + // Status-dependent callbacks + statusCode = s.statusCode || {}, + + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + + // Default abort message + strAbort = "canceled", + + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( completed ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; + } + } + match = responseHeaders[ key.toLowerCase() ]; + } + return match == null ? null : match; + }, + + // Raw string + getAllResponseHeaders: function() { + return completed ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( completed == null ) { + name = requestHeadersNames[ name.toLowerCase() ] = + requestHeadersNames[ name.toLowerCase() ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( completed == null ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( completed ) { + + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } else { + + // Lazy-add the new callbacks in a way that preserves old ones + for ( code in map ) { + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ); + + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || location.href ) + "" ) + .replace( rprotocol, location.protocol + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; + + // A cross-domain request is in order when the origin doesn't match the current origin. + if ( s.crossDomain == null ) { + urlAnchor = document.createElement( "a" ); + + // Support: IE <=8 - 11, Edge 12 - 13 + // IE throws exception on accessing the href property if url is malformed, + // e.g. http://example.com:80x/ + try { + urlAnchor.href = s.url; + + // Support: IE <=8 - 11 only + // Anchor's host property isn't correctly set when s.url is relative + urlAnchor.href = urlAnchor.href; + s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== + urlAnchor.protocol + "//" + urlAnchor.host; + } catch ( e ) { + + // If there is an error parsing the URL, assume it is crossDomain, + // it can be rejected by the transport if it is invalid + s.crossDomain = true; + } + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( completed ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + // Remove hash to simplify url manipulation + cacheURL = s.url.replace( rhash, "" ); + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // Remember the hash so we can put it back + uncached = s.url.slice( cacheURL.length ); + + // If data is available, append data to url + if ( s.data ) { + cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; + + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add or update anti-cache param if needed + if ( s.cache === false ) { + cacheURL = cacheURL.replace( rantiCache, "$1" ); + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; + } + + // Put hash and anti-cache on the URL that will be requested (gh-1732) + s.url = cacheURL + uncached; + + // Change '%20' to '+' if this is encoded form body content (gh-2658) + } else if ( s.data && s.processData && + ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { + s.data = s.data.replace( r20, "+" ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? + s.accepts[ s.dataTypes[ 0 ] ] + + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && + ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { + + // Abort if not done already and return + return jqXHR.abort(); + } + + // Aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + completeDeferred.add( s.complete ); + jqXHR.done( s.success ); + jqXHR.fail( s.error ); + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + + // If request was aborted inside ajaxSend, stop there + if ( completed ) { + return jqXHR; + } + + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = window.setTimeout( function() { + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + completed = false; + transport.send( requestHeaders, done ); + } catch ( e ) { + + // Rethrow post-completion exceptions + if ( completed ) { + throw e; + } + + // Propagate others as results + done( -1, e ); + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Ignore repeat invocations + if ( completed ) { + return; + } + + completed = true; + + // Clear timeout if it exists + if ( timeoutTimer ) { + window.clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader( "Last-Modified" ); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader( "etag" ); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + + // Extract error from statusText and normalize for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +} ); + +jQuery.each( [ "get", "post" ], function( i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + + // Shift arguments if data argument was omitted + if ( jQuery.isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + // The url can be an options object (which then must have .url) + return jQuery.ajax( jQuery.extend( { + url: url, + type: method, + dataType: type, + data: data, + success: callback + }, jQuery.isPlainObject( url ) && url ) ); + }; +} ); + + +jQuery._evalUrl = function( url ) { + return jQuery.ajax( { + url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) + type: "GET", + dataType: "script", + cache: true, + async: false, + global: false, + "throws": true + } ); +}; + + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( jQuery.isFunction( html ) ) { + html = html.call( this[ 0 ] ); + } + + // The elements to wrap the target around + wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); + + if ( this[ 0 ].parentNode ) { + wrap.insertBefore( this[ 0 ] ); + } + + wrap.map( function() { + var elem = this; + + while ( elem.firstElementChild ) { + elem = elem.firstElementChild; + } + + return elem; + } ).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each( function( i ) { + jQuery( this ).wrapInner( html.call( this, i ) ); + } ); + } + + return this.each( function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + } ); + }, + + wrap: function( html ) { + var isFunction = jQuery.isFunction( html ); + + return this.each( function( i ) { + jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); + } ); + }, + + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + + +jQuery.expr.pseudos.hidden = function( elem ) { + return !jQuery.expr.pseudos.visible( elem ); +}; +jQuery.expr.pseudos.visible = function( elem ) { + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); +}; + + + + +jQuery.ajaxSettings.xhr = function() { + try { + return new window.XMLHttpRequest(); + } catch ( e ) {} +}; + +var xhrSuccessStatus = { + + // File protocol always yields status code 0, assume 200 + 0: 200, + + // Support: IE <=9 only + // #1450: sometimes IE returns 1223 when it should be 204 + 1223: 204 + }, + xhrSupported = jQuery.ajaxSettings.xhr(); + +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +support.ajax = xhrSupported = !!xhrSupported; + +jQuery.ajaxTransport( function( options ) { + var callback, errorCallback; + + // Cross domain only allowed if supported through XMLHttpRequest + if ( support.cors || xhrSupported && !options.crossDomain ) { + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(); + + xhr.open( + options.type, + options.url, + options.async, + options.username, + options.password + ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + + // Callback + callback = function( type ) { + return function() { + if ( callback ) { + callback = errorCallback = xhr.onload = + xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; + + if ( type === "abort" ) { + xhr.abort(); + } else if ( type === "error" ) { + + // Support: IE <=9 only + // On a manual native abort, IE9 throws + // errors on any property access that is not readyState + if ( typeof xhr.status !== "number" ) { + complete( 0, "error" ); + } else { + complete( + + // File: protocol always yields status 0; see #8605, #14207 + xhr.status, + xhr.statusText + ); + } + } else { + complete( + xhrSuccessStatus[ xhr.status ] || xhr.status, + xhr.statusText, + + // Support: IE <=9 only + // IE9 has no XHR2 but throws on binary (trac-11426) + // For XHR2 non-text, let the caller handle it (gh-2498) + ( xhr.responseType || "text" ) !== "text" || + typeof xhr.responseText !== "string" ? + { binary: xhr.response } : + { text: xhr.responseText }, + xhr.getAllResponseHeaders() + ); + } + } + }; + }; + + // Listen to events + xhr.onload = callback(); + errorCallback = xhr.onerror = callback( "error" ); + + // Support: IE 9 only + // Use onreadystatechange to replace onabort + // to handle uncaught aborts + if ( xhr.onabort !== undefined ) { + xhr.onabort = errorCallback; + } else { + xhr.onreadystatechange = function() { + + // Check readyState before timeout as it changes + if ( xhr.readyState === 4 ) { + + // Allow onerror to be called first, + // but that will not handle a native abort + // Also, save errorCallback to a variable + // as xhr.onerror cannot be accessed + window.setTimeout( function() { + if ( callback ) { + errorCallback(); + } + } ); + } + }; + } + + // Create the abort callback + callback = callback( "abort" ); + + try { + + // Do send the request (this may raise an exception) + xhr.send( options.hasContent && options.data || null ); + } catch ( e ) { + + // #14683: Only rethrow if this hasn't been notified as an error yet + if ( callback ) { + throw e; + } + } + }, + + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) +jQuery.ajaxPrefilter( function( s ) { + if ( s.crossDomain ) { + s.contents.script = false; + } +} ); + +// Install script dataType +jQuery.ajaxSetup( { + accepts: { + script: "text/javascript, application/javascript, " + + "application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +} ); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + } +} ); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function( s ) { + + // This transport only deals with cross domain requests + if ( s.crossDomain ) { + var script, callback; + return { + send: function( _, complete ) { + script = jQuery( "<script>" ).prop( { + charset: s.scriptCharset, + src: s.url + } ).on( + "load error", + callback = function( evt ) { + script.remove(); + callback = null; + if ( evt ) { + complete( evt.type === "error" ? 404 : 200, evt.type ); + } + } + ); + + // Use native DOM manipulation to avoid our domManip AJAX trickery + document.head.appendChild( script[ 0 ] ); + }, + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +var oldCallbacks = [], + rjsonp = /(=)\?(?=&|$)|\?\?/; + +// Default jsonp settings +jQuery.ajaxSetup( { + jsonp: "callback", + jsonpCallback: function() { + var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); + this[ callback ] = true; + return callback; + } +} ); + +// Detect, normalize options and install callbacks for jsonp requests +jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { + + var callbackName, overwritten, responseContainer, + jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? + "url" : + typeof s.data === "string" && + ( s.contentType || "" ) + .indexOf( "application/x-www-form-urlencoded" ) === 0 && + rjsonp.test( s.data ) && "data" + ); + + // Handle iff the expected data type is "jsonp" or we have a parameter to set + if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { + + // Get callback name, remembering preexisting value associated with it + callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? + s.jsonpCallback() : + s.jsonpCallback; + + // Insert callback into url or form data + if ( jsonProp ) { + s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); + } else if ( s.jsonp !== false ) { + s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; + } + + // Use data converter to retrieve json after script execution + s.converters[ "script json" ] = function() { + if ( !responseContainer ) { + jQuery.error( callbackName + " was not called" ); + } + return responseContainer[ 0 ]; + }; + + // Force json dataType + s.dataTypes[ 0 ] = "json"; + + // Install callback + overwritten = window[ callbackName ]; + window[ callbackName ] = function() { + responseContainer = arguments; + }; + + // Clean-up function (fires after converters) + jqXHR.always( function() { + + // If previous value didn't exist - remove it + if ( overwritten === undefined ) { + jQuery( window ).removeProp( callbackName ); + + // Otherwise restore preexisting value + } else { + window[ callbackName ] = overwritten; + } + + // Save back as free + if ( s[ callbackName ] ) { + + // Make sure that re-using the options doesn't screw things around + s.jsonpCallback = originalSettings.jsonpCallback; + + // Save the callback name for future use + oldCallbacks.push( callbackName ); + } + + // Call if it was a function and we have a response + if ( responseContainer && jQuery.isFunction( overwritten ) ) { + overwritten( responseContainer[ 0 ] ); + } + + responseContainer = overwritten = undefined; + } ); + + // Delegate to script + return "script"; + } +} ); + + + + +// Support: Safari 8 only +// In Safari 8 documents created via document.implementation.createHTMLDocument +// collapse sibling forms: the second one becomes a child of the first one. +// Because of that, this security measure has to be disabled in Safari 8. +// https://bugs.webkit.org/show_bug.cgi?id=137337 +support.createHTMLDocument = ( function() { + var body = document.implementation.createHTMLDocument( "" ).body; + body.innerHTML = "<form></form><form></form>"; + return body.childNodes.length === 2; +} )(); + + +// Argument "data" should be string of html +// context (optional): If specified, the fragment will be created in this context, +// defaults to document +// keepScripts (optional): If true, will include scripts passed in the html string +jQuery.parseHTML = function( data, context, keepScripts ) { + if ( typeof data !== "string" ) { + return []; + } + if ( typeof context === "boolean" ) { + keepScripts = context; + context = false; + } + + var base, parsed, scripts; + + if ( !context ) { + + // Stop scripts or inline event handlers from being executed immediately + // by using document.implementation + if ( support.createHTMLDocument ) { + context = document.implementation.createHTMLDocument( "" ); + + // Set the base href for the created document + // so any parsed elements with URLs + // are based on the document's URL (gh-2965) + base = context.createElement( "base" ); + base.href = document.location.href; + context.head.appendChild( base ); + } else { + context = document; + } + } + + parsed = rsingleTag.exec( data ); + scripts = !keepScripts && []; + + // Single tag + if ( parsed ) { + return [ context.createElement( parsed[ 1 ] ) ]; + } + + parsed = buildFragment( [ data ], context, scripts ); + + if ( scripts && scripts.length ) { + jQuery( scripts ).remove(); + } + + return jQuery.merge( [], parsed.childNodes ); +}; + + +/** + * Load a url into a page + */ +jQuery.fn.load = function( url, params, callback ) { + var selector, type, response, + self = this, + off = url.indexOf( " " ); + + if ( off > -1 ) { + selector = stripAndCollapse( url.slice( off ) ); + url = url.slice( 0, off ); + } + + // If it's a function + if ( jQuery.isFunction( params ) ) { + + // We assume that it's the callback + callback = params; + params = undefined; + + // Otherwise, build a param string + } else if ( params && typeof params === "object" ) { + type = "POST"; + } + + // If we have elements to modify, make the request + if ( self.length > 0 ) { + jQuery.ajax( { + url: url, + + // If "type" variable is undefined, then "GET" method will be used. + // Make value of this field explicit since + // user can override it through ajaxSetup method + type: type || "GET", + dataType: "html", + data: params + } ).done( function( responseText ) { + + // Save response for use in complete callback + response = arguments; + + self.html( selector ? + + // If a selector was specified, locate the right elements in a dummy div + // Exclude scripts to avoid IE 'Permission Denied' errors + jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : + + // Otherwise use the full result + responseText ); + + // If the request succeeds, this function gets "data", "status", "jqXHR" + // but they are ignored because response was set above. + // If it fails, this function gets "jqXHR", "status", "error" + } ).always( callback && function( jqXHR, status ) { + self.each( function() { + callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); + } ); + } ); + } + + return this; +}; + + + + +// Attach a bunch of functions for handling common AJAX events +jQuery.each( [ + "ajaxStart", + "ajaxStop", + "ajaxComplete", + "ajaxError", + "ajaxSuccess", + "ajaxSend" +], function( i, type ) { + jQuery.fn[ type ] = function( fn ) { + return this.on( type, fn ); + }; +} ); + + + + +jQuery.expr.pseudos.animated = function( elem ) { + return jQuery.grep( jQuery.timers, function( fn ) { + return elem === fn.elem; + } ).length; +}; + + + + +jQuery.offset = { + setOffset: function( elem, options, i ) { + var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, + position = jQuery.css( elem, "position" ), + curElem = jQuery( elem ), + props = {}; + + // Set position first, in-case top/left are set even on static elem + if ( position === "static" ) { + elem.style.position = "relative"; + } + + curOffset = curElem.offset(); + curCSSTop = jQuery.css( elem, "top" ); + curCSSLeft = jQuery.css( elem, "left" ); + calculatePosition = ( position === "absolute" || position === "fixed" ) && + ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; + + // Need to be able to calculate position if either + // top or left is auto and position is either absolute or fixed + if ( calculatePosition ) { + curPosition = curElem.position(); + curTop = curPosition.top; + curLeft = curPosition.left; + + } else { + curTop = parseFloat( curCSSTop ) || 0; + curLeft = parseFloat( curCSSLeft ) || 0; + } + + if ( jQuery.isFunction( options ) ) { + + // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) + options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); + } + + if ( options.top != null ) { + props.top = ( options.top - curOffset.top ) + curTop; + } + if ( options.left != null ) { + props.left = ( options.left - curOffset.left ) + curLeft; + } + + if ( "using" in options ) { + options.using.call( elem, props ); + + } else { + curElem.css( props ); + } + } +}; + +jQuery.fn.extend( { + offset: function( options ) { + + // Preserve chaining for setter + if ( arguments.length ) { + return options === undefined ? + this : + this.each( function( i ) { + jQuery.offset.setOffset( this, options, i ); + } ); + } + + var doc, docElem, rect, win, + elem = this[ 0 ]; + + if ( !elem ) { + return; + } + + // Return zeros for disconnected and hidden (display: none) elements (gh-2310) + // Support: IE <=11 only + // Running getBoundingClientRect on a + // disconnected node in IE throws an error + if ( !elem.getClientRects().length ) { + return { top: 0, left: 0 }; + } + + rect = elem.getBoundingClientRect(); + + doc = elem.ownerDocument; + docElem = doc.documentElement; + win = doc.defaultView; + + return { + top: rect.top + win.pageYOffset - docElem.clientTop, + left: rect.left + win.pageXOffset - docElem.clientLeft + }; + }, + + position: function() { + if ( !this[ 0 ] ) { + return; + } + + var offsetParent, offset, + elem = this[ 0 ], + parentOffset = { top: 0, left: 0 }; + + // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, + // because it is its only offset parent + if ( jQuery.css( elem, "position" ) === "fixed" ) { + + // Assume getBoundingClientRect is there when computed position is fixed + offset = elem.getBoundingClientRect(); + + } else { + + // Get *real* offsetParent + offsetParent = this.offsetParent(); + + // Get correct offsets + offset = this.offset(); + if ( !nodeName( offsetParent[ 0 ], "html" ) ) { + parentOffset = offsetParent.offset(); + } + + // Add offsetParent borders + parentOffset = { + top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ), + left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ) + }; + } + + // Subtract parent offsets and element margins + return { + top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), + left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) + }; + }, + + // This method will return documentElement in the following cases: + // 1) For the element inside the iframe without offsetParent, this method will return + // documentElement of the parent window + // 2) For the hidden or detached element + // 3) For body or html element, i.e. in case of the html node - it will return itself + // + // but those exceptions were never presented as a real life use-cases + // and might be considered as more preferable results. + // + // This logic, however, is not guaranteed and can change at any point in the future + offsetParent: function() { + return this.map( function() { + var offsetParent = this.offsetParent; + + while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { + offsetParent = offsetParent.offsetParent; + } + + return offsetParent || documentElement; + } ); + } +} ); + +// Create scrollLeft and scrollTop methods +jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { + var top = "pageYOffset" === prop; + + jQuery.fn[ method ] = function( val ) { + return access( this, function( elem, method, val ) { + + // Coalesce documents and windows + var win; + if ( jQuery.isWindow( elem ) ) { + win = elem; + } else if ( elem.nodeType === 9 ) { + win = elem.defaultView; + } + + if ( val === undefined ) { + return win ? win[ prop ] : elem[ method ]; + } + + if ( win ) { + win.scrollTo( + !top ? val : win.pageXOffset, + top ? val : win.pageYOffset + ); + + } else { + elem[ method ] = val; + } + }, method, val, arguments.length ); + }; +} ); + +// Support: Safari <=7 - 9.1, Chrome <=37 - 49 +// Add the top/left cssHooks using jQuery.fn.position +// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 +// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 +// getComputedStyle returns percent when specified for top/left/bottom/right; +// rather than make the css module depend on the offset module, just check for it here +jQuery.each( [ "top", "left" ], function( i, prop ) { + jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, + function( elem, computed ) { + if ( computed ) { + computed = curCSS( elem, prop ); + + // If curCSS returns percentage, fallback to offset + return rnumnonpx.test( computed ) ? + jQuery( elem ).position()[ prop ] + "px" : + computed; + } + } + ); +} ); + + +// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods +jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { + jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, + function( defaultExtra, funcName ) { + + // Margin is only for outerHeight, outerWidth + jQuery.fn[ funcName ] = function( margin, value ) { + var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), + extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); + + return access( this, function( elem, type, value ) { + var doc; + + if ( jQuery.isWindow( elem ) ) { + + // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) + return funcName.indexOf( "outer" ) === 0 ? + elem[ "inner" + name ] : + elem.document.documentElement[ "client" + name ]; + } + + // Get document width or height + if ( elem.nodeType === 9 ) { + doc = elem.documentElement; + + // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], + // whichever is greatest + return Math.max( + elem.body[ "scroll" + name ], doc[ "scroll" + name ], + elem.body[ "offset" + name ], doc[ "offset" + name ], + doc[ "client" + name ] + ); + } + + return value === undefined ? + + // Get width or height on the element, requesting but not forcing parseFloat + jQuery.css( elem, type, extra ) : + + // Set width or height on the element + jQuery.style( elem, type, value, extra ); + }, type, chainable ? margin : undefined, chainable ); + }; + } ); +} ); + + +jQuery.fn.extend( { + + bind: function( types, data, fn ) { + return this.on( types, null, data, fn ); + }, + unbind: function( types, fn ) { + return this.off( types, null, fn ); + }, + + delegate: function( selector, types, data, fn ) { + return this.on( types, selector, data, fn ); + }, + undelegate: function( selector, types, fn ) { + + // ( namespace ) or ( selector, types [, fn] ) + return arguments.length === 1 ? + this.off( selector, "**" ) : + this.off( types, selector || "**", fn ); + } +} ); + +jQuery.holdReady = function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } +}; +jQuery.isArray = Array.isArray; +jQuery.parseJSON = JSON.parse; +jQuery.nodeName = nodeName; + + + + +// Register as a named AMD module, since jQuery can be concatenated with other +// files that may use define, but not via a proper concatenation script that +// understands anonymous AMD modules. A named AMD is safest and most robust +// way to register. Lowercase jquery is used because AMD module names are +// derived from file names, and jQuery is normally delivered in a lowercase +// file name. Do this after creating the global so that if an AMD module wants +// to call noConflict to hide this version of jQuery, it will work. + +// Note that for maximum portability, libraries that are not jQuery should +// declare themselves as anonymous modules, and avoid setting a global if an +// AMD loader is present. jQuery is a special case. For more information, see +// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon + +if ( typeof define === "function" && define.amd ) { + define( "jquery", [], function() { + return jQuery; + } ); +} + + + + +var + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$; + +jQuery.noConflict = function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; +}; + +// Expose jQuery and $ identifiers, even in AMD +// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) +// and CommonJS for browser emulators (#13566) +if ( !noGlobal ) { + window.jQuery = window.$ = jQuery; +} + + + + +return jQuery; +} ); diff --git a/Web/js/jquery-3.2.1.min.js b/Web/js/jquery-3.2.1.min.js new file mode 100644 index 0000000000000000000000000000000000000000..644d35e274fd64ddaf6d12af813e820c424176a9 --- /dev/null +++ b/Web/js/jquery-3.2.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=Array.isArray(d)))?(e?(e=!1,f=c&&Array.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,N,e),g(f,c,O,e)):(f++,j.call(a,g(f,c,N,e),g(f,c,O,e),g(f,c,N,c.notifyWith))):(d!==N&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S), +a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},U=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function V(){this.expando=r.expando+V.uid++}V.uid=1,V.prototype={cache:function(a){var b=a[this.expando];return b||(b={},U(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){Array.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(L)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var W=new V,X=new V,Y=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function $(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:Y.test(a)?JSON.parse(a):a)}function _(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Z,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=$(c)}catch(e){}X.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return X.hasData(a)||W.hasData(a)},data:function(a,b,c){return X.access(a,b,c)},removeData:function(a,b){X.remove(a,b)},_data:function(a,b,c){return W.access(a,b,c)},_removeData:function(a,b){W.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=X.get(f),1===f.nodeType&&!W.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),_(f,d,e[d])));W.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){X.set(this,a)}):T(this,function(b){var c;if(f&&void 0===b){if(c=X.get(f,a),void 0!==c)return c;if(c=_(f,a),void 0!==c)return c}else this.each(function(){X.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=W.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var aa=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ba=new RegExp("^(?:([+-])=|)("+aa+")([a-z%]*)$","i"),ca=["Top","Right","Bottom","Left"],da=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ea=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function fa(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&ba.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ga={};function ha(a){var b,c=a.ownerDocument,d=a.nodeName,e=ga[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ga[d]=e,e)}function ia(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=W.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&da(d)&&(e[f]=ha(d))):"none"!==c&&(e[f]="none",W.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ia(this,!0)},hide:function(){return ia(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){da(this)?r(this).show():r(this).hide()})}});var ja=/^(?:checkbox|radio)$/i,ka=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c<d;c++)W.set(a[c],"globalEval",!b||W.get(b[c],"globalEval"))}var pa=/<|&#?\w+;/;function qa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(pa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ka.exec(f)||["",""])[1].toLowerCase(),i=ma[h]||ma._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==xa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===xa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&B(this,"input"))return this.click(),!1},_default:function(a){return B(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?va:wa,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:wa,isPropagationStopped:wa,isImmediatePropagationStopped:wa,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=va,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=va,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=va,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&sa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ta.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return ya(this,a,b,c,d)},one:function(a,b,c,d){return ya(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=wa),this.each(function(){r.event.remove(this,a,c,b)})}});var za=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/<script|<style|<link/i,Ba=/checked\s*(?:[^=]|=\s*.checked.)/i,Ca=/^true\/(.*)/,Da=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}X.hasData(a)&&(h=X.access(a),i=r.extend({},h),X.set(b,i))}}function Ia(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ja.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ja(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,na(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ga),l=0;l<i;l++)j=h[l],la.test(j.type||"")&&!W.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Da,""),k))}return a}function Ka(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(na(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&oa(na(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(za,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d<e;d++)Ia(f[d],g[d]);if(b)if(c)for(f=f||na(a),g=g||na(h),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);else Ha(a,h);return g=na(h,"script"),g.length>0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(na(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ja(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(na(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var La=/^margin/,Ma=new RegExp("^("+aa+")(?!px)[a-z%]+$","i"),Na=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",ra.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,ra.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Oa(a,b,c){var d,e,f,g,h=a.style;return c=c||Na(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ma.test(g)&&La.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Pa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Qa=/^(none|table(?!-c[ea]).+)/,Ra=/^--/,Sa={position:"absolute",visibility:"hidden",display:"block"},Ta={letterSpacing:"0",fontWeight:"400"},Ua=["Webkit","Moz","ms"],Va=d.createElement("div").style;function Wa(a){if(a in Va)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ua.length;while(c--)if(a=Ua[c]+b,a in Va)return a}function Xa(a){var b=r.cssProps[a];return b||(b=r.cssProps[a]=Wa(a)||a),b}function Ya(a,b,c){var d=ba.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Za(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ca[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ca[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ca[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ca[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ca[f]+"Width",!0,e)));return g}function $a(a,b,c){var d,e=Na(a),f=Oa(a,b,e),g="border-box"===r.css(a,"boxSizing",!1,e);return Ma.test(f)?f:(d=g&&(o.boxSizingReliable()||f===a.style[b]),"auto"===f&&(f=a["offset"+b[0].toUpperCase()+b.slice(1)]),f=parseFloat(f)||0,f+Za(a,b,c||(g?"border":"content"),d,e)+"px")}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Oa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=Ra.test(b),j=a.style;return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:j[b]:(f=typeof c,"string"===f&&(e=ba.exec(c))&&e[1]&&(c=fa(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(j[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i?j.setProperty(b,c):j[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b),i=Ra.test(b);return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Oa(a,b,d)),"normal"===e&&b in Ta&&(e=Ta[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Qa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?$a(a,b,d):ea(a,Sa,function(){return $a(a,b,d)})},set:function(a,c,d){var e,f=d&&Na(a),g=d&&Za(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=ba.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ya(a,c,g)}}}),r.cssHooks.marginLeft=Pa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Oa(a,"marginLeft"))||a.getBoundingClientRect().left-ea(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ca[d]+b]=f[d]||f[d-2]||f[0];return e}},La.test(a)||(r.cssHooks[a+b].set=Ya)}),r.fn.extend({css:function(a,b){return T(this,function(a,b,c){var d,e,f={},g=0;if(Array.isArray(b)){for(d=Na(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&da(a),q=W.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],cb.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=W.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ia([a],!0),j=a.style.display||j,k=r.css(a,"display"),ia([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=W.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ia([a],!0),m.done(function(){p||ia([a]),W.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=hb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],Array.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=kb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=ab||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(i||h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:ab||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);f<g;f++)if(d=kb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,hb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j}r.Animation=r.extend(kb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return fa(c.elem,a,ba.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(L);for(var c,d=0,e=a.length;d<e;d++)c=a[d],kb.tweeners[c]=kb.tweeners[c]||[],kb.tweeners[c].unshift(b)},prefilters:[ib],prefilter:function(a,b){b?kb.prefilters.unshift(a):kb.prefilters.push(a)}}),r.speed=function(a,b,c){var d=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off?d.duration=0:"number"!=typeof d.duration&&(d.duration in r.fx.speeds?d.duration=r.fx.speeds[d.duration]:d.duration=r.fx.speeds._default),null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){r.isFunction(d.old)&&d.old.call(this),d.queue&&r.dequeue(this,d.queue)},d},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(da).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=kb(this,r.extend({},a),f);(e||W.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=W.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&db.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=W.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),r.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(ab=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),ab=void 0},r.fx.timer=function(a){r.timers.push(a),r.fx.start()},r.fx.interval=13,r.fx.start=function(){bb||(bb=!0,eb())},r.fx.stop=function(){bb=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var lb,mb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return T(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b), +null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!B(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Tb=[],Ub=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Tb.pop()||r.expando+"_"+ub++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Ub.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ub.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Ub,"$1"+e):b.jsonp!==!1&&(b.url+=(vb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Tb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=C.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=qa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=pb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length},r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),b=f.ownerDocument,c=b.documentElement,e=b.defaultView,{top:d.top+e.pageYOffset-c.clientTop,left:d.left+e.pageXOffset-c.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),B(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||ra})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return T(this,function(a,d,e){var f;return r.isWindow(a)?f=a:9===a.nodeType&&(f=a.defaultView),void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Pa(o.pixelPosition,function(a,c){if(c)return c=Oa(a,b),Ma.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return T(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.holdReady=function(a){a?r.readyWait++:r.ready(!0)},r.isArray=Array.isArray,r.parseJSON=JSON.parse,r.nodeName=B,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Vb=a.jQuery,Wb=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Wb),b&&a.jQuery===r&&(a.jQuery=Vb),r},b||(a.jQuery=a.$=r),r}); diff --git a/Web/js/jquery-3.3.1.js b/Web/js/jquery-3.3.1.js new file mode 100644 index 0000000000000000000000000000000000000000..9b5206bcc60781905d111863bdb6232d90490f33 --- /dev/null +++ b/Web/js/jquery-3.3.1.js @@ -0,0 +1,10364 @@ +/*! + * jQuery JavaScript Library v3.3.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2018-01-20T17:24Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var document = window.document; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var concat = arr.concat; + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + +var isFunction = function isFunction( obj ) { + + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML <object> elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + return typeof obj === "function" && typeof obj.nodeType !== "number"; + }; + + +var isWindow = function isWindow( obj ) { + return obj != null && obj === obj.window; + }; + + + + + var preservedScriptAttributes = { + type: true, + src: true, + noModule: true + }; + + function DOMEval( code, doc, node ) { + doc = doc || document; + + var i, + script = doc.createElement( "script" ); + + script.text = code; + if ( node ) { + for ( i in preservedScriptAttributes ) { + if ( node[ i ] ) { + script[ i ] = node[ i ]; + } + } + } + doc.head.appendChild( script ).parentNode.removeChild( script ); + } + + +function toType( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; +} +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.3.1", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android <=4.0 only + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } + + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && Array.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + + /* eslint-disable no-unused-vars */ + // See https://github.com/eslint/eslint/issues/6125 + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + // Evaluates a script in a global context + globalEval: function( code ) { + DOMEval( code ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android <=4.0 only + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = toType( obj ); + + if ( isFunction( obj ) || isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.3 + * https://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-08-08 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + disabledAncestor = addCombinator( + function( elem ) { + return elem.disabled === true && ("form" in elem || "label" in elem); + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; + + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { + + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[i] = "#" + nid + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement("fieldset"); + + try { + return !!fn( el ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + disabledAncestor( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( preferredDoc !== document && + (subWindow = document.defaultView) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( el ) { + el.className = "i"; + return !el.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( el ) { + el.appendChild( document.createComment("") ); + return !el.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programmatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + }); + + // ID filter and find + if ( support.getById ) { + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; + } else { + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( (elem = elems[i++]) ) { + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See https://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( el ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // https://bugs.jquery.com/ticket/12359 + docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + + "<select id='" + expando + "-\r\\' msallowcapture=''>" + + "<option selected=''></option></select>"; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !el.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( el ) { + el.innerHTML = "<a href='' disabled='disabled'></a>" + + "<select disabled='disabled'><option/></select>"; + + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement("input"); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( el.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( el.querySelectorAll(":enabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll(":disabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + el.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( el ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( el, "*" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( el, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === document ? -1 : + b === document ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.escape = function( sel ) { + return (sel + "").replace( rcssescape, fcssescape ); +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + return false; + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( (oldCache = uniqueCache[ key ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ key ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + return false; + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context === document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context || document, xml) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( el ) { + // Should return 1, but returns 4 (following) + return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( el ) { + el.innerHTML = "<a href='#'></a>"; + return el.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( el ) { + el.innerHTML = "<input/>"; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( el ) { + return el.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; + + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +}; +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) !== not; + } ); + } + + // Single element + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + } + + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); + } + + // Filtered directly for both simple and complex selectors + return jQuery.filter( qualifier, elements, not ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, ret, + len = this.length, + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + ret = this.pushStack( [] ); + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + return len > 1 ? jQuery.uniqueSort( ret ) : ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { + + // Inject the element directly into the jQuery object + this[ 0 ] = elem; + this.length = 1; + } + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + targets = typeof selectors !== "string" && jQuery( selectors ); + + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + if ( nodeName( elem, "iframe" ) ) { + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && toType( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // rejected_handlers.disable + // fulfilled_handlers.disable + tuples[ 3 - i ][ 3 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock, + + // progress_handlers.lock + tuples[ 0 ][ 3 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the master Deferred + master = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + master.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( master.state() === "pending" || + isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return master.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); + } + + return master.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( toType( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; + + +// Matches dashed string for camelizing +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; + +// Used by camelCase as callback to replace() +function fcamelCase( all, letter ) { + return letter.toUpperCase(); +} + +// Convert dashed to camelCase; used by the css and data modules +// Support: IE <=9 - 11, Edge 12 - 15 +// Microsoft forgot to hump their vendor prefix (#9572) +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( camelCase ); + } else { + key = camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + jQuery.contains( elem.ownerDocument, elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + +var swap = function( elem, options, callback, args ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.apply( elem, args || [] ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, scale, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Support: Firefox <=54 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) + initial = initial / 2; + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + while ( maxIterations-- ) { + + // Evaluate and update our best guess (doubling guesses that zero out). + // Finish if the scale equals or crosses 1 (making the old*new product non-positive). + jQuery.style( elem, prop, initialInUnit + unit ); + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { + maxIterations = 0; + } + initialInUnit = initialInUnit / scale; + + } + + initialInUnit = initialInUnit * 2; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); + +var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); + + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // Support: IE <=9 only + option: [ 1, "<select multiple='multiple'>", "</select>" ], + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting <tbody> or other required elements. + thead: [ 1, "<table>", "</table>" ], + col: [ 2, "<table><colgroup>", "</colgroup></table>" ], + tr: [ 2, "<table><tbody>", "</tbody></table>" ], + td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], + + _default: [ 0, "", "" ] +}; + +// Support: IE <=9 only +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, contains, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( toType( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = "<textarea>x</textarea>"; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; +} )(); +var documentElement = document.documentElement; + + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 only +// See #13393 for more info +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = {}; + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( nativeEvent ) { + + // Make a writable jQuery.Event from the native event object + var event = jQuery.event.fix( nativeEvent ); + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG <use> instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + this.focus(); + return false; + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + + which: function( event ) { + var button = event.button; + + // Add which for key events + if ( event.which == null && rkeyEvent.test( event.type ) ) { + return event.charCode != null ? event.charCode : event.keyCode; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { + if ( button & 1 ) { + return 1; + } + + if ( button & 2 ) { + return 3; + } + + if ( button & 4 ) { + return 2; + } + + return 0; + } + + return event.which; + } +}, jQuery.event.addProp ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + /* eslint-disable max-len */ + + // See https://github.com/eslint/eslint/issues/3229 + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, + + /* eslint-enable */ + + // Support: IE <=10 - 11, Edge 12 - 13 only + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /<script|<style|<link/i, + + // checked="checked" or checked + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, + rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( elem ).children( "tbody" )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { + elem.type = elem.type.slice( 5 ); + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.access( src ); + pdataCur = dataPriv.set( dest, pdataOld ); + events = pdataOld.events; + + if ( events ) { + delete pdataCur.handle; + pdataCur.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + valueIsFunction = isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( valueIsFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( valueIsFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), doc, node ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1></$2>" ); + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = jQuery.contains( elem.ownerDocument, elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + +var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + container.style.cssText = "position:absolute;left:-11111px;width:60px;" + + "margin-top:1px;padding:0;border:0"; + div.style.cssText = + "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + + "margin:auto;border:1px;padding:1px;" + + "width:60%;top:1%"; + documentElement.appendChild( container ).appendChild( div ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; + + // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 + // Some styles come back with percentage values, even though they shouldn't + div.style.right = "60%"; + pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; + + // Support: IE 9 - 11 only + // Detect misreporting of content dimensions for box-sizing:border-box elements + boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; + + // Support: IE 9 only + // Detect overflow:scroll screwiness (gh-3699) + div.style.position = "absolute"; + scrollboxSizeVal = div.offsetWidth === 36 || "absolute"; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + function roundPixelMeasures( measure ) { + return Math.round( parseFloat( measure ) ); + } + + var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, + reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + jQuery.extend( support, { + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelBoxStyles: function() { + computeStyleTests(); + return pixelBoxStylesVal; + }, + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + }, + scrollboxSize: function() { + computeStyleTests(); + return scrollboxSizeVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }, + + cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style; + +// Return a css property mapped to a potentially vendor prefixed property +function vendorPropName( name ) { + + // Shortcut for names that are not vendor prefixed + if ( name in emptyStyle ) { + return name; + } + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in emptyStyle ) { + return name; + } + } +} + +// Return a property mapped along what jQuery.cssProps suggests or to +// a vendor prefixed property. +function finalPropName( name ) { + var ret = jQuery.cssProps[ name ]; + if ( !ret ) { + ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name; + } + return ret; +} + +function setPositiveNumber( elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { + var i = dimension === "width" ? 1 : 0, + extra = 0, + delta = 0; + + // Adjustment may not be necessary + if ( box === ( isBorderBox ? "border" : "content" ) ) { + return 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin + if ( box === "margin" ) { + delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); + } + + // If we get here with a content-box, we're seeking "padding" or "border" or "margin" + if ( !isBorderBox ) { + + // Add padding + delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // For "border" or "margin", add border + if ( box !== "padding" ) { + delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + + // But still keep track of it otherwise + } else { + extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + + // If we get here with a border-box (content + padding + border), we're seeking "content" or + // "padding" or "margin" + } else { + + // For "content", subtract padding + if ( box === "content" ) { + delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // For "content" or "padding", subtract border + if ( box !== "margin" ) { + delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + // Account for positive content-box scroll gutter when requested by providing computedVal + if ( !isBorderBox && computedVal >= 0 ) { + + // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border + // Assuming integer scroll gutter, subtract the rest and round down + delta += Math.max( 0, Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + computedVal - + delta - + extra - + 0.5 + ) ); + } + + return delta; +} + +function getWidthOrHeight( elem, dimension, extra ) { + + // Start with computed style + var styles = getStyles( elem ), + val = curCSS( elem, dimension, styles ), + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + valueIsBorderBox = isBorderBox; + + // Support: Firefox <=54 + // Return a confounding non-pixel value or feign ignorance, as appropriate. + if ( rnumnonpx.test( val ) ) { + if ( !extra ) { + return val; + } + val = "auto"; + } + + // Check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = valueIsBorderBox && + ( support.boxSizingReliable() || val === elem.style[ dimension ] ); + + // Fall back to offsetWidth/offsetHeight when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + // Support: Android <=4.1 - 4.3 only + // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) + if ( val === "auto" || + !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) { + + val = elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ]; + + // offsetWidth/offsetHeight provide border-box values + valueIsBorderBox = true; + } + + // Normalize "" and auto + val = parseFloat( val ) || 0; + + // Adjust for the element's box model + return ( val + + boxModelAdjustment( + elem, + dimension, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles, + + // Provide the current computed size to request scroll gutter calculation (gh-3589) + val + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: {}, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + if ( type === "number" ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( i, dimension ) { + jQuery.cssHooks[ dimension ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, dimension, extra ); + } ) : + getWidthOrHeight( elem, dimension, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = getStyles( elem ), + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + subtract = extra && boxModelAdjustment( + elem, + dimension, + extra, + isBorderBox, + styles + ); + + // Account for unreliable border-box dimensions by comparing offset* to computed and + // faking a content-box to get border and padding (gh-3699) + if ( isBorderBox && support.scrollboxSize() === styles.position ) { + subtract -= Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + parseFloat( styles[ dimension ] ) - + boxModelAdjustment( elem, dimension, "border", false, styles ) - + 0.5 + ); + } + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ dimension ] = value; + value = jQuery.css( elem, dimension ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( prefix !== "margin" ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( Array.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + } +} ); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || jQuery.easing._default; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { + return tween.elem[ tween.prop ]; + } + + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. + result = jQuery.css( tween.elem, tween.prop, "" ); + + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.nodeType === 1 && + ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || + jQuery.cssHooks[ tween.prop ] ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 only +// Panic based approach to setting things on disconnected nodes +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + }, + _default: "swing" +}; + +jQuery.fx = Tween.prototype.init; + +// Back compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, inProgress, + rfxtypes = /^(?:toggle|show|hide)$/, + rrun = /queueHooks$/; + +function schedule() { + if ( inProgress ) { + if ( document.hidden === false && window.requestAnimationFrame ) { + window.requestAnimationFrame( schedule ); + } else { + window.setTimeout( schedule, jQuery.fx.interval ); + } + + jQuery.fx.tick(); + } +} + +// Animations created synchronously will run synchronously +function createFxNow() { + window.setTimeout( function() { + fxNow = undefined; + } ); + return ( fxNow = Date.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + i = 0, + attrs = { height: type }; + + // If we include width, step value is 1 to do all cssExpand values, + // otherwise step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { + + // We're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, + isBox = "width" in props || "height" in props, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHiddenWithinTree( elem ), + dataShow = dataPriv.get( elem, "fxshow" ); + + // Queue-skipping animations hijack the fx hooks + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always( function() { + + // Ensure the complete handler is called before this completes + anim.always( function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + } ); + } ); + } + + // Detect show/hide animations + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.test( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // Pretend to be hidden if this is a "show" and + // there is still data from a stopped show/hide + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + + // Ignore all other no-op show/hide data + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + // Bail out if this is a no-op like .hide().hide() + propTween = !jQuery.isEmptyObject( props ); + if ( !propTween && jQuery.isEmptyObject( orig ) ) { + return; + } + + // Restrict "overflow" and "display" styles during box animations + if ( isBox && elem.nodeType === 1 ) { + + // Support: IE <=9 - 11, Edge 12 - 15 + // Record all 3 overflow attributes because IE does not infer the shorthand + // from identically-valued overflowX and overflowY and Edge just mirrors + // the overflowX value there. + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Identify a display type, preferring old show/hide data over the CSS cascade + restoreDisplay = dataShow && dataShow.display; + if ( restoreDisplay == null ) { + restoreDisplay = dataPriv.get( elem, "display" ); + } + display = jQuery.css( elem, "display" ); + if ( display === "none" ) { + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } + } + + // Animate inline elements as inline-block + if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { + if ( jQuery.css( elem, "float" ) === "none" ) { + + // Restore the original display value at the end of pure show/hide animations + if ( !propTween ) { + anim.done( function() { + style.display = restoreDisplay; + } ); + if ( restoreDisplay == null ) { + display = style.display; + restoreDisplay = display === "none" ? "" : display; + } + } + style.display = "inline-block"; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + anim.always( function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + } ); + } + + // Implement show/hide animations + propTween = false; + for ( prop in orig ) { + + // General show/hide setup for this element animation + if ( !propTween ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); + } + + // Store hidden/visible for toggle so `.stop().toggle()` "reverses" + if ( toggle ) { + dataShow.hidden = !hidden; + } + + // Show elements before animating them + if ( hidden ) { + showHide( [ elem ], true ); + } + + /* eslint-disable no-loop-func */ + + anim.done( function() { + + /* eslint-enable no-loop-func */ + + // The final step of a "hide" animation is actually hiding the element + if ( !hidden ) { + showHide( [ elem ] ); + } + dataPriv.remove( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + } ); + } + + // Per-property setup + propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = propTween.start; + if ( hidden ) { + propTween.end = propTween.start; + propTween.start = 0; + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( Array.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // Not quite $.extend, this won't overwrite existing keys. + // Reusing 'index' because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = Animation.prefilters.length, + deferred = jQuery.Deferred().always( function() { + + // Don't match elem in the :animated selector + delete tick.elem; + } ), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + + // Support: Android 2.3 only + // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ] ); + + // If there's more to do, yield + if ( percent < 1 && length ) { + return remaining; + } + + // If this was an empty animation, synthesize a final progress notification + if ( !length ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + } + + // Resolve the animation and report its conclusion + deferred.resolveWith( elem, [ animation ] ); + return false; + }, + animation = deferred.promise( { + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { + specialEasing: {}, + easing: jQuery.easing._default + }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + + // If we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // Resolve when we played the last frame; otherwise, reject + if ( gotoEnd ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + } ), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length; index++ ) { + result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + if ( isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + result.stop.bind( result ); + } + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + // Attach callbacks from options + animation + .progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + } ) + ); + + return animation; +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweeners: { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ); + adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); + return tween; + } ] + }, + + tweener: function( props, callback ) { + if ( isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.match( rnothtmlwhite ); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length; index++ ) { + prop = props[ index ]; + Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; + Animation.tweeners[ prop ].unshift( callback ); + } + }, + + prefilters: [ defaultPrefilter ], + + prefilter: function( callback, prepend ) { + if ( prepend ) { + Animation.prefilters.unshift( callback ); + } else { + Animation.prefilters.push( callback ); + } + } +} ); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !isFunction( easing ) && easing + }; + + // Go to the end state if fx are off + if ( jQuery.fx.off ) { + opt.duration = 0; + + } else { + if ( typeof opt.duration !== "number" ) { + if ( opt.duration in jQuery.fx.speeds ) { + opt.duration = jQuery.fx.speeds[ opt.duration ]; + + } else { + opt.duration = jQuery.fx.speeds._default; + } + } + } + + // Normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend( { + fadeTo: function( speed, to, easing, callback ) { + + // Show any hidden elements after setting opacity to 0 + return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() + + // Animate to the value specified + .end().animate( { opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || dataPriv.get( this, "finish" ) ) { + anim.stop( true ); + } + }; + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue && type !== false ) { + this.queue( type || "fx", [] ); + } + + return this.each( function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = dataPriv.get( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && + ( type == null || timers[ index ].queue === type ) ) { + + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // Start the next in the queue if the last step wasn't forced. + // Timers currently will call their complete callbacks, which + // will dequeue but only if they were gotoEnd. + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + } ); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each( function() { + var index, + data = dataPriv.get( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // Enable finishing flag on private data + data.finish = true; + + // Empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // Look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // Look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // Turn off finishing flag + delete data.finish; + } ); + } +} ); + +jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +} ); + +// Generate shortcuts for custom animations +jQuery.each( { + slideDown: genFx( "show" ), + slideUp: genFx( "hide" ), + slideToggle: genFx( "toggle" ), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +} ); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + i = 0, + timers = jQuery.timers; + + fxNow = Date.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + + // Run the timer and safely remove it when done (allowing for external removal) + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + jQuery.fx.start(); +}; + +jQuery.fx.interval = 13; +jQuery.fx.start = function() { + if ( inProgress ) { + return; + } + + inProgress = true; + schedule(); +}; + +jQuery.fx.stop = function() { + inProgress = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = window.setTimeout( next, time ); + hooks.stop = function() { + window.clearTimeout( timeout ); + }; + } ); +}; + + +( function() { + var input = document.createElement( "input" ), + select = document.createElement( "select" ), + opt = select.appendChild( document.createElement( "option" ) ); + + input.type = "checkbox"; + + // Support: Android <=4.3 only + // Default value for a checkbox should be "on" + support.checkOn = input.value !== ""; + + // Support: IE <=11 only + // Must access selectedIndex to make default options select + support.optSelected = opt.selected; + + // Support: IE <=11 only + // An input loses its value after becoming a radio + input = document.createElement( "input" ); + input.value = "t"; + input.type = "radio"; + support.radioValue = input.value === "t"; +} )(); + + +var boolHook, + attrHandle = jQuery.expr.attrHandle; + +jQuery.fn.extend( { + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each( function() { + jQuery.removeAttr( this, name ); + } ); + } +} ); + +jQuery.extend( { + attr: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set attributes on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + // Attribute hooks are determined by the lowercase version + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + hooks = jQuery.attrHooks[ name.toLowerCase() ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); + } + + if ( value !== undefined ) { + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + } + + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + elem.setAttribute( name, value + "" ); + return value; + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? undefined : ret; + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && + nodeName( elem, "input" ) ) { + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + removeAttr: function( elem, value ) { + var name, + i = 0, + + // Attribute names can contain non-HTML whitespace characters + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 + attrNames = value && value.match( rnothtmlwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( ( name = attrNames[ i++ ] ) ) { + elem.removeAttribute( name ); + } + } + } +} ); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + elem.setAttribute( name, name ); + } + return name; + } +}; + +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = function( elem, name, isXML ) { + var ret, handle, + lowercaseName = name.toLowerCase(); + + if ( !isXML ) { + + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ lowercaseName ]; + attrHandle[ lowercaseName ] = ret; + ret = getter( elem, name, isXML ) != null ? + lowercaseName : + null; + attrHandle[ lowercaseName ] = handle; + } + return ret; + }; +} ); + + + + +var rfocusable = /^(?:input|select|textarea|button)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend( { + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each( function() { + delete this[ jQuery.propFix[ name ] || name ]; + } ); + } +} ); + +jQuery.extend( { + prop: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set properties on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + return ( elem[ name ] = value ); + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + return elem[ name ]; + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + + // Support: IE <=9 - 11 only + // elem.tabIndex doesn't always return the + // correct value when it hasn't been explicitly set + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + if ( tabindex ) { + return parseInt( tabindex, 10 ); + } + + if ( + rfocusable.test( elem.nodeName ) || + rclickable.test( elem.nodeName ) && + elem.href + ) { + return 0; + } + + return -1; + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + } +} ); + +// Support: IE <=11 only +// Accessing the selectedIndex property +// forces the browser to respect setting selected +// on the option +// The getter ensures a default option is selected +// when in an optgroup +// eslint rule "no-unused-expressions" is disabled for this code +// since it considers such accessions noop +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + }, + set: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }; +} + +jQuery.each( [ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +} ); + + + + + // Strip and collapse whitespace according to HTML spec + // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + +function getClass( elem ) { + return elem.getAttribute && elem.getAttribute( "class" ) || ""; +} + +function classesToArray( value ) { + if ( Array.isArray( value ) ) { + return value; + } + if ( typeof value === "string" ) { + return value.match( rnothtmlwhite ) || []; + } + return []; +} + +jQuery.fn.extend( { + addClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( !arguments.length ) { + return this.attr( "class", "" ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) > -1 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isValidValue = type === "string" || Array.isArray( value ); + + if ( typeof stateVal === "boolean" && isValidValue ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( isFunction( value ) ) { + return this.each( function( i ) { + jQuery( this ).toggleClass( + value.call( this, i, getClass( this ), stateVal ), + stateVal + ); + } ); + } + + return this.each( function() { + var className, i, self, classNames; + + if ( isValidValue ) { + + // Toggle individual class names + i = 0; + self = jQuery( this ); + classNames = classesToArray( value ); + + while ( ( className = classNames[ i++ ] ) ) { + + // Check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( value === undefined || type === "boolean" ) { + className = getClass( this ); + if ( className ) { + + // Store className if set + dataPriv.set( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || "" + ); + } + } + } ); + }, + + hasClass: function( selector ) { + var className, elem, + i = 0; + + className = " " + selector + " "; + while ( ( elem = this[ i++ ] ) ) { + if ( elem.nodeType === 1 && + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { + return true; + } + } + + return false; + } +} ); + + + + +var rreturn = /\r/g; + +jQuery.fn.extend( { + val: function( value ) { + var hooks, ret, valueIsFunction, + elem = this[ 0 ]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || + jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && + "get" in hooks && + ( ret = hooks.get( elem, "value" ) ) !== undefined + ) { + return ret; + } + + ret = elem.value; + + // Handle most common string cases + if ( typeof ret === "string" ) { + return ret.replace( rreturn, "" ); + } + + // Handle cases where value is null/undef or number + return ret == null ? "" : ret; + } + + return; + } + + valueIsFunction = isFunction( value ); + + return this.each( function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( valueIsFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + + } else if ( typeof val === "number" ) { + val += ""; + + } else if ( Array.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + } ); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + } ); + } +} ); + +jQuery.extend( { + valHooks: { + option: { + get: function( elem ) { + + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + + // Support: IE <=10 - 11 only + // option.text throws exceptions (#14686, #14858) + // Strip and collapse whitespace + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace + stripAndCollapse( jQuery.text( elem ) ); + } + }, + select: { + get: function( elem ) { + var value, option, i, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one", + values = one ? null : [], + max = one ? index + 1 : options.length; + + if ( index < 0 ) { + i = max; + + } else { + i = one ? index : 0; + } + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Support: IE <=9 only + // IE8-9 doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + + // Don't return options that are disabled or in a disabled optgroup + !option.disabled && + ( !option.parentNode.disabled || + !nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + /* eslint-disable no-cond-assign */ + + if ( option.selected = + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 + ) { + optionSet = true; + } + + /* eslint-enable no-cond-assign */ + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + } +} ); + +// Radios and checkboxes getter/setter +jQuery.each( [ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( Array.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + return elem.getAttribute( "value" ) === null ? "on" : elem.value; + }; + } +} ); + + + + +// Return jQuery for attributes-only inclusion + + +support.focusin = "onfocusin" in window; + + +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + stopPropagationCallback = function( e ) { + e.stopPropagation(); + }; + +jQuery.extend( jQuery.event, { + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = lastElement = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + lastElement = cur; + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && + dataPriv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( ( !special._default || + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + + if ( event.isPropagationStopped() ) { + lastElement.addEventListener( type, stopPropagationCallback ); + } + + elem[ type ](); + + if ( event.isPropagationStopped() ) { + lastElement.removeEventListener( type, stopPropagationCallback ); + } + + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + } + ); + + jQuery.event.trigger( e, null, elem ); + } + +} ); + +jQuery.fn.extend( { + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +// Support: Firefox <=44 +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = dataPriv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = dataPriv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + dataPriv.remove( doc, fix ); + + } else { + dataPriv.access( doc, fix, attaches ); + } + } + }; + } ); +} +var location = window.location; + +var nonce = Date.now(); + +var rquery = ( /\?/ ); + + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE 9 - 11 only + // IE throws on parseFromString with invalid input. + try { + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); + } catch ( e ) { + xml = undefined; + } + + if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; +}; + + +var + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( Array.isArray( obj ) ) { + + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + + // Item is non-scalar (array or object), encode its numeric index. + buildParams( + prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", + v, + traditional, + add + ); + } + } ); + + } else if ( !traditional && toType( obj ) === "object" ) { + + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, valueOrFunction ) { + + // If value is a function, invoke it and use its return value + var value = isFunction( valueOrFunction ) ? + valueOrFunction() : + valueOrFunction; + + s[ s.length ] = encodeURIComponent( key ) + "=" + + encodeURIComponent( value == null ? "" : value ); + }; + + // If an array was passed in, assume that it is an array of form elements. + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + } ); + + } else { + + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ); +}; + +jQuery.fn.extend( { + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map( function() { + + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + } ) + .filter( function() { + var type = this.type; + + // Use .is( ":disabled" ) so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + } ) + .map( function( i, elem ) { + var val = jQuery( this ).val(); + + if ( val == null ) { + return null; + } + + if ( Array.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ).get(); + } +} ); + + +var + r20 = /%20/g, + rhash = /#.*$/, + rantiCache = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat( "*" ), + + // Anchor tag for parsing the document origin + originAnchor = document.createElement( "a" ); + originAnchor.href = location.href; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; + + if ( isFunction( func ) ) { + + // For each dataType in the dataTypeExpression + while ( ( dataType = dataTypes[ i++ ] ) ) { + + // Prepend if requested + if ( dataType[ 0 ] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); + + // Otherwise append + } else { + ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && + !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + } ); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s.throws ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { + state: "parsererror", + error: conv ? e : "No conversion from " + prev + " to " + current + }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend( { + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: location.href, + type: "GET", + isLocal: rlocalProtocol.test( location.protocol ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": JSON.parse, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + + // URL without anti-cache param + cacheURL, + + // Response headers + responseHeadersString, + responseHeaders, + + // timeout handle + timeoutTimer, + + // Url cleanup var + urlAnchor, + + // Request state (becomes false upon send and true upon completion) + completed, + + // To know if global events are to be dispatched + fireGlobals, + + // Loop variable + i, + + // uncached part of the url + uncached, + + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + + // Callbacks context + callbackContext = s.context || s, + + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && + ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + + // Status-dependent callbacks + statusCode = s.statusCode || {}, + + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + + // Default abort message + strAbort = "canceled", + + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( completed ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; + } + } + match = responseHeaders[ key.toLowerCase() ]; + } + return match == null ? null : match; + }, + + // Raw string + getAllResponseHeaders: function() { + return completed ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( completed == null ) { + name = requestHeadersNames[ name.toLowerCase() ] = + requestHeadersNames[ name.toLowerCase() ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( completed == null ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( completed ) { + + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } else { + + // Lazy-add the new callbacks in a way that preserves old ones + for ( code in map ) { + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ); + + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || location.href ) + "" ) + .replace( rprotocol, location.protocol + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; + + // A cross-domain request is in order when the origin doesn't match the current origin. + if ( s.crossDomain == null ) { + urlAnchor = document.createElement( "a" ); + + // Support: IE <=8 - 11, Edge 12 - 15 + // IE throws exception on accessing the href property if url is malformed, + // e.g. http://example.com:80x/ + try { + urlAnchor.href = s.url; + + // Support: IE <=8 - 11 only + // Anchor's host property isn't correctly set when s.url is relative + urlAnchor.href = urlAnchor.href; + s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== + urlAnchor.protocol + "//" + urlAnchor.host; + } catch ( e ) { + + // If there is an error parsing the URL, assume it is crossDomain, + // it can be rejected by the transport if it is invalid + s.crossDomain = true; + } + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( completed ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + // Remove hash to simplify url manipulation + cacheURL = s.url.replace( rhash, "" ); + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // Remember the hash so we can put it back + uncached = s.url.slice( cacheURL.length ); + + // If data is available and should be processed, append data to url + if ( s.data && ( s.processData || typeof s.data === "string" ) ) { + cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; + + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add or update anti-cache param if needed + if ( s.cache === false ) { + cacheURL = cacheURL.replace( rantiCache, "$1" ); + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; + } + + // Put hash and anti-cache on the URL that will be requested (gh-1732) + s.url = cacheURL + uncached; + + // Change '%20' to '+' if this is encoded form body content (gh-2658) + } else if ( s.data && s.processData && + ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { + s.data = s.data.replace( r20, "+" ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? + s.accepts[ s.dataTypes[ 0 ] ] + + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && + ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { + + // Abort if not done already and return + return jqXHR.abort(); + } + + // Aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + completeDeferred.add( s.complete ); + jqXHR.done( s.success ); + jqXHR.fail( s.error ); + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + + // If request was aborted inside ajaxSend, stop there + if ( completed ) { + return jqXHR; + } + + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = window.setTimeout( function() { + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + completed = false; + transport.send( requestHeaders, done ); + } catch ( e ) { + + // Rethrow post-completion exceptions + if ( completed ) { + throw e; + } + + // Propagate others as results + done( -1, e ); + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Ignore repeat invocations + if ( completed ) { + return; + } + + completed = true; + + // Clear timeout if it exists + if ( timeoutTimer ) { + window.clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader( "Last-Modified" ); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader( "etag" ); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + + // Extract error from statusText and normalize for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +} ); + +jQuery.each( [ "get", "post" ], function( i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + + // Shift arguments if data argument was omitted + if ( isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + // The url can be an options object (which then must have .url) + return jQuery.ajax( jQuery.extend( { + url: url, + type: method, + dataType: type, + data: data, + success: callback + }, jQuery.isPlainObject( url ) && url ) ); + }; +} ); + + +jQuery._evalUrl = function( url ) { + return jQuery.ajax( { + url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) + type: "GET", + dataType: "script", + cache: true, + async: false, + global: false, + "throws": true + } ); +}; + + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( isFunction( html ) ) { + html = html.call( this[ 0 ] ); + } + + // The elements to wrap the target around + wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); + + if ( this[ 0 ].parentNode ) { + wrap.insertBefore( this[ 0 ] ); + } + + wrap.map( function() { + var elem = this; + + while ( elem.firstElementChild ) { + elem = elem.firstElementChild; + } + + return elem; + } ).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( isFunction( html ) ) { + return this.each( function( i ) { + jQuery( this ).wrapInner( html.call( this, i ) ); + } ); + } + + return this.each( function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + } ); + }, + + wrap: function( html ) { + var htmlIsFunction = isFunction( html ); + + return this.each( function( i ) { + jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); + } ); + }, + + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + + +jQuery.expr.pseudos.hidden = function( elem ) { + return !jQuery.expr.pseudos.visible( elem ); +}; +jQuery.expr.pseudos.visible = function( elem ) { + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); +}; + + + + +jQuery.ajaxSettings.xhr = function() { + try { + return new window.XMLHttpRequest(); + } catch ( e ) {} +}; + +var xhrSuccessStatus = { + + // File protocol always yields status code 0, assume 200 + 0: 200, + + // Support: IE <=9 only + // #1450: sometimes IE returns 1223 when it should be 204 + 1223: 204 + }, + xhrSupported = jQuery.ajaxSettings.xhr(); + +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +support.ajax = xhrSupported = !!xhrSupported; + +jQuery.ajaxTransport( function( options ) { + var callback, errorCallback; + + // Cross domain only allowed if supported through XMLHttpRequest + if ( support.cors || xhrSupported && !options.crossDomain ) { + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(); + + xhr.open( + options.type, + options.url, + options.async, + options.username, + options.password + ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + + // Callback + callback = function( type ) { + return function() { + if ( callback ) { + callback = errorCallback = xhr.onload = + xhr.onerror = xhr.onabort = xhr.ontimeout = + xhr.onreadystatechange = null; + + if ( type === "abort" ) { + xhr.abort(); + } else if ( type === "error" ) { + + // Support: IE <=9 only + // On a manual native abort, IE9 throws + // errors on any property access that is not readyState + if ( typeof xhr.status !== "number" ) { + complete( 0, "error" ); + } else { + complete( + + // File: protocol always yields status 0; see #8605, #14207 + xhr.status, + xhr.statusText + ); + } + } else { + complete( + xhrSuccessStatus[ xhr.status ] || xhr.status, + xhr.statusText, + + // Support: IE <=9 only + // IE9 has no XHR2 but throws on binary (trac-11426) + // For XHR2 non-text, let the caller handle it (gh-2498) + ( xhr.responseType || "text" ) !== "text" || + typeof xhr.responseText !== "string" ? + { binary: xhr.response } : + { text: xhr.responseText }, + xhr.getAllResponseHeaders() + ); + } + } + }; + }; + + // Listen to events + xhr.onload = callback(); + errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); + + // Support: IE 9 only + // Use onreadystatechange to replace onabort + // to handle uncaught aborts + if ( xhr.onabort !== undefined ) { + xhr.onabort = errorCallback; + } else { + xhr.onreadystatechange = function() { + + // Check readyState before timeout as it changes + if ( xhr.readyState === 4 ) { + + // Allow onerror to be called first, + // but that will not handle a native abort + // Also, save errorCallback to a variable + // as xhr.onerror cannot be accessed + window.setTimeout( function() { + if ( callback ) { + errorCallback(); + } + } ); + } + }; + } + + // Create the abort callback + callback = callback( "abort" ); + + try { + + // Do send the request (this may raise an exception) + xhr.send( options.hasContent && options.data || null ); + } catch ( e ) { + + // #14683: Only rethrow if this hasn't been notified as an error yet + if ( callback ) { + throw e; + } + } + }, + + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) +jQuery.ajaxPrefilter( function( s ) { + if ( s.crossDomain ) { + s.contents.script = false; + } +} ); + +// Install script dataType +jQuery.ajaxSetup( { + accepts: { + script: "text/javascript, application/javascript, " + + "application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +} ); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + } +} ); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function( s ) { + + // This transport only deals with cross domain requests + if ( s.crossDomain ) { + var script, callback; + return { + send: function( _, complete ) { + script = jQuery( "<script>" ).prop( { + charset: s.scriptCharset, + src: s.url + } ).on( + "load error", + callback = function( evt ) { + script.remove(); + callback = null; + if ( evt ) { + complete( evt.type === "error" ? 404 : 200, evt.type ); + } + } + ); + + // Use native DOM manipulation to avoid our domManip AJAX trickery + document.head.appendChild( script[ 0 ] ); + }, + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +var oldCallbacks = [], + rjsonp = /(=)\?(?=&|$)|\?\?/; + +// Default jsonp settings +jQuery.ajaxSetup( { + jsonp: "callback", + jsonpCallback: function() { + var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); + this[ callback ] = true; + return callback; + } +} ); + +// Detect, normalize options and install callbacks for jsonp requests +jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { + + var callbackName, overwritten, responseContainer, + jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? + "url" : + typeof s.data === "string" && + ( s.contentType || "" ) + .indexOf( "application/x-www-form-urlencoded" ) === 0 && + rjsonp.test( s.data ) && "data" + ); + + // Handle iff the expected data type is "jsonp" or we have a parameter to set + if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { + + // Get callback name, remembering preexisting value associated with it + callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? + s.jsonpCallback() : + s.jsonpCallback; + + // Insert callback into url or form data + if ( jsonProp ) { + s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); + } else if ( s.jsonp !== false ) { + s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; + } + + // Use data converter to retrieve json after script execution + s.converters[ "script json" ] = function() { + if ( !responseContainer ) { + jQuery.error( callbackName + " was not called" ); + } + return responseContainer[ 0 ]; + }; + + // Force json dataType + s.dataTypes[ 0 ] = "json"; + + // Install callback + overwritten = window[ callbackName ]; + window[ callbackName ] = function() { + responseContainer = arguments; + }; + + // Clean-up function (fires after converters) + jqXHR.always( function() { + + // If previous value didn't exist - remove it + if ( overwritten === undefined ) { + jQuery( window ).removeProp( callbackName ); + + // Otherwise restore preexisting value + } else { + window[ callbackName ] = overwritten; + } + + // Save back as free + if ( s[ callbackName ] ) { + + // Make sure that re-using the options doesn't screw things around + s.jsonpCallback = originalSettings.jsonpCallback; + + // Save the callback name for future use + oldCallbacks.push( callbackName ); + } + + // Call if it was a function and we have a response + if ( responseContainer && isFunction( overwritten ) ) { + overwritten( responseContainer[ 0 ] ); + } + + responseContainer = overwritten = undefined; + } ); + + // Delegate to script + return "script"; + } +} ); + + + + +// Support: Safari 8 only +// In Safari 8 documents created via document.implementation.createHTMLDocument +// collapse sibling forms: the second one becomes a child of the first one. +// Because of that, this security measure has to be disabled in Safari 8. +// https://bugs.webkit.org/show_bug.cgi?id=137337 +support.createHTMLDocument = ( function() { + var body = document.implementation.createHTMLDocument( "" ).body; + body.innerHTML = "<form></form><form></form>"; + return body.childNodes.length === 2; +} )(); + + +// Argument "data" should be string of html +// context (optional): If specified, the fragment will be created in this context, +// defaults to document +// keepScripts (optional): If true, will include scripts passed in the html string +jQuery.parseHTML = function( data, context, keepScripts ) { + if ( typeof data !== "string" ) { + return []; + } + if ( typeof context === "boolean" ) { + keepScripts = context; + context = false; + } + + var base, parsed, scripts; + + if ( !context ) { + + // Stop scripts or inline event handlers from being executed immediately + // by using document.implementation + if ( support.createHTMLDocument ) { + context = document.implementation.createHTMLDocument( "" ); + + // Set the base href for the created document + // so any parsed elements with URLs + // are based on the document's URL (gh-2965) + base = context.createElement( "base" ); + base.href = document.location.href; + context.head.appendChild( base ); + } else { + context = document; + } + } + + parsed = rsingleTag.exec( data ); + scripts = !keepScripts && []; + + // Single tag + if ( parsed ) { + return [ context.createElement( parsed[ 1 ] ) ]; + } + + parsed = buildFragment( [ data ], context, scripts ); + + if ( scripts && scripts.length ) { + jQuery( scripts ).remove(); + } + + return jQuery.merge( [], parsed.childNodes ); +}; + + +/** + * Load a url into a page + */ +jQuery.fn.load = function( url, params, callback ) { + var selector, type, response, + self = this, + off = url.indexOf( " " ); + + if ( off > -1 ) { + selector = stripAndCollapse( url.slice( off ) ); + url = url.slice( 0, off ); + } + + // If it's a function + if ( isFunction( params ) ) { + + // We assume that it's the callback + callback = params; + params = undefined; + + // Otherwise, build a param string + } else if ( params && typeof params === "object" ) { + type = "POST"; + } + + // If we have elements to modify, make the request + if ( self.length > 0 ) { + jQuery.ajax( { + url: url, + + // If "type" variable is undefined, then "GET" method will be used. + // Make value of this field explicit since + // user can override it through ajaxSetup method + type: type || "GET", + dataType: "html", + data: params + } ).done( function( responseText ) { + + // Save response for use in complete callback + response = arguments; + + self.html( selector ? + + // If a selector was specified, locate the right elements in a dummy div + // Exclude scripts to avoid IE 'Permission Denied' errors + jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : + + // Otherwise use the full result + responseText ); + + // If the request succeeds, this function gets "data", "status", "jqXHR" + // but they are ignored because response was set above. + // If it fails, this function gets "jqXHR", "status", "error" + } ).always( callback && function( jqXHR, status ) { + self.each( function() { + callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); + } ); + } ); + } + + return this; +}; + + + + +// Attach a bunch of functions for handling common AJAX events +jQuery.each( [ + "ajaxStart", + "ajaxStop", + "ajaxComplete", + "ajaxError", + "ajaxSuccess", + "ajaxSend" +], function( i, type ) { + jQuery.fn[ type ] = function( fn ) { + return this.on( type, fn ); + }; +} ); + + + + +jQuery.expr.pseudos.animated = function( elem ) { + return jQuery.grep( jQuery.timers, function( fn ) { + return elem === fn.elem; + } ).length; +}; + + + + +jQuery.offset = { + setOffset: function( elem, options, i ) { + var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, + position = jQuery.css( elem, "position" ), + curElem = jQuery( elem ), + props = {}; + + // Set position first, in-case top/left are set even on static elem + if ( position === "static" ) { + elem.style.position = "relative"; + } + + curOffset = curElem.offset(); + curCSSTop = jQuery.css( elem, "top" ); + curCSSLeft = jQuery.css( elem, "left" ); + calculatePosition = ( position === "absolute" || position === "fixed" ) && + ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; + + // Need to be able to calculate position if either + // top or left is auto and position is either absolute or fixed + if ( calculatePosition ) { + curPosition = curElem.position(); + curTop = curPosition.top; + curLeft = curPosition.left; + + } else { + curTop = parseFloat( curCSSTop ) || 0; + curLeft = parseFloat( curCSSLeft ) || 0; + } + + if ( isFunction( options ) ) { + + // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) + options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); + } + + if ( options.top != null ) { + props.top = ( options.top - curOffset.top ) + curTop; + } + if ( options.left != null ) { + props.left = ( options.left - curOffset.left ) + curLeft; + } + + if ( "using" in options ) { + options.using.call( elem, props ); + + } else { + curElem.css( props ); + } + } +}; + +jQuery.fn.extend( { + + // offset() relates an element's border box to the document origin + offset: function( options ) { + + // Preserve chaining for setter + if ( arguments.length ) { + return options === undefined ? + this : + this.each( function( i ) { + jQuery.offset.setOffset( this, options, i ); + } ); + } + + var rect, win, + elem = this[ 0 ]; + + if ( !elem ) { + return; + } + + // Return zeros for disconnected and hidden (display: none) elements (gh-2310) + // Support: IE <=11 only + // Running getBoundingClientRect on a + // disconnected node in IE throws an error + if ( !elem.getClientRects().length ) { + return { top: 0, left: 0 }; + } + + // Get document-relative position by adding viewport scroll to viewport-relative gBCR + rect = elem.getBoundingClientRect(); + win = elem.ownerDocument.defaultView; + return { + top: rect.top + win.pageYOffset, + left: rect.left + win.pageXOffset + }; + }, + + // position() relates an element's margin box to its offset parent's padding box + // This corresponds to the behavior of CSS absolute positioning + position: function() { + if ( !this[ 0 ] ) { + return; + } + + var offsetParent, offset, doc, + elem = this[ 0 ], + parentOffset = { top: 0, left: 0 }; + + // position:fixed elements are offset from the viewport, which itself always has zero offset + if ( jQuery.css( elem, "position" ) === "fixed" ) { + + // Assume position:fixed implies availability of getBoundingClientRect + offset = elem.getBoundingClientRect(); + + } else { + offset = this.offset(); + + // Account for the *real* offset parent, which can be the document or its root element + // when a statically positioned element is identified + doc = elem.ownerDocument; + offsetParent = elem.offsetParent || doc.documentElement; + while ( offsetParent && + ( offsetParent === doc.body || offsetParent === doc.documentElement ) && + jQuery.css( offsetParent, "position" ) === "static" ) { + + offsetParent = offsetParent.parentNode; + } + if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { + + // Incorporate borders into its offset, since they are outside its content origin + parentOffset = jQuery( offsetParent ).offset(); + parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); + parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); + } + } + + // Subtract parent offsets and element margins + return { + top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), + left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) + }; + }, + + // This method will return documentElement in the following cases: + // 1) For the element inside the iframe without offsetParent, this method will return + // documentElement of the parent window + // 2) For the hidden or detached element + // 3) For body or html element, i.e. in case of the html node - it will return itself + // + // but those exceptions were never presented as a real life use-cases + // and might be considered as more preferable results. + // + // This logic, however, is not guaranteed and can change at any point in the future + offsetParent: function() { + return this.map( function() { + var offsetParent = this.offsetParent; + + while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { + offsetParent = offsetParent.offsetParent; + } + + return offsetParent || documentElement; + } ); + } +} ); + +// Create scrollLeft and scrollTop methods +jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { + var top = "pageYOffset" === prop; + + jQuery.fn[ method ] = function( val ) { + return access( this, function( elem, method, val ) { + + // Coalesce documents and windows + var win; + if ( isWindow( elem ) ) { + win = elem; + } else if ( elem.nodeType === 9 ) { + win = elem.defaultView; + } + + if ( val === undefined ) { + return win ? win[ prop ] : elem[ method ]; + } + + if ( win ) { + win.scrollTo( + !top ? val : win.pageXOffset, + top ? val : win.pageYOffset + ); + + } else { + elem[ method ] = val; + } + }, method, val, arguments.length ); + }; +} ); + +// Support: Safari <=7 - 9.1, Chrome <=37 - 49 +// Add the top/left cssHooks using jQuery.fn.position +// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 +// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 +// getComputedStyle returns percent when specified for top/left/bottom/right; +// rather than make the css module depend on the offset module, just check for it here +jQuery.each( [ "top", "left" ], function( i, prop ) { + jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, + function( elem, computed ) { + if ( computed ) { + computed = curCSS( elem, prop ); + + // If curCSS returns percentage, fallback to offset + return rnumnonpx.test( computed ) ? + jQuery( elem ).position()[ prop ] + "px" : + computed; + } + } + ); +} ); + + +// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods +jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { + jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, + function( defaultExtra, funcName ) { + + // Margin is only for outerHeight, outerWidth + jQuery.fn[ funcName ] = function( margin, value ) { + var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), + extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); + + return access( this, function( elem, type, value ) { + var doc; + + if ( isWindow( elem ) ) { + + // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) + return funcName.indexOf( "outer" ) === 0 ? + elem[ "inner" + name ] : + elem.document.documentElement[ "client" + name ]; + } + + // Get document width or height + if ( elem.nodeType === 9 ) { + doc = elem.documentElement; + + // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], + // whichever is greatest + return Math.max( + elem.body[ "scroll" + name ], doc[ "scroll" + name ], + elem.body[ "offset" + name ], doc[ "offset" + name ], + doc[ "client" + name ] + ); + } + + return value === undefined ? + + // Get width or height on the element, requesting but not forcing parseFloat + jQuery.css( elem, type, extra ) : + + // Set width or height on the element + jQuery.style( elem, type, value, extra ); + }, type, chainable ? margin : undefined, chainable ); + }; + } ); +} ); + + +jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup contextmenu" ).split( " " ), + function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; +} ); + +jQuery.fn.extend( { + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +} ); + + + + +jQuery.fn.extend( { + + bind: function( types, data, fn ) { + return this.on( types, null, data, fn ); + }, + unbind: function( types, fn ) { + return this.off( types, null, fn ); + }, + + delegate: function( selector, types, data, fn ) { + return this.on( types, selector, data, fn ); + }, + undelegate: function( selector, types, fn ) { + + // ( namespace ) or ( selector, types [, fn] ) + return arguments.length === 1 ? + this.off( selector, "**" ) : + this.off( types, selector || "**", fn ); + } +} ); + +// Bind a function to a context, optionally partially applying any +// arguments. +// jQuery.proxy is deprecated to promote standards (specifically Function#bind) +// However, it is not slated for removal any time soon +jQuery.proxy = function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; +}; + +jQuery.holdReady = function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } +}; +jQuery.isArray = Array.isArray; +jQuery.parseJSON = JSON.parse; +jQuery.nodeName = nodeName; +jQuery.isFunction = isFunction; +jQuery.isWindow = isWindow; +jQuery.camelCase = camelCase; +jQuery.type = toType; + +jQuery.now = Date.now; + +jQuery.isNumeric = function( obj ) { + + // As of jQuery 3.0, isNumeric is limited to + // strings and numbers (primitives or objects) + // that can be coerced to finite numbers (gh-2662) + var type = jQuery.type( obj ); + return ( type === "number" || type === "string" ) && + + // parseFloat NaNs numeric-cast false positives ("") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + !isNaN( obj - parseFloat( obj ) ); +}; + + + + +// Register as a named AMD module, since jQuery can be concatenated with other +// files that may use define, but not via a proper concatenation script that +// understands anonymous AMD modules. A named AMD is safest and most robust +// way to register. Lowercase jquery is used because AMD module names are +// derived from file names, and jQuery is normally delivered in a lowercase +// file name. Do this after creating the global so that if an AMD module wants +// to call noConflict to hide this version of jQuery, it will work. + +// Note that for maximum portability, libraries that are not jQuery should +// declare themselves as anonymous modules, and avoid setting a global if an +// AMD loader is present. jQuery is a special case. For more information, see +// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon + +if ( typeof define === "function" && define.amd ) { + define( "jquery", [], function() { + return jQuery; + } ); +} + + + + +var + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$; + +jQuery.noConflict = function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; +}; + +// Expose jQuery and $ identifiers, even in AMD +// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) +// and CommonJS for browser emulators (#13566) +if ( !noGlobal ) { + window.jQuery = window.$ = jQuery; +} + + + + +return jQuery; +} ); diff --git a/Web/searchView.html b/Web/searchView.html new file mode 100644 index 0000000000000000000000000000000000000000..31546ab5292b4bd0133e6e54cf30a01d15a5bf69 --- /dev/null +++ b/Web/searchView.html @@ -0,0 +1,36 @@ +<!doctype html> +<html lang="en"> + +<head> + <title>Add or Remove Input Fields Dynamically</title> + <script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> + <script type="text/javascript" src="js/jquery-3.2.1.js"></script> + <style> + body { + display: flex; + flex-direction: column; + margin-top: 1%; + justify-content: center; + align-items: center; + } + #rowAdder { + margin-left: 17px; + } + + </style> +</head> + +<body> +<div style="width:40%;top:200px"> + <form> + <div id="entity" class="entity"> + <div class="viewName"><p>schema name</p><input id="ename" type="text" class="attribute"></div> + <button id="addEntity" type="button" class="btn btn-dark"><span></span>Search</button> + </div> + </form> +</div> + + +</body> + +</html> \ No newline at end of file diff --git a/pom.xml b/pom.xml index 63661e09eda142e1c1a5afb26bf4dbd9259c17b7..7c670cc693e1a265e4f499ef652ba7c814a5cf59 100644 --- a/pom.xml +++ b/pom.xml @@ -24,13 +24,17 @@ </build> <dependencies> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <version>2.13.3</version> + </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>2.1.214</version> <scope>runtime</scope> </dependency> - <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> @@ -42,24 +46,35 @@ <artifactId>mysql-connector-java</artifactId> <version>8.0.16</version> </dependency> - <!-- log4j --> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.17</version> - </dependency> <!-- test --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> + <dependency> + <groupId>org.postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>42.2.10</version> + </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> - <version>RELEASE</version> + <version>1.18.24</version> <scope>compile</scope> </dependency> + <!-- https://mvnrepository.com/artifact/commons-io/commons-io --> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.5</version> + </dependency> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>5.9.0</version> + <scope>test</scope> + </dependency> </dependencies> - + </project> \ No newline at end of file diff --git a/src/main/java/com/ic/er/Attribute.java b/src/main/java/com/ic/er/Attribute.java new file mode 100644 index 0000000000000000000000000000000000000000..6c34e83f6aaa5650df2bfe4449dd50fa1970813d --- /dev/null +++ b/src/main/java/com/ic/er/Attribute.java @@ -0,0 +1,113 @@ +package com.ic.er; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.ic.er.common.DataType; +import com.ic.er.common.RelatedObjType; +import com.ic.er.entity.AttributeDO; +import com.ic.er.exception.ERException; +import lombok.Getter; +import org.apache.ibatis.exceptions.PersistenceException; + +import java.util.Date; +import java.util.List; + +@Getter +@JsonIgnoreProperties({"id", "entityID", "schemaID", "gmtCreate", "gmtModified"}) +public class Attribute { + private Long ID; + private Long entityID; + private Long schemaID; + private String name; + private DataType dataType; + private Boolean isPrimary; + private Boolean nullable; + private LayoutInfo layoutInfo; + private Date gmtCreate; + private Date gmtModified; + + protected Attribute(Long ID, Long entityID, Long schemaID, String name, DataType dataType, + Boolean isPrimary, Boolean nullable, LayoutInfo layoutInfo, Double layoutX, Double layoutY, Date gmtCreate, Date gmtModified) { + this.ID = ID; + this.entityID = entityID; + this.schemaID = schemaID; + this.name = name; + this.dataType = dataType; + this.isPrimary = isPrimary; + this.nullable = nullable; + this.layoutInfo = layoutInfo; + this.gmtCreate = gmtCreate; + this.gmtModified = gmtModified; + if (this.ID == 0) { + this.insertDB(); + } + if (this.layoutInfo == null) { + this.layoutInfo = new LayoutInfo(0L, this.ID, RelatedObjType.ATTRIBUTE, layoutX, layoutY, 0.0, 0.0); + } + } + + + private void insertDB() throws PersistenceException { + try { + AttributeDO aDo = new AttributeDO(this.ID, this.entityID, this.schemaID, this.name, this.dataType, this.isPrimary, this.nullable, 0, this.gmtCreate, this.gmtModified); + int ret = ER.attributeMapper.insert(aDo); + if (ret == 0) { + throw new ERException("insertDB fail"); + } + this.ID = aDo.getID(); + } catch (PersistenceException e) { + throw new ERException("insertDB fail", e); + } + } + + protected void deleteDB() { + ER.attributeMapper.deleteByID(this.ID); + } + + public void updateInfo(String name, DataType dataType, Boolean isPrimary, Boolean nullable) throws ERException { + if (name != null) { + this.name = name; + } + if (dataType != null) { + this.dataType = dataType; + } + if (isPrimary != null) { + this.isPrimary = isPrimary; + } + if (nullable != null) { + this.nullable = nullable; + } + if (name != null) { + List<Attribute> attributeList = Attribute.queryByAttribute(new AttributeDO(null, this.entityID, this.schemaID, name, null, null, null, null, null, null)); + if (attributeList.size() != 0 && !attributeList.get(0).getID().equals(this.ID)) { + throw new ERException(String.format("attribute with name: %s already exists", this.name)); + } + } + if (isPrimary != null && isPrimary) { + List<Attribute> attributeList = Attribute.queryByAttribute(new AttributeDO(null, this.entityID, this.schemaID, null, null, true, null, null, null, null)); + if (attributeList.size() != 0 && !attributeList.get(0).getID().equals(this.ID)) { + throw new ERException(String.format("attribute that is primary key already exists, name: %s", attributeList.get(0).getName())); + } + } + if (this.nullable && this.isPrimary) { + throw new ERException("primary attribute cannot be null"); + } + ER.attributeMapper.updateByID(new AttributeDO(this.ID, this.entityID, this.schemaID, this.name, this.dataType, this.isPrimary, this.nullable, 0, this.gmtCreate, new Date())); + } + + public void updateLayoutInfo(Double layoutX, Double layoutY, Double height, Double width) throws ERException { + this.layoutInfo.update(layoutX, layoutY, height, width); + } + + public static List<Attribute> queryByAttribute(AttributeDO attributeDO) { + return Trans.TransAttributeListFromDB(ER.attributeMapper.selectByAttribute(attributeDO)); + } + + public static Attribute queryByID(Long ID) throws ERException { + List<Attribute> attributeList = Trans.TransAttributeListFromDB(ER.attributeMapper.selectByAttribute(new AttributeDO(ID))); + if (attributeList.size() == 0) { + throw new ERException(String.format("Attribute with ID: %d not found ", ID)); + } else { + return attributeList.get(0); + } + } +} diff --git a/src/main/java/com/ic/er/ER.java b/src/main/java/com/ic/er/ER.java new file mode 100644 index 0000000000000000000000000000000000000000..692f5fd918ae6d8e981ed91c479dbcbeb8089f74 --- /dev/null +++ b/src/main/java/com/ic/er/ER.java @@ -0,0 +1,80 @@ +package com.ic.er; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.ic.er.dao.*; +import com.ic.er.exception.ERException; +import org.apache.ibatis.io.Resources; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; +import org.apache.ibatis.session.SqlSessionFactoryBuilder; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class ER { + public static SqlSession sqlSession; + public static AttributeMapper attributeMapper; + public static EntityMapper entityMapper; + public static RelationshipMapper relationshipMapper; + public static SchemaMapper schemaMapper; + public static LayoutInfoMapper layoutInfoMapper; + + public static void initialize(boolean usePostgre) throws SQLException, IOException { + String XMLPath = "mybatis-config.xml"; + if (usePostgre) { + XMLPath = "mybatis-config-postgre.xml"; + } + InputStream is = Resources.getResourceAsStream(XMLPath); + SqlSessionFactoryBuilder sqlSessionFactoryBuilder = new SqlSessionFactoryBuilder(); + SqlSessionFactory sqlSessionFactory = sqlSessionFactoryBuilder.build(is); + sqlSession = sqlSessionFactory.openSession(true); + attributeMapper = sqlSession.getMapper(AttributeMapper.class); + entityMapper = sqlSession.getMapper(EntityMapper.class); + relationshipMapper = sqlSession.getMapper(RelationshipMapper.class); + schemaMapper = sqlSession.getMapper(SchemaMapper.class); + layoutInfoMapper = sqlSession.getMapper(LayoutInfoMapper.class); + if (!usePostgre) { + createTables(); + } + } + + private static void createTables() throws SQLException, IOException { + Connection conn = sqlSession.getConnection(); + Statement stmt = conn.createStatement(); + String sql = new String(Resources.getResourceAsStream("schema-v1.sql").readAllBytes(), StandardCharsets.UTF_8); + stmt.execute(sql); + } + + public static Schema createSchema(String name, String creator) { + return new Schema(0L, name, new ArrayList<>(), new ArrayList<>(), creator, new Date(), new Date()); + } + + + public static void deleteSchema(Schema schema) { + schema.deleteDB(); + } + + public static List<Schema> queryAllSchema() { + return Schema.queryAll(); + } + + public static Schema querySchemaByID(Long ID) { + return Schema.queryByID(ID); + } + + public static Schema loadFromJSON(String json) throws ERException { + try { + return new ObjectMapper().readValue(json, Schema.class); + } catch (JsonProcessingException e) { + throw new ERException(String.format("loadFromJSON fail, error: %s", e.getMessage())); + } + } +} diff --git a/src/main/java/com/ic/er/Entity.java b/src/main/java/com/ic/er/Entity.java new file mode 100644 index 0000000000000000000000000000000000000000..0173884e5d3e5c9d9ab6f149d403dc93aacd74a4 --- /dev/null +++ b/src/main/java/com/ic/er/Entity.java @@ -0,0 +1,122 @@ +package com.ic.er; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.ic.er.common.DataType; +import com.ic.er.common.RelatedObjType; +import com.ic.er.entity.AttributeDO; +import com.ic.er.entity.EntityDO; +import com.ic.er.exception.ERException; +import lombok.Getter; +import org.apache.ibatis.exceptions.PersistenceException; + +import java.util.Date; +import java.util.List; + +@Getter +@JsonIgnoreProperties({"id", "schemaID", "gmtCreate", "gmtModified"}) +public class Entity { + private Long ID; + private String name; + private Long schemaID; + private List<Attribute> attributeList; + private LayoutInfo layoutInfo; + private Date gmtCreate; + private Date gmtModified; + + protected Entity(Long ID, String name, Long schemaID, List<Attribute> attributeList, LayoutInfo layoutInfo, Double layoutX, Double layoutY, Date gmtCreate, Date gmtModified) { + this.ID = ID; + this.name = name; + this.schemaID = schemaID; + this.attributeList = attributeList; + this.layoutInfo = layoutInfo; + this.gmtCreate = gmtCreate; + this.gmtModified = gmtModified; + if (this.ID == 0) { + this.insertDB(); + } + if (this.layoutInfo == null) { + this.layoutInfo = new LayoutInfo(0L, this.ID, RelatedObjType.ENTITY, layoutX, layoutY, 0.0, 0.0); + } + } + + + public Attribute addAttribute(String attributeName, DataType dataType, Boolean isPrimary, Boolean nullable) { + return addAttribute(attributeName, dataType, isPrimary, nullable, 0.0, 0.0); + } + + public Attribute addAttribute(String attributeName, DataType dataType, Boolean isPrimary, Boolean nullable, Double layoutX, Double layoutY) { + if (attributeName.equals("")) { + throw new ERException("attributeName cannot be empty"); + } + if (isPrimary && nullable) { + throw new ERException("primary attribute cannot be null"); + } + List<Attribute> attributeList = Attribute.queryByAttribute(new AttributeDO(null, this.ID, this.schemaID, attributeName, null, null, null, null, null, null)); + if (attributeList.size() != 0) { + throw new ERException(String.format("attribute with name: %s already exists", this.name)); + } + attributeList = Attribute.queryByAttribute(new AttributeDO(null, this.ID, this.schemaID, null, null, null, true, null, null, null)); + if (isPrimary && attributeList.size() != 0) { + throw new ERException(String.format("attribute that is primary key already exists, name: %s", attributeList.get(0).getName())); + } + Attribute attribute = new Attribute(0L, this.ID, this.schemaID, attributeName, dataType, isPrimary, nullable, null, layoutX, layoutY, new Date(), new Date()); + this.attributeList.add(attribute); + return attribute; + } + + public boolean deleteAttribute(Attribute attribute) { + this.attributeList.remove(attribute); + attribute.deleteDB(); + return false; + } + + private void insertDB() { + try { + EntityDO entityDO = new EntityDO(0L, this.name, this.schemaID, 0, this.gmtCreate, this.gmtModified); + int ret = ER.entityMapper.insert(entityDO); + if (ret == 0) { + throw new ERException("insertDB fail"); + } + this.ID = entityDO.getID(); + } catch (PersistenceException e) { + throw new ERException("insertDB fail", e); + } + } + + protected void deleteDB() { + for (Attribute attribute : attributeList) { + attribute.deleteDB(); + } + ER.entityMapper.deleteByID(this.ID); + } + + public void updateInfo(String name) { + if (name != null) { + this.name = name; + List<Entity> entities = Entity.queryByEntity(new EntityDO(null, name, this.schemaID, null, null, null)); + if (entities.size() != 0 && !entities.get(0).getID().equals(this.ID)) { + throw new ERException(String.format("entity with name: %s already exists", name)); + } + } + ER.entityMapper.updateByID(new EntityDO(this.ID, this.name, this.schemaID, 0, this.gmtCreate, new Date())); + } + + public void updateLayoutInfo(Double layoutX, Double layoutY, Double height, Double width) { + this.layoutInfo.update(layoutX, layoutY, height, width); + } + + public static List<Entity> queryByEntity(EntityDO entityDO) { + List<EntityDO> entityDOList = ER.entityMapper.selectByEntity(entityDO); + return Trans.TransEntityListFormFromDB(entityDOList); + } + + public static Entity queryByID(Long ID) { + List<Entity> entityDOList = queryByEntity(new EntityDO(ID)); + if (entityDOList.size() == 0) { + throw new ERException(String.format("entity with ID: %d not found", ID)); + } else { + return entityDOList.get(0); + } + } + +} diff --git a/src/main/java/com/ic/er/LayoutInfo.java b/src/main/java/com/ic/er/LayoutInfo.java new file mode 100644 index 0000000000000000000000000000000000000000..2bd74c6dc7719845d25da13c5eefe91054acd268 --- /dev/null +++ b/src/main/java/com/ic/er/LayoutInfo.java @@ -0,0 +1,90 @@ +package com.ic.er; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.ic.er.common.RelatedObjType; +import com.ic.er.entity.LayoutInfoDO; +import com.ic.er.exception.ERException; +import lombok.Getter; +import org.apache.ibatis.exceptions.PersistenceException; + +import java.util.List; + +@Getter +@JsonIgnoreProperties({"id", "relatedObjID", "relatedObjType", "height", "width"}) +public class LayoutInfo { + private Long ID; + private Long relatedObjID; + private RelatedObjType relatedObjType; + private Double layoutX; + private Double layoutY; + private Double height; + private Double width; + + protected LayoutInfo(Long ID, Long relatedObjID, RelatedObjType relatedObjType, Double layoutX, Double layoutY, Double height, Double width) { + this.ID = ID; + this.relatedObjID = relatedObjID; + this.relatedObjType = relatedObjType; + this.layoutX = layoutX; + this.layoutY = layoutY; + this.height = height; + this.width = width; + if (this.ID == 0) { + this.insertDB(); + } + } + + public static List<LayoutInfo> queryByLayoutInfo(LayoutInfoDO layoutInfoDO) { + List<LayoutInfoDO> LayoutInfoDOList = ER.layoutInfoMapper.selectByLayoutInfo(layoutInfoDO); + return Trans.TransLayoutInfoListFormDB(LayoutInfoDOList); + } + + public static LayoutInfo queryByObjIDAndObjType(Long relatedObjID, RelatedObjType relatedObjType) { + List<LayoutInfo> layoutInfoDOList = queryByLayoutInfo(new LayoutInfoDO(relatedObjID, relatedObjType)); + if (layoutInfoDOList.size() == 0) { + throw new ERException(String.format("LayoutInfo with relatedObjID: %d, relatedObjType: %s not found ", relatedObjID, relatedObjType.name())); + } else { + return layoutInfoDOList.get(0); + } + } + + public static LayoutInfo queryByID(Long ID) throws ERException { + List<LayoutInfo> layoutInfoDOList = queryByLayoutInfo(new LayoutInfoDO(ID)); + if (layoutInfoDOList.size() == 0) { + throw new ERException(String.format("LayoutInfo with ID: %d not found ", ID)); + } else { + return layoutInfoDOList.get(0); + } + } + + private void insertDB() { + try { + LayoutInfoDO LayoutInfoDO = new LayoutInfoDO(0L, this.relatedObjID, this.relatedObjType, this.layoutX, this.layoutY, this.height, this.width); + int ret = ER.layoutInfoMapper.insert(LayoutInfoDO); + if (ret == 0) { + throw new ERException("insertDB fail"); + } + this.ID = LayoutInfoDO.getID(); + } catch (PersistenceException e) { + throw new ERException("insertDB fail", e); + } + } + + public void update(Double layoutX, Double layoutY, Double height, Double width) throws ERException { + if (layoutX != null) { + this.layoutX = layoutX; + } + if (layoutX != null) { + this.layoutY = layoutY; + } + if (layoutX != null) { + this.height = height; + } + if (layoutX != null) { + this.width = width; + } + int ret = ER.layoutInfoMapper.updateByID(new LayoutInfoDO(this.ID, this.relatedObjID, this.relatedObjType, this.layoutX, this.layoutY, this.height, this.width)); + if (ret == 0) { + throw new ERException(String.format("cannot find LayoutInfo with ID: %d", this.ID)); + } + } +} diff --git a/src/main/java/com/ic/er/Relationship.java b/src/main/java/com/ic/er/Relationship.java new file mode 100644 index 0000000000000000000000000000000000000000..719949ef2d2c870e0f1e72c9cdfcc43cddb606de --- /dev/null +++ b/src/main/java/com/ic/er/Relationship.java @@ -0,0 +1,124 @@ +package com.ic.er; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.ic.er.common.Cardinality; +import com.ic.er.common.RelatedObjType; +import com.ic.er.common.RelationshipSerializer; +import com.ic.er.entity.RelationshipDO; +import com.ic.er.exception.ERException; +import lombok.Getter; +import org.apache.ibatis.exceptions.PersistenceException; + +import java.util.Date; +import java.util.List; + +@Getter +@JsonSerialize(using = RelationshipSerializer.class) +@JsonIgnoreProperties({"id", "schemaID", "gmtCreate", "gmtModified"}) +public class Relationship { + private Long ID; + private String name; + private Long schemaID; + private Entity firstEntity; + private Entity secondEntity; + private Cardinality firstCardinality; + private Cardinality secondCardinality; + private LayoutInfo layoutInfo; + private Date gmtCreate; + private Date gmtModified; + + protected Relationship(Long ID, String name, Long schemaID, Entity firstEntity, Entity secondEntity, Cardinality firstCardinality, Cardinality secondCardinality, LayoutInfo layoutInfo, Date gmtCreate, Date gmtModified) { + this.ID = ID; + this.name = name; + this.schemaID = schemaID; + this.firstEntity = firstEntity; + this.secondEntity = secondEntity; + this.firstCardinality = firstCardinality; + this.secondCardinality = secondCardinality; + this.layoutInfo = layoutInfo; + this.gmtCreate = gmtCreate; + this.gmtModified = gmtModified; + if (this.ID == 0) { + insertDB(); + } + if (this.layoutInfo == null) { + this.layoutInfo = new LayoutInfo(0L, this.ID, RelatedObjType.RELATIONSHIP, 0.0, 0.0, 0.0, 0.0); + } + } + + + private void insertDB() { + try { + RelationshipDO relationshipDO = new RelationshipDO( + 0L, this.name, this.schemaID, this.firstEntity.getID(), this.secondEntity.getID(), this.firstCardinality, this.secondCardinality, + 0, this.gmtCreate, this.gmtModified); + int ret = ER.relationshipMapper.insert(relationshipDO); + if (ret == 0) { + throw new ERException("insertDB fail"); + } + this.ID = relationshipDO.getID(); + } catch (PersistenceException e) { + throw new ERException("insertDB fail", e); + } + } + + public static List<Relationship> queryByRelationship(RelationshipDO RelationshipDO) { + return Trans.TransRelationshipListFromDB(ER.relationshipMapper.selectByRelationship(RelationshipDO)); + } + + public static Relationship queryByID(Long ID) throws ERException { + List<Relationship> relationships = queryByRelationship(new RelationshipDO(ID)); + if (relationships.size() == 0) { + throw new ERException(String.format("Relationship with ID: %d not found ", ID)); + } else { + return relationships.get(0); + } + } + + protected void deleteDB() { + ER.relationshipMapper.deleteByID(this.ID); + } + + public void updateInfo(String name, Entity firstEntity, Entity secondEntity, Cardinality firstCardinality, Cardinality secondCardinality) { + if (name != null) { + this.name = name; + } + if (firstEntity != null) { + this.firstEntity = firstEntity; + if (Entity.queryByID(firstEntity.getID()) == null) { + throw new ERException(String.format("entity with ID: %d not found", firstEntity.getID())); + } + if (!firstEntity.getSchemaID().equals(this.schemaID)) { + throw new ERException(String.format("entity: %s does not belong to this schema", firstEntity.getName())); + } + } + if (secondEntity != null) { + this.secondEntity = secondEntity; + if (Entity.queryByID(secondEntity.getID()) == null) { + throw new ERException(String.format("entity with ID: %d not found", secondEntity.getID())); + } + if (!secondEntity.getSchemaID().equals(this.schemaID)) { + throw new ERException(String.format("entity: %s does not belong to this schema", secondEntity.getName())); + } + } + if (firstCardinality != null) { + this.firstCardinality = firstCardinality; + } + if (secondCardinality != null) { + this.secondCardinality = secondCardinality; + } + if (firstEntity != null && secondEntity != null) { + List<Relationship> oldRelationshipList = Relationship.queryByRelationship(new RelationshipDO(firstEntity.getID(), secondEntity.getID())); + if (oldRelationshipList.size() != 0 && !oldRelationshipList.get(0).getID().equals(this.ID)) { + throw new ERException(String.format("relation between entity %s and %s already exists", firstEntity.getName(), secondEntity.getName())); + } + } + ER.relationshipMapper.updateByID(new RelationshipDO(this.ID, this.name, this.schemaID, this.firstEntity.getID(), this.secondEntity.getID(), this.firstCardinality, this.secondCardinality, 0, this.gmtCreate, new Date())); + } + + public void updateLayoutInfo(Double layoutX, Double layoutY, Double height, Double width) { + this.layoutInfo.update(layoutX, layoutY, height, width); + } + +} diff --git a/src/main/java/com/ic/er/Schema.java b/src/main/java/com/ic/er/Schema.java new file mode 100644 index 0000000000000000000000000000000000000000..45065e3a1b3dac8ced4fa4f2719494c8107b8dfe --- /dev/null +++ b/src/main/java/com/ic/er/Schema.java @@ -0,0 +1,171 @@ +package com.ic.er; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.ic.er.common.Cardinality; +import com.ic.er.common.SchemaDeserializer; +import com.ic.er.entity.EntityDO; +import com.ic.er.entity.RelationshipDO; +import com.ic.er.entity.SchemaDO; +import com.ic.er.exception.ERException; +import lombok.Getter; +import org.apache.ibatis.exceptions.PersistenceException; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Getter +@JsonDeserialize(using = SchemaDeserializer.class) +@JsonIgnoreProperties({"id", "creator", "gmtCreate", "gmtModified"}) +public class Schema { + private Long ID; + private String name; + private List<Entity> entityList; + private List<Relationship> relationshipList; + private String creator; + private Date gmtCreate; + private Date gmtModified; + + protected Schema(Long ID, String name, List<Entity> entityList, List<Relationship> relationshipList, String creator, Date gmtCreate, Date gmtModified) { + this.ID = ID; + this.name = name; + this.entityList = entityList; + this.relationshipList = relationshipList; + this.creator = creator; + this.gmtCreate = gmtCreate; + this.gmtModified = gmtModified; + if (this.ID == 0) { + insertDB(); + } + } + + public Entity addEntity(String entityName) { + return addEntity(entityName, 0.0, 0.0); + } + + public Entity addEntity(String entityName, Double layoutX, Double layoutY) { + if (entityName.equals("")) { + throw new ERException("entityName cannot be empty"); + } + List<Entity> entities = Entity.queryByEntity(new EntityDO(null, entityName, this.ID, null, null, null)); + if (entities.size() != 0) { + throw new ERException(String.format("entity with name: %s already exists", entityName)); + } + Entity entity = new Entity(0L, entityName, this.ID, new ArrayList<>(), null, layoutX, layoutY, new Date(), new Date()); + this.entityList.add(entity); + return entity; + } + + public void deleteEntity(Entity entity) { + this.entityList.remove(entity); + List<Relationship> relationships = Relationship.queryByRelationship(new RelationshipDO(null, null, this.ID, entity.getID(), null, null, null, null, null, null)); + for (Relationship relationship : relationships) { + deleteRelationship(relationship); + } + relationships = Relationship.queryByRelationship(new RelationshipDO(null, null, this.ID, null, entity.getID(), null, null, null, null, null)); + for (Relationship relationship : relationships) { + deleteRelationship(relationship); + } + entity.deleteDB(); + } + + public Relationship createRelationship(String relationshipName, Entity firstEntity, Entity secondEntity, + Cardinality firstCardinality, Cardinality secondCardinality) { + if (relationshipName.equals("")) { + throw new ERException("relationshipName cannot be empty"); + } + if (firstEntity.getID().equals(secondEntity.getID())) { + throw new ERException("relationship cannot be created on the same entity"); + } + if (Entity.queryByID(firstEntity.getID()) == null) { + throw new ERException(String.format("entity with ID: %d not found", firstEntity.getID())); + } + if (Entity.queryByID(secondEntity.getID()) == null) { + throw new ERException(String.format("entity with ID: %d not found", secondEntity.getID())); + } + if (Relationship.queryByRelationship(new RelationshipDO(firstEntity.getID(), secondEntity.getID())).size() != 0) { + throw new ERException(String.format("relation between entity %s and %s already exists", firstEntity.getName(), secondEntity.getName())); + } + if (Relationship.queryByRelationship(new RelationshipDO(secondEntity.getID(), firstEntity.getID())).size() != 0) { + throw new ERException(String.format("relation between entity %s and %s already exists", firstEntity.getName(), secondEntity.getName())); + } + if (!firstEntity.getSchemaID().equals(this.ID)) { + throw new ERException(String.format("entity: %s does not belong to this schema", firstEntity.getName())); + } + if (!secondEntity.getSchemaID().equals(this.ID)) { + throw new ERException(String.format("entity: %s does not belong to this schema", secondEntity.getName())); + } + Relationship relationship = new Relationship(0L, relationshipName, this.ID, firstEntity, secondEntity, firstCardinality, secondCardinality, null, new Date(), new Date()); + this.relationshipList.add(relationship); + return relationship; + } + + public void deleteRelationship(Relationship relationship) { + this.relationshipList.remove(relationship); + relationship.deleteDB(); + } + + private void insertDB() { + try { + SchemaDO schemaDO = new SchemaDO(0L, this.name, this.creator, 0L, 0, this.gmtCreate, this.gmtModified); + int ret = ER.schemaMapper.insert(schemaDO); + if (ret == 0) { + throw new ERException("insertDB fail"); + } + this.ID = schemaDO.getID(); + } catch (PersistenceException e) { + throw new ERException("insertDB fail", e); + } + } + + public String toJSON() { + ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter(); + String json; + try { + json = ow.writeValueAsString(this); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + return json; + } + + public static List<Schema> queryAll() { + return Trans.TransSchemaListFromDB(ER.schemaMapper.selectAll()); + } + + public static List<Schema> queryBySchema(SchemaDO SchemaDO) { + List<SchemaDO> schemaDOList = ER.schemaMapper.selectBySchema(SchemaDO); + return Trans.TransSchemaListFromDB(schemaDOList); + } + + public static Schema queryByID(Long ID) { + List<Schema> schemaDOList = queryBySchema(new SchemaDO(ID)); + if (schemaDOList.size() == 0) { + throw new ERException(String.format("Schema with ID: %d not found", ID)); + } else { + return schemaDOList.get(0); + } + } + + protected void deleteDB() { + // cascade delete the entities and relationships in this schema + for (Entity entity : entityList) { + entity.deleteDB(); + } + for (Relationship relationship : relationshipList) { + relationship.deleteDB(); + } + ER.schemaMapper.deleteByID(this.ID); + } + + public void updateInfo(String name) { + if (name != null) { + this.name = name; + } + ER.schemaMapper.updateByID(new SchemaDO(this.ID, this.name, this.creator, 0L, 0, this.gmtCreate, new Date())); + } +} \ No newline at end of file diff --git a/src/main/java/com/ic/er/Trans.java b/src/main/java/com/ic/er/Trans.java new file mode 100644 index 0000000000000000000000000000000000000000..fe8ef3f2889f0a30a4df12d6a5cc6a3bffc8d101 --- /dev/null +++ b/src/main/java/com/ic/er/Trans.java @@ -0,0 +1,85 @@ +package com.ic.er; + +import com.ic.er.common.RelatedObjType; +import com.ic.er.entity.*; + +import java.util.ArrayList; +import java.util.List; + +public class Trans { + + protected static LayoutInfo TransformFromDB(LayoutInfoDO layoutInfoDO) { + return new LayoutInfo(layoutInfoDO.getID(), layoutInfoDO.getRelatedObjID(), layoutInfoDO.getRelatedObjType(), layoutInfoDO.getLayoutX(), layoutInfoDO.getLayoutY(), layoutInfoDO.getHeight(), layoutInfoDO.getWidth()); + } + + protected static List<LayoutInfo> TransLayoutInfoListFormDB(List<LayoutInfoDO> doList) { + List<LayoutInfo> ret = new ArrayList<>(); + for (LayoutInfoDO LayoutInfoDO : doList) { + ret.add(TransformFromDB(LayoutInfoDO)); + } + return ret; + } + + protected static Attribute TransformFromDB(AttributeDO attributeDO) { + LayoutInfo layoutInfo = LayoutInfo.queryByObjIDAndObjType(attributeDO.getID(), RelatedObjType.ATTRIBUTE); + return new Attribute(attributeDO.getID(), attributeDO.getEntityID(), attributeDO.getSchemaID(), + attributeDO.getName(), attributeDO.getDataType(), attributeDO.getIsPrimary(), attributeDO.getNullable(), + layoutInfo, 0.0, 0.0, attributeDO.getGmtCreate(), attributeDO.getGmtModified()); + } + + protected static List<Attribute> TransAttributeListFromDB(List<AttributeDO> doList) { + List<Attribute> ret = new ArrayList<>(); + for (AttributeDO attributeDO : doList) { + ret.add(TransformFromDB(attributeDO)); + } + return ret; + } + + protected static Entity TransformFromDB(EntityDO entityDO) { + List<Attribute> attributeList = Attribute.queryByAttribute(new AttributeDO(entityDO.getID(), entityDO.getSchemaID())); + LayoutInfo layoutInfo = LayoutInfo.queryByObjIDAndObjType(entityDO.getID(), RelatedObjType.ENTITY); + return new Entity(entityDO.getID(), entityDO.getName(), entityDO.getSchemaID(), attributeList, layoutInfo, null, null, + entityDO.getGmtCreate(), entityDO.getGmtModified()); + } + + protected static List<Entity> TransEntityListFormFromDB(List<EntityDO> doList) { + List<Entity> ret = new ArrayList<>(); + for (EntityDO EntityDO : doList) { + ret.add(TransformFromDB(EntityDO)); + } + return ret; + } + + + protected static Relationship TransformFromDB(RelationshipDO relationshipDO) { + LayoutInfo layoutInfo = LayoutInfo.queryByObjIDAndObjType(relationshipDO.getID(), RelatedObjType.RELATIONSHIP); + return new Relationship(relationshipDO.getID(), relationshipDO.getName(), relationshipDO.getSchemaID(), + Entity.queryByID(relationshipDO.getFirstEntityID()), Entity.queryByID(relationshipDO.getSecondEntityID()), + relationshipDO.getFirstCardinality(), relationshipDO.getSecondCardinality(), layoutInfo, + relationshipDO.getGmtCreate(), relationshipDO.getGmtModified()); + } + + protected static List<Relationship> TransRelationshipListFromDB(List<RelationshipDO> doList) { + List<Relationship> ret = new ArrayList<>(); + for (RelationshipDO RelationshipDO : doList) { + ret.add(TransformFromDB(RelationshipDO)); + } + return ret; + } + + protected static Schema TransformFromDB(SchemaDO schema) { + List<Entity> entityList = Entity.queryByEntity(new EntityDO(null, null, schema.getID(), null, null, null)); + List<Relationship> relationshipList = Relationship.queryByRelationship(new RelationshipDO(null, null, schema.getID(), null, null, null, null, null, null, null)); + return new Schema(schema.getID(), schema.getName(), entityList, relationshipList, schema.getCreator(), + schema.getGmtCreate(), schema.getGmtModified()); + } + + protected static List<Schema> TransSchemaListFromDB(List<SchemaDO> doList) { + List<Schema> ret = new ArrayList<>(); + for (SchemaDO SchemaDO : doList) { + ret.add(TransformFromDB(SchemaDO)); + } + return ret; + } + +} diff --git a/src/main/java/com/ic/er/bean/dto/.gitkeep b/src/main/java/com/ic/er/bean/dto/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/main/java/com/ic/er/bean/dto/AttributeDTO.java b/src/main/java/com/ic/er/bean/dto/AttributeDTO.java deleted file mode 100644 index a05acf9fc864516041f3d534b83c0dff6dc16b77..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/bean/dto/AttributeDTO.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.ic.er.bean.dto; - -public class AttributeDTO { - private Long entity_id; - - private Long view_id; - - private String name; - - private String data_type; - - private int is_primary; - - private int is_foreign; - - private int is_delete; - -} diff --git a/src/main/java/com/ic/er/bean/dto/EntityDTO.java b/src/main/java/com/ic/er/bean/dto/EntityDTO.java deleted file mode 100644 index 2ff0e2334565854abfaa28c15687915a9e1d5e62..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/bean/dto/EntityDTO.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ic.er.bean.dto; - -import java.util.List; - -public class EntityDTO { - private Long id; - - private String name; - - private Long view_id; - - private List<AttributeDTO> attributeDTOList; - -} diff --git a/src/main/java/com/ic/er/bean/dto/RelationshipDTO.java b/src/main/java/com/ic/er/bean/dto/RelationshipDTO.java deleted file mode 100644 index 7f174644a2bdf11bca143449b4898a0bd5a23fac..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/bean/dto/RelationshipDTO.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.ic.er.bean.dto; - -public class RelationshipDTO { - private Long id; - - private String name; - - private Long view_id; - - private Long first_entity_id; - - private Long second_entity_id; - - private Long first_attribute_id; - - private Long second_attribute_id; - - private int cardinatily; - -} diff --git a/src/main/java/com/ic/er/bean/dto/ViewDTO.java b/src/main/java/com/ic/er/bean/dto/ViewDTO.java deleted file mode 100644 index 5db275c5a5db85ea12359bff392b8d0390b4ad24..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/bean/dto/ViewDTO.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.ic.er.bean.dto; - -public class ViewDTO { - private Long id; - - private String name; - - private String creator; -} diff --git a/src/main/java/com/ic/er/bean/entity/Attribute.java b/src/main/java/com/ic/er/bean/entity/Attribute.java deleted file mode 100644 index 1e2b33b7ce71eed252e41ec92b0753e5051c7a5b..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/bean/entity/Attribute.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.ic.er.bean.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class Attribute { - private Long id; - - private Long entity_id; - - private Long view_id; - - private String name; - - private String data_type; - - private int is_primary; - - private int is_foreign; - - private int is_delete; - - private Date gmt_create; - - private Date gmt_modified; - -} diff --git a/src/main/java/com/ic/er/bean/entity/Entity.java b/src/main/java/com/ic/er/bean/entity/Entity.java deleted file mode 100644 index 80aa7e5b0c75c1c9bc2ef02a44f9a016d7b645ea..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/bean/entity/Entity.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.ic.er.bean.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class Entity { - private Long id; - - private String name; - - private Long view_id; - - private int is_delete; - - private Date gmt_create; - - private Date gmt_modified; - -} diff --git a/src/main/java/com/ic/er/bean/entity/Relationship.java b/src/main/java/com/ic/er/bean/entity/Relationship.java deleted file mode 100644 index 824724a4291efc14c645ee20e9b533e356f4b72a..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/bean/entity/Relationship.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.ic.er.bean.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class Relationship { - private Long id; - - private String name; - - private Long view_id; - - private Long first_entity_id; - - private Long second_entity_id; - - private Long first_attribute_id; - - private Long second_attribute_id; - - private int cardinality; - - private int is_delete; - - private Date gmt_create; - - private Date gmt_modified; - -} diff --git a/src/main/java/com/ic/er/bean/entity/View.java b/src/main/java/com/ic/er/bean/entity/View.java deleted file mode 100644 index 18f98f68e5ecc6b5507b0ccf266d1a3ca03998af..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/bean/entity/View.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.ic.er.bean.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class View { - private Long id; - - private String name; - - private String creator; - - private Long parent_id; - - private int is_delete; - - private Date gmt_create; - - private Date gmt_modified; - -} diff --git a/src/main/java/com/ic/er/bean/vo/.gitkeep b/src/main/java/com/ic/er/bean/vo/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/main/java/com/ic/er/bean/vo/AttributeVO.java b/src/main/java/com/ic/er/bean/vo/AttributeVO.java deleted file mode 100644 index a4be192530d83eb58ac4eb1d0dc3ded7757fd4a2..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/bean/vo/AttributeVO.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.ic.er.bean.vo; - -import com.ic.er.common.ResultState; - -public class AttributeVO { - private Long id; - - private Long entity_id; - - private Long view_id; - - private String name; - - private String data_type; - - private int is_primary; - - private int is_foreign; - - private int is_delete; - - private ResultState resultState; - -} diff --git a/src/main/java/com/ic/er/bean/vo/EntityVO.java b/src/main/java/com/ic/er/bean/vo/EntityVO.java deleted file mode 100644 index d00e06dc0b75eab21afb678dca1bda0cd48074a5..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/bean/vo/EntityVO.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.ic.er.bean.vo; - -import com.ic.er.bean.entity.Attribute; -import com.ic.er.common.ResultState; -import java.util.List; - -public class EntityVO { - private Long id; - - private String name; - - private Long view_id; - - private List<Attribute> attributeList; - - private ResultState resultState; -} diff --git a/src/main/java/com/ic/er/bean/vo/RelationshipVO.java b/src/main/java/com/ic/er/bean/vo/RelationshipVO.java deleted file mode 100644 index 97158cbfdafeb0855d7679f0b1e0821118f6d65c..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/bean/vo/RelationshipVO.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.ic.er.bean.vo; - -import com.ic.er.common.ResultState; - -public class RelationshipVO { - private Long id; - - private String name; - - private Long view_id; - - private Long first_entity_id; - - private Long second_entity_id; - - private Long first_attribute_id; - - private Long second_attribute_id; - - private int cardinality; - - private ResultState resultState; - -} diff --git a/src/main/java/com/ic/er/bean/vo/ViewVO.java b/src/main/java/com/ic/er/bean/vo/ViewVO.java deleted file mode 100644 index abf93ad51ec6304353e263a15eff91f650b8dd8f..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/bean/vo/ViewVO.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.ic.er.bean.vo; - -import com.ic.er.bean.entity.Attribute; -import com.ic.er.bean.entity.Entity; -import com.ic.er.bean.entity.Relationship; -import com.ic.er.common.ResultState; - -import java.util.List; - -/** - * @description input parameter for view service - * @author wendi - * @date 16/10/2022 - */ -public class ViewVO { - - private String name; - - private String creator; - - private Long parent_id; - - private List<EntityVO> entityList; - - private List<Relationship> relationshipList; - - private ResultState resultState; -} diff --git a/src/main/java/com/ic/er/common/Cardinality.java b/src/main/java/com/ic/er/common/Cardinality.java new file mode 100644 index 0000000000000000000000000000000000000000..fe1005f8f5c42045a72a59af35e27139a4838946 --- /dev/null +++ b/src/main/java/com/ic/er/common/Cardinality.java @@ -0,0 +1,42 @@ +package com.ic.er.common; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + + +@Getter +@AllArgsConstructor +public enum Cardinality { + Unknown(0, ""), + ZeroToOne(1, "0:1"), + ZeroToMany(2, "0:N"), + OneToOne(3, "1:1"), + OneToMany(4, "1:N"); + private final Integer code; + private final String value; + private static final Map<String, Cardinality> EnumFromValue; + private static final Map<Integer, Cardinality> EnumFromCode; + + static { + Map<String, Cardinality> map = new ConcurrentHashMap<>(); + Map<Integer, Cardinality> mapFromCode = new ConcurrentHashMap<>(); + for (Cardinality instance : Cardinality.values()) { + map.put(instance.getValue(), instance); + mapFromCode.put(instance.getCode(), instance); + } + EnumFromValue = Collections.unmodifiableMap(map); + EnumFromCode = Collections.unmodifiableMap(mapFromCode); + } + + public static Cardinality getFromValue(String name) { + return EnumFromValue.get(name); + } + + public static Cardinality getFromCode(Integer code) { + return EnumFromCode.get(code); + } +} diff --git a/src/main/java/com/ic/er/common/CardinalityEnumTypeHandler.java b/src/main/java/com/ic/er/common/CardinalityEnumTypeHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..af380f0ad80361c2ec4c9968aebc00c64012f681 --- /dev/null +++ b/src/main/java/com/ic/er/common/CardinalityEnumTypeHandler.java @@ -0,0 +1,33 @@ +package com.ic.er.common; + +import java.sql.CallableStatement; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import org.apache.ibatis.type.BaseTypeHandler; +import org.apache.ibatis.type.JdbcType; + +public class CardinalityEnumTypeHandler extends BaseTypeHandler<Cardinality> { + + @Override + public void setNonNullParameter(PreparedStatement ps, int i, Cardinality parameter, JdbcType jdbcType) + throws SQLException { + ps.setInt(i, parameter.getCode()); + } + + @Override + public Cardinality getNullableResult(ResultSet rs, String columnName) throws SQLException { + return Cardinality.getFromCode(rs.getInt(columnName)); + } + + @Override + public Cardinality getNullableResult(ResultSet rs, int columnIndex) throws SQLException { + return Cardinality.getFromCode(rs.getInt(columnIndex)); + } + + @Override + public Cardinality getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { + return Cardinality.getFromCode(cs.getInt(columnIndex)); + } +} \ No newline at end of file diff --git a/src/main/java/com/ic/er/common/DataType.java b/src/main/java/com/ic/er/common/DataType.java new file mode 100644 index 0000000000000000000000000000000000000000..2acfb6e34d74ff1bf65a203b63360e0e7056d2fb --- /dev/null +++ b/src/main/java/com/ic/er/common/DataType.java @@ -0,0 +1,15 @@ +package com.ic.er.common; + +public enum DataType { + UNKNOWN, + CHAR, + VARCHAR, + TEXT, + TINYINT, + SMALLINT, + INT, + BIGINT, + FLOAT, + DOUBLE, + DATETIME, +} diff --git a/src/main/java/com/ic/er/common/RelatedObjType.java b/src/main/java/com/ic/er/common/RelatedObjType.java new file mode 100644 index 0000000000000000000000000000000000000000..22352aa2dbc2bd61a27eca9c0b392ce4417d47b7 --- /dev/null +++ b/src/main/java/com/ic/er/common/RelatedObjType.java @@ -0,0 +1,15 @@ +package com.ic.er.common; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum RelatedObjType { + UNKNOWN(0), + ATTRIBUTE(1), + ENTITY(2), + RELATIONSHIP(3); + + private final Integer value; +} diff --git a/src/main/java/com/ic/er/common/RelationshipSerializer.java b/src/main/java/com/ic/er/common/RelationshipSerializer.java new file mode 100644 index 0000000000000000000000000000000000000000..ccce978703b30d98154227ab7cad7064d90243cb --- /dev/null +++ b/src/main/java/com/ic/er/common/RelationshipSerializer.java @@ -0,0 +1,35 @@ +package com.ic.er.common; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.ic.er.Relationship; + +import java.io.IOException; + +public class RelationshipSerializer extends StdSerializer<Relationship> { + + public RelationshipSerializer() { + this(null); + } + + public RelationshipSerializer(Class<Relationship> t) { + super(t); + } + + @Override + public void serialize( + Relationship relationship, JsonGenerator jgen, SerializerProvider provider) + throws IOException { + + jgen.writeStartObject(); + jgen.writeStringField("name", relationship.getName()); + jgen.writeStringField("firstEntity", relationship.getFirstEntity().getName()); + jgen.writeStringField("firstCardinality", relationship.getFirstCardinality().getValue()); + jgen.writeStringField("secondEntity", relationship.getSecondEntity().getName()); + jgen.writeStringField("secondCardinality", relationship.getSecondCardinality().getValue()); + jgen.writeObjectField("layoutInfo", relationship.getLayoutInfo()); + jgen.writeEndObject(); + } +} \ No newline at end of file diff --git a/src/main/java/com/ic/er/common/ResultState.java b/src/main/java/com/ic/er/common/ResultState.java index 87a03f5d3c57d4b70f1781abb614c7a16943e33a..3402e4f10d09c5feed4c4f6df42aebdf806b1ecb 100644 --- a/src/main/java/com/ic/er/common/ResultState.java +++ b/src/main/java/com/ic/er/common/ResultState.java @@ -32,7 +32,7 @@ public class ResultState { } public ResultState(Object data) { - this.status = ResultStateCode.successfulOp; + this.status = ResultStateCode.Success; this.msg = "OK"; this.data = data; } diff --git a/src/main/java/com/ic/er/common/ResultStateCode.java b/src/main/java/com/ic/er/common/ResultStateCode.java index 42f0540c36e40b05015e3e9d0f1026df65772c9d..1831484ceaebbdc637a852ff87dc6e441b69d282 100644 --- a/src/main/java/com/ic/er/common/ResultStateCode.java +++ b/src/main/java/com/ic/er/common/ResultStateCode.java @@ -1,6 +1,6 @@ package com.ic.er.common; public class ResultStateCode { - public static Integer successfulOp = 200; - public static Integer failOp = 400; + public static Integer Success = 0; + public static Integer Failure = 1; } diff --git a/src/main/java/com/ic/er/common/SchemaDeserializer.java b/src/main/java/com/ic/er/common/SchemaDeserializer.java new file mode 100644 index 0000000000000000000000000000000000000000..e14b4f22171c61861be75756695d5a5e87fde082 --- /dev/null +++ b/src/main/java/com/ic/er/common/SchemaDeserializer.java @@ -0,0 +1,63 @@ +package com.ic.er.common; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.ic.er.ER; +import com.ic.er.Entity; +import com.ic.er.Relationship; +import com.ic.er.Schema; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class SchemaDeserializer extends StdDeserializer<Schema> { + + public SchemaDeserializer() { + this(null); + } + + public SchemaDeserializer(Class<?> vc) { + super(vc); + } + + @Override + public Schema deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + Map<String, Entity> entityNameMap = new HashMap<>(); + + JsonNode schemaJSONNode = jp.getCodec().readTree(jp); + String schemaName = schemaJSONNode.get("name").textValue(); + Schema schema = ER.createSchema(schemaName, ""); + for (JsonNode entityJSONNode : schemaJSONNode.get("entityList")) { + String entityName = entityJSONNode.get("name").textValue(); + Entity entity = schema.addEntity(entityName); + for (JsonNode attributeJSONNode : entityJSONNode.get("attributeList")) { + String attributeName = attributeJSONNode.get("name").textValue(); + DataType attributeDataType = DataType.valueOf(attributeJSONNode.get("dataType").textValue()); + Boolean attributeIsPrimary = attributeJSONNode.get("isPrimary").booleanValue(); + Boolean attributeNullable = attributeJSONNode.get("nullable").booleanValue(); + entity.addAttribute(attributeName, attributeDataType, attributeIsPrimary, attributeNullable); + entityNameMap.put(entityName, entity); + } + JsonNode layoutInfoJSONNode = entityJSONNode.get("layoutInfo"); + entity.updateLayoutInfo(layoutInfoJSONNode.get("layoutX").asDouble(), layoutInfoJSONNode.get("layoutY").asDouble(), 0.0, 0.0); + } + + for (JsonNode relationshipJSONNode : schemaJSONNode.get("relationshipList")) { + String relationshipName = relationshipJSONNode.get("name").textValue(); + String firstEntityName = relationshipJSONNode.get("firstEntity").textValue(); + String secondEntityName = relationshipJSONNode.get("secondEntity").textValue(); + String firstCardinality = relationshipJSONNode.get("firstCardinality").textValue(); + String secondCardinality = relationshipJSONNode.get("secondCardinality").textValue(); + Relationship relationship = schema.createRelationship(relationshipName, entityNameMap.get(firstEntityName), entityNameMap.get(secondEntityName), Cardinality.getFromValue(firstCardinality), Cardinality.getFromValue(secondCardinality)); + JsonNode layoutInfoJSONNode = relationshipJSONNode.get("layoutInfo"); + relationship.updateLayoutInfo(layoutInfoJSONNode.get("layoutX").asDouble(), layoutInfoJSONNode.get("layoutY").asDouble(), 0.0, 0.0); + } + + return schema; + } +} \ No newline at end of file diff --git a/src/main/java/com/ic/er/config/.gitkeep b/src/main/java/com/ic/er/config/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/main/java/com/ic/er/dao/AttributeMapper.java b/src/main/java/com/ic/er/dao/AttributeMapper.java index 19d7ca5058cb6f50dbfb03313f32dc731d2a1605..b62cad15cfe8db4588881caa2ec3cc79029a2b3b 100644 --- a/src/main/java/com/ic/er/dao/AttributeMapper.java +++ b/src/main/java/com/ic/er/dao/AttributeMapper.java @@ -1,19 +1,20 @@ package com.ic.er.dao; -import com.ic.er.bean.entity.Attribute; +import com.ic.er.entity.AttributeDO; +import org.apache.ibatis.annotations.Mapper; import java.util.List; +@Mapper public interface AttributeMapper { - Attribute selectById(Long id); + AttributeDO selectByID(Long ID); - List<Attribute> selectByAttribute(Attribute attribute); + List<AttributeDO> selectByAttribute(AttributeDO attributeDO); - int insert(Attribute attribute); + int insert(AttributeDO attributeDO); - // rarely use, please use update to change is_delete to 1 - int deleteById(Long id); + int deleteByID(Long ID); - int updateById(Long id); + int updateByID(AttributeDO attributeDO); } diff --git a/src/main/java/com/ic/er/dao/EntityMapper.java b/src/main/java/com/ic/er/dao/EntityMapper.java index 6c3b43aa448446f94bcba1f910c97516d927b139..55cd4397008e6c82d358f105373f21dfc7ead7a9 100644 --- a/src/main/java/com/ic/er/dao/EntityMapper.java +++ b/src/main/java/com/ic/er/dao/EntityMapper.java @@ -1,19 +1,19 @@ package com.ic.er.dao; -import com.ic.er.bean.entity.Entity; +import com.ic.er.entity.EntityDO; import java.util.List; public interface EntityMapper { - Entity selectById(Long id); + EntityDO selectByID(Long ID); - List<Entity> selectByEntity(Entity entity); + List<EntityDO> selectByEntity(EntityDO entityDO); - int insert(Entity entity); + int insert(EntityDO entityDO); // rarely use, please use update to change is_delete to 1 - int deleteById(Long id); + int deleteByID(Long ID); - int updateById(Long id); + int updateByID(EntityDO entityDO); } diff --git a/src/main/java/com/ic/er/dao/LayoutInfoMapper.java b/src/main/java/com/ic/er/dao/LayoutInfoMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..2f28cad3edc6565a5e306a51fc8db799b916ba18 --- /dev/null +++ b/src/main/java/com/ic/er/dao/LayoutInfoMapper.java @@ -0,0 +1,22 @@ +package com.ic.er.dao; + +import com.ic.er.common.RelatedObjType; +import com.ic.er.entity.LayoutInfoDO; + +import java.util.List; + +public interface LayoutInfoMapper { + + LayoutInfoDO selectByID(Long ID); + + LayoutInfoDO selectByRelatedObjID(Long relatedObjID, RelatedObjType relatedObjType); + + List<LayoutInfoDO> selectByLayoutInfo(LayoutInfoDO layoutInfoDO); + + int insert(LayoutInfoDO layoutInfoDO); + + int updateByID(LayoutInfoDO layoutInfoDO); + + int updateByObjID(LayoutInfoDO layoutInfoDO); + +} diff --git a/src/main/java/com/ic/er/dao/RelationshipMapper.java b/src/main/java/com/ic/er/dao/RelationshipMapper.java index 97ac4576d85758b057323b33dee4f9e633391ed0..643fbae6834f0d33998657c8eb5d987723cf8226 100644 --- a/src/main/java/com/ic/er/dao/RelationshipMapper.java +++ b/src/main/java/com/ic/er/dao/RelationshipMapper.java @@ -1,18 +1,18 @@ package com.ic.er.dao; -import com.ic.er.bean.entity.Relationship; +import com.ic.er.entity.RelationshipDO; import java.util.List; public interface RelationshipMapper { - Relationship selectById(Long id); + RelationshipDO selectByID(Long ID); - List<Relationship> selectByRelationship(Relationship relationship); + List<RelationshipDO> selectByRelationship(RelationshipDO relationshipDO); - int insert(Relationship relationship); + int insert(RelationshipDO relationshipDO); // rarely use, please use update to change is_delete to 1 - int deleteById(Long id); + int deleteByID(Long ID); - int updateById(Long id); + int updateByID(RelationshipDO relationshipDO); } diff --git a/src/main/java/com/ic/er/dao/SchemaMapper.java b/src/main/java/com/ic/er/dao/SchemaMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..601202ff73496f2bbc7295ae50c21f9c4380be6f --- /dev/null +++ b/src/main/java/com/ic/er/dao/SchemaMapper.java @@ -0,0 +1,21 @@ +package com.ic.er.dao; + +import com.ic.er.entity.SchemaDO; + +import java.util.List; + +public interface SchemaMapper { + List<SchemaDO> selectAll(); + + List<SchemaDO> selectBySchema(SchemaDO schemaDO); + + SchemaDO selectByID(Long ID); + + int insert(SchemaDO schemaDO); + + // rarely use, please use update to change is_delete to 1 + int deleteByID(Long ID); + + int updateByID(SchemaDO schemaDO); + +} diff --git a/src/main/java/com/ic/er/dao/ViewMapper.java b/src/main/java/com/ic/er/dao/ViewMapper.java deleted file mode 100644 index f52622c4b2f0c53108993115ec2b3811646bd63e..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/dao/ViewMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.ic.er.dao; - -import com.ic.er.bean.entity.View; -import java.util.List; - -public interface ViewMapper { - List<View> selectAll(); - - List<View> selectByView(View view); - - View selectById(Long id); - - int insert(View view); - - // rarely use, please use update to change is_delete to 1 - int deleteById(Long id); - - int updateById(Long id); - -} diff --git a/src/main/java/com/ic/er/entity/AttributeDO.java b/src/main/java/com/ic/er/entity/AttributeDO.java new file mode 100644 index 0000000000000000000000000000000000000000..89b457785320d232fc950716b06613b52f8e09a8 --- /dev/null +++ b/src/main/java/com/ic/er/entity/AttributeDO.java @@ -0,0 +1,34 @@ +package com.ic.er.entity; + +import com.ic.er.common.DataType; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class AttributeDO { + private Long ID; + private Long entityID; + private Long schemaID; + private String name; + private DataType dataType; + private Boolean isPrimary; + private Boolean nullable; + private Integer isDelete; + private Date gmtCreate; + private Date gmtModified; + + public AttributeDO(Long ID) { + this.ID = ID; + } + + public AttributeDO(Long entityID, Long schemaID) { + this.entityID = entityID; + this.schemaID = schemaID; + } + +} diff --git a/src/main/java/com/ic/er/entity/EntityDO.java b/src/main/java/com/ic/er/entity/EntityDO.java new file mode 100644 index 0000000000000000000000000000000000000000..fb6f125871324b65bcb9937569bead87d1c673a6 --- /dev/null +++ b/src/main/java/com/ic/er/entity/EntityDO.java @@ -0,0 +1,28 @@ +package com.ic.er.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class EntityDO { + private Long ID; + + private String name; + + private Long schemaID; + + private Integer isDelete; + + private Date gmtCreate; + + private Date gmtModified; + + public EntityDO(Long ID) { + this.ID = ID; + } +} diff --git a/src/main/java/com/ic/er/entity/LayoutInfoDO.java b/src/main/java/com/ic/er/entity/LayoutInfoDO.java new file mode 100644 index 0000000000000000000000000000000000000000..939d25d44fec84fb68a8c06f398634ad6a8eea5b --- /dev/null +++ b/src/main/java/com/ic/er/entity/LayoutInfoDO.java @@ -0,0 +1,36 @@ +package com.ic.er.entity; + + +import com.ic.er.common.RelatedObjType; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class LayoutInfoDO { + + private Long ID; + + private Long relatedObjID; + + private RelatedObjType relatedObjType; + + private Double layoutX; + + private Double layoutY; + + private Double height; + + private Double width; + + public LayoutInfoDO(Long id) { + this.ID = id; + } + + public LayoutInfoDO(Long relatedObjID, RelatedObjType relatedObjType) { + this.relatedObjID = relatedObjID; + this.relatedObjType = relatedObjType; + } +} diff --git a/src/main/java/com/ic/er/entity/RelationshipDO.java b/src/main/java/com/ic/er/entity/RelationshipDO.java new file mode 100644 index 0000000000000000000000000000000000000000..3edb3abddd4216c0029b8c13435eb0701f778d13 --- /dev/null +++ b/src/main/java/com/ic/er/entity/RelationshipDO.java @@ -0,0 +1,34 @@ +package com.ic.er.entity; + +import com.ic.er.common.Cardinality; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class RelationshipDO { + private Long ID; + private String name; + private Long schemaID; + private Long firstEntityID; + private Long secondEntityID; + private Cardinality firstCardinality; + private Cardinality secondCardinality; + private Integer isDelete; + private Date gmtCreate; + private Date gmtModified; + + public RelationshipDO(Long ID) { + this.ID = ID; + } + + public RelationshipDO(Long firstEntityID, Long secondEntityID) { + this.firstEntityID = firstEntityID; + this.secondEntityID = secondEntityID; + } + +} diff --git a/src/main/java/com/ic/er/entity/SchemaDO.java b/src/main/java/com/ic/er/entity/SchemaDO.java new file mode 100644 index 0000000000000000000000000000000000000000..39ebea9feb31cdd9265802e2b617b689341673a6 --- /dev/null +++ b/src/main/java/com/ic/er/entity/SchemaDO.java @@ -0,0 +1,31 @@ +package com.ic.er.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class SchemaDO { + private Long ID; + + private String name; + + private String creator; + + private Long parentID; + + private Integer isDelete; + + private Date gmtCreate; + + private Date gmtModified; + + public SchemaDO(Long ID) { + this.ID = ID; + } + +} diff --git a/src/main/java/com/ic/er/exception/ERException.java b/src/main/java/com/ic/er/exception/ERException.java new file mode 100644 index 0000000000000000000000000000000000000000..d376387cdba027c8bdcf1a782cea351a1d34714b --- /dev/null +++ b/src/main/java/com/ic/er/exception/ERException.java @@ -0,0 +1,20 @@ +package com.ic.er.exception; + +public class ERException extends RuntimeException { + public ERException() { + super(); + } + + public ERException(String message) { + super(message); + } + + public ERException(String message, Throwable cause) { + super(message, cause); + } + + public ERException(Throwable cause) { + super(cause); + } + +} diff --git a/src/main/java/com/ic/er/service/AttributeService.java b/src/main/java/com/ic/er/service/AttributeService.java deleted file mode 100644 index b5168b6e2825192397ff52bb142afcd1b03ae2d5..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/service/AttributeService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ic.er.service; - -import com.ic.er.bean.dto.AttributeDTO; -import com.ic.er.bean.vo.AttributeVO; -import com.ic.er.common.ResultState; - -public interface AttributeService { - AttributeVO createAttribute(AttributeDTO attributeDTO); - - ResultState deleteAttribute(AttributeDTO attributeDTO); - - ResultState updateAttribute(AttributeDTO attributeDTO); - -} diff --git a/src/main/java/com/ic/er/service/EntityService.java b/src/main/java/com/ic/er/service/EntityService.java deleted file mode 100644 index cc28c5c6b8af146d59141d77315a11764a2422aa..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/service/EntityService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ic.er.service; - -import com.ic.er.bean.dto.EntityDTO; -import com.ic.er.bean.vo.EntityVO; -import com.ic.er.common.ResultState; - -public interface EntityService { - - EntityVO createEntity(EntityDTO entityDTO); - - ResultState deleteEntity(EntityDTO entityDTO); - - ResultState updateEntity(EntityDTO entityDTO); -} diff --git a/src/main/java/com/ic/er/service/RelationshipService.java b/src/main/java/com/ic/er/service/RelationshipService.java deleted file mode 100644 index 40b204938337907c6dfabbc12be7dbeb0d2d1e2c..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/service/RelationshipService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ic.er.service; - -import com.ic.er.bean.dto.RelationshipDTO; -import com.ic.er.bean.vo.RelationshipVO; -import com.ic.er.common.ResultState; - -public interface RelationshipService { - - RelationshipVO createRelationship(RelationshipDTO relationshipDTO); - - ResultState deleteRelationship(RelationshipDTO relationshipDTO); - - ResultState updateRelationship(RelationshipDTO relationshipDTO); -} diff --git a/src/main/java/com/ic/er/service/ViewService.java b/src/main/java/com/ic/er/service/ViewService.java deleted file mode 100644 index 246f90f8d234ed38afe35a1a8571f0576d794e04..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/service/ViewService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.ic.er.service; - -import com.ic.er.bean.dto.ViewDTO; -import com.ic.er.bean.vo.ViewVO; -import com.ic.er.common.ResultState; -import java.util.List; - -public interface ViewService { - ViewVO createView(ViewDTO view); - - ResultState deleteView(ViewDTO view); - - List<ViewVO> queryAllView(); - - ViewVO queryView(ViewDTO view); - - ResultState updateView(ViewDTO view); -} diff --git a/src/main/java/com/ic/er/service/serviceImpl/.gitkeep b/src/main/java/com/ic/er/service/serviceImpl/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/main/java/com/ic/er/util/.gitkeep b/src/main/java/com/ic/er/util/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/main/java/com/ic/er/util/boot.java b/src/main/java/com/ic/er/util/boot.java deleted file mode 100644 index ba41e2e01a5ee4125de8b16b0d33f6fde873c3c7..0000000000000000000000000000000000000000 --- a/src/main/java/com/ic/er/util/boot.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.ic.er.util; - -import com.ic.er.common.ResultState; -import com.ic.er.common.ResultStateCode; -import org.apache.ibatis.io.Resources; -import org.apache.ibatis.session.SqlSession; -import org.apache.ibatis.session.SqlSessionFactory; -import org.apache.ibatis.session.SqlSessionFactoryBuilder; - -import java.io.IOException; -import java.io.InputStream; - -public class boot { - public static SqlSession sqlSession; - - public static ResultState connectDB(){ - ResultState resultState = null; - try { - InputStream is = Resources.getResourceAsStream("mybatis-config.xml"); - SqlSessionFactoryBuilder sqlSessionFactoryBuilder = new SqlSessionFactoryBuilder(); - SqlSessionFactory sqlSessionFactory = sqlSessionFactoryBuilder.build(is); - sqlSession = sqlSessionFactory.openSession(true); - resultState = ResultState.ok(); - } catch (IOException msg) { - resultState = ResultState.build(ResultStateCode.failOp, msg.getMessage()); - return resultState; - } - return resultState; - } -} diff --git a/src/main/resources/jdbc-postgre.properties b/src/main/resources/jdbc-postgre.properties new file mode 100644 index 0000000000000000000000000000000000000000..22a722a68d3adb30ad184eaa44ef568d7b94d551 --- /dev/null +++ b/src/main/resources/jdbc-postgre.properties @@ -0,0 +1,4 @@ +jdbc.driverClassName=org.postgresql.Driver +jdbc.url=jdbc:postgresql://db.doc.ic.ac.uk:5432/wh722 +jdbc.username=wh722 +jdbc.password=4jC@A3528>0N6 diff --git a/src/main/resources/jdbc.properties b/src/main/resources/jdbc.properties index 0d2a5464dc0799f06ea40115cfa16719e01aecfd..35f385b45cead5d1a6257e537d73a6646bbb2de9 100644 --- a/src/main/resources/jdbc.properties +++ b/src/main/resources/jdbc.properties @@ -1,4 +1,4 @@ jdbc.driverClassName=org.h2.Driver -jdbc.url=jdbc:h2:tcp://localhost/~/test +jdbc.url=jdbc:h2:mem:test jdbc.username=sa jdbc.password= \ No newline at end of file diff --git a/src/main/resources/mapper/AttributeMapper.xml b/src/main/resources/mapper/AttributeMapper.xml index 3d39010b49feb2752525f83bdd9a9a6b9307fced..e0e6f31620246f55aa50101e6c26837995cf85ec 100644 --- a/src/main/resources/mapper/AttributeMapper.xml +++ b/src/main/resources/mapper/AttributeMapper.xml @@ -4,148 +4,138 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ic.er.dao.AttributeMapper"> - <resultMap id="BaseResultMap" type="com.ic.er.bean.entity.Attribute"> - <id column="id" property="id"/> - <result column="entity_id" property="entity_id"/> - <result column="view_id" property="view_id"/> + <resultMap id="BaseResultMap" type="com.ic.er.entity.AttributeDO"> + <id column="id" property="ID"/> + <result column="entity_id" property="entityID"/> + <result column="schema_id" property="schemaID"/> <result column="name" property="name"/> - <result column="data_type" property="data_type"/> - <result column="is_primary" property="is_primary"/> - <result column="is_foreign" property="is_foreign"/> - <result column="is_delete" property="is_delete"/> - <result column="gmt_create" property="gmt_create"/> - <result column="gmt_modified" property="gmt_modified"/> + <result column="data_type" property="dataType"/> + <result column="is_primary" property="isPrimary"/> + <result column="is_null" property="isNull"/> + <result column="is_delete" property="isDelete"/> + <result column="gmt_create" property="gmtCreate"/> + <result column="gmt_modified" property="gmtModified"/> </resultMap> <sql id="Base_Column_List"> - id, entity_id, view_id, name, data_type, is_primary, is_foreign + id, entity_id, schema_id, name, data_type, is_primary </sql> - <select id="selectById" parameterType="java.lang.Long"> + <select id="selectByID" parameterType="java.lang.Long" resultMap="BaseResultMap"> select - id,entity_id,view_id,name,data_type,is_primary,is_foreign,is_delete,gmt_create,gmt_modified + id,entity_id,schema_id,name,data_type,is_primary,nullable,is_delete,gmt_create,gmt_modified from attribute where id = #{id,jdbcType=BIGINT} and is_delete = 0 </select> - <select id="selectByAttribute" parameterType="com.ic.er.bean.entity.Attribute"> + <select id="selectByAttribute" parameterType="com.ic.er.entity.AttributeDO" resultMap="BaseResultMap"> select - id,entity_id,view_id,name,data_type,is_primary,is_foreign,is_delete,gmt_create,gmt_modified + id,entity_id,schema_id,name,data_type,is_primary,nullable,is_delete,gmt_create,gmt_modified from attribute <where> - <if test="id != null"> - and id = #{id,jdbcType=BIGINT} + <if test="ID != null"> + and id = #{ID,jdbcType=BIGINT} </if> - <if test="entity_id != null"> - and entity_id = #{entity_id,jdbcType=BIGINT} + <if test="entityID != null"> + and entity_id = #{entityID,jdbcType=BIGINT} </if> - <if test="view_id != null"> - and view_id = #{view_id,jdbcType=BIGINT} + <if test="schemaID != null"> + and schema_id = #{schemaID,jdbcType=BIGINT} </if> <if test="name != null"> and name = #{name,jdbcType=VARCHAR} </if> - <if test="data_type != null"> - and data_type = #{data_type,jdbcType=VARCHAR} + <if test="dataType != null"> + and data_type = #{dataType,jdbcType=VARCHAR} </if> - <if test="is_primary != null"> - and is_primary = #{is_primary,jdbcType=TINYINT} + <if test="isPrimary != null"> + and is_primary = #{isPrimary,jdbcType=TINYINT} </if> - <if test="is_foreign != null"> - and is_foreign = #{is_foreign,jdbcType=TINYINT} + <if test="nullable != null"> + and nullable = #{nullable,jdbcType=TINYINT} </if> - <if test="is_delete != null"> - and is_delete = #{is_delete,jdbcType=TINYINT} + <if test="gmtCreate != null"> + and gmt_create = #{gmtCreate,jdbcType=DATETIME} </if> - <if test="gmt_create != null"> - and gmt_create = #{gmt_create,jdbcType=DATETIME} - </if> - <if test="gmt_modified != null"> - and gmt_modified = #{gmt_modified,jdbcType=DATETIME} + <if test="gmtModified != null"> + and gmt_modified = #{gmtModified,jdbcType=DATETIME} </if> + and is_delete = 0 </where> </select> - <insert id="insert" parameterType="com.ic.er.bean.entity.Attribute"> + <insert id="insert" parameterType="com.ic.er.entity.AttributeDO" useGeneratedKeys="true" keyProperty="ID"> insert into attribute <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> - id, - </if> - <if test="entity_id != null"> + <if test="entityID != null"> entity_id, </if> - <if test="view_id != null"> - view_id, + <if test="schemaID != null"> + schema_id, </if> <if test="name != null"> name, </if> - <if test="data_type != null"> + <if test="dataType != null"> data_type, </if> - <if test="is_primary != null"> + <if test="isPrimary != null"> is_primary, </if> - <if test="is_foreign != null"> - is_foreign, + <if test="nullable != null"> + nullable, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> - <if test="entity_id != null"> - #{entity_id,jdbcType=BIGINT}, + <if test="entityID != null"> + #{entityID,jdbcType=BIGINT}, </if> - <if test="view_id != null"> - #{view_id,jdbcType=BIGINT}, + <if test="schemaID != null"> + #{schemaID,jdbcType=BIGINT}, </if> <if test="name != null"> #{name,jdbcType=VARCHAR}, </if> - <if test="data_type != null"> - #{data_type,jdbcType=VARCHAR}, + <if test="dataType != null"> + #{dataType,jdbcType=VARCHAR}, </if> - <if test="is_primary != null"> - #{is_primary,jdbcType=TINYINT}, + <if test="isPrimary != null"> + #{isPrimary,jdbcType=TINYINT}, </if> - <if test="is_foreign != null"> - #{is_foreign,jdbcType=TINYINT}, + <if test="nullable != null"> + #{nullable,jdbcType=TINYINT}, </if> </trim> </insert> - <delete id="deleteById" parameterType="java.lang.Long"> - delete from attribute - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </delete> + <update id="deleteByID" parameterType="java.lang.Long"> + update attribute set + is_delete = 1 + where id = #{ID,jdbcType=BIGINT} and is_delete = 0 + </update> - <update id="updateById" parameterType="com.ic.er.bean.entity.Attribute"> + <update id="updateByID" parameterType="com.ic.er.entity.AttributeDO"> update attribute <set> - <if test="entity_id != null"> - entity_id = #{entity_id,jdbcType=BIGINT}, + <if test="entityID != null"> + entity_id = #{entityID,jdbcType=BIGINT}, </if> - <if test="view_id != null"> - view_id = #{view_id,jdbcType=BIGINT}, + <if test="schemaID != null"> + schema_id = #{schemaID,jdbcType=BIGINT}, </if> <if test="name != null"> name = #{name,jdbcType=VARCHAR}, </if> - <if test="data_type != null"> - data_type = #{data_type,jdbcType=VARCHAR}, - </if> - <if test="is_primary != null"> - is_primary = #{is_primary,jdbcType=TINYINT}, + <if test="dataType != null"> + data_type = #{dataType,jdbcType=VARCHAR}, </if> - <if test="is_foreign != null"> - is_foreign = #{is_foreign,jdbcType=TINYINT}, + <if test="isPrimary != null"> + is_primary = #{isPrimary,jdbcType=TINYINT}, </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, + <if test="nullable != null"> + nullable = #{nullable,jdbcType=TINYINT}, </if> </set> - where id = #{id,jdbcType=BIGINT} + where id = #{ID,jdbcType=BIGINT} and is_delete = 0 </update> </mapper> \ No newline at end of file diff --git a/src/main/resources/mapper/EntityMapper.xml b/src/main/resources/mapper/EntityMapper.xml index 4341dcdbe6620db52460c5459990354e3da8049e..b9223e7738b38a1ecbb277b04e087f003d65be0a 100644 --- a/src/main/resources/mapper/EntityMapper.xml +++ b/src/main/resources/mapper/EntityMapper.xml @@ -4,97 +4,86 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ic.er.dao.EntityMapper"> - <resultMap id="BaseResultMap" type="com.ic.er.bean.entity.Entity"> - <id column="id" property="id"/> + <resultMap id="BaseResultMap" type="com.ic.er.entity.EntityDO"> + <id column="id" property="ID"/> <result column="name" property="name"/> - <result column="view_id" property="view_id"/> - <result column="is_delete" property="is_delete"/> - <result column="gmt_create" property="gmt_create"/> - <result column="gmt_modified" property="gmt_modified"/> + <result column="schema_id" property="schemaID"/> + <result column="is_delete" property="isDelete"/> + <result column="gmt_create" property="gmtCreate"/> + <result column="gmt_modified" property="gmtModified"/> </resultMap> <sql id="Base_Column_List"> - id, name, view_id + id, name, schema_id </sql> - <select id="selectById" parameterType="java.lang.Long"> + <select id="selectByID" parameterType="java.lang.Long" resultMap="BaseResultMap"> select - id,name,view_id,is_delete,gmt_create,gmt_modified + id,name,schema_id,is_delete,gmt_create,gmt_modified from entity - where id = #{id,jdbcType=BIGINT} and is_delete = 0 + where id = #{ID,jdbcType=BIGINT} and is_delete = 0 </select> - <select id="selectByEntity" parameterType="com.ic.er.bean.entity.Entity"> + <select id="selectByEntity" parameterType="com.ic.er.entity.EntityDO" resultMap="BaseResultMap"> select - id,name,view_id,is_delete,gmt_create,gmt_modified + id,name,schema_id,is_delete,gmt_create,gmt_modified from entity - where - <trim suffixOverrides=","> - <if test="id != null"> - id = #{id,jdbcType=BIGINT}, + <where> + <if test="ID != null"> + and id = #{ID,jdbcType=BIGINT} </if> <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, - </if> - <if test="view_id != null"> - view_id = #{view_id,jdbcType=BIGINT}, + and name = #{name,jdbcType=VARCHAR} </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, + <if test="schemaID != null"> + and schema_id = #{schemaID,jdbcType=BIGINT} </if> - <if test="gmt_create != null"> - gmt_create = #{gmt_create,jdbcType=DATETIME}, + <if test="gmtCreate != null"> + and gmt_create = #{gmtCreate,jdbcType=DATETIME} </if> - <if test="gmt_modified != null"> - gmt_modified = #{gmt_modified,jdbcType=DATETIME}, + <if test="gmtModified != null"> + and gmt_modified = #{gmtModified,jdbcType=DATETIME} </if> - </trim> + and is_delete = 0 + </where> </select> - <insert id="insert" parameterType="com.ic.er.bean.entity.Entity"> + <insert id="insert" parameterType="com.ic.er.entity.EntityDO" useGeneratedKeys="true" keyProperty="ID"> insert into entity <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> - id, - </if> <if test="name != null"> name, </if> - <if test="view_id != null"> - view_id, + <if test="schemaID != null"> + schema_id, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> <if test="name != null"> #{name,jdbcType=VARCHAR}, </if> - <if test="view_id != null"> - #{view_id,jdbcType=BIGINT}, + <if test="schemaID != null"> + #{schemaID,jdbcType=BIGINT}, </if> </trim> </insert> - <delete id="deleteById" parameterType="java.lang.Long"> - delete from entity - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </delete> + <update id="deleteByID" parameterType="java.lang.Long"> + update entity set + is_delete = 1 + where id = #{ID,jdbcType=BIGINT} and is_delete = 0 + </update> - <update id="updateById" parameterType="com.ic.er.bean.entity.Entity"> + <update id="updateByID" parameterType="com.ic.er.entity.EntityDO"> update entity <set> <if test="name != null"> name = #{name,jdbcType=VARCHAR}, </if> - <if test="view_id != null"> - view_id = #{view_id,jdbcType=BIGINT}, - </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, + <if test="schemaID != null"> + schema_id = #{schemaID,jdbcType=BIGINT}, </if> </set> - where id = #{id,jdbcType=BIGINT} + where id = #{ID,jdbcType=BIGINT} and is_delete = 0 </update> </mapper> \ No newline at end of file diff --git a/src/main/resources/mapper/LayoutInfoMapper.xml b/src/main/resources/mapper/LayoutInfoMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..421d4b9a2c0107e779ac0eea75dbac7ebc852243 --- /dev/null +++ b/src/main/resources/mapper/LayoutInfoMapper.xml @@ -0,0 +1,147 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ic.er.dao.LayoutInfoMapper"> + + <resultMap id="BaseResultMap" type="com.ic.er.entity.LayoutInfoDO"> + <id column="id" property="ID"/> + <result column="related_obj_id" property="relatedObjID"/> + <result column="related_obj_type" property="relatedObjType"/> + <result column="layout_x" property="layoutX"/> + <result column="layout_y" property="layoutY"/> + <result column="width" property="width"/> + <result column="height" property="height"/> + </resultMap> + + <sql id="Base_Column_List"> + id, related_obj_id, related_obj_type, layout_x, layout_y, width, height + </sql> + + <select id="selectByID" parameterType="java.lang.Long" resultMap="BaseResultMap"> + select + id,related_obj_id,related_obj_type,layout_x,layout_y,width,height + from layout_info + where id = #{ID,jdbcType=BIGINT} + </select> + + <select id="selectByRelatedObjID" parameterType="java.lang.Long" resultMap="BaseResultMap"> + select + id,related_obj_id,related_obj_type,layout_x,layout_y,width,height + from layout_info + where related_obj_id = #{relatedObjID,jdbcType=BIGINT} and related_obj_type = + #{relatedObjType.value,jdbcType=SMALLINT} + </select> + + <select id="selectByLayoutInfo" parameterType="com.ic.er.entity.LayoutInfoDO" resultMap="BaseResultMap"> + select + id,related_obj_id,related_obj_type,layout_x,layout_y,width,height + from layout_info + <where> + <if test="ID != null"> + and id = #{ID,jdbcType=BIGINT} + </if> + <if test="relatedObjID != null"> + and related_obj_id = #{relatedObjID,jdbcType=BIGINT} + </if> + <if test="relatedObjType != null"> + and related_obj_type = #{relatedObjType.value,jdbcType=SMALLINT} + </if> + <if test="layoutX != null"> + and layout_x = #{layoutX,jdbcType=NUMERIC} + </if> + <if test="layoutY != null"> + and layout_y = #{layoutY,jdbcType=NUMERIC} + </if> + <if test="width != null"> + and width = #{width,jdbcType=NUMERIC} + </if> + <if test="height != null"> + and height = #{height,jdbcType=NUMERIC} + </if> + </where> + </select> + + <insert id="insert" parameterType="com.ic.er.entity.LayoutInfoDO" useGeneratedKeys="true" keyProperty="ID"> + insert into layout_info + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="relatedObjID != null"> + related_obj_id, + </if> + <if test="relatedObjType != null"> + related_obj_type, + </if> + <if test="layoutX != null"> + layout_x, + </if> + <if test="layoutY != null"> + layout_y, + </if> + <if test="width != null"> + width, + </if> + <if test="height != null"> + height, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="relatedObjID != null"> + #{relatedObjID,jdbcType=BIGINT}, + </if> + <if test="relatedObjType != null"> + #{relatedObjType.value,jdbcType=SMALLINT}, + </if> + <if test="layoutX != null"> + #{layoutX,jdbcType=NUMERIC}, + </if> + <if test="layoutY != null"> + #{layoutY,jdbcType=NUMERIC}, + </if> + <if test="width != null"> + #{width,jdbcType=NUMERIC}, + </if> + <if test="height != null"> + #{height,jdbcType=NUMERIC}, + </if> + </trim> + </insert> + + <update id="updateByID" parameterType="com.ic.er.entity.LayoutInfoDO"> + update layout_info + <set> + <if test="layoutX != null"> + layout_x = #{layoutX,jdbcType=NUMERIC}, + </if> + <if test="layoutY != null"> + layout_y = #{layoutY,jdbcType=NUMERIC}, + </if> + <if test="width != null"> + width = #{width,jdbcType=NUMERIC}, + </if> + <if test="height != null"> + height = #{height,jdbcType=NUMERIC}, + </if> + </set> + where id = #{ID,jdbcType=BIGINT} + </update> + + <update id="updateByObjIDAnd" parameterType="com.ic.er.entity.LayoutInfoDO"> + update layout_info + <set> + <if test="layoutX != null"> + layout_x = #{layoutX,jdbcType=NUMERIC}, + </if> + <if test="layoutY != null"> + layout_y = #{layoutY,jdbcType=NUMERIC}, + </if> + <if test="width != null"> + width = #{width,jdbcType=NUMERIC}, + </if> + <if test="height != null"> + height = #{height,jdbcType=NUMERIC}, + </if> + </set> + where related_obj_id = #{relatedObjID,jdbcType=BIGINT} and related_obj_type = + #{relatedObjType.value,jdbcType=SMALLINT} + </update> +</mapper> \ No newline at end of file diff --git a/src/main/resources/mapper/RelationshipMapper.xml b/src/main/resources/mapper/RelationshipMapper.xml index 1f03d0f1931036c99b7b9ee1239c8887f137bed4..45c905ca2a85a20d41a4c0c00b0f02f58dc5262c 100644 --- a/src/main/resources/mapper/RelationshipMapper.xml +++ b/src/main/resources/mapper/RelationshipMapper.xml @@ -4,162 +4,138 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ic.er.dao.RelationshipMapper"> - <resultMap id="BaseResultMap" type="com.ic.er.bean.entity.Relationship"> - <id column="id" property="id"/> + <resultMap id="BaseResultMap" type="com.ic.er.entity.RelationshipDO"> + <id column="id" property="ID"/> <result column="name" property="name"/> - <result column="view_id" property="view_id"/> - <result column="first_entity_id" property="first_entity_id"/> - <result column="second_entity_id" property="second_entity_id"/> - <result column="first_attribute_id" property="first_attribute_id"/> - <result column="second_attribute_id" property="second_attribute_id"/> - <result column="cardinatily" property="cardinatily"/> - <result column="is_delete" property="is_delete"/> - <result column="gmt_create" property="gmt_create"/> - <result column="gmt_modified" property="gmt_modified"/> + <result column="schema_id" property="schemaID"/> + <result column="first_entity_id" property="firstEntityID"/> + <result column="second_entity_id" property="secondEntityID"/> + <result column="first_cardinality" property="firstCardinality"/> + <result column="second_cardinality" property="secondCardinality"/> + <result column="is_delete" property="isDelete"/> + <result column="gmt_create" property="gmtCreate"/> + <result column="gmt_modified" property="gmtModified"/> </resultMap> <sql id="Base_Column_List"> - id, name, view_id, first_entity_id, second_entity_id, first_attribute_id, second_attribute_id, cardinatily + id, name, schema_id, first_entity_id, second_entity_id, first_cardinality, second_cardinality </sql> - <select id="selectById" parameterType="java.lang.Long"> + <select id="selectByID" parameterType="java.lang.Long" resultMap="BaseResultMap"> select - id,name,view_id,first_entity_id,second_entity_id,first_attribute_id,second_attribute_id,cardinality,is_delete,gmt_create,gmt_modified + id,name,schema_id,first_entity_id,second_entity_id,first_cardinality,second_cardinality,is_delete,gmt_create,gmt_modified from relationship - where id = #{id,jdbcType=BIGINT} and is_delete = 0 + where id = #{ID,jdbcType=BIGINT} and is_delete = 0 </select> - <select id="selectByRelationship" parameterType="com.ic.er.bean.entity.Relationship"> + <select id="selectByRelationship" parameterType="com.ic.er.entity.RelationshipDO" resultMap="BaseResultMap"> select - id,name,view_id,first_entity_id,second_entity_id,first_attribute_id,second_attribute_id,cardinality,is_delete,gmt_create,gmt_modified + id,name,schema_id,first_entity_id,second_entity_id,first_cardinality,second_cardinality,is_delete,gmt_create,gmt_modified from relationship - where - <trim suffixOverrides=","> - <if test="id != null"> - id = #{id,jdbcType=BIGINT}, + <where> + <if test="ID != null"> + and id = #{ID,jdbcType=BIGINT} </if> <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, - </if> - <if test="view_id != null"> - view_id = #{view_id,jdbcType=BIGINT}, - </if> - <if test="first_entity_id != null"> - first_entity_id = #{first_entity_id,jdbcType=BIGINT}, + and name = #{name,jdbcType=VARCHAR} </if> - <if test="second_entity_id != null"> - second_entity_id = #{second_entity_id,jdbcType=BIGINT}, + <if test="schemaID != null"> + and schema_id = #{schemaID,jdbcType=BIGINT} </if> - <if test="first_attribute_id != null"> - first_attribute_id = #{first_attribute_id,jdbcType=BIGINT}, + <if test="firstEntityID != null"> + and first_entity_id = #{firstEntityID,jdbcType=BIGINT} </if> - <if test="second_attribute_id != null"> - second_attribute_id = #{second_attribute_id,jdbcType=BIGINT}, + <if test="secondEntityID != null"> + and second_entity_id = #{secondEntityID,jdbcType=BIGINT} </if> - <if test="cardinality != null"> - cardinality = #{cardinality,jdbcType=SMALLINT}, + <if test="firstCardinality != null"> + and first_cardinality = #{firstCardinality,jdbcType=SMALLINT} </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, + <if test="secondCardinality != null"> + and second_cardinality = #{secondCardinality,jdbcType=SMALLINT} </if> - <if test="gmt_create != null"> - gmt_create = #{gmt_create,jdbcType=DATETIME}, + <if test="gmtCreate != null"> + and gmt_create = #{gmtCreate,jdbcType=DATETIME} </if> - <if test="gmt_modified != null"> - gmt_modified = #{gmt_modified,jdbcType=DATETIME}, + <if test="gmtModified != null"> + and gmt_modified = #{gmtModified,jdbcType=DATETIME} </if> - </trim> + and is_delete = 0 + </where> </select> - <insert id="insert" parameterType="com.ic.er.bean.entity.Relationship"> + <insert id="insert" parameterType="com.ic.er.entity.RelationshipDO" useGeneratedKeys="true" keyProperty="ID"> insert into relationship <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> - id, - </if> <if test="name != null"> name, </if> - <if test="view_id != null"> - view_id, + <if test="schemaID != null"> + schema_id, </if> - <if test="first_entity_id != null"> + <if test="firstEntityID != null"> first_entity_id, </if> - <if test="second_entity_id != null"> + <if test="secondEntityID != null"> second_entity_id, </if> - <if test="first_attribute_id != null"> - first_attribute_id, - </if> - <if test="second_attribute_id != null"> - second_attribute_id, + <if test="firstCardinality != null"> + first_cardinality, </if> - <if test="cardinality != null"> - cardinality, + <if test="secondCardinality != null"> + second_cardinality </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> <if test="name != null"> #{name,jdbcType=VARCHAR}, </if> - <if test="view_id != null"> - #{view_id,jdbcType=BIGINT}, - </if> - <if test="first_entity_id != null"> - #{first_entity_id,jdbcType=BIGINT}, + <if test="schemaID != null"> + #{schemaID,jdbcType=BIGINT}, </if> - <if test="second_entity_id != null"> - #{second_entity_id,jdbcType=BIGINT}, + <if test="firstEntityID != null"> + #{firstEntityID,jdbcType=BIGINT}, </if> - <if test="first_attribute_id != null"> - #{first_attribute_id,jdbcType=BIGINT}, + <if test="secondEntityID != null"> + #{secondEntityID,jdbcType=BIGINT}, </if> - <if test="second_attribute_id != null"> - #{second_attribute_id,jdbcType=BIGINT}, + <if test="firstCardinality != null"> + #{firstCardinality,jdbcType=SMALLINT}, </if> - <if test="cardinality != null"> - #{cardinality,jdbcType=SMALLINT}, + <if test="secondCardinality != null"> + #{secondCardinality,jdbcType=SMALLINT} </if> </trim> </insert> - <delete id="deleteById" parameterType="java.lang.Long"> - delete from relationship - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </delete> + <update id="deleteByID" parameterType="java.lang.Long"> + update relationship set + is_delete = 1 + where id = #{ID,jdbcType=BIGINT} and is_delete = 0 + </update> - <update id="updateById" parameterType="com.ic.er.bean.entity.Attribute"> - update attribute + <update id="updateByID" parameterType="com.ic.er.entity.RelationshipDO"> + update relationship <set> <if test="name != null"> name = #{name,jdbcType=VARCHAR}, </if> - <if test="view_id != null"> - view_id = #{view_id,jdbcType=BIGINT}, - </if> - <if test="first_entity_id != null"> - first_entity_id = #{first_entity_id,jdbcType=BIGINT}, - </if> - <if test="second_entity_id != null"> - second_entity_id = #{second_entity_id,jdbcType=BIGINT}, + <if test="schemaID != null"> + schema_id = #{schemaID,jdbcType=BIGINT}, </if> - <if test="first_attribute_id != null"> - first_attribute_id = #{first_attribute_id,jdbcType=BIGINT}, + <if test="firstEntityID != null"> + first_entity_id = #{firstEntityID,jdbcType=BIGINT}, </if> - <if test="second_attribute_id != null"> - second_attribute_id = #{second_attribute_id,jdbcType=BIGINT}, + <if test="secondEntityID != null"> + second_entity_id = #{secondEntityID,jdbcType=BIGINT}, </if> - <if test="cardinality != null"> - cardinality = #{cardinality,jdbcType=SMALLINT}, + <if test="firstCardinality != null"> + first_cardinality = #{firstCardinality,jdbcType=SMALLINT}, </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, + <if test="secondCardinality != null"> + second_cardinality = #{secondCardinality,jdbcType=SMALLINT} </if> </set> - where id = #{id,jdbcType=BIGINT} + where id = #{ID,jdbcType=BIGINT} and is_delete = 0 </update> </mapper> \ No newline at end of file diff --git a/src/main/resources/mapper/SchemaMapper.xml b/src/main/resources/mapper/SchemaMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..190925dcf812763048a5c2c408ef0b0d9bbae327 --- /dev/null +++ b/src/main/resources/mapper/SchemaMapper.xml @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ic.er.dao.SchemaMapper"> + + <resultMap id="BaseResultMap" type="com.ic.er.entity.SchemaDO"> + <id column="id" property="ID"/> + <result column="name" property="name"/> + <result column="creator" property="creator"/> + <result column="parent_id" property="parentID"/> + <result column="is_delete" property="isDelete"/> + <result column="gmt_create" property="gmtCreate"/> + <result column="gmt_modified" property="gmtModified"/> + </resultMap> + + <sql id="Base_Column_List"> + id, name, creator, parent_id + </sql> + + <select id="selectAll" resultMap="BaseResultMap"> + select + id,name,creator,parent_id,is_delete,gmt_create,gmt_modified + from schema where is_delete = 0 + </select> + + <select id="selectBySchema" parameterType="com.ic.er.entity.SchemaDO" resultMap="BaseResultMap"> + select + id,name,creator,parent_id,is_delete,gmt_create,gmt_modified + from schema + <where> + <if test="ID != null"> + id = #{ID,jdbcType=BIGINT} + </if> + <if test="name != null"> + and name = #{name,jdbcType=VARCHAR} + </if> + <if test="creator != null"> + and creator = #{creator,jdbcType=VARCHAR} + </if> + <if test="parentID != null"> + and parent_id = #{parentID,jdbcType=BIGINT} + </if> + <if test="gmtCreate != null"> + and gmt_create = #{gmtCreate,jdbcType=DATETIME} + </if> + <if test="gmtModified != null"> + and gmt_modified = #{gmtModified,jdbcType=DATETIME} + </if> + and is_delete = 0 + </where> + </select> + + <select id="selectByID" parameterType="java.lang.Long" resultMap="BaseResultMap"> + select + id,name,creator,parent_id,is_delete,gmt_create,gmt_modified + from schema + where id = #{ID,jdbcType=BIGINT} and is_delete = 0 + </select> + + <insert id="insert" parameterType="com.ic.er.entity.SchemaDO" useGeneratedKeys="true" keyProperty="ID"> + insert into schema + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="name != null"> + name, + </if> + <if test="creator != null"> + creator, + </if> + <if test="parentID != null"> + parent_id, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="name != null"> + #{name,jdbcType=VARCHAR}, + </if> + <if test="creator != null"> + #{creator,jdbcType=VARCHAR}, + </if> + <if test="parentID != null"> + #{parentID,jdbcType=BIGINT}, + </if> + </trim> + </insert> + + <update id="deleteByID" parameterType="java.lang.Long"> + update schema set + is_delete = 1 + where id = #{ID,jdbcType=BIGINT} and is_delete = 0 + </update> + + <update id="updateByID" parameterType="com.ic.er.entity.SchemaDO"> + update schema + <set> + <if test="name != null"> + name = #{name,jdbcType=VARCHAR}, + </if> + <if test="creator != null"> + creator = #{creator,jdbcType=VARCHAR}, + </if> + <if test="parentID != null"> + parent_id = #{parentID,jdbcType=BIGINT}, + </if> + </set> + where id = #{ID,jdbcType=BIGINT} and is_delete = 0 + </update> + +</mapper> \ No newline at end of file diff --git a/src/main/resources/mapper/ViewMapper.xml b/src/main/resources/mapper/ViewMapper.xml deleted file mode 100644 index 4df48c432a20b78bfa21f7108db95dbdd96b762e..0000000000000000000000000000000000000000 --- a/src/main/resources/mapper/ViewMapper.xml +++ /dev/null @@ -1,120 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper - PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.ic.er.dao.ViewMapper"> - - <resultMap id="BaseResultMap" type="com.ic.er.bean.entity.View"> - <id column="id" property="id"/> - <result column="name" property="name"/> - <result column="creator" property="creator"/> - <result column="parent_id" property="parent_id"/> - <result column="is_delete" property="is_delete"/> - <result column="gmt_create" property="gmt_create"/> - <result column="gmt_modified" property="gmt_modified"/> - </resultMap> - - <sql id="Base_Column_List"> - id, name, creator, parent_id - </sql> - - <select id="selectAll"> - select - id,name,creator,parent_id,is_delete,gmt_create,gmt_modified - from view where is_delete = 0 - </select> - - <select id="selectByView" parameterType="com.ic.er.bean.entity.View"> - select - id,name,creator,parent_id,is_delete,gmt_create,gmt_modified - from view - where - <trim suffixOverrides=","> - <if test="id != null"> - id = #{id,jdbcType=BIGINT}, - </if> - <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, - </if> - <if test="creator != null"> - creator = #{creator,jdbcType=VARCHAR}, - </if> - <if test="parent_id != null"> - parent_id = #{parent_id,jdbcType=BIGINT}, - </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, - </if> - <if test="gmt_create != null"> - gmt_create = #{gmt_create,jdbcType=DATETIME}, - </if> - <if test="gmt_modified != null"> - gmt_modified = #{gmt_modified,jdbcType=DATETIME}, - </if> - </trim> - </select> - - <select id="selectById" parameterType="java.lang.Long"> - select - id,name,creator,parent_id,is_delete,gmt_create,gmt_modified - from view - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </select> - - <insert id="insert" parameterType="com.ic.er.bean.entity.View"> - insert into view - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> - id, - </if> - <if test="name != null"> - name, - </if> - <if test="creator != null"> - creator, - </if> - <if test="parent_id != null"> - parent_id, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> - <if test="name != null"> - #{name,jdbcType=VARCHAR}, - </if> - <if test="creator != null"> - #{creator,jdbcType=VARCHAR}, - </if> - <if test="parent_id != null"> - #{parent_id,jdbcType=BIGINT}, - </if> - </trim> - </insert> - - <delete id="deleteById" parameterType="java.lang.Long"> - delete from view - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </delete> - - <update id="updateById" parameterType="com.ic.er.bean.entity.View"> - update view - <set> - <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, - </if> - <if test="creator != null"> - creator = #{creator,jdbcType=VARCHAR}, - </if> - <if test="parent_id != null"> - parent_id = #{parent_id,jdbcType=BIGINT}, - </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, - </if> - </set> - where id = #{id,jdbcType=BIGINT} - </update> - -</mapper> \ No newline at end of file diff --git a/target/classes/mybatis-config.xml b/src/main/resources/mybatis-config-postgre.xml similarity index 68% rename from target/classes/mybatis-config.xml rename to src/main/resources/mybatis-config-postgre.xml index 734ba7628753f226b7a33d481f7ccb3fef820b69..ad2140e8da0a6bc350e8e96a8209c12d0b413ab2 100644 --- a/target/classes/mybatis-config.xml +++ b/src/main/resources/mybatis-config-postgre.xml @@ -3,7 +3,12 @@ PUBLIC '-//mybatis.org//DTD Config 3.0//EN' 'http://mybatis.org/dtd/mybatis-3-config.dtd'> <configuration> - <properties resource='jdbc.properties'/> + <properties resource='jdbc-postgre.properties'/> + <typeHandlers> + <typeHandler handler="org.apache.ibatis.type.EnumOrdinalTypeHandler" + javaType="com.ic.er.common.RelatedObjType"/> + <typeHandler handler="com.ic.er.common.CardinalityEnumTypeHandler"/> + </typeHandlers> <environments default='development'> <environment id='development'> <transactionManager type='JDBC'/> @@ -19,6 +24,7 @@ <mapper resource='mapper/AttributeMapper.xml'/> <mapper resource='mapper/EntityMapper.xml'/> <mapper resource='mapper/RelationshipMapper.xml'/> - <mapper resource='mapper/ViewMapper.xml'/> + <mapper resource='mapper/SchemaMapper.xml'/> + <mapper resource='mapper/LayoutInfoMapper.xml'/> </mappers> </configuration> \ No newline at end of file diff --git a/src/main/resources/mybatis-config.xml b/src/main/resources/mybatis-config.xml index 734ba7628753f226b7a33d481f7ccb3fef820b69..a0ff1b865799076e3c5d4d125971472afcfbfe0e 100644 --- a/src/main/resources/mybatis-config.xml +++ b/src/main/resources/mybatis-config.xml @@ -4,6 +4,11 @@ 'http://mybatis.org/dtd/mybatis-3-config.dtd'> <configuration> <properties resource='jdbc.properties'/> + <typeHandlers> + <typeHandler handler="org.apache.ibatis.type.EnumOrdinalTypeHandler" + javaType="com.ic.er.common.RelatedObjType"/> + <typeHandler handler="com.ic.er.common.CardinalityEnumTypeHandler"/> + </typeHandlers> <environments default='development'> <environment id='development'> <transactionManager type='JDBC'/> @@ -19,6 +24,7 @@ <mapper resource='mapper/AttributeMapper.xml'/> <mapper resource='mapper/EntityMapper.xml'/> <mapper resource='mapper/RelationshipMapper.xml'/> - <mapper resource='mapper/ViewMapper.xml'/> + <mapper resource='mapper/SchemaMapper.xml'/> + <mapper resource='mapper/LayoutInfoMapper.xml'/> </mappers> </configuration> \ No newline at end of file diff --git a/src/main/sql/schema-v1.sql b/src/main/resources/schema-v1.sql similarity index 66% rename from src/main/sql/schema-v1.sql rename to src/main/resources/schema-v1.sql index 28ac34bbc6b623d05ba7263210e819d2fa756e3d..8caf929ca96a4b5fcda6540284d09e94d8028ba6 100644 --- a/src/main/sql/schema-v1.sql +++ b/src/main/resources/schema-v1.sql @@ -1,14 +1,12 @@ ---CREATE DATABASE amazingER; - DROP TABLE IF EXISTS `attribute`; CREATE TABLE attribute ( id bigint NOT NULL AUTO_INCREMENT COMMENT 'uuid of the attribute', entity_id bigint NOT NULL COMMENT 'related entity id', - view_id bigint NOT NULL COMMENT 'related view id', + schema_id bigint NOT NULL COMMENT 'related schema id', name varchar(255) NOT NULL COMMENT 'attribute name', data_type varchar(50) NOT NULL COMMENT 'attribute type', is_primary tinyint NOT NULL DEFAULT 0 COMMENT '0-not a primary key, 1-primary key, default 0', - is_foreign tinyint NOT NULL DEFAULT 0 COMMENT '0-not a foreign key, 1-foreign key, default 0', + nullable tinyint NOT NULL DEFAULT 0 COMMENT '0-not null, 1-nullable, default 0', is_delete tinyint NOT NULL DEFAULT 0 COMMENT '0-undeleted,1-delete,default 0', gmt_create datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create time', gmt_modified datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modified time', @@ -19,7 +17,7 @@ DROP TABLE IF EXISTS `entity`; CREATE TABLE `entity` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'uuid of the entity', `name` varchar(255) NOT NULL COMMENT 'attribute name', - `view_id` bigint NOT NULL COMMENT 'related view id', + `schema_id` bigint NOT NULL COMMENT 'related schema id', `is_delete` tinyint NOT NULL DEFAULT 0 COMMENT '0-undeleted,1-delete,default 0', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create time', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modified time', @@ -30,26 +28,37 @@ DROP TABLE IF EXISTS `relationship`; CREATE TABLE `relationship` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'uuid of the relationship between entities', `name` varchar(50) NULL COMMENT 'the name of relation', - `view_id` bigint NOT NULL COMMENT 'related view id', + `schema_id` bigint NOT NULL COMMENT 'related schema id', `first_entity_id` bigint NOT NULL COMMENT 'the first entity in the relationship', `second_entity_id` bigint NOT NULL COMMENT 'the second entity in the relationship', - `first_attribute_id` bigint NOT NULL COMMENT 'the first attribute in the relationship', - `second_attribute_id` bigint NOT NULL COMMENT 'the second attribute in the relationship', - `cardinality` smallint NOT NULL COMMENT '0-one to one, 1-one to many, 2-many to many, 3-many to one', + `first_cardinality` smallint NOT NULL COMMENT '0-unknown, 1-0:1, 2-0:N, 3-1:1, 4-1:N', + `second_cardinality` smallint NOT NULL COMMENT '0-unknown, 1-0:1, 2-0:N, 3-1:1, 4-1:N', `is_delete` tinyint NOT NULL DEFAULT 0 COMMENT '0-undeleted,1-delete,default 0', - `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create times', + `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create time', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modified time', PRIMARY KEY (`id`) ); -DROP TABLE IF EXISTS `view`; -CREATE TABLE `view` ( +DROP TABLE IF EXISTS `schema`; +CREATE TABLE `schema` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'uuid of the ER model', `name` varchar(255) NOT NULL COMMENT 'name of the ER model', `creator` varchar(255) NULL DEFAULT NULL COMMENT 'name of the ER model', - `parent_id` bigint NULL DEFAULT NULL COMMENT 'parent view id', + `parent_id` bigint NULL DEFAULT 0 COMMENT 'parent schema id', `is_delete` tinyint NOT NULL DEFAULT 0 COMMENT '0-undeleted,1-delete,default 0', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create time', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modified time', PRIMARY KEY (`id`) +); + +DROP TABLE IF EXISTS `layout_info`; +CREATE TABLE `layout_info` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'layout id', + `related_obj_id` bigint NOT NULL COMMENT 'related object id', + `related_obj_type` smallint NOT NULL COMMENT 'type of the related object, 0: Unknown, 1: Attribute, 2: Entity, 3: Relationship', + `layout_x` NUMERIC(8,3) NOT NULL COMMENT 'x position on the schema', + `layout_y` NUMERIC(8,3) NOT NULL COMMENT 'y position on the schema', + `width` NUMERIC(8,3) NOT NULL COMMENT 'the width of object', + `height` NUMERIC(8,3) NOT NULL COMMENT 'the height of object', + PRIMARY KEY (`id`) ); \ No newline at end of file diff --git a/src/main/resources/templates/delete b/src/main/resources/templates/delete deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/test/java/com/ic/er/TestAttribute.java b/src/test/java/com/ic/er/TestAttribute.java new file mode 100644 index 0000000000000000000000000000000000000000..e61adb2476c8e26bce7a01033faf05c6b31834d4 --- /dev/null +++ b/src/test/java/com/ic/er/TestAttribute.java @@ -0,0 +1,78 @@ +package com.ic.er; + +import com.ic.er.common.DataType; +import com.ic.er.entity.AttributeDO; +import com.ic.er.exception.ERException; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class TestAttribute { + + private Schema testSchema; + private Entity testEntity; + + @Before + public void init() throws Exception { + ER.initialize(TestCommon.usePostgre); + testSchema = ER.createSchema("testSchema", "wt22"); + testEntity = testSchema.addEntity("teacher"); + } + + @Test + public void addAttributeTest() { + assertThrows(ERException.class, () -> testEntity.addAttribute("testPrimaryWithNullable", DataType.INT, true, true)); + + Attribute a1 = testEntity.addAttribute("teacher_id", DataType.VARCHAR, true, false); + Attribute a2 = testEntity.addAttribute("name", DataType.VARCHAR, false, false); + Attribute a3 = testEntity.addAttribute("age", DataType.INT, false, true); + Assert.assertNotNull(a1); + Assert.assertNotNull(a2); + Assert.assertNotNull(a3); + + assertThrows(ERException.class, () -> testEntity.addAttribute("age", DataType.INT, false, false)); + assertThrows(ERException.class, () -> testEntity.addAttribute("new primary", DataType.INT, true, false)); + } + + @Test + public void updateTest() { + Attribute backup = testEntity.addAttribute("backup", DataType.VARCHAR, true, false); + Attribute a1 = testEntity.addAttribute("teacher_id", DataType.VARCHAR, false, false); + String newName = "new_teacher_id"; + a1.updateInfo(newName, null, null, null); + a1.updateLayoutInfo(1.0, 2.0, 3.0, 4.0); + + List<Attribute> attributeList = Attribute.queryByAttribute(new AttributeDO(a1.getID())); + Assert.assertEquals(attributeList.size(), 1); + Assert.assertEquals(attributeList.get(0).getName(), newName); + Assert.assertEquals(attributeList.get(0).getLayoutInfo().getLayoutX(), Double.valueOf(1.0)); + Assert.assertEquals(attributeList.get(0).getLayoutInfo().getLayoutY(), Double.valueOf(2.0)); + Assert.assertEquals(attributeList.get(0).getLayoutInfo().getHeight(), Double.valueOf(3.0)); + Assert.assertEquals(attributeList.get(0).getLayoutInfo().getWidth(), Double.valueOf(4.0)); + + assertThrows(ERException.class, () -> a1.updateInfo("backup", null, null, null)); + assertThrows(ERException.class, () -> a1.updateInfo(null, null, true, null)); + assertThrows(ERException.class, () -> backup.updateInfo(null, null, null, true)); + } + + @Test + public void selectByIDTest() { + Attribute a1 = testEntity.addAttribute("teacher_id", DataType.VARCHAR, true, false); + Attribute attribute = Attribute.queryByID(a1.getID()); + Assert.assertNotNull(attribute); + } + + @Test + public void deleteByIDTest() { + Attribute a1 = testEntity.addAttribute("teacher_id", DataType.VARCHAR, true, false); + + // delete + a1.deleteDB(); + + assertThrows(ERException.class, () -> Attribute.queryByID(a1.getID())); + } +} diff --git a/src/test/java/com/ic/er/TestCommon.java b/src/test/java/com/ic/er/TestCommon.java new file mode 100644 index 0000000000000000000000000000000000000000..f58fe9e0b44fa70b0689be1e6cc84a861715fc54 --- /dev/null +++ b/src/test/java/com/ic/er/TestCommon.java @@ -0,0 +1,5 @@ +package com.ic.er; + +public class TestCommon { + public static final boolean usePostgre = false; +} diff --git a/src/test/java/com/ic/er/TestER.java b/src/test/java/com/ic/er/TestER.java new file mode 100644 index 0000000000000000000000000000000000000000..b1d8e65325341a9c2ac53414c888879553f034df --- /dev/null +++ b/src/test/java/com/ic/er/TestER.java @@ -0,0 +1,74 @@ +package com.ic.er; + +import com.ic.er.common.Cardinality; +import com.ic.er.common.DataType; +import com.ic.er.exception.ERException; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.io.FileWriter; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class TestER { + + @Before + public void setUp() throws Exception { + ER.initialize(TestCommon.usePostgre); + } + + @Test + public void createSchemaTest() { + Schema testSchema = ER.createSchema("testSchema", "wt22"); + Assert.assertNotNull(ER.querySchemaByID(testSchema.getID())); + } + + @Test + public void deleteSchemaTest() { + Schema testSchema = ER.createSchema("testSchema", "wt22"); + Assert.assertNotEquals(ER.queryAllSchema().size(), 0); + ER.deleteSchema(testSchema); + assertThrows(ERException.class, () -> ER.querySchemaByID(testSchema.getID())); + } + + @Test + public void drawER() throws IOException { + Schema example = ER.createSchema("BranchAccountMovement", ""); + + Entity branch = example.addEntity("branch"); + branch.addAttribute("sortcode", DataType.INT, true, false); + branch.addAttribute("bname", DataType.VARCHAR, false, false); + branch.addAttribute("cash", DataType.DOUBLE, false, false); + + Entity account = example.addEntity("account"); + account.addAttribute("no", DataType.INT, true, false); + account.addAttribute("type", DataType.CHAR, false, false); + account.addAttribute("cname", DataType.VARCHAR, false, false); + account.addAttribute("rate", DataType.DOUBLE, false, true); + + Entity movement = example.addEntity("movement"); + movement.addAttribute("mid", DataType.INT, true, false); + movement.addAttribute("amount", DataType.DOUBLE, false, false); + movement.addAttribute("tdate", DataType.DATETIME, false, false); + + Relationship holds = example.createRelationship("holds", account, branch, Cardinality.OneToOne, Cardinality.ZeroToMany); + Relationship has = example.createRelationship("has", account, movement, Cardinality.ZeroToMany, Cardinality.OneToOne); + + String jsonString = example.toJSON(); + FileWriter myWriter = new FileWriter(String.format("%s.json", example.getName())); + myWriter.write(jsonString); + myWriter.close(); + } + + @Test + public void loadFromJSONTest() throws IOException { + String jsonString = Files.readString(Path.of("BranchAccountMovement.json"), Charset.defaultCharset()); + Schema schema = ER.loadFromJSON(jsonString); + Assert.assertNotNull(schema); + } +} diff --git a/src/test/java/com/ic/er/TestEntity.java b/src/test/java/com/ic/er/TestEntity.java new file mode 100644 index 0000000000000000000000000000000000000000..2d223c8555d71c559b2671fa98b341f23cfa0ef0 --- /dev/null +++ b/src/test/java/com/ic/er/TestEntity.java @@ -0,0 +1,73 @@ +package com.ic.er; + + +import com.ic.er.common.DataType; +import com.ic.er.exception.ERException; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class TestEntity { + + private Schema testSchema; + + @Before + public void init() throws Exception { + ER.initialize(TestCommon.usePostgre); + testSchema = ER.createSchema("testSchema", "wt22"); + } + + + @Test + public void addEntityTest() { + Entity teacher = testSchema.addEntity("teacher"); + Assert.assertNotEquals(teacher.getID(), Long.valueOf(0)); + assertThrows(ERException.class, () -> testSchema.addEntity("teacher")); + } + + @Test + public void deleteEntityTest() { + Entity teacher = testSchema.addEntity("teacher"); + Assert.assertNotEquals(teacher.getID(), Long.valueOf(0)); + + teacher.deleteDB(); + assertThrows(ERException.class, () -> Entity.queryByID(teacher.getID())); + } + + @Test + public void queryEntityTest() { + Entity teacher = testSchema.addEntity("teacher"); + Assert.assertNotEquals(teacher.getID(), Long.valueOf(0)); + + Assert.assertNotNull(Entity.queryByID(teacher.getID())); + } + + @Test + public void updateEntityTest() { + Entity teacher = testSchema.addEntity("teacher"); + Entity student = testSchema.addEntity("student"); + Assert.assertNotEquals(teacher.getID(), Long.valueOf(0)); + + teacher.updateInfo("new teacher name"); + Entity entity = Entity.queryByID(teacher.getID()); + Assert.assertNotNull(entity); + Assert.assertEquals(entity.getName(), "new teacher name"); + + assertThrows(ERException.class, () -> teacher.updateInfo("student")); + } + + @Test + public void attributeTest() { + Entity teacher = testSchema.addEntity("teacher"); + Attribute teacherID = teacher.addAttribute("teacher_id", DataType.INT, true, false); + Assert.assertNotEquals(teacher.getID(), Long.valueOf(0)); + + teacher.updateInfo("new teacher name"); + + teacher.deleteAttribute(teacherID); + Assert.assertEquals(teacher.getAttributeList().size(), 0); + assertThrows(ERException.class, () -> Attribute.queryByID(teacherID.getID())); + } +} \ No newline at end of file diff --git a/src/test/java/com/ic/er/TestRelationship.java b/src/test/java/com/ic/er/TestRelationship.java new file mode 100644 index 0000000000000000000000000000000000000000..89c22e15005d8a9af2d3777926a8eca015a20cb3 --- /dev/null +++ b/src/test/java/com/ic/er/TestRelationship.java @@ -0,0 +1,95 @@ +package com.ic.er; + +import com.ic.er.common.Cardinality; +import com.ic.er.entity.RelationshipDO; +import com.ic.er.exception.ERException; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class TestRelationship { + + private Schema testSchema; + private Schema secondSchema; + private Entity teacher; + private Entity student; + private Entity classroom; + private Entity secondSchemaEntity1; + private Entity secondSchemaEntity2; + + @Before + public void init() throws Exception { + ER.initialize(TestCommon.usePostgre); + testSchema = ER.createSchema("testSchema", "wt22"); + secondSchema = ER.createSchema("secondSchema", "wt22"); + teacher = testSchema.addEntity("teacher"); + student = testSchema.addEntity("student"); + classroom = testSchema.addEntity("classroom"); + secondSchemaEntity1 = secondSchema.addEntity("ent1"); + secondSchemaEntity2 = secondSchema.addEntity("ent2"); + Assert.assertNotNull(teacher); + Assert.assertNotNull(student); + Assert.assertNotNull(classroom); + } + + @Test + public void createRelationshipTest() { + assertThrows(ERException.class, () -> secondSchema.createRelationship("teaches", student, teacher, Cardinality.ZeroToMany, Cardinality.ZeroToMany)); + + Relationship relationship = testSchema.createRelationship("teaches", teacher, student, Cardinality.ZeroToMany, Cardinality.ZeroToMany); + Assert.assertNotNull(relationship); + + assertThrows(ERException.class, () -> testSchema.createRelationship("teaches", teacher, student, Cardinality.ZeroToMany, Cardinality.ZeroToMany)); + assertThrows(ERException.class, () -> testSchema.createRelationship("teaches", student, teacher, Cardinality.ZeroToMany, Cardinality.ZeroToMany)); + } + + @Test + public void deleteRelationshipTest() { + Relationship testEntityCascadeDelete = testSchema.createRelationship("teaches", teacher, student, Cardinality.ZeroToMany, Cardinality.ZeroToMany); + Assert.assertNotNull(testEntityCascadeDelete); + testSchema.deleteEntity(teacher); + assertThrows(ERException.class, () -> Entity.queryByID(teacher.getID())); + assertThrows(ERException.class, () -> Relationship.queryByID(testEntityCascadeDelete.getID())); + + teacher = testSchema.addEntity("teacher"); + Relationship relationship = testSchema.createRelationship("teaches", teacher, student, Cardinality.ZeroToMany, Cardinality.ZeroToMany); + Assert.assertNotNull(relationship); + relationship.deleteDB(); + assertThrows(ERException.class, () -> Relationship.queryByID(relationship.getID())); + } + + @Test + public void updateRelationshipTest() { + Relationship relationship = testSchema.createRelationship("teaches", teacher, student, Cardinality.ZeroToMany, Cardinality.ZeroToMany); + Assert.assertNotNull(relationship); + + String newName = "new name"; + Cardinality newCardi = Cardinality.OneToMany; + + relationship.updateInfo(newName, null, null, newCardi, newCardi); + Relationship relationship1 = Relationship.queryByID(relationship.getID()); + Assert.assertNotNull(relationship1); + Assert.assertEquals(relationship1.getName(), newName); + Assert.assertEquals(relationship1.getFirstCardinality(), newCardi); + + Relationship teachClassroom = testSchema.createRelationship("teaches", teacher, classroom, Cardinality.ZeroToMany, Cardinality.ZeroToMany); + assertThrows(ERException.class, () -> teachClassroom.updateInfo(newName, teacher, student, newCardi, newCardi)); + assertThrows(ERException.class, () -> teachClassroom.updateInfo(newName, secondSchemaEntity1, secondSchemaEntity2, newCardi, newCardi)); + } + + @Test + public void queryRelationshipTest() { + Relationship relationship = testSchema.createRelationship("teaches", teacher, student, Cardinality.ZeroToMany, Cardinality.ZeroToMany); + Assert.assertNotNull(relationship); + assertThrows(ERException.class, () -> testSchema.createRelationship("teaches2", teacher, student, Cardinality.ZeroToMany, Cardinality.ZeroToMany)); + + Relationship relationship1 = Relationship.queryByID(relationship.getID()); + Assert.assertNotNull(relationship1); + List<Relationship> results = Relationship.queryByRelationship(new RelationshipDO(relationship.getFirstEntity().getID(), relationship.getSecondEntity().getID())); + Assert.assertEquals(results.size(), 1); + } +} diff --git a/src/test/java/com/ic/er/TestSchema.java b/src/test/java/com/ic/er/TestSchema.java new file mode 100644 index 0000000000000000000000000000000000000000..a11213f29b394af696d00ef33b4ef03fd917bb8b --- /dev/null +++ b/src/test/java/com/ic/er/TestSchema.java @@ -0,0 +1,84 @@ +package com.ic.er; + +import com.ic.er.common.Cardinality; +import com.ic.er.common.DataType; +import com.ic.er.exception.ERException; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class TestSchema { + + @Before + public void init() throws Exception { + ER.initialize(TestCommon.usePostgre); + } + + @Test + public void createSchemaTest() { + Schema testSchema = ER.createSchema("testSchema", "wt22"); + + Entity teacher = testSchema.addEntity("teacher"); + teacher.addAttribute("teacher_id", DataType.VARCHAR, true, false); + teacher.addAttribute("name", DataType.VARCHAR, false, false); + teacher.addAttribute("age", DataType.INT, false, false); + + Entity student = testSchema.addEntity("student"); + student.addAttribute("student_id", DataType.VARCHAR, true, false); + student.addAttribute("name", DataType.VARCHAR, false, false); + student.addAttribute("grade", DataType.INT, false, false); + + Relationship ts = testSchema.createRelationship("teaches", teacher, student, Cardinality.ZeroToMany, Cardinality.ZeroToMany); + + Schema dbSchema = Schema.queryByID(testSchema.getID()); + Assert.assertNotNull(dbSchema); + Assert.assertEquals(dbSchema.getEntityList().size(), 2); + Assert.assertEquals(dbSchema.getRelationshipList().size(), 1); + } + + @Test + public void updateSchemaTest() { + Schema firstSchema = ER.createSchema("first schema", "tw"); + String newSchemaName = "new schema name"; + firstSchema.updateInfo(newSchemaName); + + Schema newSchema = Schema.queryByID(firstSchema.getID()); + Assert.assertEquals(newSchema.getName(), newSchemaName); + } + + @Test + public void deleteSchemaTest() { + Schema testDeleteSchema = ER.createSchema("first schema", "tw"); + testDeleteSchema = Schema.queryByID(testDeleteSchema.getID()); + Assert.assertNotNull(testDeleteSchema); + + testDeleteSchema.deleteDB(); + + Schema finalTestDeleteSchema = testDeleteSchema; + assertThrows(ERException.class, () -> Schema.queryByID(finalTestDeleteSchema.getID())); + } + + @Test + public void deleteEntityTest() { + Schema firstSchema = ER.createSchema("first schema", "tw"); + Entity firstEntity = firstSchema.addEntity("teacher"); + Assert.assertNotNull(firstEntity); + + firstSchema.deleteEntity(firstEntity); + + Schema newSchema = Schema.queryByID(firstSchema.getID()); + Assert.assertEquals(newSchema.getEntityList().size(), 0); + assertThrows(ERException.class, () -> Entity.queryByID(firstEntity.getID())); + } + + @Test + public void querySchemaTest() { + Schema firstSchema = ER.createSchema("first schema", "tw"); + List<Schema> schemas = Schema.queryAll(); + Assert.assertNotEquals(schemas.size(), 0); + } +} diff --git a/src/test/java/com/ic/er/mapper/attributeMapperTest.java b/src/test/java/com/ic/er/mapper/attributeMapperTest.java new file mode 100644 index 0000000000000000000000000000000000000000..b11f72a9e966c6bc55f3cf19460ca00c3a843c0d --- /dev/null +++ b/src/test/java/com/ic/er/mapper/attributeMapperTest.java @@ -0,0 +1,127 @@ +package com.ic.er.mapper; + +import com.ic.er.ER; +import com.ic.er.TestCommon; +import com.ic.er.common.DataType; +import com.ic.er.entity.AttributeDO; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.Date; +import java.util.List; + + +/** + * @author jie + * @data 18/10/2022 + */ +public class attributeMapperTest { + @Before + public void init() throws Exception { + ER.initialize(TestCommon.usePostgre); + } + + @Test + public void insertAttribute() { + + Long entityID = Long.valueOf(456); + + Long SchemaID = Long.valueOf(789); + + String name = "a"; + + String dataType = "int"; + + Boolean isPrimary = true; + Boolean nullable = false; + + int isDelete = 0; + + Date gmtCreate = new Date(); + + Date gmtModified = new Date(); + + + AttributeDO attributeDO = new AttributeDO(0L, entityID, SchemaID, name, DataType.INT, isPrimary, nullable, isDelete, gmtCreate, gmtModified); + AttributeDO attributeDO2 = new AttributeDO(0L, entityID, SchemaID, name, DataType.INT, isPrimary, nullable, isDelete, gmtCreate, gmtModified); + AttributeDO attributeDO3 = new AttributeDO(0L, entityID, SchemaID, name, DataType.INT, isPrimary, nullable, isDelete, gmtCreate, gmtModified); + + int ret = ER.attributeMapper.insert(attributeDO); + int ret2 = ER.attributeMapper.insert(attributeDO2); + int ret3 = ER.attributeMapper.insert(attributeDO3); + } + + @Test + public void selectByAttributeTest() { + Long entityID = 456L; + + AttributeDO attributeDO = new AttributeDO(0L, entityID, 789L, "abc", DataType.VARCHAR, false, true, 0, null, null); + int ret = ER.attributeMapper.insert(attributeDO); + Assert.assertEquals(ret, 1); + List<AttributeDO> attributeDOList = ER.attributeMapper.selectByAttribute(attributeDO); + Assert.assertEquals(attributeDOList.size(), 1); + Assert.assertEquals(attributeDOList.get(0).getEntityID(), entityID); + + attributeDOList = ER.attributeMapper.selectByAttribute(new AttributeDO(attributeDO.getID())); + Assert.assertEquals(attributeDOList.size(), 1); + Assert.assertEquals(attributeDOList.get(0).getEntityID(), entityID); + } + + @Test + public void selectByIDTest() { + Long entityID = 456L; + Long newEntityID = 789L; + + // create + AttributeDO attributeDO = new AttributeDO(0L, entityID, 789L, "abc", DataType.VARCHAR, false, true, 0, null, null); + int ret = ER.attributeMapper.insert(attributeDO); + Assert.assertEquals(ret, 1); + Assert.assertEquals(attributeDO.getEntityID(), entityID); + + AttributeDO aDo = ER.attributeMapper.selectByID(attributeDO.getID()); + Assert.assertNotNull(aDo); + } + + @Test + public void updateByIDTest() { + Long entityID = 456L; + Long newEntityID = 789L; + + // create + AttributeDO attributeDO = new AttributeDO(0L, entityID, 789L, "abc", DataType.VARCHAR, false, true, 0, null, null); + int ret = ER.attributeMapper.insert(attributeDO); + Assert.assertEquals(ret, 1); + Assert.assertEquals(attributeDO.getEntityID(), entityID); + + // update + attributeDO.setEntityID(newEntityID); + ER.attributeMapper.updateByID(attributeDO); + + // query + List<AttributeDO> attributeDOList = ER.attributeMapper.selectByAttribute(attributeDO); + Assert.assertEquals(attributeDOList.size(), 1); + Assert.assertEquals(attributeDOList.get(0).getEntityID(), newEntityID); + } + + @Test + public void deleteByIDTest() { + Long entityID = 456L; + + // create + AttributeDO attributeDO = new AttributeDO(0L, entityID, 789L, "abc", DataType.VARCHAR, false, true, 0, null, null); + int ret = ER.attributeMapper.insert(attributeDO); + Assert.assertEquals(ret, 1); + Assert.assertEquals(attributeDO.getEntityID(), entityID); + + // delete + ER.attributeMapper.deleteByID(attributeDO.getID()); + + // query to verify + List<AttributeDO> attributeDOList = ER.attributeMapper.selectByAttribute(attributeDO); + Assert.assertEquals(attributeDOList.size(), 0); + } + +} + + diff --git a/src/test/java/com/ic/er/mapper/entityMapperTest.java b/src/test/java/com/ic/er/mapper/entityMapperTest.java new file mode 100644 index 0000000000000000000000000000000000000000..022c85ab96627f7bf996e723b4bb85b534e40062 --- /dev/null +++ b/src/test/java/com/ic/er/mapper/entityMapperTest.java @@ -0,0 +1,98 @@ +package com.ic.er.mapper; + +import com.ic.er.ER; +import com.ic.er.TestCommon; +import com.ic.er.entity.EntityDO; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; +import java.sql.SQLException; +import java.util.Date; + +/** + * @author wendi + * @data 15/10/2022 + */ +public class entityMapperTest { + @Before + public void init() throws IOException, SQLException { + ER.initialize(TestCommon.usePostgre); + } + + @Test + public void insertEntity() { + + long id = Long.valueOf(456); + String name = "b"; + long schemaID = Long.valueOf(2234); + Date create = new Date(); + Date modify = new Date(); + int isDelete = 0; + + EntityDO entity = new EntityDO(id, name, schemaID, isDelete, create, modify); + + ER.entityMapper.insert(entity); + } + + @Test + public void insertEntityTest() { + + long id = 12334; + String name = "b"; + long schemaID = 789; + Date create = new Date(); + Date modify = new Date(); + int isDelete = 0; + + EntityDO entity = new EntityDO(id, name, schemaID, isDelete, create, modify); + + ER.entityMapper.insert(entity); + } + + @Test + public void selectByEntityTest() { + + long id = Long.valueOf(12334); + String name = null; + long schemaID = Long.valueOf(789); + Date create = null; + Date modify = null; + int isDelete = 0; + + EntityDO entity = new EntityDO(id, name, schemaID, isDelete, create, modify); + + ER.entityMapper.selectByEntity(entity); + } + + @Test + public void selectByIDTest() { + Long id = Long.valueOf(123); + + ER.entityMapper.selectByID(id); + } + + + @Test + public void updateByIDTest() { + + long id = Long.valueOf(123); + String name = "b"; + long schemaID = Long.valueOf(456); + Date create = new Date(); + Date modify = new Date(); + int isDelete = 0; + + EntityDO entityDo = new EntityDO(id, name, schemaID, isDelete, create, modify); + + ER.entityMapper.updateByID(entityDo); + } + + @Test + public void deleteByIDTest() { + + long id = Long.valueOf(123); + + ER.entityMapper.deleteByID(id); + } +} diff --git a/src/test/java/com/ic/er/mapper/testRelationMapper.java b/src/test/java/com/ic/er/mapper/testRelationMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..9a99f90f9d2d3f1366fb10536d2bb1457cb3a9e9 --- /dev/null +++ b/src/test/java/com/ic/er/mapper/testRelationMapper.java @@ -0,0 +1,58 @@ +package com.ic.er.mapper; + +import com.ic.er.ER; +import com.ic.er.TestCommon; +import com.ic.er.common.Cardinality; +import com.ic.er.entity.RelationshipDO; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; +import java.sql.SQLException; +import java.util.Date; +import java.util.List; + +public class testRelationMapper { + @Before + public void init() throws IOException, SQLException { + ER.initialize(TestCommon.usePostgre); + } + + + @Test + public void testQueryRelation() { + RelationshipDO relationshipDO = ER.relationshipMapper.selectByID(Long.valueOf(3)); + System.out.println(relationshipDO); + } + + @Test + public void testQueryRelationByRelation() { + RelationshipDO relationshipDO = new RelationshipDO(null, "relation4", + null, null, null, + Cardinality.ZeroToMany, Cardinality.ZeroToMany, 0, null, null); + List<RelationshipDO> res = ER.relationshipMapper.selectByRelationship(relationshipDO); + System.out.println(res); + } + + @Test + public void testCreateRelation() { + RelationshipDO relationshipDO = new RelationshipDO(Long.valueOf(11), "relation4", + Long.valueOf(4), Long.valueOf(4), Long.valueOf(3), + Cardinality.ZeroToMany, Cardinality.ZeroToMany, 0, new Date(), new Date()); + Assert.assertEquals(ER.relationshipMapper.insert(relationshipDO), 1); + } + + @Test + public void testDeleteRelation() { + Assert.assertEquals(ER.relationshipMapper.deleteByID(Long.valueOf(11)), 1); + } + + @Test + public void testUpdateRelation() { + RelationshipDO relationshipDO = new RelationshipDO(Long.valueOf(4), "relation4update", + Long.valueOf(3), Long.valueOf(4), Long.valueOf(3), + Cardinality.ZeroToMany, Cardinality.ZeroToMany, 0, new Date(), new Date()); + Assert.assertEquals(ER.relationshipMapper.updateByID(relationshipDO), 1); + } +} diff --git a/src/test/java/com/ic/er/mapper/testSchemaMapper.java b/src/test/java/com/ic/er/mapper/testSchemaMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..0755a1ed09ee93e1eb3a1f335e38578190e9ee55 --- /dev/null +++ b/src/test/java/com/ic/er/mapper/testSchemaMapper.java @@ -0,0 +1,58 @@ +package com.ic.er.mapper; + +import com.ic.er.ER; +import com.ic.er.TestCommon; +import com.ic.er.entity.SchemaDO; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; +import java.sql.SQLException; +import java.util.Date; +import java.util.List; + +public class testSchemaMapper { + @Before + public void init() throws IOException, SQLException { + ER.initialize(TestCommon.usePostgre); + } + + + @Test + public void testQueryAllSchemas() { + List<SchemaDO> schemaDOList = ER.schemaMapper.selectAll(); + Assert.assertEquals(1, schemaDOList.size()); + } + + @Test + public void testQueryByID() { + SchemaDO schemaDO = ER.schemaMapper.selectByID(Long.valueOf(3)); + System.out.println(schemaDO); + } + + @Test + public void testCreateSchema() { + SchemaDO schemaDO = new SchemaDO(Long.valueOf(2), "schema3", "creator3", Long.valueOf(1), 0, new Date(), new Date()); + Assert.assertEquals(ER.schemaMapper.insert(schemaDO), 1); + } + + @Test + public void testDeleteSchema() { + Assert.assertEquals(ER.schemaMapper.deleteByID(Long.valueOf(2)), 1); + } + + @Test + public void testQuerySchema() { + SchemaDO schemaDO = new SchemaDO(null, "schema1", null, null, 0, null, null); + List<SchemaDO> res = ER.schemaMapper.selectBySchema(schemaDO); + System.out.println(res); + + } + + @Test + public void testUpdateSchema() { + SchemaDO schemaDO = new SchemaDO(Long.valueOf(3), "schema3update", "creator3update", Long.valueOf(1), 0, new Date(), new Date()); + Assert.assertEquals(ER.schemaMapper.updateByID(schemaDO), 1); + } +} diff --git a/src/test/java/com/ic/er/testMybatis.java b/src/test/java/com/ic/er/testMybatis.java index b39ec3db92251a6c8dbb0613728de05d1b66d866..4f3513a16ec75bd70777f73495bb20cffe31dcc0 100644 --- a/src/test/java/com/ic/er/testMybatis.java +++ b/src/test/java/com/ic/er/testMybatis.java @@ -10,17 +10,12 @@ import org.junit.Test; import java.io.IOException; import java.io.InputStream; import java.sql.Connection; +import java.sql.SQLException; -/** - * - * @author wendi - * @data 15/10/2022 - * - */ public class testMybatis { @Test - public void testMybatisConnect() throws IOException { + public void testMybatisConnect() { try { InputStream is = Resources.getResourceAsStream("mybatis-config.xml"); SqlSessionFactoryBuilder sqlSessionFactoryBuilder = new SqlSessionFactoryBuilder(); @@ -32,4 +27,11 @@ public class testMybatis { Assert.fail(); } } + + @Test + public void testDBConnection() throws IOException, SQLException { + ER.initialize(true); + Assert.assertNotNull(ER.sqlSession); + System.out.println(ER.sqlSession.getConnection()); + } } diff --git a/target/classes/com/ic/er/bean/entity/Attribute.class b/target/classes/com/ic/er/bean/entity/Attribute.class deleted file mode 100644 index 3393b6bb372ebbe286c841190583aae568a09014..0000000000000000000000000000000000000000 Binary files a/target/classes/com/ic/er/bean/entity/Attribute.class and /dev/null differ diff --git a/target/classes/com/ic/er/bean/entity/Entity.class b/target/classes/com/ic/er/bean/entity/Entity.class deleted file mode 100644 index 73252b9c45caf85e2e942cd4a062709251053170..0000000000000000000000000000000000000000 Binary files a/target/classes/com/ic/er/bean/entity/Entity.class and /dev/null differ diff --git a/target/classes/com/ic/er/bean/entity/Relationship.class b/target/classes/com/ic/er/bean/entity/Relationship.class deleted file mode 100644 index e4ff5a94445b31dbc9b0dba7829b2290d5d41d78..0000000000000000000000000000000000000000 Binary files a/target/classes/com/ic/er/bean/entity/Relationship.class and /dev/null differ diff --git a/target/classes/com/ic/er/bean/entity/View.class b/target/classes/com/ic/er/bean/entity/View.class deleted file mode 100644 index ac7585540aa079049f61f3ead30e66e663990494..0000000000000000000000000000000000000000 Binary files a/target/classes/com/ic/er/bean/entity/View.class and /dev/null differ diff --git a/target/classes/com/ic/er/dao/AttributeMapper.class b/target/classes/com/ic/er/dao/AttributeMapper.class deleted file mode 100644 index 4c39c7c4b6b31400bee693c5550bc9ef860e57b4..0000000000000000000000000000000000000000 Binary files a/target/classes/com/ic/er/dao/AttributeMapper.class and /dev/null differ diff --git a/target/classes/com/ic/er/dao/EntityMapper.class b/target/classes/com/ic/er/dao/EntityMapper.class deleted file mode 100644 index 853dd0c0b481509ca8caedb0ed10add7492fb195..0000000000000000000000000000000000000000 Binary files a/target/classes/com/ic/er/dao/EntityMapper.class and /dev/null differ diff --git a/target/classes/com/ic/er/dao/RelationshipMapper.class b/target/classes/com/ic/er/dao/RelationshipMapper.class deleted file mode 100644 index b0f077b61af7eaccfea583809bb80a06908bd0f8..0000000000000000000000000000000000000000 Binary files a/target/classes/com/ic/er/dao/RelationshipMapper.class and /dev/null differ diff --git a/target/classes/com/ic/er/dao/ViewMapper.class b/target/classes/com/ic/er/dao/ViewMapper.class deleted file mode 100644 index c788305bf5239be2643baba5c52d39236e173103..0000000000000000000000000000000000000000 Binary files a/target/classes/com/ic/er/dao/ViewMapper.class and /dev/null differ diff --git a/target/classes/jdbc.properties b/target/classes/jdbc.properties deleted file mode 100644 index 0d2a5464dc0799f06ea40115cfa16719e01aecfd..0000000000000000000000000000000000000000 --- a/target/classes/jdbc.properties +++ /dev/null @@ -1,4 +0,0 @@ -jdbc.driverClassName=org.h2.Driver -jdbc.url=jdbc:h2:tcp://localhost/~/test -jdbc.username=sa -jdbc.password= \ No newline at end of file diff --git a/target/classes/mapper/AttributeMapper.xml b/target/classes/mapper/AttributeMapper.xml deleted file mode 100644 index 3a860e319b9d46ffa1c7b82937009cb770550fa4..0000000000000000000000000000000000000000 --- a/target/classes/mapper/AttributeMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper - PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.ic.er.dao.AttributeMapper"> - - <resultMap id="BaseResultMap" type="com.ic.er.bean.entity.Attribute"> - <id column="id" property="id"/> - <result column="entity_id" property="entity_id"/> - <result column="view_id" property="view_id"/> - <result column="name" property="name"/> - <result column="data_type" property="data_type"/> - <result column="is_primary" property="is_primary"/> - <result column="is_foreign" property="is_foreign"/> - <result column="is_delete" property="is_delete"/> - <result column="gmt_create" property="gmt_create"/> - <result column="gmt_modefied" property="gmt_modefied"/> - </resultMap> - - <sql id="Base_Column_List"> - id, entity_id, view_id, name, data_type, is_primary, is_foreign - </sql> - - <select id="selectById" parameterType="java.lang.Long"> - select - id,entity_id,view_id,name,data_type,is_primary,is_foreign,is_delete,gmt_create,gmt_modefied - from attribute - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </select> - - <select id="selectByAttribute" parameterType="com.ic.er.bean.entity.Attribute"> - select - id,entity_id,view_id,name,data_type,is_primary,is_foreign,is_delete,gmt_create,gmt_modefied - from attribute - <where> - <if test="id != null"> - and id = #{id,jdbcType=BIGINT} - </if> - <if test="entity_id != null"> - and entity_id = #{entity_id,jdbcType=BIGINT} - </if> - <if test="view_id != null"> - and view_id = #{view_id,jdbcType=BIGINT} - </if> - <if test="name != null"> - and name = #{name,jdbcType=VARCHAR} - </if> - <if test="data_type != null"> - and data_type = #{data_type,jdbcType=VARCHAR} - </if> - <if test="is_primary != null"> - and is_primary = #{is_primary,jdbcType=TINYINT} - </if> - <if test="is_foreign != null"> - and is_foreign = #{is_foreign,jdbcType=TINYINT} - </if> - <if test="is_delete != null"> - and is_delete = #{is_delete,jdbcType=TINYINT} - </if> - <if test="gmt_create != null"> - and gmt_create = #{gmt_create,jdbcType=DATETIME} - </if> - <if test="gmt_modefied != null"> - and gmt_modefied = #{gmt_modefied,jdbcType=DATETIME} - </if> - </where> - </select> - - <insert id="insert" parameterType="com.ic.er.bean.entity.Attribute"> - insert into attribute - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> - id, - </if> - <if test="entity_id != null"> - entity_id, - </if> - <if test="view_id != null"> - view_id, - </if> - <if test="name != null"> - name, - </if> - <if test="data_type != null"> - data_type, - </if> - <if test="is_primary != null"> - is_primary, - </if> - <if test="is_foreign != null"> - is_foreign, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> - <if test="entity_id != null"> - #{entity_id,jdbcType=BIGINT}, - </if> - <if test="view_id != null"> - #{view_id,jdbcType=BIGINT}, - </if> - <if test="name != null"> - #{name,jdbcType=VARCHAR}, - </if> - <if test="data_type != null"> - #{data_type,jdbcType=VARCHAR}, - </if> - <if test="is_primary != null"> - #{is_primary,jdbcType=TINYINT}, - </if> - <if test="is_foreign != null"> - #{is_foreign,jdbcType=TINYINT}, - </if> - </trim> - </insert> - - <delete id="deleteById" parameterType="java.lang.Long"> - delete from attribute - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </delete> - - <update id="updateById" parameterType="com.ic.er.bean.entity.Attribute"> - update attribute - <set> - <if test="entity_id != null"> - entity_id = #{entity_id,jdbcType=BIGINT}, - </if> - <if test="view_id != null"> - view_id = #{view_id,jdbcType=BIGINT}, - </if> - <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, - </if> - <if test="data_type != null"> - data_type = #{data_type,jdbcType=VARCHAR}, - </if> - <if test="is_primary != null"> - is_primary = #{is_primary,jdbcType=TINYINT}, - </if> - <if test="is_foreign != null"> - is_foreign = #{is_foreign,jdbcType=TINYINT}, - </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, - </if> - </set> - where id = #{id,jdbcType=BIGINT} - </update> -</mapper> \ No newline at end of file diff --git a/target/classes/mapper/EntityMapper.xml b/target/classes/mapper/EntityMapper.xml deleted file mode 100644 index 88f6aa74b71a7fe06d16e6744d3cca232f2dbbb5..0000000000000000000000000000000000000000 --- a/target/classes/mapper/EntityMapper.xml +++ /dev/null @@ -1,100 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper - PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.ic.er.dao.EntityMapper"> - - <resultMap id="BaseResultMap" type="com.ic.er.bean.entity.Entity"> - <id column="id" property="id"/> - <result column="name" property="name"/> - <result column="view_id" property="view_id"/> - <result column="is_delete" property="is_delete"/> - <result column="gmt_create" property="gmt_create"/> - <result column="gmt_modefied" property="gmt_modefied"/> - </resultMap> - - <sql id="Base_Column_List"> - id, name, view_id - </sql> - - <select id="selectById" parameterType="java.lang.Long"> - select - id,name,view_id,is_delete,gmt_create,gmt_modefied - from entity - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </select> - - <select id="selectByEntity" parameterType="com.ic.er.bean.entity.Entity"> - select - id,name,view_id,is_delete,gmt_create,gmt_modefied - from entity - where - <trim suffixOverrides=","> - <if test="id != null"> - id = #{id,jdbcType=BIGINT}, - </if> - <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, - </if> - <if test="view_id != null"> - view_id = #{view_id,jdbcType=BIGINT}, - </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, - </if> - <if test="gmt_create != null"> - gmt_create = #{gmt_create,jdbcType=DATETIME}, - </if> - <if test="gmt_modefied != null"> - gmt_modefied = #{gmt_modefied,jdbcType=DATETIME}, - </if> - </trim> - </select> - - <insert id="insert" parameterType="com.ic.er.bean.entity.Entity"> - insert into entity - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> - id, - </if> - <if test="name != null"> - name, - </if> - <if test="view_id != null"> - view_id, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> - <if test="name != null"> - #{name,jdbcType=VARCHAR}, - </if> - <if test="view_id != null"> - #{view_id,jdbcType=BIGINT}, - </if> - </trim> - </insert> - - <delete id="deleteById" parameterType="java.lang.Long"> - delete from entity - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </delete> - - <update id="updateById" parameterType="com.ic.er.bean.entity.Entity"> - update entity - <set> - <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, - </if> - <if test="view_id != null"> - view_id = #{view_id,jdbcType=BIGINT}, - </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, - </if> - </set> - where id = #{id,jdbcType=BIGINT} - </update> -</mapper> \ No newline at end of file diff --git a/target/classes/mapper/RelationshipMapper.xml b/target/classes/mapper/RelationshipMapper.xml deleted file mode 100644 index 330b57ad9e7337d107361fdcbd99b8344d85fe8f..0000000000000000000000000000000000000000 --- a/target/classes/mapper/RelationshipMapper.xml +++ /dev/null @@ -1,165 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper - PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.ic.er.dao.RelationshipMapper"> - - <resultMap id="BaseResultMap" type="com.ic.er.bean.entity.Relationship"> - <id column="id" property="id"/> - <result column="name" property="name"/> - <result column="view_id" property="view_id"/> - <result column="first_entity_id" property="first_entity_id"/> - <result column="second_entity_id" property="second_entity_id"/> - <result column="first_attribute_id" property="first_attribute_id"/> - <result column="second_attribute_id" property="second_attribute_id"/> - <result column="cardinatily" property="cardinatily"/> - <result column="is_delete" property="is_delete"/> - <result column="gmt_create" property="gmt_create"/> - <result column="gmt_modefied" property="gmt_modefied"/> - </resultMap> - - <sql id="Base_Column_List"> - id, name, view_id, first_entity_id, second_entity_id, first_attribute_id, second_attribute_id, cardinatily - </sql> - - <select id="selectById" parameterType="java.lang.Long"> - select - id,name,view_id,first_entity_id,second_entity_id,first_attribute_id,second_attribute_id,cardinality,is_delete,gmt_create,gmt_modefied - from relationship - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </select> - - <select id="selectByRelationship" parameterType="com.ic.er.bean.entity.Relationship"> - select - id,name,view_id,first_entity_id,second_entity_id,first_attribute_id,second_attribute_id,cardinality,is_delete,gmt_create,gmt_modefied - from relationship - where - <trim suffixOverrides=","> - <if test="id != null"> - id = #{id,jdbcType=BIGINT}, - </if> - <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, - </if> - <if test="view_id != null"> - view_id = #{view_id,jdbcType=BIGINT}, - </if> - <if test="first_entity_id != null"> - first_entity_id = #{first_entity_id,jdbcType=BIGINT}, - </if> - <if test="second_entity_id != null"> - second_entity_id = #{second_entity_id,jdbcType=BIGINT}, - </if> - <if test="first_attribute_id != null"> - first_attribute_id = #{first_attribute_id,jdbcType=BIGINT}, - </if> - <if test="second_attribute_id != null"> - second_attribute_id = #{second_attribute_id,jdbcType=BIGINT}, - </if> - <if test="cardinality != null"> - cardinality = #{cardinality,jdbcType=SMALLINT}, - </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, - </if> - <if test="gmt_create != null"> - gmt_create = #{gmt_create,jdbcType=DATETIME}, - </if> - <if test="gmt_modefied != null"> - gmt_modefied = #{gmt_modefied,jdbcType=DATETIME}, - </if> - </trim> - </select> - - <insert id="insert" parameterType="com.ic.er.bean.entity.Relationship"> - insert into relationship - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> - id, - </if> - <if test="name != null"> - name, - </if> - <if test="view_id != null"> - view_id, - </if> - <if test="first_entity_id != null"> - first_entity_id, - </if> - <if test="second_entity_id != null"> - second_entity_id, - </if> - <if test="first_attribute_id != null"> - first_attribute_id, - </if> - <if test="second_attribute_id != null"> - second_attribute_id, - </if> - <if test="cardinality != null"> - cardinality, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> - <if test="name != null"> - #{name,jdbcType=VARCHAR}, - </if> - <if test="view_id != null"> - #{view_id,jdbcType=BIGINT}, - </if> - <if test="first_entity_id != null"> - #{first_entity_id,jdbcType=BIGINT}, - </if> - <if test="second_entity_id != null"> - #{second_entity_id,jdbcType=BIGINT}, - </if> - <if test="first_attribute_id != null"> - #{first_attribute_id,jdbcType=BIGINT}, - </if> - <if test="second_attribute_id != null"> - #{second_attribute_id,jdbcType=BIGINT}, - </if> - <if test="cardinality != null"> - #{cardinality,jdbcType=SMALLINT}, - </if> - </trim> - </insert> - - <delete id="deleteById" parameterType="java.lang.Long"> - delete from relationship - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </delete> - - <update id="updateById" parameterType="com.ic.er.bean.entity.Attribute"> - update attribute - <set> - <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, - </if> - <if test="view_id != null"> - view_id = #{view_id,jdbcType=BIGINT}, - </if> - <if test="first_entity_id != null"> - first_entity_id = #{first_entity_id,jdbcType=BIGINT}, - </if> - <if test="second_entity_id != null"> - second_entity_id = #{second_entity_id,jdbcType=BIGINT}, - </if> - <if test="first_attribute_id != null"> - first_attribute_id = #{first_attribute_id,jdbcType=BIGINT}, - </if> - <if test="second_attribute_id != null"> - second_attribute_id = #{second_attribute_id,jdbcType=BIGINT}, - </if> - <if test="cardinality != null"> - cardinality = #{cardinality,jdbcType=SMALLINT}, - </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, - </if> - </set> - where id = #{id,jdbcType=BIGINT} - </update> -</mapper> \ No newline at end of file diff --git a/target/classes/mapper/ViewMapper.xml b/target/classes/mapper/ViewMapper.xml deleted file mode 100644 index f0b294b1b60a6d4d33ff28b70d918d2c51272427..0000000000000000000000000000000000000000 --- a/target/classes/mapper/ViewMapper.xml +++ /dev/null @@ -1,120 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper - PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.ic.er.dao.ViewMapper"> - - <resultMap id="BaseResultMap" type="com.ic.er.bean.entity.View"> - <id column="id" property="id"/> - <result column="name" property="name"/> - <result column="creator" property="creator"/> - <result column="parent_id" property="parent_id"/> - <result column="is_delete" property="is_delete"/> - <result column="gmt_create" property="gmt_create"/> - <result column="gmt_modefied" property="gmt_modefied"/> - </resultMap> - - <sql id="Base_Column_List"> - id, name, creator, parent_id - </sql> - - <select id="selectAll"> - select - id,name,creator,parent_id,is_delete,gmt_create,gmt_modefied - from view where is_delete = 0 - </select> - - <select id="selectByView" parameterType="com.ic.er.bean.entity.View"> - select - id,name,creator,parent_id,is_delete,gmt_create,gmt_modefied - from view - where - <trim suffixOverrides=","> - <if test="id != null"> - id = #{id,jdbcType=BIGINT}, - </if> - <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, - </if> - <if test="creator != null"> - creator = #{creator,jdbcType=VARCHAR}, - </if> - <if test="parent_id != null"> - parent_id = #{parent_id,jdbcType=BIGINT}, - </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, - </if> - <if test="gmt_create != null"> - gmt_create = #{gmt_create,jdbcType=DATETIME}, - </if> - <if test="gmt_modefied != null"> - gmt_modefied = #{gmt_modefied,jdbcType=DATETIME}, - </if> - </trim> - </select> - - <select id="selectById" parameterType="java.lang.Long"> - select - id,name,creator,parent_id,is_delete,gmt_create,gmt_modefied - from view - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </select> - - <insert id="insert" parameterType="com.ic.er.bean.entity.View"> - insert into view - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> - id, - </if> - <if test="name != null"> - name, - </if> - <if test="creator != null"> - creator, - </if> - <if test="parent_id != null"> - parent_id, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> - <if test="name != null"> - #{name,jdbcType=VARCHAR}, - </if> - <if test="creator != null"> - #{creator,jdbcType=VARCHAR}, - </if> - <if test="parent_id != null"> - #{parent_id,jdbcType=BIGINT}, - </if> - </trim> - </insert> - - <delete id="deleteById" parameterType="java.lang.Long"> - delete from view - where id = #{id,jdbcType=BIGINT} and is_delete = 0 - </delete> - - <update id="updateById" parameterType="com.ic.er.bean.entity.View"> - update view - <set> - <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, - </if> - <if test="creator != null"> - creator = #{creator,jdbcType=VARCHAR}, - </if> - <if test="parent_id != null"> - parent_id = #{parent_id,jdbcType=BIGINT}, - </if> - <if test="is_delete != null"> - is_delete = #{is_delete,jdbcType=TINYINT}, - </if> - </set> - where id = #{id,jdbcType=BIGINT} - </update> - -</mapper> \ No newline at end of file diff --git a/target/classes/templates/delete b/target/classes/templates/delete deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/target/test-classes/com/ic/er/testMybatis.class b/target/test-classes/com/ic/er/testMybatis.class deleted file mode 100644 index 117e45a063fc7338e24a49044c3eb982173172a6..0000000000000000000000000000000000000000 Binary files a/target/test-classes/com/ic/er/testMybatis.class and /dev/null differ