aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvvarvate <vv00489503@techmahindra.com>2018-03-23 19:25:55 +0530
committervvarvate <vv00489503@techmahindra.com>2018-03-23 19:27:59 +0530
commit543004a668263b6d669ffd338b99154d7f91f6a0 (patch)
tree139c817f68a1d6938e9494c066b108eccc81fc99
parent8a4ef574e32c8f42706a863868485a070d85f446 (diff)
SDNC-254 Historical Report Swagger API
sdnc_reports_service Provides REST API for viewing historical reports remotely . Issue-ID: SDNC-254 Change-Id: Ifd1213fcd26d7fd2400a32e1a40649b54059f737 Signed-off-by: vvarvate <vv00489503@techmahindra.com>
-rw-r--r--sdnc_report_api_sdnc_253_story/pom.xml3
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_api/logs/sdnc_report_api.log6
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/.classpath36
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/.gitignore1
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/.project35
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.core.resources.prefs6
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.jdt.core.prefs13
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.wst.common.project.facet.core.xml4
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/logs/sdnc_report_swagger.log4
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/pom.xml208
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/Application.java84
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/ServletInitializer.java27
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/config/JpaApplicationConfig.java62
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/config/SwaggerConfig.java61
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/controller/PreTestController.java147
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/service/IReportService.java47
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/service/ReportServiceImpl.java112
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/application.properties40
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/log4j2.xml39
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/print.css1191
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/reset.css125
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/screen.css1304
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/style.css250
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/typography.css14
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/fonts/DroidSans-Bold.ttfbin0 -> 42477 bytes
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/fonts/DroidSans.ttfbin0 -> 190776 bytes
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/collapse.gifbin0 -> 69 bytes
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/expand.gifbin0 -> 73 bytes
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/explorer_icons.pngbin0 -> 5763 bytes
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/favicon-16x16.pngbin0 -> 645 bytes
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/favicon-32x32.pngbin0 -> 1654 bytes
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/favicon.icobin0 -> 5430 bytes
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/logo_small.pngbin0 -> 770 bytes
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/pet_store_api.pngbin0 -> 824 bytes
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/throbber.gifbin0 -> 9257 bytes
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/wordnik_api.pngbin0 -> 980 bytes
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/index.html122
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/en.js56
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/es.js53
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/fr.js54
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/it.js52
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/ja.js53
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/pl.js53
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/pt.js53
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/ru.js56
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/tr.js53
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/translator.js39
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/zh-cn.js53
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/backbone-min.js15
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/handlebars-2.0.0.js28
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/highlight.7.3.pack.js1
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery-1.8.0.min.js2
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery.ba-bbq.min.js18
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery.slideto.min.js1
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery.wiggle.min.js8
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/js-yaml.min.js3
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jsoneditor.min.js11
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/lodash.min.js102
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/marked.js1272
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/swagger-oauth.js338
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/o2c.html20
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/swagger-ui.js27461
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/swagger-ui.min.js11
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/java/com/onap/sdnc/reports/controller/PreTestControllerTest.java114
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/java/com/onap/sdnc/reports/repository/PreTestConfigRepositoryTest.java145
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/java/com/onap/sdnc/reports/service/ReportServiceImplTest.java205
-rw-r--r--sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/resources/application.properties55
68 files changed, 34329 insertions, 1 deletions
diff --git a/sdnc_report_api_sdnc_253_story/pom.xml b/sdnc_report_api_sdnc_253_story/pom.xml
index 513bcd2..491c008 100644
--- a/sdnc_report_api_sdnc_253_story/pom.xml
+++ b/sdnc_report_api_sdnc_253_story/pom.xml
@@ -17,6 +17,7 @@
<modules>
<module>sdnc_reports_dao</module>
- <module>sdnc_reports_api</module>
+ <module>sdnc_reports_api</module>
+ <module>sdnc_reports_service</module>
</modules>
</project> \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_api/logs/sdnc_report_api.log b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/logs/sdnc_report_api.log
index b03c9dd..9ea32d9 100644
--- a/sdnc_report_api_sdnc_253_story/sdnc_reports_api/logs/sdnc_report_api.log
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_api/logs/sdnc_report_api.log
@@ -19,3 +19,9 @@
2018-03-23 15:47:30.359 INFO INPUHJPC11773 --- [ main] c.o.s.r.ApplicationTest : Context Load Test Succeded
2018-03-23 15:47:33.095 INFO INPUHJPC11773 --- [ main] c.o.s.r.s.ReportServiceImpl : Received Output From Repository Is: [PreTestConfig [testId=0, testName=Network Layer, result=Pass, execuationDetails=Ping Successful, timestamp=Fri Mar 23 15:47:33 IST 2018, device=DeviceConfig [id=0, deviceName=Router, createdon=Mar 23, 2018 3:47:33 PM]]]
2018-03-23 15:47:33.096 INFO INPUHJPC11773 --- [ main] c.o.s.r.s.ReportServiceImpl : Final PreTestConfig List Size : 1
+2018-03-23 19:01:02.925 INFO INPUHJPC11773 --- [ main] c.o.s.r.ApplicationTest : Context Load Test Succeded
+2018-03-23 19:01:05.629 INFO INPUHJPC11773 --- [ main] c.o.s.r.s.ReportServiceImpl : Received Output From Repository Is: [PreTestConfig [testId=0, testName=Network Layer, result=Pass, execuationDetails=Ping Successful, timestamp=Fri Mar 23 19:01:05 IST 2018, device=DeviceConfig [id=0, deviceName=Router, createdon=Mar 23, 2018 7:01:05 PM]]]
+2018-03-23 19:01:05.629 INFO INPUHJPC11773 --- [ main] c.o.s.r.s.ReportServiceImpl : Final PreTestConfig List Size : 1
+2018-03-23 19:02:47.430 INFO INPUHJPC11773 --- [ main] c.o.s.r.ApplicationTest : Context Load Test Succeded
+2018-03-23 19:02:50.480 INFO INPUHJPC11773 --- [ main] c.o.s.r.s.ReportServiceImpl : Received Output From Repository Is: [PreTestConfig [testId=0, testName=Network Layer, result=Pass, execuationDetails=Ping Successful, timestamp=Fri Mar 23 19:02:50 IST 2018, device=DeviceConfig [id=0, deviceName=Router, createdon=Mar 23, 2018 7:02:50 PM]]]
+2018-03-23 19:02:50.480 INFO INPUHJPC11773 --- [ main] c.o.s.r.s.ReportServiceImpl : Final PreTestConfig List Size : 1
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.classpath b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.classpath
new file mode 100644
index 0000000..7e4ca5c
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.classpath
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.gitignore b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.project b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.project
new file mode 100644
index 0000000..090f7f0
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.project
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>sdnc_reports_service</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.springframework.ide.eclipse.core.springbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.springframework.ide.eclipse.core.springnature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription>
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.core.resources.prefs b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..29abf99
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding//src/test/java=UTF-8
+encoding//src/test/resources=UTF-8
+encoding/<project>=UTF-8
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.jdt.core.prefs b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..13b3428
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,13 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.m2e.core.prefs b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.wst.common.project.facet.core.xml b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100644
index 0000000..d858295
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <installed facet="cloudfoundry.standalone.app" version="1.0"/>
+</faceted-project>
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/logs/sdnc_report_swagger.log b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/logs/sdnc_report_swagger.log
new file mode 100644
index 0000000..cd479c7
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/logs/sdnc_report_swagger.log
@@ -0,0 +1,4 @@
+2018-03-23 19:04:38.768 INFO INPUHJPC11773 --- [ restartedMain] c.o.s.r.Application : SDNC REPORTS SWAGGER API Has Started..
+2018-03-23 19:08:59.620 INFO INPUHJPC11773 --- [ restartedMain] c.o.s.r.Application : SDNC REPORTS SWAGGER API Has Started..
+2018-03-23 19:09:19.240 INFO INPUHJPC11773 --- [ restartedMain] c.o.s.r.Application : SDNC REPORTS SWAGGER API Has Started..
+2018-03-23 19:11:09.289 INFO INPUHJPC11773 --- [ restartedMain] c.o.s.r.Application : SDNC REPORTS SWAGGER API Has Started..
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/pom.xml b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/pom.xml
new file mode 100644
index 0000000..a2e7fb8
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/pom.xml
@@ -0,0 +1,208 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>jar</packaging>
+ <artifactId>sdnc_reports_service</artifactId>
+
+ <parent>
+ <groupId>com.sdnc.reports</groupId>
+ <artifactId>sdnc_reports</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <java.version>1.8</java.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.sdnc.reports</groupId>
+ <artifactId>sdnc_reports_dao</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </dependency>
+
+
+ <!-- <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>4.3.9.RELEASE</version>
+ </dependency> -->
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ <version>1.5.3.RELEASE</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ <version>1.4.194</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <version>1.5.4.RELEASE</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-tomcat</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+
+ <groupId>org.springframework.boot</groupId>
+
+ <artifactId>spring-boot-starter-tomcat</artifactId>
+
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-thymeleaf</artifactId>
+ </dependency>
+ <!-- <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </dependency> -->
+
+
+
+ <dependency>
+ <groupId>io.springfox</groupId>
+ <artifactId>springfox-swagger-ui</artifactId>
+ <version>2.2.2</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.springfox</groupId>
+ <artifactId>springfox-swagger2</artifactId>
+ <version>2.2.2</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>1.5.3</version>
+ <!-- <type>bundle</type> -->
+ </dependency>
+
+
+ <!-- <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-actuator</artifactId>
+ </dependency> -->
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.module</groupId>
+ <artifactId>jackson-module-jaxb-annotations</artifactId>
+ <version>2.4.5</version>
+ </dependency>
+
+
+
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-devtools</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-log4j2</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <!-- <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </testResource>
+ </testResources> -->
+
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+
+ <!-- <configuration>
+ <mainClass>${start-class}</mainClass>
+ <layout>ZIP</layout>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions> -->
+ </plugin>
+
+<plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.7.5.201505241946</version>
+ <executions>
+ <!--
+ Prepares the property pointing to the JaCoCo runtime agent which
+ is passed as VM argument when Maven the Surefire plugin is executed.
+ -->
+ <execution>
+ <id>pre-unit-test</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+ <!-- Sets the path to the file which contains the execution data. -->
+ <destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
+ <!--
+ Sets the name of the property containing the settings
+ for JaCoCo runtime agent.
+ -->
+ <propertyName>surefireArgLine</propertyName>
+ </configuration>
+ </execution>
+ <!--
+ Ensures that the code coverage report for unit tests is created after
+ unit tests have been run.
+ -->
+ <execution>
+ <id>post-unit-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ <configuration>
+ <!-- Sets the path to the file which contains the execution data. -->
+ <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
+ <!-- Sets the output directory for the code coverage report. -->
+ <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+</plugin>
+
+ </plugins>
+
+</build>
+</project> \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/Application.java b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/Application.java
new file mode 100644
index 0000000..f0707c0
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/Application.java
@@ -0,0 +1,84 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+package com.onap.sdnc.reports;
+
+import java.util.Collections;
+
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.domain.EntityScan;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import static springfox.documentation.builders.PathSelectors.regex;
+
+@SpringBootApplication
+//@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
+//@EnableSwagger2
+public class Application {
+ private static final Logger logger = LogManager.getLogger(Application.class);
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ logger.info("SDNC REPORTS SWAGGER API Has Started..");
+ }
+
+
+ /*@Bean
+ public Docket api() {
+ return new Docket(DocumentationType.SWAGGER_2)
+ .select()
+ .apis(RequestHandlerSelectors.any())
+ .paths(PathSelectors.any())
+ .build();
+ }*/
+
+
+
+ /* private ApiInfo apiInfo() {
+ return new ApiInfo(
+ "My REST API",
+ "Some custom description of API.",
+ "API TOS",
+ "Terms of service",
+ new Contact("John Doe", "www.example.com", "myeaddress@company.com"),
+ "License of API", "API license URL", Collections.emptyList());
+ }*/
+}
+
+
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/ServletInitializer.java b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/ServletInitializer.java
new file mode 100644
index 0000000..80d5eae
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/ServletInitializer.java
@@ -0,0 +1,27 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+package com.onap.sdnc.reports;
+
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.support.SpringBootServletInitializer;
+
+public class ServletInitializer {
+
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/config/JpaApplicationConfig.java b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/config/JpaApplicationConfig.java
new file mode 100644
index 0000000..d6d9aec
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/config/JpaApplicationConfig.java
@@ -0,0 +1,62 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+package com.onap.sdnc.reports.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.dao.support.PersistenceExceptionTranslator;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.orm.jpa.AbstractEntityManagerFactoryBean;
+import org.springframework.orm.jpa.JpaTransactionManager;
+import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
+import org.springframework.orm.jpa.vendor.OpenJpaDialect;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+//@Configuration
+//@EnableJpaRepositories("com.onap.sdnc.reports.repository")
+//@EnableTransactionManagement
+public class JpaApplicationConfig {
+
+ /*@Bean
+ public AbstractEntityManagerFactoryBean entityManagerFactory()
+ {
+ LocalContainerEntityManagerFactoryBean factory=new LocalContainerEntityManagerFactoryBean();
+ factory.setPackagesToScan("com.onap.sdnc.reports.repository");
+ //factory.setPersistenceUnitName("name");
+ //factory.setPersistenceUnitName("transactions-optional");
+ return factory;
+ }
+
+
+ @Bean
+ public PlatformTransactionManager transactionManager()
+ {
+ JpaTransactionManager jpaTransactionManager=new JpaTransactionManager();
+ jpaTransactionManager.setEntityManagerFactory(entityManagerFactory().getObject());
+ return jpaTransactionManager;
+ }
+
+ @Bean
+ public PersistenceExceptionTranslator persistenceExceptionTranslator()
+ {
+ return new OpenJpaDialect();
+ }*/
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/config/SwaggerConfig.java b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/config/SwaggerConfig.java
new file mode 100644
index 0000000..5117102
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/config/SwaggerConfig.java
@@ -0,0 +1,61 @@
+package com.onap.sdnc.reports.config;
+
+import static springfox.documentation.builders.PathSelectors.regex;
+
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import org.springframework.boot.autoconfigure.domain.EntityScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+@Configuration
+@EnableJpaRepositories("com.onap.sdnc.reports.repository")
+@EntityScan("com.onap.sdnc.reports.*")
+@EnableSwagger2
+//@Profile("!test")
+public class SwaggerConfig {
+
+ @Bean
+ public Docket newsApi() {
+ return new Docket(DocumentationType.SWAGGER_2)
+ .groupName("sdncreport")
+ .apiInfo(apiInfo())
+ .select()
+ .paths(regex("/sdnc/report/.*"))
+ // .paths(PathSelectors.any())
+ .build()
+ .directModelSubstitute(XMLGregorianCalendar.class, MixIn.class);
+ }
+
+ public static interface MixIn {
+ @JsonIgnore
+ public void setYear(int year);
+ }
+
+ /**
+ *
+ * @return
+ */
+ private ApiInfo apiInfo() {
+ return new ApiInfoBuilder()
+ .title("SDNC Report Service REST APIs")
+ .description("SDNC Report Microservice REST APIs")
+ .termsOfServiceUrl("http://....")
+ .contact("TechMahindra")
+ .license("TechMahindra Licensed")
+ .licenseUrl("https://techmahindra.com")
+ .version("2.0")
+ .build();
+ }
+
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/controller/PreTestController.java b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/controller/PreTestController.java
new file mode 100644
index 0000000..cd3fdd3
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/controller/PreTestController.java
@@ -0,0 +1,147 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+package com.onap.sdnc.reports.controller;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.onap.sdnc.reports.model.Report;
+import com.onap.sdnc.reports.model.Response;
+import com.onap.sdnc.reports.repository.DeviceRepository;
+import com.onap.sdnc.reports.rest.model.PreTestModel;
+import com.onap.sdnc.reports.service.IReportService;
+import com.onap.sdnc.reports.service.ReportServiceImpl;
+
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponses;
+import io.swagger.annotations.ApiResponse;
+
+@RestController
+@RequestMapping("/sdnc/report")
+//@RequestMapping("/")
+public class PreTestController {
+
+ private static final Logger logger = LogManager.getLogger(PreTestController.class);
+ @Autowired
+ IReportService reportService;
+
+ @ApiOperation(value = "findReportByDeviceName/{startDate}/{endDate}/{deviceName}", notes = "findReportByDeviceName from specified start date and end date with given deviceName")
+ @ApiResponses(value = { @ApiResponse(code = 200, message = "got successfull"),
+ @ApiResponse(code = 500, message = "Internal Server Error")
+ })
+ //@RequestMapping(value="/findReportByDeviceName/{startDate}/{endDate}/{deviceName}",produces=MediaType.APPLICATION_JSON_VALUE,method=RequestMethod.GET,consumes=("text/plain"))
+ @RequestMapping(value="/findReportByDeviceName/{startDate}/{endDate}/{deviceName}",method=RequestMethod.GET)
+ public List<PreTestModel> findReportByDeviceName(@PathVariable("startDate") long startDate,@PathVariable("endDate") long endDate,@PathVariable("deviceName") String deviceName) {
+
+ try{
+ logger.info("findReportByDeviceName Started Working..");
+ Date sDate=new Date(startDate);
+ Date eDate=new Date(endDate);
+
+ if(sDate.after(eDate) || eDate.before(sDate))
+ {
+ // need to handle this condition
+ }
+ logger.info("findReportByDeviceName Finished Working..");
+ return reportService.findReportByDeviceName(sDate,eDate,deviceName);
+ }
+ catch(Exception ex)
+ {
+ logger.info("Exception Occured : "+ex.getLocalizedMessage());
+ return java.util.Collections.EMPTY_LIST;
+ }
+
+ }
+
+/* @ApiOperation(value = "save users", notes = "save single report at a time")
+ @ApiResponses(value = { @ApiResponse(code = 200, message = "got successfull"),
+ @ApiResponse(code = 500, message = "Internal Server Error")
+ })
+ @RequestMapping(value = "/saveReport", method = RequestMethod.POST,consumes=MediaType.APPLICATION_JSON_VALUE)
+ public void saveReport(@RequestBody Report Report) {
+
+ //repository.save(new Report(Report.getFirstName(), Report.getLastName()));
+ }
+
+ @ApiOperation(value = "findAllReports", notes = "findAllReports from specified start date and end date")
+ @ApiResponses(value = { @ApiResponse(code = 200, message = "got successfull"),
+ @ApiResponse(code = 500, message = "Internal Server Error")
+ })
+ @RequestMapping(value="/findAllReports/{startDate}/{endDate}",produces=MediaType.APPLICATION_JSON_VALUE)
+ public Response findAllReports(@PathVariable("startDate") Date startDate,@PathVariable("endDate") Date endDate) {
+
+ //Iterable<Report> Reports = repository.findAll();
+
+ //return new Response("Done", Reports);
+
+ return reportService.findAllReports(startDate,endDate);
+ }
+
+ @ApiOperation(value = "findReportByTestName", notes = "findReportByTestName from specified start date and end date with given testName")
+ @ApiResponses(value = { @ApiResponse(code = 200, message = "got successfull"),
+ @ApiResponse(code = 500, message = "Internal Server Error")
+ })
+ @RequestMapping(value="/findReportByTestName/{startDate}/{endDate}/{testName}",produces=MediaType.APPLICATION_JSON_VALUE)
+ public Response findReportByTestName(@PathVariable("startDate") Date startDate,@PathVariable("endDate") Date endDate,@PathVariable("testName") String testName) {
+
+
+ return reportService.findReportByTestName(startDate,endDate,testName);
+ }
+
+
+
+ @RequestMapping(value="/findReportsByDeviceNamdAndTestName/{startDate}/{endDate}",produces=MediaType.APPLICATION_JSON_VALUE)
+ public Response findReportsByDeviceNamdAndTestName(@PathVariable("startDate") Date startDate,@PathVariable("endDate") Date endDate,@PathVariable("deviceName") String deviceName,@PathVariable("testName") String testName) {
+
+ return reportService.findReportsByDeviceNamdAndTestName(startDate,endDate,deviceName,testName);
+ }*/
+
+
+
+ /*@ApiOperation(value = "findReportByDeviceName/{startDate}/{endDate}/{deviceName}", notes = "findReportByDeviceName from specified start date and end date with given deviceName")
+ @ApiResponses(value = { @ApiResponse(code = 200, message = "got successfull"),
+ @ApiResponse(code = 500, message = "Internal Server Error")
+ })
+ //@RequestMapping(value="/findReportByDeviceName/{startDate}/{endDate}/{deviceName}",produces=MediaType.APPLICATION_JSON_VALUE,method=RequestMethod.GET,consumes=("text/plain"))
+ @RequestMapping(value="/findReportByDeviceName/{startDate}/{endDate}/{deviceName}",method=RequestMethod.GET)
+ public List<PreTestModel> findReportByDeviceName(@PathVariable("startDate") Date startDate,@PathVariable("endDate") Date endDate,@PathVariable("deviceName") String deviceName) {
+
+ System.out.println("findReportByDeviceName Got Called");
+ //List<Report> Reports = null;//repository.findByLastName(lastName);
+
+ //return new Response("Done", Reports);
+
+ return reportService.findReportByDeviceName(startDate,endDate,deviceName);
+ }*/
+
+
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/service/IReportService.java b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/service/IReportService.java
new file mode 100644
index 0000000..f67c2e4
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/service/IReportService.java
@@ -0,0 +1,47 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+package com.onap.sdnc.reports.service;
+
+import java.util.Date;
+import java.util.List;
+
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import com.onap.sdnc.reports.model.PreTestConfig;
+import com.onap.sdnc.reports.model.Report;
+import com.onap.sdnc.reports.model.Response;
+import com.onap.sdnc.reports.rest.model.PreTestModel;
+
+public interface IReportService {
+
+ public void saveReport(@RequestBody Report Report);
+
+ public Response findAllReports(@PathVariable("startDate") Date startDate,@PathVariable("endDate") Date endDate);
+
+
+ public Response findReportByTestName(@PathVariable("startDate") Date startDate,@PathVariable("endDate") Date endDate,@PathVariable("testName") String testName);
+
+ public List<PreTestModel> findReportByDeviceName(@PathVariable("startDate") Date startDate,@PathVariable("endDate") Date endDate,@RequestParam("deviceName") String deviceName) throws Exception;
+
+ public Response findReportsByDeviceNamdAndTestName(@PathVariable("startDate") Date startDate,@PathVariable("endDate") Date endDate,@PathVariable("deviceName") String deviceName,@PathVariable("testName") String testName);
+
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/service/ReportServiceImpl.java b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/service/ReportServiceImpl.java
new file mode 100644
index 0000000..522c8c8
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/java/com/onap/sdnc/reports/service/ReportServiceImpl.java
@@ -0,0 +1,112 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+package com.onap.sdnc.reports.service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.onap.sdnc.reports.controller.PreTestController;
+import com.onap.sdnc.reports.model.PreTestConfig;
+import com.onap.sdnc.reports.model.Report;
+import com.onap.sdnc.reports.model.Response;
+import com.onap.sdnc.reports.repository.DeviceRepository;
+import com.onap.sdnc.reports.repository.PreTestConfigRepository;
+import com.onap.sdnc.reports.rest.model.PreTestModel;
+
+@Service
+public class ReportServiceImpl implements IReportService {
+
+ private static Logger logger=Logger.getLogger(ReportServiceImpl.class);
+
+ @Autowired
+ DeviceRepository deviceRepository;
+
+ @Autowired
+ PreTestConfigRepository preTestConfigRepository;
+
+ @Override
+ public void saveReport(Report Report) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public Response findAllReports(Date startDate, Date endDate) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Response findReportByTestName(Date startDate, Date endDate, String testName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public List<PreTestModel> findReportByDeviceName(Date startDate, Date endDate, String deviceName) throws Exception{
+ try{
+ List<PreTestConfig> resultSet= preTestConfigRepository.findReportByDeviceName(startDate, endDate, deviceName);
+ logger.info("findReportByDeviceName Received Output : "+resultSet);
+
+ List<PreTestModel> preTestList=new ArrayList<PreTestModel>();
+ for(PreTestConfig config : resultSet)
+ {
+ try{
+ long deviceid=config.getDevice().getId();
+ long testid=config.getTestId();
+ String testName=config.getTestName();
+ String deviName=config.getDevice().getDeviceName();
+ String execuationDetails=config.getExecuationDetails();
+ String result=config.getResult();
+ Date timeStamp=config.getTimestamp();
+
+ PreTestModel model=new PreTestModel(testid, deviceid, testName, deviName, execuationDetails, result, timeStamp);
+ preTestList.add(model);
+ }
+ catch(Exception ex)
+ {
+ logger.info("Exception Occured : "+ex.getLocalizedMessage());
+ }
+ }
+ Response r=new Response("Pass", resultSet);
+ logger.info("Final PreTestConfig List Size : "+preTestList.size());
+ return preTestList;
+ }
+ catch(Exception ex)
+ {
+ logger.info("Exception Occured : "+ex.getLocalizedMessage());
+ throw new Exception(ex);
+ }
+
+ }
+
+ @Override
+ public Response findReportsByDeviceNamdAndTestName(Date startDate, Date endDate, String deviceName,
+ String testName) {
+
+ return null;
+ }
+
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/application.properties b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/application.properties
new file mode 100644
index 0000000..831969a
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/application.properties
@@ -0,0 +1,40 @@
+
+
+server.port = 9003
+
+
+spring.jackson.serialization.fail-on-empty-beans=false
+
+
+
+server.error.whitelabel.enabled=false
+#spring.mvc.view.prefix = /WEB-INF/views/
+#spring.mvc.view.suffix = .jsp
+
+spring.datasource.url=jdbc:mariadb://localhost:3307/testreports
+spring.datasource.username=root
+spring.datasource.password=root
+spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
+spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
+# Keep the connection alive if idle for a long time (needed in production)
+spring.datasource.testWhileIdle=true
+spring.datasource.validationQuery=SELECT 1
+
+
+#spring.datasource.url=jdbc:mysql://localhost:3306/mysql?useSSL=false
+#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+#spring.datasource.name=mysql
+#spring.jpa.database=mysql
+#spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
+
+
+#spring.jpa.generate-ddl=true
+
+# Hibernate
+#hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
+#hibernate.show_sql=true
+#hibernate.hbm2ddl.auto=create
+
+
+
+spring.jpa.show-sql=true \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/log4j2.xml b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..86a227c
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/log4j2.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration status="WARN" monitorInterval="30">
+ <Properties>
+ <Property name="LOG_PATTERN">
+ %d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex
+ </Property>
+ </Properties>
+ <Appenders>
+
+ <!-- <Console name="ConsoleAppender" target="SYSTEM_OUT" follow="true">
+ <PatternLayout pattern="${LOG_PATTERN}"/>
+ </Console> -->
+
+ <!-- Rolling File Appender -->
+ <RollingFile name="FileAppender" fileName="logs/sdnc_report_swagger.log"
+ filePattern="logs/sdnc_report_swagger-%d{yyyy-MM-dd}-%i.log">
+ <PatternLayout>
+ <Pattern>${LOG_PATTERN}</Pattern>
+ </PatternLayout>
+ <Policies>
+ <SizeBasedTriggeringPolicy size="10MB" />
+ </Policies>
+ <DefaultRolloverStrategy max="10"/>
+ </RollingFile>
+
+ </Appenders>
+
+ <Loggers>
+ <Logger name="com.onap.sdnc.reports" level="debug" additivity="false">
+ <AppenderRef ref="FileAppender" />
+ </Logger>
+
+
+ <Root level="debug">
+ <!-- <AppenderRef ref="ConsoleAppender" /> -->
+ <AppenderRef ref="FileAppender"/>
+ </Root>
+ </Loggers>
+</Configuration> \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/print.css b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/print.css
new file mode 100644
index 0000000..daae7a2
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/print.css
@@ -0,0 +1,1191 @@
+/* Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> */
+.swagger-section pre code {
+ display: block;
+ padding: 0.5em;
+ background: #F0F0F0;
+}
+.swagger-section pre code,
+.swagger-section pre .subst,
+.swagger-section pre .tag .title,
+.swagger-section pre .lisp .title,
+.swagger-section pre .clojure .built_in,
+.swagger-section pre .nginx .title {
+ color: black;
+}
+.swagger-section pre .string,
+.swagger-section pre .title,
+.swagger-section pre .constant,
+.swagger-section pre .parent,
+.swagger-section pre .tag .value,
+.swagger-section pre .rules .value,
+.swagger-section pre .rules .value .number,
+.swagger-section pre .preprocessor,
+.swagger-section pre .ruby .symbol,
+.swagger-section pre .ruby .symbol .string,
+.swagger-section pre .aggregate,
+.swagger-section pre .template_tag,
+.swagger-section pre .django .variable,
+.swagger-section pre .smalltalk .class,
+.swagger-section pre .addition,
+.swagger-section pre .flow,
+.swagger-section pre .stream,
+.swagger-section pre .bash .variable,
+.swagger-section pre .apache .tag,
+.swagger-section pre .apache .cbracket,
+.swagger-section pre .tex .command,
+.swagger-section pre .tex .special,
+.swagger-section pre .erlang_repl .function_or_atom,
+.swagger-section pre .markdown .header {
+ color: #800;
+}
+.swagger-section pre .comment,
+.swagger-section pre .annotation,
+.swagger-section pre .template_comment,
+.swagger-section pre .diff .header,
+.swagger-section pre .chunk,
+.swagger-section pre .markdown .blockquote {
+ color: #888;
+}
+.swagger-section pre .number,
+.swagger-section pre .date,
+.swagger-section pre .regexp,
+.swagger-section pre .literal,
+.swagger-section pre .smalltalk .symbol,
+.swagger-section pre .smalltalk .char,
+.swagger-section pre .go .constant,
+.swagger-section pre .change,
+.swagger-section pre .markdown .bullet,
+.swagger-section pre .markdown .link_url {
+ color: #080;
+}
+.swagger-section pre .label,
+.swagger-section pre .javadoc,
+.swagger-section pre .ruby .string,
+.swagger-section pre .decorator,
+.swagger-section pre .filter .argument,
+.swagger-section pre .localvars,
+.swagger-section pre .array,
+.swagger-section pre .attr_selector,
+.swagger-section pre .important,
+.swagger-section pre .pseudo,
+.swagger-section pre .pi,
+.swagger-section pre .doctype,
+.swagger-section pre .deletion,
+.swagger-section pre .envvar,
+.swagger-section pre .shebang,
+.swagger-section pre .apache .sqbracket,
+.swagger-section pre .nginx .built_in,
+.swagger-section pre .tex .formula,
+.swagger-section pre .erlang_repl .reserved,
+.swagger-section pre .prompt,
+.swagger-section pre .markdown .link_label,
+.swagger-section pre .vhdl .attribute,
+.swagger-section pre .clojure .attribute,
+.swagger-section pre .coffeescript .property {
+ color: #8888ff;
+}
+.swagger-section pre .keyword,
+.swagger-section pre .id,
+.swagger-section pre .phpdoc,
+.swagger-section pre .title,
+.swagger-section pre .built_in,
+.swagger-section pre .aggregate,
+.swagger-section pre .css .tag,
+.swagger-section pre .javadoctag,
+.swagger-section pre .phpdoc,
+.swagger-section pre .yardoctag,
+.swagger-section pre .smalltalk .class,
+.swagger-section pre .winutils,
+.swagger-section pre .bash .variable,
+.swagger-section pre .apache .tag,
+.swagger-section pre .go .typename,
+.swagger-section pre .tex .command,
+.swagger-section pre .markdown .strong,
+.swagger-section pre .request,
+.swagger-section pre .status {
+ font-weight: bold;
+}
+.swagger-section pre .markdown .emphasis {
+ font-style: italic;
+}
+.swagger-section pre .nginx .built_in {
+ font-weight: normal;
+}
+.swagger-section pre .coffeescript .javascript,
+.swagger-section pre .javascript .xml,
+.swagger-section pre .tex .formula,
+.swagger-section pre .xml .javascript,
+.swagger-section pre .xml .vbscript,
+.swagger-section pre .xml .css,
+.swagger-section pre .xml .cdata {
+ opacity: 0.5;
+}
+.swagger-section .swagger-ui-wrap {
+ line-height: 1;
+ font-family: "Droid Sans", sans-serif;
+ max-width: 960px;
+ margin-left: auto;
+ margin-right: auto;
+ /* JSONEditor specific styling */
+}
+.swagger-section .swagger-ui-wrap b,
+.swagger-section .swagger-ui-wrap strong {
+ font-family: "Droid Sans", sans-serif;
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap q,
+.swagger-section .swagger-ui-wrap blockquote {
+ quotes: none;
+}
+.swagger-section .swagger-ui-wrap p {
+ line-height: 1.4em;
+ padding: 0 0 10px;
+ color: #333333;
+}
+.swagger-section .swagger-ui-wrap q:before,
+.swagger-section .swagger-ui-wrap q:after,
+.swagger-section .swagger-ui-wrap blockquote:before,
+.swagger-section .swagger-ui-wrap blockquote:after {
+ content: none;
+}
+.swagger-section .swagger-ui-wrap .heading_with_menu h1,
+.swagger-section .swagger-ui-wrap .heading_with_menu h2,
+.swagger-section .swagger-ui-wrap .heading_with_menu h3,
+.swagger-section .swagger-ui-wrap .heading_with_menu h4,
+.swagger-section .swagger-ui-wrap .heading_with_menu h5,
+.swagger-section .swagger-ui-wrap .heading_with_menu h6 {
+ display: block;
+ clear: none;
+ float: left;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+ width: 60%;
+}
+.swagger-section .swagger-ui-wrap table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+.swagger-section .swagger-ui-wrap table thead tr th {
+ padding: 5px;
+ font-size: 0.9em;
+ color: #666666;
+ border-bottom: 1px solid #999999;
+}
+.swagger-section .swagger-ui-wrap table tbody tr:last-child td {
+ border-bottom: none;
+}
+.swagger-section .swagger-ui-wrap table tbody tr.offset {
+ background-color: #f0f0f0;
+}
+.swagger-section .swagger-ui-wrap table tbody tr td {
+ padding: 6px;
+ font-size: 0.9em;
+ border-bottom: 1px solid #cccccc;
+ vertical-align: top;
+ line-height: 1.3em;
+}
+.swagger-section .swagger-ui-wrap ol {
+ margin: 0px 0 10px;
+ padding: 0 0 0 18px;
+ list-style-type: decimal;
+}
+.swagger-section .swagger-ui-wrap ol li {
+ padding: 5px 0px;
+ font-size: 0.9em;
+ color: #333333;
+}
+.swagger-section .swagger-ui-wrap ol,
+.swagger-section .swagger-ui-wrap ul {
+ list-style: none;
+}
+.swagger-section .swagger-ui-wrap h1 a,
+.swagger-section .swagger-ui-wrap h2 a,
+.swagger-section .swagger-ui-wrap h3 a,
+.swagger-section .swagger-ui-wrap h4 a,
+.swagger-section .swagger-ui-wrap h5 a,
+.swagger-section .swagger-ui-wrap h6 a {
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap h1 a:hover,
+.swagger-section .swagger-ui-wrap h2 a:hover,
+.swagger-section .swagger-ui-wrap h3 a:hover,
+.swagger-section .swagger-ui-wrap h4 a:hover,
+.swagger-section .swagger-ui-wrap h5 a:hover,
+.swagger-section .swagger-ui-wrap h6 a:hover {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap h1 span.divider,
+.swagger-section .swagger-ui-wrap h2 span.divider,
+.swagger-section .swagger-ui-wrap h3 span.divider,
+.swagger-section .swagger-ui-wrap h4 span.divider,
+.swagger-section .swagger-ui-wrap h5 span.divider,
+.swagger-section .swagger-ui-wrap h6 span.divider {
+ color: #aaaaaa;
+}
+.swagger-section .swagger-ui-wrap a {
+ color: #547f00;
+}
+.swagger-section .swagger-ui-wrap a img {
+ border: none;
+}
+.swagger-section .swagger-ui-wrap article,
+.swagger-section .swagger-ui-wrap aside,
+.swagger-section .swagger-ui-wrap details,
+.swagger-section .swagger-ui-wrap figcaption,
+.swagger-section .swagger-ui-wrap figure,
+.swagger-section .swagger-ui-wrap footer,
+.swagger-section .swagger-ui-wrap header,
+.swagger-section .swagger-ui-wrap hgroup,
+.swagger-section .swagger-ui-wrap menu,
+.swagger-section .swagger-ui-wrap nav,
+.swagger-section .swagger-ui-wrap section,
+.swagger-section .swagger-ui-wrap summary {
+ display: block;
+}
+.swagger-section .swagger-ui-wrap pre {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ background-color: #fcf6db;
+ border: 1px solid #e5e0c6;
+ padding: 10px;
+}
+.swagger-section .swagger-ui-wrap pre code {
+ line-height: 1.6em;
+ background: none;
+}
+.swagger-section .swagger-ui-wrap .content > .content-type > div > label {
+ clear: both;
+ display: block;
+ color: #0F6AB4;
+ font-size: 1.1em;
+ margin: 0;
+ padding: 15px 0 5px;
+}
+.swagger-section .swagger-ui-wrap .content pre {
+ font-size: 12px;
+ margin-top: 5px;
+ padding: 5px;
+}
+.swagger-section .swagger-ui-wrap .icon-btn {
+ cursor: pointer;
+}
+.swagger-section .swagger-ui-wrap .info_title {
+ padding-bottom: 10px;
+ font-weight: bold;
+ font-size: 25px;
+}
+.swagger-section .swagger-ui-wrap .footer {
+ margin-top: 20px;
+}
+.swagger-section .swagger-ui-wrap p.big,
+.swagger-section .swagger-ui-wrap div.big p {
+ font-size: 1em;
+ margin-bottom: 10px;
+}
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input,
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input,
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea,
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input {
+ width: 500px !important;
+}
+.swagger-section .swagger-ui-wrap .info_license {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_tos {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .message-fail {
+ color: #cc0000;
+}
+.swagger-section .swagger-ui-wrap .info_url {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_email {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_name {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_description {
+ padding-bottom: 10px;
+ font-size: 15px;
+}
+.swagger-section .swagger-ui-wrap .markdown ol li,
+.swagger-section .swagger-ui-wrap .markdown ul li {
+ padding: 3px 0px;
+ line-height: 1.4em;
+ color: #333333;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input {
+ display: block;
+ padding: 4px;
+ width: auto;
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title {
+ font-size: 1.3em;
+}
+.swagger-section .swagger-ui-wrap table.fullwidth {
+ width: 100%;
+}
+.swagger-section .swagger-ui-wrap .model-signature {
+ font-family: "Droid Sans", sans-serif;
+ font-size: 1em;
+ line-height: 1.5em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-nav a {
+ text-decoration: none;
+ color: #AAA;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover {
+ text-decoration: underline;
+ color: black;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected {
+ color: black;
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propType {
+ color: #5555aa;
+}
+.swagger-section .swagger-ui-wrap .model-signature pre:hover {
+ background-color: #ffffdd;
+}
+.swagger-section .swagger-ui-wrap .model-signature pre {
+ font-size: .85em;
+ line-height: 1.2em;
+ overflow: auto;
+ max-height: 200px;
+ cursor: pointer;
+}
+.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
+ display: block;
+ min-width: 230px;
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child {
+ padding-right: 0;
+ border-right: none;
+}
+.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li {
+ float: left;
+ margin: 0 5px 5px 0;
+ padding: 2px 5px 2px 0;
+ border-right: 1px solid #ddd;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propOpt {
+ color: #555;
+}
+.swagger-section .swagger-ui-wrap .model-signature .snippet small {
+ font-size: 0.75em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propOptKey {
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .strong {
+ font-weight: bold;
+ color: #000;
+ font-size: .9em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description div {
+ font-size: 0.9em;
+ line-height: 1.5em;
+ margin-left: 1em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .stronger {
+ font-weight: bold;
+ color: #000;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper {
+ border-spacing: 0;
+ position: absolute;
+ background-color: #ffffff;
+ border: 1px solid #bbbbbb;
+ display: none;
+ font-size: 11px;
+ max-width: 400px;
+ line-height: 30px;
+ color: black;
+ padding: 5px;
+ margin-left: 10px;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th {
+ text-align: center;
+ background-color: #eeeeee;
+ border: 1px solid #bbbbbb;
+ font-size: 11px;
+ color: #666666;
+ font-weight: bold;
+ padding: 5px;
+ line-height: 15px;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName {
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child,
+.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child {
+ display: inline;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before {
+ display: block;
+ content: '';
+}
+.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child {
+ margin-right: -3px;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propName {
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-container {
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap .body-textarea {
+ width: 300px;
+ height: 100px;
+ border: 1px solid #aaa;
+}
+.swagger-section .swagger-ui-wrap .markdown p code,
+.swagger-section .swagger-ui-wrap .markdown li code {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ background-color: #f0f0f0;
+ color: black;
+ padding: 1px 3px;
+}
+.swagger-section .swagger-ui-wrap .required {
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .editor_holder {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap .editor_holder label {
+ font-weight: normal!important;
+ /* JSONEditor uses bold by default for all labels, we revert that back to normal to not give the impression that by default fields are required */
+}
+.swagger-section .swagger-ui-wrap .editor_holder label.required {
+ font-weight: bold!important;
+}
+.swagger-section .swagger-ui-wrap input.parameter {
+ width: 300px;
+ border: 1px solid #aaa;
+}
+.swagger-section .swagger-ui-wrap h1 {
+ color: black;
+ font-size: 1.5em;
+ line-height: 1.3em;
+ padding: 10px 0 10px 0;
+ font-family: "Droid Sans", sans-serif;
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .heading_with_menu {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap .heading_with_menu ul {
+ display: block;
+ clear: none;
+ float: right;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+ margin-top: 10px;
+}
+.swagger-section .swagger-ui-wrap h2 {
+ color: black;
+ font-size: 1.3em;
+ padding: 10px 0 10px 0;
+}
+.swagger-section .swagger-ui-wrap h2 a {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap h2 span.sub {
+ font-size: 0.7em;
+ color: #999999;
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap h2 span.sub a {
+ color: #777777;
+}
+.swagger-section .swagger-ui-wrap span.weak {
+ color: #666666;
+}
+.swagger-section .swagger-ui-wrap .message-success {
+ color: #89BF04;
+}
+.swagger-section .swagger-ui-wrap caption,
+.swagger-section .swagger-ui-wrap th,
+.swagger-section .swagger-ui-wrap td {
+ text-align: left;
+ font-weight: normal;
+ vertical-align: middle;
+}
+.swagger-section .swagger-ui-wrap .code {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea {
+ font-family: "Droid Sans", sans-serif;
+ height: 250px;
+ padding: 4px;
+ display: block;
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select {
+ display: block;
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label {
+ display: block;
+ float: left;
+ clear: none;
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input {
+ display: block;
+ float: left;
+ clear: none;
+ margin: 0 5px 0 0;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label {
+ display: block;
+ clear: both;
+ width: auto;
+ padding: 0 0 3px;
+ color: #666666;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr {
+ padding-left: 3px;
+ color: #888888;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints {
+ margin-left: 0;
+ font-style: italic;
+ font-size: 0.9em;
+ margin: 0;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons {
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap span.blank,
+.swagger-section .swagger-ui-wrap span.empty {
+ color: #888888;
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap .markdown h3 {
+ color: #547f00;
+}
+.swagger-section .swagger-ui-wrap .markdown h4 {
+ color: #666666;
+}
+.swagger-section .swagger-ui-wrap .markdown pre {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ background-color: #fcf6db;
+ border: 1px solid #e5e0c6;
+ padding: 10px;
+ margin: 0 0 10px 0;
+}
+.swagger-section .swagger-ui-wrap .markdown pre code {
+ line-height: 1.6em;
+}
+.swagger-section .swagger-ui-wrap div.gist {
+ margin: 20px 0 25px 0 !important;
+}
+.swagger-section .swagger-ui-wrap ul#resources {
+ font-family: "Droid Sans", sans-serif;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource {
+ border-bottom: 1px solid #dddddd;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a,
+.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a,
+.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a {
+ color: #555555;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child {
+ border-bottom: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading {
+ border: 1px solid transparent;
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options {
+ overflow: hidden;
+ padding: 0;
+ display: block;
+ clear: none;
+ float: right;
+ margin: 14px 10px 0 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li {
+ float: left;
+ clear: none;
+ margin: 0;
+ padding: 2px 10px;
+ border-right: 1px solid #dddddd;
+ color: #666666;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a {
+ color: #aaaaaa;
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover {
+ text-decoration: underline;
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last {
+ padding-right: 0;
+ border-right: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
+ color: #999999;
+ padding-left: 0;
+ display: block;
+ clear: none;
+ float: left;
+ font-family: "Droid Sans", sans-serif;
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a {
+ color: #999999;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+ margin: 0 0 10px;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 {
+ display: block;
+ clear: none;
+ float: left;
+ width: auto;
+ margin: 0;
+ padding: 0;
+ line-height: 1.1em;
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path {
+ padding-left: 10px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a {
+ color: black;
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a.toggleOperation.deprecated {
+ text-decoration: line-through;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a {
+ text-transform: uppercase;
+ text-decoration: none;
+ color: white;
+ display: inline-block;
+ width: 50px;
+ font-size: 0.7em;
+ text-align: center;
+ padding: 7px 0 4px;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+ -o-border-radius: 2px;
+ -ms-border-radius: 2px;
+ -khtml-border-radius: 2px;
+ border-radius: 2px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span {
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options {
+ overflow: hidden;
+ padding: 0;
+ display: block;
+ clear: none;
+ float: right;
+ margin: 6px 10px 0 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li {
+ float: left;
+ clear: none;
+ margin: 0;
+ padding: 2px 10px;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a {
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content {
+ border-top: none;
+ padding: 10px;
+ -moz-border-radius-bottomleft: 6px;
+ -webkit-border-bottom-left-radius: 6px;
+ -o-border-bottom-left-radius: 6px;
+ -ms-border-bottom-left-radius: 6px;
+ -khtml-border-bottom-left-radius: 6px;
+ border-bottom-left-radius: 6px;
+ -moz-border-radius-bottomright: 6px;
+ -webkit-border-bottom-right-radius: 6px;
+ -o-border-bottom-right-radius: 6px;
+ -ms-border-bottom-right-radius: 6px;
+ -khtml-border-bottom-right-radius: 6px;
+ border-bottom-right-radius: 6px;
+ margin: 0 0 20px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 {
+ font-size: 1.1em;
+ margin: 0;
+ padding: 15px 0 5px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a {
+ padding: 4px 0 0 10px;
+ display: inline-block;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit {
+ display: block;
+ clear: none;
+ float: left;
+ padding: 6px 8px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber {
+ background-image: url('../images/throbber.gif');
+ width: 128px;
+ height: 16px;
+ display: block;
+ clear: none;
+ float: right;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error {
+ outline: 2px solid black;
+ outline-color: #cc0000;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] {
+ max-width: 300px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ padding: 10px;
+ font-size: 0.9em;
+ max-height: 400px;
+ overflow-y: auto;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading {
+ background-color: #f9f2e9;
+ border: 1px solid #f0e0ca;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a {
+ background-color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #f0e0ca;
+ color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a {
+ color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content {
+ background-color: #faf5ee;
+ border: 1px solid #f0e0ca;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 {
+ color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a {
+ color: #dcb67f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading {
+ background-color: #fcffcd;
+ border: 1px solid black;
+ border-color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a {
+ text-transform: uppercase;
+ background-color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #ffd20f;
+ color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a {
+ color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content {
+ background-color: #fcffcd;
+ border: 1px solid black;
+ border-color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 {
+ color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a {
+ color: #6fc992;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading {
+ background-color: #f5e8e8;
+ border: 1px solid #e8c6c7;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a {
+ text-transform: uppercase;
+ background-color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #e8c6c7;
+ color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a {
+ color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
+ background-color: #f7eded;
+ border: 1px solid #e8c6c7;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 {
+ color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a {
+ color: #c8787a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading {
+ background-color: #e7f6ec;
+ border: 1px solid #c3e8d1;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a {
+ background-color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #c3e8d1;
+ color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a {
+ color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content {
+ background-color: #ebf7f0;
+ border: 1px solid #c3e8d1;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 {
+ color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a {
+ color: #6fc992;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading {
+ background-color: #FCE9E3;
+ border: 1px solid #F5D5C3;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a {
+ background-color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #f0cecb;
+ color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a {
+ color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content {
+ background-color: #faf0ef;
+ border: 1px solid #f0cecb;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 {
+ color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a {
+ color: #dcb67f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading {
+ background-color: #e7f0f7;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a {
+ background-color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #c3d9ec;
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content {
+ background-color: #ebf3f9;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a {
+ color: #6fa5d2;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading {
+ background-color: #e7f0f7;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a {
+ background-color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #c3d9ec;
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content {
+ background-color: #ebf3f9;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a {
+ color: #6fa5d2;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
+ border-top: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last {
+ padding-right: 0;
+ border-right: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap p#colophon {
+ margin: 0 15px 40px 15px;
+ padding: 10px 0;
+ font-size: 0.8em;
+ border-top: 1px solid #dddddd;
+ font-family: "Droid Sans", sans-serif;
+ color: #999999;
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap p#colophon a {
+ text-decoration: none;
+ color: #547f00;
+}
+.swagger-section .swagger-ui-wrap h3 {
+ color: black;
+ font-size: 1.1em;
+ padding: 10px 0 10px 0;
+}
+.swagger-section .swagger-ui-wrap .markdown ol,
+.swagger-section .swagger-ui-wrap .markdown ul {
+ font-family: "Droid Sans", sans-serif;
+ margin: 5px 0 10px;
+ padding: 0 0 0 18px;
+ list-style-type: disc;
+}
+.swagger-section .swagger-ui-wrap form.form_box {
+ background-color: #ebf3f9;
+ border: 1px solid #c3d9ec;
+ padding: 10px;
+}
+.swagger-section .swagger-ui-wrap form.form_box label {
+ color: #0f6ab4 !important;
+}
+.swagger-section .swagger-ui-wrap form.form_box input[type=submit] {
+ display: block;
+ padding: 10px;
+}
+.swagger-section .swagger-ui-wrap form.form_box p.weak {
+ font-size: 0.8em;
+}
+.swagger-section .swagger-ui-wrap form.form_box p {
+ font-size: 0.9em;
+ padding: 0 0 15px;
+ color: #7e7b6d;
+}
+.swagger-section .swagger-ui-wrap form.form_box p a {
+ color: #646257;
+}
+.swagger-section .swagger-ui-wrap form.form_box p strong {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
+ padding-bottom: 0;
+}
+.swagger-section .title {
+ font-style: bold;
+}
+.swagger-section .secondary_form {
+ display: none;
+}
+.swagger-section .main_image {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+.swagger-section .oauth_body {
+ margin-left: 100px;
+ margin-right: 100px;
+}
+.swagger-section .oauth_submit {
+ text-align: center;
+}
+.swagger-section .api-popup-dialog {
+ z-index: 10000;
+ position: absolute;
+ width: 500px;
+ background: #FFF;
+ padding: 20px;
+ border: 1px solid #ccc;
+ border-radius: 5px;
+ display: none;
+ font-size: 13px;
+ color: #777;
+}
+.swagger-section .api-popup-dialog .api-popup-title {
+ font-size: 24px;
+ padding: 10px 0;
+}
+.swagger-section .api-popup-dialog .api-popup-title {
+ font-size: 24px;
+ padding: 10px 0;
+}
+.swagger-section .api-popup-dialog .error-msg {
+ padding-left: 5px;
+ padding-bottom: 5px;
+}
+.swagger-section .api-popup-dialog .api-popup-authbtn {
+ height: 30px;
+}
+.swagger-section .api-popup-dialog .api-popup-cancel {
+ height: 30px;
+}
+.swagger-section .api-popup-scopes {
+ padding: 10px 20px;
+}
+.swagger-section .api-popup-scopes li {
+ padding: 5px 0;
+ line-height: 20px;
+}
+.swagger-section .api-popup-scopes li input {
+ position: relative;
+ top: 2px;
+}
+.swagger-section .api-popup-scopes .api-scope-desc {
+ padding-left: 20px;
+ font-style: italic;
+}
+.swagger-section .api-popup-actions {
+ padding-top: 10px;
+}
+#header {
+ display: none;
+}
+.swagger-section .swagger-ui-wrap .model-signature pre {
+ max-height: none;
+}
+.swagger-section .swagger-ui-wrap .body-textarea {
+ width: 100px;
+}
+.swagger-section .swagger-ui-wrap input.parameter {
+ width: 100px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options {
+ display: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints {
+ display: block !important;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content {
+ display: block !important;
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/reset.css b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/reset.css
new file mode 100644
index 0000000..b2b0789
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/reset.css
@@ -0,0 +1,125 @@
+/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */
+html,
+body,
+div,
+span,
+applet,
+object,
+iframe,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+p,
+blockquote,
+pre,
+a,
+abbr,
+acronym,
+address,
+big,
+cite,
+code,
+del,
+dfn,
+em,
+img,
+ins,
+kbd,
+q,
+s,
+samp,
+small,
+strike,
+strong,
+sub,
+sup,
+tt,
+var,
+b,
+u,
+i,
+center,
+dl,
+dt,
+dd,
+ol,
+ul,
+li,
+fieldset,
+form,
+label,
+legend,
+table,
+caption,
+tbody,
+tfoot,
+thead,
+tr,
+th,
+td,
+article,
+aside,
+canvas,
+details,
+embed,
+figure,
+figcaption,
+footer,
+header,
+hgroup,
+menu,
+nav,
+output,
+ruby,
+section,
+summary,
+time,
+mark,
+audio,
+video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+menu,
+nav,
+section {
+ display: block;
+}
+body {
+ line-height: 1;
+}
+ol,
+ul {
+ list-style: none;
+}
+blockquote,
+q {
+ quotes: none;
+}
+blockquote:before,
+blockquote:after,
+q:before,
+q:after {
+ content: '';
+ content: none;
+}
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/screen.css b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/screen.css
new file mode 100644
index 0000000..725bab8
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/screen.css
@@ -0,0 +1,1304 @@
+/* Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> */
+.swagger-section pre code {
+ display: block;
+ padding: 0.5em;
+ background: #F0F0F0;
+}
+.swagger-section pre code,
+.swagger-section pre .subst,
+.swagger-section pre .tag .title,
+.swagger-section pre .lisp .title,
+.swagger-section pre .clojure .built_in,
+.swagger-section pre .nginx .title {
+ color: black;
+}
+.swagger-section pre .string,
+.swagger-section pre .title,
+.swagger-section pre .constant,
+.swagger-section pre .parent,
+.swagger-section pre .tag .value,
+.swagger-section pre .rules .value,
+.swagger-section pre .rules .value .number,
+.swagger-section pre .preprocessor,
+.swagger-section pre .ruby .symbol,
+.swagger-section pre .ruby .symbol .string,
+.swagger-section pre .aggregate,
+.swagger-section pre .template_tag,
+.swagger-section pre .django .variable,
+.swagger-section pre .smalltalk .class,
+.swagger-section pre .addition,
+.swagger-section pre .flow,
+.swagger-section pre .stream,
+.swagger-section pre .bash .variable,
+.swagger-section pre .apache .tag,
+.swagger-section pre .apache .cbracket,
+.swagger-section pre .tex .command,
+.swagger-section pre .tex .special,
+.swagger-section pre .erlang_repl .function_or_atom,
+.swagger-section pre .markdown .header {
+ color: #800;
+}
+.swagger-section pre .comment,
+.swagger-section pre .annotation,
+.swagger-section pre .template_comment,
+.swagger-section pre .diff .header,
+.swagger-section pre .chunk,
+.swagger-section pre .markdown .blockquote {
+ color: #888;
+}
+.swagger-section pre .number,
+.swagger-section pre .date,
+.swagger-section pre .regexp,
+.swagger-section pre .literal,
+.swagger-section pre .smalltalk .symbol,
+.swagger-section pre .smalltalk .char,
+.swagger-section pre .go .constant,
+.swagger-section pre .change,
+.swagger-section pre .markdown .bullet,
+.swagger-section pre .markdown .link_url {
+ color: #080;
+}
+.swagger-section pre .label,
+.swagger-section pre .javadoc,
+.swagger-section pre .ruby .string,
+.swagger-section pre .decorator,
+.swagger-section pre .filter .argument,
+.swagger-section pre .localvars,
+.swagger-section pre .array,
+.swagger-section pre .attr_selector,
+.swagger-section pre .important,
+.swagger-section pre .pseudo,
+.swagger-section pre .pi,
+.swagger-section pre .doctype,
+.swagger-section pre .deletion,
+.swagger-section pre .envvar,
+.swagger-section pre .shebang,
+.swagger-section pre .apache .sqbracket,
+.swagger-section pre .nginx .built_in,
+.swagger-section pre .tex .formula,
+.swagger-section pre .erlang_repl .reserved,
+.swagger-section pre .prompt,
+.swagger-section pre .markdown .link_label,
+.swagger-section pre .vhdl .attribute,
+.swagger-section pre .clojure .attribute,
+.swagger-section pre .coffeescript .property {
+ color: #8888ff;
+}
+.swagger-section pre .keyword,
+.swagger-section pre .id,
+.swagger-section pre .phpdoc,
+.swagger-section pre .title,
+.swagger-section pre .built_in,
+.swagger-section pre .aggregate,
+.swagger-section pre .css .tag,
+.swagger-section pre .javadoctag,
+.swagger-section pre .phpdoc,
+.swagger-section pre .yardoctag,
+.swagger-section pre .smalltalk .class,
+.swagger-section pre .winutils,
+.swagger-section pre .bash .variable,
+.swagger-section pre .apache .tag,
+.swagger-section pre .go .typename,
+.swagger-section pre .tex .command,
+.swagger-section pre .markdown .strong,
+.swagger-section pre .request,
+.swagger-section pre .status {
+ font-weight: bold;
+}
+.swagger-section pre .markdown .emphasis {
+ font-style: italic;
+}
+.swagger-section pre .nginx .built_in {
+ font-weight: normal;
+}
+.swagger-section pre .coffeescript .javascript,
+.swagger-section pre .javascript .xml,
+.swagger-section pre .tex .formula,
+.swagger-section pre .xml .javascript,
+.swagger-section pre .xml .vbscript,
+.swagger-section pre .xml .css,
+.swagger-section pre .xml .cdata {
+ opacity: 0.5;
+}
+.swagger-section .swagger-ui-wrap {
+ line-height: 1;
+ font-family: "Droid Sans", sans-serif;
+ max-width: 960px;
+ margin-left: auto;
+ margin-right: auto;
+ /* JSONEditor specific styling */
+}
+.swagger-section .swagger-ui-wrap b,
+.swagger-section .swagger-ui-wrap strong {
+ font-family: "Droid Sans", sans-serif;
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap q,
+.swagger-section .swagger-ui-wrap blockquote {
+ quotes: none;
+}
+.swagger-section .swagger-ui-wrap p {
+ line-height: 1.4em;
+ padding: 0 0 10px;
+ color: #333333;
+}
+.swagger-section .swagger-ui-wrap q:before,
+.swagger-section .swagger-ui-wrap q:after,
+.swagger-section .swagger-ui-wrap blockquote:before,
+.swagger-section .swagger-ui-wrap blockquote:after {
+ content: none;
+}
+.swagger-section .swagger-ui-wrap .heading_with_menu h1,
+.swagger-section .swagger-ui-wrap .heading_with_menu h2,
+.swagger-section .swagger-ui-wrap .heading_with_menu h3,
+.swagger-section .swagger-ui-wrap .heading_with_menu h4,
+.swagger-section .swagger-ui-wrap .heading_with_menu h5,
+.swagger-section .swagger-ui-wrap .heading_with_menu h6 {
+ display: block;
+ clear: none;
+ float: left;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+ width: 60%;
+}
+.swagger-section .swagger-ui-wrap table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+.swagger-section .swagger-ui-wrap table thead tr th {
+ padding: 5px;
+ font-size: 0.9em;
+ color: #666666;
+ border-bottom: 1px solid #999999;
+}
+.swagger-section .swagger-ui-wrap table tbody tr:last-child td {
+ border-bottom: none;
+}
+.swagger-section .swagger-ui-wrap table tbody tr.offset {
+ background-color: #f0f0f0;
+}
+.swagger-section .swagger-ui-wrap table tbody tr td {
+ padding: 6px;
+ font-size: 0.9em;
+ border-bottom: 1px solid #cccccc;
+ vertical-align: top;
+ line-height: 1.3em;
+}
+.swagger-section .swagger-ui-wrap ol {
+ margin: 0px 0 10px;
+ padding: 0 0 0 18px;
+ list-style-type: decimal;
+}
+.swagger-section .swagger-ui-wrap ol li {
+ padding: 5px 0px;
+ font-size: 0.9em;
+ color: #333333;
+}
+.swagger-section .swagger-ui-wrap ol,
+.swagger-section .swagger-ui-wrap ul {
+ list-style: none;
+}
+.swagger-section .swagger-ui-wrap h1 a,
+.swagger-section .swagger-ui-wrap h2 a,
+.swagger-section .swagger-ui-wrap h3 a,
+.swagger-section .swagger-ui-wrap h4 a,
+.swagger-section .swagger-ui-wrap h5 a,
+.swagger-section .swagger-ui-wrap h6 a {
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap h1 a:hover,
+.swagger-section .swagger-ui-wrap h2 a:hover,
+.swagger-section .swagger-ui-wrap h3 a:hover,
+.swagger-section .swagger-ui-wrap h4 a:hover,
+.swagger-section .swagger-ui-wrap h5 a:hover,
+.swagger-section .swagger-ui-wrap h6 a:hover {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap h1 span.divider,
+.swagger-section .swagger-ui-wrap h2 span.divider,
+.swagger-section .swagger-ui-wrap h3 span.divider,
+.swagger-section .swagger-ui-wrap h4 span.divider,
+.swagger-section .swagger-ui-wrap h5 span.divider,
+.swagger-section .swagger-ui-wrap h6 span.divider {
+ color: #aaaaaa;
+}
+.swagger-section .swagger-ui-wrap a {
+ color: #547f00;
+}
+.swagger-section .swagger-ui-wrap a img {
+ border: none;
+}
+.swagger-section .swagger-ui-wrap article,
+.swagger-section .swagger-ui-wrap aside,
+.swagger-section .swagger-ui-wrap details,
+.swagger-section .swagger-ui-wrap figcaption,
+.swagger-section .swagger-ui-wrap figure,
+.swagger-section .swagger-ui-wrap footer,
+.swagger-section .swagger-ui-wrap header,
+.swagger-section .swagger-ui-wrap hgroup,
+.swagger-section .swagger-ui-wrap menu,
+.swagger-section .swagger-ui-wrap nav,
+.swagger-section .swagger-ui-wrap section,
+.swagger-section .swagger-ui-wrap summary {
+ display: block;
+}
+.swagger-section .swagger-ui-wrap pre {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ background-color: #fcf6db;
+ border: 1px solid #e5e0c6;
+ padding: 10px;
+}
+.swagger-section .swagger-ui-wrap pre code {
+ line-height: 1.6em;
+ background: none;
+}
+.swagger-section .swagger-ui-wrap .content > .content-type > div > label {
+ clear: both;
+ display: block;
+ color: #0F6AB4;
+ font-size: 1.1em;
+ margin: 0;
+ padding: 15px 0 5px;
+}
+.swagger-section .swagger-ui-wrap .content pre {
+ font-size: 12px;
+ margin-top: 5px;
+ padding: 5px;
+}
+.swagger-section .swagger-ui-wrap .icon-btn {
+ cursor: pointer;
+}
+.swagger-section .swagger-ui-wrap .info_title {
+ padding-bottom: 10px;
+ font-weight: bold;
+ font-size: 25px;
+}
+.swagger-section .swagger-ui-wrap .footer {
+ margin-top: 20px;
+}
+.swagger-section .swagger-ui-wrap p.big,
+.swagger-section .swagger-ui-wrap div.big p {
+ font-size: 1em;
+ margin-bottom: 10px;
+}
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input,
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input,
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea,
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input {
+ width: 500px !important;
+}
+.swagger-section .swagger-ui-wrap .info_license {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_tos {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .message-fail {
+ color: #cc0000;
+}
+.swagger-section .swagger-ui-wrap .info_url {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_email {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_name {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_description {
+ padding-bottom: 10px;
+ font-size: 15px;
+}
+.swagger-section .swagger-ui-wrap .markdown ol li,
+.swagger-section .swagger-ui-wrap .markdown ul li {
+ padding: 3px 0px;
+ line-height: 1.4em;
+ color: #333333;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input {
+ display: block;
+ padding: 4px;
+ width: auto;
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title {
+ font-size: 1.3em;
+}
+.swagger-section .swagger-ui-wrap table.fullwidth {
+ width: 100%;
+}
+.swagger-section .swagger-ui-wrap .model-signature {
+ font-family: "Droid Sans", sans-serif;
+ font-size: 1em;
+ line-height: 1.5em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-nav a {
+ text-decoration: none;
+ color: #AAA;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover {
+ text-decoration: underline;
+ color: black;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected {
+ color: black;
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propType {
+ color: #5555aa;
+}
+.swagger-section .swagger-ui-wrap .model-signature pre:hover {
+ background-color: #ffffdd;
+}
+.swagger-section .swagger-ui-wrap .model-signature pre {
+ font-size: .85em;
+ line-height: 1.2em;
+ overflow: auto;
+ max-height: 200px;
+ cursor: pointer;
+}
+.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
+ display: block;
+ min-width: 230px;
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child {
+ padding-right: 0;
+ border-right: none;
+}
+.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li {
+ float: left;
+ margin: 0 5px 5px 0;
+ padding: 2px 5px 2px 0;
+ border-right: 1px solid #ddd;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propOpt {
+ color: #555;
+}
+.swagger-section .swagger-ui-wrap .model-signature .snippet small {
+ font-size: 0.75em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propOptKey {
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .strong {
+ font-weight: bold;
+ color: #000;
+ font-size: .9em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description div {
+ font-size: 0.9em;
+ line-height: 1.5em;
+ margin-left: 1em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .stronger {
+ font-weight: bold;
+ color: #000;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper {
+ border-spacing: 0;
+ position: absolute;
+ background-color: #ffffff;
+ border: 1px solid #bbbbbb;
+ display: none;
+ font-size: 11px;
+ max-width: 400px;
+ line-height: 30px;
+ color: black;
+ padding: 5px;
+ margin-left: 10px;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th {
+ text-align: center;
+ background-color: #eeeeee;
+ border: 1px solid #bbbbbb;
+ font-size: 11px;
+ color: #666666;
+ font-weight: bold;
+ padding: 5px;
+ line-height: 15px;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName {
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child,
+.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child {
+ display: inline;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before {
+ display: block;
+ content: '';
+}
+.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child {
+ margin-right: -3px;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propName {
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-container {
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap .body-textarea {
+ width: 300px;
+ height: 100px;
+ border: 1px solid #aaa;
+}
+.swagger-section .swagger-ui-wrap .markdown p code,
+.swagger-section .swagger-ui-wrap .markdown li code {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ background-color: #f0f0f0;
+ color: black;
+ padding: 1px 3px;
+}
+.swagger-section .swagger-ui-wrap .required {
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .editor_holder {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap .editor_holder label {
+ font-weight: normal!important;
+ /* JSONEditor uses bold by default for all labels, we revert that back to normal to not give the impression that by default fields are required */
+}
+.swagger-section .swagger-ui-wrap .editor_holder label.required {
+ font-weight: bold!important;
+}
+.swagger-section .swagger-ui-wrap input.parameter {
+ width: 300px;
+ border: 1px solid #aaa;
+}
+.swagger-section .swagger-ui-wrap h1 {
+ color: black;
+ font-size: 1.5em;
+ line-height: 1.3em;
+ padding: 10px 0 10px 0;
+ font-family: "Droid Sans", sans-serif;
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .heading_with_menu {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap .heading_with_menu ul {
+ display: block;
+ clear: none;
+ float: right;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+ margin-top: 10px;
+}
+.swagger-section .swagger-ui-wrap h2 {
+ color: black;
+ font-size: 1.3em;
+ padding: 10px 0 10px 0;
+}
+.swagger-section .swagger-ui-wrap h2 a {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap h2 span.sub {
+ font-size: 0.7em;
+ color: #999999;
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap h2 span.sub a {
+ color: #777777;
+}
+.swagger-section .swagger-ui-wrap span.weak {
+ color: #666666;
+}
+.swagger-section .swagger-ui-wrap .message-success {
+ color: #89BF04;
+}
+.swagger-section .swagger-ui-wrap caption,
+.swagger-section .swagger-ui-wrap th,
+.swagger-section .swagger-ui-wrap td {
+ text-align: left;
+ font-weight: normal;
+ vertical-align: middle;
+}
+.swagger-section .swagger-ui-wrap .code {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea {
+ font-family: "Droid Sans", sans-serif;
+ height: 250px;
+ padding: 4px;
+ display: block;
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select {
+ display: block;
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label {
+ display: block;
+ float: left;
+ clear: none;
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input {
+ display: block;
+ float: left;
+ clear: none;
+ margin: 0 5px 0 0;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label {
+ display: block;
+ clear: both;
+ width: auto;
+ padding: 0 0 3px;
+ color: #666666;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr {
+ padding-left: 3px;
+ color: #888888;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints {
+ margin-left: 0;
+ font-style: italic;
+ font-size: 0.9em;
+ margin: 0;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons {
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap span.blank,
+.swagger-section .swagger-ui-wrap span.empty {
+ color: #888888;
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap .markdown h3 {
+ color: #547f00;
+}
+.swagger-section .swagger-ui-wrap .markdown h4 {
+ color: #666666;
+}
+.swagger-section .swagger-ui-wrap .markdown pre {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ background-color: #fcf6db;
+ border: 1px solid #e5e0c6;
+ padding: 10px;
+ margin: 0 0 10px 0;
+}
+.swagger-section .swagger-ui-wrap .markdown pre code {
+ line-height: 1.6em;
+}
+.swagger-section .swagger-ui-wrap div.gist {
+ margin: 20px 0 25px 0 !important;
+}
+.swagger-section .swagger-ui-wrap ul#resources {
+ font-family: "Droid Sans", sans-serif;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource {
+ border-bottom: 1px solid #dddddd;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a,
+.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a,
+.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a {
+ color: #555555;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child {
+ border-bottom: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading {
+ border: 1px solid transparent;
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options {
+ overflow: hidden;
+ padding: 0;
+ display: block;
+ clear: none;
+ float: right;
+ margin: 14px 10px 0 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li {
+ float: left;
+ clear: none;
+ margin: 0;
+ padding: 2px 10px;
+ border-right: 1px solid #dddddd;
+ color: #666666;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a {
+ color: #aaaaaa;
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover {
+ text-decoration: underline;
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last {
+ padding-right: 0;
+ border-right: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
+ color: #999999;
+ padding-left: 0;
+ display: block;
+ clear: none;
+ float: left;
+ font-family: "Droid Sans", sans-serif;
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a {
+ color: #999999;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+ margin: 0 0 10px;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 {
+ display: block;
+ clear: none;
+ float: left;
+ width: auto;
+ margin: 0;
+ padding: 0;
+ line-height: 1.1em;
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path {
+ padding-left: 10px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a {
+ color: black;
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a.toggleOperation.deprecated {
+ text-decoration: line-through;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a {
+ text-transform: uppercase;
+ text-decoration: none;
+ color: white;
+ display: inline-block;
+ width: 50px;
+ font-size: 0.7em;
+ text-align: center;
+ padding: 7px 0 4px;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+ -o-border-radius: 2px;
+ -ms-border-radius: 2px;
+ -khtml-border-radius: 2px;
+ border-radius: 2px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span {
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options {
+ overflow: hidden;
+ padding: 0;
+ display: block;
+ clear: none;
+ float: right;
+ margin: 6px 10px 0 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li {
+ float: left;
+ clear: none;
+ margin: 0;
+ padding: 2px 10px;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a {
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content {
+ border-top: none;
+ padding: 10px;
+ -moz-border-radius-bottomleft: 6px;
+ -webkit-border-bottom-left-radius: 6px;
+ -o-border-bottom-left-radius: 6px;
+ -ms-border-bottom-left-radius: 6px;
+ -khtml-border-bottom-left-radius: 6px;
+ border-bottom-left-radius: 6px;
+ -moz-border-radius-bottomright: 6px;
+ -webkit-border-bottom-right-radius: 6px;
+ -o-border-bottom-right-radius: 6px;
+ -ms-border-bottom-right-radius: 6px;
+ -khtml-border-bottom-right-radius: 6px;
+ border-bottom-right-radius: 6px;
+ margin: 0 0 20px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 {
+ font-size: 1.1em;
+ margin: 0;
+ padding: 15px 0 5px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a {
+ padding: 4px 0 0 10px;
+ display: inline-block;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit {
+ display: block;
+ clear: none;
+ float: left;
+ padding: 6px 8px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber {
+ background-image: url('../images/throbber.gif');
+ width: 128px;
+ height: 16px;
+ display: block;
+ clear: none;
+ float: right;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error {
+ outline: 2px solid black;
+ outline-color: #cc0000;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] {
+ max-width: 300px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ padding: 10px;
+ font-size: 0.9em;
+ max-height: 400px;
+ overflow-y: auto;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading {
+ background-color: #f9f2e9;
+ border: 1px solid #f0e0ca;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a {
+ background-color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #f0e0ca;
+ color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a {
+ color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content {
+ background-color: #faf5ee;
+ border: 1px solid #f0e0ca;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 {
+ color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a {
+ color: #dcb67f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading {
+ background-color: #fcffcd;
+ border: 1px solid black;
+ border-color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a {
+ text-transform: uppercase;
+ background-color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #ffd20f;
+ color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a {
+ color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content {
+ background-color: #fcffcd;
+ border: 1px solid black;
+ border-color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 {
+ color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a {
+ color: #6fc992;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading {
+ background-color: #f5e8e8;
+ border: 1px solid #e8c6c7;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a {
+ text-transform: uppercase;
+ background-color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #e8c6c7;
+ color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a {
+ color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
+ background-color: #f7eded;
+ border: 1px solid #e8c6c7;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 {
+ color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a {
+ color: #c8787a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading {
+ background-color: #e7f6ec;
+ border: 1px solid #c3e8d1;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a {
+ background-color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #c3e8d1;
+ color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a {
+ color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content {
+ background-color: #ebf7f0;
+ border: 1px solid #c3e8d1;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 {
+ color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a {
+ color: #6fc992;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading {
+ background-color: #FCE9E3;
+ border: 1px solid #F5D5C3;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a {
+ background-color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #f0cecb;
+ color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a {
+ color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content {
+ background-color: #faf0ef;
+ border: 1px solid #f0cecb;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 {
+ color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a {
+ color: #dcb67f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading {
+ background-color: #e7f0f7;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a {
+ background-color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #c3d9ec;
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content {
+ background-color: #ebf3f9;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a {
+ color: #6fa5d2;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading {
+ background-color: #e7f0f7;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a {
+ background-color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #c3d9ec;
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content {
+ background-color: #ebf3f9;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a {
+ color: #6fa5d2;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
+ border-top: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last {
+ padding-right: 0;
+ border-right: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap p#colophon {
+ margin: 0 15px 40px 15px;
+ padding: 10px 0;
+ font-size: 0.8em;
+ border-top: 1px solid #dddddd;
+ font-family: "Droid Sans", sans-serif;
+ color: #999999;
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap p#colophon a {
+ text-decoration: none;
+ color: #547f00;
+}
+.swagger-section .swagger-ui-wrap h3 {
+ color: black;
+ font-size: 1.1em;
+ padding: 10px 0 10px 0;
+}
+.swagger-section .swagger-ui-wrap .markdown ol,
+.swagger-section .swagger-ui-wrap .markdown ul {
+ font-family: "Droid Sans", sans-serif;
+ margin: 5px 0 10px;
+ padding: 0 0 0 18px;
+ list-style-type: disc;
+}
+.swagger-section .swagger-ui-wrap form.form_box {
+ background-color: #ebf3f9;
+ border: 1px solid #c3d9ec;
+ padding: 10px;
+}
+.swagger-section .swagger-ui-wrap form.form_box label {
+ color: #0f6ab4 !important;
+}
+.swagger-section .swagger-ui-wrap form.form_box input[type=submit] {
+ display: block;
+ padding: 10px;
+}
+.swagger-section .swagger-ui-wrap form.form_box p.weak {
+ font-size: 0.8em;
+}
+.swagger-section .swagger-ui-wrap form.form_box p {
+ font-size: 0.9em;
+ padding: 0 0 15px;
+ color: #7e7b6d;
+}
+.swagger-section .swagger-ui-wrap form.form_box p a {
+ color: #646257;
+}
+.swagger-section .swagger-ui-wrap form.form_box p strong {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
+ padding-bottom: 0;
+}
+.swagger-section .title {
+ font-style: bold;
+}
+.swagger-section .secondary_form {
+ display: none;
+}
+.swagger-section .main_image {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+.swagger-section .oauth_body {
+ margin-left: 100px;
+ margin-right: 100px;
+}
+.swagger-section .oauth_submit {
+ text-align: center;
+}
+.swagger-section .api-popup-dialog {
+ z-index: 10000;
+ position: absolute;
+ width: 500px;
+ background: #FFF;
+ padding: 20px;
+ border: 1px solid #ccc;
+ border-radius: 5px;
+ display: none;
+ font-size: 13px;
+ color: #777;
+}
+.swagger-section .api-popup-dialog .api-popup-title {
+ font-size: 24px;
+ padding: 10px 0;
+}
+.swagger-section .api-popup-dialog .api-popup-title {
+ font-size: 24px;
+ padding: 10px 0;
+}
+.swagger-section .api-popup-dialog .error-msg {
+ padding-left: 5px;
+ padding-bottom: 5px;
+}
+.swagger-section .api-popup-dialog .api-popup-authbtn {
+ height: 30px;
+}
+.swagger-section .api-popup-dialog .api-popup-cancel {
+ height: 30px;
+}
+.swagger-section .api-popup-scopes {
+ padding: 10px 20px;
+}
+.swagger-section .api-popup-scopes li {
+ padding: 5px 0;
+ line-height: 20px;
+}
+.swagger-section .api-popup-scopes li input {
+ position: relative;
+ top: 2px;
+}
+.swagger-section .api-popup-scopes .api-scope-desc {
+ padding-left: 20px;
+ font-style: italic;
+}
+.swagger-section .api-popup-actions {
+ padding-top: 10px;
+}
+.swagger-section .access {
+ float: right;
+}
+.swagger-section .auth {
+ float: right;
+}
+.swagger-section .api-ic {
+ height: 18px;
+ vertical-align: middle;
+ display: inline-block;
+ background: url(../images/explorer_icons.png) no-repeat;
+}
+.swagger-section .api-ic .api_information_panel {
+ position: relative;
+ margin-top: 20px;
+ margin-left: -5px;
+ background: #FFF;
+ border: 1px solid #ccc;
+ border-radius: 5px;
+ display: none;
+ font-size: 13px;
+ max-width: 300px;
+ line-height: 30px;
+ color: black;
+ padding: 5px;
+}
+.swagger-section .api-ic .api_information_panel p .api-msg-enabled {
+ color: green;
+}
+.swagger-section .api-ic .api_information_panel p .api-msg-disabled {
+ color: red;
+}
+.swagger-section .api-ic:hover .api_information_panel {
+ position: absolute;
+ display: block;
+}
+.swagger-section .ic-info {
+ background-position: 0 0;
+ width: 18px;
+ margin-top: -6px;
+ margin-left: 4px;
+}
+.swagger-section .ic-warning {
+ background-position: -60px 0;
+ width: 18px;
+ margin-top: -6px;
+ margin-left: 4px;
+}
+.swagger-section .ic-error {
+ background-position: -30px 0;
+ width: 18px;
+ margin-top: -6px;
+ margin-left: 4px;
+}
+.swagger-section .ic-off {
+ background-position: -90px 0;
+ width: 58px;
+ margin-top: -4px;
+ cursor: pointer;
+}
+.swagger-section .ic-on {
+ background-position: -160px 0;
+ width: 58px;
+ margin-top: -4px;
+ cursor: pointer;
+}
+.swagger-section #header {
+ background-color: #89bf04;
+ padding: 14px;
+}
+.swagger-section #input_baseUrl {
+ width: 400px;
+}
+.swagger-section #api_selector {
+ display: block;
+ clear: none;
+ float: right;
+}
+.swagger-section #api_selector .input {
+ display: block;
+ clear: none;
+ float: left;
+ margin: 0 10px 0 0;
+}
+.swagger-section #api_selector input {
+ font-size: 0.9em;
+ padding: 3px;
+ margin: 0;
+}
+.swagger-section #input_apiKey {
+ width: 200px;
+}
+.swagger-section #explore {
+ display: block;
+ text-decoration: none;
+ font-weight: bold;
+ padding: 6px 8px;
+ font-size: 0.9em;
+ color: white;
+ background-color: #547f00;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ -o-border-radius: 4px;
+ -ms-border-radius: 4px;
+ -khtml-border-radius: 4px;
+ border-radius: 4px;
+}
+.swagger-section #explore:hover {
+ background-color: #547f00;
+}
+.swagger-section #header #logo {
+ font-size: 1.5em;
+ font-weight: bold;
+ text-decoration: none;
+ background: transparent url(../images/logo_small.png) no-repeat left center;
+ padding: 20px 0 20px 40px;
+ color: white;
+}
+.swagger-section #content_message {
+ margin: 10px 15px;
+ font-style: italic;
+ color: #999999;
+}
+.swagger-section #message-bar {
+ min-height: 30px;
+ text-align: center;
+ padding-top: 10px;
+}
+.swagger-section .swagger-collapse:before {
+ content: "-";
+}
+.swagger-section .swagger-expand:before {
+ content: "+";
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/style.css b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/style.css
new file mode 100644
index 0000000..fc21a31
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/style.css
@@ -0,0 +1,250 @@
+.swagger-section #header a#logo {
+ font-size: 1.5em;
+ font-weight: bold;
+ text-decoration: none;
+ background: transparent url(../images/logo.png) no-repeat left center;
+ padding: 20px 0 20px 40px;
+}
+#text-head {
+ font-size: 80px;
+ font-family: 'Roboto', sans-serif;
+ color: #ffffff;
+ float: right;
+ margin-right: 20%;
+}
+.navbar-fixed-top .navbar-nav {
+ height: auto;
+}
+.navbar-fixed-top .navbar-brand {
+ height: auto;
+}
+.navbar-header {
+ height: auto;
+}
+.navbar-inverse {
+ background-color: #000;
+ border-color: #000;
+}
+#navbar-brand {
+ margin-left: 20%;
+}
+.navtext {
+ font-size: 10px;
+}
+.h1,
+h1 {
+ font-size: 60px;
+}
+.navbar-default .navbar-header .navbar-brand {
+ color: #a2dfee;
+}
+/* tag titles */
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a {
+ color: #393939;
+ font-family: 'Arvo', serif;
+ font-size: 1.5em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
+ color: #525252;
+ padding-left: 0px;
+ display: block;
+ clear: none;
+ float: left;
+ font-family: 'Arvo', serif;
+ font-weight: bold;
+}
+.navbar-default .navbar-collapse,
+.navbar-default .navbar-form {
+ border-color: #0A0A0A;
+}
+.container1 {
+ width: 1500px;
+ margin: auto;
+ margin-top: 0;
+ background-image: url('../images/shield.png');
+ background-repeat: no-repeat;
+ background-position: -40px -20px;
+ margin-bottom: 210px;
+}
+.container-inner {
+ width: 1200px;
+ margin: auto;
+ background-color: rgba(223, 227, 228, 0.75);
+ padding-bottom: 40px;
+ padding-top: 40px;
+ border-radius: 15px;
+}
+.header-content {
+ padding: 0;
+ width: 1000px;
+}
+.title1 {
+ font-size: 80px;
+ font-family: 'Vollkorn', serif;
+ color: #404040;
+ text-align: center;
+ padding-top: 40px;
+ padding-bottom: 100px;
+}
+#icon {
+ margin-top: -18px;
+}
+.subtext {
+ font-size: 25px;
+ font-style: italic;
+ color: #08b;
+ text-align: right;
+ padding-right: 250px;
+}
+.bg-primary {
+ background-color: #00468b;
+}
+.navbar-default .nav > li > a,
+.navbar-default .nav > li > a:focus {
+ color: #08b;
+}
+.navbar-default .nav > li > a,
+.navbar-default .nav > li > a:hover {
+ color: #08b;
+}
+.navbar-default .nav > li > a,
+.navbar-default .nav > li > a:focus:hover {
+ color: #08b;
+}
+.text-faded {
+ font-size: 25px;
+ font-family: 'Vollkorn', serif;
+}
+.section-heading {
+ font-family: 'Vollkorn', serif;
+ font-size: 45px;
+ padding-bottom: 10px;
+}
+hr {
+ border-color: #00468b;
+ padding-bottom: 10px;
+}
+.description {
+ margin-top: 20px;
+ padding-bottom: 200px;
+}
+.description li {
+ font-family: 'Vollkorn', serif;
+ font-size: 25px;
+ color: #525252;
+ margin-left: 28%;
+ padding-top: 5px;
+}
+.gap {
+ margin-top: 200px;
+}
+.troubleshootingtext {
+ color: rgba(255, 255, 255, 0.7);
+ padding-left: 30%;
+}
+.troubleshootingtext li {
+ list-style-type: circle;
+ font-size: 25px;
+ padding-bottom: 5px;
+}
+.overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 1000;
+}
+.block.response_body.json:hover {
+ cursor: pointer;
+}
+.backdrop {
+ color: blue;
+}
+#myModal {
+ height: 100%;
+}
+.modal-backdrop {
+ bottom: 0;
+ position: fixed;
+}
+.curl {
+ padding: 10px;
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ font-size: 0.9em;
+ max-height: 400px;
+ margin-top: 5px;
+ overflow-y: auto;
+ background-color: #fcf6db;
+ border: 1px solid #e5e0c6;
+ border-radius: 4px;
+}
+.curl_title {
+ font-size: 1.1em;
+ margin: 0;
+ padding: 15px 0 5px;
+ font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
+ font-weight: 500;
+ line-height: 1.1;
+}
+.footer {
+ display: none;
+}
+.swagger-section .swagger-ui-wrap h2 {
+ padding: 0;
+}
+h2 {
+ margin: 0;
+ margin-bottom: 5px;
+}
+.markdown p {
+ font-size: 15px;
+ font-family: 'Arvo', serif;
+}
+.swagger-section .swagger-ui-wrap .code {
+ font-size: 15px;
+ font-family: 'Arvo', serif;
+}
+.swagger-section .swagger-ui-wrap b {
+ font-family: 'Arvo', serif;
+}
+#signin:hover {
+ cursor: pointer;
+}
+.dropdown-menu {
+ padding: 15px;
+}
+.navbar-right .dropdown-menu {
+ left: 0;
+ right: auto;
+}
+#signinbutton {
+ width: 100%;
+ height: 32px;
+ font-size: 13px;
+ font-weight: bold;
+ color: #08b;
+}
+.navbar-default .nav > li .details {
+ color: #000000;
+ text-transform: none;
+ font-size: 15px;
+ font-weight: normal;
+ font-family: 'Open Sans', sans-serif;
+ font-style: italic;
+ line-height: 20px;
+ top: -2px;
+}
+.navbar-default .nav > li .details:hover {
+ color: black;
+}
+#signout {
+ width: 100%;
+ height: 32px;
+ font-size: 13px;
+ font-weight: bold;
+ color: #08b;
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/typography.css b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/typography.css
new file mode 100644
index 0000000..3235edd
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/css/typography.css
@@ -0,0 +1,14 @@
+/* Google Font's Droid Sans */
+@font-face {
+ font-family: 'Droid Sans';
+ font-style: normal;
+ font-weight: 400;
+ src: local('Droid Sans'), local('DroidSans'), url('../fonts/DroidSans.ttf') format('truetype');
+}
+/* Google Font's Droid Sans Bold */
+@font-face {
+ font-family: 'Droid Sans';
+ font-style: normal;
+ font-weight: 700;
+ src: local('Droid Sans Bold'), local('DroidSans-Bold'), url('../fonts/DroidSans-Bold.ttf') format('truetype');
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/fonts/DroidSans-Bold.ttf b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/fonts/DroidSans-Bold.ttf
new file mode 100644
index 0000000..befea09
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/fonts/DroidSans-Bold.ttf
Binary files differ
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/fonts/DroidSans.ttf b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/fonts/DroidSans.ttf
new file mode 100644
index 0000000..ad1efca
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/fonts/DroidSans.ttf
Binary files differ
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/collapse.gif b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/collapse.gif
new file mode 100644
index 0000000..8843e8c
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/collapse.gif
Binary files differ
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/expand.gif b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/expand.gif
new file mode 100644
index 0000000..477bf13
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/expand.gif
Binary files differ
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/explorer_icons.png b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/explorer_icons.png
new file mode 100644
index 0000000..ed9d2ff
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/explorer_icons.png
Binary files differ
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/favicon-16x16.png b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/favicon-16x16.png
new file mode 100644
index 0000000..66b1a5b
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/favicon-16x16.png
Binary files differ
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/favicon-32x32.png b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/favicon-32x32.png
new file mode 100644
index 0000000..32f319f
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/favicon-32x32.png
Binary files differ
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/favicon.ico b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/favicon.ico
new file mode 100644
index 0000000..8b60bcf
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/favicon.ico
Binary files differ
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/logo_small.png b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/logo_small.png
new file mode 100644
index 0000000..5496a65
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/logo_small.png
Binary files differ
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/pet_store_api.png b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/pet_store_api.png
new file mode 100644
index 0000000..f9f9cd4
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/pet_store_api.png
Binary files differ
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/throbber.gif b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/throbber.gif
new file mode 100644
index 0000000..0639388
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/throbber.gif
Binary files differ
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/wordnik_api.png b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/wordnik_api.png
new file mode 100644
index 0000000..dca4f14
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/images/wordnik_api.png
Binary files differ
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/index.html b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/index.html
new file mode 100644
index 0000000..ca9deb0
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/index.html
@@ -0,0 +1,122 @@
+
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Product Management REST APIs</title>
+ <link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
+ <link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
+ <link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
+ <link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>
+ <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
+ <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
+ <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
+ <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
+ <script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
+ <script src='lib/js-yaml.min.js' type='text/javascript'></script>
+ <script src='lib/lodash.min.js' type='text/javascript'></script>
+ <script src='lib/backbone-min.js' type='text/javascript'></script>
+ <script src='swagger-ui.js' type='text/javascript'></script>
+ <script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
+ <script src='lib/jsoneditor.min.js' type='text/javascript'></script>
+ <script src='lib/marked.js' type='text/javascript'></script>
+ <script src='lib/swagger-oauth.js' type='text/javascript'></script>
+
+ <!-- Some basic translations -->
+ <!-- <script src='lang/translator.js' type='text/javascript'></script> -->
+ <!-- <script src='lang/ru.js' type='text/javascript'></script> -->
+ <!-- <script src='lang/en.js' type='text/javascript'></script> -->
+
+ <script type="text/javascript">
+
+ $(function () {
+ var url = window.location.search.match(/url=([^&]+)/);
+ if (url && url.length > 1) {
+ url = decodeURIComponent(url[1]);
+ } else {
+ url = "/v2/api-docs?group=changerecord";
+ }
+
+ // Pre load translate...
+ if(window.SwaggerTranslator) {
+ window.SwaggerTranslator.translate();
+ }
+ window.swaggerUi = new SwaggerUi({
+ url: url,
+ dom_id: "swagger-ui-container",
+ supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
+ onComplete: function(swaggerApi, swaggerUi){
+ if(typeof initOAuth == "function") {
+ initOAuth({
+ clientId: "your-client-id",
+ clientSecret: "your-client-secret-if-required",
+ realm: "your-realms",
+ appName: "your-app-name",
+ scopeSeparator: ",",
+ additionalQueryStringParams: {}
+ });
+ }
+
+ if(window.SwaggerTranslator) {
+ window.SwaggerTranslator.translate();
+ }
+
+ addApiKeyAuthorization();
+ },
+ onFailure: function(data) {
+ log("Unable to Load SwaggerUI");
+ },
+ docExpansion: "none",
+ jsonEditor: false,
+ apisSorter: "alpha",
+ defaultModelRendering: 'schema',
+ showRequestHeaders: false
+ });
+
+ function addApiKeyAuthorization(){
+ var key = encodeURIComponent($('#input_apiKey')[0].value);
+ if(key && key.trim() != "") {
+ var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
+ window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
+ log("added key " + key);
+ }
+ }
+
+ $('#input_apiKey').change(addApiKeyAuthorization);
+
+ // if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
+ /*
+ var apiKey = "myApiKeyXXXX123456789";
+ $('#input_apiKey').val(apiKey);
+ */
+
+ window.swaggerUi.load();
+
+ function log() {
+ if ('console' in window) {
+ console.log.apply(console, arguments);
+ }
+ }
+ });
+ </script>
+</head>
+
+<body class="swagger-section">
+<div id='header'>
+ <div class="swagger-ui-wrap">
+ <a id="logo" href="http://swagger.io">swagger</a>
+ <form id='api_selector'>
+ <div class='input'><input placeholder="http://example.com.att.vtm.changerecord/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
+ <div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
+ <div class='input'><a id="explore" href="#" data-sw-translate>Explore</a></div>
+ </form>
+ </div>
+</div>
+
+<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
+<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
+</body>
+</html>
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/en.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/en.js
new file mode 100644
index 0000000..9183136
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/en.js
@@ -0,0 +1,56 @@
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Warning: Deprecated",
+ "Implementation Notes":"Implementation Notes",
+ "Response Class":"Response Class",
+ "Status":"Status",
+ "Parameters":"Parameters",
+ "Parameter":"Parameter",
+ "Value":"Value",
+ "Description":"Description",
+ "Parameter Type":"Parameter Type",
+ "Data Type":"Data Type",
+ "Response Messages":"Response Messages",
+ "HTTP Status Code":"HTTP Status Code",
+ "Reason":"Reason",
+ "Response Model":"Response Model",
+ "Request URL":"Request URL",
+ "Response Body":"Response Body",
+ "Response Code":"Response Code",
+ "Response Headers":"Response Headers",
+ "Hide Response":"Hide Response",
+ "Headers":"Headers",
+ "Try it out!":"Try it out!",
+ "Show/Hide":"Show/Hide",
+ "List Operations":"List Operations",
+ "Expand Operations":"Expand Operations",
+ "Raw":"Raw",
+ "can't parse JSON. Raw result":"can't parse JSON. Raw result",
+ "Example Value":"Example Value",
+ "Model Schema":"Model Schema",
+ "Model":"Model",
+ "Click to set as parameter value":"Click to set as parameter value",
+ "apply":"apply",
+ "Username":"Username",
+ "Password":"Password",
+ "Terms of service":"Terms of service",
+ "Created by":"Created by",
+ "See more at":"See more at",
+ "Contact the developer":"Contact the developer",
+ "api version":"api version",
+ "Response Content Type":"Response Content Type",
+ "Parameter content type:":"Parameter content type:",
+ "fetching resource":"fetching resource",
+ "fetching resource list":"fetching resource list",
+ "Explore":"Explore",
+ "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.",
+ "Please specify the protocol for":"Please specify the protocol for",
+ "Can't read swagger JSON from":"Can't read swagger JSON from",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI",
+ "Unable to read api":"Unable to read api",
+ "from path":"from path",
+ "server returned":"server returned"
+});
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/es.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/es.js
new file mode 100644
index 0000000..13fa015
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/es.js
@@ -0,0 +1,53 @@
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Advertencia: Obsoleto",
+ "Implementation Notes":"Notas de implementación",
+ "Response Class":"Clase de la Respuesta",
+ "Status":"Status",
+ "Parameters":"Parámetros",
+ "Parameter":"Parámetro",
+ "Value":"Valor",
+ "Description":"Descripción",
+ "Parameter Type":"Tipo del Parámetro",
+ "Data Type":"Tipo del Dato",
+ "Response Messages":"Mensajes de la Respuesta",
+ "HTTP Status Code":"Código de Status HTTP",
+ "Reason":"Razón",
+ "Response Model":"Modelo de la Respuesta",
+ "Request URL":"URL de la Solicitud",
+ "Response Body":"Cuerpo de la Respuesta",
+ "Response Code":"Código de la Respuesta",
+ "Response Headers":"Encabezados de la Respuesta",
+ "Hide Response":"Ocultar Respuesta",
+ "Try it out!":"Pruébalo!",
+ "Show/Hide":"Mostrar/Ocultar",
+ "List Operations":"Listar Operaciones",
+ "Expand Operations":"Expandir Operaciones",
+ "Raw":"Crudo",
+ "can't parse JSON. Raw result":"no puede parsear el JSON. Resultado crudo",
+ "Example Value":"Valor de Ejemplo",
+ "Model Schema":"Esquema del Modelo",
+ "Model":"Modelo",
+ "apply":"aplicar",
+ "Username":"Nombre de usuario",
+ "Password":"Contraseña",
+ "Terms of service":"Términos de Servicio",
+ "Created by":"Creado por",
+ "See more at":"Ver más en",
+ "Contact the developer":"Contactar al desarrollador",
+ "api version":"versión de la api",
+ "Response Content Type":"Tipo de Contenido (Content Type) de la Respuesta",
+ "fetching resource":"buscando recurso",
+ "fetching resource list":"buscando lista del recurso",
+ "Explore":"Explorar",
+ "Show Swagger Petstore Example Apis":"Mostrar Api Ejemplo de Swagger Petstore",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"No se puede leer del servidor. Tal vez no tiene la configuración de control de acceso de origen (access-control-origin) apropiado.",
+ "Please specify the protocol for":"Por favor, especificar el protocola para",
+ "Can't read swagger JSON from":"No se puede leer el JSON de swagger desde",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Finalizada la carga del recurso de Información. Mostrando Swagger UI",
+ "Unable to read api":"No se puede leer la api",
+ "from path":"desde ruta",
+ "server returned":"el servidor retornó"
+});
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/fr.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/fr.js
new file mode 100644
index 0000000..edf5ad6
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/fr.js
@@ -0,0 +1,54 @@
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Avertissement : Obsolète",
+ "Implementation Notes":"Notes d'implementation",
+ "Response Class":"Classe de la réponse",
+ "Status":"Statut",
+ "Parameters":"Paramètres",
+ "Parameter":"Paramètre",
+ "Value":"Valeur",
+ "Description":"Description",
+ "Parameter Type":"Type du paramètre",
+ "Data Type":"Type de données",
+ "Response Messages":"Messages de la réponse",
+ "HTTP Status Code":"Code de statut HTTP",
+ "Reason":"Raison",
+ "Response Model":"Modèle de réponse",
+ "Request URL":"URL appelée",
+ "Response Body":"Corps de la réponse",
+ "Response Code":"Code de la réponse",
+ "Response Headers":"En-têtes de la réponse",
+ "Hide Response":"Cacher la réponse",
+ "Headers":"En-têtes",
+ "Try it out!":"Testez !",
+ "Show/Hide":"Afficher/Masquer",
+ "List Operations":"Liste des opérations",
+ "Expand Operations":"Développer les opérations",
+ "Raw":"Brut",
+ "can't parse JSON. Raw result":"impossible de décoder le JSON. Résultat brut",
+ "Example Value":"Exemple la valeur",
+ "Model Schema":"Définition du modèle",
+ "Model":"Modèle",
+ "apply":"appliquer",
+ "Username":"Nom d'utilisateur",
+ "Password":"Mot de passe",
+ "Terms of service":"Conditions de service",
+ "Created by":"Créé par",
+ "See more at":"Voir plus sur",
+ "Contact the developer":"Contacter le développeur",
+ "api version":"version de l'api",
+ "Response Content Type":"Content Type de la réponse",
+ "fetching resource":"récupération de la ressource",
+ "fetching resource list":"récupération de la liste de ressources",
+ "Explore":"Explorer",
+ "Show Swagger Petstore Example Apis":"Montrer les Apis de l'exemple Petstore de Swagger",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"Impossible de lire à partir du serveur. Il se peut que les réglages access-control-origin ne soient pas appropriés.",
+ "Please specify the protocol for":"Veuillez spécifier un protocole pour",
+ "Can't read swagger JSON from":"Impossible de lire le JSON swagger à partir de",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Chargement des informations terminé. Affichage de Swagger UI",
+ "Unable to read api":"Impossible de lire l'api",
+ "from path":"à partir du chemin",
+ "server returned":"réponse du serveur"
+});
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/it.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/it.js
new file mode 100644
index 0000000..8529c2a
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/it.js
@@ -0,0 +1,52 @@
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Attenzione: Deprecato",
+ "Implementation Notes":"Note di implementazione",
+ "Response Class":"Classe della risposta",
+ "Status":"Stato",
+ "Parameters":"Parametri",
+ "Parameter":"Parametro",
+ "Value":"Valore",
+ "Description":"Descrizione",
+ "Parameter Type":"Tipo di parametro",
+ "Data Type":"Tipo di dato",
+ "Response Messages":"Messaggi della risposta",
+ "HTTP Status Code":"Codice stato HTTP",
+ "Reason":"Motivo",
+ "Response Model":"Modello di risposta",
+ "Request URL":"URL della richiesta",
+ "Response Body":"Corpo della risposta",
+ "Response Code":"Oggetto della risposta",
+ "Response Headers":"Intestazioni della risposta",
+ "Hide Response":"Nascondi risposta",
+ "Try it out!":"Provalo!",
+ "Show/Hide":"Mostra/Nascondi",
+ "List Operations":"Mostra operazioni",
+ "Expand Operations":"Espandi operazioni",
+ "Raw":"Grezzo (raw)",
+ "can't parse JSON. Raw result":"non è possibile parsare il JSON. Risultato grezzo (raw).",
+ "Model Schema":"Schema del modello",
+ "Model":"Modello",
+ "apply":"applica",
+ "Username":"Nome utente",
+ "Password":"Password",
+ "Terms of service":"Condizioni del servizio",
+ "Created by":"Creato da",
+ "See more at":"Informazioni aggiuntive:",
+ "Contact the developer":"Contatta lo sviluppatore",
+ "api version":"versione api",
+ "Response Content Type":"Tipo di contenuto (content type) della risposta",
+ "fetching resource":"recuperando la risorsa",
+ "fetching resource list":"recuperando lista risorse",
+ "Explore":"Esplora",
+ "Show Swagger Petstore Example Apis":"Mostra le api di esempio di Swagger Petstore",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"Non è possibile leggere dal server. Potrebbe non avere le impostazioni di controllo accesso origine (access-control-origin) appropriate.",
+ "Please specify the protocol for":"Si prega di specificare il protocollo per",
+ "Can't read swagger JSON from":"Impossibile leggere JSON swagger da:",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Lettura informazioni risorse termianta. Swagger UI viene mostrata",
+ "Unable to read api":"Impossibile leggere la api",
+ "from path":"da cartella",
+ "server returned":"il server ha restituito"
+});
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/ja.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/ja.js
new file mode 100644
index 0000000..3207bfc
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/ja.js
@@ -0,0 +1,53 @@
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"警告: 廃止予定",
+ "Implementation Notes":"実装メモ",
+ "Response Class":"レスポンスクラス",
+ "Status":"ステータス",
+ "Parameters":"パラメータ群",
+ "Parameter":"パラメータ",
+ "Value":"値",
+ "Description":"説明",
+ "Parameter Type":"パラメータタイプ",
+ "Data Type":"データタイプ",
+ "Response Messages":"レスポンスメッセージ",
+ "HTTP Status Code":"HTTPステータスコード",
+ "Reason":"理由",
+ "Response Model":"レスポンスモデル",
+ "Request URL":"リクエストURL",
+ "Response Body":"レスポンスボディ",
+ "Response Code":"レスポンスコード",
+ "Response Headers":"レスポンスヘッダ",
+ "Hide Response":"レスポンスを隠す",
+ "Headers":"ヘッダ",
+ "Try it out!":"実際に実行!",
+ "Show/Hide":"表示/非表示",
+ "List Operations":"操作一覧",
+ "Expand Operations":"操作の展開",
+ "Raw":"Raw",
+ "can't parse JSON. Raw result":"JSONへ解釈できません. 未加工の結果",
+ "Model Schema":"モデルスキーマ",
+ "Model":"モデル",
+ "apply":"実行",
+ "Username":"ユーザ名",
+ "Password":"パスワード",
+ "Terms of service":"サービス利用規約",
+ "Created by":"Created by",
+ "See more at":"See more at",
+ "Contact the developer":"開発者に連絡",
+ "api version":"APIバージョン",
+ "Response Content Type":"レスポンス コンテンツタイプ",
+ "fetching resource":"リソースの取得",
+ "fetching resource list":"リソース一覧の取得",
+ "Explore":"Explore",
+ "Show Swagger Petstore Example Apis":"SwaggerペットストアAPIの表示",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"サーバから読み込めません. 適切なaccess-control-origin設定を持っていない可能性があります.",
+ "Please specify the protocol for":"プロトコルを指定してください",
+ "Can't read swagger JSON from":"次からswagger JSONを読み込めません",
+ "Finished Loading Resource Information. Rendering Swagger UI":"リソース情報の読み込みが完了しました. Swagger UIを描画しています",
+ "Unable to read api":"APIを読み込めません",
+ "from path":"次のパスから",
+ "server returned":"サーバからの返答"
+});
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/pl.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/pl.js
new file mode 100644
index 0000000..ce41e91
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/pl.js
@@ -0,0 +1,53 @@
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Uwaga: Wycofane",
+ "Implementation Notes":"Uwagi Implementacji",
+ "Response Class":"Klasa Odpowiedzi",
+ "Status":"Status",
+ "Parameters":"Parametry",
+ "Parameter":"Parametr",
+ "Value":"Wartość",
+ "Description":"Opis",
+ "Parameter Type":"Typ Parametru",
+ "Data Type":"Typ Danych",
+ "Response Messages":"Wiadomości Odpowiedzi",
+ "HTTP Status Code":"Kod Statusu HTTP",
+ "Reason":"Przyczyna",
+ "Response Model":"Model Odpowiedzi",
+ "Request URL":"URL Wywołania",
+ "Response Body":"Treść Odpowiedzi",
+ "Response Code":"Kod Odpowiedzi",
+ "Response Headers":"Nagłówki Odpowiedzi",
+ "Hide Response":"Ukryj Odpowiedź",
+ "Headers":"Nagłówki",
+ "Try it out!":"Wypróbuj!",
+ "Show/Hide":"Pokaż/Ukryj",
+ "List Operations":"Lista Operacji",
+ "Expand Operations":"Rozwiń Operacje",
+ "Raw":"Nieprzetworzone",
+ "can't parse JSON. Raw result":"nie można przetworzyć pliku JSON. Nieprzetworzone dane",
+ "Model Schema":"Schemat Modelu",
+ "Model":"Model",
+ "apply":"użyj",
+ "Username":"Nazwa użytkownika",
+ "Password":"Hasło",
+ "Terms of service":"Warunki używania",
+ "Created by":"Utworzone przez",
+ "See more at":"Zobacz więcej na",
+ "Contact the developer":"Kontakt z deweloperem",
+ "api version":"wersja api",
+ "Response Content Type":"Typ Zasobu Odpowiedzi",
+ "fetching resource":"ładowanie zasobu",
+ "fetching resource list":"ładowanie listy zasobów",
+ "Explore":"Eksploruj",
+ "Show Swagger Petstore Example Apis":"Pokaż Przykładowe Api Swagger Petstore",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"Brak połączenia z serwerem. Może on nie mieć odpowiednich ustawień access-control-origin.",
+ "Please specify the protocol for":"Proszę podać protokół dla",
+ "Can't read swagger JSON from":"Nie można odczytać swagger JSON z",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Ukończono Ładowanie Informacji o Zasobie. Renderowanie Swagger UI",
+ "Unable to read api":"Nie można odczytać api",
+ "from path":"ze ścieżki",
+ "server returned":"serwer zwrócił"
+});
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/pt.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/pt.js
new file mode 100644
index 0000000..f2e7c13
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/pt.js
@@ -0,0 +1,53 @@
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Aviso: Depreciado",
+ "Implementation Notes":"Notas de Implementação",
+ "Response Class":"Classe de resposta",
+ "Status":"Status",
+ "Parameters":"Parâmetros",
+ "Parameter":"Parâmetro",
+ "Value":"Valor",
+ "Description":"Descrição",
+ "Parameter Type":"Tipo de parâmetro",
+ "Data Type":"Tipo de dados",
+ "Response Messages":"Mensagens de resposta",
+ "HTTP Status Code":"Código de status HTTP",
+ "Reason":"Razão",
+ "Response Model":"Modelo resposta",
+ "Request URL":"URL requisição",
+ "Response Body":"Corpo da resposta",
+ "Response Code":"Código da resposta",
+ "Response Headers":"Cabeçalho da resposta",
+ "Headers":"Cabeçalhos",
+ "Hide Response":"Esconder resposta",
+ "Try it out!":"Tente agora!",
+ "Show/Hide":"Mostrar/Esconder",
+ "List Operations":"Listar operações",
+ "Expand Operations":"Expandir operações",
+ "Raw":"Cru",
+ "can't parse JSON. Raw result":"Falha ao analisar JSON. Resulto cru",
+ "Model Schema":"Modelo esquema",
+ "Model":"Modelo",
+ "apply":"Aplicar",
+ "Username":"Usuário",
+ "Password":"Senha",
+ "Terms of service":"Termos do serviço",
+ "Created by":"Criado por",
+ "See more at":"Veja mais em",
+ "Contact the developer":"Contate o desenvolvedor",
+ "api version":"Versão api",
+ "Response Content Type":"Tipo de conteúdo da resposta",
+ "fetching resource":"busca recurso",
+ "fetching resource list":"buscando lista de recursos",
+ "Explore":"Explorar",
+ "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"Não é possível ler do servidor. Pode não ter as apropriadas configurações access-control-origin",
+ "Please specify the protocol for":"Por favor especifique o protocolo",
+ "Can't read swagger JSON from":"Não é possível ler o JSON Swagger de",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Carregar informação de recurso finalizada. Renderizando Swagger UI",
+ "Unable to read api":"Não foi possível ler api",
+ "from path":"do caminho",
+ "server returned":"servidor retornou"
+});
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/ru.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/ru.js
new file mode 100644
index 0000000..592744e
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/ru.js
@@ -0,0 +1,56 @@
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Предупреждение: Устарело",
+ "Implementation Notes":"Заметки",
+ "Response Class":"Пример ответа",
+ "Status":"Статус",
+ "Parameters":"Параметры",
+ "Parameter":"Параметр",
+ "Value":"Значение",
+ "Description":"Описание",
+ "Parameter Type":"Тип параметра",
+ "Data Type":"Тип данных",
+ "HTTP Status Code":"HTTP код",
+ "Reason":"Причина",
+ "Response Model":"Структура ответа",
+ "Request URL":"URL запроса",
+ "Response Body":"Тело ответа",
+ "Response Code":"HTTP код ответа",
+ "Response Headers":"Заголовки ответа",
+ "Hide Response":"Спрятать ответ",
+ "Headers":"Заголовки",
+ "Response Messages":"Что может прийти в ответ",
+ "Try it out!":"Попробовать!",
+ "Show/Hide":"Показать/Скрыть",
+ "List Operations":"Операции кратко",
+ "Expand Operations":"Операции подробно",
+ "Raw":"В сыром виде",
+ "can't parse JSON. Raw result":"Не удается распарсить ответ:",
+ "Example Value":"Пример",
+ "Model Schema":"Структура",
+ "Model":"Описание",
+ "Click to set as parameter value":"Нажмите, чтобы испльзовать в качестве значения параметра",
+ "apply":"применить",
+ "Username":"Имя пользователя",
+ "Password":"Пароль",
+ "Terms of service":"Условия использования",
+ "Created by":"Разработано",
+ "See more at":"Еще тут",
+ "Contact the developer":"Связаться с разработчиком",
+ "api version":"Версия API",
+ "Response Content Type":"Content Type ответа",
+ "Parameter content type:":"Content Type параметра:",
+ "fetching resource":"Получение ресурса",
+ "fetching resource list":"Получение ресурсов",
+ "Explore":"Показать",
+ "Show Swagger Petstore Example Apis":"Показать примеры АПИ",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"Не удается получить ответ от сервера. Возможно, проблема с настройками доступа",
+ "Please specify the protocol for":"Пожалуйста, укажите протокол для",
+ "Can't read swagger JSON from":"Не получается прочитать swagger json из",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ресурсах завершена. Рендерим",
+ "Unable to read api":"Не удалось прочитать api",
+ "from path":"по адресу",
+ "server returned":"сервер сказал"
+});
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/tr.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/tr.js
new file mode 100644
index 0000000..16426a9
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/tr.js
@@ -0,0 +1,53 @@
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Uyarı: Deprecated",
+ "Implementation Notes":"Gerçekleştirim Notları",
+ "Response Class":"Dönen Sınıf",
+ "Status":"Statü",
+ "Parameters":"Parametreler",
+ "Parameter":"Parametre",
+ "Value":"Değer",
+ "Description":"Açıklama",
+ "Parameter Type":"Parametre Tipi",
+ "Data Type":"Veri Tipi",
+ "Response Messages":"Dönüş Mesajı",
+ "HTTP Status Code":"HTTP Statü Kodu",
+ "Reason":"Gerekçe",
+ "Response Model":"Dönüş Modeli",
+ "Request URL":"İstek URL",
+ "Response Body":"Dönüş İçeriği",
+ "Response Code":"Dönüş Kodu",
+ "Response Headers":"Dönüş Üst Bilgileri",
+ "Hide Response":"Dönüşü Gizle",
+ "Headers":"Üst Bilgiler",
+ "Try it out!":"Dene!",
+ "Show/Hide":"Göster/Gizle",
+ "List Operations":"Operasyonları Listele",
+ "Expand Operations":"Operasyonları Aç",
+ "Raw":"Ham",
+ "can't parse JSON. Raw result":"JSON çözümlenemiyor. Ham sonuç",
+ "Model Schema":"Model Şema",
+ "Model":"Model",
+ "apply":"uygula",
+ "Username":"Kullanıcı Adı",
+ "Password":"Parola",
+ "Terms of service":"Servis şartları",
+ "Created by":"Oluşturan",
+ "See more at":"Daha fazlası için",
+ "Contact the developer":"Geliştirici ile İletişime Geçin",
+ "api version":"api versiyon",
+ "Response Content Type":"Dönüş İçerik Tipi",
+ "fetching resource":"kaynak getiriliyor",
+ "fetching resource list":"kaynak listesi getiriliyor",
+ "Explore":"Keşfet",
+ "Show Swagger Petstore Example Apis":"Swagger Petstore Örnek Api'yi Gör",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"Sunucudan okuma yapılamıyor. Sunucu access-control-origin ayarlarınızı kontrol edin.",
+ "Please specify the protocol for":"Lütfen istenen adres için protokol belirtiniz",
+ "Can't read swagger JSON from":"Swagger JSON bu kaynaktan okunamıyor",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Kaynak baglantısı tamamlandı. Swagger UI gösterime hazırlanıyor",
+ "Unable to read api":"api okunamadı",
+ "from path":"yoldan",
+ "server returned":"sunucuya dönüldü"
+});
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/translator.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/translator.js
new file mode 100644
index 0000000..591f6d4
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/translator.js
@@ -0,0 +1,39 @@
+'use strict';
+
+/**
+ * Translator for documentation pages.
+ *
+ * To enable translation you should include one of language-files in your index.html
+ * after <script src='lang/translator.js' type='text/javascript'></script>.
+ * For example - <script src='lang/ru.js' type='text/javascript'></script>
+ *
+ * If you wish to translate some new texsts you should do two things:
+ * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too.
+ * 2. Mark that text it templates this way <anyHtmlTag data-sw-translate>New Phrase</anyHtmlTag> or <anyHtmlTag data-sw-translate value='New Phrase'/>.
+ * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate.
+ *
+ */
+window.SwaggerTranslator = {
+
+ _words:[],
+
+ translate: function(sel) {
+ var $this = this;
+ sel = sel || '[data-sw-translate]';
+
+ $(sel).each(function() {
+ $(this).html($this._tryTranslate($(this).html()));
+
+ $(this).val($this._tryTranslate($(this).val()));
+ $(this).attr('title', $this._tryTranslate($(this).attr('title')));
+ });
+ },
+
+ _tryTranslate: function(word) {
+ return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word;
+ },
+
+ learn: function(wordsMap) {
+ this._words = wordsMap;
+ }
+};
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/zh-cn.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/zh-cn.js
new file mode 100644
index 0000000..570319b
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lang/zh-cn.js
@@ -0,0 +1,53 @@
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"警告:已过时",
+ "Implementation Notes":"实现备注",
+ "Response Class":"响应类",
+ "Status":"状态",
+ "Parameters":"参数",
+ "Parameter":"参数",
+ "Value":"值",
+ "Description":"描述",
+ "Parameter Type":"参数类型",
+ "Data Type":"数据类型",
+ "Response Messages":"响应消息",
+ "HTTP Status Code":"HTTP状态码",
+ "Reason":"原因",
+ "Response Model":"响应模型",
+ "Request URL":"请求URL",
+ "Response Body":"响应体",
+ "Response Code":"响应码",
+ "Response Headers":"响应头",
+ "Hide Response":"隐藏响应",
+ "Headers":"头",
+ "Try it out!":"试一下!",
+ "Show/Hide":"显示/隐藏",
+ "List Operations":"显示操作",
+ "Expand Operations":"展开操作",
+ "Raw":"原始",
+ "can't parse JSON. Raw result":"无法解析JSON. 原始结果",
+ "Model Schema":"模型架构",
+ "Model":"模型",
+ "apply":"应用",
+ "Username":"用户名",
+ "Password":"密码",
+ "Terms of service":"服务条款",
+ "Created by":"创建者",
+ "See more at":"查看更多:",
+ "Contact the developer":"联系开发者",
+ "api version":"api版本",
+ "Response Content Type":"响应Content Type",
+ "fetching resource":"正在获取资源",
+ "fetching resource list":"正在获取资源列表",
+ "Explore":"浏览",
+ "Show Swagger Petstore Example Apis":"显示 Swagger Petstore 示例 Apis",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"无法从服务器读取。可能没有正确设置access-control-origin。",
+ "Please specify the protocol for":"请指定协议:",
+ "Can't read swagger JSON from":"无法读取swagger JSON于",
+ "Finished Loading Resource Information. Rendering Swagger UI":"已加载资源信息。正在渲染Swagger UI",
+ "Unable to read api":"无法读取api",
+ "from path":"从路径",
+ "server returned":"服务器返回"
+});
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/backbone-min.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/backbone-min.js
new file mode 100644
index 0000000..a3f544b
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/backbone-min.js
@@ -0,0 +1,15 @@
+// Backbone.js 1.1.2
+
+(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h<u;h++){t=o[h];if(a=this._events[t]){this._events[t]=s=[];if(e||r){for(l=0,f=a.length;l<f;l++){n=a[l];if(e&&e!==n.callback&&e!==n.callback._callback||r&&r!==n.context){s.push(n)}}}if(!s.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=o.call(arguments,1);if(!c(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)f(i,e);if(r)f(r,arguments);return this},stopListening:function(t,e,r){var s=this._listeningTo;if(!s)return this;var n=!e&&!r;if(!r&&typeof e==="object")r=this;if(t)(s={})[t._listenId]=t;for(var a in s){t=s[a];t.off(e,r,this);if(n||i.isEmpty(t._events))delete this._listeningTo[a]}return this}};var l=/\s+/;var c=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(l.test(i)){var n=i.split(l);for(var a=0,o=n.length;a<o;a++){t[e].apply(t,[n[a]].concat(r))}return false}return true};var f=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],o=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,o);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e);return}};var d={listenTo:"on",listenToOnce:"once"};i.each(d,function(t,e){u[e]=function(e,r,s){var n=this._listeningTo||(this._listeningTo={});var a=e._listenId||(e._listenId=i.uniqueId("l"));n[a]=e;if(!s&&typeof r==="object")s=this;e[t](r,s,this);return this}});u.bind=u.on;u.unbind=u.off;i.extend(e,u);var p=e.Model=function(t,e){var r=t||{};e||(e={});this.cid=i.uniqueId("c");this.attributes={};if(e.collection)this.collection=e.collection;if(e.parse)r=this.parse(r,e)||{};r=i.defaults({},r,i.result(this,"defaults"));this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};i.extend(p.prototype,u,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,r){var s,n,a,o,h,u,l,c;if(t==null)return this;if(typeof t==="object"){n=t;r=e}else{(n={})[t]=e}r||(r={});if(!this._validate(n,r))return false;a=r.unset;h=r.silent;o=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=i.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in n)this.id=n[this.idAttribute];for(s in n){e=n[s];if(!i.isEqual(c[s],e))o.push(s);if(!i.isEqual(l[s],e)){this.changed[s]=e}else{delete this.changed[s]}a?delete c[s]:c[s]=e}if(!h){if(o.length)this._pending=r;for(var f=0,d=o.length;f<d;f++){this.trigger("change:"+o[f],this,c[o[f]],r)}}if(u)return this;if(!h){while(this._pending){r=this._pending;this._pending=false;this.trigger("change",this,r)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:true}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,i.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!i.isEmpty(this.changed);return i.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?i.clone(this.changed):false;var e,r=false;var s=this._changing?this._previousAttributes:this.attributes;for(var n in t){if(i.isEqual(s[n],e=t[n]))continue;(r||(r={}))[n]=e}return r},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var r=t.success;t.success=function(i){if(!e.set(e.parse(i,t),t))return false;if(r)r(e,i,t);e.trigger("sync",e,i,t)};q(this,t);return this.sync("read",this,t)},save:function(t,e,r){var s,n,a,o=this.attributes;if(t==null||typeof t==="object"){s=t;r=e}else{(s={})[t]=e}r=i.extend({validate:true},r);if(s&&!r.wait){if(!this.set(s,r))return false}else{if(!this._validate(s,r))return false}if(s&&r.wait){this.attributes=i.extend({},o,s)}if(r.parse===void 0)r.parse=true;var h=this;var u=r.success;r.success=function(t){h.attributes=o;var e=h.parse(t,r);if(r.wait)e=i.extend(s||{},e);if(i.isObject(e)&&!h.set(e,r)){return false}if(u)u(h,t,r);h.trigger("sync",h,t,r)};q(this,r);n=this.isNew()?"create":r.patch?"patch":"update";if(n==="patch")r.attrs=s;a=this.sync(n,this,r);if(s&&r.wait)this.attributes=o;return a},destroy:function(t){t=t?i.clone(t):{};var e=this;var r=t.success;var s=function(){e.trigger("destroy",e,e.collection,t)};t.success=function(i){if(t.wait||e.isNew())s();if(r)r(e,i,t);if(!e.isNew())e.trigger("sync",e,i,t)};if(this.isNew()){t.success();return false}q(this,t);var n=this.sync("delete",this,t);if(!t.wait)s();return n},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||M();if(this.isNew())return t;return t.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend(t||{},{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=i.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;if(!r)return true;this.trigger("invalid",this,r,i.extend(e,{validationError:r}));return false}});var v=["keys","values","pairs","invert","pick","omit"];i.each(v,function(t){p.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.attributes);return i[t].apply(i,e)}});var g=e.Collection=function(t,e){e||(e={});if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,i.extend({silent:true},e))};var m={add:true,remove:true,merge:true};var y={add:true,remove:false};i.extend(g.prototype,u,{model:p,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:false},e,y))},remove:function(t,e){var r=!i.isArray(t);t=r?[t]:i.clone(t);e||(e={});var s,n,a,o;for(s=0,n=t.length;s<n;s++){o=t[s]=this.get(t[s]);if(!o)continue;delete this._byId[o.id];delete this._byId[o.cid];a=this.indexOf(o);this.models.splice(a,1);this.length--;if(!e.silent){e.index=a;o.trigger("remove",o,this,e)}this._removeReference(o,e)}return r?t[0]:t},set:function(t,e){e=i.defaults({},e,m);if(e.parse)t=this.parse(t,e);var r=!i.isArray(t);t=r?t?[t]:[]:i.clone(t);var s,n,a,o,h,u,l;var c=e.at;var f=this.model;var d=this.comparator&&c==null&&e.sort!==false;var v=i.isString(this.comparator)?this.comparator:null;var g=[],y=[],_={};var b=e.add,w=e.merge,x=e.remove;var E=!d&&b&&x?[]:false;for(s=0,n=t.length;s<n;s++){h=t[s]||{};if(h instanceof p){a=o=h}else{a=h[f.prototype.idAttribute||"id"]}if(u=this.get(a)){if(x)_[u.cid]=true;if(w){h=h===o?o.attributes:h;if(e.parse)h=u.parse(h,e);u.set(h,e);if(d&&!l&&u.hasChanged(v))l=true}t[s]=u}else if(b){o=t[s]=this._prepareModel(h,e);if(!o)continue;g.push(o);this._addReference(o,e)}o=u||o;if(E&&(o.isNew()||!_[o.id]))E.push(o);_[o.id]=true}if(x){for(s=0,n=this.length;s<n;++s){if(!_[(o=this.models[s]).cid])y.push(o)}if(y.length)this.remove(y,e)}if(g.length||E&&E.length){if(d)l=true;this.length+=g.length;if(c!=null){for(s=0,n=g.length;s<n;s++){this.models.splice(c+s,0,g[s])}}else{if(E)this.models.length=0;var k=E||g;for(s=0,n=k.length;s<n;s++){this.models.push(k[s])}}}if(l)this.sort({silent:true});if(!e.silent){for(s=0,n=g.length;s<n;s++){(o=g[s]).trigger("add",o,this,e)}if(l||E&&E.length)this.trigger("sort",this,e)}return r?t[0]:t},reset:function(t,e){e||(e={});for(var r=0,s=this.models.length;r<s;r++){this._removeReference(this.models[r],e)}e.previousModels=this.models;this._reset();t=this.add(t,i.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);this.remove(e,t);return e},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);this.remove(e,t);return e},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(t==null)return void 0;return this._byId[t]||this._byId[t.id]||this._byId[t.cid]},at:function(t){return this.models[t]},where:function(t,e){if(i.isEmpty(t))return e?void 0:[];return this[e?"find":"filter"](function(e){for(var i in t){if(t[i]!==e.get(i))return false}return true})},findWhere:function(t){return this.where(t,true)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");t||(t={});if(i.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(i.bind(this.comparator,this))}if(!t.silent)this.trigger("sort",this,t);return this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=t.success;var r=this;t.success=function(i){var s=t.reset?"reset":"set";r[s](i,t);if(e)e(r,i,t);r.trigger("sync",r,i,t)};q(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?i.clone(e):{};if(!(t=this._prepareModel(t,e)))return false;if(!e.wait)this.add(t,e);var r=this;var s=e.success;e.success=function(t,i){if(e.wait)r.add(t,e);if(s)s(t,i,e)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(t instanceof p)return t;e=e?i.clone(e):{};e.collection=this;var r=new this.model(t,e);if(!r.validationError)return r;this.trigger("invalid",this,r.validationError,e);return false},_addReference:function(t,e){this._byId[t.cid]=t;if(t.id!=null)this._byId[t.id]=t;if(!t.collection)t.collection=this;t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(e&&t==="change:"+e.idAttribute){delete this._byId[e.previous(e.idAttribute)];if(e.id!=null)this._byId[e.id]=e}this.trigger.apply(this,arguments)}});var _=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];i.each(_,function(t){g.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.models);return i[t].apply(i,e)}});var b=["groupBy","countBy","sortBy","indexBy"];i.each(b,function(t){g.prototype[t]=function(e,r){var s=i.isFunction(e)?e:function(t){return t.get(e)};return i[t](this.models,s,r)}});var w=e.View=function(t){this.cid=i.uniqueId("view");t||(t={});i.extend(this,i.pick(t,E));this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var x=/^(\S+)\s*(.*)$/;var E=["model","collection","el","id","attributes","className","tagName","events"];i.extend(w.prototype,u,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(t,i){if(this.$el)this.undelegateEvents();this.$el=t instanceof e.$?t:e.$(t);this.el=this.$el[0];if(i!==false)this.delegateEvents();return this},delegateEvents:function(t){if(!(t||(t=i.result(this,"events"))))return this;this.undelegateEvents();for(var e in t){var r=t[e];if(!i.isFunction(r))r=this[t[e]];if(!r)continue;var s=e.match(x);var n=s[1],a=s[2];r=i.bind(r,this);n+=".delegateEvents"+this.cid;if(a===""){this.$el.on(n,r)}else{this.$el.on(n,a,r)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_ensureElement:function(){if(!this.el){var t=i.extend({},i.result(this,"attributes"));if(this.id)t.id=i.result(this,"id");if(this.className)t["class"]=i.result(this,"className");var r=e.$("<"+i.result(this,"tagName")+">").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSON(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=a.hide().appendTo("body")[0].contentWindow;this.navigate(r)}if(this._hasPushState){e.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!n){e.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=r;var o=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){this.fragment=this.getFragment(null,true);this.location.replace(this.root+"#"+this.fragment);return true}else if(this._hasPushState&&this.atRoot()&&o.hash){this.fragment=this.getHash().replace(R,"");this.history.replaceState({},document.title,this.root+this.fragment)}}if(!this.options.silent)return this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);N.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){t=this.fragment=this.getFragment(t);return i.any(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!N.started)return false;if(!e||e===true)e={trigger:!!e};var i=this.root+(t=this.getFragment(t||""));t=t.replace(j,"");if(this.fragment===t)return;this.fragment=t;if(t===""&&i!=="/")i=i.slice(0,-1);if(this._hasPushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});e.history=new N;var U=function(t,e){var r=this;var s;if(t&&i.has(t,"constructor")){s=t.constructor}else{s=function(){return r.apply(this,arguments)}}i.extend(s,r,e);var n=function(){this.constructor=s};n.prototype=r.prototype;s.prototype=new n;if(t)i.extend(s.prototype,t);s.__super__=r.prototype;return s};p.extend=g.extend=$.extend=w.extend=N.extend=U;var M=function(){throw new Error('A "url" property or function must be specified')};var q=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error",t,r,e)}};return e});
+
+// From http://stackoverflow.com/a/19431552
+// Compatibility override - Backbone 1.1 got rid of the 'options' binding
+// automatically to views in the constructor - we need to keep that.
+Backbone.View = (function(View) {
+ return View.extend({
+ constructor: function(options) {
+ this.options = options || {};
+ View.apply(this, arguments);
+ }
+ });
+})(Backbone.View); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/handlebars-2.0.0.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/handlebars-2.0.0.js
new file mode 100644
index 0000000..53cf921
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/handlebars-2.0.0.js
@@ -0,0 +1,28 @@
+/*!
+
+ handlebars v2.0.0
+
+Copyright (C) 2011-2014 by Yehuda Katz
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+@license
+*/
+!function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.Handlebars=a.Handlebars||b()}(this,function(){var a=function(){"use strict";function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){"use strict";function b(a){return i[a]}function c(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function d(a){return a instanceof h?a.toString():null==a?"":a?(a=""+a,k.test(a)?a.replace(j,b):a):a+""}function e(a){return a||0===a?n(a)&&0===a.length?!0:!1:!0}function f(a,b){return(a?a+".":"")+b}var g={},h=a,i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},j=/[&<>"'`]/g,k=/[&<>"'`]/;g.extend=c;var l=Object.prototype.toString;g.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)});var m;g.isFunction=m;var n=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===l.call(a):!1};return g.isArray=n,g.escapeExpression=d,g.isEmpty=e,g.appendContextPath=f,g}(a),c=function(){"use strict";function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f<c.length;f++)this[c[f]]=e[c[f]];d&&(this.lineNumber=d,this.column=b.firstColumn)}var b,c=["description","fileName","lineNumber","message","name","number","stack"];return a.prototype=new Error,b=a}(),d=function(a,b){"use strict";function c(a,b){this.helpers=a||{},this.partials=b||{},d(this)}function d(a){a.registerHelper("helperMissing",function(){if(1===arguments.length)return void 0;throw new g("Missing helper: '"+arguments[arguments.length-1].name+"'")}),a.registerHelper("blockHelperMissing",function(b,c){var d=c.inverse,e=c.fn;if(b===!0)return e(this);if(b===!1||null==b)return d(this);if(k(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=q(c.data);g.contextPath=f.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){if(!b)throw new g("Must pass iterator to #each");var c,d,e=b.fn,h=b.inverse,i=0,j="";if(b.data&&b.ids&&(d=f.appendContextPath(b.data.contextPath,b.ids[0])+"."),l(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(k(a))for(var m=a.length;m>i;i++)c&&(c.index=i,c.first=0===i,c.last=i===a.length-1,d&&(c.contextPath=d+i)),j+=e(a[i],{data:c});else for(var n in a)a.hasOwnProperty(n)&&(c&&(c.key=n,c.index=i,c.first=0===i,d&&(c.contextPath=d+n)),j+=e(a[n],{data:c}),i++);return 0===i&&(j=h(this)),j}),a.registerHelper("if",function(a,b){return l(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||f.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){l(a)&&(a=a.call(this));var c=b.fn;if(f.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=q(b.data);d.contextPath=f.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}var e={},f=a,g=b,h="2.0.0";e.VERSION=h;var i=6;e.COMPILER_REVISION=i;var j={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};e.REVISION_CHANGES=j;var k=f.isArray,l=f.isFunction,m=f.toString,n="[object Object]";e.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:o,log:p,registerHelper:function(a,b){if(m.call(a)===n){if(b)throw new g("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){m.call(a)===n?f.extend(this.partials,a):this.partials[a]=b},unregisterPartial:function(a){delete this.partials[a]}};var o={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(o.level<=a){var c=o.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};e.logger=o;var p=o.log;e.log=p;var q=function(a){var b=f.extend({},a);return b._parent=a,b};return e.createFrame=q,e}(b,c),e=function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");if(!a||!a.main)throw new l("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var c=function(c,d,e,f,g,h,i,j,m){g&&(f=k.extend({},f,g));var n=b.VM.invokePartial.call(this,c,e,f,h,i,j,m);if(null==n&&b.compile){var o={helpers:h,partials:i,data:j,depths:m};i[e]=b.compile(c,{data:void 0!==j,compat:a.compat},b),n=i[e](f,o)}if(null!=n){if(d){for(var p=n.split("\n"),q=0,r=p.length;r>q&&(p[q]||q+1!==r);q++)p[q]=d+p[q];n=p.join("\n")}return n}throw new l("The partial "+e+" could not be compiled when running in runtime-only mode")},d={lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:k.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c){var d=this.programs[a],e=this.fn(a);return b||c?d=f(this,a,e,b,c):d||(d=this.programs[a]=f(this,a,e)),d},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=k.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler},e=function(b,c){c=c||{};var f=c.data;e._setup(c),!c.partial&&a.useData&&(f=i(b,f));var g;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(d,b,d.helpers,d.partials,f,g)};return e.isTop=!0,e._setup=function(c){c.partial?(d.helpers=c.helpers,d.partials=c.partials):(d.helpers=d.merge(c.helpers,b.helpers),a.usePartial&&(d.partials=d.merge(c.partials,b.partials)))},e._child=function(b,c,e){if(a.useDepths&&!e)throw new l("must pass parent depths");return f(d,b,a[b],c,e)},e}function f(a,b,c,d,e){var f=function(b,f){return f=f||{},c.call(a,b,a.helpers,a.partials,f.data||d,e&&[b].concat(e))};return f.program=b,f.depth=e?e.length:0,f}function g(a,b,c,d,e,f,g){var h={partial:!0,helpers:d,partials:e,data:f,depths:g};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,h):void 0}function h(){return""}function i(a,b){return b&&"root"in b||(b=b?o(b):{},b.root=a),b}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES,o=c.createFrame;return j.checkRevision=d,j.template=e,j.program=f,j.invokePartial=g,j.noop=h,j}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.escapeExpression=j.escapeExpression,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,m["default"]=m,f=m}(d,a,c,b,e),g=function(a){"use strict";function b(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var c,d=a,e={ProgramNode:function(a,c,d){b.call(this,d),this.type="program",this.statements=a,this.strip=c},MustacheNode:function(a,c,d,f,g){if(b.call(this,g),this.type="mustache",this.strip=f,null!=d&&d.charAt){var h=d.charAt(3)||d.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!d;this.sexpr=a instanceof e.SexprNode?a:new e.SexprNode(a,c),this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,c,d){b.call(this,d),this.type="sexpr",this.hash=c;var e=this.id=a[0],f=this.params=a.slice(1);this.isHelper=!(!f.length&&!c),this.eligibleHelper=this.isHelper||e.isSimple},PartialNode:function(a,c,d,e,f){b.call(this,f),this.type="partial",this.partialName=a,this.context=c,this.hash=d,this.strip=e,this.strip.inlineStandalone=!0},BlockNode:function(a,c,d,e,f){b.call(this,f),this.type="block",this.mustache=a,this.program=c,this.inverse=d,this.strip=e,d&&!c&&(this.isInverse=!0)},RawBlockNode:function(a,c,f,g){if(b.call(this,g),a.sexpr.id.original!==f)throw new d(a.sexpr.id.original+" doesn't match "+f,this);c=new e.ContentNode(c,g),this.type="block",this.mustache=a,this.program=new e.ProgramNode([c],{},g)},ContentNode:function(a,c){b.call(this,c),this.type="content",this.original=this.string=a},HashNode:function(a,c){b.call(this,c),this.type="hash",this.pairs=a},IdNode:function(a,c){b.call(this,c),this.type="ID";for(var e="",f=[],g=0,h="",i=0,j=a.length;j>i;i++){var k=a[i].part;if(e+=(a[i].separator||"")+k,".."===k||"."===k||"this"===k){if(f.length>0)throw new d("Invalid path: "+e,this);".."===k?(g++,h+="../"):this.isScoped=!0}else f.push(k)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.idName=h+this.string,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,c){b.call(this,c),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,c){b.call(this,c),this.type="DATA",this.id=a,this.stringModeValue=a.stringModeValue,this.idName="@"+a.stringModeValue},StringNode:function(a,c){b.call(this,c),this.type="STRING",this.original=this.string=this.stringModeValue=a},NumberNode:function(a,c){b.call(this,c),this.type="NUMBER",this.original=this.number=a,this.stringModeValue=Number(a)},BooleanNode:function(a,c){b.call(this,c),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,c){b.call(this,c),this.type="comment",this.comment=a,this.strip={inlineStandalone:!0}}};return c=e}(c),h=function(){"use strict";var a,b=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,CONTENT:12,COMMENT:13,openRawBlock:14,END_RAW_BLOCK:15,OPEN_RAW_BLOCK:16,sexpr:17,CLOSE_RAW_BLOCK:18,openBlock:19,block_option0:20,closeBlock:21,openInverse:22,block_option1:23,OPEN_BLOCK:24,CLOSE:25,OPEN_INVERSE:26,inverseAndProgram:27,INVERSE:28,OPEN_ENDBLOCK:29,path:30,OPEN:31,OPEN_UNESCAPED:32,CLOSE_UNESCAPED:33,OPEN_PARTIAL:34,partialName:35,param:36,partial_option0:37,partial_option1:38,sexpr_repetition0:39,sexpr_option0:40,dataName:41,STRING:42,NUMBER:43,BOOLEAN:44,OPEN_SEXPR:45,CLOSE_SEXPR:46,hash:47,hash_repetition_plus0:48,hashSegment:49,ID:50,EQUALS:51,DATA:52,pathSegments:53,SEP:54,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],performAction:function(a,b,c,d,e,f){var g=f.length-1;switch(e){case 1:return d.prepareProgram(f[g-1].statements,!0),f[g-1];case 2:this.$=new d.ProgramNode(d.prepareProgram(f[g]),{},this._$);break;case 3:this.$=f[g];break;case 4:this.$=f[g];break;case 5:this.$=f[g];break;case 6:this.$=f[g];break;case 7:this.$=new d.ContentNode(f[g],this._$);break;case 8:this.$=new d.CommentNode(f[g],this._$);break;case 9:this.$=new d.RawBlockNode(f[g-2],f[g-1],f[g],this._$);break;case 10:this.$=new d.MustacheNode(f[g-1],null,"","",this._$);break;case 11:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!1,this._$);break;case 12:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!0,this._$);break;case 13:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 14:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 15:this.$={strip:d.stripFlags(f[g-1],f[g-1]),program:f[g]};break;case 16:this.$={path:f[g-1],strip:d.stripFlags(f[g-2],f[g])};break;case 17:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 18:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 19:this.$=new d.PartialNode(f[g-3],f[g-2],f[g-1],d.stripFlags(f[g-4],f[g]),this._$);break;case 20:this.$=new d.PartialNode(f[g-2],void 0,f[g-1],d.stripFlags(f[g-3],f[g]),this._$);break;case 21:this.$=new d.SexprNode([f[g-2]].concat(f[g-1]),f[g],this._$);break;case 22:this.$=new d.SexprNode([f[g]],null,this._$);break;case 23:this.$=f[g];break;case 24:this.$=new d.StringNode(f[g],this._$);break;case 25:this.$=new d.NumberNode(f[g],this._$);break;case 26:this.$=new d.BooleanNode(f[g],this._$);break;case 27:this.$=f[g];break;case 28:f[g-1].isHelper=!0,this.$=f[g-1];break;case 29:this.$=new d.HashNode(f[g],this._$);break;case 30:this.$=[f[g-2],f[g]];break;case 31:this.$=new d.PartialNameNode(f[g],this._$);break;case 32:this.$=new d.PartialNameNode(new d.StringNode(f[g],this._$),this._$);break;case 33:this.$=new d.PartialNameNode(new d.NumberNode(f[g],this._$));break;case 34:this.$=new d.DataNode(f[g],this._$);break;case 35:this.$=new d.IdNode(f[g],this._$);break;case 36:f[g-2].push({part:f[g],separator:f[g-1]}),this.$=f[g-2];break;case 37:this.$=[{part:f[g]}];break;case 38:this.$=[];break;case 39:f[g-1].push(f[g]);break;case 48:this.$=[];break;case 49:f[g-1].push(f[g]);break;case 52:this.$=[f[g]];break;case 53:f[g-1].push(f[g])}},table:[{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],defaultActions:{4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},parseError:function(a){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;g<f.length&&(c=this._input.match(this.rules[f[g]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 12;break;case 1:return 12;case 2:return this.popState(),12;case 3:return b.yytext=b.yytext.substr(5,b.yyleng-9),this.popState(),15;case 4:return 12;case 5:return e(0,4),this.popState(),13;case 6:return 45;case 7:return 46;case 8:return 16;case 9:return this.popState(),this.begin("raw"),18;case 10:return 34;case 11:return 24;case 12:return 29;case 13:return this.popState(),28;case 14:return this.popState(),28;case 15:return 26;case 16:return 26;case 17:return 32;case 18:return 31;case 19:this.popState(),this.begin("com");break;case 20:return e(3,5),this.popState(),13;case 21:return 31;case 22:return 51;case 23:return 50;case 24:return 50;case 25:return 54;case 26:break;case 27:return this.popState(),33;case 28:return this.popState(),25;case 29:return b.yytext=e(1,2).replace(/\\"/g,'"'),42;case 30:return b.yytext=e(1,2).replace(/\\'/g,"'"),42;case 31:return 52;case 32:return 44;case 33:return 44;case 34:return 43;case 35:return 50;case 36:return b.yytext=e(1,2),50;case 37:return"INVALID";case 38:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[5],inclusive:!1},raw:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,1,38],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();return a=b}(),i=function(a){"use strict";function b(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt(b.length-3)}}function c(a,b,c,d,i,k){if(a.sexpr.id.original!==d.path.original)throw new j(a.sexpr.id.original+" doesn't match "+d.path.original,a);var l=c&&c.program,m={left:a.strip.left,right:d.strip.right,openStandalone:f(b.statements),closeStandalone:e((l||b).statements)};if(a.strip.right&&g(b.statements,null,!0),l){var n=c.strip;n.left&&h(b.statements,null,!0),n.right&&g(l.statements,null,!0),d.strip.left&&h(l.statements,null,!0),e(b.statements)&&f(l.statements)&&(h(b.statements),g(l.statements))}else d.strip.left&&h(b.statements,null,!0);return i?new this.BlockNode(a,l,b,m,k):new this.BlockNode(a,b,l,m,k)}function d(a,b){for(var c=0,d=a.length;d>c;c++){var i=a[c],j=i.strip;if(j){var k=e(a,c,b,"partial"===i.type),l=f(a,c,b),m=j.openStandalone&&k,n=j.closeStandalone&&l,o=j.inlineStandalone&&k&&l;j.right&&g(a,c,!0),j.left&&h(a,c,!0),o&&(g(a,c),h(a,c)&&"partial"===i.type&&(i.indent=/([ \t]+$)/.exec(a[c-1].original)?RegExp.$1:"")),m&&(g((i.program||i.inverse).statements),h(a,c)),n&&(g(a,c),h((i.inverse||i.program).statements))}}return a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"content"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"content"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"content"===d.type&&(c||!d.rightStripped)){var e=d.string;d.string=d.string.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.string!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"content"===d.type&&(c||!d.leftStripped)){var e=d.string;return d.string=d.string.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.string!==e,d.leftStripped}}var i={},j=a;return i.stripFlags=b,i.prepareBlock=c,i.prepareProgram=d,i}(c),j=function(a,b,c,d){"use strict";function e(a){return a.constructor===h.ProgramNode?a:(g.yy=k,g.parse(a))}var f={},g=a,h=b,i=c,j=d.extend;f.parser=g;var k={};return j(k,i,h),f.parse=e,f}(h,g,i,b),k=function(a,b){"use strict";function c(){}function d(a,b,c){if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new h("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function e(a,b,c){function d(){var d=c.parse(a),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new h("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var e,f=function(a,b){return e||(e=d()),e.call(this,a,b)};return f._setup=function(a){return e||(e=d()),e._setup(a)},f._child=function(a,b,c){return e||(e=d()),e._child(a,b,c)},f}function f(a,b){if(a===b)return!0;if(i(a)&&i(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!f(a[c],b[c]))return!1;return!0}}var g={},h=a,i=b.isArray,j=[].slice;return g.Compiler=c,c.prototype={compiler:c,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;b>c;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!f(d.args,e.args))return!1}for(b=this.children.length,c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.opcodes=[],this.children=[],this.depths={list:[]},this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds;var c=this.options.knownHelpers;if(this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},accept:function(a){return this[a.type](a)},program:function(a){for(var b=a.statements,c=0,d=b.length;d>c;c++)this.accept(b[c]);return this.isSimple=1===d,this.depths.list=this.depths.list.sort(function(a,b){return a-b}),this},compileProgram:function(a){var b,c=(new this.compiler).compile(a,this.options),d=this.guid++;
+this.usePartial=this.usePartial||c.usePartial,this.children[d]=c;for(var e=0,f=c.depths.list.length;f>e;e++)b=c.depths.list[e],2>b||this.addDepth(b-1);return d},block:function(a){var b=a.mustache,c=a.program,d=a.inverse;c&&(c=this.compileProgram(c)),d&&(d=this.compileProgram(d));var e=b.sexpr,f=this.classifySexpr(e);"helper"===f?this.helperSexpr(e,c,d):"simple"===f?(this.simpleSexpr(e),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("blockValue",e.id.original)):(this.ambiguousSexpr(e,c,d),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(a){var b,c,d=a.pairs;for(this.opcode("pushHash"),b=0,c=d.length;c>b;b++)this.pushParam(d[b][1]);for(;b--;)this.opcode("assignToHash",d[b][0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0,a.hash?this.accept(a.hash):this.opcode("push","undefined"),a.context?this.accept(a.context):(this.opcode("getContext",0),this.opcode("pushContext")),this.opcode("invokePartial",b.name,a.indent||""),this.opcode("append")},content:function(a){a.string&&this.opcode("appendContent",a.string)},mustache:function(a){this.sexpr(a.sexpr),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(a,b,c){var d=a.id,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.ID(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.id;"DATA"===b.type?this.DATA(b):b.parts.length?this.ID(b):(this.addDepth(b.depth),this.opcode("getContext",b.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.id,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new h("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.falsy=!0,this.ID(e),this.opcode("invokeHelper",d.length,e.original,e.isSimple)}},sexpr:function(a){var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ID:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0];b?this.opcode("lookupOnContext",a.parts,a.falsy,a.isScoped):this.opcode("pushContext")},DATA:function(a){this.options.data=!0,this.opcode("lookupData",a.id.depth,a.id.parts)},STRING:function(a){this.opcode("pushString",a.string)},NUMBER:function(a){this.opcode("pushLiteral",a.number)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:j.call(arguments,1)})},addDepth:function(a){0!==a&&(this.depths[a]||(this.depths[a]=!0,this.depths.list.push(a)))},classifySexpr:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;if(c&&!b){var e=a.id.parts[0];d.knownHelpers[e]?b=!0:d.knownHelpersOnly&&(c=!1)}return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;c>b;b++)this.pushParam(a[b])},pushParam:function(a){this.stringParams?(a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",a.stringModeValue,a.type),"sexpr"===a.type&&this.sexpr(a)):(this.trackIds&&this.opcode("pushId",a.type,a.idName||a.stringModeValue),this.accept(a))},setupFullMustacheParams:function(a,b,c){var d=a.params;return this.pushParams(d),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.hash(a.hash):this.opcode("emptyHash"),d}},g.precompile=d,g.compile=e,g}(c,b),l=function(a,b){"use strict";function c(a){this.value=a}function d(){}var e,f=a.COMPILER_REVISION,g=a.REVISION_CHANGES,h=b;d.prototype={nameLookup:function(a,b){return d.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']"},depthedLookup:function(a){return this.aliases.lookup="this.lookup",'lookup(depths, "'+a+'")'},compilerInfo:function(){var a=f,b=g[a];return[a,b]},appendToBuffer:function(a){return this.environment.isSimple?"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.depths.list.length||this.options.compat;var e,f,g,i=a.opcodes;for(f=0,g=i.length;g>f;f++)e=i[f],this[e.opcode].apply(this,e.args);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new h("Compile completed with content left on stack");var j=this.createFunctionContext(d);if(this.isChild)return j;var k={compiler:this.compilerInfo(),main:j},l=this.context.programs;for(f=0,g=l.length;g>f;f++)l[f]&&(k[f]=l[f]);return this.environment.usePartial&&(k.usePartial=!0),this.options.data&&(k.useData=!0),this.useDepths&&(k.useDepths=!0),this.options.compat&&(k.compat=!0),d||(k.compiler=JSON.stringify(k.compiler),k=this.objectLiteral(k)),k},preamble:function(){this.lastContext=0,this.source=[]},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));for(var d in this.aliases)this.aliases.hasOwnProperty(d)&&(b+=", "+d+"="+this.aliases[d]);var e=["depth0","helpers","partials","data"];this.useDepths&&e.push("depths");var f=this.mergeSource(b);return a?(e.push(f),Function.apply(this,e)):"function("+e.join(",")+") {\n "+f+"}"},mergeSource:function(a){for(var b,c,d="",e=!this.forceBuffer,f=0,g=this.source.length;g>f;f++){var h=this.source[f];h.appendToBuffer?b=b?b+"\n + "+h.content:h.content:(b&&(d?d+="buffer += "+b+";\n ":(c=!0,d=b+";\n "),b=void 0),d+=h+"\n ",this.environment.isSimple||(e=!1))}return e?(b||!d)&&(d+="return "+(b||'""')+";\n"):(a+=", buffer = "+(c?"":this.initializeBuffer()),d+=b?"return buffer + "+b+";\n":"return buffer;\n"),a&&(d="var "+a.substring(2)+(c?"":";\n ")+d),d},blockValue:function(a){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var b=[this.contextName(0)];this.setupParams(a,0,b);var c=this.popStack();b.splice(1,0,c),this.push("blockHelperMissing.call("+b.join(", ")+")")},ambiguousBlockValue:function(){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=[this.contextName(0)];this.setupParams("",0,a,!0),this.flushInline();var b=this.topStack();a.splice(1,0,b),this.pushSource("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.pendingContent&&(a=this.pendingContent+a),this.pendingContent=a},append:function(){this.flushInline();var a=this.popStack();this.pushSource("if ("+a+" != null) { "+this.appendToBuffer(a)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c){var d=0,e=a.length;for(c||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[d++]));e>d;d++)this.replaceStack(function(c){var e=this.nameLookup(c,a[d],"context");return b?" && "+e:" != null ? "+e+" : "+c})},lookupData:function(a,b){a?this.pushStackLiteral("this.data(data, "+a+")"):this.pushStackLiteral("data");for(var c=b.length,d=0;c>d;d++)this.replaceStack(function(a){return" && "+this.nameLookup(a,b[d],"data")})},resolvePossibleLambda:function(){this.aliases.lambda="this.lambda",this.push("lambda("+this.popStack()+", "+this.contextName(0)+")")},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"sexpr"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(){this.pushStackLiteral("{}"),this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push("{"+a.ids.join(",")+"}"),this.stringParams&&(this.push("{"+a.contexts.join(",")+"}"),this.push("{"+a.types.join(",")+"}")),this.push("{\n "+a.values.join(",\n ")+"\n }")},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){return this.inlineStack.push(a),a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},invokeHelper:function(a,b,c){this.aliases.helperMissing="helpers.helperMissing";var d=this.popStack(),e=this.setupHelper(a,b),f=(c?e.name+" || ":"")+d+" || helperMissing";this.push("(("+f+").call("+e.callParams+"))")},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.aliases.functionType='"function"',this.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper");this.push("((helper = (helper = "+e+" || "+c+") != null ? helper : helperMissing"+(d.paramsInit?"),("+d.paramsInit:"")+"),(typeof helper === functionType ? helper.call("+d.callParams+") : helper))")},invokePartial:function(a,b){var c=[this.nameLookup("partials",a,"partial"),"'"+b+"'","'"+a+"'",this.popStack(),this.popStack(),"helpers","partials"];this.options.data?c.push("data"):this.options.compat&&c.push("undefined"),this.options.compat&&c.push("depths"),this.push("this.invokePartial("+c.join(", ")+")")},assignToHash:function(a){var b,c,d,e=this.popStack();this.trackIds&&(d=this.popStack()),this.stringParams&&(c=this.popStack(),b=this.popStack());var f=this.hash;b&&f.contexts.push("'"+a+"': "+b),c&&f.types.push("'"+a+"': "+c),d&&f.ids.push("'"+a+"': "+d),f.values.push("'"+a+"': ("+e+")")},pushId:function(a,b){"ID"===a||"DATA"===a?this.pushString(b):"sexpr"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:d,compileChildren:function(a,b){for(var c,d,e=a.children,f=0,g=e.length;g>f;f++){c=e[f],d=new this.compiler;var h=this.matchExistingProgram(c);null==h?(this.context.programs.push(""),h=this.context.programs.length,c.index=h,c.name="program"+h,this.context.programs[h]=d.compile(c,b,this.context,!this.precompile),this.context.environments[h]=c,this.useDepths=this.useDepths||d.useDepths):(c.index=h,c.name="program"+h)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){var b=this.environment.children[a],c=(b.depths.list,this.useDepths),d=[b.index,"data"];return c&&d.push("depths"),"this.program("+d.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new c(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0),a&&this.source.push(a)},pushStack:function(a){this.flushInline();var b=this.incrStack();return this.pushSource(b+" = "+a+";"),this.compileStack.push(b),b},replaceStack:function(a){{var b,d,e,f="";this.isInline()}if(!this.isInline())throw new h("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof c)f=b=g.value,e=!0;else{d=!this.stackSlot;var i=d?this.incrStack():this.topStackName();f="("+this.push(i)+" = "+g+")",b=this.topStack()}var j=a.call(this,b);e||this.popStack(),d&&this.stackSlot--,this.push("("+f+j+")")},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,d=a.length;d>b;b++){var e=a[b];e instanceof c?this.compileStack.push(e):this.pushStack(e)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),d=(b?this.inlineStack:this.compileStack).pop();if(!a&&d instanceof c)return d.value;if(!b){if(!this.stackSlot)throw new h("Invalid stack pop");this.stackSlot--}return d},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof c?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(this.quotedString(c)+":"+a[c]);return"{"+b.join(",")+"}"},setupHelper:function(a,b,c){var d=[],e=this.setupParams(b,a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:[this.contextName(0)].concat(d).join(", ")}},setupOptions:function(a,b,c){var d,e,f,g={},h=[],i=[],j=[];g.name=this.quotedString(a),g.hash=this.popStack(),this.trackIds&&(g.hashIds=this.popStack()),this.stringParams&&(g.hashTypes=this.popStack(),g.hashContexts=this.popStack()),e=this.popStack(),f=this.popStack(),(f||e)&&(f||(f="this.noop"),e||(e="this.noop"),g.fn=f,g.inverse=e);for(var k=b;k--;)d=this.popStack(),c[k]=d,this.trackIds&&(j[k]=this.popStack()),this.stringParams&&(i[k]=this.popStack(),h[k]=this.popStack());return this.trackIds&&(g.ids="["+j.join(",")+"]"),this.stringParams&&(g.types="["+i.join(",")+"]",g.contexts="["+h.join(",")+"]"),this.options.data&&(g.data="data"),g},setupParams:function(a,b,c,d){var e=this.objectLiteral(this.setupOptions(a,b,c));return d?(this.useRegister("options"),c.push("options"),"options="+e):(c.push(e),"")}};for(var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),j=d.RESERVED_WORDS={},k=0,l=i.length;l>k;k++)j[i[k]]=!0;return d.isValidJavaScriptVariableName=function(a){return!d.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},e=d}(d,c),m=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c.parser,j=c.parse,k=d.Compiler,l=d.compile,m=d.precompile,n=e,o=g.create,p=function(){var a=o();return a.compile=function(b,c){return l(b,c,a)},a.precompile=function(b,c){return m(b,c,a)},a.AST=h,a.Compiler=k,a.JavaScriptCompiler=n,a.Parser=i,a.parse=j,a};return g=p(),g.create=p,g["default"]=g,f=g}(f,g,j,k,l);return m}); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/highlight.7.3.pack.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/highlight.7.3.pack.js
new file mode 100644
index 0000000..9a95a75
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/highlight.7.3.pack.js
@@ -0,0 +1 @@
+var hljs=new function(){function l(o){return o.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function b(p){for(var o=p.firstChild;o;o=o.nextSibling){if(o.nodeName=="CODE"){return o}if(!(o.nodeType==3&&o.nodeValue.match(/\s+/))){break}}}function h(p,o){return Array.prototype.map.call(p.childNodes,function(q){if(q.nodeType==3){return o?q.nodeValue.replace(/\n/g,""):q.nodeValue}if(q.nodeName=="BR"){return"\n"}return h(q,o)}).join("")}function a(q){var p=(q.className+" "+q.parentNode.className).split(/\s+/);p=p.map(function(r){return r.replace(/^language-/,"")});for(var o=0;o<p.length;o++){if(e[p[o]]||p[o]=="no-highlight"){return p[o]}}}function c(q){var o=[];(function p(r,s){for(var t=r.firstChild;t;t=t.nextSibling){if(t.nodeType==3){s+=t.nodeValue.length}else{if(t.nodeName=="BR"){s+=1}else{if(t.nodeType==1){o.push({event:"start",offset:s,node:t});s=p(t,s);o.push({event:"stop",offset:s,node:t})}}}}return s})(q,0);return o}function j(x,v,w){var p=0;var y="";var r=[];function t(){if(x.length&&v.length){if(x[0].offset!=v[0].offset){return(x[0].offset<v[0].offset)?x:v}else{return v[0].event=="start"?x:v}}else{return x.length?x:v}}function s(A){function z(B){return" "+B.nodeName+'="'+l(B.value)+'"'}return"<"+A.nodeName+Array.prototype.map.call(A.attributes,z).join("")+">"}while(x.length||v.length){var u=t().splice(0,1)[0];y+=l(w.substr(p,u.offset-p));p=u.offset;if(u.event=="start"){y+=s(u.node);r.push(u.node)}else{if(u.event=="stop"){var o,q=r.length;do{q--;o=r[q];y+=("</"+o.nodeName.toLowerCase()+">")}while(o!=u.node);r.splice(q,1);while(q<r.length){y+=s(r[q]);q++}}}}return y+l(w.substr(p))}function f(q){function o(s,r){return RegExp(s,"m"+(q.cI?"i":"")+(r?"g":""))}function p(y,w){if(y.compiled){return}y.compiled=true;var s=[];if(y.k){var r={};function z(A,t){t.split(" ").forEach(function(B){var C=B.split("|");r[C[0]]=[A,C[1]?Number(C[1]):1];s.push(C[0])})}y.lR=o(y.l||hljs.IR,true);if(typeof y.k=="string"){z("keyword",y.k)}else{for(var x in y.k){if(!y.k.hasOwnProperty(x)){continue}z(x,y.k[x])}}y.k=r}if(w){if(y.bWK){y.b="\\b("+s.join("|")+")\\s"}y.bR=o(y.b?y.b:"\\B|\\b");if(!y.e&&!y.eW){y.e="\\B|\\b"}if(y.e){y.eR=o(y.e)}y.tE=y.e||"";if(y.eW&&w.tE){y.tE+=(y.e?"|":"")+w.tE}}if(y.i){y.iR=o(y.i)}if(y.r===undefined){y.r=1}if(!y.c){y.c=[]}for(var v=0;v<y.c.length;v++){if(y.c[v]=="self"){y.c[v]=y}p(y.c[v],y)}if(y.starts){p(y.starts,w)}var u=[];for(var v=0;v<y.c.length;v++){u.push(y.c[v].b)}if(y.tE){u.push(y.tE)}if(y.i){u.push(y.i)}y.t=u.length?o(u.join("|"),true):{exec:function(t){return null}}}p(q)}function d(D,E){function o(r,M){for(var L=0;L<M.c.length;L++){var K=M.c[L].bR.exec(r);if(K&&K.index==0){return M.c[L]}}}function s(K,r){if(K.e&&K.eR.test(r)){return K}if(K.eW){return s(K.parent,r)}}function t(r,K){return K.i&&K.iR.test(r)}function y(L,r){var K=F.cI?r[0].toLowerCase():r[0];return L.k.hasOwnProperty(K)&&L.k[K]}function G(){var K=l(w);if(!A.k){return K}var r="";var N=0;A.lR.lastIndex=0;var L=A.lR.exec(K);while(L){r+=K.substr(N,L.index-N);var M=y(A,L);if(M){v+=M[1];r+='<span class="'+M[0]+'">'+L[0]+"</span>"}else{r+=L[0]}N=A.lR.lastIndex;L=A.lR.exec(K)}return r+K.substr(N)}function z(){if(A.sL&&!e[A.sL]){return l(w)}var r=A.sL?d(A.sL,w):g(w);if(A.r>0){v+=r.keyword_count;B+=r.r}return'<span class="'+r.language+'">'+r.value+"</span>"}function J(){return A.sL!==undefined?z():G()}function I(L,r){var K=L.cN?'<span class="'+L.cN+'">':"";if(L.rB){x+=K;w=""}else{if(L.eB){x+=l(r)+K;w=""}else{x+=K;w=r}}A=Object.create(L,{parent:{value:A}});B+=L.r}function C(K,r){w+=K;if(r===undefined){x+=J();return 0}var L=o(r,A);if(L){x+=J();I(L,r);return L.rB?0:r.length}var M=s(A,r);if(M){if(!(M.rE||M.eE)){w+=r}x+=J();do{if(A.cN){x+="</span>"}A=A.parent}while(A!=M.parent);if(M.eE){x+=l(r)}w="";if(M.starts){I(M.starts,"")}return M.rE?0:r.length}if(t(r,A)){throw"Illegal"}w+=r;return r.length||1}var F=e[D];f(F);var A=F;var w="";var B=0;var v=0;var x="";try{var u,q,p=0;while(true){A.t.lastIndex=p;u=A.t.exec(E);if(!u){break}q=C(E.substr(p,u.index-p),u[0]);p=u.index+q}C(E.substr(p));return{r:B,keyword_count:v,value:x,language:D}}catch(H){if(H=="Illegal"){return{r:0,keyword_count:0,value:l(E)}}else{throw H}}}function g(s){var o={keyword_count:0,r:0,value:l(s)};var q=o;for(var p in e){if(!e.hasOwnProperty(p)){continue}var r=d(p,s);r.language=p;if(r.keyword_count+r.r>q.keyword_count+q.r){q=r}if(r.keyword_count+r.r>o.keyword_count+o.r){q=o;o=r}}if(q.language){o.second_best=q}return o}function i(q,p,o){if(p){q=q.replace(/^((<[^>]+>|\t)+)/gm,function(r,v,u,t){return v.replace(/\t/g,p)})}if(o){q=q.replace(/\n/g,"<br>")}return q}function m(r,u,p){var v=h(r,p);var t=a(r);if(t=="no-highlight"){return}var w=t?d(t,v):g(v);t=w.language;var o=c(r);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=j(o,c(q),v)}w.value=i(w.value,u,p);var s=r.className;if(!s.match("(\\s|^)(language-)?"+t+"(\\s|$)")){s=s?(s+" "+t):t}r.innerHTML=w.value;r.className=s;r.result={language:t,kw:w.keyword_count,re:w.r};if(w.second_best){r.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function n(){if(n.called){return}n.called=true;Array.prototype.map.call(document.getElementsByTagName("pre"),b).filter(Boolean).forEach(function(o){m(o,hljs.tabReplace)})}function k(){window.addEventListener("DOMContentLoaded",n,false);window.addEventListener("load",n,false)}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=m;this.initHighlighting=n;this.initHighlightingOnLoad=k;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[b],starts:{e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ />]+"},b]}]}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}}(hljs); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery-1.8.0.min.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery-1.8.0.min.js
new file mode 100644
index 0000000..066d72c
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery-1.8.0.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v@1.8.0 jquery.com | jquery.org/license */
+(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bX(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bV.length;while(e--){b=bV[e]+c;if(b in a)return b}return d}function bY(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function bZ(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bY(c)&&(e[f]=p._data(c,"olddisplay",cb(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b$(a,b,c){var d=bO.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function b_(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bU[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bU[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bU[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bU[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bU[e]+"Width"))||0));return f}function ca(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bP.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+b_(a,b,c||(f?"border":"content"),e)+"px"}function cb(a){if(bR[a])return bR[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cz(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cu;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cz(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cz(a,c,d,e,"*",g)),h}function cA(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cB(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cC(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cK(){try{return new a.XMLHttpRequest}catch(b){}}function cL(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cT(){return setTimeout(function(){cM=b},0),cM=p.now()}function cU(a,b){p.each(b,function(b,c){var d=(cS[b]||[]).concat(cS["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cV(a,b,c){var d,e=0,f=0,g=cR.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cM||cT(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cM||cT(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cW(k,j.opts.specialEasing);for(;e<g;e++){d=cR[e].call(j,a,k,j.opts);if(d)return d}return cU(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cW(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(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 cX(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bY(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cb(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cO.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cY(a,b,c,d,e){return new cY.prototype.init(a,b,c,d,e)}function cZ(a,b){var c,d={height:a},e=0;for(;e<4;e+=2-b)c=bU[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function c_(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=r.test(" ")?/^[\s\xA0]+|[\s\xA0]+$/g:/^\s+|\s+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":a.toString().replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||f.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete"||e.readyState!=="loading"&&e.addEventListener)setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){p.isFunction(c)&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")===0&&(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)(d=p._data(g[h],a+"queueHooks"))&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,k,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=[].slice.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click")){g=p(this),g.context=this;for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){i={},k=[],g[0]=f;for(d=0;d<q;d++)l=o[d],m=l.selector,i[m]===b&&(i[m]=g.is(m)),i[m]&&k.push(l);k.length&&u.push({elem:f,matches:k})}}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){j=u[d],c.currentTarget=j.elem;for(e=0;e<j.matches.length&&!c.isImmediatePropagationStopped();e++){l=j.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,h=((p.event.special[l.origType]||{}).handle||l.handler).apply(j.elem,r),h!==b&&(c.result=h,h===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{ready:{setup:p.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)Z(a,b[e],c,d)}function be(a,b,c,d,e,f){var g,h=$.setFilters[b.toLowerCase()];return h||Z.error(b),(a||!(g=e))&&bd(a||"*",d,g=[],e),g.length>0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;a<c;a++)arguments[a]===b&&(g[a]=b)};for(;p<q;p++){s.exec(""),a=f[p],j=[],i=0,k=e;while(g=s.exec(a)){n=s.lastIndex=g.index+g[0].length;if(n>i){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0].replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}function bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="<a name='"+q+"'></a><div name='"+q+"'></div>",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!==1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e<f;e=e+2)d.push(a[e]);return d},odd:function(a,b,c){var d=[],e=c?0:1,f=a.length;for(;e<f;e=e+2)d.push(a[e]);return d},lt:function(a,b,c){return c?a.slice(+b):a.slice(0,+b)},gt:function(a,b,c){return c?a.slice(0,+b+1):a.slice(+b+1)},eq:function(a,b,c){var d=a.splice(+b,1);return c?a:d}}};$.setFilters.nth=$.setFilters.eq,$.filters=$.pseudos,X||($.attrHandle={href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}}),V&&($.order.push("NAME"),$.find.NAME=function(a,b){if(typeof b.getElementsByName!==j)return b.getElementsByName(a)}),Y&&($.order.splice(1,0,"CLASS"),$.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!==j&&!c)return b.getElementsByClassName(a)});try{n.call(i.childNodes,0)[0].nodeType}catch(_){n=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}var ba=Z.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},bb=Z.contains=i.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:i.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc=Z.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=bc(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=bc(b);return c};Z.attr=function(a,b){var c,d=ba(a);return d||(b=b.toLowerCase()),$.attrHandle[b]?$.attrHandle[b](a):U||d?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},Z.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},[0,0].sort(function(){return l=0}),i.compareDocumentPosition?e=function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:(e=function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],g=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return f(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)g.unshift(j),j=j.parentNode;c=e.length,d=g.length;for(var l=0;l<c&&l<d;l++)if(e[l]!==g[l])return f(e[l],g[l]);return l===c?f(a,g[l],-1):f(e[l],b,1)},f=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),Z.uniqueSort=function(a){var b,c=1;if(e){k=l,a.sort(e);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1)}return a};var bl=Z.compile=function(a,b,c){var d,e,f,g=O[a];if(g&&g.context===b)return g;e=bg(a,b,c);for(f=0;d=e[f];f++)e[f]=bj(d,b,c);return g=O[a]=bk(e),g.context=b,g.runs=g.dirruns=0,P.push(a),P.length>$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSelector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j<k;j++){p=$.order[j];if(s=L[p].exec(m)){h=$.find[p]((s[1]||"").replace(K,""),q,g);if(h==null)continue;m===r&&(a=a.slice(0,a.length-r.length)+m.replace(L[p],""),a||o.apply(e,n.call(h,0)));break}}}if(a){i=bl(a,b,g),d=i.dirruns++,h==null&&(h=$.find.TAG("*",G.test(a)&&b.parentNode||b));for(j=0;l=h[j];j++)c=i.runs++,i(l,b)&&e.push(l)}return e};h.querySelectorAll&&function(){var a,b=bm,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[],f=[":active"],g=i.matchesSelector||i.mozMatchesSelector||i.webkitMatchesSelector||i.oMatchesSelector||i.msMatchesSelector;T(function(a){a.innerHTML="<select><option selected></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=(c[0]||c).ownerDocument||c[0]||c,typeof c.createDocumentFragment=="undefined"&&(c=e),a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/,co=/^\/\//,cp=/\?/,cq=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cr=/([?&])_=[^&]*/,cs=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ct=p.fn.load,cu={},cv={},cw=["*/"]+["*"];try{ci=f.href}catch(cx){ci=e.createElement("a"),ci.href="",ci=ci.href}cj=cs.exec(ci.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&ct)return ct.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cq,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cA(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cA(a,b),a},ajaxSettings:{url:ci,isLocal:cm.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cw},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cy(cu),ajaxTransport:cy(cv),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cB(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cC(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cl.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(ck,"").replace(co,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=cs.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==cj[1]&&i[2]==cj[2]&&(i[3]||(i[1]==="http:"?80:443))==(cj[3]||(cj[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cz(cu,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!cn.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cp.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cr,"$1_="+z);l.url=A+(A===l.url?(cp.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cw+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cz(cv,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cD=[],cE=/\?/,cF=/(=)\?(?=&|$)|\?\?/,cG=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cD.pop()||p.expando+"_"+cG++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cF.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cF.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cF,"$1"+f):m?c.data=i.replace(cF,"$1"+f):k&&(c.url+=(cE.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cD.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cH,cI=a.ActiveXObject?function(){for(var a in cH)cH[a](0,1)}:!1,cJ=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cK()||cL()}:cK,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cI&&delete cH[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cJ,cI&&(cH||(cH={},p(a).unload(cI)),cH[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cM,cN,cO=/^(?:toggle|show|hide)$/,cP=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cQ=/queueHooks$/,cR=[cX],cS={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cP.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cV,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cS[c]=cS[c]||[],cS[c].unshift(b)},prefilter:function(a,b){b?cR.unshift(a):cR.push(a)}}),p.Tween=cY,cY.prototype={constructor:cY,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cY.propHooks[this.prop];return a&&a.get?a.get(this):cY.propHooks._default.get(this)},run:function(a){var b,c=cY.propHooks[this.prop];return this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration),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):cY.propHooks._default.set(this),this}},cY.prototype.init.prototype=cY.prototype,cY.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cY.propHooks.scrollTop=cY.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(cZ(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bY).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cV(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cQ.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:cZ("show"),slideUp:cZ("hide"),slideToggle:cZ("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cY.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cN&&(cN=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cN),cN=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c$=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j,k,l,m=this[0],n=m&&m.ownerDocument;if(!n)return;return(e=n.body)===m?p.offset.bodyOffset(m):(d=n.documentElement,p.contains(d,m)?(c=m.getBoundingClientRect(),f=c_(n),g=d.clientTop||e.clientTop||0,h=d.clientLeft||e.clientLeft||0,i=f.pageYOffset||d.scrollTop,j=f.pageXOffset||d.scrollLeft,k=c.top+i-g,l=c.left+j-h,{top:k,left:l}):{top:0,left:0})},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c$.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c$.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=c_(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery.ba-bbq.min.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery.ba-bbq.min.js
new file mode 100644
index 0000000..bcbf248
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery.ba-bbq.min.js
@@ -0,0 +1,18 @@
+/*
+ * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
+ * http://benalman.com/projects/jquery-bbq-plugin/
+ *
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
+/*
+ * jQuery hashchange event - v1.2 - 2/11/2010
+ * http://benalman.com/projects/jquery-hashchange-plugin/
+ *
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery.slideto.min.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery.slideto.min.js
new file mode 100644
index 0000000..ba32cff
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery.slideto.min.js
@@ -0,0 +1 @@
+(function(b){b.fn.slideto=function(a){a=b.extend({slide_duration:"slow",highlight_duration:3E3,highlight:true,highlight_color:"#FFFF99"},a);return this.each(function(){obj=b(this);b("body").animate({scrollTop:obj.offset().top},a.slide_duration,function(){a.highlight&&b.ui.version&&obj.effect("highlight",{color:a.highlight_color},a.highlight_duration)})})}})(jQuery);
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery.wiggle.min.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery.wiggle.min.js
new file mode 100644
index 0000000..2adb0d6
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jquery.wiggle.min.js
@@ -0,0 +1,8 @@
+/*
+jQuery Wiggle
+Author: WonderGroup, Jordan Thomas
+URL: http://labs.wondergroup.com/demos/mini-ui/index.html
+License: MIT (http://en.wikipedia.org/wiki/MIT_License)
+*/
+jQuery.fn.wiggle=function(o){var d={speed:50,wiggles:3,travel:5,callback:null};var o=jQuery.extend(d,o);return this.each(function(){var cache=this;var wrap=jQuery(this).wrap('<div class="wiggle-wrap"></div>').css("position","relative");var calls=0;for(i=1;i<=o.wiggles;i++){jQuery(this).animate({left:"-="+o.travel},o.speed).animate({left:"+="+o.travel*2},o.speed*2).animate({left:"-="+o.travel},o.speed,function(){calls++;if(jQuery(cache).parent().hasClass('wiggle-wrap')){jQuery(cache).parent().replaceWith(cache);}
+if(calls==o.wiggles&&jQuery.isFunction(o.callback)){o.callback();}});}});}; \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/js-yaml.min.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/js-yaml.min.js
new file mode 100644
index 0000000..c3d07ad
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/js-yaml.min.js
@@ -0,0 +1,3 @@
+/* js-yaml 3.4.6 https://github.com/nodeca/js-yaml */
+!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.jsyaml=t()}}(function(){var t;return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return r(n?n:e)},l,l.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(t,e,n){"use strict";function i(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}var r=t("./js-yaml/loader"),o=t("./js-yaml/dumper");e.exports.Type=t("./js-yaml/type"),e.exports.Schema=t("./js-yaml/schema"),e.exports.FAILSAFE_SCHEMA=t("./js-yaml/schema/failsafe"),e.exports.JSON_SCHEMA=t("./js-yaml/schema/json"),e.exports.CORE_SCHEMA=t("./js-yaml/schema/core"),e.exports.DEFAULT_SAFE_SCHEMA=t("./js-yaml/schema/default_safe"),e.exports.DEFAULT_FULL_SCHEMA=t("./js-yaml/schema/default_full"),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.safeLoad=r.safeLoad,e.exports.safeLoadAll=r.safeLoadAll,e.exports.dump=o.dump,e.exports.safeDump=o.safeDump,e.exports.YAMLException=t("./js-yaml/exception"),e.exports.MINIMAL_SCHEMA=t("./js-yaml/schema/failsafe"),e.exports.SAFE_SCHEMA=t("./js-yaml/schema/default_safe"),e.exports.DEFAULT_SCHEMA=t("./js-yaml/schema/default_full"),e.exports.scan=i("scan"),e.exports.parse=i("parse"),e.exports.compose=i("compose"),e.exports.addConstructor=i("addConstructor")},{"./js-yaml/dumper":3,"./js-yaml/exception":4,"./js-yaml/loader":5,"./js-yaml/schema":7,"./js-yaml/schema/core":8,"./js-yaml/schema/default_full":9,"./js-yaml/schema/default_safe":10,"./js-yaml/schema/failsafe":11,"./js-yaml/schema/json":12,"./js-yaml/type":13}],2:[function(t,e,n){"use strict";function i(t){return"undefined"==typeof t||null===t}function r(t){return"object"==typeof t&&null!==t}function o(t){return Array.isArray(t)?t:i(t)?[]:[t]}function a(t,e){var n,i,r,o;if(e)for(o=Object.keys(e),n=0,i=o.length;i>n;n+=1)r=o[n],t[r]=e[r];return t}function s(t,e){var n,i="";for(n=0;e>n;n+=1)i+=t;return i}function c(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t}e.exports.isNothing=i,e.exports.isObject=r,e.exports.toArray=o,e.exports.repeat=s,e.exports.isNegativeZero=c,e.exports.extend=a},{}],3:[function(t,e,n){"use strict";function i(t,e){var n,i,r,o,a,s,c;if(null===e)return{};for(n={},i=Object.keys(e),r=0,o=i.length;o>r;r+=1)a=i[r],s=String(e[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),c=t.compiledTypeMap[a],c&&E.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[a]=s;return n}function r(t){var e,n,i;if(e=t.toString(16).toUpperCase(),255>=t)n="x",i=2;else if(65535>=t)n="u",i=4;else{if(!(4294967295>=t))throw new O("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+j.repeat("0",i-e.length)+e}function o(t){this.schema=t.schema||S,this.indent=Math.max(1,t.indent||2),this.skipInvalid=t.skipInvalid||!1,this.flowLevel=j.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=i(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function a(t,e){for(var n,i=j.repeat(" ",e),r=0,o=-1,a="",s=t.length;s>r;)o=t.indexOf("\n",r),-1===o?(n=t.slice(r),r=s):(n=t.slice(r,o+1),r=o+1),n.length&&"\n"!==n&&(a+=i),a+=n;return a}function s(t,e){return"\n"+j.repeat(" ",t.indent*e)}function c(t,e){var n,i,r;for(n=0,i=t.implicitTypes.length;i>n;n+=1)if(r=t.implicitTypes[n],r.resolve(e))return!0;return!1}function u(t){this.source=t,this.result="",this.checkpoint=0}function l(t,e,n,i){var r,o,s,l,f,m,g,y,v,x,A,b,w,k,C,j,O,S,_,I,E;if(0===e.length)return void(t.dump="''");if(-1!==et.indexOf(e))return void(t.dump="'"+e+"'");for(r=!0,o=e.length?e.charCodeAt(0):0,s=M===o||M===e.charCodeAt(e.length-1),(K===o||W===o||G===o||z===o)&&(r=!1),s?(r=!1,l=!1,f=!1):(l=!i,f=!i),m=!0,g=new u(e),y=!1,v=0,x=0,A=t.indent*n,b=t.lineWidth,-1===b&&(b=9007199254740991),40>A?b-=A:b=40,k=0;k<e.length;k++){if(w=e.charCodeAt(k),r){if(h(w))continue;r=!1}m&&w===P&&(m=!1),C=tt[w],j=d(w),(C||j)&&(w!==N&&w!==D&&w!==P?(l=!1,f=!1):w===N&&(y=!0,m=!1,k>0&&(O=e.charCodeAt(k-1),O===M&&(f=!1,l=!1)),l&&(S=k-v,v=k,S>x&&(x=S))),w!==D&&(m=!1),g.takeUpTo(k),g.escapeChar())}if(r&&c(t,e)&&(r=!1),_="",(l||f)&&(I=0,e.charCodeAt(e.length-1)===N&&(I+=1,e.charCodeAt(e.length-2)===N&&(I+=1)),0===I?_="-":2===I&&(_="+")),f&&b>x&&(l=!1),y||(f=!1),r)t.dump=e;else if(m)t.dump="'"+e+"'";else if(l)E=p(e,b),t.dump=">"+_+"\n"+a(E,A);else if(f)_||(e=e.replace(/\n$/,"")),t.dump="|"+_+"\n"+a(e,A);else{if(!g)throw new Error("Failed to dump scalar value");g.finish(),t.dump='"'+g.result+'"'}}function p(t,e){var n,i="",r=0,o=t.length,a=/\n+$/.exec(t);for(a&&(o=a.index+1);o>r;)n=t.indexOf("\n",r),n>o||-1===n?(i&&(i+="\n\n"),i+=f(t.slice(r,o),e),r=o):(i&&(i+="\n\n"),i+=f(t.slice(r,n),e),r=n+1);return a&&"\n"!==a[0]&&(i+=a[0]),i}function f(t,e){if(""===t)return t;for(var n,i,r,o=/[^\s] [^\s]/g,a="",s=0,c=0,u=o.exec(t);u;)n=u.index,n-c>e&&(i=s!==c?s:n,a&&(a+="\n"),r=t.slice(c,i),a+=r,c=i+1),s=n+1,u=o.exec(t);return a&&(a+="\n"),a+=c!==s&&t.length-c>e?t.slice(c,s)+"\n"+t.slice(s+1):t.slice(c)}function h(t){return F!==t&&N!==t&&T!==t&&B!==t&&V!==t&&Z!==t&&J!==t&&X!==t&&U!==t&&Y!==t&&$!==t&&L!==t&&Q!==t&&R!==t&&P!==t&&D!==t&&q!==t&&H!==t&&!tt[t]&&!d(t)}function d(t){return!(t>=32&&126>=t||133===t||t>=160&&55295>=t||t>=57344&&65533>=t||t>=65536&&1114111>=t)}function m(t,e,n){var i,r,o="",a=t.tag;for(i=0,r=n.length;r>i;i+=1)A(t,e,n[i],!1,!1)&&(0!==i&&(o+=", "),o+=t.dump);t.tag=a,t.dump="["+o+"]"}function g(t,e,n,i){var r,o,a="",c=t.tag;for(r=0,o=n.length;o>r;r+=1)A(t,e+1,n[r],!0,!0)&&(i&&0===r||(a+=s(t,e)),a+="- "+t.dump);t.tag=c,t.dump=a||"[]"}function y(t,e,n){var i,r,o,a,s,c="",u=t.tag,l=Object.keys(n);for(i=0,r=l.length;r>i;i+=1)s="",0!==i&&(s+=", "),o=l[i],a=n[o],A(t,e,o,!1,!1)&&(t.dump.length>1024&&(s+="? "),s+=t.dump+": ",A(t,e,a,!1,!1)&&(s+=t.dump,c+=s));t.tag=u,t.dump="{"+c+"}"}function v(t,e,n,i){var r,o,a,c,u,l,p="",f=t.tag,h=Object.keys(n);if(t.sortKeys===!0)h.sort();else if("function"==typeof t.sortKeys)h.sort(t.sortKeys);else if(t.sortKeys)throw new O("sortKeys must be a boolean or a function");for(r=0,o=h.length;o>r;r+=1)l="",i&&0===r||(l+=s(t,e)),a=h[r],c=n[a],A(t,e+1,a,!0,!0,!0)&&(u=null!==t.tag&&"?"!==t.tag||t.dump&&t.dump.length>1024,u&&(l+=t.dump&&N===t.dump.charCodeAt(0)?"?":"? "),l+=t.dump,u&&(l+=s(t,e)),A(t,e+1,c,!0,u)&&(l+=t.dump&&N===t.dump.charCodeAt(0)?":":": ",l+=t.dump,p+=l));t.tag=f,t.dump=p||"{}"}function x(t,e,n){var i,r,o,a,s,c;for(r=n?t.explicitTypes:t.implicitTypes,o=0,a=r.length;a>o;o+=1)if(s=r[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof e&&e instanceof s.instanceOf)&&(!s.predicate||s.predicate(e))){if(t.tag=n?s.tag:"?",s.represent){if(c=t.styleMap[s.tag]||s.defaultStyle,"[object Function]"===I.call(s.represent))i=s.represent(e,c);else{if(!E.call(s.represent,c))throw new O("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');i=s.represent[c](e,c)}t.dump=i}return!0}return!1}function A(t,e,n,i,r,o){t.tag=null,t.dump=n,x(t,n,!1)||x(t,n,!0);var a=I.call(t.dump);i&&(i=0>t.flowLevel||t.flowLevel>e);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(s=t.duplicates.indexOf(n),c=-1!==s),(null!==t.tag&&"?"!==t.tag||c||2!==t.indent&&e>0)&&(r=!1),c&&t.usedDuplicates[s])t.dump="*ref_"+s;else{if(u&&c&&!t.usedDuplicates[s]&&(t.usedDuplicates[s]=!0),"[object Object]"===a)i&&0!==Object.keys(t.dump).length?(v(t,e,t.dump,r),c&&(t.dump="&ref_"+s+t.dump)):(y(t,e,t.dump),c&&(t.dump="&ref_"+s+" "+t.dump));else if("[object Array]"===a)i&&0!==t.dump.length?(g(t,e,t.dump,r),c&&(t.dump="&ref_"+s+t.dump)):(m(t,e,t.dump),c&&(t.dump="&ref_"+s+" "+t.dump));else{if("[object String]"!==a){if(t.skipInvalid)return!1;throw new O("unacceptable kind of an object to dump "+a)}"?"!==t.tag&&l(t,t.dump,e,o)}null!==t.tag&&"?"!==t.tag&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function b(t,e){var n,i,r=[],o=[];for(w(t,r,o),n=0,i=o.length;i>n;n+=1)e.duplicates.push(r[o[n]]);e.usedDuplicates=new Array(i)}function w(t,e,n){var i,r,o;if(null!==t&&"object"==typeof t)if(r=e.indexOf(t),-1!==r)-1===n.indexOf(r)&&n.push(r);else if(e.push(t),Array.isArray(t))for(r=0,o=t.length;o>r;r+=1)w(t[r],e,n);else for(i=Object.keys(t),r=0,o=i.length;o>r;r+=1)w(t[i[r]],e,n)}function k(t,e){e=e||{};var n=new o(e);return b(t,n),A(n,0,t,!0,!0)?n.dump+"\n":""}function C(t,e){return k(t,j.extend({schema:_},e))}var j=t("./common"),O=t("./exception"),S=t("./schema/default_full"),_=t("./schema/default_safe"),I=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=9,N=10,T=13,M=32,L=33,D=34,U=35,q=37,Y=38,P=39,$=42,B=44,K=45,H=58,R=62,W=63,G=64,V=91,Z=93,z=96,J=123,Q=124,X=125,tt={};tt[0]="\\0",tt[7]="\\a",tt[8]="\\b",tt[9]="\\t",tt[10]="\\n",tt[11]="\\v",tt[12]="\\f",tt[13]="\\r",tt[27]="\\e",tt[34]='\\"',tt[92]="\\\\",tt[133]="\\N",tt[160]="\\_",tt[8232]="\\L",tt[8233]="\\P";var et=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];u.prototype.takeUpTo=function(t){var e;if(t<this.checkpoint)throw e=new Error("position should be > checkpoint"),e.position=t,e.checkpoint=this.checkpoint,e;return this.result+=this.source.slice(this.checkpoint,t),this.checkpoint=t,this},u.prototype.escapeChar=function(){var t,e;return t=this.source.charCodeAt(this.checkpoint),e=tt[t]||r(t),this.result+=e,this.checkpoint+=1,this},u.prototype.finish=function(){this.source.length>this.checkpoint&&this.takeUpTo(this.source.length)},e.exports.dump=k,e.exports.safeDump=C},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(t,e,n){"use strict";function i(t,e){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name="YAMLException",this.reason=t,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():"")}var r=t("inherit");r(i,Error),i.prototype.toString=function(t){var e=this.name+": ";return e+=this.reason||"(unknown reason)",!t&&this.mark&&(e+=" "+this.mark.toString()),e},e.exports=i},{inherit:31}],5:[function(t,e,n){"use strict";function i(t){return 10===t||13===t}function r(t){return 9===t||32===t}function o(t){return 9===t||32===t||10===t||13===t}function a(t){return 44===t||91===t||93===t||123===t||125===t}function s(t){var e;return t>=48&&57>=t?t-48:(e=32|t,e>=97&&102>=e?e-97+10:-1)}function c(t){return 120===t?2:117===t?4:85===t?8:0}function u(t){return t>=48&&57>=t?t-48:-1}function l(t){return 48===t?"\x00":97===t?"":98===t?"\b":116===t?" ":9===t?" ":110===t?"\n":118===t?" ":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"…":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function p(t){return 65535>=t?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function f(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||H,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function h(t,e){return new $(e,new B(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function d(t,e){throw h(t,e)}function m(t,e){t.onWarning&&t.onWarning.call(null,h(t,e))}function g(t,e,n,i){var r,o,a,s;if(n>e){if(s=t.input.slice(e,n),i)for(r=0,o=s.length;o>r;r+=1)a=s.charCodeAt(r),9===a||a>=32&&1114111>=a||d(t,"expected valid JSON character");else X.test(s)&&d(t,"the stream contains non-printable characters");t.result+=s}}function y(t,e,n){var i,r,o,a;for(P.isObject(n)||d(t,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;a>o;o+=1)r=i[o],R.call(e,r)||(e[r]=n[r])}function v(t,e,n,i,r){var o,a;if(i=String(i),null===e&&(e={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(r))for(o=0,a=r.length;a>o;o+=1)y(t,e,r[o]);else y(t,e,r);else e[i]=r;return e}function x(t){var e;e=t.input.charCodeAt(t.position),10===e?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):d(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function A(t,e,n){for(var o=0,a=t.input.charCodeAt(t.position);0!==a;){for(;r(a);)a=t.input.charCodeAt(++t.position);if(e&&35===a)do a=t.input.charCodeAt(++t.position);while(10!==a&&13!==a&&0!==a);if(!i(a))break;for(x(t),a=t.input.charCodeAt(t.position),o++,t.lineIndent=0;32===a;)t.lineIndent++,a=t.input.charCodeAt(++t.position)}return-1!==n&&0!==o&&t.lineIndent<n&&m(t,"deficient indentation"),o}function b(t){var e,n=t.position;return e=t.input.charCodeAt(n),45!==e&&46!==e||t.input.charCodeAt(n+1)!==e||t.input.charCodeAt(n+2)!==e||(n+=3,e=t.input.charCodeAt(n),0!==e&&!o(e))?!1:!0}function w(t,e){1===e?t.result+=" ":e>1&&(t.result+=P.repeat("\n",e-1))}function k(t,e,n){var s,c,u,l,p,f,h,d,m,y=t.kind,v=t.result;if(m=t.input.charCodeAt(t.position),o(m)||a(m)||35===m||38===m||42===m||33===m||124===m||62===m||39===m||34===m||37===m||64===m||96===m)return!1;if((63===m||45===m)&&(c=t.input.charCodeAt(t.position+1),o(c)||n&&a(c)))return!1;for(t.kind="scalar",t.result="",u=l=t.position,p=!1;0!==m;){if(58===m){if(c=t.input.charCodeAt(t.position+1),o(c)||n&&a(c))break}else if(35===m){if(s=t.input.charCodeAt(t.position-1),o(s))break}else{if(t.position===t.lineStart&&b(t)||n&&a(m))break;if(i(m)){if(f=t.line,h=t.lineStart,d=t.lineIndent,A(t,!1,-1),t.lineIndent>=e){p=!0,m=t.input.charCodeAt(t.position);continue}t.position=l,t.line=f,t.lineStart=h,t.lineIndent=d;break}}p&&(g(t,u,l,!1),w(t,t.line-f),u=l=t.position,p=!1),r(m)||(l=t.position+1),m=t.input.charCodeAt(++t.position)}return g(t,u,l,!1),t.result?!0:(t.kind=y,t.result=v,!1)}function C(t,e){var n,r,o;if(n=t.input.charCodeAt(t.position),39!==n)return!1;for(t.kind="scalar",t.result="",t.position++,r=o=t.position;0!==(n=t.input.charCodeAt(t.position));)if(39===n){if(g(t,r,t.position,!0),n=t.input.charCodeAt(++t.position),39!==n)return!0;r=o=t.position,t.position++}else i(n)?(g(t,r,o,!0),w(t,A(t,!1,e)),r=o=t.position):t.position===t.lineStart&&b(t)?d(t,"unexpected end of the document within a single quoted scalar"):(t.position++,o=t.position);d(t,"unexpected end of the stream within a single quoted scalar")}function j(t,e){var n,r,o,a,u,l;if(l=t.input.charCodeAt(t.position),34!==l)return!1;for(t.kind="scalar",t.result="",t.position++,n=r=t.position;0!==(l=t.input.charCodeAt(t.position));){if(34===l)return g(t,n,t.position,!0),t.position++,!0;if(92===l){if(g(t,n,t.position,!0),l=t.input.charCodeAt(++t.position),i(l))A(t,!1,e);else if(256>l&&rt[l])t.result+=ot[l],t.position++;else if((u=c(l))>0){for(o=u,a=0;o>0;o--)l=t.input.charCodeAt(++t.position),(u=s(l))>=0?a=(a<<4)+u:d(t,"expected hexadecimal character");t.result+=p(a),t.position++}else d(t,"unknown escape sequence");n=r=t.position}else i(l)?(g(t,n,r,!0),w(t,A(t,!1,e)),n=r=t.position):t.position===t.lineStart&&b(t)?d(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}d(t,"unexpected end of the stream within a double quoted scalar")}function O(t,e){var n,i,r,a,s,c,u,l,p,f,h,m=!0,g=t.tag,y=t.anchor;if(h=t.input.charCodeAt(t.position),91===h)a=93,u=!1,i=[];else{if(123!==h)return!1;a=125,u=!0,i={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=i),h=t.input.charCodeAt(++t.position);0!==h;){if(A(t,!0,e),h=t.input.charCodeAt(t.position),h===a)return t.position++,t.tag=g,t.anchor=y,t.kind=u?"mapping":"sequence",t.result=i,!0;m||d(t,"missed comma between flow collection entries"),p=l=f=null,s=c=!1,63===h&&(r=t.input.charCodeAt(t.position+1),o(r)&&(s=c=!0,t.position++,A(t,!0,e))),n=t.line,T(t,e,W,!1,!0),p=t.tag,l=t.result,A(t,!0,e),h=t.input.charCodeAt(t.position),!c&&t.line!==n||58!==h||(s=!0,h=t.input.charCodeAt(++t.position),A(t,!0,e),T(t,e,W,!1,!0),f=t.result),u?v(t,i,p,l,f):i.push(s?v(t,null,p,l,f):l),A(t,!0,e),h=t.input.charCodeAt(t.position),44===h?(m=!0,h=t.input.charCodeAt(++t.position)):m=!1}d(t,"unexpected end of the stream within a flow collection")}function S(t,e){var n,o,a,s,c=z,l=!1,p=e,f=0,h=!1;if(s=t.input.charCodeAt(t.position),124===s)o=!1;else{if(62!==s)return!1;o=!0}for(t.kind="scalar",t.result="";0!==s;)if(s=t.input.charCodeAt(++t.position),43===s||45===s)z===c?c=43===s?Q:J:d(t,"repeat of a chomping mode identifier");else{if(!((a=u(s))>=0))break;0===a?d(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?d(t,"repeat of an indentation width identifier"):(p=e+a-1,l=!0)}if(r(s)){do s=t.input.charCodeAt(++t.position);while(r(s));if(35===s)do s=t.input.charCodeAt(++t.position);while(!i(s)&&0!==s)}for(;0!==s;){for(x(t),t.lineIndent=0,s=t.input.charCodeAt(t.position);(!l||t.lineIndent<p)&&32===s;)t.lineIndent++,s=t.input.charCodeAt(++t.position);if(!l&&t.lineIndent>p&&(p=t.lineIndent),i(s))f++;else{if(t.lineIndent<p){c===Q?t.result+=P.repeat("\n",f):c===z&&l&&(t.result+="\n");break}for(o?r(s)?(h=!0,t.result+=P.repeat("\n",f+1)):h?(h=!1,t.result+=P.repeat("\n",f+1)):0===f?l&&(t.result+=" "):t.result+=P.repeat("\n",f):l?t.result+=P.repeat("\n",f+1):t.result+=P.repeat("\n",f),l=!0,f=0,n=t.position;!i(s)&&0!==s;)s=t.input.charCodeAt(++t.position);g(t,n,t.position,!1)}}return!0}function _(t,e){var n,i,r,a=t.tag,s=t.anchor,c=[],u=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=c),r=t.input.charCodeAt(t.position);0!==r&&45===r&&(i=t.input.charCodeAt(t.position+1),o(i));)if(u=!0,t.position++,A(t,!0,-1)&&t.lineIndent<=e)c.push(null),r=t.input.charCodeAt(t.position);else if(n=t.line,T(t,e,V,!1,!0),c.push(t.result),A(t,!0,-1),r=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==r)d(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return u?(t.tag=a,t.anchor=s,t.kind="sequence",t.result=c,!0):!1}function I(t,e,n){var i,a,s,c,u=t.tag,l=t.anchor,p={},f=null,h=null,m=null,g=!1,y=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=p),c=t.input.charCodeAt(t.position);0!==c;){if(i=t.input.charCodeAt(t.position+1),s=t.line,63!==c&&58!==c||!o(i)){if(!T(t,n,G,!1,!0))break;if(t.line===s){for(c=t.input.charCodeAt(t.position);r(c);)c=t.input.charCodeAt(++t.position);if(58===c)c=t.input.charCodeAt(++t.position),o(c)||d(t,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(v(t,p,f,h,null),f=h=m=null),y=!0,g=!1,a=!1,f=t.tag,h=t.result;else{if(!y)return t.tag=u,t.anchor=l,!0;d(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return t.tag=u,t.anchor=l,!0;d(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(g&&(v(t,p,f,h,null),f=h=m=null),y=!0,g=!0,a=!0):g?(g=!1,a=!0):d(t,"incomplete explicit mapping pair; a key node is missed"),t.position+=1,c=i;if((t.line===s||t.lineIndent>e)&&(T(t,e,Z,!0,a)&&(g?h=t.result:m=t.result),g||(v(t,p,f,h,m),f=h=m=null),A(t,!0,-1),c=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==c)d(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return g&&v(t,p,f,h,null),y&&(t.tag=u,t.anchor=l,t.kind="mapping",t.result=p),y}function E(t){var e,n,i,r,a=!1,s=!1;if(r=t.input.charCodeAt(t.position),33!==r)return!1;if(null!==t.tag&&d(t,"duplication of a tag property"),r=t.input.charCodeAt(++t.position),60===r?(a=!0,r=t.input.charCodeAt(++t.position)):33===r?(s=!0,n="!!",r=t.input.charCodeAt(++t.position)):n="!",e=t.position,a){do r=t.input.charCodeAt(++t.position);while(0!==r&&62!==r);t.position<t.length?(i=t.input.slice(e,t.position),r=t.input.charCodeAt(++t.position)):d(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==r&&!o(r);)33===r&&(s?d(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),nt.test(n)||d(t,"named tag handle cannot contain such characters"),s=!0,e=t.position+1)),r=t.input.charCodeAt(++t.position);i=t.input.slice(e,t.position),et.test(i)&&d(t,"tag suffix cannot contain flow indicator characters")}return i&&!it.test(i)&&d(t,"tag name cannot contain such characters: "+i),a?t.tag=i:R.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:"!"===n?t.tag="!"+i:"!!"===n?t.tag="tag:yaml.org,2002:"+i:d(t,'undeclared tag handle "'+n+'"'),!0}function F(t){var e,n;if(n=t.input.charCodeAt(t.position),38!==n)return!1;for(null!==t.anchor&&d(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!o(n)&&!a(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&d(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function N(t){var e,n,i;if(i=t.input.charCodeAt(t.position),42!==i)return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!o(i)&&!a(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&d(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),t.anchorMap.hasOwnProperty(n)||d(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],A(t,!0,-1),!0}function T(t,e,n,i,r){var o,a,s,c,u,l,p,f,h=1,m=!1,g=!1;if(t.tag=null,t.anchor=null,t.kind=null,t.result=null,o=a=s=Z===n||V===n,i&&A(t,!0,-1)&&(m=!0,t.lineIndent>e?h=1:t.lineIndent===e?h=0:t.lineIndent<e&&(h=-1)),1===h)for(;E(t)||F(t);)A(t,!0,-1)?(m=!0,s=o,t.lineIndent>e?h=1:t.lineIndent===e?h=0:t.lineIndent<e&&(h=-1)):s=!1;if(s&&(s=m||r),(1===h||Z===n)&&(p=W===n||G===n?e:e+1,f=t.position-t.lineStart,1===h?s&&(_(t,f)||I(t,f,p))||O(t,p)?g=!0:(a&&S(t,p)||C(t,p)||j(t,p)?g=!0:N(t)?(g=!0,(null!==t.tag||null!==t.anchor)&&d(t,"alias node should not have any properties")):k(t,p,W===n)&&(g=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===h&&(g=s&&_(t,f))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(c=0,u=t.implicitTypes.length;u>c;c+=1)if(l=t.implicitTypes[c],l.resolve(t.result)){t.result=l.construct(t.result),t.tag=l.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else R.call(t.typeMap,t.tag)?(l=t.typeMap[t.tag],null!==t.result&&l.kind!==t.kind&&d(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+l.kind+'", not "'+t.kind+'"'),l.resolve(t.result)?(t.result=l.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):d(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):d(t,"unknown tag !<"+t.tag+">");return null!==t.tag||null!==t.anchor||g}function M(t){var e,n,a,s,c=t.position,u=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(s=t.input.charCodeAt(t.position))&&(A(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==s));){for(u=!0,s=t.input.charCodeAt(++t.position),e=t.position;0!==s&&!o(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(e,t.position),a=[],n.length<1&&d(t,"directive name must not be less than one character in length");0!==s;){for(;r(s);)s=t.input.charCodeAt(++t.position);if(35===s){do s=t.input.charCodeAt(++t.position);while(0!==s&&!i(s));break}if(i(s))break;for(e=t.position;0!==s&&!o(s);)s=t.input.charCodeAt(++t.position);a.push(t.input.slice(e,t.position))}0!==s&&x(t),R.call(st,n)?st[n](t,n,a):m(t,'unknown document directive "'+n+'"')}return A(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,A(t,!0,-1)):u&&d(t,"directives end mark is expected"),T(t,t.lineIndent-1,Z,!1,!0),A(t,!0,-1),t.checkLineBreaks&&tt.test(t.input.slice(c,t.position))&&m(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&b(t)?void(46===t.input.charCodeAt(t.position)&&(t.position+=3,A(t,!0,-1))):void(t.position<t.length-1&&d(t,"end of the stream or a document separator is expected"))}function L(t,e){t=String(t),e=e||{},0!==t.length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var n=new f(t,e);for(n.input+="\x00";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)M(n);return n.documents}function D(t,e,n){var i,r,o=L(t,n);for(i=0,r=o.length;r>i;i+=1)e(o[i])}function U(t,e){var n=L(t,e);if(0===n.length)return void 0;if(1===n.length)return n[0];throw new $("expected a single document in the stream, but found more")}function q(t,e,n){D(t,e,P.extend({schema:K},n))}function Y(t,e){return U(t,P.extend({schema:K},e))}for(var P=t("./common"),$=t("./exception"),B=t("./mark"),K=t("./schema/default_safe"),H=t("./schema/default_full"),R=Object.prototype.hasOwnProperty,W=1,G=2,V=3,Z=4,z=1,J=2,Q=3,X=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,tt=/[\x85\u2028\u2029]/,et=/[,\[\]\{\}]/,nt=/^(?:!|!!|![a-z\-]+!)$/i,it=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,rt=new Array(256),ot=new Array(256),at=0;256>at;at++)rt[at]=l(at)?1:0,ot[at]=l(at);var st={YAML:function(t,e,n){var i,r,o;null!==t.version&&d(t,"duplication of %YAML directive"),1!==n.length&&d(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===i&&d(t,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&d(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=2>o,1!==o&&2!==o&&m(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var i,r;2!==n.length&&d(t,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],nt.test(i)||d(t,"ill-formed tag handle (first argument) of the TAG directive"),R.call(t.tagMap,i)&&d(t,'there is a previously declared suffix for "'+i+'" tag handle'),it.test(r)||d(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[i]=r}};e.exports.loadAll=D,e.exports.load=U,e.exports.safeLoadAll=q,e.exports.safeLoad=Y},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(t,e,n){"use strict";function i(t,e,n,i,r){this.name=t,this.buffer=e,this.position=n,this.line=i,this.column=r}var r=t("./common");i.prototype.getSnippet=function(t,e){var n,i,o,a,s;if(!this.buffer)return null;for(t=t||4,e=e||75,n="",i=this.position;i>0&&-1==="\x00\r\n…\u2028\u2029".indexOf(this.buffer.charAt(i-1));)if(i-=1,this.position-i>e/2-1){n=" ... ",i+=5;break}for(o="",a=this.position;a<this.buffer.length&&-1==="\x00\r\n…\u2028\u2029".indexOf(this.buffer.charAt(a));)if(a+=1,a-this.position>e/2-1){o=" ... ",a-=5;break}return s=this.buffer.slice(i,a),r.repeat(" ",t)+n+s+o+"\n"+r.repeat(" ",t+this.position-i+n.length)+"^"},i.prototype.toString=function(t){var e,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet(),e&&(n+=":\n"+e)),n},e.exports=i},{"./common":2}],7:[function(t,e,n){"use strict";function i(t,e,n){var r=[];return t.include.forEach(function(t){n=i(t,e,n)}),t[e].forEach(function(t){n.forEach(function(e,n){e.tag===t.tag&&r.push(n)}),n.push(t)}),n.filter(function(t,e){return-1===r.indexOf(e)})}function r(){function t(t){i[t.tag]=t}var e,n,i={};for(e=0,n=arguments.length;n>e;e+=1)arguments[e].forEach(t);return i}function o(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&"scalar"!==t.loadKind)throw new s("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=i(this,"implicit",[]),this.compiledExplicit=i(this,"explicit",[]),this.compiledTypeMap=r(this.compiledImplicit,this.compiledExplicit)}var a=t("./common"),s=t("./exception"),c=t("./type");o.DEFAULT=null,o.create=function(){var t,e;switch(arguments.length){case 1:t=o.DEFAULT,e=arguments[0];break;case 2:t=arguments[0],e=arguments[1];break;default:throw new s("Wrong number of arguments for Schema.create function")}if(t=a.toArray(t),e=a.toArray(e),!t.every(function(t){return t instanceof o}))throw new s("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!e.every(function(t){return t instanceof c}))throw new s("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new o({include:t,explicit:e})},e.exports=o},{"./common":2,"./exception":4,"./type":13}],8:[function(t,e,n){"use strict";var i=t("../schema");e.exports=new i({include:[t("./json")]})},{"../schema":7,"./json":12}],9:[function(t,e,n){"use strict";var i=t("../schema");e.exports=i.DEFAULT=new i({include:[t("./default_safe")],explicit:[t("../type/js/undefined"),t("../type/js/regexp"),t("../type/js/function")]})},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(t,e,n){"use strict";var i=t("../schema");e.exports=new i({include:[t("./core")],implicit:[t("../type/timestamp"),t("../type/merge")],explicit:[t("../type/binary"),t("../type/omap"),t("../type/pairs"),t("../type/set")]})},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(t,e,n){"use strict";var i=t("../schema");e.exports=new i({explicit:[t("../type/str"),t("../type/seq"),t("../type/map")]})},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(t,e,n){"use strict";var i=t("../schema");e.exports=new i({include:[t("./failsafe")],implicit:[t("../type/null"),t("../type/bool"),t("../type/int"),t("../type/float")]})},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(t,e,n){"use strict";function i(t){var e={};return null!==t&&Object.keys(t).forEach(function(n){t[n].forEach(function(t){e[String(t)]=n})}),e}function r(t,e){if(e=e||{},Object.keys(e).forEach(function(e){if(-1===a.indexOf(e))throw new o('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=i(e.styleAliases||null),-1===s.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var o=t("./exception"),a=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];e.exports=r},{"./exception":4}],14:[function(t,e,n){"use strict";function i(t){if(null===t)return!1;var e,n,i=0,r=t.length,o=u;for(n=0;r>n;n++)if(e=o.indexOf(t.charAt(n)),!(e>64)){if(0>e)return!1;i+=6}return i%8===0}function r(t){var e,n,i=t.replace(/[\r\n=]/g,""),r=i.length,o=u,a=0,c=[];for(e=0;r>e;e++)e%4===0&&e&&(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)),a=a<<6|o.indexOf(i.charAt(e));return n=r%4*6,0===n?(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)):18===n?(c.push(a>>10&255),c.push(a>>2&255)):12===n&&c.push(a>>4&255),s?new s(c):c}function o(t){var e,n,i="",r=0,o=t.length,a=u;for(e=0;o>e;e++)e%3===0&&e&&(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+t[e];return n=o%3,0===n?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}function a(t){return s&&s.isBuffer(t)}var s=t("buffer").Buffer,c=t("../type"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new c("tag:yaml.org,2002:binary",{kind:"scalar",resolve:i,
+construct:r,predicate:a,represent:o})},{"../type":13,buffer:30}],15:[function(t,e,n){"use strict";function i(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)}function r(t){return"true"===t||"True"===t||"TRUE"===t}function o(t){return"[object Boolean]"===Object.prototype.toString.call(t)}var a=t("../type");e.exports=new a("tag:yaml.org,2002:bool",{kind:"scalar",resolve:i,construct:r,predicate:o,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(t,e,n){"use strict";function i(t){return null===t?!1:u.test(t)?!0:!1}function r(t){var e,n,i,r;return e=t.replace(/_/g,"").toLowerCase(),n="-"===e[0]?-1:1,r=[],0<="+-".indexOf(e[0])&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:0<=e.indexOf(":")?(e.split(":").forEach(function(t){r.unshift(parseFloat(t,10))}),e=0,i=1,r.forEach(function(t){e+=t*i,i*=60}),n*e):n*parseFloat(e,10)}function o(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(s.isNegativeZero(t))return"-0.0";return n=t.toString(10),l.test(n)?n.replace("e",".e"):n}function a(t){return"[object Number]"===Object.prototype.toString.call(t)&&(0!==t%1||s.isNegativeZero(t))}var s=t("../common"),c=t("../type"),u=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?|\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),l=/^[-+]?[0-9]+e/;e.exports=new c("tag:yaml.org,2002:float",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o,defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(t,e,n){"use strict";function i(t){return t>=48&&57>=t||t>=65&&70>=t||t>=97&&102>=t}function r(t){return t>=48&&55>=t}function o(t){return t>=48&&57>=t}function a(t){if(null===t)return!1;var e,n=t.length,a=0,s=!1;if(!n)return!1;if(e=t[a],("-"===e||"+"===e)&&(e=t[++a]),"0"===e){if(a+1===n)return!0;if(e=t[++a],"b"===e){for(a++;n>a;a++)if(e=t[a],"_"!==e){if("0"!==e&&"1"!==e)return!1;s=!0}return s}if("x"===e){for(a++;n>a;a++)if(e=t[a],"_"!==e){if(!i(t.charCodeAt(a)))return!1;s=!0}return s}for(;n>a;a++)if(e=t[a],"_"!==e){if(!r(t.charCodeAt(a)))return!1;s=!0}return s}for(;n>a;a++)if(e=t[a],"_"!==e){if(":"===e)break;if(!o(t.charCodeAt(a)))return!1;s=!0}return s?":"!==e?!0:/^(:[0-5]?[0-9])+$/.test(t.slice(a)):!1}function s(t){var e,n,i=t,r=1,o=[];return-1!==i.indexOf("_")&&(i=i.replace(/_/g,"")),e=i[0],("-"===e||"+"===e)&&("-"===e&&(r=-1),i=i.slice(1),e=i[0]),"0"===i?0:"0"===e?"b"===i[1]?r*parseInt(i.slice(2),2):"x"===i[1]?r*parseInt(i,16):r*parseInt(i,8):-1!==i.indexOf(":")?(i.split(":").forEach(function(t){o.unshift(parseInt(t,10))}),i=0,n=1,o.forEach(function(t){i+=t*n,n*=60}),r*i):r*parseInt(i,10)}function c(t){return"[object Number]"===Object.prototype.toString.call(t)&&0===t%1&&!u.isNegativeZero(t)}var u=t("../common"),l=t("../type");e.exports=new l("tag:yaml.org,2002:int",{kind:"scalar",resolve:a,construct:s,predicate:c,represent:{binary:function(t){return"0b"+t.toString(2)},octal:function(t){return"0"+t.toString(8)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return"0x"+t.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":2,"../type":13}],18:[function(t,e,n){"use strict";function i(t){if(null===t)return!1;try{var e="("+t+")",n=s.parse(e,{range:!0});return"Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"FunctionExpression"!==n.body[0].expression.type?!1:!0}catch(i){return!1}}function r(t){var e,n="("+t+")",i=s.parse(n,{range:!0}),r=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach(function(t){r.push(t.name)}),e=i.body[0].expression.body.range,new Function(r,n.slice(e[0]+1,e[1]-1))}function o(t){return t.toString()}function a(t){return"[object Function]"===Object.prototype.toString.call(t)}var s;try{s=t("esprima")}catch(c){"undefined"!=typeof window&&(s=window.esprima)}var u=t("../../type");e.exports=new u("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o})},{"../../type":13,esprima:"esprima"}],19:[function(t,e,n){"use strict";function i(t){if(null===t)return!1;if(0===t.length)return!1;var e=t,n=/\/([gim]*)$/.exec(t),i="";if("/"===e[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==e[e.length-i.length-1])return!1;e=e.slice(1,e.length-i.length-1)}try{return!0}catch(r){return!1}}function r(t){var e=t,n=/\/([gim]*)$/.exec(t),i="";return"/"===e[0]&&(n&&(i=n[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)}function o(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}function a(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var s=t("../../type");e.exports=new s("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o})},{"../../type":13}],20:[function(t,e,n){"use strict";function i(){return!0}function r(){return void 0}function o(){return""}function a(t){return"undefined"==typeof t}var s=t("../../type");e.exports=new s("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o})},{"../../type":13}],21:[function(t,e,n){"use strict";var i=t("../type");e.exports=new i("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}})},{"../type":13}],22:[function(t,e,n){"use strict";function i(t){return"<<"===t||null===t}var r=t("../type");e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:i})},{"../type":13}],23:[function(t,e,n){"use strict";function i(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)}function r(){return null}function o(t){return null===t}var a=t("../type");e.exports=new a("tag:yaml.org,2002:null",{kind:"scalar",resolve:i,construct:r,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":13}],24:[function(t,e,n){"use strict";function i(t){if(null===t)return!0;var e,n,i,r,o,c=[],u=t;for(e=0,n=u.length;n>e;e+=1){if(i=u[e],o=!1,"[object Object]"!==s.call(i))return!1;for(r in i)if(a.call(i,r)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==c.indexOf(r))return!1;c.push(r)}return!0}function r(t){return null!==t?t:[]}var o=t("../type"),a=Object.prototype.hasOwnProperty,s=Object.prototype.toString;e.exports=new o("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i,construct:r})},{"../type":13}],25:[function(t,e,n){"use strict";function i(t){if(null===t)return!0;var e,n,i,r,o,s=t;for(o=new Array(s.length),e=0,n=s.length;n>e;e+=1){if(i=s[e],"[object Object]"!==a.call(i))return!1;if(r=Object.keys(i),1!==r.length)return!1;o[e]=[r[0],i[r[0]]]}return!0}function r(t){if(null===t)return[];var e,n,i,r,o,a=t;for(o=new Array(a.length),e=0,n=a.length;n>e;e+=1)i=a[e],r=Object.keys(i),o[e]=[r[0],i[r[0]]];return o}var o=t("../type"),a=Object.prototype.toString;e.exports=new o("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:i,construct:r})},{"../type":13}],26:[function(t,e,n){"use strict";var i=t("../type");e.exports=new i("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}})},{"../type":13}],27:[function(t,e,n){"use strict";function i(t){if(null===t)return!0;var e,n=t;for(e in n)if(a.call(n,e)&&null!==n[e])return!1;return!0}function r(t){return null!==t?t:{}}var o=t("../type"),a=Object.prototype.hasOwnProperty;e.exports=new o("tag:yaml.org,2002:set",{kind:"mapping",resolve:i,construct:r})},{"../type":13}],28:[function(t,e,n){"use strict";var i=t("../type");e.exports=new i("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}})},{"../type":13}],29:[function(t,e,n){"use strict";function i(t){return null===t?!1:null===s.exec(t)?!1:!0}function r(t){var e,n,i,r,o,a,c,u,l,p,f=0,h=null;if(e=s.exec(t),null===e)throw new Error("Date resolve error");if(n=+e[1],i=+e[2]-1,r=+e[3],!e[4])return new Date(Date.UTC(n,i,r));if(o=+e[4],a=+e[5],c=+e[6],e[7]){for(f=e[7].slice(0,3);f.length<3;)f+="0";f=+f}return e[9]&&(u=+e[10],l=+(e[11]||0),h=6e4*(60*u+l),"-"===e[9]&&(h=-h)),p=new Date(Date.UTC(n,i,r,o,a,c,f)),h&&p.setTime(p.getTime()-h),p}function o(t){return t.toISOString()}var a=t("../type"),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$");e.exports=new a("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:i,construct:r,instanceOf:Date,represent:o})},{"../type":13}],30:[function(t,e,n){},{}],31:[function(t,e,n){e.exports=t("./lib/inherit")},{"./lib/inherit":32}],32:[function(e,n,i){!function(e){function r(t){var e=f(t);if(v)for(var n,i=0;n=b[i++];)t.hasOwnProperty(n)&&e.push(n);return e}function o(t,e,n){for(var i,o,a=r(n),s=0,u=a.length;u>s;)"__self"!==(i=a[s++])&&(o=n[i],g(o)&&(!c||o.toString().indexOf(".__base")>-1)?e[i]=function(n,i){var r=t[n]?t[n]:"__constructor"===n?e.__self.__parent:y;return function(){var t=this.__base;this.__base=r;var e=i.apply(this,arguments);return this.__base=t,e}}(i,o):e[i]=o)}function a(t,e){for(var n,i=1;n=t[i++];)e?g(n)?s.self(e,n.prototype,n):s.self(e,n):e=g(n)?s(t[0],n.prototype,n):s(t[0],n);return e||t[0]}function s(){var t=arguments,e=m(t[0]),n=e||g(t[0]),i=n?e?a(t[0]):t[0]:u,r=t[n?1:0]||{},s=t[n?2:1],c=r.__constructor||n&&i.prototype.__constructor?function(){return this.__constructor.apply(this,arguments)}:n?function(){return i.apply(this,arguments)}:function(){};if(!n)return c.prototype=r,c.prototype.__self=c.prototype.constructor=c,h(c,s);h(c,i),c.__parent=i;var l=i.prototype,f=c.prototype=p(l);return f.__self=f.constructor=c,r&&o(l,f,r),s&&o(i,c,s),c}var c=function(){"_"}.toString().indexOf("_")>-1,u=function(){},l=Object.prototype.hasOwnProperty,p=Object.create||function(t){var e=function(){};return e.prototype=t,new e},f=Object.keys||function(t){var e=[];for(var n in t)l.call(t,n)&&e.push(n);return e},h=function(t,e){for(var n in e)l.call(e,n)&&(t[n]=e[n]);return t},d=Object.prototype.toString,m=Array.isArray||function(t){return"[object Array]"===d.call(t)},g=function(t){return"[object Function]"===d.call(t)},y=function(){},v=!0,x={toString:""};for(var A in x)x.hasOwnProperty(A)&&(v=!1);var b=v?["toString","valueOf"]:null;s.self=function(){var t=arguments,e=m(t[0]),n=e?a(t[0],t[0][0]):t[0],i=t[1],r=t[2],s=n.prototype;return i&&o(s,s,i),r&&o(n,n,r),n};var w=!0;"object"==typeof i&&(n.exports=s,w=!1),"object"==typeof modules&&(modules.define("inherit",function(t){t(s)}),w=!1),"function"==typeof t&&(t(function(t,e,n){n.exports=s}),w=!1),w&&(e.inherit=s)}(this)},{}],"/":[function(t,e,n){"use strict";var i=t("./lib/js-yaml.js");e.exports=i},{"./lib/js-yaml.js":1}]},{},[])("/")});
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jsoneditor.min.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jsoneditor.min.js
new file mode 100644
index 0000000..343397f
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/jsoneditor.min.js
@@ -0,0 +1,11 @@
+/*! JSON Editor v0.7.22 - JSON Schema -> HTML Editor
+ * By Jeremy Dorn - https://github.com/jdorn/json-editor/
+ * Released under the MIT license
+ *
+ * Date: 2015-08-12
+ */
+!function(){var a;!function(){var b=!1,c=/xyz/.test(function(){window.postMessage("xyz")})?/\b_super\b/:/.*/;return a=function(){},a.extend=function(a){function d(){!b&&this.init&&this.init.apply(this,arguments)}var e=this.prototype;b=!0;var f=new this;b=!1;for(var g in a)f[g]="function"==typeof a[g]&&"function"==typeof e[g]&&c.test(a[g])?function(a,b){return function(){var c=this._super;this._super=e[a];var d=b.apply(this,arguments);return this._super=c,d}}(g,a[g]):a[g];return d.prototype=f,d.prototype.constructor=d,d.extend=arguments.callee,d},a}(),function(){function a(a,b){b=b||{bubbles:!1,cancelable:!1,detail:void 0};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail),c}a.prototype=window.Event.prototype,window.CustomEvent=a}(),function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(b,c){var d=(new Date).getTime(),e=Math.max(0,16-(d-a)),f=window.setTimeout(function(){b(d+e)},e);return a=d+e,f}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(a){clearTimeout(a)})}(),function(){Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)})}();var b=function(a){return"object"!=typeof a||a.nodeType||null!==a&&a===a.window?!1:a.constructor&&!Object.prototype.hasOwnProperty.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},c=function(a){var d,e,f;for(e=1;e<arguments.length;e++){d=arguments[e];for(f in d)d.hasOwnProperty(f)&&(d[f]&&b(d[f])?(a.hasOwnProperty(f)||(a[f]={}),c(a[f],d[f])):a[f]=d[f])}return a},d=function(a,b){if(a&&"object"==typeof a){var c;if(Array.isArray(a)||"number"==typeof a.length&&a.length>0&&a.length-1 in a){for(c=0;c<a.length;c++)if(b(c,a[c])===!1)return}else if(Object.keys){var d=Object.keys(a);for(c=0;c<d.length;c++)if(b(d[c],a[d[c]])===!1)return}else for(c in a)if(a.hasOwnProperty(c)&&b(c,a[c])===!1)return}},e=function(a,b){var c=document.createEvent("HTMLEvents");c.initEvent(b,!0,!0),a.dispatchEvent(c)},f=function(a,b){if(!(a instanceof Element))throw new Error("element should be an instance of Element");b=c({},f.defaults.options,b||{}),this.element=a,this.options=b,this.init()};f.prototype={constructor:f,init:function(){var a=this;this.ready=!1;var b=f.defaults.themes[this.options.theme||f.defaults.theme];if(!b)throw"Unknown theme "+(this.options.theme||f.defaults.theme);this.schema=this.options.schema,this.theme=new b,this.template=this.options.template,this.refs=this.options.refs||{},this.uuid=0,this.__data={};var c=f.defaults.iconlibs[this.options.iconlib||f.defaults.iconlib];c&&(this.iconlib=new c),this.root_container=this.theme.getContainer(),this.element.appendChild(this.root_container),this.translate=this.options.translate||f.defaults.translate,this._loadExternalRefs(this.schema,function(){a._getDefinitions(a.schema),a.validator=new f.Validator(a);var b=a.getEditorClass(a.schema);a.root=a.createEditor(b,{jsoneditor:a,schema:a.schema,required:!0,container:a.root_container}),a.root.preBuild(),a.root.build(),a.root.postBuild(),a.options.startval&&a.root.setValue(a.options.startval),a.validation_results=a.validator.validate(a.root.getValue()),a.root.showValidationErrors(a.validation_results),a.ready=!0,window.requestAnimationFrame(function(){a.ready&&(a.validation_results=a.validator.validate(a.root.getValue()),a.root.showValidationErrors(a.validation_results),a.trigger("ready"),a.trigger("change"))})})},getValue:function(){if(!this.ready)throw"JSON Editor not ready yet. Listen for 'ready' event before getting the value";return this.root.getValue()},setValue:function(a){if(!this.ready)throw"JSON Editor not ready yet. Listen for 'ready' event before setting the value";return this.root.setValue(a),this},validate:function(a){if(!this.ready)throw"JSON Editor not ready yet. Listen for 'ready' event before validating";return 1===arguments.length?this.validator.validate(a):this.validation_results},destroy:function(){this.destroyed||this.ready&&(this.schema=null,this.options=null,this.root.destroy(),this.root=null,this.root_container=null,this.validator=null,this.validation_results=null,this.theme=null,this.iconlib=null,this.template=null,this.__data=null,this.ready=!1,this.element.innerHTML="",this.destroyed=!0)},on:function(a,b){return this.callbacks=this.callbacks||{},this.callbacks[a]=this.callbacks[a]||[],this.callbacks[a].push(b),this},off:function(a,b){if(a&&b){this.callbacks=this.callbacks||{},this.callbacks[a]=this.callbacks[a]||[];for(var c=[],d=0;d<this.callbacks[a].length;d++)this.callbacks[a][d]!==b&&c.push(this.callbacks[a][d]);this.callbacks[a]=c}else a?(this.callbacks=this.callbacks||{},this.callbacks[a]=[]):this.callbacks={};return this},trigger:function(a){if(this.callbacks&&this.callbacks[a]&&this.callbacks[a].length)for(var b=0;b<this.callbacks[a].length;b++)this.callbacks[a][b]();return this},setOption:function(a,b){if("show_errors"!==a)throw"Option "+a+" must be set during instantiation and cannot be changed later";return this.options.show_errors=b,this.onChange(),this},getEditorClass:function(a){var b;if(a=this.expandSchema(a),d(f.defaults.resolvers,function(c,d){var e=d(a);return e&&f.defaults.editors[e]?(b=e,!1):void 0}),!b)throw"Unknown editor for schema "+JSON.stringify(a);if(!f.defaults.editors[b])throw"Unknown editor "+b;return f.defaults.editors[b]},createEditor:function(a,b){return b=c({},a.options||{},b),new a(b)},onChange:function(){if(this.ready&&!this.firing_change){this.firing_change=!0;var a=this;return window.requestAnimationFrame(function(){a.firing_change=!1,a.ready&&(a.validation_results=a.validator.validate(a.root.getValue()),"never"!==a.options.show_errors?a.root.showValidationErrors(a.validation_results):a.root.showValidationErrors([]),a.trigger("change"))}),this}},compileTemplate:function(a,b){b=b||f.defaults.template;var c;if("string"==typeof b){if(!f.defaults.templates[b])throw"Unknown template engine "+b;if(c=f.defaults.templates[b](),!c)throw"Template engine "+b+" missing required library."}else c=b;if(!c)throw"No template engine set";if(!c.compile)throw"Invalid template engine set";return c.compile(a)},_data:function(a,b,c){if(3!==arguments.length)return a.hasAttribute("data-jsoneditor-"+b)?this.__data[a.getAttribute("data-jsoneditor-"+b)]:null;var d;a.hasAttribute("data-jsoneditor-"+b)?d=a.getAttribute("data-jsoneditor-"+b):(d=this.uuid++,a.setAttribute("data-jsoneditor-"+b,d)),this.__data[d]=c},registerEditor:function(a){return this.editors=this.editors||{},this.editors[a.path]=a,this},unregisterEditor:function(a){return this.editors=this.editors||{},this.editors[a.path]=null,this},getEditor:function(a){return this.editors?this.editors[a]:void 0},watch:function(a,b){return this.watchlist=this.watchlist||{},this.watchlist[a]=this.watchlist[a]||[],this.watchlist[a].push(b),this},unwatch:function(a,b){if(!this.watchlist||!this.watchlist[a])return this;if(!b)return this.watchlist[a]=null,this;for(var c=[],d=0;d<this.watchlist[a].length;d++)this.watchlist[a][d]!==b&&c.push(this.watchlist[a][d]);return this.watchlist[a]=c.length?c:null,this},notifyWatchers:function(a){if(!this.watchlist||!this.watchlist[a])return this;for(var b=0;b<this.watchlist[a].length;b++)this.watchlist[a][b]()},isEnabled:function(){return!this.root||this.root.isEnabled()},enable:function(){this.root.enable()},disable:function(){this.root.disable()},_getDefinitions:function(a,b){if(b=b||"#/definitions/",a.definitions)for(var c in a.definitions)a.definitions.hasOwnProperty(c)&&(this.refs[b+c]=a.definitions[c],a.definitions[c].definitions&&this._getDefinitions(a.definitions[c],b+c+"/definitions/"))},_getExternalRefs:function(a){var b={},c=function(a){for(var c in a)a.hasOwnProperty(c)&&(b[c]=!0)};a.$ref&&"object"!=typeof a.$ref&&"#"!==a.$ref.substr(0,1)&&!this.refs[a.$ref]&&(b[a.$ref]=!0);for(var d in a)if(a.hasOwnProperty(d))if(a[d]&&"object"==typeof a[d]&&Array.isArray(a[d]))for(var e=0;e<a[d].length;e++)"object"==typeof a[d][e]&&c(this._getExternalRefs(a[d][e]));else a[d]&&"object"==typeof a[d]&&c(this._getExternalRefs(a[d]));return b},_loadExternalRefs:function(a,b){var c=this,e=this._getExternalRefs(a),f=0,g=0,h=!1;d(e,function(a){if(!c.refs[a]){if(!c.options.ajax)throw"Must set ajax option to true to load external ref "+a;c.refs[a]="loading",g++;var d=new XMLHttpRequest;d.open("GET",a,!0),d.onreadystatechange=function(){if(4==d.readyState){if(200!==d.status)throw window.console.log(d),"Failed to fetch ref via ajax- "+a;var e;try{e=JSON.parse(d.responseText)}catch(i){throw window.console.log(i),"Failed to parse external ref "+a}if(!e||"object"!=typeof e)throw"External ref does not contain a valid schema - "+a;c.refs[a]=e,c._loadExternalRefs(e,function(){f++,f>=g&&!h&&(h=!0,b())})}},d.send()}}),g||b()},expandRefs:function(a){for(a=c({},a);a.$ref;){var b=a.$ref;delete a.$ref,this.refs[b]||(b=decodeURIComponent(b)),a=this.extendSchemas(a,this.refs[b])}return a},expandSchema:function(a){var b,e=this,f=c({},a);if("object"==typeof a.type&&(Array.isArray(a.type)?d(a.type,function(b,c){"object"==typeof c&&(a.type[b]=e.expandSchema(c))}):a.type=e.expandSchema(a.type)),"object"==typeof a.disallow&&(Array.isArray(a.disallow)?d(a.disallow,function(b,c){"object"==typeof c&&(a.disallow[b]=e.expandSchema(c))}):a.disallow=e.expandSchema(a.disallow)),a.anyOf&&d(a.anyOf,function(b,c){a.anyOf[b]=e.expandSchema(c)}),a.dependencies&&d(a.dependencies,function(b,c){"object"!=typeof c||Array.isArray(c)||(a.dependencies[b]=e.expandSchema(c))}),a.not&&(a.not=this.expandSchema(a.not)),a.allOf){for(b=0;b<a.allOf.length;b++)f=this.extendSchemas(f,this.expandSchema(a.allOf[b]));delete f.allOf}if(a["extends"]){if(Array.isArray(a["extends"]))for(b=0;b<a["extends"].length;b++)f=this.extendSchemas(f,this.expandSchema(a["extends"][b]));else f=this.extendSchemas(f,this.expandSchema(a["extends"]));delete f["extends"]}if(a.oneOf){var g=c({},f);for(delete g.oneOf,b=0;b<a.oneOf.length;b++)f.oneOf[b]=this.extendSchemas(this.expandSchema(a.oneOf[b]),g)}return this.expandRefs(f)},extendSchemas:function(a,b){a=c({},a),b=c({},b);var e=this,f={};return d(a,function(a,c){"undefined"!=typeof b[a]?"required"===a&&"object"==typeof c&&Array.isArray(c)?f.required=c.concat(b[a]).reduce(function(a,b){return a.indexOf(b)<0&&a.push(b),a},[]):"type"!==a||"string"!=typeof c&&!Array.isArray(c)?"object"==typeof c&&Array.isArray(c)?f[a]=c.filter(function(c){return-1!==b[a].indexOf(c)}):"object"==typeof c&&null!==c?f[a]=e.extendSchemas(c,b[a]):f[a]=c:("string"==typeof c&&(c=[c]),"string"==typeof b.type&&(b.type=[b.type]),f.type=c.filter(function(a){return-1!==b.type.indexOf(a)}),1===f.type.length&&"string"==typeof f.type[0]&&(f.type=f.type[0])):f[a]=c}),d(b,function(b,c){"undefined"==typeof a[b]&&(f[b]=c)}),f}},f.defaults={themes:{},templates:{},iconlibs:{},editors:{},languages:{},resolvers:[],custom_validators:[]},f.Validator=a.extend({init:function(a,b){this.jsoneditor=a,this.schema=b||this.jsoneditor.schema,this.options={},this.translate=this.jsoneditor.translate||f.defaults.translate},validate:function(a){return this._validateSchema(this.schema,a)},_validateSchema:function(a,b,e){var g,h,i,j=this,k=[],l=JSON.stringify(b);if(e=e||"root",a=c({},this.jsoneditor.expandRefs(a)),a.required&&a.required===!0){if("undefined"==typeof b)return k.push({path:e,property:"required",message:this.translate("error_notset")}),k}else if("undefined"==typeof b){if(!this.jsoneditor.options.required_by_default)return k;k.push({path:e,property:"required",message:this.translate("error_notset")})}if(a["enum"]){for(g=!1,h=0;h<a["enum"].length;h++)l===JSON.stringify(a["enum"][h])&&(g=!0);g||k.push({path:e,property:"enum",message:this.translate("error_enum")})}if(a["extends"])for(h=0;h<a["extends"].length;h++)k=k.concat(this._validateSchema(a["extends"][h],b,e));if(a.allOf)for(h=0;h<a.allOf.length;h++)k=k.concat(this._validateSchema(a.allOf[h],b,e));if(a.anyOf){for(g=!1,h=0;h<a.anyOf.length;h++)if(!this._validateSchema(a.anyOf[h],b,e).length){g=!0;break}g||k.push({path:e,property:"anyOf",message:this.translate("error_anyOf")})}if(a.oneOf){g=0;var m=[];for(h=0;h<a.oneOf.length;h++){var n=this._validateSchema(a.oneOf[h],b,e);for(n.length||g++,i=0;i<n.length;i++)n[i].path=e+".oneOf["+h+"]"+n[i].path.substr(e.length);m=m.concat(n)}1!==g&&(k.push({path:e,property:"oneOf",message:this.translate("error_oneOf",[g])}),k=k.concat(m))}if(a.not&&(this._validateSchema(a.not,b,e).length||k.push({path:e,property:"not",message:this.translate("error_not")})),a.type)if(Array.isArray(a.type)){for(g=!1,h=0;h<a.type.length;h++)if(this._checkType(a.type[h],b)){g=!0;break}g||k.push({path:e,property:"type",message:this.translate("error_type_union")})}else this._checkType(a.type,b)||k.push({path:e,property:"type",message:this.translate("error_type",[a.type])});if(a.disallow)if(Array.isArray(a.disallow)){for(g=!0,h=0;h<a.disallow.length;h++)if(this._checkType(a.disallow[h],b)){g=!1;break}g||k.push({path:e,property:"disallow",message:this.translate("error_disallow_union")})}else this._checkType(a.disallow,b)&&k.push({path:e,property:"disallow",message:this.translate("error_disallow",[a.disallow])});if("number"==typeof b)(a.multipleOf||a.divisibleBy)&&(g=b/(a.multipleOf||a.divisibleBy),g!==Math.floor(g)&&k.push({path:e,property:a.multipleOf?"multipleOf":"divisibleBy",message:this.translate("error_multipleOf",[a.multipleOf||a.divisibleBy])})),a.hasOwnProperty("maximum")&&(a.exclusiveMaximum&&b>=a.maximum?k.push({path:e,property:"maximum",message:this.translate("error_maximum_excl",[a.maximum])}):!a.exclusiveMaximum&&b>a.maximum&&k.push({path:e,property:"maximum",message:this.translate("error_maximum_incl",[a.maximum])})),a.hasOwnProperty("minimum")&&(a.exclusiveMinimum&&b<=a.minimum?k.push({path:e,property:"minimum",message:this.translate("error_minimum_excl",[a.minimum])}):!a.exclusiveMinimum&&b<a.minimum&&k.push({path:e,property:"minimum",message:this.translate("error_minimum_incl",[a.minimum])}));else if("string"==typeof b)a.maxLength&&(b+"").length>a.maxLength&&k.push({path:e,property:"maxLength",message:this.translate("error_maxLength",[a.maxLength])}),a.minLength&&(b+"").length<a.minLength&&k.push({path:e,property:"minLength",message:this.translate(1===a.minLength?"error_notempty":"error_minLength",[a.minLength])}),a.pattern&&(new RegExp(a.pattern).test(b)||k.push({path:e,property:"pattern",message:this.translate("error_pattern")}));else if("object"==typeof b&&null!==b&&Array.isArray(b)){if(a.items)if(Array.isArray(a.items))for(h=0;h<b.length;h++)if(a.items[h])k=k.concat(this._validateSchema(a.items[h],b[h],e+"."+h));else{if(a.additionalItems===!0)break;if(!a.additionalItems){if(a.additionalItems===!1){k.push({path:e,property:"additionalItems",message:this.translate("error_additionalItems")});break}break}k=k.concat(this._validateSchema(a.additionalItems,b[h],e+"."+h))}else for(h=0;h<b.length;h++)k=k.concat(this._validateSchema(a.items,b[h],e+"."+h));if(a.maxItems&&b.length>a.maxItems&&k.push({path:e,property:"maxItems",message:this.translate("error_maxItems",[a.maxItems])}),a.minItems&&b.length<a.minItems&&k.push({path:e,property:"minItems",message:this.translate("error_minItems",[a.minItems])}),a.uniqueItems){var o={};for(h=0;h<b.length;h++){if(g=JSON.stringify(b[h]),o[g]){k.push({path:e,property:"uniqueItems",message:this.translate("error_uniqueItems")});break}o[g]=!0}}}else if("object"==typeof b&&null!==b){if(a.maxProperties){g=0;for(h in b)b.hasOwnProperty(h)&&g++;g>a.maxProperties&&k.push({path:e,property:"maxProperties",message:this.translate("error_maxProperties",[a.maxProperties])})}if(a.minProperties){g=0;for(h in b)b.hasOwnProperty(h)&&g++;g<a.minProperties&&k.push({path:e,property:"minProperties",message:this.translate("error_minProperties",[a.minProperties])})}if(a.required&&Array.isArray(a.required))for(h=0;h<a.required.length;h++)"undefined"==typeof b[a.required[h]]&&k.push({path:e,property:"required",message:this.translate("error_required",[a.required[h]])});var p={};if(a.properties)for(h in a.properties)a.properties.hasOwnProperty(h)&&(p[h]=!0,k=k.concat(this._validateSchema(a.properties[h],b[h],e+"."+h)));if(a.patternProperties)for(h in a.patternProperties)if(a.patternProperties.hasOwnProperty(h)){var q=new RegExp(h);for(i in b)b.hasOwnProperty(i)&&q.test(i)&&(p[i]=!0,k=k.concat(this._validateSchema(a.patternProperties[h],b[i],e+"."+i)))}if("undefined"!=typeof a.additionalProperties||!this.jsoneditor.options.no_additional_properties||a.oneOf||a.anyOf||(a.additionalProperties=!1),"undefined"!=typeof a.additionalProperties)for(h in b)if(b.hasOwnProperty(h)&&!p[h]){if(!a.additionalProperties){k.push({path:e,property:"additionalProperties",message:this.translate("error_additional_properties",[h])});break}if(a.additionalProperties===!0)break;k=k.concat(this._validateSchema(a.additionalProperties,b[h],e+"."+h))}if(a.dependencies)for(h in a.dependencies)if(a.dependencies.hasOwnProperty(h)&&"undefined"!=typeof b[h])if(Array.isArray(a.dependencies[h]))for(i=0;i<a.dependencies[h].length;i++)"undefined"==typeof b[a.dependencies[h][i]]&&k.push({path:e,property:"dependencies",message:this.translate("error_dependency",[a.dependencies[h][i]])});else k=k.concat(this._validateSchema(a.dependencies[h],b,e))}return d(f.defaults.custom_validators,function(c,d){k=k.concat(d.call(j,a,b,e))}),k},_checkType:function(a,b){return"string"==typeof a?"string"===a?"string"==typeof b:"number"===a?"number"==typeof b:"integer"===a?"number"==typeof b&&b===Math.floor(b):"boolean"===a?"boolean"==typeof b:"array"===a?Array.isArray(b):"object"===a?null!==b&&!Array.isArray(b)&&"object"==typeof b:"null"===a?null===b:!0:!this._validateSchema(a,b).length}}),f.AbstractEditor=a.extend({onChildEditorChange:function(a){this.onChange(!0)},notify:function(){this.jsoneditor.notifyWatchers(this.path)},change:function(){this.parent?this.parent.onChildEditorChange(this):this.jsoneditor.onChange()},onChange:function(a){this.notify(),this.watch_listener&&this.watch_listener(),a&&this.change()},register:function(){this.jsoneditor.registerEditor(this),this.onChange()},unregister:function(){this.jsoneditor&&this.jsoneditor.unregisterEditor(this)},getNumColumns:function(){return 12},init:function(a){this.jsoneditor=a.jsoneditor,this.theme=this.jsoneditor.theme,this.template_engine=this.jsoneditor.template,this.iconlib=this.jsoneditor.iconlib,this.original_schema=a.schema,this.schema=this.jsoneditor.expandSchema(this.original_schema),this.options=c({},this.options||{},a.schema.options||{},a),a.path||this.schema.id||(this.schema.id="root"),this.path=a.path||"root",this.formname=a.formname||this.path.replace(/\.([^.]+)/g,"[$1]"),this.jsoneditor.options.form_name_root&&(this.formname=this.formname.replace(/^root\[/,this.jsoneditor.options.form_name_root+"[")),this.key=this.path.split(".").pop(),this.parent=a.parent,this.link_watchers=[],a.container&&this.setContainer(a.container)},setContainer:function(a){this.container=a,this.schema.id&&this.container.setAttribute("data-schemaid",this.schema.id),this.schema.type&&"string"==typeof this.schema.type&&this.container.setAttribute("data-schematype",this.schema.type),this.container.setAttribute("data-schemapath",this.path)},preBuild:function(){},build:function(){},postBuild:function(){this.setupWatchListeners(),this.addLinks(),this.setValue(this.getDefault(),!0),this.updateHeaderText(),this.register(),this.onWatchedFieldChange()},setupWatchListeners:function(){var a=this;if(this.watched={},this.schema.vars&&(this.schema.watch=this.schema.vars),this.watched_values={},this.watch_listener=function(){a.refreshWatchedFieldValues()&&a.onWatchedFieldChange()},this.register(),this.schema.hasOwnProperty("watch")){var b,c,d,e,f;for(var g in this.schema.watch)if(this.schema.watch.hasOwnProperty(g)){if(b=this.schema.watch[g],Array.isArray(b)?c=[b[0]].concat(b[1].split(".")):(c=b.split("."),a.theme.closest(a.container,'[data-schemaid="'+c[0]+'"]')||c.unshift("#")),d=c.shift(),"#"===d&&(d=a.jsoneditor.schema.id||"root"),e=a.theme.closest(a.container,'[data-schemaid="'+d+'"]'),!e)throw"Could not find ancestor node with id "+d;f=e.getAttribute("data-schemapath")+"."+c.join("."),a.jsoneditor.watch(f,a.watch_listener),a.watched[g]=f}}this.schema.headerTemplate&&(this.header_template=this.jsoneditor.compileTemplate(this.schema.headerTemplate,this.template_engine))},addLinks:function(){if(!this.no_link_holder&&(this.link_holder=this.theme.getLinksHolder(),this.container.appendChild(this.link_holder),this.schema.links))for(var a=0;a<this.schema.links.length;a++)this.addLink(this.getLink(this.schema.links[a]))},getButton:function(a,b,c){var d="json-editor-btn-"+b;b=this.iconlib?this.iconlib.getIcon(b):null,!b&&c&&(a=c,c=null);var e=this.theme.getButton(a,b,c);return e.className+=" "+d+" ",e},setButtonText:function(a,b,c,d){return c=this.iconlib?this.iconlib.getIcon(c):null,!c&&d&&(b=d,d=null),this.theme.setButtonText(a,b,c,d)},addLink:function(a){this.link_holder&&this.link_holder.appendChild(a)},getLink:function(a){var b,c,d=a.mediaType||"application/javascript",e=d.split("/")[0],f=this.jsoneditor.compileTemplate(a.href,this.template_engine);if("image"===e){b=this.theme.getBlockLinkHolder(),c=document.createElement("a"),c.setAttribute("target","_blank");var g=document.createElement("img");this.theme.createImageLink(b,c,g),this.link_watchers.push(function(b){var d=f(b);c.setAttribute("href",d),c.setAttribute("title",a.rel||d),g.setAttribute("src",d)})}else if(["audio","video"].indexOf(e)>=0){b=this.theme.getBlockLinkHolder(),c=this.theme.getBlockLink(),c.setAttribute("target","_blank");var h=document.createElement(e);h.setAttribute("controls","controls"),this.theme.createMediaLink(b,c,h),this.link_watchers.push(function(b){var d=f(b);c.setAttribute("href",d),c.textContent=a.rel||d,h.setAttribute("src",d)})}else b=this.theme.getBlockLink(),b.setAttribute("target","_blank"),b.textContent=a.rel,this.link_watchers.push(function(c){var d=f(c);b.setAttribute("href",d),b.textContent=a.rel||d});return b},refreshWatchedFieldValues:function(){if(this.watched_values){var a={},b=!1,c=this;if(this.watched){var d,e;for(var f in this.watched)this.watched.hasOwnProperty(f)&&(e=c.jsoneditor.getEditor(this.watched[f]),d=e?e.getValue():null,c.watched_values[f]!==d&&(b=!0),a[f]=d)}return a.self=this.getValue(),this.watched_values.self!==a.self&&(b=!0),this.watched_values=a,b}},getWatchedFieldValues:function(){return this.watched_values},updateHeaderText:function(){if(this.header)if(this.header.children.length){for(var a=0;a<this.header.childNodes.length;a++)if(3===this.header.childNodes[a].nodeType){this.header.childNodes[a].nodeValue=this.getHeaderText();break}}else this.header.textContent=this.getHeaderText()},getHeaderText:function(a){return this.header_text?this.header_text:a?this.schema.title:this.getTitle()},onWatchedFieldChange:function(){var a;if(this.header_template){a=c(this.getWatchedFieldValues(),{key:this.key,i:this.key,i0:1*this.key,i1:1*this.key+1,title:this.getTitle()});var b=this.header_template(a);b!==this.header_text&&(this.header_text=b,this.updateHeaderText(),this.notify())}if(this.link_watchers.length){a=this.getWatchedFieldValues();for(var d=0;d<this.link_watchers.length;d++)this.link_watchers[d](a)}},setValue:function(a){this.value=a},getValue:function(){return this.value},refreshValue:function(){},getChildEditors:function(){return!1},destroy:function(){var a=this;this.unregister(this),d(this.watched,function(b,c){a.jsoneditor.unwatch(c,a.watch_listener)}),this.watched=null,this.watched_values=null,this.watch_listener=null,this.header_text=null,this.header_template=null,this.value=null,this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.container=null,this.jsoneditor=null,this.schema=null,this.path=null,this.key=null,this.parent=null},getDefault:function(){if(this.schema["default"])return this.schema["default"];if(this.schema["enum"])return this.schema["enum"][0];var a=this.schema.type||this.schema.oneOf;if(a&&Array.isArray(a)&&(a=a[0]),a&&"object"==typeof a&&(a=a.type),a&&Array.isArray(a)&&(a=a[0]),"string"==typeof a){if("number"===a)return 0;if("boolean"===a)return!1;if("integer"===a)return 0;if("string"===a)return"";if("object"===a)return{};if("array"===a)return[]}return null},getTitle:function(){return this.schema.title||this.key},enable:function(){this.disabled=!1},disable:function(){this.disabled=!0},isEnabled:function(){return!this.disabled},isRequired:function(){return"boolean"==typeof this.schema.required?this.schema.required:this.parent&&this.parent.schema&&Array.isArray(this.parent.schema.required)?this.parent.schema.required.indexOf(this.key)>-1:this.jsoneditor.options.required_by_default?!0:!1},getDisplayText:function(a){var b=[],c={};d(a,function(a,b){b.title&&(c[b.title]=c[b.title]||0,c[b.title]++),b.description&&(c[b.description]=c[b.description]||0,c[b.description]++),b.format&&(c[b.format]=c[b.format]||0,c[b.format]++),b.type&&(c[b.type]=c[b.type]||0,c[b.type]++)}),d(a,function(a,d){var e;e="string"==typeof d?d:d.title&&c[d.title]<=1?d.title:d.format&&c[d.format]<=1?d.format:d.type&&c[d.type]<=1?d.type:d.description&&c[d.description]<=1?d.descripton:d.title?d.title:d.format?d.format:d.type?d.type:d.description?d.description:JSON.stringify(d).length<50?JSON.stringify(d):"type",b.push(e)});var e={};return d(b,function(a,d){e[d]=e[d]||0,e[d]++,c[d]>1&&(b[a]=d+" "+e[d])}),b},getOption:function(a){try{throw"getOption is deprecated"}catch(b){window.console.error(b)}return this.options[a]},showValidationErrors:function(a){}}),f.defaults.editors["null"]=f.AbstractEditor.extend({getValue:function(){return null},setValue:function(){this.onChange()},getNumColumns:function(){return 2}}),f.defaults.editors.string=f.AbstractEditor.extend({register:function(){this._super(),this.input&&this.input.setAttribute("name",this.formname)},unregister:function(){this._super(),this.input&&this.input.removeAttribute("name")},setValue:function(a,b,c){if((!this.template||c)&&(null===a||"undefined"==typeof a?a="":"object"==typeof a?a=JSON.stringify(a):"string"!=typeof a&&(a=""+a),a!==this.serialized)){var d=this.sanitize(a);if(this.input.value!==d){this.input.value=d,this.sceditor_instance?this.sceditor_instance.val(d):this.epiceditor?this.epiceditor.importFile(null,d):this.ace_editor&&this.ace_editor.setValue(d);var e=c||this.getValue()!==a;this.refreshValue(),b?this.is_dirty=!1:"change"===this.jsoneditor.options.show_errors&&(this.is_dirty=!0),this.adjust_height&&this.adjust_height(this.input),this.onChange(e)}}},getNumColumns:function(){var a,b=Math.ceil(Math.max(this.getTitle().length,this.schema.maxLength||0,this.schema.minLength||0)/5);return a="textarea"===this.input_type?6:["text","email"].indexOf(this.input_type)>=0?4:2,Math.min(12,Math.max(b,a))},build:function(){var a=this;if(this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.schema.description)),this.format=this.schema.format,!this.format&&this.schema.media&&this.schema.media.type&&(this.format=this.schema.media.type.replace(/(^(application|text)\/(x-)?(script\.)?)|(-source$)/g,"")),!this.format&&this.options.default_format&&(this.format=this.options.default_format),this.options.format&&(this.format=this.options.format),this.format)if("textarea"===this.format)this.input_type="textarea",this.input=this.theme.getTextareaInput();else if("range"===this.format){this.input_type="range";var b=this.schema.minimum||0,c=this.schema.maximum||Math.max(100,b+1),d=1;this.schema.multipleOf&&(b%this.schema.multipleOf&&(b=Math.ceil(b/this.schema.multipleOf)*this.schema.multipleOf),c%this.schema.multipleOf&&(c=Math.floor(c/this.schema.multipleOf)*this.schema.multipleOf),d=this.schema.multipleOf),this.input=this.theme.getRangeInput(b,c,d)}else["actionscript","batchfile","bbcode","c","c++","cpp","coffee","csharp","css","dart","django","ejs","erlang","golang","handlebars","haskell","haxe","html","ini","jade","java","javascript","json","less","lisp","lua","makefile","markdown","matlab","mysql","objectivec","pascal","perl","pgsql","php","python","r","ruby","sass","scala","scss","smarty","sql","stylus","svg","twig","vbscript","xml","yaml"].indexOf(this.format)>=0?(this.input_type=this.format,this.source_code=!0,this.input=this.theme.getTextareaInput()):(this.input_type=this.format,this.input=this.theme.getFormInputField(this.input_type));else this.input_type="text",this.input=this.theme.getFormInputField(this.input_type);"undefined"!=typeof this.schema.maxLength&&this.input.setAttribute("maxlength",this.schema.maxLength),"undefined"!=typeof this.schema.pattern?this.input.setAttribute("pattern",this.schema.pattern):"undefined"!=typeof this.schema.minLength&&this.input.setAttribute("pattern",".{"+this.schema.minLength+",}"),this.options.compact?this.container.className+=" compact":this.options.input_width&&(this.input.style.width=this.options.input_width),(this.schema.readOnly||this.schema.readonly||this.schema.template)&&(this.always_disabled=!0,this.input.disabled=!0),this.input.addEventListener("change",function(b){if(b.preventDefault(),b.stopPropagation(),a.schema.template)return void(this.value=a.value);var c=this.value,d=a.sanitize(c);c!==d&&(this.value=d),a.is_dirty=!0,a.refreshValue(),a.onChange(!0)}),this.options.input_height&&(this.input.style.height=this.options.input_height),this.options.expand_height&&(this.adjust_height=function(a){if(a){var b,c=a.offsetHeight;if(a.offsetHeight<a.scrollHeight)for(b=0;a.offsetHeight<a.scrollHeight+3&&!(b>100);)b++,c++,a.style.height=c+"px";else{for(b=0;a.offsetHeight>=a.scrollHeight+3&&!(b>100);)b++,c--,a.style.height=c+"px";a.style.height=c+1+"px"}}},this.input.addEventListener("keyup",function(b){a.adjust_height(this)}),this.input.addEventListener("change",function(b){a.adjust_height(this)}),this.adjust_height()),this.format&&this.input.setAttribute("data-schemaformat",this.format),this.control=this.theme.getFormControl(this.label,this.input,this.description),this.container.appendChild(this.control),window.requestAnimationFrame(function(){a.input.parentNode&&a.afterInputReady(),a.adjust_height&&a.adjust_height(a.input)}),this.schema.template?(this.template=this.jsoneditor.compileTemplate(this.schema.template,this.template_engine),this.refreshValue()):this.refreshValue()},enable:function(){this.always_disabled||(this.input.disabled=!1),this._super()},disable:function(){this.input.disabled=!0,this._super()},afterInputReady:function(){var a,b=this;if(this.source_code)if(this.options.wysiwyg&&["html","bbcode"].indexOf(this.input_type)>=0&&window.jQuery&&window.jQuery.fn&&window.jQuery.fn.sceditor)a=c({},{plugins:"html"===b.input_type?"xhtml":"bbcode",emoticonsEnabled:!1,width:"100%",height:300},f.plugins.sceditor,b.options.sceditor_options||{}),window.jQuery(b.input).sceditor(a),b.sceditor_instance=window.jQuery(b.input).sceditor("instance"),b.sceditor_instance.blur(function(){var a=window.jQuery("<div>"+b.sceditor_instance.val()+"</div>");window.jQuery("#sceditor-start-marker,#sceditor-end-marker,.sceditor-nlf",a).remove(),b.input.value=a.html(),b.value=b.input.value,b.is_dirty=!0,b.onChange(!0)});else if("markdown"===this.input_type&&window.EpicEditor)this.epiceditor_container=document.createElement("div"),this.input.parentNode.insertBefore(this.epiceditor_container,this.input),this.input.style.display="none",a=c({},f.plugins.epiceditor,{container:this.epiceditor_container,clientSideStorage:!1}),this.epiceditor=new window.EpicEditor(a).load(),this.epiceditor.importFile(null,this.getValue()),this.epiceditor.on("update",function(){var a=b.epiceditor.exportFile();b.input.value=a,b.value=a,b.is_dirty=!0,b.onChange(!0);
+});else if(window.ace){var d=this.input_type;("cpp"===d||"c++"===d||"c"===d)&&(d="c_cpp"),this.ace_container=document.createElement("div"),this.ace_container.style.width="100%",this.ace_container.style.position="relative",this.ace_container.style.height="400px",this.input.parentNode.insertBefore(this.ace_container,this.input),this.input.style.display="none",this.ace_editor=window.ace.edit(this.ace_container),this.ace_editor.setValue(this.getValue()),f.plugins.ace.theme&&this.ace_editor.setTheme("ace/theme/"+f.plugins.ace.theme),d=window.ace.require("ace/mode/"+d),d&&this.ace_editor.getSession().setMode(new d.Mode),this.ace_editor.on("change",function(){var a=b.ace_editor.getValue();b.input.value=a,b.refreshValue(),b.is_dirty=!0,b.onChange(!0)})}b.theme.afterInputReady(b.input)},refreshValue:function(){this.value=this.input.value,"string"!=typeof this.value&&(this.value=""),this.serialized=this.value},destroy:function(){this.sceditor_instance?this.sceditor_instance.destroy():this.epiceditor?this.epiceditor.unload():this.ace_editor&&this.ace_editor.destroy(),this.template=null,this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this._super()},sanitize:function(a){return a},onWatchedFieldChange:function(){var a;this.template&&(a=this.getWatchedFieldValues(),this.setValue(this.template(a),!1,!0)),this._super()},showValidationErrors:function(a){var b=this;if("always"===this.jsoneditor.options.show_errors);else if(!this.is_dirty&&this.previous_error_setting===this.jsoneditor.options.show_errors)return;this.previous_error_setting=this.jsoneditor.options.show_errors;var c=[];d(a,function(a,d){d.path===b.path&&c.push(d.message)}),c.length?this.theme.addInputError(this.input,c.join(". ")+"."):this.theme.removeInputError(this.input)}}),f.defaults.editors.number=f.defaults.editors.string.extend({sanitize:function(a){return(a+"").replace(/[^0-9\.\-eE]/g,"")},getNumColumns:function(){return 2},getValue:function(){return 1*this.value}}),f.defaults.editors.integer=f.defaults.editors.number.extend({sanitize:function(a){return a+="",a.replace(/[^0-9\-]/g,"")},getNumColumns:function(){return 2}}),f.defaults.editors.object=f.AbstractEditor.extend({getDefault:function(){return c({},this.schema["default"]||{})},getChildEditors:function(){return this.editors},register:function(){if(this._super(),this.editors)for(var a in this.editors)this.editors.hasOwnProperty(a)&&this.editors[a].register()},unregister:function(){if(this._super(),this.editors)for(var a in this.editors)this.editors.hasOwnProperty(a)&&this.editors[a].unregister()},getNumColumns:function(){return Math.max(Math.min(12,this.maxwidth),3)},enable:function(){if(this.editjson_button&&(this.editjson_button.disabled=!1),this.addproperty_button&&(this.addproperty_button.disabled=!1),this._super(),this.editors)for(var a in this.editors)this.editors.hasOwnProperty(a)&&this.editors[a].enable()},disable:function(){if(this.editjson_button&&(this.editjson_button.disabled=!0),this.addproperty_button&&(this.addproperty_button.disabled=!0),this.hideEditJSON(),this._super(),this.editors)for(var a in this.editors)this.editors.hasOwnProperty(a)&&this.editors[a].disable()},layoutEditors:function(){var a,b,c=this;if(this.row_container){this.property_order=Object.keys(this.editors),this.property_order=this.property_order.sort(function(a,b){var d=c.editors[a].schema.propertyOrder,e=c.editors[b].schema.propertyOrder;return"number"!=typeof d&&(d=1e3),"number"!=typeof e&&(e=1e3),d-e});var e;if("grid"===this.format){var f=[];for(d(this.property_order,function(a,b){var d=c.editors[b];if(!d.property_removed){for(var e=!1,g=d.options.hidden?0:d.options.grid_columns||d.getNumColumns(),h=d.options.hidden?0:d.container.offsetHeight,i=0;i<f.length;i++)f[i].width+g<=12&&(!h||.5*f[i].minh<h&&2*f[i].maxh>h)&&(e=i);e===!1&&(f.push({width:0,minh:999999,maxh:0,editors:[]}),e=f.length-1),f[e].editors.push({key:b,width:g,height:h}),f[e].width+=g,f[e].minh=Math.min(f[e].minh,h),f[e].maxh=Math.max(f[e].maxh,h)}}),a=0;a<f.length;a++)if(f[a].width<12){var g=!1,h=0;for(b=0;b<f[a].editors.length;b++)g===!1?g=b:f[a].editors[b].width>f[a].editors[g].width&&(g=b),f[a].editors[b].width*=12/f[a].width,f[a].editors[b].width=Math.floor(f[a].editors[b].width),h+=f[a].editors[b].width;12>h&&(f[a].editors[g].width+=12-h),f[a].width=12}if(this.layout===JSON.stringify(f))return!1;for(this.layout=JSON.stringify(f),e=document.createElement("div"),a=0;a<f.length;a++){var i=this.theme.getGridRow();for(e.appendChild(i),b=0;b<f[a].editors.length;b++){var j=f[a].editors[b].key,k=this.editors[j];k.options.hidden?k.container.style.display="none":this.theme.setGridColumnSize(k.container,f[a].editors[b].width),i.appendChild(k.container)}}}else e=document.createElement("div"),d(this.property_order,function(a,b){var d=c.editors[b];if(!d.property_removed){var f=c.theme.getGridRow();e.appendChild(f),d.options.hidden?d.container.style.display="none":c.theme.setGridColumnSize(d.container,12),f.appendChild(d.container)}});this.row_container.innerHTML="",this.row_container.appendChild(e)}},getPropertySchema:function(a){var b=this.schema.properties[a]||{};b=c({},b);var d=this.schema.properties[a]?!0:!1;if(this.schema.patternProperties)for(var e in this.schema.patternProperties)if(this.schema.patternProperties.hasOwnProperty(e)){var f=new RegExp(e);f.test(a)&&(b.allOf=b.allOf||[],b.allOf.push(this.schema.patternProperties[e]),d=!0)}return!d&&this.schema.additionalProperties&&"object"==typeof this.schema.additionalProperties&&(b=c({},this.schema.additionalProperties)),b},preBuild:function(){this._super(),this.editors={},this.cached_editors={};var a=this;if(this.format=this.options.layout||this.options.object_layout||this.schema.format||this.jsoneditor.options.object_layout||"normal",this.schema.properties=this.schema.properties||{},this.minwidth=0,this.maxwidth=0,this.options.table_row)d(this.schema.properties,function(b,c){var d=a.jsoneditor.getEditorClass(c);a.editors[b]=a.jsoneditor.createEditor(d,{jsoneditor:a.jsoneditor,schema:c,path:a.path+"."+b,parent:a,compact:!0,required:!0}),a.editors[b].preBuild();var e=a.editors[b].options.hidden?0:a.editors[b].options.grid_columns||a.editors[b].getNumColumns();a.minwidth+=e,a.maxwidth+=e}),this.no_link_holder=!0;else{if(this.options.table)throw"Not supported yet";this.defaultProperties=this.schema.defaultProperties||Object.keys(this.schema.properties),a.maxwidth+=1,d(this.defaultProperties,function(b,c){a.addObjectProperty(c,!0),a.editors[c]&&(a.minwidth=Math.max(a.minwidth,a.editors[c].options.grid_columns||a.editors[c].getNumColumns()),a.maxwidth+=a.editors[c].options.grid_columns||a.editors[c].getNumColumns())})}this.property_order=Object.keys(this.editors),this.property_order=this.property_order.sort(function(b,c){var d=a.editors[b].schema.propertyOrder,e=a.editors[c].schema.propertyOrder;return"number"!=typeof d&&(d=1e3),"number"!=typeof e&&(e=1e3),d-e})},build:function(){var a=this;if(this.options.table_row)this.editor_holder=this.container,d(this.editors,function(b,c){var d=a.theme.getTableCell();a.editor_holder.appendChild(d),c.setContainer(d),c.build(),c.postBuild(),a.editors[b].options.hidden&&(d.style.display="none"),a.editors[b].options.input_width&&(d.style.width=a.editors[b].options.input_width)});else{if(this.options.table)throw"Not supported yet";this.header=document.createElement("span"),this.header.textContent=this.getTitle(),this.title=this.theme.getHeader(this.header),this.container.appendChild(this.title),this.container.style.position="relative",this.editjson_holder=this.theme.getModal(),this.editjson_textarea=this.theme.getTextareaInput(),this.editjson_textarea.style.height="170px",this.editjson_textarea.style.width="300px",this.editjson_textarea.style.display="block",this.editjson_save=this.getButton("Save","save","Save"),this.editjson_save.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.saveJSON()}),this.editjson_cancel=this.getButton("Cancel","cancel","Cancel"),this.editjson_cancel.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.hideEditJSON()}),this.editjson_holder.appendChild(this.editjson_textarea),this.editjson_holder.appendChild(this.editjson_save),this.editjson_holder.appendChild(this.editjson_cancel),this.addproperty_holder=this.theme.getModal(),this.addproperty_list=document.createElement("div"),this.addproperty_list.style.width="295px",this.addproperty_list.style.maxHeight="160px",this.addproperty_list.style.padding="5px 0",this.addproperty_list.style.overflowY="auto",this.addproperty_list.style.overflowX="hidden",this.addproperty_list.style.paddingLeft="5px",this.addproperty_list.setAttribute("class","property-selector"),this.addproperty_add=this.getButton("add","add","add"),this.addproperty_input=this.theme.getFormInputField("text"),this.addproperty_input.setAttribute("placeholder","Property name..."),this.addproperty_input.style.width="220px",this.addproperty_input.style.marginBottom="0",this.addproperty_input.style.display="inline-block",this.addproperty_add.addEventListener("click",function(b){if(b.preventDefault(),b.stopPropagation(),a.addproperty_input.value){if(a.editors[a.addproperty_input.value])return void window.alert("there is already a property with that name");a.addObjectProperty(a.addproperty_input.value),a.editors[a.addproperty_input.value]&&a.editors[a.addproperty_input.value].disable(),a.onChange(!0)}}),this.addproperty_holder.appendChild(this.addproperty_list),this.addproperty_holder.appendChild(this.addproperty_input),this.addproperty_holder.appendChild(this.addproperty_add);var b=document.createElement("div");b.style.clear="both",this.addproperty_holder.appendChild(b),this.schema.description&&(this.description=this.theme.getDescription(this.schema.description),this.container.appendChild(this.description)),this.error_holder=document.createElement("div"),this.container.appendChild(this.error_holder),this.editor_holder=this.theme.getIndentedPanel(),this.editor_holder.style.paddingBottom="0",this.container.appendChild(this.editor_holder),this.row_container=this.theme.getGridContainer(),this.editor_holder.appendChild(this.row_container),d(this.editors,function(b,c){var d=a.theme.getGridColumn();a.row_container.appendChild(d),c.setContainer(d),c.build(),c.postBuild()}),this.title_controls=this.theme.getHeaderButtonHolder(),this.editjson_controls=this.theme.getHeaderButtonHolder(),this.addproperty_controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.title_controls),this.title.appendChild(this.editjson_controls),this.title.appendChild(this.addproperty_controls),this.collapsed=!1,this.toggle_button=this.getButton("","collapse","Collapse"),this.title_controls.appendChild(this.toggle_button),this.toggle_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.collapsed?(a.editor_holder.style.display="",a.collapsed=!1,a.setButtonText(a.toggle_button,"","collapse","Collapse")):(a.editor_holder.style.display="none",a.collapsed=!0,a.setButtonText(a.toggle_button,"","expand","Expand"))}),this.options.collapsed&&e(this.toggle_button,"click"),this.schema.options&&"undefined"!=typeof this.schema.options.disable_collapse?this.schema.options.disable_collapse&&(this.toggle_button.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.toggle_button.style.display="none"),this.editjson_button=this.getButton("JSON","edit","Edit JSON"),this.editjson_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.toggleEditJSON()}),this.editjson_controls.appendChild(this.editjson_button),this.editjson_controls.appendChild(this.editjson_holder),this.schema.options&&"undefined"!=typeof this.schema.options.disable_edit_json?this.schema.options.disable_edit_json&&(this.editjson_button.style.display="none"):this.jsoneditor.options.disable_edit_json&&(this.editjson_button.style.display="none"),this.addproperty_button=this.getButton("Properties","edit","Object Properties"),this.addproperty_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.toggleAddProperty()}),this.addproperty_controls.appendChild(this.addproperty_button),this.addproperty_controls.appendChild(this.addproperty_holder),this.refreshAddProperties()}this.options.table_row?(this.editor_holder=this.container,d(this.property_order,function(b,c){a.editor_holder.appendChild(a.editors[c].container)})):(this.layoutEditors(),this.layoutEditors())},showEditJSON:function(){this.editjson_holder&&(this.hideAddProperty(),this.editjson_holder.style.left=this.editjson_button.offsetLeft+"px",this.editjson_holder.style.top=this.editjson_button.offsetTop+this.editjson_button.offsetHeight+"px",this.editjson_textarea.value=JSON.stringify(this.getValue(),null,2),this.disable(),this.editjson_holder.style.display="",this.editjson_button.disabled=!1,this.editing_json=!0)},hideEditJSON:function(){this.editjson_holder&&this.editing_json&&(this.editjson_holder.style.display="none",this.enable(),this.editing_json=!1)},saveJSON:function(){if(this.editjson_holder)try{var a=JSON.parse(this.editjson_textarea.value);this.setValue(a),this.hideEditJSON()}catch(b){throw window.alert("invalid JSON"),b}},toggleEditJSON:function(){this.editing_json?this.hideEditJSON():this.showEditJSON()},insertPropertyControlUsingPropertyOrder:function(a,b,c){var d;this.schema.properties[a]&&(d=this.schema.properties[a].propertyOrder),"number"!=typeof d&&(d=1e3),b.propertyOrder=d;for(var e=0;e<c.childNodes.length;e++){var f=c.childNodes[e];if(b.propertyOrder<f.propertyOrder){this.addproperty_list.insertBefore(b,f),b=null;break}}b&&this.addproperty_list.appendChild(b)},addPropertyCheckbox:function(a){var b,c,d,e,f=this;return b=f.theme.getCheckbox(),b.style.width="auto",d=this.schema.properties[a]&&this.schema.properties[a].title?this.schema.properties[a].title:a,c=f.theme.getCheckboxLabel(d),e=f.theme.getFormControl(c,b),e.style.paddingBottom=e.style.marginBottom=e.style.paddingTop=e.style.marginTop=0,e.style.height="auto",this.insertPropertyControlUsingPropertyOrder(a,e,this.addproperty_list),b.checked=a in this.editors,b.addEventListener("change",function(){b.checked?f.addObjectProperty(a):f.removeObjectProperty(a),f.onChange(!0)}),f.addproperty_checkboxes[a]=b,b},showAddProperty:function(){this.addproperty_holder&&(this.hideEditJSON(),this.addproperty_holder.style.left=this.addproperty_button.offsetLeft+"px",this.addproperty_holder.style.top=this.addproperty_button.offsetTop+this.addproperty_button.offsetHeight+"px",this.disable(),this.adding_property=!0,this.addproperty_button.disabled=!1,this.addproperty_holder.style.display="",this.refreshAddProperties())},hideAddProperty:function(){this.addproperty_holder&&this.adding_property&&(this.addproperty_holder.style.display="none",this.enable(),this.adding_property=!1)},toggleAddProperty:function(){this.adding_property?this.hideAddProperty():this.showAddProperty()},removeObjectProperty:function(a){this.editors[a]&&(this.editors[a].unregister(),delete this.editors[a],this.refreshValue(),this.layoutEditors())},addObjectProperty:function(a,b){var c=this;if(!this.editors[a]){if(this.cached_editors[a]){if(this.editors[a]=this.cached_editors[a],b)return;this.editors[a].register()}else{if(!(this.canHaveAdditionalProperties()||this.schema.properties&&this.schema.properties[a]))return;var d=c.getPropertySchema(a),e=c.jsoneditor.getEditorClass(d);if(c.editors[a]=c.jsoneditor.createEditor(e,{jsoneditor:c.jsoneditor,schema:d,path:c.path+"."+a,parent:c}),c.editors[a].preBuild(),!b){var f=c.theme.getChildEditorHolder();c.editor_holder.appendChild(f),c.editors[a].setContainer(f),c.editors[a].build(),c.editors[a].postBuild()}c.cached_editors[a]=c.editors[a]}b||(c.refreshValue(),c.layoutEditors())}},onChildEditorChange:function(a){this.refreshValue(),this._super(a)},canHaveAdditionalProperties:function(){return"boolean"==typeof this.schema.additionalProperties?this.schema.additionalProperties:!this.jsoneditor.options.no_additional_properties},destroy:function(){d(this.cached_editors,function(a,b){b.destroy()}),this.editor_holder&&(this.editor_holder.innerHTML=""),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.error_holder&&this.error_holder.parentNode&&this.error_holder.parentNode.removeChild(this.error_holder),this.editors=null,this.cached_editors=null,this.editor_holder&&this.editor_holder.parentNode&&this.editor_holder.parentNode.removeChild(this.editor_holder),this.editor_holder=null,this._super()},getValue:function(){var a=this._super();if(this.jsoneditor.options.remove_empty_properties||this.options.remove_empty_properties)for(var b in a)a.hasOwnProperty(b)&&(a[b]||delete a[b]);return a},refreshValue:function(){this.value={};for(var a in this.editors)this.editors.hasOwnProperty(a)&&(this.value[a]=this.editors[a].getValue());this.adding_property&&this.refreshAddProperties()},refreshAddProperties:function(){if(this.options.disable_properties||this.options.disable_properties!==!1&&this.jsoneditor.options.disable_properties)return void(this.addproperty_controls.style.display="none");var a,b=!1,c=!1,d=0,e=!1;for(a in this.editors)this.editors.hasOwnProperty(a)&&d++;b=this.canHaveAdditionalProperties()&&!("undefined"!=typeof this.schema.maxProperties&&d>=this.schema.maxProperties),this.addproperty_checkboxes&&(this.addproperty_list.innerHTML=""),this.addproperty_checkboxes={};for(a in this.cached_editors)this.cached_editors.hasOwnProperty(a)&&(this.addPropertyCheckbox(a),this.isRequired(this.cached_editors[a])&&a in this.editors&&(this.addproperty_checkboxes[a].disabled=!0),"undefined"!=typeof this.schema.minProperties&&d<=this.schema.minProperties?(this.addproperty_checkboxes[a].disabled=this.addproperty_checkboxes[a].checked,this.addproperty_checkboxes[a].checked||(e=!0)):a in this.editors?(e=!0,c=!0):b||this.schema.properties.hasOwnProperty(a)?(this.addproperty_checkboxes[a].disabled=!1,e=!0):this.addproperty_checkboxes[a].disabled=!0);this.canHaveAdditionalProperties()&&(e=!0);for(a in this.schema.properties)this.schema.properties.hasOwnProperty(a)&&(this.cached_editors[a]||(e=!0,this.addPropertyCheckbox(a)));e?this.canHaveAdditionalProperties()?b?this.addproperty_add.disabled=!1:this.addproperty_add.disabled=!0:(this.addproperty_add.style.display="none",this.addproperty_input.style.display="none"):(this.hideAddProperty(),this.addproperty_controls.style.display="none")},isRequired:function(a){return"boolean"==typeof a.schema.required?a.schema.required:Array.isArray(this.schema.required)?this.schema.required.indexOf(a.key)>-1:this.jsoneditor.options.required_by_default?!0:!1},setValue:function(a,b){var c=this;a=a||{},("object"!=typeof a||Array.isArray(a))&&(a={}),d(this.cached_editors,function(d,e){"undefined"!=typeof a[d]?(c.addObjectProperty(d),e.setValue(a[d],b)):b||c.isRequired(e)?e.setValue(e.getDefault(),b):c.removeObjectProperty(d)}),d(a,function(a,d){c.cached_editors[a]||(c.addObjectProperty(a),c.editors[a]&&c.editors[a].setValue(d,b))}),this.refreshValue(),this.layoutEditors(),this.onChange()},showValidationErrors:function(a){var b=this,c=[],e=[];if(d(a,function(a,d){d.path===b.path?c.push(d):e.push(d)}),this.error_holder)if(c.length){this.error_holder.innerHTML="",this.error_holder.style.display="",d(c,function(a,c){b.error_holder.appendChild(b.theme.getErrorMessage(c.message))})}else this.error_holder.style.display="none";this.options.table_row&&(c.length?this.theme.addTableRowError(this.container):this.theme.removeTableRowError(this.container)),d(this.editors,function(a,b){b.showValidationErrors(e)})}}),f.defaults.editors.array=f.AbstractEditor.extend({getDefault:function(){return this.schema["default"]||[]},register:function(){if(this._super(),this.rows)for(var a=0;a<this.rows.length;a++)this.rows[a].register()},unregister:function(){if(this._super(),this.rows)for(var a=0;a<this.rows.length;a++)this.rows[a].unregister()},getNumColumns:function(){var a=this.getItemInfo(0);return this.tabs_holder?Math.max(Math.min(12,a.width+2),4):a.width},enable:function(){if(this.add_row_button&&(this.add_row_button.disabled=!1),this.remove_all_rows_button&&(this.remove_all_rows_button.disabled=!1),this.delete_last_row_button&&(this.delete_last_row_button.disabled=!1),this.rows)for(var a=0;a<this.rows.length;a++)this.rows[a].enable(),this.rows[a].moveup_button&&(this.rows[a].moveup_button.disabled=!1),this.rows[a].movedown_button&&(this.rows[a].movedown_button.disabled=!1),this.rows[a].delete_button&&(this.rows[a].delete_button.disabled=!1);this._super()},disable:function(){if(this.add_row_button&&(this.add_row_button.disabled=!0),this.remove_all_rows_button&&(this.remove_all_rows_button.disabled=!0),this.delete_last_row_button&&(this.delete_last_row_button.disabled=!0),this.rows)for(var a=0;a<this.rows.length;a++)this.rows[a].disable(),this.rows[a].moveup_button&&(this.rows[a].moveup_button.disabled=!0),this.rows[a].movedown_button&&(this.rows[a].movedown_button.disabled=!0),this.rows[a].delete_button&&(this.rows[a].delete_button.disabled=!0);this._super()},preBuild:function(){this._super(),this.rows=[],this.row_cache=[],this.hide_delete_buttons=this.options.disable_array_delete||this.jsoneditor.options.disable_array_delete,this.hide_move_buttons=this.options.disable_array_reorder||this.jsoneditor.options.disable_array_reorder,this.hide_add_button=this.options.disable_array_add||this.jsoneditor.options.disable_array_add},build:function(){this.options.compact?(this.panel=this.theme.getIndentedPanel(),this.container.appendChild(this.panel),this.controls=this.theme.getButtonHolder(),this.panel.appendChild(this.controls),this.row_holder=document.createElement("div"),this.panel.appendChild(this.row_holder)):(this.header=document.createElement("span"),this.header.textContent=this.getTitle(),this.title=this.theme.getHeader(this.header,this.isRequired()),this.container.appendChild(this.title),this.title_controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.title_controls),this.schema.description&&(this.description=this.theme.getDescription(this.schema.description),this.container.appendChild(this.description)),this.error_holder=document.createElement("div"),this.container.appendChild(this.error_holder),"tabs"===this.schema.format?(this.controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.controls),this.tabs_holder=this.theme.getTabHolder(),this.container.appendChild(this.tabs_holder),this.row_holder=this.theme.getTabContentHolder(this.tabs_holder),this.active_tab=null):(this.panel=this.theme.getIndentedPanel(),this.container.appendChild(this.panel),this.row_holder=document.createElement("div"),this.panel.appendChild(this.row_holder),this.controls=this.theme.getButtonHolder(),this.panel.appendChild(this.controls))),this.addControls()},onChildEditorChange:function(a){this.refreshValue(),this.refreshTabs(!0),this._super(a)},getItemTitle:function(){if(!this.item_title)if(this.schema.items&&!Array.isArray(this.schema.items)){var a=this.jsoneditor.expandRefs(this.schema.items);this.item_title=a.title||"item"}else this.item_title="item";return this.item_title},getItemSchema:function(a){return Array.isArray(this.schema.items)?a>=this.schema.items.length?this.schema.additionalItems===!0?{}:this.schema.additionalItems?c({},this.schema.additionalItems):void 0:c({},this.schema.items[a]):this.schema.items?c({},this.schema.items):{}},getItemInfo:function(a){var b=this.getItemSchema(a);this.item_info=this.item_info||{};var c=JSON.stringify(b);return"undefined"!=typeof this.item_info[c]?this.item_info[c]:(b=this.jsoneditor.expandRefs(b),this.item_info[c]={title:b.title||"item","default":b["default"],width:12,child_editors:b.properties||b.items},this.item_info[c])},getElementEditor:function(a){var b=this.getItemInfo(a),c=this.getItemSchema(a);c=this.jsoneditor.expandRefs(c),c.title=b.title+" "+(a+1);var d,e=this.jsoneditor.getEditorClass(c);d=this.tabs_holder?this.theme.getTabContent():b.child_editors?this.theme.getChildEditorHolder():this.theme.getIndentedPanel(),this.row_holder.appendChild(d);var f=this.jsoneditor.createEditor(e,{jsoneditor:this.jsoneditor,schema:c,container:d,path:this.path+"."+a,parent:this,required:!0});return f.preBuild(),f.build(),f.postBuild(),f.title_controls||(f.array_controls=this.theme.getButtonHolder(),d.appendChild(f.array_controls)),f},destroy:function(){this.empty(!0),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.row_holder&&this.row_holder.parentNode&&this.row_holder.parentNode.removeChild(this.row_holder),this.controls&&this.controls.parentNode&&this.controls.parentNode.removeChild(this.controls),this.panel&&this.panel.parentNode&&this.panel.parentNode.removeChild(this.panel),this.rows=this.row_cache=this.title=this.description=this.row_holder=this.panel=this.controls=null,this._super()},empty:function(a){if(this.rows){var b=this;d(this.rows,function(c,d){a&&(d.tab&&d.tab.parentNode&&d.tab.parentNode.removeChild(d.tab),b.destroyRow(d,!0),b.row_cache[c]=null),b.rows[c]=null}),b.rows=[],a&&(b.row_cache=[])}},destroyRow:function(a,b){var c=a.container;b?(a.destroy(),c.parentNode&&c.parentNode.removeChild(c),a.tab&&a.tab.parentNode&&a.tab.parentNode.removeChild(a.tab)):(a.tab&&(a.tab.style.display="none"),c.style.display="none",a.unregister())},getMax:function(){return Array.isArray(this.schema.items)&&this.schema.additionalItems===!1?Math.min(this.schema.items.length,this.schema.maxItems||1/0):this.schema.maxItems||1/0},refreshTabs:function(a){var b=this;d(this.rows,function(c,d){d.tab&&(a?d.tab_text.textContent=d.getHeaderText():d.tab===b.active_tab?(b.theme.markTabActive(d.tab),d.container.style.display=""):(b.theme.markTabInactive(d.tab),d.container.style.display="none"))})},setValue:function(a,b){a=a||[],Array.isArray(a)||(a=[a]);var c=JSON.stringify(a);if(c!==this.serialized){if(this.schema.minItems)for(;a.length<this.schema.minItems;)a.push(this.getItemInfo(a.length)["default"]);this.getMax()&&a.length>this.getMax()&&(a=a.slice(0,this.getMax()));var e=this;d(a,function(a,c){e.rows[a]?e.rows[a].setValue(c,b):e.row_cache[a]?(e.rows[a]=e.row_cache[a],e.rows[a].setValue(c,b),e.rows[a].container.style.display="",e.rows[a].tab&&(e.rows[a].tab.style.display=""),e.rows[a].register()):e.addRow(c,b)});for(var f=a.length;f<e.rows.length;f++)e.destroyRow(e.rows[f]),e.rows[f]=null;e.rows=e.rows.slice(0,a.length);var g=null;d(e.rows,function(a,b){return b.tab===e.active_tab?(g=b.tab,!1):void 0}),!g&&e.rows.length&&(g=e.rows[0].tab),e.active_tab=g,e.refreshValue(b),e.refreshTabs(!0),e.refreshTabs(),e.onChange()}},refreshValue:function(a){var b=this,c=this.value?this.value.length:0;if(this.value=[],d(this.rows,function(a,c){b.value[a]=c.getValue()}),c!==this.value.length||a){var e=this.schema.minItems&&this.schema.minItems>=this.rows.length;d(this.rows,function(a,c){c.movedown_button&&(a===b.rows.length-1?c.movedown_button.style.display="none":c.movedown_button.style.display=""),c.delete_button&&(e?c.delete_button.style.display="none":c.delete_button.style.display=""),b.value[a]=c.getValue()});var f=!1;this.value.length?1===this.value.length?(this.remove_all_rows_button.style.display="none",e||this.hide_delete_buttons?this.delete_last_row_button.style.display="none":(this.delete_last_row_button.style.display="",f=!0)):e||this.hide_delete_buttons?(this.delete_last_row_button.style.display="none",this.remove_all_rows_button.style.display="none"):(this.delete_last_row_button.style.display="",this.remove_all_rows_button.style.display="",f=!0):(this.delete_last_row_button.style.display="none",this.remove_all_rows_button.style.display="none"),this.getMax()&&this.getMax()<=this.rows.length||this.hide_add_button?this.add_row_button.style.display="none":(this.add_row_button.style.display="",f=!0),!this.collapsed&&f?this.controls.style.display="inline-block":this.controls.style.display="none"}},addRow:function(a,b){var c=this,e=this.rows.length;c.rows[e]=this.getElementEditor(e),c.row_cache[e]=c.rows[e],c.tabs_holder&&(c.rows[e].tab_text=document.createElement("span"),c.rows[e].tab_text.textContent=c.rows[e].getHeaderText(),c.rows[e].tab=c.theme.getTab(c.rows[e].tab_text),c.rows[e].tab.addEventListener("click",function(a){c.active_tab=c.rows[e].tab,c.refreshTabs(),a.preventDefault(),a.stopPropagation()}),c.theme.addTab(c.tabs_holder,c.rows[e].tab));var f=c.rows[e].title_controls||c.rows[e].array_controls;c.hide_delete_buttons||(c.rows[e].delete_button=this.getButton(c.getItemTitle(),"delete","Delete "+c.getItemTitle()),c.rows[e].delete_button.className+=" delete",c.rows[e].delete_button.setAttribute("data-i",e),c.rows[e].delete_button.addEventListener("click",function(a){a.preventDefault(),a.stopPropagation();var b=1*this.getAttribute("data-i"),e=c.getValue(),f=[],g=null;d(e,function(a,d){return a===b?void(c.rows[a].tab===c.active_tab&&(c.rows[a+1]?g=c.rows[a].tab:a&&(g=c.rows[a-1].tab))):void f.push(d)}),c.setValue(f),g&&(c.active_tab=g,c.refreshTabs()),c.onChange(!0)}),f&&f.appendChild(c.rows[e].delete_button)),e&&!c.hide_move_buttons&&(c.rows[e].moveup_button=this.getButton("","moveup","Move up"),c.rows[e].moveup_button.className+=" moveup",c.rows[e].moveup_button.setAttribute("data-i",e),c.rows[e].moveup_button.addEventListener("click",function(a){a.preventDefault(),a.stopPropagation();var b=1*this.getAttribute("data-i");if(!(0>=b)){var d=c.getValue(),e=d[b-1];d[b-1]=d[b],d[b]=e,c.setValue(d),c.active_tab=c.rows[b-1].tab,c.refreshTabs(),c.onChange(!0)}}),f&&f.appendChild(c.rows[e].moveup_button)),c.hide_move_buttons||(c.rows[e].movedown_button=this.getButton("","movedown","Move down"),c.rows[e].movedown_button.className+=" movedown",c.rows[e].movedown_button.setAttribute("data-i",e),c.rows[e].movedown_button.addEventListener("click",function(a){a.preventDefault(),a.stopPropagation();var b=1*this.getAttribute("data-i"),d=c.getValue();if(!(b>=d.length-1)){var e=d[b+1];d[b+1]=d[b],d[b]=e,c.setValue(d),c.active_tab=c.rows[b+1].tab,c.refreshTabs(),c.onChange(!0)}}),f&&f.appendChild(c.rows[e].movedown_button)),a&&c.rows[e].setValue(a,b),c.refreshTabs()},addControls:function(){var a=this;this.collapsed=!1,this.toggle_button=this.getButton("","collapse","Collapse"),this.title_controls.appendChild(this.toggle_button);var b=a.row_holder.style.display,c=a.controls.style.display;this.toggle_button.addEventListener("click",function(d){d.preventDefault(),d.stopPropagation(),a.collapsed?(a.collapsed=!1,a.panel&&(a.panel.style.display=""),a.row_holder.style.display=b,a.tabs_holder&&(a.tabs_holder.style.display=""),a.controls.style.display=c,a.setButtonText(this,"","collapse","Collapse")):(a.collapsed=!0,a.row_holder.style.display="none",a.tabs_holder&&(a.tabs_holder.style.display="none"),a.controls.style.display="none",a.panel&&(a.panel.style.display="none"),a.setButtonText(this,"","expand","Expand"))}),this.options.collapsed&&e(this.toggle_button,"click"),this.schema.options&&"undefined"!=typeof this.schema.options.disable_collapse?this.schema.options.disable_collapse&&(this.toggle_button.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.toggle_button.style.display="none"),this.add_row_button=this.getButton(this.getItemTitle(),"add","Add "+this.getItemTitle()),this.add_row_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation();var c=a.rows.length;a.row_cache[c]?(a.rows[c]=a.row_cache[c],a.rows[c].setValue(a.rows[c].getDefault()),a.rows[c].container.style.display="",a.rows[c].tab&&(a.rows[c].tab.style.display=""),a.rows[c].register()):a.addRow(),a.active_tab=a.rows[c].tab,a.refreshTabs(),a.refreshValue(),a.onChange(!0)}),a.controls.appendChild(this.add_row_button),this.delete_last_row_button=this.getButton("Last "+this.getItemTitle(),"delete","Delete Last "+this.getItemTitle()),
+this.delete_last_row_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation();var c=a.getValue(),d=null;a.rows.length>1&&a.rows[a.rows.length-1].tab===a.active_tab&&(d=a.rows[a.rows.length-2].tab),c.pop(),a.setValue(c),d&&(a.active_tab=d,a.refreshTabs()),a.onChange(!0)}),a.controls.appendChild(this.delete_last_row_button),this.remove_all_rows_button=this.getButton("All","delete","Delete All"),this.remove_all_rows_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.setValue([]),a.onChange(!0)}),a.controls.appendChild(this.remove_all_rows_button),a.tabs&&(this.add_row_button.style.width="100%",this.add_row_button.style.textAlign="left",this.add_row_button.style.marginBottom="3px",this.delete_last_row_button.style.width="100%",this.delete_last_row_button.style.textAlign="left",this.delete_last_row_button.style.marginBottom="3px",this.remove_all_rows_button.style.width="100%",this.remove_all_rows_button.style.textAlign="left",this.remove_all_rows_button.style.marginBottom="3px")},showValidationErrors:function(a){var b=this,c=[],e=[];if(d(a,function(a,d){d.path===b.path?c.push(d):e.push(d)}),this.error_holder)if(c.length){this.error_holder.innerHTML="",this.error_holder.style.display="",d(c,function(a,c){b.error_holder.appendChild(b.theme.getErrorMessage(c.message))})}else this.error_holder.style.display="none";d(this.rows,function(a,b){b.showValidationErrors(e)})}}),f.defaults.editors.table=f.defaults.editors.array.extend({register:function(){if(this._super(),this.rows)for(var a=0;a<this.rows.length;a++)this.rows[a].register()},unregister:function(){if(this._super(),this.rows)for(var a=0;a<this.rows.length;a++)this.rows[a].unregister()},getNumColumns:function(){return Math.max(Math.min(12,this.width),3)},preBuild:function(){var a=this.jsoneditor.expandRefs(this.schema.items||{});this.item_title=a.title||"row",this.item_default=a["default"]||null,this.item_has_child_editors=a.properties||a.items,this.width=12,this._super()},build:function(){var a=this;this.table=this.theme.getTable(),this.container.appendChild(this.table),this.thead=this.theme.getTableHead(),this.table.appendChild(this.thead),this.header_row=this.theme.getTableRow(),this.thead.appendChild(this.header_row),this.row_holder=this.theme.getTableBody(),this.table.appendChild(this.row_holder);var b=this.getElementEditor(0,!0);if(this.item_default=b.getDefault(),this.width=b.getNumColumns()+2,this.options.compact?(this.panel=document.createElement("div"),this.container.appendChild(this.panel)):(this.title=this.theme.getHeader(this.getTitle(),this.isRequired()),this.container.appendChild(this.title),this.title_controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.title_controls),this.schema.description&&(this.description=this.theme.getDescription(this.schema.description),this.container.appendChild(this.description)),this.panel=this.theme.getIndentedPanel(),this.container.appendChild(this.panel),this.error_holder=document.createElement("div"),this.panel.appendChild(this.error_holder)),this.panel.appendChild(this.table),this.controls=this.theme.getButtonHolder(),this.panel.appendChild(this.controls),this.item_has_child_editors)for(var c=b.getChildEditors(),d=b.property_order||Object.keys(c),e=0;e<d.length;e++){var f=a.theme.getTableHeaderCell(c[d[e]].getTitle());c[d[e]].options.hidden&&(f.style.display="none"),a.header_row.appendChild(f)}else a.header_row.appendChild(a.theme.getTableHeaderCell(this.item_title));b.destroy(),this.row_holder.innerHTML="",this.controls_header_cell=a.theme.getTableHeaderCell(" "),a.header_row.appendChild(this.controls_header_cell),this.addControls()},onChildEditorChange:function(a){this.refreshValue(),this._super()},getItemDefault:function(){return c({},{"default":this.item_default})["default"]},getItemTitle:function(){return this.item_title},getElementEditor:function(a,b){var d=c({},this.schema.items),e=this.jsoneditor.getEditorClass(d,this.jsoneditor),f=this.row_holder.appendChild(this.theme.getTableRow()),g=f;this.item_has_child_editors||(g=this.theme.getTableCell(),f.appendChild(g));var h=this.jsoneditor.createEditor(e,{jsoneditor:this.jsoneditor,schema:d,container:g,path:this.path+"."+a,parent:this,compact:!0,table_row:!0});return h.preBuild(),b||(h.build(),h.postBuild(),h.controls_cell=f.appendChild(this.theme.getTableCell()),h.row=f,h.table_controls=this.theme.getButtonHolder(),h.controls_cell.appendChild(h.table_controls),h.table_controls.style.margin=0,h.table_controls.style.padding=0),h},destroy:function(){this.innerHTML="",this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.row_holder&&this.row_holder.parentNode&&this.row_holder.parentNode.removeChild(this.row_holder),this.table&&this.table.parentNode&&this.table.parentNode.removeChild(this.table),this.panel&&this.panel.parentNode&&this.panel.parentNode.removeChild(this.panel),this.rows=this.title=this.description=this.row_holder=this.table=this.panel=null,this._super()},setValue:function(a,b){if(a=a||[],this.schema.minItems)for(;a.length<this.schema.minItems;)a.push(this.getItemDefault());this.schema.maxItems&&a.length>this.schema.maxItems&&(a=a.slice(0,this.schema.maxItems));var c=JSON.stringify(a);if(c!==this.serialized){var e=!1,f=this;d(a,function(a,b){f.rows[a]?f.rows[a].setValue(b):(f.addRow(b),e=!0)});for(var g=a.length;g<f.rows.length;g++){var h=f.rows[g].container;f.item_has_child_editors||f.rows[g].row.parentNode.removeChild(f.rows[g].row),f.rows[g].destroy(),h.parentNode&&h.parentNode.removeChild(h),f.rows[g]=null,e=!0}f.rows=f.rows.slice(0,a.length),f.refreshValue(),(e||b)&&f.refreshRowButtons(),f.onChange()}},refreshRowButtons:function(){var a=this,b=this.schema.minItems&&this.schema.minItems>=this.rows.length,c=!1;d(this.rows,function(d,e){e.movedown_button&&(d===a.rows.length-1?e.movedown_button.style.display="none":(c=!0,e.movedown_button.style.display="")),e.delete_button&&(b?e.delete_button.style.display="none":(c=!0,e.delete_button.style.display="")),e.moveup_button&&(c=!0)}),d(this.rows,function(a,b){c?b.controls_cell.style.display="":b.controls_cell.style.display="none"}),c?this.controls_header_cell.style.display="":this.controls_header_cell.style.display="none";var e=!1;this.value.length?1===this.value.length||this.hide_delete_buttons?(this.table.style.display="",this.remove_all_rows_button.style.display="none",b||this.hide_delete_buttons?this.delete_last_row_button.style.display="none":(this.delete_last_row_button.style.display="",e=!0)):(this.table.style.display="",b||this.hide_delete_buttons?(this.delete_last_row_button.style.display="none",this.remove_all_rows_button.style.display="none"):(this.delete_last_row_button.style.display="",this.remove_all_rows_button.style.display="",e=!0)):(this.delete_last_row_button.style.display="none",this.remove_all_rows_button.style.display="none",this.table.style.display="none"),this.schema.maxItems&&this.schema.maxItems<=this.rows.length||this.hide_add_button?this.add_row_button.style.display="none":(this.add_row_button.style.display="",e=!0),e?this.controls.style.display="":this.controls.style.display="none"},refreshValue:function(){var a=this;this.value=[],d(this.rows,function(b,c){a.value[b]=c.getValue()}),this.serialized=JSON.stringify(this.value)},addRow:function(a){var b=this,c=this.rows.length;b.rows[c]=this.getElementEditor(c);var e=b.rows[c].table_controls;this.hide_delete_buttons||(b.rows[c].delete_button=this.getButton("","delete","Delete"),b.rows[c].delete_button.className+=" delete",b.rows[c].delete_button.setAttribute("data-i",c),b.rows[c].delete_button.addEventListener("click",function(a){a.preventDefault(),a.stopPropagation();var c=1*this.getAttribute("data-i"),e=b.getValue(),f=[];d(e,function(a,b){a!==c&&f.push(b)}),b.setValue(f),b.onChange(!0)}),e.appendChild(b.rows[c].delete_button)),c&&!this.hide_move_buttons&&(b.rows[c].moveup_button=this.getButton("","moveup","Move up"),b.rows[c].moveup_button.className+=" moveup",b.rows[c].moveup_button.setAttribute("data-i",c),b.rows[c].moveup_button.addEventListener("click",function(a){a.preventDefault(),a.stopPropagation();var c=1*this.getAttribute("data-i");if(!(0>=c)){var d=b.getValue(),e=d[c-1];d[c-1]=d[c],d[c]=e,b.setValue(d),b.onChange(!0)}}),e.appendChild(b.rows[c].moveup_button)),this.hide_move_buttons||(b.rows[c].movedown_button=this.getButton("","movedown","Move down"),b.rows[c].movedown_button.className+=" movedown",b.rows[c].movedown_button.setAttribute("data-i",c),b.rows[c].movedown_button.addEventListener("click",function(a){a.preventDefault(),a.stopPropagation();var c=1*this.getAttribute("data-i"),d=b.getValue();if(!(c>=d.length-1)){var e=d[c+1];d[c+1]=d[c],d[c]=e,b.setValue(d),b.onChange(!0)}}),e.appendChild(b.rows[c].movedown_button)),a&&b.rows[c].setValue(a)},addControls:function(){var a=this;this.collapsed=!1,this.toggle_button=this.getButton("","collapse","Collapse"),this.title_controls&&(this.title_controls.appendChild(this.toggle_button),this.toggle_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.collapsed?(a.collapsed=!1,a.panel.style.display="",a.setButtonText(this,"","collapse","Collapse")):(a.collapsed=!0,a.panel.style.display="none",a.setButtonText(this,"","expand","Expand"))}),this.options.collapsed&&e(this.toggle_button,"click"),this.schema.options&&"undefined"!=typeof this.schema.options.disable_collapse?this.schema.options.disable_collapse&&(this.toggle_button.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.toggle_button.style.display="none")),this.add_row_button=this.getButton(this.getItemTitle(),"add","Add "+this.getItemTitle()),this.add_row_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.addRow(),a.refreshValue(),a.refreshRowButtons(),a.onChange(!0)}),a.controls.appendChild(this.add_row_button),this.delete_last_row_button=this.getButton("Last "+this.getItemTitle(),"delete","Delete Last "+this.getItemTitle()),this.delete_last_row_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation();var c=a.getValue();c.pop(),a.setValue(c),a.onChange(!0)}),a.controls.appendChild(this.delete_last_row_button),this.remove_all_rows_button=this.getButton("All","delete","Delete All"),this.remove_all_rows_button.addEventListener("click",function(b){b.preventDefault(),b.stopPropagation(),a.setValue([]),a.onChange(!0)}),a.controls.appendChild(this.remove_all_rows_button)}}),f.defaults.editors.multiple=f.AbstractEditor.extend({register:function(){if(this.editors){for(var a=0;a<this.editors.length;a++)this.editors[a]&&this.editors[a].unregister();this.editors[this.type]&&this.editors[this.type].register()}this._super()},unregister:function(){if(this._super(),this.editors)for(var a=0;a<this.editors.length;a++)this.editors[a]&&this.editors[a].unregister()},getNumColumns:function(){return this.editors[this.type]?Math.max(this.editors[this.type].getNumColumns(),4):4},enable:function(){if(this.editors)for(var a=0;a<this.editors.length;a++)this.editors[a]&&this.editors[a].enable();this.switcher.disabled=!1,this._super()},disable:function(){if(this.editors)for(var a=0;a<this.editors.length;a++)this.editors[a]&&this.editors[a].disable();this.switcher.disabled=!0,this._super()},switchEditor:function(a){var b=this;this.editors[a]||this.buildChildEditor(a),b.type=a,b.register();var c=b.getValue();d(b.editors,function(a,d){d&&(b.type===a?(b.keep_values&&d.setValue(c,!0),d.container.style.display=""):d.container.style.display="none")}),b.refreshValue(),b.refreshHeaderText()},buildChildEditor:function(a){var b=this,d=this.types[a],e=b.theme.getChildEditorHolder();b.editor_holder.appendChild(e);var f;"string"==typeof d?(f=c({},b.schema),f.type=d):(f=c({},b.schema,d),f=b.jsoneditor.expandRefs(f),d.required&&Array.isArray(d.required)&&b.schema.required&&Array.isArray(b.schema.required)&&(f.required=b.schema.required.concat(d.required)));var g=b.jsoneditor.getEditorClass(f);b.editors[a]=b.jsoneditor.createEditor(g,{jsoneditor:b.jsoneditor,schema:f,container:e,path:b.path,parent:b,required:!0}),b.editors[a].preBuild(),b.editors[a].build(),b.editors[a].postBuild(),b.editors[a].header&&(b.editors[a].header.style.display="none"),b.editors[a].option=b.switcher_options[a],e.addEventListener("change_header_text",function(){b.refreshHeaderText()}),a!==b.type&&(e.style.display="none")},preBuild:function(){if(this.types=[],this.type=0,this.editors=[],this.validators=[],this.keep_values=!0,"undefined"!=typeof this.jsoneditor.options.keep_oneof_values&&(this.keep_values=this.jsoneditor.options.keep_oneof_values),"undefined"!=typeof this.options.keep_oneof_values&&(this.keep_values=this.options.keep_oneof_values),this.schema.oneOf)this.oneOf=!0,this.types=this.schema.oneOf,d(this.types,function(a,b){}),delete this.schema.oneOf;else{if(this.schema.type&&"any"!==this.schema.type)Array.isArray(this.schema.type)?this.types=this.schema.type:this.types=[this.schema.type];else if(this.types=["string","number","integer","boolean","object","array","null"],this.schema.disallow){var a=this.schema.disallow;"object"==typeof a&&Array.isArray(a)||(a=[a]);var b=[];d(this.types,function(c,d){-1===a.indexOf(d)&&b.push(d)}),this.types=b}delete this.schema.type}this.display_text=this.getDisplayText(this.types)},build:function(){var a=this,b=this.container;this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired()),this.container.appendChild(this.header),this.switcher=this.theme.getSwitcher(this.display_text),b.appendChild(this.switcher),this.switcher.addEventListener("change",function(b){b.preventDefault(),b.stopPropagation(),a.switchEditor(a.display_text.indexOf(this.value)),a.onChange(!0)}),this.editor_holder=document.createElement("div"),b.appendChild(this.editor_holder),this.switcher_options=this.theme.getSwitcherOptions(this.switcher),d(this.types,function(b,d){a.editors[b]=!1;var e;"string"==typeof d?(e=c({},a.schema),e.type=d):(e=c({},a.schema,d),d.required&&Array.isArray(d.required)&&a.schema.required&&Array.isArray(a.schema.required)&&(e.required=a.schema.required.concat(d.required))),a.validators[b]=new f.Validator(a.jsoneditor,e)}),this.switchEditor(0)},onChildEditorChange:function(a){this.editors[this.type]&&(this.refreshValue(),this.refreshHeaderText()),this._super()},refreshHeaderText:function(){var a=this.getDisplayText(this.types);d(this.switcher_options,function(b,c){c.textContent=a[b]})},refreshValue:function(){this.value=this.editors[this.type].getValue()},setValue:function(a,b){var c=this;d(this.validators,function(b,d){return d.validate(a).length?void 0:(c.type=b,c.switcher.value=c.display_text[b],!1)}),this.switchEditor(this.type),this.editors[this.type].setValue(a,b),this.refreshValue(),c.onChange()},destroy:function(){d(this.editors,function(a,b){b&&b.destroy()}),this.editor_holder&&this.editor_holder.parentNode&&this.editor_holder.parentNode.removeChild(this.editor_holder),this.switcher&&this.switcher.parentNode&&this.switcher.parentNode.removeChild(this.switcher),this._super()},showValidationErrors:function(a){var b=this;this.oneOf?d(this.editors,function(e,f){if(f){var g=b.path+".oneOf["+e+"]",h=[];d(a,function(a,d){if(d.path.substr(0,g.length)===g){var e=c({},d);e.path=b.path+e.path.substr(g.length),h.push(e)}}),f.showValidationErrors(h)}}):d(this.editors,function(b,c){c&&c.showValidationErrors(a)})}}),f.defaults.editors["enum"]=f.AbstractEditor.extend({getNumColumns:function(){return 4},build:function(){this.container;this.title=this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired()),this.container.appendChild(this.title),this.options.enum_titles=this.options.enum_titles||[],this["enum"]=this.schema["enum"],this.selected=0,this.select_options=[],this.html_values=[];for(var a=this,b=0;b<this["enum"].length;b++)this.select_options[b]=this.options.enum_titles[b]||"Value "+(b+1),this.html_values[b]=this.getHTML(this["enum"][b]);this.switcher=this.theme.getSwitcher(this.select_options),this.container.appendChild(this.switcher),this.display_area=this.theme.getIndentedPanel(),this.container.appendChild(this.display_area),this.options.hide_display&&(this.display_area.style.display="none"),this.switcher.addEventListener("change",function(){a.selected=a.select_options.indexOf(this.value),a.value=a["enum"][a.selected],a.refreshValue(),a.onChange(!0)}),this.value=this["enum"][0],this.refreshValue(),1===this["enum"].length&&(this.switcher.style.display="none")},refreshValue:function(){var a=this;a.selected=-1;var b=JSON.stringify(this.value);return d(this["enum"],function(c,d){return b===JSON.stringify(d)?(a.selected=c,!1):void 0}),a.selected<0?void a.setValue(a["enum"][0]):(this.switcher.value=this.select_options[this.selected],void(this.display_area.innerHTML=this.html_values[this.selected]))},enable:function(){this.always_disabled||(this.switcher.disabled=!1),this._super()},disable:function(){this.switcher.disabled=!0,this._super()},getHTML:function(a){var b=this;if(null===a)return"<em>null</em>";if("object"==typeof a){var c="";return d(a,function(d,e){var f=b.getHTML(e);Array.isArray(a)||(f="<div><em>"+d+"</em>: "+f+"</div>"),c+="<li>"+f+"</li>"}),c=Array.isArray(a)?"<ol>"+c+"</ol>":"<ul style='margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;'>"+c+"</ul>"}return"boolean"==typeof a?a?"true":"false":"string"==typeof a?a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):a},setValue:function(a){this.value!==a&&(this.value=a,this.refreshValue(),this.onChange())},destroy:function(){this.display_area&&this.display_area.parentNode&&this.display_area.parentNode.removeChild(this.display_area),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.switcher&&this.switcher.parentNode&&this.switcher.parentNode.removeChild(this.switcher),this._super()}}),f.defaults.editors.select=f.AbstractEditor.extend({setValue:function(a,b){a=this.typecast(a||"");var c=a;this.enum_values.indexOf(c)<0&&(c=this.enum_values[0]),this.value!==c&&(this.input.value=this.enum_options[this.enum_values.indexOf(c)],this.select2&&this.select2.select2("val",this.input.value),this.value=c,this.onChange())},register:function(){this._super(),this.input&&this.input.setAttribute("name",this.formname)},unregister:function(){this._super(),this.input&&this.input.removeAttribute("name")},getNumColumns:function(){if(!this.enum_options)return 3;for(var a=this.getTitle().length,b=0;b<this.enum_options.length;b++)a=Math.max(a,this.enum_options[b].length+4);return Math.min(12,Math.max(a/7,2))},typecast:function(a){return"boolean"===this.schema.type?!!a:"number"===this.schema.type?1*a:"integer"===this.schema.type?Math.floor(1*a):""+a},getValue:function(){return this.value},preBuild:function(){var a=this;if(this.input_type="select",this.enum_options=[],this.enum_values=[],this.enum_display=[],this.schema["enum"]){var b=this.schema.options&&this.schema.options.enum_titles||[];d(this.schema["enum"],function(c,d){a.enum_options[c]=""+d,a.enum_display[c]=""+(b[c]||d),a.enum_values[c]=a.typecast(d)}),this.isRequired()||(a.enum_display.unshift(" "),a.enum_options.unshift("undefined"),a.enum_values.unshift(void 0))}else if("boolean"===this.schema.type)a.enum_display=this.schema.options&&this.schema.options.enum_titles||["true","false"],a.enum_options=["1",""],a.enum_values=[!0,!1],this.isRequired()||(a.enum_display.unshift(" "),a.enum_options.unshift("undefined"),a.enum_values.unshift(void 0));else{if(!this.schema.enumSource)throw"'select' editor requires the enum property to be set.";if(this.enumSource=[],this.enum_display=[],this.enum_options=[],this.enum_values=[],Array.isArray(this.schema.enumSource))for(h=0;h<this.schema.enumSource.length;h++)"string"==typeof this.schema.enumSource[h]?this.enumSource[h]={source:this.schema.enumSource[h]}:Array.isArray(this.schema.enumSource[h])?this.enumSource[h]=this.schema.enumSource[h]:this.enumSource[h]=c({},this.schema.enumSource[h]);else this.schema.enumValue?this.enumSource=[{source:this.schema.enumSource,value:this.schema.enumValue}]:this.enumSource=[{source:this.schema.enumSource}];for(h=0;h<this.enumSource.length;h++)this.enumSource[h].value&&(this.enumSource[h].value=this.jsoneditor.compileTemplate(this.enumSource[h].value,this.template_engine)),this.enumSource[h].title&&(this.enumSource[h].title=this.jsoneditor.compileTemplate(this.enumSource[h].title,this.template_engine)),this.enumSource[h].filter&&(this.enumSource[h].filter=this.jsoneditor.compileTemplate(this.enumSource[h].filter,this.template_engine))}},build:function(){var a=this;this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.schema.description)),this.options.compact&&(this.container.className+=" compact"),this.input=this.theme.getSelectInput(this.enum_options),this.theme.setSelectOptions(this.input,this.enum_options,this.enum_display),(this.schema.readOnly||this.schema.readonly)&&(this.always_disabled=!0,this.input.disabled=!0),this.input.addEventListener("change",function(b){b.preventDefault(),b.stopPropagation(),a.onInputChange()}),this.control=this.theme.getFormControl(this.label,this.input,this.description),this.container.appendChild(this.control),this.value=this.enum_values[0]},onInputChange:function(){var a=this.input.value,b=a;-1===this.enum_options.indexOf(a)&&(b=this.enum_options[0]),this.value=this.enum_values[this.enum_options.indexOf(a)],this.onChange(!0)},setupSelect2:function(){if(window.jQuery&&window.jQuery.fn&&window.jQuery.fn.select2&&(this.enum_options.length>2||this.enum_options.length&&this.enumSource)){var a=c({},f.plugins.select2);this.schema.options&&this.schema.options.select2_options&&(a=c(a,this.schema.options.select2_options)),this.select2=window.jQuery(this.input).select2(a);var b=this;this.select2.on("select2-blur",function(){b.input.value=b.select2.select2("val"),b.onInputChange()})}else this.select2=null},postBuild:function(){this._super(),this.theme.afterInputReady(this.input),this.setupSelect2()},onWatchedFieldChange:function(){var a,b;if(this.enumSource){a=this.getWatchedFieldValues();for(var c=[],d=[],e=0;e<this.enumSource.length;e++)if(Array.isArray(this.enumSource[e]))c=c.concat(this.enumSource[e]),d=d.concat(this.enumSource[e]);else{var f=[];if(f=Array.isArray(this.enumSource[e].source)?this.enumSource[e].source:a[this.enumSource[e].source]){if(this.enumSource[e].slice&&(f=Array.prototype.slice.apply(f,this.enumSource[e].slice)),this.enumSource[e].filter){var g=[];for(b=0;b<f.length;b++)this.enumSource[e].filter({i:b,item:f[b],watched:a})&&g.push(f[b]);f=g}var h=[],i=[];for(b=0;b<f.length;b++){var j=f[b];this.enumSource[e].value?i[b]=this.enumSource[e].value({i:b,item:j}):i[b]=f[b],this.enumSource[e].title?h[b]=this.enumSource[e].title({i:b,item:j}):h[b]=i[b]}c=c.concat(i),d=d.concat(h)}}var k=this.value;this.theme.setSelectOptions(this.input,c,d),this.enum_options=c,this.enum_display=d,this.enum_values=c,this.select2&&this.select2.select2("destroy"),-1!==c.indexOf(k)?(this.input.value=k,this.value=k):(this.input.value=c[0],this.value=c[0]||"",this.parent?this.parent.onChildEditorChange(this):this.jsoneditor.onChange(),this.jsoneditor.notifyWatchers(this.path)),this.setupSelect2()}this._super()},enable:function(){this.always_disabled||(this.input.disabled=!1,this.select2&&this.select2.select2("enable",!0)),this._super()},disable:function(){this.input.disabled=!0,this.select2&&this.select2.select2("enable",!1),this._super()},destroy:function(){this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.select2&&(this.select2.select2("destroy"),this.select2=null),this._super()}}),f.defaults.editors.multiselect=f.AbstractEditor.extend({preBuild:function(){this._super(),this.select_options={},this.select_values={};var a=this.jsoneditor.expandRefs(this.schema.items||{}),b=a["enum"]||[];for(this.option_keys=[],h=0;h<b.length;h++)this.sanitize(b[h])===b[h]&&(this.option_keys.push(b[h]+""),this.select_values[b[h]+""]=b[h])},build:function(){var a,b=this;if(this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.schema.description)),!this.schema.format&&this.option_keys.length<8||"checkbox"===this.schema.format){for(this.input_type="checkboxes",this.inputs={},this.controls={},a=0;a<this.option_keys.length;a++){this.inputs[this.option_keys[a]]=this.theme.getCheckbox(),this.select_options[this.option_keys[a]]=this.inputs[this.option_keys[a]];var c=this.theme.getCheckboxLabel(this.option_keys[a]);this.controls[this.option_keys[a]]=this.theme.getFormControl(c,this.inputs[this.option_keys[a]])}this.control=this.theme.getMultiCheckboxHolder(this.controls,this.label,this.description)}else{for(this.input_type="select",this.input=this.theme.getSelectInput(this.option_keys),this.input.multiple=!0,this.input.size=Math.min(10,this.option_keys.length),a=0;a<this.option_keys.length;a++)this.select_options[this.option_keys[a]]=this.input.children[a];(this.schema.readOnly||this.schema.readonly)&&(this.always_disabled=!0,this.input.disabled=!0),this.control=this.theme.getFormControl(this.label,this.input,this.description)}this.container.appendChild(this.control),this.control.addEventListener("change",function(c){c.preventDefault(),c.stopPropagation();var d=[];for(a=0;a<b.option_keys.length;a++)(b.select_options[b.option_keys[a]].selected||b.select_options[b.option_keys[a]].checked)&&d.push(b.select_values[b.option_keys[a]]);b.updateValue(d),b.onChange(!0)})},setValue:function(a,b){var c;for(a=a||[],"object"!=typeof a?a=[a]:Array.isArray(a)||(a=[]),c=0;c<a.length;c++)"string"!=typeof a[c]&&(a[c]+="");for(c in this.select_options)this.select_options.hasOwnProperty(c)&&(this.select_options[c]["select"===this.input_type?"selected":"checked"]=-1!==a.indexOf(c));this.updateValue(a),this.onChange()},setupSelect2:function(){if(window.jQuery&&window.jQuery.fn&&window.jQuery.fn.select2){var a=window.jQuery.extend({},f.plugins.select2);this.schema.options&&this.schema.options.select2_options&&(a=c(a,this.schema.options.select2_options)),this.select2=window.jQuery(this.input).select2(a);var b=this;this.select2.on("select2-blur",function(){var a=b.select2.select2("val");b.value=a,b.onChange(!0)})}else this.select2=null},onInputChange:function(){this.value=this.input.value,this.onChange(!0)},postBuild:function(){this._super(),this.setupSelect2()},register:function(){this._super(),this.input&&this.input.setAttribute("name",this.formname)},unregister:function(){this._super(),this.input&&this.input.removeAttribute("name")},getNumColumns:function(){var a=this.getTitle().length;for(var b in this.select_values)this.select_values.hasOwnProperty(b)&&(a=Math.max(a,(this.select_values[b]+"").length+4));return Math.min(12,Math.max(a/7,2))},updateValue:function(a){for(var b=!1,c=[],d=0;d<a.length;d++)if(this.select_options[a[d]+""]){var e=this.sanitize(this.select_values[a[d]]);c.push(e),e!==a[d]&&(b=!0)}else b=!0;return this.value=c,this.select2&&this.select2.select2("val",this.value),b},sanitize:function(a){return"number"===this.schema.items.type?1*a:"integer"===this.schema.items.type?Math.floor(1*a):""+a},enable:function(){if(!this.always_disabled){if(this.input)this.input.disabled=!1;else if(this.inputs)for(var a in this.inputs)this.inputs.hasOwnProperty(a)&&(this.inputs[a].disabled=!1);this.select2&&this.select2.select2("enable",!0)}this._super()},disable:function(){if(this.input)this.input.disabled=!0;else if(this.inputs)for(var a in this.inputs)this.inputs.hasOwnProperty(a)&&(this.inputs[a].disabled=!0);this.select2&&this.select2.select2("enable",!1),this._super()},destroy:function(){this.select2&&(this.select2.select2("destroy"),this.select2=null),this._super()}}),f.defaults.editors.base64=f.AbstractEditor.extend({getNumColumns:function(){return 4},build:function(){var a=this;if(this.title=this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired()),this.input=this.theme.getFormInputField("hidden"),this.container.appendChild(this.input),!this.schema.readOnly&&!this.schema.readonly){if(!window.FileReader)throw"FileReader required for base64 editor";this.uploader=this.theme.getFormInputField("file"),this.uploader.addEventListener("change",function(b){if(b.preventDefault(),b.stopPropagation(),this.files&&this.files.length){var c=new FileReader;c.onload=function(b){a.value=b.target.result,a.refreshPreview(),a.onChange(!0),c=null},c.readAsDataURL(this.files[0])}})}this.preview=this.theme.getFormInputDescription(this.schema.description),this.container.appendChild(this.preview),this.control=this.theme.getFormControl(this.label,this.uploader||this.input,this.preview),this.container.appendChild(this.control)},refreshPreview:function(){if(this.last_preview!==this.value&&(this.last_preview=this.value,this.preview.innerHTML="",this.value)){var a=this.value.match(/^data:([^;,]+)[;,]/);if(a&&(a=a[1]),a){if(this.preview.innerHTML="<strong>Type:</strong> "+a+", <strong>Size:</strong> "+Math.floor((this.value.length-this.value.split(",")[0].length-1)/1.33333)+" bytes","image"===a.substr(0,5)){this.preview.innerHTML+="<br>";var b=document.createElement("img");b.style.maxWidth="100%",b.style.maxHeight="100px",b.src=this.value,this.preview.appendChild(b)}}else this.preview.innerHTML="<em>Invalid data URI</em>"}},enable:function(){this.uploader&&(this.uploader.disabled=!1),this._super()},disable:function(){this.uploader&&(this.uploader.disabled=!0),this._super()},setValue:function(a){this.value!==a&&(this.value=a,this.input.value=this.value,this.refreshPreview(),this.onChange())},destroy:function(){this.preview&&this.preview.parentNode&&this.preview.parentNode.removeChild(this.preview),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.uploader&&this.uploader.parentNode&&this.uploader.parentNode.removeChild(this.uploader),this._super()}}),f.defaults.editors.upload=f.AbstractEditor.extend({getNumColumns:function(){return 4},build:function(){var a=this;if(this.title=this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired()),this.input=this.theme.getFormInputField("hidden"),this.container.appendChild(this.input),!this.schema.readOnly&&!this.schema.readonly){if(!this.jsoneditor.options.upload)throw"Upload handler required for upload editor";this.uploader=this.theme.getFormInputField("file"),this.uploader.addEventListener("change",function(b){if(b.preventDefault(),b.stopPropagation(),this.files&&this.files.length){var c=new FileReader;c.onload=function(b){a.preview_value=b.target.result,a.refreshPreview(),a.onChange(!0),c=null},c.readAsDataURL(this.files[0])}})}var b=this.schema.description;b||(b=""),this.preview=this.theme.getFormInputDescription(b),this.container.appendChild(this.preview),this.control=this.theme.getFormControl(this.label,this.uploader||this.input,this.preview),this.container.appendChild(this.control)},refreshPreview:function(){if(this.last_preview!==this.preview_value&&(this.last_preview=this.preview_value,this.preview.innerHTML="",this.preview_value)){var a=this,b=this.preview_value.match(/^data:([^;,]+)[;,]/);b&&(b=b[1]),b||(b="unknown");var c=this.uploader.files[0];if(this.preview.innerHTML="<strong>Type:</strong> "+b+", <strong>Size:</strong> "+c.size+" bytes","image"===b.substr(0,5)){this.preview.innerHTML+="<br>";var d=document.createElement("img");d.style.maxWidth="100%",d.style.maxHeight="100px",d.src=this.preview_value,
+this.preview.appendChild(d)}this.preview.innerHTML+="<br>";var e=this.getButton("Upload","upload","Upload");this.preview.appendChild(e),e.addEventListener("click",function(b){b.preventDefault(),e.setAttribute("disabled","disabled"),a.theme.removeInputError(a.uploader),a.theme.getProgressBar&&(a.progressBar=a.theme.getProgressBar(),a.preview.appendChild(a.progressBar)),a.jsoneditor.options.upload(a.path,c,{success:function(b){a.setValue(b),a.parent?a.parent.onChildEditorChange(a):a.jsoneditor.onChange(),a.progressBar&&a.preview.removeChild(a.progressBar),e.removeAttribute("disabled")},failure:function(b){a.theme.addInputError(a.uploader,b),a.progressBar&&a.preview.removeChild(a.progressBar),e.removeAttribute("disabled")},updateProgress:function(b){a.progressBar&&(b?a.theme.updateProgressBar(a.progressBar,b):a.theme.updateProgressBarUnknown(a.progressBar))}})})}},enable:function(){this.uploader&&(this.uploader.disabled=!1),this._super()},disable:function(){this.uploader&&(this.uploader.disabled=!0),this._super()},setValue:function(a){this.value!==a&&(this.value=a,this.input.value=this.value,this.onChange())},destroy:function(){this.preview&&this.preview.parentNode&&this.preview.parentNode.removeChild(this.preview),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.uploader&&this.uploader.parentNode&&this.uploader.parentNode.removeChild(this.uploader),this._super()}}),f.defaults.editors.checkbox=f.AbstractEditor.extend({setValue:function(a,b){this.value=!!a,this.input.checked=this.value,this.onChange()},register:function(){this._super(),this.input&&this.input.setAttribute("name",this.formname)},unregister:function(){this._super(),this.input&&this.input.removeAttribute("name")},getNumColumns:function(){return Math.min(12,Math.max(this.getTitle().length/7,2))},build:function(){var a=this;this.options.compact||(this.label=this.header=this.theme.getCheckboxLabel(this.getTitle())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.schema.description)),this.options.compact&&(this.container.className+=" compact"),this.input=this.theme.getCheckbox(),this.control=this.theme.getFormControl(this.label,this.input,this.description),(this.schema.readOnly||this.schema.readonly)&&(this.always_disabled=!0,this.input.disabled=!0),this.input.addEventListener("change",function(b){b.preventDefault(),b.stopPropagation(),a.value=this.checked,a.onChange(!0)}),this.container.appendChild(this.control)},enable:function(){this.always_disabled||(this.input.disabled=!1),this._super()},disable:function(){this.input.disabled=!0,this._super()},destroy:function(){this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this._super()}});var g=function(){var a=document.documentElement;return a.matches?"matches":a.webkitMatchesSelector?"webkitMatchesSelector":a.mozMatchesSelector?"mozMatchesSelector":a.msMatchesSelector?"msMatchesSelector":a.oMatchesSelector?"oMatchesSelector":void 0}();f.AbstractTheme=a.extend({getContainer:function(){return document.createElement("div")},getFloatRightLinkHolder:function(){var a=document.createElement("div");return a.style=a.style||{},a.style.cssFloat="right",a.style.marginLeft="10px",a},getModal:function(){var a=document.createElement("div");return a.style.backgroundColor="white",a.style.border="1px solid black",a.style.boxShadow="3px 3px black",a.style.position="absolute",a.style.zIndex="10",a.style.display="none",a},getGridContainer:function(){var a=document.createElement("div");return a},getGridRow:function(){var a=document.createElement("div");return a.className="row",a},getGridColumn:function(){var a=document.createElement("div");return a},setGridColumnSize:function(a,b){},getLink:function(a){var b=document.createElement("a");return b.setAttribute("href","#"),b.appendChild(document.createTextNode(a)),b},disableHeader:function(a){a.style.color="#ccc"},disableLabel:function(a){a.style.color="#ccc"},enableHeader:function(a){a.style.color=""},enableLabel:function(a){a.style.color=""},getFormInputLabel:function(a){var b=document.createElement("label");return b.appendChild(document.createTextNode(a)),b},getCheckboxLabel:function(a){var b=this.getFormInputLabel(a);return b.style.fontWeight="normal",b},getHeader:function(a,b){var c=document.createElement("h3");return"string"==typeof a?c.textContent=a:c.appendChild(a),b&&(c.className+=" required"),c},getCheckbox:function(){var a=this.getFormInputField("checkbox");return a.style.display="inline-block",a.style.width="auto",a},getMultiCheckboxHolder:function(a,b,c){var d=document.createElement("div");b&&(b.style.display="block",d.appendChild(b));for(var e in a)a.hasOwnProperty(e)&&(a[e].style.display="inline-block",a[e].style.marginRight="20px",d.appendChild(a[e]));return c&&d.appendChild(c),d},getSelectInput:function(a){var b=document.createElement("select");return a&&this.setSelectOptions(b,a),b},getSwitcher:function(a){var b=this.getSelectInput(a);return b.style.backgroundColor="transparent",b.style.display="inline-block",b.style.fontStyle="italic",b.style.fontWeight="normal",b.style.height="auto",b.style.marginBottom=0,b.style.marginLeft="5px",b.style.padding="0 0 0 3px",b.style.width="auto",b},getSwitcherOptions:function(a){return a.getElementsByTagName("option")},setSwitcherOptions:function(a,b,c){this.setSelectOptions(a,b,c)},setSelectOptions:function(a,b,c){c=c||[],a.innerHTML="";for(var d=0;d<b.length;d++){var e=document.createElement("option");e.setAttribute("value",b[d]),e.textContent=c[d]||b[d],a.appendChild(e)}},getTextareaInput:function(){var a=document.createElement("textarea");return a.style=a.style||{},a.style.width="100%",a.style.height="300px",a.style.boxSizing="border-box",a},getRangeInput:function(a,b,c){var d=this.getFormInputField("range");return d.setAttribute("min",a),d.setAttribute("max",b),d.setAttribute("step",c),d},getFormInputField:function(a){var b=document.createElement("input");return b.setAttribute("type",a),b},afterInputReady:function(a){},getFormControl:function(a,b,c){var d=document.createElement("div");return d.className="form-control",a&&d.appendChild(a),"checkbox"===b.type?a.insertBefore(b,a.firstChild):d.appendChild(b),c&&d.appendChild(c),d},getIndentedPanel:function(){var a=document.createElement("div");return a.style=a.style||{},a.style.paddingLeft="10px",a.style.marginLeft="10px",a.style.borderLeft="1px solid #ccc",a},getChildEditorHolder:function(){return document.createElement("div")},getDescription:function(a){var b=document.createElement("p");return b.innerHTML=a,b},getCheckboxDescription:function(a){return this.getDescription(a)},getFormInputDescription:function(a){return this.getDescription(a)},getHeaderButtonHolder:function(){return this.getButtonHolder()},getButtonHolder:function(){return document.createElement("div")},getButton:function(a,b,c){var d=document.createElement("button");return d.type="button",this.setButtonText(d,a,b,c),d},setButtonText:function(a,b,c,d){a.innerHTML="",c&&(a.appendChild(c),a.innerHTML+=" "),a.appendChild(document.createTextNode(b)),d&&a.setAttribute("title",d)},getTable:function(){return document.createElement("table")},getTableRow:function(){return document.createElement("tr")},getTableHead:function(){return document.createElement("thead")},getTableBody:function(){return document.createElement("tbody")},getTableHeaderCell:function(a){var b=document.createElement("th");return b.textContent=a,b},getTableCell:function(){var a=document.createElement("td");return a},getErrorMessage:function(a){var b=document.createElement("p");return b.style=b.style||{},b.style.color="red",b.appendChild(document.createTextNode(a)),b},addInputError:function(a,b){},removeInputError:function(a){},addTableRowError:function(a){},removeTableRowError:function(a){},getTabHolder:function(){var a=document.createElement("div");return a.innerHTML="<div style='float: left; width: 130px;' class='tabs'></div><div class='content' style='margin-left: 130px;'></div><div style='clear:both;'></div>",a},applyStyles:function(a,b){a.style=a.style||{};for(var c in b)b.hasOwnProperty(c)&&(a.style[c]=b[c])},closest:function(a,b){for(;a&&a!==document;){if(!g)return!1;if(a[g](b))return a;a=a.parentNode}return!1},getTab:function(a){var b=document.createElement("div");return b.appendChild(a),b.style=b.style||{},this.applyStyles(b,{border:"1px solid #ccc",borderWidth:"1px 0 1px 1px",textAlign:"center",lineHeight:"30px",borderRadius:"5px",borderBottomRightRadius:0,borderTopRightRadius:0,fontWeight:"bold",cursor:"pointer"}),b},getTabContentHolder:function(a){return a.children[1]},getTabContent:function(){return this.getIndentedPanel()},markTabActive:function(a){this.applyStyles(a,{opacity:1,background:"white"})},markTabInactive:function(a){this.applyStyles(a,{opacity:.5,background:""})},addTab:function(a,b){a.children[0].appendChild(b)},getBlockLink:function(){var a=document.createElement("a");return a.style.display="block",a},getBlockLinkHolder:function(){var a=document.createElement("div");return a},getLinksHolder:function(){var a=document.createElement("div");return a},createMediaLink:function(a,b,c){a.appendChild(b),c.style.width="100%",a.appendChild(c)},createImageLink:function(a,b,c){a.appendChild(b),b.appendChild(c)}}),f.defaults.themes.bootstrap2=f.AbstractTheme.extend({getRangeInput:function(a,b,c){return this._super(a,b,c)},getGridContainer:function(){var a=document.createElement("div");return a.className="container-fluid",a},getGridRow:function(){var a=document.createElement("div");return a.className="row-fluid",a},getFormInputLabel:function(a,b){var c=this._super(a);return c.style.display="inline-block",c.style.fontWeight="bold",b&&(c.className+=" required"),c},setGridColumnSize:function(a,b){a.className="span"+b},getSelectInput:function(a){var b=this._super(a);return b.style.width="auto",b.style.maxWidth="98%",b},getFormInputField:function(a){var b=this._super(a);return b.style.width="98%",b},afterInputReady:function(a){a.controlgroup||(a.controlgroup=this.closest(a,".control-group"),a.controls=this.closest(a,".controls"),this.closest(a,".compact")&&(a.controlgroup.className=a.controlgroup.className.replace(/control-group/g,"").replace(/[ ]{2,}/g," "),a.controls.className=a.controlgroup.className.replace(/controls/g,"").replace(/[ ]{2,}/g," "),a.style.marginBottom=0))},getIndentedPanel:function(){var a=document.createElement("div");return a.className="well well-small",a},getFormInputDescription:function(a){var b=document.createElement("p");return b.className="help-inline",b.textContent=a,b},getFormControl:function(a,b,c){var d=document.createElement("div");d.className="control-group";var e=document.createElement("div");return e.className="controls",a&&"checkbox"===b.getAttribute("type")?(d.appendChild(e),a.className+=" checkbox",a.appendChild(b),e.appendChild(a),e.style.height="30px"):(a&&(a.className+=" control-label",d.appendChild(a)),e.appendChild(b),d.appendChild(e)),c&&e.appendChild(c),d},getHeaderButtonHolder:function(){var a=this.getButtonHolder();return a.style.marginLeft="10px",a},getButtonHolder:function(){var a=document.createElement("div");return a.className="btn-group",a},getButton:function(a,b,c){var d=this._super(a,b,c);return d.className+=" btn btn-default",d},getTable:function(){var a=document.createElement("table");return a.className="table table-bordered",a.style.width="auto",a.style.maxWidth="none",a},addInputError:function(a,b){a.controlgroup&&a.controls&&(a.controlgroup.className+=" error",a.errmsg?a.errmsg.style.display="":(a.errmsg=document.createElement("p"),a.errmsg.className="help-block errormsg",a.controls.appendChild(a.errmsg)),a.errmsg.textContent=b)},removeInputError:function(a){a.errmsg&&(a.errmsg.style.display="none",a.controlgroup.className=a.controlgroup.className.replace(/\s?error/g,""))},getTabHolder:function(){var a=document.createElement("div");return a.className="tabbable tabs-left",a.innerHTML="<ul class='nav nav-tabs span2' style='margin-right: 0;'></ul><div class='tab-content span10' style='overflow:visible;'></div>",a},getTab:function(a){var b=document.createElement("li"),c=document.createElement("a");return c.setAttribute("href","#"),c.appendChild(a),b.appendChild(c),b},getTabContentHolder:function(a){return a.children[1]},getTabContent:function(){var a=document.createElement("div");return a.className="tab-pane active",a},markTabActive:function(a){a.className+=" active"},markTabInactive:function(a){a.className=a.className.replace(/\s?active/g,"")},addTab:function(a,b){a.children[0].appendChild(b)},getProgressBar:function(){var a=document.createElement("div");a.className="progress";var b=document.createElement("div");return b.className="bar",b.style.width="0%",a.appendChild(b),a},updateProgressBar:function(a,b){a&&(a.firstChild.style.width=b+"%")},updateProgressBarUnknown:function(a){a&&(a.className="progress progress-striped active",a.firstChild.style.width="100%")}}),f.defaults.themes.bootstrap3=f.AbstractTheme.extend({getSelectInput:function(a){var b=this._super(a);return b.className+="form-control",b},setGridColumnSize:function(a,b){a.className="col-md-"+b},afterInputReady:function(a){a.controlgroup||(a.controlgroup=this.closest(a,".form-group"),this.closest(a,".compact")&&(a.controlgroup.style.marginBottom=0))},getTextareaInput:function(){var a=document.createElement("textarea");return a.className="form-control",a},getRangeInput:function(a,b,c){return this._super(a,b,c)},getFormInputField:function(a){var b=this._super(a);return"checkbox"!==a&&(b.className+="form-control"),b},getFormControl:function(a,b,c){var d=document.createElement("div");return a&&"checkbox"===b.type?(d.className+=" checkbox",a.appendChild(b),a.style.fontSize="14px",d.style.marginTop="0",d.appendChild(a),b.style.position="relative",b.style.cssFloat="left"):(d.className+=" form-group",a&&(a.className+=" control-label",d.appendChild(a)),d.appendChild(b)),c&&d.appendChild(c),d},getIndentedPanel:function(){var a=document.createElement("div");return a.className="well well-sm",a},getFormInputDescription:function(a){var b=document.createElement("p");return b.className="help-block",b.innerHTML=a,b},getHeaderButtonHolder:function(){var a=this.getButtonHolder();return a.style.marginLeft="10px",a},getButtonHolder:function(){var a=document.createElement("div");return a.className="btn-group",a},getButton:function(a,b,c){var d=this._super(a,b,c);return d.className+="btn btn-default",d},getTable:function(){var a=document.createElement("table");return a.className="table table-bordered",a.style.width="auto",a.style.maxWidth="none",a},addInputError:function(a,b){a.controlgroup&&(a.controlgroup.className+=" has-error",a.errmsg?a.errmsg.style.display="":(a.errmsg=document.createElement("p"),a.errmsg.className="help-block errormsg",a.controlgroup.appendChild(a.errmsg)),a.errmsg.textContent=b)},removeInputError:function(a){a.errmsg&&(a.errmsg.style.display="none",a.controlgroup.className=a.controlgroup.className.replace(/\s?has-error/g,""))},getTabHolder:function(){var a=document.createElement("div");return a.innerHTML="<div class='tabs list-group col-md-2'></div><div class='col-md-10'></div>",a.className="rows",a},getTab:function(a){var b=document.createElement("a");return b.className="list-group-item",b.setAttribute("href","#"),b.appendChild(a),b},markTabActive:function(a){a.className+=" active"},markTabInactive:function(a){a.className=a.className.replace(/\s?active/g,"")},getProgressBar:function(){var a=0,b=100,c=0,d=document.createElement("div");d.className="progress";var e=document.createElement("div");return e.className="progress-bar",e.setAttribute("role","progressbar"),e.setAttribute("aria-valuenow",c),e.setAttribute("aria-valuemin",a),e.setAttribute("aria-valuenax",b),e.innerHTML=c+"%",d.appendChild(e),d},updateProgressBar:function(a,b){if(a){var c=a.firstChild,d=b+"%";c.setAttribute("aria-valuenow",b),c.style.width=d,c.innerHTML=d}},updateProgressBarUnknown:function(a){if(a){var b=a.firstChild;a.className="progress progress-striped active",b.removeAttribute("aria-valuenow"),b.style.width="100%",b.innerHTML=""}}}),f.defaults.themes.foundation=f.AbstractTheme.extend({getChildEditorHolder:function(){var a=document.createElement("div");return a.style.marginBottom="15px",a},getSelectInput:function(a){var b=this._super(a);return b.style.minWidth="none",b.style.padding="5px",b.style.marginTop="3px",b},getSwitcher:function(a){var b=this._super(a);return b.style.paddingRight="8px",b},afterInputReady:function(a){this.closest(a,".compact")&&(a.style.marginBottom=0),a.group=this.closest(a,".form-control")},getFormInputLabel:function(a,b){var c=this._super(a);return c.style.display="inline-block",b&&(c.className+=" required"),c},getFormInputField:function(a){var b=this._super(a);return b.style.width="100%",b.style.marginBottom="checkbox"===a?"0":"12px",b},getFormInputDescription:function(a){var b=document.createElement("p");return b.textContent=a,b.style.marginTop="-10px",b.style.fontStyle="italic",b},getIndentedPanel:function(){var a=document.createElement("div");return a.className="panel",a},getHeaderButtonHolder:function(){var a=this.getButtonHolder();return a.style.display="inline-block",a.style.marginLeft="10px",a.style.verticalAlign="middle",a},getButtonHolder:function(){var a=document.createElement("div");return a.className="button-group",a},getButton:function(a,b,c){var d=this._super(a,b,c);return d.className+=" small button",d},addInputError:function(a,b){a.group&&(a.group.className+=" error",a.errmsg?a.errmsg.style.display="":(a.insertAdjacentHTML("afterend",'<small class="error"></small>'),a.errmsg=a.parentNode.getElementsByClassName("error")[0]),a.errmsg.textContent=b)},removeInputError:function(a){a.errmsg&&(a.group.className=a.group.className.replace(/ error/g,""),a.errmsg.style.display="none")},getProgressBar:function(){var a=document.createElement("div");a.className="progress";var b=document.createElement("span");return b.className="meter",b.style.width="0%",a.appendChild(b),a},updateProgressBar:function(a,b){a&&(a.firstChild.style.width=b+"%")},updateProgressBarUnknown:function(a){a&&(a.firstChild.style.width="100%")}}),f.defaults.themes.foundation3=f.defaults.themes.foundation.extend({getHeaderButtonHolder:function(){var a=this._super();return a.style.fontSize=".6em",a},getFormInputLabel:function(a,b){var c=this._super(a);return c.style.fontWeight="bold",b&&(c.className+=" required"),c},getTabHolder:function(){var a=document.createElement("div");return a.className="row",a.innerHTML="<dl class='tabs vertical two columns'></dl><div class='tabs-content ten columns'></div>",a},setGridColumnSize:function(a,b){var c=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve"];a.className="columns "+c[b]},getTab:function(a){var b=document.createElement("dd"),c=document.createElement("a");return c.setAttribute("href","#"),c.appendChild(a),b.appendChild(c),b},getTabContentHolder:function(a){return a.children[1]},getTabContent:function(){var a=document.createElement("div");return a.className="content active",a.style.paddingLeft="5px",a},markTabActive:function(a){a.className+=" active"},markTabInactive:function(a){a.className=a.className.replace(/\s*active/g,"")},addTab:function(a,b){a.children[0].appendChild(b)}}),f.defaults.themes.foundation4=f.defaults.themes.foundation.extend({getHeaderButtonHolder:function(){var a=this._super();return a.style.fontSize=".6em",a},setGridColumnSize:function(a,b){a.className="columns large-"+b},getFormInputDescription:function(a){var b=this._super(a);return b.style.fontSize=".8rem",b},getFormInputLabel:function(a,b){var c=this._super(a);return c.style.fontWeight="bold",b&&(c.className+=" required"),c}}),f.defaults.themes.foundation5=f.defaults.themes.foundation.extend({getFormInputDescription:function(a){var b=this._super(a);return b.style.fontSize=".8rem",b},setGridColumnSize:function(a,b){a.className="columns medium-"+b},getButton:function(a,b,c){var d=this._super(a,b,c);return d.className=d.className.replace(/\s*small/g,"")+" tiny",d},getTabHolder:function(){var a=document.createElement("div");return a.innerHTML="<dl class='tabs vertical'></dl><div class='tabs-content vertical'></div>",a},getTab:function(a){var b=document.createElement("dd"),c=document.createElement("a");return c.setAttribute("href","#"),c.appendChild(a),b.appendChild(c),b},getTabContentHolder:function(a){return a.children[1]},getTabContent:function(){var a=document.createElement("div");return a.className="content active",a.style.paddingLeft="5px",a},markTabActive:function(a){a.className+=" active"},markTabInactive:function(a){a.className=a.className.replace(/\s*active/g,"")},addTab:function(a,b){a.children[0].appendChild(b)}}),f.defaults.themes.html=f.AbstractTheme.extend({getFormInputLabel:function(a,b){var c=this._super(a);return c.style.display="block",c.style.marginBottom="3px",c.style.fontWeight="bold",b&&(c.className+=" required"),c},getFormInputDescription:function(a){var b=this._super(a);return b.style.fontSize=".8em",b.style.margin=0,b.style.display="inline-block",b.style.fontStyle="italic",b},getIndentedPanel:function(){var a=this._super();return a.style.border="1px solid #ddd",a.style.padding="5px",a.style.margin="5px",a.style.borderRadius="3px",a},getChildEditorHolder:function(){var a=this._super();return a.style.marginBottom="8px",a},getHeaderButtonHolder:function(){var a=this.getButtonHolder();return a.style.display="inline-block",a.style.marginLeft="10px",a.style.fontSize=".8em",a.style.verticalAlign="middle",a},getTable:function(){var a=this._super();return a.style.borderBottom="1px solid #ccc",a.style.marginBottom="5px",a},addInputError:function(a,b){if(a.style.borderColor="red",a.errmsg)a.errmsg.style.display="block";else{var c=this.closest(a,".form-control");a.errmsg=document.createElement("div"),a.errmsg.setAttribute("class","errmsg"),a.errmsg.style=a.errmsg.style||{},a.errmsg.style.color="red",c.appendChild(a.errmsg)}a.errmsg.innerHTML="",a.errmsg.appendChild(document.createTextNode(b))},removeInputError:function(a){a.style.borderColor="",a.errmsg&&(a.errmsg.style.display="none")},getProgressBar:function(){var a=100,b=0,c=document.createElement("progress");return c.setAttribute("max",a),c.setAttribute("value",b),c},updateProgressBar:function(a,b){a&&a.setAttribute("value",b)},updateProgressBarUnknown:function(a){a&&a.removeAttribute("value")}}),f.defaults.themes.jqueryui=f.AbstractTheme.extend({getTable:function(){var a=this._super();return a.setAttribute("cellpadding",5),a.setAttribute("cellspacing",0),a},getTableHeaderCell:function(a){var b=this._super(a);return b.className="ui-state-active",b.style.fontWeight="bold",b},getTableCell:function(){var a=this._super();return a.className="ui-widget-content",a},getHeaderButtonHolder:function(){var a=this.getButtonHolder();return a.style.marginLeft="10px",a.style.fontSize=".6em",a.style.display="inline-block",a},getFormInputDescription:function(a){var b=this.getDescription(a);return b.style.marginLeft="10px",b.style.display="inline-block",b},getFormControl:function(a,b,c){var d=this._super(a,b,c);return"checkbox"===b.type?(d.style.lineHeight="25px",d.style.padding="3px 0"):d.style.padding="4px 0 8px 0",d},getDescription:function(a){var b=document.createElement("span");return b.style.fontSize=".8em",b.style.fontStyle="italic",b.textContent=a,b},getButtonHolder:function(){var a=document.createElement("div");return a.className="ui-buttonset",a.style.fontSize=".7em",a},getFormInputLabel:function(a,b){var c=document.createElement("label");return c.style.fontWeight="bold",c.style.display="block",b&&(c.className+=" required"),c.textContent=a,c},getButton:function(a,b,c){var d=document.createElement("button");d.className="ui-button ui-widget ui-state-default ui-corner-all",b&&!a?(d.className+=" ui-button-icon-only",b.className+=" ui-button-icon-primary ui-icon-primary",d.appendChild(b)):b?(d.className+=" ui-button-text-icon-primary",b.className+=" ui-button-icon-primary ui-icon-primary",d.appendChild(b)):d.className+=" ui-button-text-only";var e=document.createElement("span");return e.className="ui-button-text",e.textContent=a||c||".",d.appendChild(e),d.setAttribute("title",c),d},setButtonText:function(a,b,c,d){a.innerHTML="",a.className="ui-button ui-widget ui-state-default ui-corner-all",c&&!b?(a.className+=" ui-button-icon-only",c.className+=" ui-button-icon-primary ui-icon-primary",a.appendChild(c)):c?(a.className+=" ui-button-text-icon-primary",c.className+=" ui-button-icon-primary ui-icon-primary",a.appendChild(c)):a.className+=" ui-button-text-only";var e=document.createElement("span");e.className="ui-button-text",e.textContent=b||d||".",a.appendChild(e),a.setAttribute("title",d)},getIndentedPanel:function(){var a=document.createElement("div");return a.className="ui-widget-content ui-corner-all",a.style.padding="1em 1.4em",a.style.marginBottom="20px",a},afterInputReady:function(a){a.controls||(a.controls=this.closest(a,".form-control"))},addInputError:function(a,b){a.controls&&(a.errmsg?a.errmsg.style.display="":(a.errmsg=document.createElement("div"),a.errmsg.className="ui-state-error",a.controls.appendChild(a.errmsg)),a.errmsg.textContent=b)},removeInputError:function(a){a.errmsg&&(a.errmsg.style.display="none")},markTabActive:function(a){a.className=a.className.replace(/\s*ui-widget-header/g,"")+" ui-state-active"},markTabInactive:function(a){a.className=a.className.replace(/\s*ui-state-active/g,"")+" ui-widget-header"}}),f.AbstractIconLib=a.extend({mapping:{collapse:"",expand:"","delete":"",edit:"",add:"",cancel:"",save:"",moveup:"",movedown:""},icon_prefix:"",getIconClass:function(a){return this.mapping[a]?this.icon_prefix+this.mapping[a]:null},getIcon:function(a){var b=this.getIconClass(a);if(!b)return null;var c=document.createElement("i");return c.className=b,c}}),f.defaults.iconlibs.bootstrap2=f.AbstractIconLib.extend({mapping:{collapse:"chevron-down",expand:"chevron-up","delete":"trash",edit:"pencil",add:"plus",cancel:"ban-circle",save:"ok",moveup:"arrow-up",movedown:"arrow-down"},icon_prefix:"icon-"}),f.defaults.iconlibs.bootstrap3=f.AbstractIconLib.extend({mapping:{collapse:"chevron-down",expand:"chevron-right","delete":"remove",edit:"pencil",add:"plus",cancel:"floppy-remove",save:"floppy-saved",moveup:"arrow-up",movedown:"arrow-down"},icon_prefix:"glyphicon glyphicon-"}),f.defaults.iconlibs.fontawesome3=f.AbstractIconLib.extend({mapping:{collapse:"chevron-down",expand:"chevron-right","delete":"remove",edit:"pencil",add:"plus",cancel:"ban-circle",save:"save",moveup:"arrow-up",movedown:"arrow-down"},icon_prefix:"icon-"}),f.defaults.iconlibs.fontawesome4=f.AbstractIconLib.extend({mapping:{collapse:"caret-square-o-down",expand:"caret-square-o-right","delete":"times",edit:"pencil",add:"plus",cancel:"ban",save:"save",moveup:"arrow-up",movedown:"arrow-down"},icon_prefix:"fa fa-"}),f.defaults.iconlibs.foundation2=f.AbstractIconLib.extend({mapping:{collapse:"minus",expand:"plus","delete":"remove",edit:"edit",add:"add-doc",cancel:"error",save:"checkmark",moveup:"up-arrow",movedown:"down-arrow"},icon_prefix:"foundicon-"}),f.defaults.iconlibs.foundation3=f.AbstractIconLib.extend({mapping:{collapse:"minus",expand:"plus","delete":"x",edit:"pencil",add:"page-add",cancel:"x-circle",save:"save",moveup:"arrow-up",movedown:"arrow-down"},icon_prefix:"fi-"}),f.defaults.iconlibs.jqueryui=f.AbstractIconLib.extend({mapping:{collapse:"triangle-1-s",expand:"triangle-1-e","delete":"trash",edit:"pencil",add:"plusthick",cancel:"closethick",save:"disk",moveup:"arrowthick-1-n",movedown:"arrowthick-1-s"},icon_prefix:"ui-icon ui-icon-"}),f.defaults.templates["default"]=function(){return{compile:function(a){var b=a.match(/{{\s*([a-zA-Z0-9\-_ \.]+)\s*}}/g),c=b&&b.length;if(!c)return function(){return a};for(var d=[],e=function(a){var c,e=b[a].replace(/[{}]+/g,"").trim().split("."),f=e.length;if(f>1){var g;c=function(b){for(g=b,a=0;f>a&&(g=g[e[a]],g);a++);return g}}else e=e[0],c=function(a){return a[e]};d.push({s:b[a],r:c})},f=0;c>f;f++)e(f);return function(b){var e,g=a+"";for(f=0;c>f;f++)e=d[f],g=g.replace(e.s,e.r(b));return g}}}},f.defaults.templates.ejs=function(){return window.EJS?{compile:function(a){var b=new window.EJS({text:a});return function(a){return b.render(a)}}}:!1},f.defaults.templates.handlebars=function(){return window.Handlebars},f.defaults.templates.hogan=function(){return window.Hogan?{compile:function(a){var b=window.Hogan.compile(a);return function(a){return b.render(a)}}}:!1},f.defaults.templates.markup=function(){return window.Mark&&window.Mark.up?{compile:function(a){return function(b){return window.Mark.up(a,b)}}}:!1},f.defaults.templates.mustache=function(){return window.Mustache?{compile:function(a){return function(b){return window.Mustache.render(a,b)}}}:!1},f.defaults.templates.swig=function(){return window.swig},f.defaults.templates.underscore=function(){return window._?{compile:function(a){return function(b){return window._.template(a,b)}}}:!1},f.defaults.theme="html",f.defaults.template="default",f.defaults.options={},f.defaults.translate=function(a,b){var c=f.defaults.languages[f.defaults.language];if(!c)throw"Unknown language "+f.defaults.language;var d=c[a]||f.defaults.languages[f.defaults.default_language][a];if("undefined"==typeof d)throw"Unknown translate string "+a;if(b)for(var e=0;e<b.length;e++)d=d.replace(new RegExp("\\{\\{"+e+"}}","g"),b[e]);return d},f.defaults.default_language="en",f.defaults.language=f.defaults.default_language,f.defaults.languages.en={error_notset:"Property must be set",error_notempty:"Value required",error_enum:"Value must be one of the enumerated values",error_anyOf:"Value must validate against at least one of the provided schemas",error_oneOf:"Value must validate against exactly one of the provided schemas. It currently validates against {{0}} of the schemas.",error_not:"Value must not validate against the provided schema",error_type_union:"Value must be one of the provided types",error_type:"Value must be of type {{0}}",error_disallow_union:"Value must not be one of the provided disallowed types",error_disallow:"Value must not be of type {{0}}",error_multipleOf:"Value must be a multiple of {{0}}",error_maximum_excl:"Value must be less than {{0}}",error_maximum_incl:"Value must at most {{0}}",error_minimum_excl:"Value must be greater than {{0}}",error_minimum_incl:"Value must be at least {{0}}",error_maxLength:"Value must be at most {{0}} characters long",error_minLength:"Value must be at least {{0}} characters long",error_pattern:"Value must match the provided pattern",error_additionalItems:"No additional items allowed in this array",error_maxItems:"Value must have at most {{0}} items",error_minItems:"Value must have at least {{0}} items",error_uniqueItems:"Array must have unique items",error_maxProperties:"Object must have at most {{0}} properties",error_minProperties:"Object must have at least {{0}} properties",error_required:"Object is missing the required property '{{0}}'",error_additional_properties:"No additional properties allowed, but property {{0}} is set",error_dependency:"Must have property {{0}}"},f.plugins={ace:{theme:""},epiceditor:{},sceditor:{},select2:{}};for(var h in f.defaults.editors)f.defaults.editors.hasOwnProperty(h)&&(f.defaults.editors[h].options=f.defaults.editors.options||{});f.defaults.resolvers.unshift(function(a){return"string"!=typeof a.type?"multiple":void 0}),f.defaults.resolvers.unshift(function(a){return!a.type&&a.properties?"object":void 0}),f.defaults.resolvers.unshift(function(a){return"string"==typeof a.type?a.type:void 0}),f.defaults.resolvers.unshift(function(a){return"boolean"===a.type?"checkbox"===a.format||a.options&&a.options.checkbox?"checkbox":"select":void 0;
+}),f.defaults.resolvers.unshift(function(a){return"any"===a.type?"multiple":void 0}),f.defaults.resolvers.unshift(function(a){return"string"===a.type&&a.media&&"base64"===a.media.binaryEncoding?"base64":void 0}),f.defaults.resolvers.unshift(function(a){return"string"===a.type&&"url"===a.format&&a.options&&a.options.upload===!0&&window.FileReader?"upload":void 0}),f.defaults.resolvers.unshift(function(a){return"array"==a.type&&"table"==a.format?"table":void 0}),f.defaults.resolvers.unshift(function(a){return a.enumSource?"select":void 0}),f.defaults.resolvers.unshift(function(a){if(a["enum"]){if("array"===a.type||"object"===a.type)return"enum";if("number"===a.type||"integer"===a.type||"string"===a.type)return"select"}}),f.defaults.resolvers.unshift(function(a){return"array"===a.type&&a.items&&!Array.isArray(a.items)&&a.uniqueItems&&a.items["enum"]&&["string","number","integer"].indexOf(a.items.type)>=0?"multiselect":void 0}),f.defaults.resolvers.unshift(function(a){return a.oneOf?"multiple":void 0}),function(){if(window.jQuery||window.Zepto){var a=window.jQuery||window.Zepto;a.jsoneditor=f.defaults,a.fn.jsoneditor=function(a){var b=this,c=this.data("jsoneditor");if("value"===a){if(!c)throw"Must initialize jsoneditor before getting/setting the value";if(!(arguments.length>1))return c.getValue();c.setValue(arguments[1])}else{if("validate"===a){if(!c)throw"Must initialize jsoneditor before validating";return arguments.length>1?c.validate(arguments[1]):c.validate()}"destroy"===a?c&&(c.destroy(),this.data("jsoneditor",null)):(c&&c.destroy(),c=new f(this.get(0),a),this.data("jsoneditor",c),c.on("change",function(){b.trigger("change")}),c.on("ready",function(){b.trigger("ready")}))}return this}}}(),window.JSONEditor=f}(); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/lodash.min.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/lodash.min.js
new file mode 100644
index 0000000..05870d1
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/lodash.min.js
@@ -0,0 +1,102 @@
+/**
+ * @license
+ * lodash 3.10.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
+ * Build: `lodash compat -o ./lodash.js`
+ */
+;(function(){function n(n,t){if(n!==t){var r=null===n,e=n===w,u=n===n,o=null===t,i=t===w,f=t===t;if(n>t&&!o||!u||r&&!i&&f||e&&f)return 1;if(n<t&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function t(n,t,r){for(var e=n.length,u=r?e:-1;r?u--:++u<e;)if(t(n[u],u,n))return u;return-1}function r(n,t,r){if(t!==t)return p(n,r);r-=1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function e(n){return typeof n=="function"||false}function u(n){return null==n?"":n+""}function o(n,t){for(var r=-1,e=n.length;++r<e&&-1<t.indexOf(n.charAt(r)););
+return r}function i(n,t){for(var r=n.length;r--&&-1<t.indexOf(n.charAt(r)););return r}function f(t,r){return n(t.a,r.a)||t.b-r.b}function a(n){return Nn[n]}function c(n){return Tn[n]}function l(n,t,r){return t?n=Bn[n]:r&&(n=Dn[n]),"\\"+n}function s(n){return"\\"+Dn[n]}function p(n,t,r){var e=n.length;for(t+=r?0:-1;r?t--:++t<e;){var u=n[t];if(u!==u)return t}return-1}function h(n){return!!n&&typeof n=="object"}function _(n){return 160>=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n);
+}function v(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;)n[r]===t&&(n[r]=P,o[++u]=r);return o}function g(n){for(var t=-1,r=n.length;++t<r&&_(n.charCodeAt(t)););return t}function y(n){for(var t=n.length;t--&&_(n.charCodeAt(t)););return t}function d(n){return Pn[n]}function m(_){function Nn(n){if(h(n)&&!(Wo(n)||n instanceof zn)){if(n instanceof Pn)return n;if(eu.call(n,"__chain__")&&eu.call(n,"__wrapped__"))return qr(n)}return new Pn(n)}function Tn(){}function Pn(n,t,r){this.__wrapped__=n,this.__actions__=r||[],
+this.__chain__=!!t}function zn(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=Cu,this.__views__=[]}function Bn(){this.__data__={}}function Dn(n){var t=n?n.length:0;for(this.data={hash:mu(null),set:new hu};t--;)this.push(n[t])}function Mn(n,t){var r=n.data;return(typeof t=="string"||de(t)?r.set.has(t):r.hash[t])?0:-1}function qn(n,t){var r=-1,e=n.length;for(t||(t=De(e));++r<e;)t[r]=n[r];return t}function Kn(n,t){for(var r=-1,e=n.length;++r<e&&false!==t(n[r],r,n););
+return n}function Vn(n,t){for(var r=-1,e=n.length;++r<e;)if(!t(n[r],r,n))return false;return true}function Zn(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;){var i=n[r];t(i,r,n)&&(o[++u]=i)}return o}function Xn(n,t){for(var r=-1,e=n.length,u=De(e);++r<e;)u[r]=t(n[r],r,n);return u}function Hn(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function Qn(n,t,r,e){var u=-1,o=n.length;for(e&&o&&(r=n[++u]);++u<o;)r=t(r,n[u],u,n);return r}function nt(n,t){for(var r=-1,e=n.length;++r<e;)if(t(n[r],r,n))return true;
+return false}function tt(n,t,r,e){return n!==w&&eu.call(e,r)?n:t}function rt(n,t,r){for(var e=-1,u=Ko(t),o=u.length;++e<o;){var i=u[e],f=n[i],a=r(f,t[i],i,n,t);(a===a?a===f:f!==f)&&(f!==w||i in n)||(n[i]=a)}return n}function et(n,t){return null==t?n:ot(t,Ko(t),n)}function ut(n,t){for(var r=-1,e=null==n,u=!e&&Sr(n),o=u?n.length:0,i=t.length,f=De(i);++r<i;){var a=t[r];f[r]=u?Ur(a,o)?n[a]:w:e?w:n[a]}return f}function ot(n,t,r){r||(r={});for(var e=-1,u=t.length;++e<u;){var o=t[e];r[o]=n[o]}return r}function it(n,t,r){
+var e=typeof n;return"function"==e?t===w?n:Dt(n,t,r):null==n?Ne:"object"==e?At(n):t===w?Be(n):jt(n,t)}function ft(n,t,r,e,u,o,i){var f;if(r&&(f=u?r(n,e,u):r(n)),f!==w)return f;if(!de(n))return n;if(e=Wo(n)){if(f=Ir(n),!t)return qn(n,f)}else{var a=ou.call(n),c=a==K;if(a!=Z&&a!=z&&(!c||u))return Ln[a]?Er(n,a,t):u?n:{};if(Gn(n))return u?n:{};if(f=Rr(c?{}:n),!t)return et(f,n)}for(o||(o=[]),i||(i=[]),u=o.length;u--;)if(o[u]==n)return i[u];return o.push(n),i.push(f),(e?Kn:gt)(n,function(e,u){f[u]=ft(e,t,r,u,n,o,i);
+}),f}function at(n,t,r){if(typeof n!="function")throw new Xe(T);return _u(function(){n.apply(w,r)},t)}function ct(n,t){var e=n?n.length:0,u=[];if(!e)return u;var o=-1,i=jr(),f=i===r,a=f&&t.length>=F&&mu&&hu?new Dn(t):null,c=t.length;a&&(i=Mn,f=false,t=a);n:for(;++o<e;)if(a=n[o],f&&a===a){for(var l=c;l--;)if(t[l]===a)continue n;u.push(a)}else 0>i(t,a,0)&&u.push(a);return u}function lt(n,t){var r=true;return zu(n,function(n,e,u){return r=!!t(n,e,u)}),r}function st(n,t,r,e){var u=e,o=u;return zu(n,function(n,i,f){
+i=+t(n,i,f),(r(i,u)||i===e&&i===o)&&(u=i,o=n)}),o}function pt(n,t){var r=[];return zu(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function ht(n,t,r,e){var u;return r(n,function(n,r,o){return t(n,r,o)?(u=e?r:n,false):void 0}),u}function _t(n,t,r,e){e||(e=[]);for(var u=-1,o=n.length;++u<o;){var i=n[u];h(i)&&Sr(i)&&(r||Wo(i)||_e(i))?t?_t(i,t,r,e):Hn(e,i):r||(e[e.length]=i)}return e}function vt(n,t){return Du(n,t,Ee)}function gt(n,t){return Du(n,t,Ko)}function yt(n,t){return Mu(n,t,Ko)}function dt(n,t){for(var r=-1,e=t.length,u=-1,o=[];++r<e;){
+var i=t[r];ye(n[i])&&(o[++u]=i)}return o}function mt(n,t,r){if(null!=n){n=Dr(n),r!==w&&r in n&&(t=[r]),r=0;for(var e=t.length;null!=n&&r<e;)n=Dr(n)[t[r++]];return r&&r==e?n:w}}function wt(n,t,r,e,u,o){if(n===t)return true;if(null==n||null==t||!de(n)&&!h(t))return n!==n&&t!==t;n:{var i=wt,f=Wo(n),a=Wo(t),c=B,l=B;f||(c=ou.call(n),c==z?c=Z:c!=Z&&(f=je(n))),a||(l=ou.call(t),l==z?l=Z:l!=Z&&je(t));var s=c==Z&&!Gn(n),a=l==Z&&!Gn(t),l=c==l;if(!l||f||s){if(!e&&(c=s&&eu.call(n,"__wrapped__"),a=a&&eu.call(t,"__wrapped__"),
+c||a)){n=i(c?n.value():n,a?t.value():t,r,e,u,o);break n}if(l){for(u||(u=[]),o||(o=[]),c=u.length;c--;)if(u[c]==n){n=o[c]==t;break n}u.push(n),o.push(t),n=(f?mr:xr)(n,t,i,r,e,u,o),u.pop(),o.pop()}else n=false}else n=wr(n,t,c)}return n}function xt(n,t,r){var e=t.length,u=e,o=!r;if(null==n)return!u;for(n=Dr(n);e--;){var i=t[e];if(o&&i[2]?i[1]!==n[i[0]]:!(i[0]in n))return false}for(;++e<u;){var i=t[e],f=i[0],a=n[f],c=i[1];if(o&&i[2]){if(a===w&&!(f in n))return false}else if(i=r?r(a,c,f):w,i===w?!wt(c,a,r,true):!i)return false;
+}return true}function bt(n,t){var r=-1,e=Sr(n)?De(n.length):[];return zu(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function At(n){var t=kr(n);if(1==t.length&&t[0][2]){var r=t[0][0],e=t[0][1];return function(n){return null==n?false:(n=Dr(n),n[r]===e&&(e!==w||r in n))}}return function(n){return xt(n,t)}}function jt(n,t){var r=Wo(n),e=Wr(n)&&t===t&&!de(t),u=n+"";return n=Mr(n),function(o){if(null==o)return false;var i=u;if(o=Dr(o),!(!r&&e||i in o)){if(o=1==n.length?o:mt(o,St(n,0,-1)),null==o)return false;i=Gr(n),o=Dr(o);
+}return o[i]===t?t!==w||i in o:wt(t,o[i],w,true)}}function kt(n,t,r,e,u){if(!de(n))return n;var o=Sr(t)&&(Wo(t)||je(t)),i=o?w:Ko(t);return Kn(i||t,function(f,a){if(i&&(a=f,f=t[a]),h(f)){e||(e=[]),u||(u=[]);n:{for(var c=a,l=e,s=u,p=l.length,_=t[c];p--;)if(l[p]==_){n[c]=s[p];break n}var p=n[c],v=r?r(p,_,c,n,t):w,g=v===w;g&&(v=_,Sr(_)&&(Wo(_)||je(_))?v=Wo(p)?p:Sr(p)?qn(p):[]:xe(_)||_e(_)?v=_e(p)?Ie(p):xe(p)?p:{}:g=false),l.push(_),s.push(v),g?n[c]=kt(v,_,r,l,s):(v===v?v!==p:p===p)&&(n[c]=v)}}else c=n[a],
+l=r?r(c,f,a,n,t):w,(s=l===w)&&(l=f),l===w&&(!o||a in n)||!s&&(l===l?l===c:c!==c)||(n[a]=l)}),n}function Ot(n){return function(t){return null==t?w:Dr(t)[n]}}function It(n){var t=n+"";return n=Mr(n),function(r){return mt(r,n,t)}}function Rt(n,t){for(var r=n?t.length:0;r--;){var e=t[r];if(e!=u&&Ur(e)){var u=e;vu.call(n,e,1)}}return n}function Et(n,t){return n+wu(Ru()*(t-n+1))}function Ct(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function St(n,t,r){var e=-1,u=n.length;for(t=null==t?0:+t||0,
+0>t&&(t=-t>u?0:u+t),r=r===w||r>u?u:+r||0,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=De(u);++e<u;)r[e]=n[e+t];return r}function Ut(n,t){var r;return zu(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function $t(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].c;return n}function Wt(t,r,e){var u=br(),o=-1;return r=Xn(r,function(n){return u(n)}),t=bt(t,function(n){return{a:Xn(r,function(t){return t(n)}),b:++o,c:n}}),$t(t,function(t,r){var u;n:{for(var o=-1,i=t.a,f=r.a,a=i.length,c=e.length;++o<a;)if(u=n(i[o],f[o])){
+if(o>=c)break n;o=e[o],u*="asc"===o||true===o?1:-1;break n}u=t.b-r.b}return u})}function Ft(n,t){var r=0;return zu(n,function(n,e,u){r+=+t(n,e,u)||0}),r}function Lt(n,t){var e=-1,u=jr(),o=n.length,i=u===r,f=i&&o>=F,a=f&&mu&&hu?new Dn(void 0):null,c=[];a?(u=Mn,i=false):(f=false,a=t?[]:c);n:for(;++e<o;){var l=n[e],s=t?t(l,e,n):l;if(i&&l===l){for(var p=a.length;p--;)if(a[p]===s)continue n;t&&a.push(s),c.push(l)}else 0>u(a,s,0)&&((t||f)&&a.push(s),c.push(l))}return c}function Nt(n,t){for(var r=-1,e=t.length,u=De(e);++r<e;)u[r]=n[t[r]];
+return u}function Tt(n,t,r,e){for(var u=n.length,o=e?u:-1;(e?o--:++o<u)&&t(n[o],o,n););return r?St(n,e?0:o,e?o+1:u):St(n,e?o+1:0,e?u:o)}function Pt(n,t){var r=n;r instanceof zn&&(r=r.value());for(var e=-1,u=t.length;++e<u;)var o=t[e],r=o.func.apply(o.thisArg,Hn([r],o.args));return r}function zt(n,t,r){var e=0,u=n?n.length:e;if(typeof t=="number"&&t===t&&u<=Uu){for(;e<u;){var o=e+u>>>1,i=n[o];(r?i<=t:i<t)&&null!==i?e=o+1:u=o}return u}return Bt(n,t,Ne,r)}function Bt(n,t,r,e){t=r(t);for(var u=0,o=n?n.length:0,i=t!==t,f=null===t,a=t===w;u<o;){
+var c=wu((u+o)/2),l=r(n[c]),s=l!==w,p=l===l;(i?p||e:f?p&&s&&(e||null!=l):a?p&&(e||s):null==l?0:e?l<=t:l<t)?u=c+1:o=c}return ku(o,Su)}function Dt(n,t,r){if(typeof n!="function")return Ne;if(t===w)return n;switch(r){case 1:return function(r){return n.call(t,r)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,o){return n.call(t,r,e,u,o)};case 5:return function(r,e,u,o,i){return n.call(t,r,e,u,o,i)}}return function(){return n.apply(t,arguments)}}function Mt(n){var t=new au(n.byteLength);
+return new gu(t).set(new gu(n)),t}function qt(n,t,r){for(var e=r.length,u=-1,o=ju(n.length-e,0),i=-1,f=t.length,a=De(f+o);++i<f;)a[i]=t[i];for(;++u<e;)a[r[u]]=n[u];for(;o--;)a[i++]=n[u++];return a}function Kt(n,t,r){for(var e=-1,u=r.length,o=-1,i=ju(n.length-u,0),f=-1,a=t.length,c=De(i+a);++o<i;)c[o]=n[o];for(i=o;++f<a;)c[i+f]=t[f];for(;++e<u;)c[i+r[e]]=n[o++];return c}function Vt(n,t){return function(r,e,u){var o=t?t():{};if(e=br(e,u,3),Wo(r)){u=-1;for(var i=r.length;++u<i;){var f=r[u];n(o,f,e(f,u,r),r);
+}}else zu(r,function(t,r,u){n(o,t,e(t,r,u),u)});return o}}function Zt(n){return pe(function(t,r){var e=-1,u=null==t?0:r.length,o=2<u?r[u-2]:w,i=2<u?r[2]:w,f=1<u?r[u-1]:w;for(typeof o=="function"?(o=Dt(o,f,5),u-=2):(o=typeof f=="function"?f:w,u-=o?1:0),i&&$r(r[0],r[1],i)&&(o=3>u?w:o,u=1);++e<u;)(i=r[e])&&n(t,i,o);return t})}function Yt(n,t){return function(r,e){var u=r?Vu(r):0;if(!Lr(u))return n(r,e);for(var o=t?u:-1,i=Dr(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}function Gt(n){return function(t,r,e){
+var u=Dr(t);e=e(t);for(var o=e.length,i=n?o:-1;n?i--:++i<o;){var f=e[i];if(false===r(u[f],f,u))break}return t}}function Jt(n,t){function r(){return(this&&this!==Yn&&this instanceof r?e:n).apply(t,arguments)}var e=Ht(n);return r}function Xt(n){return function(t){var r=-1;t=Fe(Ue(t));for(var e=t.length,u="";++r<e;)u=n(u,t[r],r);return u}}function Ht(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);
+case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Pu(n.prototype),t=n.apply(r,t);return de(t)?t:r}}function Qt(n){function t(r,e,u){return u&&$r(r,e,u)&&(e=w),r=dr(r,n,w,w,w,w,w,e),r.placeholder=t.placeholder,r}return t}function nr(n,t){return pe(function(r){var e=r[0];return null==e?e:(r.push(t),n.apply(w,r))})}function tr(n,t){return function(r,e,u){
+if(u&&$r(r,e,u)&&(e=w),e=br(e,u,3),1==e.length){u=r=Wo(r)?r:Br(r);for(var o=e,i=-1,f=u.length,a=t,c=a;++i<f;){var l=u[i],s=+o(l);n(s,a)&&(a=s,c=l)}if(u=c,!r.length||u!==t)return u}return st(r,e,n,t)}}function rr(n,r){return function(e,u,o){return u=br(u,o,3),Wo(e)?(u=t(e,u,r),-1<u?e[u]:w):ht(e,u,n)}}function er(n){return function(r,e,u){return r&&r.length?(e=br(e,u,3),t(r,e,n)):-1}}function ur(n){return function(t,r,e){return r=br(r,e,3),ht(t,r,n,true)}}function or(n){return function(){for(var t,r=arguments.length,e=n?r:-1,u=0,o=De(r);n?e--:++e<r;){
+var i=o[u++]=arguments[e];if(typeof i!="function")throw new Xe(T);!t&&Pn.prototype.thru&&"wrapper"==Ar(i)&&(t=new Pn([],true))}for(e=t?-1:r;++e<r;){var i=o[e],u=Ar(i),f="wrapper"==u?Ku(i):w;t=f&&Fr(f[0])&&f[1]==(E|k|I|C)&&!f[4].length&&1==f[9]?t[Ar(f[0])].apply(t,f[3]):1==i.length&&Fr(i)?t[u]():t.thru(i)}return function(){var n=arguments,e=n[0];if(t&&1==n.length&&Wo(e)&&e.length>=F)return t.plant(e).value();for(var u=0,n=r?o[u].apply(this,n):e;++u<r;)n=o[u].call(this,n);return n}}}function ir(n,t){
+return function(r,e,u){return typeof e=="function"&&u===w&&Wo(r)?n(r,e):t(r,Dt(e,u,3))}}function fr(n){return function(t,r,e){return(typeof r!="function"||e!==w)&&(r=Dt(r,e,3)),n(t,r,Ee)}}function ar(n){return function(t,r,e){return(typeof r!="function"||e!==w)&&(r=Dt(r,e,3)),n(t,r)}}function cr(n){return function(t,r,e){var u={};return r=br(r,e,3),gt(t,function(t,e,o){o=r(t,e,o),e=n?o:e,t=n?t:o,u[e]=t}),u}}function lr(n){return function(t,r,e){return t=u(t),(n?t:"")+_r(t,r,e)+(n?"":t)}}function sr(n){
+var t=pe(function(r,e){var u=v(e,t.placeholder);return dr(r,n,w,e,u)});return t}function pr(n,t){return function(r,e,u,o){var i=3>arguments.length;return typeof e=="function"&&o===w&&Wo(r)?n(r,e,u,i):Ct(r,br(e,o,4),u,i,t)}}function hr(n,t,r,e,u,o,i,f,a,c){function l(){for(var m=arguments.length,x=m,j=De(m);x--;)j[x]=arguments[x];if(e&&(j=qt(j,e,u)),o&&(j=Kt(j,o,i)),_||y){var x=l.placeholder,k=v(j,x),m=m-k.length;if(m<c){var O=f?qn(f):w,m=ju(c-m,0),E=_?k:w,k=_?w:k,C=_?j:w,j=_?w:j;return t|=_?I:R,t&=~(_?R:I),
+g||(t&=~(b|A)),j=[n,t,r,C,E,j,k,O,a,m],O=hr.apply(w,j),Fr(n)&&Zu(O,j),O.placeholder=x,O}}if(x=p?r:this,O=h?x[n]:n,f)for(m=j.length,E=ku(f.length,m),k=qn(j);E--;)C=f[E],j[E]=Ur(C,m)?k[C]:w;return s&&a<j.length&&(j.length=a),this&&this!==Yn&&this instanceof l&&(O=d||Ht(n)),O.apply(x,j)}var s=t&E,p=t&b,h=t&A,_=t&k,g=t&j,y=t&O,d=h?w:Ht(n);return l}function _r(n,t,r){return n=n.length,t=+t,n<t&&bu(t)?(t-=n,r=null==r?" ":r+"",$e(r,du(t/r.length)).slice(0,t)):""}function vr(n,t,r,e){function u(){for(var t=-1,f=arguments.length,a=-1,c=e.length,l=De(c+f);++a<c;)l[a]=e[a];
+for(;f--;)l[a++]=arguments[++t];return(this&&this!==Yn&&this instanceof u?i:n).apply(o?r:this,l)}var o=t&b,i=Ht(n);return u}function gr(n){var t=Ve[n];return function(n,r){return(r=r===w?0:+r||0)?(r=su(10,r),t(n*r)/r):t(n)}}function yr(n){return function(t,r,e,u){var o=br(e);return null==e&&o===it?zt(t,r,n):Bt(t,r,o(e,u,1),n)}}function dr(n,t,r,e,u,o,i,f){var a=t&A;if(!a&&typeof n!="function")throw new Xe(T);var c=e?e.length:0;if(c||(t&=~(I|R),e=u=w),c-=u?u.length:0,t&R){var l=e,s=u;e=u=w}var p=a?w:Ku(n);
+return r=[n,t,r,e,u,l,s,o,i,f],p&&(e=r[1],t=p[1],f=e|t,u=t==E&&e==k||t==E&&e==C&&r[7].length<=p[8]||t==(E|C)&&e==k,(f<E||u)&&(t&b&&(r[2]=p[2],f|=e&b?0:j),(e=p[3])&&(u=r[3],r[3]=u?qt(u,e,p[4]):qn(e),r[4]=u?v(r[3],P):qn(p[4])),(e=p[5])&&(u=r[5],r[5]=u?Kt(u,e,p[6]):qn(e),r[6]=u?v(r[5],P):qn(p[6])),(e=p[7])&&(r[7]=qn(e)),t&E&&(r[8]=null==r[8]?p[8]:ku(r[8],p[8])),null==r[9]&&(r[9]=p[9]),r[0]=p[0],r[1]=f),t=r[1],f=r[9]),r[9]=null==f?a?0:n.length:ju(f-c,0)||0,n=t==b?Jt(r[0],r[2]):t!=I&&t!=(b|I)||r[4].length?hr.apply(w,r):vr.apply(w,r),
+(p?qu:Zu)(n,r)}function mr(n,t,r,e,u,o,i){var f=-1,a=n.length,c=t.length;if(a!=c&&(!u||c<=a))return false;for(;++f<a;){var l=n[f],c=t[f],s=e?e(u?c:l,u?l:c,f):w;if(s!==w){if(s)continue;return false}if(u){if(!nt(t,function(n){return l===n||r(l,n,e,u,o,i)}))return false}else if(l!==c&&!r(l,c,e,u,o,i))return false}return true}function wr(n,t,r){switch(r){case D:case M:return+n==+t;case q:return n.name==t.name&&n.message==t.message;case V:return n!=+n?t!=+t:n==+t;case Y:case G:return n==t+""}return false}function xr(n,t,r,e,u,o,i){
+var f=Ko(n),a=f.length,c=Ko(t).length;if(a!=c&&!u)return false;for(c=a;c--;){var l=f[c];if(!(u?l in t:eu.call(t,l)))return false}for(var s=u;++c<a;){var l=f[c],p=n[l],h=t[l],_=e?e(u?h:p,u?p:h,l):w;if(_===w?!r(p,h,e,u,o,i):!_)return false;s||(s="constructor"==l)}return s||(r=n.constructor,e=t.constructor,!(r!=e&&"constructor"in n&&"constructor"in t)||typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)?true:false}function br(n,t,r){var e=Nn.callback||Le,e=e===Le?it:e;return r?e(n,t,r):e}function Ar(n){
+for(var t=n.name+"",r=Fu[t],e=r?r.length:0;e--;){var u=r[e],o=u.func;if(null==o||o==n)return u.name}return t}function jr(n,t,e){var u=Nn.indexOf||Yr,u=u===Yr?r:u;return n?u(n,t,e):u}function kr(n){n=Ce(n);for(var t=n.length;t--;){var r,e=n[t];r=n[t][1],r=r===r&&!de(r),e[2]=r}return n}function Or(n,t){var r=null==n?w:n[t];return me(r)?r:w}function Ir(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&eu.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Rr(n){return n=n.constructor,
+typeof n=="function"&&n instanceof n||(n=Ye),new n}function Er(n,t,r){var e=n.constructor;switch(t){case J:return Mt(n);case D:case M:return new e(+n);case X:case H:case Q:case nn:case tn:case rn:case en:case un:case on:return e instanceof e&&(e=Lu[t]),t=n.buffer,new e(r?Mt(t):t,n.byteOffset,n.length);case V:case G:return new e(n);case Y:var u=new e(n.source,kn.exec(n));u.lastIndex=n.lastIndex}return u}function Cr(n,t,r){return null==n||Wr(t,n)||(t=Mr(t),n=1==t.length?n:mt(n,St(t,0,-1)),t=Gr(t)),
+t=null==n?n:n[t],null==t?w:t.apply(n,r)}function Sr(n){return null!=n&&Lr(Vu(n))}function Ur(n,t){return n=typeof n=="number"||Rn.test(n)?+n:-1,t=null==t?$u:t,-1<n&&0==n%1&&n<t}function $r(n,t,r){if(!de(r))return false;var e=typeof t;return("number"==e?Sr(r)&&Ur(t,r.length):"string"==e&&t in r)?(t=r[t],n===n?n===t:t!==t):false}function Wr(n,t){var r=typeof n;return"string"==r&&dn.test(n)||"number"==r?true:Wo(n)?false:!yn.test(n)||null!=t&&n in Dr(t)}function Fr(n){var t=Ar(n),r=Nn[t];return typeof r=="function"&&t in zn.prototype?n===r?true:(t=Ku(r),
+!!t&&n===t[0]):false}function Lr(n){return typeof n=="number"&&-1<n&&0==n%1&&n<=$u}function Nr(n,t){return n===w?t:Fo(n,t,Nr)}function Tr(n,t){n=Dr(n);for(var r=-1,e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u}function Pr(n,t){var r={};return vt(n,function(n,e,u){t(n,e,u)&&(r[e]=n)}),r}function zr(n){for(var t=Ee(n),r=t.length,e=r&&n.length,u=!!e&&Lr(e)&&(Wo(n)||_e(n)||Ae(n)),o=-1,i=[];++o<r;){var f=t[o];(u&&Ur(f,e)||eu.call(n,f))&&i.push(f)}return i}function Br(n){return null==n?[]:Sr(n)?Nn.support.unindexedChars&&Ae(n)?n.split(""):de(n)?n:Ye(n):Se(n);
+}function Dr(n){if(Nn.support.unindexedChars&&Ae(n)){for(var t=-1,r=n.length,e=Ye(n);++t<r;)e[t]=n.charAt(t);return e}return de(n)?n:Ye(n)}function Mr(n){if(Wo(n))return n;var t=[];return u(n).replace(mn,function(n,r,e,u){t.push(e?u.replace(An,"$1"):r||n)}),t}function qr(n){return n instanceof zn?n.clone():new Pn(n.__wrapped__,n.__chain__,qn(n.__actions__))}function Kr(n,t,r){return n&&n.length?((r?$r(n,t,r):null==t)&&(t=1),St(n,0>t?0:t)):[]}function Vr(n,t,r){var e=n?n.length:0;return e?((r?$r(n,t,r):null==t)&&(t=1),
+t=e-(+t||0),St(n,0,0>t?0:t)):[]}function Zr(n){return n?n[0]:w}function Yr(n,t,e){var u=n?n.length:0;if(!u)return-1;if(typeof e=="number")e=0>e?ju(u+e,0):e;else if(e)return e=zt(n,t),e<u&&(t===t?t===n[e]:n[e]!==n[e])?e:-1;return r(n,t,e||0)}function Gr(n){var t=n?n.length:0;return t?n[t-1]:w}function Jr(n){return Kr(n,1)}function Xr(n,t,e,u){if(!n||!n.length)return[];null!=t&&typeof t!="boolean"&&(u=e,e=$r(n,t,u)?w:t,t=false);var o=br();if((null!=e||o!==it)&&(e=o(e,u,3)),t&&jr()===r){t=e;var i;e=-1,
+u=n.length;for(var o=-1,f=[];++e<u;){var a=n[e],c=t?t(a,e,n):a;e&&i===c||(i=c,f[++o]=a)}n=f}else n=Lt(n,e);return n}function Hr(n){if(!n||!n.length)return[];var t=-1,r=0;n=Zn(n,function(n){return Sr(n)?(r=ju(n.length,r),true):void 0});for(var e=De(r);++t<r;)e[t]=Xn(n,Ot(t));return e}function Qr(n,t,r){return n&&n.length?(n=Hr(n),null==t?n:(t=Dt(t,r,4),Xn(n,function(n){return Qn(n,t,w,true)}))):[]}function ne(n,t){var r=-1,e=n?n.length:0,u={};for(!e||t||Wo(n[0])||(t=[]);++r<e;){var o=n[r];t?u[o]=t[r]:o&&(u[o[0]]=o[1]);
+}return u}function te(n){return n=Nn(n),n.__chain__=true,n}function re(n,t,r){return t.call(r,n)}function ee(n,t,r){var e=Wo(n)?Vn:lt;return r&&$r(n,t,r)&&(t=w),(typeof t!="function"||r!==w)&&(t=br(t,r,3)),e(n,t)}function ue(n,t,r){var e=Wo(n)?Zn:pt;return t=br(t,r,3),e(n,t)}function oe(n,t,r,e){var u=n?Vu(n):0;return Lr(u)||(n=Se(n),u=n.length),r=typeof r!="number"||e&&$r(t,r,e)?0:0>r?ju(u+r,0):r||0,typeof n=="string"||!Wo(n)&&Ae(n)?r<=u&&-1<n.indexOf(t,r):!!u&&-1<jr(n,t,r)}function ie(n,t,r){var e=Wo(n)?Xn:bt;
+return t=br(t,r,3),e(n,t)}function fe(n,t,r){if(r?$r(n,t,r):null==t){n=Br(n);var e=n.length;return 0<e?n[Et(0,e-1)]:w}r=-1,n=Oe(n);var e=n.length,u=e-1;for(t=ku(0>t?0:+t||0,e);++r<t;){var e=Et(r,u),o=n[e];n[e]=n[r],n[r]=o}return n.length=t,n}function ae(n,t,r){var e=Wo(n)?nt:Ut;return r&&$r(n,t,r)&&(t=w),(typeof t!="function"||r!==w)&&(t=br(t,r,3)),e(n,t)}function ce(n,t){var r;if(typeof t!="function"){if(typeof n!="function")throw new Xe(T);var e=n;n=t,t=e}return function(){return 0<--n&&(r=t.apply(this,arguments)),
+1>=n&&(t=w),r}}function le(n,t,r){function e(t,r){r&&cu(r),a=p=h=w,t&&(_=wo(),c=n.apply(s,f),p||a||(f=s=w))}function u(){var n=t-(wo()-l);0>=n||n>t?e(h,a):p=_u(u,n)}function o(){e(g,p)}function i(){if(f=arguments,l=wo(),s=this,h=g&&(p||!y),false===v)var r=y&&!p;else{a||y||(_=l);var e=v-(l-_),i=0>=e||e>v;i?(a&&(a=cu(a)),_=l,c=n.apply(s,f)):a||(a=_u(o,e))}return i&&p?p=cu(p):p||t===v||(p=_u(u,t)),r&&(i=true,c=n.apply(s,f)),!i||p||a||(f=s=w),c}var f,a,c,l,s,p,h,_=0,v=false,g=true;if(typeof n!="function")throw new Xe(T);
+if(t=0>t?0:+t||0,true===r)var y=true,g=false;else de(r)&&(y=!!r.leading,v="maxWait"in r&&ju(+r.maxWait||0,t),g="trailing"in r?!!r.trailing:g);return i.cancel=function(){p&&cu(p),a&&cu(a),_=0,a=p=h=w},i}function se(n,t){if(typeof n!="function"||t&&typeof t!="function")throw new Xe(T);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=n.apply(this,e),r.cache=o.set(u,e),e)};return r.cache=new se.Cache,r}function pe(n,t){if(typeof n!="function")throw new Xe(T);return t=ju(t===w?n.length-1:+t||0,0),
+function(){for(var r=arguments,e=-1,u=ju(r.length-t,0),o=De(u);++e<u;)o[e]=r[t+e];switch(t){case 0:return n.call(this,o);case 1:return n.call(this,r[0],o);case 2:return n.call(this,r[0],r[1],o)}for(u=De(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function he(n,t){return n>t}function _e(n){return h(n)&&Sr(n)&&eu.call(n,"callee")&&!pu.call(n,"callee")}function ve(n,t,r,e){return e=(r=typeof r=="function"?Dt(r,e,3):w)?r(n,t):w,e===w?wt(n,t,r):!!e}function ge(n){return h(n)&&typeof n.message=="string"&&ou.call(n)==q;
+}function ye(n){return de(n)&&ou.call(n)==K}function de(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function me(n){return null==n?false:ye(n)?fu.test(ru.call(n)):h(n)&&(Gn(n)?fu:In).test(n)}function we(n){return typeof n=="number"||h(n)&&ou.call(n)==V}function xe(n){var t;if(!h(n)||ou.call(n)!=Z||Gn(n)||_e(n)||!(eu.call(n,"constructor")||(t=n.constructor,typeof t!="function"||t instanceof t)))return false;var r;return Nn.support.ownLast?(vt(n,function(n,t,e){return r=eu.call(e,t),false}),false!==r):(vt(n,function(n,t){
+r=t}),r===w||eu.call(n,r))}function be(n){return de(n)&&ou.call(n)==Y}function Ae(n){return typeof n=="string"||h(n)&&ou.call(n)==G}function je(n){return h(n)&&Lr(n.length)&&!!Fn[ou.call(n)]}function ke(n,t){return n<t}function Oe(n){var t=n?Vu(n):0;return Lr(t)?t?Nn.support.unindexedChars&&Ae(n)?n.split(""):qn(n):[]:Se(n)}function Ie(n){return ot(n,Ee(n))}function Re(n){return dt(n,Ee(n))}function Ee(n){if(null==n)return[];de(n)||(n=Ye(n));for(var t=n.length,r=Nn.support,t=t&&Lr(t)&&(Wo(n)||_e(n)||Ae(n))&&t||0,e=n.constructor,u=-1,e=ye(e)&&e.prototype||nu,o=e===n,i=De(t),f=0<t,a=r.enumErrorProps&&(n===Qe||n instanceof qe),c=r.enumPrototypes&&ye(n);++u<t;)i[u]=u+"";
+for(var l in n)c&&"prototype"==l||a&&("message"==l||"name"==l)||f&&Ur(l,t)||"constructor"==l&&(o||!eu.call(n,l))||i.push(l);if(r.nonEnumShadows&&n!==nu)for(t=n===tu?G:n===Qe?q:ou.call(n),r=Nu[t]||Nu[Z],t==Z&&(e=nu),t=Wn.length;t--;)l=Wn[t],u=r[l],o&&u||(u?!eu.call(n,l):n[l]===e[l])||i.push(l);return i}function Ce(n){n=Dr(n);for(var t=-1,r=Ko(n),e=r.length,u=De(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u}function Se(n){return Nt(n,Ko(n))}function Ue(n){return(n=u(n))&&n.replace(En,a).replace(bn,"");
+}function $e(n,t){var r="";if(n=u(n),t=+t,1>t||!n||!bu(t))return r;do t%2&&(r+=n),t=wu(t/2),n+=n;while(t);return r}function We(n,t,r){var e=n;return(n=u(n))?(r?$r(e,t,r):null==t)?n.slice(g(n),y(n)+1):(t+="",n.slice(o(n,t),i(n,t)+1)):n}function Fe(n,t,r){return r&&$r(n,t,r)&&(t=w),n=u(n),n.match(t||Un)||[]}function Le(n,t,r){return r&&$r(n,t,r)&&(t=w),h(n)?Te(n):it(n,t)}function Ne(n){return n}function Te(n){return At(ft(n,true))}function Pe(n,t,r){if(null==r){var e=de(t),u=e?Ko(t):w;((u=u&&u.length?dt(t,u):w)?u.length:e)||(u=false,
+r=t,t=n,n=this)}u||(u=dt(t,Ko(t)));var o=true,e=-1,i=ye(n),f=u.length;false===r?o=false:de(r)&&"chain"in r&&(o=r.chain);for(;++e<f;){r=u[e];var a=t[r];n[r]=a,i&&(n.prototype[r]=function(t){return function(){var r=this.__chain__;if(o||r){var e=n(this.__wrapped__);return(e.__actions__=qn(this.__actions__)).push({func:t,args:arguments,thisArg:n}),e.__chain__=r,e}return t.apply(n,Hn([this.value()],arguments))}}(a))}return n}function ze(){}function Be(n){return Wr(n)?Ot(n):It(n)}_=_?Jn.defaults(Yn.Object(),_,Jn.pick(Yn,$n)):Yn;
+var De=_.Array,Me=_.Date,qe=_.Error,Ke=_.Function,Ve=_.Math,Ze=_.Number,Ye=_.Object,Ge=_.RegExp,Je=_.String,Xe=_.TypeError,He=De.prototype,Qe=qe.prototype,nu=Ye.prototype,tu=Je.prototype,ru=Ke.prototype.toString,eu=nu.hasOwnProperty,uu=0,ou=nu.toString,iu=Yn._,fu=Ge("^"+ru.call(eu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),au=_.ArrayBuffer,cu=_.clearTimeout,lu=_.parseFloat,su=Ve.pow,pu=nu.propertyIsEnumerable,hu=Or(_,"Set"),_u=_.setTimeout,vu=He.splice,gu=_.Uint8Array,yu=Or(_,"WeakMap"),du=Ve.ceil,mu=Or(Ye,"create"),wu=Ve.floor,xu=Or(De,"isArray"),bu=_.isFinite,Au=Or(Ye,"keys"),ju=Ve.max,ku=Ve.min,Ou=Or(Me,"now"),Iu=_.parseInt,Ru=Ve.random,Eu=Ze.NEGATIVE_INFINITY,Cu=Ze.POSITIVE_INFINITY,Su=4294967294,Uu=2147483647,$u=9007199254740991,Wu=yu&&new yu,Fu={},Lu={};
+Lu[X]=_.Float32Array,Lu[H]=_.Float64Array,Lu[Q]=_.Int8Array,Lu[nn]=_.Int16Array,Lu[tn]=_.Int32Array,Lu[rn]=gu,Lu[en]=_.Uint8ClampedArray,Lu[un]=_.Uint16Array,Lu[on]=_.Uint32Array;var Nu={};Nu[B]=Nu[M]=Nu[V]={constructor:true,toLocaleString:true,toString:true,valueOf:true},Nu[D]=Nu[G]={constructor:true,toString:true,valueOf:true},Nu[q]=Nu[K]=Nu[Y]={constructor:true,toString:true},Nu[Z]={constructor:true},Kn(Wn,function(n){for(var t in Nu)if(eu.call(Nu,t)){var r=Nu[t];r[n]=eu.call(r,n)}});var Tu=Nn.support={};!function(n){
+var t=function(){this.x=n},r={0:n,length:n},e=[];t.prototype={valueOf:n,y:n};for(var u in new t)e.push(u);Tu.enumErrorProps=pu.call(Qe,"message")||pu.call(Qe,"name"),Tu.enumPrototypes=pu.call(t,"prototype"),Tu.nonEnumShadows=!/valueOf/.test(e),Tu.ownLast="x"!=e[0],Tu.spliceObjects=(vu.call(r,0,1),!r[0]),Tu.unindexedChars="xx"!="x"[0]+Ye("x")[0]}(1,0),Nn.templateSettings={escape:_n,evaluate:vn,interpolate:gn,variable:"",imports:{_:Nn}};var Pu=function(){function n(){}return function(t){if(de(t)){n.prototype=t;
+var r=new n;n.prototype=w}return r||{}}}(),zu=Yt(gt),Bu=Yt(yt,true),Du=Gt(),Mu=Gt(true),qu=Wu?function(n,t){return Wu.set(n,t),n}:Ne,Ku=Wu?function(n){return Wu.get(n)}:ze,Vu=Ot("length"),Zu=function(){var n=0,t=0;return function(r,e){var u=wo(),o=W-(u-t);if(t=u,0<o){if(++n>=$)return r}else n=0;return qu(r,e)}}(),Yu=pe(function(n,t){return h(n)&&Sr(n)?ct(n,_t(t,false,true)):[]}),Gu=er(),Ju=er(true),Xu=pe(function(n){for(var t=n.length,e=t,u=De(l),o=jr(),i=o===r,f=[];e--;){var a=n[e]=Sr(a=n[e])?a:[];u[e]=i&&120<=a.length&&mu&&hu?new Dn(e&&a):null;
+}var i=n[0],c=-1,l=i?i.length:0,s=u[0];n:for(;++c<l;)if(a=i[c],0>(s?Mn(s,a):o(f,a,0))){for(e=t;--e;){var p=u[e];if(0>(p?Mn(p,a):o(n[e],a,0)))continue n}s&&s.push(a),f.push(a)}return f}),Hu=pe(function(t,r){r=_t(r);var e=ut(t,r);return Rt(t,r.sort(n)),e}),Qu=yr(),no=yr(true),to=pe(function(n){return Lt(_t(n,false,true))}),ro=pe(function(n,t){return Sr(n)?ct(n,t):[]}),eo=pe(Hr),uo=pe(function(n){var t=n.length,r=2<t?n[t-2]:w,e=1<t?n[t-1]:w;return 2<t&&typeof r=="function"?t-=2:(r=1<t&&typeof e=="function"?(--t,
+e):w,e=w),n.length=t,Qr(n,r,e)}),oo=pe(function(n){return n=_t(n),this.thru(function(t){t=Wo(t)?t:[Dr(t)];for(var r=n,e=-1,u=t.length,o=-1,i=r.length,f=De(u+i);++e<u;)f[e]=t[e];for(;++o<i;)f[e++]=r[o];return f})}),io=pe(function(n,t){return Sr(n)&&(n=Br(n)),ut(n,_t(t))}),fo=Vt(function(n,t,r){eu.call(n,r)?++n[r]:n[r]=1}),ao=rr(zu),co=rr(Bu,true),lo=ir(Kn,zu),so=ir(function(n,t){for(var r=n.length;r--&&false!==t(n[r],r,n););return n},Bu),po=Vt(function(n,t,r){eu.call(n,r)?n[r].push(t):n[r]=[t]}),ho=Vt(function(n,t,r){
+n[r]=t}),_o=pe(function(n,t,r){var e=-1,u=typeof t=="function",o=Wr(t),i=Sr(n)?De(n.length):[];return zu(n,function(n){var f=u?t:o&&null!=n?n[t]:w;i[++e]=f?f.apply(n,r):Cr(n,t,r)}),i}),vo=Vt(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),go=pr(Qn,zu),yo=pr(function(n,t,r,e){var u=n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r},Bu),mo=pe(function(n,t){if(null==n)return[];var r=t[2];return r&&$r(t[0],t[1],r)&&(t.length=1),Wt(n,_t(t),[])}),wo=Ou||function(){return(new Me).getTime();
+},xo=pe(function(n,t,r){var e=b;if(r.length)var u=v(r,xo.placeholder),e=e|I;return dr(n,e,t,r,u)}),bo=pe(function(n,t){t=t.length?_t(t):Re(n);for(var r=-1,e=t.length;++r<e;){var u=t[r];n[u]=dr(n[u],b,n)}return n}),Ao=pe(function(n,t,r){var e=b|A;if(r.length)var u=v(r,Ao.placeholder),e=e|I;return dr(t,e,n,r,u)}),jo=Qt(k),ko=Qt(O),Oo=pe(function(n,t){return at(n,1,t)}),Io=pe(function(n,t,r){return at(n,t,r)}),Ro=or(),Eo=or(true),Co=pe(function(n,t){if(t=_t(t),typeof n!="function"||!Vn(t,e))throw new Xe(T);
+var r=t.length;return pe(function(e){for(var u=ku(e.length,r);u--;)e[u]=t[u](e[u]);return n.apply(this,e)})}),So=sr(I),Uo=sr(R),$o=pe(function(n,t){return dr(n,C,w,w,w,_t(t))}),Wo=xu||function(n){return h(n)&&Lr(n.length)&&ou.call(n)==B},Fo=Zt(kt),Lo=Zt(function(n,t,r){return r?rt(n,t,r):et(n,t)}),No=nr(Lo,function(n,t){return n===w?t:n}),To=nr(Fo,Nr),Po=ur(gt),zo=ur(yt),Bo=fr(Du),Do=fr(Mu),Mo=ar(gt),qo=ar(yt),Ko=Au?function(n){var t=null==n?w:n.constructor;return typeof t=="function"&&t.prototype===n||(typeof n=="function"?Nn.support.enumPrototypes:Sr(n))?zr(n):de(n)?Au(n):[];
+}:zr,Vo=cr(true),Zo=cr(),Yo=pe(function(n,t){if(null==n)return{};if("function"!=typeof t[0])return t=Xn(_t(t),Je),Tr(n,ct(Ee(n),t));var r=Dt(t[0],t[1],3);return Pr(n,function(n,t,e){return!r(n,t,e)})}),Go=pe(function(n,t){return null==n?{}:"function"==typeof t[0]?Pr(n,Dt(t[0],t[1],3)):Tr(n,_t(t))}),Jo=Xt(function(n,t,r){return t=t.toLowerCase(),n+(r?t.charAt(0).toUpperCase()+t.slice(1):t)}),Xo=Xt(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Ho=lr(),Qo=lr(true),ni=Xt(function(n,t,r){return n+(r?"_":"")+t.toLowerCase();
+}),ti=Xt(function(n,t,r){return n+(r?" ":"")+(t.charAt(0).toUpperCase()+t.slice(1))}),ri=pe(function(n,t){try{return n.apply(w,t)}catch(r){return ge(r)?r:new qe(r)}}),ei=pe(function(n,t){return function(r){return Cr(r,n,t)}}),ui=pe(function(n,t){return function(r){return Cr(n,r,t)}}),oi=gr("ceil"),ii=gr("floor"),fi=tr(he,Eu),ai=tr(ke,Cu),ci=gr("round");return Nn.prototype=Tn.prototype,Pn.prototype=Pu(Tn.prototype),Pn.prototype.constructor=Pn,zn.prototype=Pu(Tn.prototype),zn.prototype.constructor=zn,
+Bn.prototype["delete"]=function(n){return this.has(n)&&delete this.__data__[n]},Bn.prototype.get=function(n){return"__proto__"==n?w:this.__data__[n]},Bn.prototype.has=function(n){return"__proto__"!=n&&eu.call(this.__data__,n)},Bn.prototype.set=function(n,t){return"__proto__"!=n&&(this.__data__[n]=t),this},Dn.prototype.push=function(n){var t=this.data;typeof n=="string"||de(n)?t.set.add(n):t.hash[n]=true},se.Cache=Bn,Nn.after=function(n,t){if(typeof t!="function"){if(typeof n!="function")throw new Xe(T);
+var r=n;n=t,t=r}return n=bu(n=+n)?n:0,function(){return 1>--n?t.apply(this,arguments):void 0}},Nn.ary=function(n,t,r){return r&&$r(n,t,r)&&(t=w),t=n&&null==t?n.length:ju(+t||0,0),dr(n,E,w,w,w,w,t)},Nn.assign=Lo,Nn.at=io,Nn.before=ce,Nn.bind=xo,Nn.bindAll=bo,Nn.bindKey=Ao,Nn.callback=Le,Nn.chain=te,Nn.chunk=function(n,t,r){t=(r?$r(n,t,r):null==t)?1:ju(wu(t)||1,1),r=0;for(var e=n?n.length:0,u=-1,o=De(du(e/t));r<e;)o[++u]=St(n,r,r+=t);return o},Nn.compact=function(n){for(var t=-1,r=n?n.length:0,e=-1,u=[];++t<r;){
+var o=n[t];o&&(u[++e]=o)}return u},Nn.constant=function(n){return function(){return n}},Nn.countBy=fo,Nn.create=function(n,t,r){var e=Pu(n);return r&&$r(n,t,r)&&(t=w),t?et(e,t):e},Nn.curry=jo,Nn.curryRight=ko,Nn.debounce=le,Nn.defaults=No,Nn.defaultsDeep=To,Nn.defer=Oo,Nn.delay=Io,Nn.difference=Yu,Nn.drop=Kr,Nn.dropRight=Vr,Nn.dropRightWhile=function(n,t,r){return n&&n.length?Tt(n,br(t,r,3),true,true):[]},Nn.dropWhile=function(n,t,r){return n&&n.length?Tt(n,br(t,r,3),true):[]},Nn.fill=function(n,t,r,e){
+var u=n?n.length:0;if(!u)return[];for(r&&typeof r!="number"&&$r(n,t,r)&&(r=0,e=u),u=n.length,r=null==r?0:+r||0,0>r&&(r=-r>u?0:u+r),e=e===w||e>u?u:+e||0,0>e&&(e+=u),u=r>e?0:e>>>0,r>>>=0;r<u;)n[r++]=t;return n},Nn.filter=ue,Nn.flatten=function(n,t,r){var e=n?n.length:0;return r&&$r(n,t,r)&&(t=false),e?_t(n,t):[]},Nn.flattenDeep=function(n){return n&&n.length?_t(n,true):[]},Nn.flow=Ro,Nn.flowRight=Eo,Nn.forEach=lo,Nn.forEachRight=so,Nn.forIn=Bo,Nn.forInRight=Do,Nn.forOwn=Mo,Nn.forOwnRight=qo,Nn.functions=Re,
+Nn.groupBy=po,Nn.indexBy=ho,Nn.initial=function(n){return Vr(n,1)},Nn.intersection=Xu,Nn.invert=function(n,t,r){r&&$r(n,t,r)&&(t=w),r=-1;for(var e=Ko(n),u=e.length,o={};++r<u;){var i=e[r],f=n[i];t?eu.call(o,f)?o[f].push(i):o[f]=[i]:o[f]=i}return o},Nn.invoke=_o,Nn.keys=Ko,Nn.keysIn=Ee,Nn.map=ie,Nn.mapKeys=Vo,Nn.mapValues=Zo,Nn.matches=Te,Nn.matchesProperty=function(n,t){return jt(n,ft(t,true))},Nn.memoize=se,Nn.merge=Fo,Nn.method=ei,Nn.methodOf=ui,Nn.mixin=Pe,Nn.modArgs=Co,Nn.negate=function(n){if(typeof n!="function")throw new Xe(T);
+return function(){return!n.apply(this,arguments)}},Nn.omit=Yo,Nn.once=function(n){return ce(2,n)},Nn.pairs=Ce,Nn.partial=So,Nn.partialRight=Uo,Nn.partition=vo,Nn.pick=Go,Nn.pluck=function(n,t){return ie(n,Be(t))},Nn.property=Be,Nn.propertyOf=function(n){return function(t){return mt(n,Mr(t),t+"")}},Nn.pull=function(){var n=arguments,t=n[0];if(!t||!t.length)return t;for(var r=0,e=jr(),u=n.length;++r<u;)for(var o=0,i=n[r];-1<(o=e(t,i,o));)vu.call(t,o,1);return t},Nn.pullAt=Hu,Nn.range=function(n,t,r){
+r&&$r(n,t,r)&&(t=r=w),n=+n||0,r=null==r?1:+r||0,null==t?(t=n,n=0):t=+t||0;var e=-1;t=ju(du((t-n)/(r||1)),0);for(var u=De(t);++e<t;)u[e]=n,n+=r;return u},Nn.rearg=$o,Nn.reject=function(n,t,r){var e=Wo(n)?Zn:pt;return t=br(t,r,3),e(n,function(n,r,e){return!t(n,r,e)})},Nn.remove=function(n,t,r){var e=[];if(!n||!n.length)return e;var u=-1,o=[],i=n.length;for(t=br(t,r,3);++u<i;)r=n[u],t(r,u,n)&&(e.push(r),o.push(u));return Rt(n,o),e},Nn.rest=Jr,Nn.restParam=pe,Nn.set=function(n,t,r){if(null==n)return n;
+var e=t+"";t=null!=n[e]||Wr(t,n)?[e]:Mr(t);for(var e=-1,u=t.length,o=u-1,i=n;null!=i&&++e<u;){var f=t[e];de(i)&&(e==o?i[f]=r:null==i[f]&&(i[f]=Ur(t[e+1])?[]:{})),i=i[f]}return n},Nn.shuffle=function(n){return fe(n,Cu)},Nn.slice=function(n,t,r){var e=n?n.length:0;return e?(r&&typeof r!="number"&&$r(n,t,r)&&(t=0,r=e),St(n,t,r)):[]},Nn.sortBy=function(n,t,r){if(null==n)return[];r&&$r(n,t,r)&&(t=w);var e=-1;return t=br(t,r,3),n=bt(n,function(n,r,u){return{a:t(n,r,u),b:++e,c:n}}),$t(n,f)},Nn.sortByAll=mo,
+Nn.sortByOrder=function(n,t,r,e){return null==n?[]:(e&&$r(t,r,e)&&(r=w),Wo(t)||(t=null==t?[]:[t]),Wo(r)||(r=null==r?[]:[r]),Wt(n,t,r))},Nn.spread=function(n){if(typeof n!="function")throw new Xe(T);return function(t){return n.apply(this,t)}},Nn.take=function(n,t,r){return n&&n.length?((r?$r(n,t,r):null==t)&&(t=1),St(n,0,0>t?0:t)):[]},Nn.takeRight=function(n,t,r){var e=n?n.length:0;return e?((r?$r(n,t,r):null==t)&&(t=1),t=e-(+t||0),St(n,0>t?0:t)):[]},Nn.takeRightWhile=function(n,t,r){return n&&n.length?Tt(n,br(t,r,3),false,true):[];
+},Nn.takeWhile=function(n,t,r){return n&&n.length?Tt(n,br(t,r,3)):[]},Nn.tap=function(n,t,r){return t.call(r,n),n},Nn.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new Xe(T);return false===r?e=false:de(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),le(n,t,{leading:e,maxWait:+t,trailing:u})},Nn.thru=re,Nn.times=function(n,t,r){if(n=wu(n),1>n||!bu(n))return[];var e=-1,u=De(ku(n,4294967295));for(t=Dt(t,r,1);++e<n;)4294967295>e?u[e]=t(e):t(e);return u},Nn.toArray=Oe,
+Nn.toPlainObject=Ie,Nn.transform=function(n,t,r,e){var u=Wo(n)||je(n);return t=br(t,e,4),null==r&&(u||de(n)?(e=n.constructor,r=u?Wo(n)?new e:[]:Pu(ye(e)?e.prototype:w)):r={}),(u?Kn:gt)(n,function(n,e,u){return t(r,n,e,u)}),r},Nn.union=to,Nn.uniq=Xr,Nn.unzip=Hr,Nn.unzipWith=Qr,Nn.values=Se,Nn.valuesIn=function(n){return Nt(n,Ee(n))},Nn.where=function(n,t){return ue(n,At(t))},Nn.without=ro,Nn.wrap=function(n,t){return t=null==t?Ne:t,dr(t,I,w,[n],[])},Nn.xor=function(){for(var n=-1,t=arguments.length;++n<t;){
+var r=arguments[n];if(Sr(r))var e=e?Hn(ct(e,r),ct(r,e)):r}return e?Lt(e):[]},Nn.zip=eo,Nn.zipObject=ne,Nn.zipWith=uo,Nn.backflow=Eo,Nn.collect=ie,Nn.compose=Eo,Nn.each=lo,Nn.eachRight=so,Nn.extend=Lo,Nn.iteratee=Le,Nn.methods=Re,Nn.object=ne,Nn.select=ue,Nn.tail=Jr,Nn.unique=Xr,Pe(Nn,Nn),Nn.add=function(n,t){return(+n||0)+(+t||0)},Nn.attempt=ri,Nn.camelCase=Jo,Nn.capitalize=function(n){return(n=u(n))&&n.charAt(0).toUpperCase()+n.slice(1)},Nn.ceil=oi,Nn.clone=function(n,t,r,e){return t&&typeof t!="boolean"&&$r(n,t,r)?t=false:typeof t=="function"&&(e=r,
+r=t,t=false),typeof r=="function"?ft(n,t,Dt(r,e,3)):ft(n,t)},Nn.cloneDeep=function(n,t,r){return typeof t=="function"?ft(n,true,Dt(t,r,3)):ft(n,true)},Nn.deburr=Ue,Nn.endsWith=function(n,t,r){n=u(n),t+="";var e=n.length;return r=r===w?e:ku(0>r?0:+r||0,e),r-=t.length,0<=r&&n.indexOf(t,r)==r},Nn.escape=function(n){return(n=u(n))&&hn.test(n)?n.replace(sn,c):n},Nn.escapeRegExp=function(n){return(n=u(n))&&xn.test(n)?n.replace(wn,l):n||"(?:)"},Nn.every=ee,Nn.find=ao,Nn.findIndex=Gu,Nn.findKey=Po,Nn.findLast=co,
+Nn.findLastIndex=Ju,Nn.findLastKey=zo,Nn.findWhere=function(n,t){return ao(n,At(t))},Nn.first=Zr,Nn.floor=ii,Nn.get=function(n,t,r){return n=null==n?w:mt(n,Mr(t),t+""),n===w?r:n},Nn.gt=he,Nn.gte=function(n,t){return n>=t},Nn.has=function(n,t){if(null==n)return false;var r=eu.call(n,t);if(!r&&!Wr(t)){if(t=Mr(t),n=1==t.length?n:mt(n,St(t,0,-1)),null==n)return false;t=Gr(t),r=eu.call(n,t)}return r||Lr(n.length)&&Ur(t,n.length)&&(Wo(n)||_e(n)||Ae(n))},Nn.identity=Ne,Nn.includes=oe,Nn.indexOf=Yr,Nn.inRange=function(n,t,r){
+return t=+t||0,r===w?(r=t,t=0):r=+r||0,n>=ku(t,r)&&n<ju(t,r)},Nn.isArguments=_e,Nn.isArray=Wo,Nn.isBoolean=function(n){return true===n||false===n||h(n)&&ou.call(n)==D},Nn.isDate=function(n){return h(n)&&ou.call(n)==M},Nn.isElement=function(n){return!!n&&1===n.nodeType&&h(n)&&!xe(n)},Nn.isEmpty=function(n){return null==n?true:Sr(n)&&(Wo(n)||Ae(n)||_e(n)||h(n)&&ye(n.splice))?!n.length:!Ko(n).length},Nn.isEqual=ve,Nn.isError=ge,Nn.isFinite=function(n){return typeof n=="number"&&bu(n)},Nn.isFunction=ye,Nn.isMatch=function(n,t,r,e){
+return r=typeof r=="function"?Dt(r,e,3):w,xt(n,kr(t),r)},Nn.isNaN=function(n){return we(n)&&n!=+n},Nn.isNative=me,Nn.isNull=function(n){return null===n},Nn.isNumber=we,Nn.isObject=de,Nn.isPlainObject=xe,Nn.isRegExp=be,Nn.isString=Ae,Nn.isTypedArray=je,Nn.isUndefined=function(n){return n===w},Nn.kebabCase=Xo,Nn.last=Gr,Nn.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?ju(e+r,0):ku(r||0,e-1))+1;else if(r)return u=zt(n,t,true)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;
+if(t!==t)return p(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Nn.lt=ke,Nn.lte=function(n,t){return n<=t},Nn.max=fi,Nn.min=ai,Nn.noConflict=function(){return Yn._=iu,this},Nn.noop=ze,Nn.now=wo,Nn.pad=function(n,t,r){n=u(n),t=+t;var e=n.length;return e<t&&bu(t)?(e=(t-e)/2,t=wu(e),e=du(e),r=_r("",e,r),r.slice(0,t)+n+r):n},Nn.padLeft=Ho,Nn.padRight=Qo,Nn.parseInt=function(n,t,r){return(r?$r(n,t,r):null==t)?t=0:t&&(t=+t),n=We(n),Iu(n,t||(On.test(n)?16:10))},Nn.random=function(n,t,r){r&&$r(n,t,r)&&(t=r=w);
+var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=Ru(),ku(n+r*(t-n+lu("1e-"+((r+"").length-1))),t)):Et(n,t)},Nn.reduce=go,Nn.reduceRight=yo,Nn.repeat=$e,Nn.result=function(n,t,r){var e=null==n?w:Dr(n)[t];return e===w&&(null==n||Wr(t,n)||(t=Mr(t),n=1==t.length?n:mt(n,St(t,0,-1)),e=null==n?w:Dr(n)[Gr(t)]),e=e===w?r:e),ye(e)?e.call(n):e},Nn.round=ci,Nn.runInContext=m,Nn.size=function(n){
+var t=n?Vu(n):0;return Lr(t)?t:Ko(n).length},Nn.snakeCase=ni,Nn.some=ae,Nn.sortedIndex=Qu,Nn.sortedLastIndex=no,Nn.startCase=ti,Nn.startsWith=function(n,t,r){return n=u(n),r=null==r?0:ku(0>r?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Nn.sum=function(n,t,r){if(r&&$r(n,t,r)&&(t=w),t=br(t,r,3),1==t.length){n=Wo(n)?n:Br(n),r=n.length;for(var e=0;r--;)e+=+t(n[r])||0;n=e}else n=Ft(n,t);return n},Nn.template=function(n,t,r){var e=Nn.templateSettings;r&&$r(n,t,r)&&(t=r=w),n=u(n),t=rt(et({},r||t),e,tt),r=rt(et({},t.imports),e.imports,tt);
+var o,i,f=Ko(r),a=Nt(r,f),c=0;r=t.interpolate||Cn;var l="__p+='";r=Ge((t.escape||Cn).source+"|"+r.source+"|"+(r===gn?jn:Cn).source+"|"+(t.evaluate||Cn).source+"|$","g");var p="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,u,f,a){return e||(e=u),l+=n.slice(c,a).replace(Sn,s),r&&(o=true,l+="'+__e("+r+")+'"),f&&(i=true,l+="';"+f+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),c=a+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(i?l.replace(fn,""):l).replace(an,"$1").replace(cn,"$1;"),
+l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(o?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=ri(function(){return Ke(f,p+"return "+l).apply(w,a)}),t.source=l,ge(t))throw t;return t},Nn.trim=We,Nn.trimLeft=function(n,t,r){var e=n;return(n=u(n))?n.slice((r?$r(e,t,r):null==t)?g(n):o(n,t+"")):n},Nn.trimRight=function(n,t,r){var e=n;return(n=u(n))?(r?$r(e,t,r):null==t)?n.slice(0,y(n)+1):n.slice(0,i(n,t+"")+1):n;
+},Nn.trunc=function(n,t,r){r&&$r(n,t,r)&&(t=w);var e=S;if(r=U,null!=t)if(de(t)){var o="separator"in t?t.separator:o,e="length"in t?+t.length||0:e;r="omission"in t?u(t.omission):r}else e=+t||0;if(n=u(n),e>=n.length)return n;if(e-=r.length,1>e)return r;if(t=n.slice(0,e),null==o)return t+r;if(be(o)){if(n.slice(e).search(o)){var i,f=n.slice(0,e);for(o.global||(o=Ge(o.source,(kn.exec(o)||"")+"g")),o.lastIndex=0;n=o.exec(f);)i=n.index;t=t.slice(0,null==i?e:i)}}else n.indexOf(o,e)!=e&&(o=t.lastIndexOf(o),
+-1<o&&(t=t.slice(0,o)));return t+r},Nn.unescape=function(n){return(n=u(n))&&pn.test(n)?n.replace(ln,d):n},Nn.uniqueId=function(n){var t=++uu;return u(n)+t},Nn.words=Fe,Nn.all=ee,Nn.any=ae,Nn.contains=oe,Nn.eq=ve,Nn.detect=ao,Nn.foldl=go,Nn.foldr=yo,Nn.head=Zr,Nn.include=oe,Nn.inject=go,Pe(Nn,function(){var n={};return gt(Nn,function(t,r){Nn.prototype[r]||(n[r]=t)}),n}(),false),Nn.sample=fe,Nn.prototype.sample=function(n){return this.__chain__||null!=n?this.thru(function(t){return fe(t,n)}):fe(this.value());
+},Nn.VERSION=x,Kn("bind bindKey curry curryRight partial partialRight".split(" "),function(n){Nn[n].placeholder=Nn}),Kn(["drop","take"],function(n,t){zn.prototype[n]=function(r){var e=this.__filtered__;if(e&&!t)return new zn(this);r=null==r?1:ju(wu(r)||0,0);var u=this.clone();return e?u.__takeCount__=ku(u.__takeCount__,r):u.__views__.push({size:r,type:n+(0>u.__dir__?"Right":"")}),u},zn.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),Kn(["filter","map","takeWhile"],function(n,t){
+var r=t+1,e=r!=N;zn.prototype[n]=function(n,t){var u=this.clone();return u.__iteratees__.push({iteratee:br(n,t,1),type:r}),u.__filtered__=u.__filtered__||e,u}}),Kn(["first","last"],function(n,t){var r="take"+(t?"Right":"");zn.prototype[n]=function(){return this[r](1).value()[0]}}),Kn(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");zn.prototype[n]=function(){return this.__filtered__?new zn(this):this[r](1)}}),Kn(["pluck","where"],function(n,t){var r=t?"filter":"map",e=t?At:Be;zn.prototype[n]=function(n){
+return this[r](e(n))}}),zn.prototype.compact=function(){return this.filter(Ne)},zn.prototype.reject=function(n,t){return n=br(n,t,1),this.filter(function(t){return!n(t)})},zn.prototype.slice=function(n,t){n=null==n?0:+n||0;var r=this;return r.__filtered__&&(0<n||0>t)?new zn(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==w&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r)},zn.prototype.takeRightWhile=function(n,t){return this.reverse().takeWhile(n,t).reverse()},zn.prototype.toArray=function(){return this.take(Cu);
+},gt(zn.prototype,function(n,t){var r=/^(?:filter|map|reject)|While$/.test(t),e=/^(?:first|last)$/.test(t),u=Nn[e?"take"+("last"==t?"Right":""):t];u&&(Nn.prototype[t]=function(){var t=e?[1]:arguments,o=this.__chain__,i=this.__wrapped__,f=!!this.__actions__.length,a=i instanceof zn,c=t[0],l=a||Wo(i);l&&r&&typeof c=="function"&&1!=c.length&&(a=l=false);var s=function(n){return e&&o?u(n,1)[0]:u.apply(w,Hn([n],t))},c={func:re,args:[s],thisArg:w},f=a&&!f;return e&&!o?f?(i=i.clone(),i.__actions__.push(c),
+n.call(i)):u.call(w,this.value())[0]:!e&&l?(i=f?i:new zn(this),i=n.apply(i,t),i.__actions__.push(c),new Pn(i,o)):this.thru(s)})}),Kn("join pop push replace shift sort splice split unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?tu:He)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=!Tu.spliceObjects&&/^(?:pop|shift|splice)$/.test(n),u=/^(?:join|pop|replace|shift)$/.test(n),o=e?function(){var n=t.apply(this,arguments);return 0===this.length&&delete this[0],n}:t;Nn.prototype[n]=function(){
+var n=arguments;return u&&!this.__chain__?o.apply(this.value(),n):this[r](function(t){return o.apply(t,n)})}}),gt(zn.prototype,function(n,t){var r=Nn[t];if(r){var e=r.name+"";(Fu[e]||(Fu[e]=[])).push({name:t,func:r})}}),Fu[hr(w,A).name]=[{name:"wrapper",func:w}],zn.prototype.clone=function(){var n=new zn(this.__wrapped__);return n.__actions__=qn(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=qn(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=qn(this.__views__),
+n},zn.prototype.reverse=function(){if(this.__filtered__){var n=new zn(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},zn.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=Wo(t),u=0>r,o=e?t.length:0;n=0;for(var i=o,f=this.__views__,a=-1,c=f.length;++a<c;){var l=f[a],s=l.size;switch(l.type){case"drop":n+=s;break;case"dropRight":i-=s;break;case"take":i=ku(i,n+s);break;case"takeRight":n=ju(n,i-s)}}if(n={start:n,end:i},i=n.start,f=n.end,n=f-i,
+u=u?f:i-1,i=this.__iteratees__,f=i.length,a=0,c=ku(n,this.__takeCount__),!e||o<F||o==n&&c==n)return Pt(t,this.__actions__);e=[];n:for(;n--&&a<c;){for(u+=r,o=-1,l=t[u];++o<f;){var p=i[o],s=p.type,p=p.iteratee(l);if(s==N)l=p;else if(!p){if(s==L)continue n;break n}}e[a++]=l}return e},Nn.prototype.chain=function(){return te(this)},Nn.prototype.commit=function(){return new Pn(this.value(),this.__chain__)},Nn.prototype.concat=oo,Nn.prototype.plant=function(n){for(var t,r=this;r instanceof Tn;){var e=qr(r);
+t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},Nn.prototype.reverse=function(){var n=this.__wrapped__,t=function(n){return n.reverse()};return n instanceof zn?(this.__actions__.length&&(n=new zn(this)),n=n.reverse(),n.__actions__.push({func:re,args:[t],thisArg:w}),new Pn(n,this.__chain__)):this.thru(t)},Nn.prototype.toString=function(){return this.value()+""},Nn.prototype.run=Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return Pt(this.__wrapped__,this.__actions__);
+},Nn.prototype.collect=Nn.prototype.map,Nn.prototype.head=Nn.prototype.first,Nn.prototype.select=Nn.prototype.filter,Nn.prototype.tail=Nn.prototype.rest,Nn}var w,x="3.10.1",b=1,A=2,j=4,k=8,O=16,I=32,R=64,E=128,C=256,S=30,U="...",$=150,W=16,F=200,L=1,N=2,T="Expected a function",P="__lodash_placeholder__",z="[object Arguments]",B="[object Array]",D="[object Boolean]",M="[object Date]",q="[object Error]",K="[object Function]",V="[object Number]",Z="[object Object]",Y="[object RegExp]",G="[object String]",J="[object ArrayBuffer]",X="[object Float32Array]",H="[object Float64Array]",Q="[object Int8Array]",nn="[object Int16Array]",tn="[object Int32Array]",rn="[object Uint8Array]",en="[object Uint8ClampedArray]",un="[object Uint16Array]",on="[object Uint32Array]",fn=/\b__p\+='';/g,an=/\b(__p\+=)''\+/g,cn=/(__e\(.*?\)|\b__t\))\+'';/g,ln=/&(?:amp|lt|gt|quot|#39|#96);/g,sn=/[&<>"'`]/g,pn=RegExp(ln.source),hn=RegExp(sn.source),_n=/<%-([\s\S]+?)%>/g,vn=/<%([\s\S]+?)%>/g,gn=/<%=([\s\S]+?)%>/g,yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,dn=/^\w*$/,mn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,wn=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,xn=RegExp(wn.source),bn=/[\u0300-\u036f\ufe20-\ufe23]/g,An=/\\(\\)?/g,jn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,kn=/\w*$/,On=/^0[xX]/,In=/^\[object .+?Constructor\]$/,Rn=/^\d+$/,En=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Cn=/($^)/,Sn=/['\n\r\u2028\u2029\\]/g,Un=RegExp("[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?=[A-Z\\xc0-\\xd6\\xd8-\\xde][a-z\\xdf-\\xf6\\xf8-\\xff]+)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|[0-9]+","g"),$n="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout isFinite parseFloat parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap".split(" "),Wn="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Fn={};
+Fn[X]=Fn[H]=Fn[Q]=Fn[nn]=Fn[tn]=Fn[rn]=Fn[en]=Fn[un]=Fn[on]=true,Fn[z]=Fn[B]=Fn[J]=Fn[D]=Fn[M]=Fn[q]=Fn[K]=Fn["[object Map]"]=Fn[V]=Fn[Z]=Fn[Y]=Fn["[object Set]"]=Fn[G]=Fn["[object WeakMap]"]=false;var Ln={};Ln[z]=Ln[B]=Ln[J]=Ln[D]=Ln[M]=Ln[X]=Ln[H]=Ln[Q]=Ln[nn]=Ln[tn]=Ln[V]=Ln[Z]=Ln[Y]=Ln[G]=Ln[rn]=Ln[en]=Ln[un]=Ln[on]=true,Ln[q]=Ln[K]=Ln["[object Map]"]=Ln["[object Set]"]=Ln["[object WeakMap]"]=false;var Nn={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a",
+"\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y",
+"\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Tn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},Pn={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},zn={"function":true,object:true},Bn={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Dn={"\\":"\\",
+"'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Mn=zn[typeof exports]&&exports&&!exports.nodeType&&exports,qn=zn[typeof module]&&module&&!module.nodeType&&module,Kn=zn[typeof self]&&self&&self.Object&&self,Vn=zn[typeof window]&&window&&window.Object&&window,Zn=qn&&qn.exports===Mn&&Mn,Yn=Mn&&qn&&typeof global=="object"&&global&&global.Object&&global||Vn!==(this&&this.window)&&Vn||Kn||this,Gn=function(){try{Object({toString:0}+"")}catch(n){return function(){return false}}return function(n){
+return typeof n.toString!="function"&&typeof(n+"")=="string"}}(),Jn=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Yn._=Jn, define(function(){return Jn})):Mn&&qn?Zn?(qn.exports=Jn)._=Jn:Mn._=Jn:Yn._=Jn}).call(this); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/marked.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/marked.js
new file mode 100644
index 0000000..c2a678d
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/marked.js
@@ -0,0 +1,1272 @@
+/**
+ * marked - a markdown parser
+ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
+ * https://github.com/chjj/marked
+ */
+
+;(function() {
+
+/**
+ * Block-Level Grammar
+ */
+
+var block = {
+ newline: /^\n+/,
+ code: /^( {4}[^\n]+\n*)+/,
+ fences: noop,
+ hr: /^( *[-*_]){3,} *(?:\n+|$)/,
+ heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
+ nptable: noop,
+ lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
+ blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
+ list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
+ html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
+ table: noop,
+ paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
+ text: /^[^\n]+/
+};
+
+block.bullet = /(?:[*+-]|\d+\.)/;
+block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;
+block.item = replace(block.item, 'gm')
+ (/bull/g, block.bullet)
+ ();
+
+block.list = replace(block.list)
+ (/bull/g, block.bullet)
+ ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')
+ ('def', '\\n+(?=' + block.def.source + ')')
+ ();
+
+block.blockquote = replace(block.blockquote)
+ ('def', block.def)
+ ();
+
+block._tag = '(?!(?:'
+ + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'
+ + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'
+ + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';
+
+block.html = replace(block.html)
+ ('comment', /<!--[\s\S]*?-->/)
+ ('closed', /<(tag)[\s\S]+?<\/\1>/)
+ ('closing', /<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)
+ (/tag/g, block._tag)
+ ();
+
+block.paragraph = replace(block.paragraph)
+ ('hr', block.hr)
+ ('heading', block.heading)
+ ('lheading', block.lheading)
+ ('blockquote', block.blockquote)
+ ('tag', '<' + block._tag)
+ ('def', block.def)
+ ();
+
+/**
+ * Normal Block Grammar
+ */
+
+block.normal = merge({}, block);
+
+/**
+ * GFM Block Grammar
+ */
+
+block.gfm = merge({}, block.normal, {
+ fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,
+ paragraph: /^/
+});
+
+block.gfm.paragraph = replace(block.paragraph)
+ ('(?!', '(?!'
+ + block.gfm.fences.source.replace('\\1', '\\2') + '|'
+ + block.list.source.replace('\\1', '\\3') + '|')
+ ();
+
+/**
+ * GFM + Tables Block Grammar
+ */
+
+block.tables = merge({}, block.gfm, {
+ nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,
+ table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/
+});
+
+/**
+ * Block Lexer
+ */
+
+function Lexer(options) {
+ this.tokens = [];
+ this.tokens.links = {};
+ this.options = options || marked.defaults;
+ this.rules = block.normal;
+
+ if (this.options.gfm) {
+ if (this.options.tables) {
+ this.rules = block.tables;
+ } else {
+ this.rules = block.gfm;
+ }
+ }
+}
+
+/**
+ * Expose Block Rules
+ */
+
+Lexer.rules = block;
+
+/**
+ * Static Lex Method
+ */
+
+Lexer.lex = function(src, options) {
+ var lexer = new Lexer(options);
+ return lexer.lex(src);
+};
+
+/**
+ * Preprocessing
+ */
+
+Lexer.prototype.lex = function(src) {
+ src = src
+ .replace(/\r\n|\r/g, '\n')
+ .replace(/\t/g, ' ')
+ .replace(/\u00a0/g, ' ')
+ .replace(/\u2424/g, '\n');
+
+ return this.token(src, true);
+};
+
+/**
+ * Lexing
+ */
+
+Lexer.prototype.token = function(src, top, bq) {
+ var src = src.replace(/^ +$/gm, '')
+ , next
+ , loose
+ , cap
+ , bull
+ , b
+ , item
+ , space
+ , i
+ , l;
+
+ while (src) {
+ // newline
+ if (cap = this.rules.newline.exec(src)) {
+ src = src.substring(cap[0].length);
+ if (cap[0].length > 1) {
+ this.tokens.push({
+ type: 'space'
+ });
+ }
+ }
+
+ // code
+ if (cap = this.rules.code.exec(src)) {
+ src = src.substring(cap[0].length);
+ cap = cap[0].replace(/^ {4}/gm, '');
+ this.tokens.push({
+ type: 'code',
+ text: !this.options.pedantic
+ ? cap.replace(/\n+$/, '')
+ : cap
+ });
+ continue;
+ }
+
+ // fences (gfm)
+ if (cap = this.rules.fences.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'code',
+ lang: cap[2],
+ text: cap[3]
+ });
+ continue;
+ }
+
+ // heading
+ if (cap = this.rules.heading.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'heading',
+ depth: cap[1].length,
+ text: cap[2]
+ });
+ continue;
+ }
+
+ // table no leading pipe (gfm)
+ if (top && (cap = this.rules.nptable.exec(src))) {
+ src = src.substring(cap[0].length);
+
+ item = {
+ type: 'table',
+ header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
+ align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
+ cells: cap[3].replace(/\n$/, '').split('\n')
+ };
+
+ for (i = 0; i < item.align.length; i++) {
+ if (/^ *-+: *$/.test(item.align[i])) {
+ item.align[i] = 'right';
+ } else if (/^ *:-+: *$/.test(item.align[i])) {
+ item.align[i] = 'center';
+ } else if (/^ *:-+ *$/.test(item.align[i])) {
+ item.align[i] = 'left';
+ } else {
+ item.align[i] = null;
+ }
+ }
+
+ for (i = 0; i < item.cells.length; i++) {
+ item.cells[i] = item.cells[i].split(/ *\| */);
+ }
+
+ this.tokens.push(item);
+
+ continue;
+ }
+
+ // lheading
+ if (cap = this.rules.lheading.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'heading',
+ depth: cap[2] === '=' ? 1 : 2,
+ text: cap[1]
+ });
+ continue;
+ }
+
+ // hr
+ if (cap = this.rules.hr.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'hr'
+ });
+ continue;
+ }
+
+ // blockquote
+ if (cap = this.rules.blockquote.exec(src)) {
+ src = src.substring(cap[0].length);
+
+ this.tokens.push({
+ type: 'blockquote_start'
+ });
+
+ cap = cap[0].replace(/^ *> ?/gm, '');
+
+ // Pass `top` to keep the current
+ // "toplevel" state. This is exactly
+ // how markdown.pl works.
+ this.token(cap, top, true);
+
+ this.tokens.push({
+ type: 'blockquote_end'
+ });
+
+ continue;
+ }
+
+ // list
+ if (cap = this.rules.list.exec(src)) {
+ src = src.substring(cap[0].length);
+ bull = cap[2];
+
+ this.tokens.push({
+ type: 'list_start',
+ ordered: bull.length > 1
+ });
+
+ // Get each top-level item.
+ cap = cap[0].match(this.rules.item);
+
+ next = false;
+ l = cap.length;
+ i = 0;
+
+ for (; i < l; i++) {
+ item = cap[i];
+
+ // Remove the list item's bullet
+ // so it is seen as the next token.
+ space = item.length;
+ item = item.replace(/^ *([*+-]|\d+\.) +/, '');
+
+ // Outdent whatever the
+ // list item contains. Hacky.
+ if (~item.indexOf('\n ')) {
+ space -= item.length;
+ item = !this.options.pedantic
+ ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
+ : item.replace(/^ {1,4}/gm, '');
+ }
+
+ // Determine whether the next list item belongs here.
+ // Backpedal if it does not belong in this list.
+ if (this.options.smartLists && i !== l - 1) {
+ b = block.bullet.exec(cap[i + 1])[0];
+ if (bull !== b && !(bull.length > 1 && b.length > 1)) {
+ src = cap.slice(i + 1).join('\n') + src;
+ i = l - 1;
+ }
+ }
+
+ // Determine whether item is loose or not.
+ // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
+ // for discount behavior.
+ loose = next || /\n\n(?!\s*$)/.test(item);
+ if (i !== l - 1) {
+ next = item.charAt(item.length - 1) === '\n';
+ if (!loose) loose = next;
+ }
+
+ this.tokens.push({
+ type: loose
+ ? 'loose_item_start'
+ : 'list_item_start'
+ });
+
+ // Recurse.
+ this.token(item, false, bq);
+
+ this.tokens.push({
+ type: 'list_item_end'
+ });
+ }
+
+ this.tokens.push({
+ type: 'list_end'
+ });
+
+ continue;
+ }
+
+ // html
+ if (cap = this.rules.html.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: this.options.sanitize
+ ? 'paragraph'
+ : 'html',
+ pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',
+ text: cap[0]
+ });
+ continue;
+ }
+
+ // def
+ if ((!bq && top) && (cap = this.rules.def.exec(src))) {
+ src = src.substring(cap[0].length);
+ this.tokens.links[cap[1].toLowerCase()] = {
+ href: cap[2],
+ title: cap[3]
+ };
+ continue;
+ }
+
+ // table (gfm)
+ if (top && (cap = this.rules.table.exec(src))) {
+ src = src.substring(cap[0].length);
+
+ item = {
+ type: 'table',
+ header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
+ align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
+ cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n')
+ };
+
+ for (i = 0; i < item.align.length; i++) {
+ if (/^ *-+: *$/.test(item.align[i])) {
+ item.align[i] = 'right';
+ } else if (/^ *:-+: *$/.test(item.align[i])) {
+ item.align[i] = 'center';
+ } else if (/^ *:-+ *$/.test(item.align[i])) {
+ item.align[i] = 'left';
+ } else {
+ item.align[i] = null;
+ }
+ }
+
+ for (i = 0; i < item.cells.length; i++) {
+ item.cells[i] = item.cells[i]
+ .replace(/^ *\| *| *\| *$/g, '')
+ .split(/ *\| */);
+ }
+
+ this.tokens.push(item);
+
+ continue;
+ }
+
+ // top-level paragraph
+ if (top && (cap = this.rules.paragraph.exec(src))) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'paragraph',
+ text: cap[1].charAt(cap[1].length - 1) === '\n'
+ ? cap[1].slice(0, -1)
+ : cap[1]
+ });
+ continue;
+ }
+
+ // text
+ if (cap = this.rules.text.exec(src)) {
+ // Top-level should never reach here.
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'text',
+ text: cap[0]
+ });
+ continue;
+ }
+
+ if (src) {
+ throw new
+ Error('Infinite loop on byte: ' + src.charCodeAt(0));
+ }
+ }
+
+ return this.tokens;
+};
+
+/**
+ * Inline-Level Grammar
+ */
+
+var inline = {
+ escape: /^\\([\\`*{}\[\]()#+\-.!_>])/,
+ autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
+ url: noop,
+ tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,
+ link: /^!?\[(inside)\]\(href\)/,
+ reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
+ nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
+ strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
+ em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
+ code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
+ br: /^ {2,}\n(?!\s*$)/,
+ del: noop,
+ text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
+};
+
+inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;
+inline._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;
+
+inline.link = replace(inline.link)
+ ('inside', inline._inside)
+ ('href', inline._href)
+ ();
+
+inline.reflink = replace(inline.reflink)
+ ('inside', inline._inside)
+ ();
+
+/**
+ * Normal Inline Grammar
+ */
+
+inline.normal = merge({}, inline);
+
+/**
+ * Pedantic Inline Grammar
+ */
+
+inline.pedantic = merge({}, inline.normal, {
+ strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
+ em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/
+});
+
+/**
+ * GFM Inline Grammar
+ */
+
+inline.gfm = merge({}, inline.normal, {
+ escape: replace(inline.escape)('])', '~|])')(),
+ url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,
+ del: /^~~(?=\S)([\s\S]*?\S)~~/,
+ text: replace(inline.text)
+ (']|', '~]|')
+ ('|', '|https?://|')
+ ()
+});
+
+/**
+ * GFM + Line Breaks Inline Grammar
+ */
+
+inline.breaks = merge({}, inline.gfm, {
+ br: replace(inline.br)('{2,}', '*')(),
+ text: replace(inline.gfm.text)('{2,}', '*')()
+});
+
+/**
+ * Inline Lexer & Compiler
+ */
+
+function InlineLexer(links, options) {
+ this.options = options || marked.defaults;
+ this.links = links;
+ this.rules = inline.normal;
+ this.renderer = this.options.renderer || new Renderer;
+ this.renderer.options = this.options;
+
+ if (!this.links) {
+ throw new
+ Error('Tokens array requires a `links` property.');
+ }
+
+ if (this.options.gfm) {
+ if (this.options.breaks) {
+ this.rules = inline.breaks;
+ } else {
+ this.rules = inline.gfm;
+ }
+ } else if (this.options.pedantic) {
+ this.rules = inline.pedantic;
+ }
+}
+
+/**
+ * Expose Inline Rules
+ */
+
+InlineLexer.rules = inline;
+
+/**
+ * Static Lexing/Compiling Method
+ */
+
+InlineLexer.output = function(src, links, options) {
+ var inline = new InlineLexer(links, options);
+ return inline.output(src);
+};
+
+/**
+ * Lexing/Compiling
+ */
+
+InlineLexer.prototype.output = function(src) {
+ var out = ''
+ , link
+ , text
+ , href
+ , cap;
+
+ while (src) {
+ // escape
+ if (cap = this.rules.escape.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += cap[1];
+ continue;
+ }
+
+ // autolink
+ if (cap = this.rules.autolink.exec(src)) {
+ src = src.substring(cap[0].length);
+ if (cap[2] === '@') {
+ text = cap[1].charAt(6) === ':'
+ ? this.mangle(cap[1].substring(7))
+ : this.mangle(cap[1]);
+ href = this.mangle('mailto:') + text;
+ } else {
+ text = escape(cap[1]);
+ href = text;
+ }
+ out += this.renderer.link(href, null, text);
+ continue;
+ }
+
+ // url (gfm)
+ if (!this.inLink && (cap = this.rules.url.exec(src))) {
+ src = src.substring(cap[0].length);
+ text = escape(cap[1]);
+ href = text;
+ out += this.renderer.link(href, null, text);
+ continue;
+ }
+
+ // tag
+ if (cap = this.rules.tag.exec(src)) {
+ if (!this.inLink && /^<a /i.test(cap[0])) {
+ this.inLink = true;
+ } else if (this.inLink && /^<\/a>/i.test(cap[0])) {
+ this.inLink = false;
+ }
+ src = src.substring(cap[0].length);
+ out += this.options.sanitize
+ ? escape(cap[0])
+ : cap[0];
+ continue;
+ }
+
+ // link
+ if (cap = this.rules.link.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.inLink = true;
+ out += this.outputLink(cap, {
+ href: cap[2],
+ title: cap[3]
+ });
+ this.inLink = false;
+ continue;
+ }
+
+ // reflink, nolink
+ if ((cap = this.rules.reflink.exec(src))
+ || (cap = this.rules.nolink.exec(src))) {
+ src = src.substring(cap[0].length);
+ link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
+ link = this.links[link.toLowerCase()];
+ if (!link || !link.href) {
+ out += cap[0].charAt(0);
+ src = cap[0].substring(1) + src;
+ continue;
+ }
+ this.inLink = true;
+ out += this.outputLink(cap, link);
+ this.inLink = false;
+ continue;
+ }
+
+ // strong
+ if (cap = this.rules.strong.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += this.renderer.strong(this.output(cap[2] || cap[1]));
+ continue;
+ }
+
+ // em
+ if (cap = this.rules.em.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += this.renderer.em(this.output(cap[2] || cap[1]));
+ continue;
+ }
+
+ // code
+ if (cap = this.rules.code.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += this.renderer.codespan(escape(cap[2], true));
+ continue;
+ }
+
+ // br
+ if (cap = this.rules.br.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += this.renderer.br();
+ continue;
+ }
+
+ // del (gfm)
+ if (cap = this.rules.del.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += this.renderer.del(this.output(cap[1]));
+ continue;
+ }
+
+ // text
+ if (cap = this.rules.text.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += escape(this.smartypants(cap[0]));
+ continue;
+ }
+
+ if (src) {
+ throw new
+ Error('Infinite loop on byte: ' + src.charCodeAt(0));
+ }
+ }
+
+ return out;
+};
+
+/**
+ * Compile Link
+ */
+
+InlineLexer.prototype.outputLink = function(cap, link) {
+ var href = escape(link.href)
+ , title = link.title ? escape(link.title) : null;
+
+ return cap[0].charAt(0) !== '!'
+ ? this.renderer.link(href, title, this.output(cap[1]))
+ : this.renderer.image(href, title, escape(cap[1]));
+};
+
+/**
+ * Smartypants Transformations
+ */
+
+InlineLexer.prototype.smartypants = function(text) {
+ if (!this.options.smartypants) return text;
+ return text
+ // em-dashes
+ .replace(/--/g, '\u2014')
+ // opening singles
+ .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
+ // closing singles & apostrophes
+ .replace(/'/g, '\u2019')
+ // opening doubles
+ .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
+ // closing doubles
+ .replace(/"/g, '\u201d')
+ // ellipses
+ .replace(/\.{3}/g, '\u2026');
+};
+
+/**
+ * Mangle Links
+ */
+
+InlineLexer.prototype.mangle = function(text) {
+ var out = ''
+ , l = text.length
+ , i = 0
+ , ch;
+
+ for (; i < l; i++) {
+ ch = text.charCodeAt(i);
+ if (Math.random() > 0.5) {
+ ch = 'x' + ch.toString(16);
+ }
+ out += '&#' + ch + ';';
+ }
+
+ return out;
+};
+
+/**
+ * Renderer
+ */
+
+function Renderer(options) {
+ this.options = options || {};
+}
+
+Renderer.prototype.code = function(code, lang, escaped) {
+ if (this.options.highlight) {
+ var out = this.options.highlight(code, lang);
+ if (out != null && out !== code) {
+ escaped = true;
+ code = out;
+ }
+ }
+
+ if (!lang) {
+ return '<pre><code>'
+ + (escaped ? code : escape(code, true))
+ + '\n</code></pre>';
+ }
+
+ return '<pre><code class="'
+ + this.options.langPrefix
+ + escape(lang, true)
+ + '">'
+ + (escaped ? code : escape(code, true))
+ + '\n</code></pre>\n';
+};
+
+Renderer.prototype.blockquote = function(quote) {
+ return '<blockquote>\n' + quote + '</blockquote>\n';
+};
+
+Renderer.prototype.html = function(html) {
+ return html;
+};
+
+Renderer.prototype.heading = function(text, level, raw) {
+ return '<h'
+ + level
+ + ' id="'
+ + this.options.headerPrefix
+ + raw.toLowerCase().replace(/[^\w]+/g, '-')
+ + '">'
+ + text
+ + '</h'
+ + level
+ + '>\n';
+};
+
+Renderer.prototype.hr = function() {
+ return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
+};
+
+Renderer.prototype.list = function(body, ordered) {
+ var type = ordered ? 'ol' : 'ul';
+ return '<' + type + '>\n' + body + '</' + type + '>\n';
+};
+
+Renderer.prototype.listitem = function(text) {
+ return '<li>' + text + '</li>\n';
+};
+
+Renderer.prototype.paragraph = function(text) {
+ return '<p>' + text + '</p>\n';
+};
+
+Renderer.prototype.table = function(header, body) {
+ return '<table>\n'
+ + '<thead>\n'
+ + header
+ + '</thead>\n'
+ + '<tbody>\n'
+ + body
+ + '</tbody>\n'
+ + '</table>\n';
+};
+
+Renderer.prototype.tablerow = function(content) {
+ return '<tr>\n' + content + '</tr>\n';
+};
+
+Renderer.prototype.tablecell = function(content, flags) {
+ var type = flags.header ? 'th' : 'td';
+ var tag = flags.align
+ ? '<' + type + ' style="text-align:' + flags.align + '">'
+ : '<' + type + '>';
+ return tag + content + '</' + type + '>\n';
+};
+
+// span level renderer
+Renderer.prototype.strong = function(text) {
+ return '<strong>' + text + '</strong>';
+};
+
+Renderer.prototype.em = function(text) {
+ return '<em>' + text + '</em>';
+};
+
+Renderer.prototype.codespan = function(text) {
+ return '<code>' + text + '</code>';
+};
+
+Renderer.prototype.br = function() {
+ return this.options.xhtml ? '<br/>' : '<br>';
+};
+
+Renderer.prototype.del = function(text) {
+ return '<del>' + text + '</del>';
+};
+
+Renderer.prototype.link = function(href, title, text) {
+ if (this.options.sanitize) {
+ try {
+ var prot = decodeURIComponent(unescape(href))
+ .replace(/[^\w:]/g, '')
+ .toLowerCase();
+ } catch (e) {
+ return '';
+ }
+ if (prot.indexOf('javascript:') === 0) {
+ return '';
+ }
+ }
+ var out = '<a href="' + href + '"';
+ if (title) {
+ out += ' title="' + title + '"';
+ }
+ out += '>' + text + '</a>';
+ return out;
+};
+
+Renderer.prototype.image = function(href, title, text) {
+ var out = '<img src="' + href + '" alt="' + text + '"';
+ if (title) {
+ out += ' title="' + title + '"';
+ }
+ out += this.options.xhtml ? '/>' : '>';
+ return out;
+};
+
+/**
+ * Parsing & Compiling
+ */
+
+function Parser(options) {
+ this.tokens = [];
+ this.token = null;
+ this.options = options || marked.defaults;
+ this.options.renderer = this.options.renderer || new Renderer;
+ this.renderer = this.options.renderer;
+ this.renderer.options = this.options;
+}
+
+/**
+ * Static Parse Method
+ */
+
+Parser.parse = function(src, options, renderer) {
+ var parser = new Parser(options, renderer);
+ return parser.parse(src);
+};
+
+/**
+ * Parse Loop
+ */
+
+Parser.prototype.parse = function(src) {
+ this.inline = new InlineLexer(src.links, this.options, this.renderer);
+ this.tokens = src.reverse();
+
+ var out = '';
+ while (this.next()) {
+ out += this.tok();
+ }
+
+ return out;
+};
+
+/**
+ * Next Token
+ */
+
+Parser.prototype.next = function() {
+ return this.token = this.tokens.pop();
+};
+
+/**
+ * Preview Next Token
+ */
+
+Parser.prototype.peek = function() {
+ return this.tokens[this.tokens.length - 1] || 0;
+};
+
+/**
+ * Parse Text Tokens
+ */
+
+Parser.prototype.parseText = function() {
+ var body = this.token.text;
+
+ while (this.peek().type === 'text') {
+ body += '\n' + this.next().text;
+ }
+
+ return this.inline.output(body);
+};
+
+/**
+ * Parse Current Token
+ */
+
+Parser.prototype.tok = function() {
+ switch (this.token.type) {
+ case 'space': {
+ return '';
+ }
+ case 'hr': {
+ return this.renderer.hr();
+ }
+ case 'heading': {
+ return this.renderer.heading(
+ this.inline.output(this.token.text),
+ this.token.depth,
+ this.token.text);
+ }
+ case 'code': {
+ return this.renderer.code(this.token.text,
+ this.token.lang,
+ this.token.escaped);
+ }
+ case 'table': {
+ var header = ''
+ , body = ''
+ , i
+ , row
+ , cell
+ , flags
+ , j;
+
+ // header
+ cell = '';
+ for (i = 0; i < this.token.header.length; i++) {
+ flags = { header: true, align: this.token.align[i] };
+ cell += this.renderer.tablecell(
+ this.inline.output(this.token.header[i]),
+ { header: true, align: this.token.align[i] }
+ );
+ }
+ header += this.renderer.tablerow(cell);
+
+ for (i = 0; i < this.token.cells.length; i++) {
+ row = this.token.cells[i];
+
+ cell = '';
+ for (j = 0; j < row.length; j++) {
+ cell += this.renderer.tablecell(
+ this.inline.output(row[j]),
+ { header: false, align: this.token.align[j] }
+ );
+ }
+
+ body += this.renderer.tablerow(cell);
+ }
+ return this.renderer.table(header, body);
+ }
+ case 'blockquote_start': {
+ var body = '';
+
+ while (this.next().type !== 'blockquote_end') {
+ body += this.tok();
+ }
+
+ return this.renderer.blockquote(body);
+ }
+ case 'list_start': {
+ var body = ''
+ , ordered = this.token.ordered;
+
+ while (this.next().type !== 'list_end') {
+ body += this.tok();
+ }
+
+ return this.renderer.list(body, ordered);
+ }
+ case 'list_item_start': {
+ var body = '';
+
+ while (this.next().type !== 'list_item_end') {
+ body += this.token.type === 'text'
+ ? this.parseText()
+ : this.tok();
+ }
+
+ return this.renderer.listitem(body);
+ }
+ case 'loose_item_start': {
+ var body = '';
+
+ while (this.next().type !== 'list_item_end') {
+ body += this.tok();
+ }
+
+ return this.renderer.listitem(body);
+ }
+ case 'html': {
+ var html = !this.token.pre && !this.options.pedantic
+ ? this.inline.output(this.token.text)
+ : this.token.text;
+ return this.renderer.html(html);
+ }
+ case 'paragraph': {
+ return this.renderer.paragraph(this.inline.output(this.token.text));
+ }
+ case 'text': {
+ return this.renderer.paragraph(this.parseText());
+ }
+ }
+};
+
+/**
+ * Helpers
+ */
+
+function escape(html, encode) {
+ return html
+ .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+ .replace(/"/g, '&quot;')
+ .replace(/'/g, '&#39;');
+}
+
+function unescape(html) {
+ return html.replace(/&([#\w]+);/g, function(_, n) {
+ n = n.toLowerCase();
+ if (n === 'colon') return ':';
+ if (n.charAt(0) === '#') {
+ return n.charAt(1) === 'x'
+ ? String.fromCharCode(parseInt(n.substring(2), 16))
+ : String.fromCharCode(+n.substring(1));
+ }
+ return '';
+ });
+}
+
+function replace(regex, opt) {
+ regex = regex.source;
+ opt = opt || '';
+ return function self(name, val) {
+ if (!name) return new RegExp(regex, opt);
+ val = val.source || val;
+ val = val.replace(/(^|[^\[])\^/g, '$1');
+ regex = regex.replace(name, val);
+ return self;
+ };
+}
+
+function noop() {}
+noop.exec = noop;
+
+function merge(obj) {
+ var i = 1
+ , target
+ , key;
+
+ for (; i < arguments.length; i++) {
+ target = arguments[i];
+ for (key in target) {
+ if (Object.prototype.hasOwnProperty.call(target, key)) {
+ obj[key] = target[key];
+ }
+ }
+ }
+
+ return obj;
+}
+
+
+/**
+ * Marked
+ */
+
+function marked(src, opt, callback) {
+ if (callback || typeof opt === 'function') {
+ if (!callback) {
+ callback = opt;
+ opt = null;
+ }
+
+ opt = merge({}, marked.defaults, opt || {});
+
+ var highlight = opt.highlight
+ , tokens
+ , pending
+ , i = 0;
+
+ try {
+ tokens = Lexer.lex(src, opt)
+ } catch (e) {
+ return callback(e);
+ }
+
+ pending = tokens.length;
+
+ var done = function(err) {
+ if (err) {
+ opt.highlight = highlight;
+ return callback(err);
+ }
+
+ var out;
+
+ try {
+ out = Parser.parse(tokens, opt);
+ } catch (e) {
+ err = e;
+ }
+
+ opt.highlight = highlight;
+
+ return err
+ ? callback(err)
+ : callback(null, out);
+ };
+
+ if (!highlight || highlight.length < 3) {
+ return done();
+ }
+
+ delete opt.highlight;
+
+ if (!pending) return done();
+
+ for (; i < tokens.length; i++) {
+ (function(token) {
+ if (token.type !== 'code') {
+ return --pending || done();
+ }
+ return highlight(token.text, token.lang, function(err, code) {
+ if (err) return done(err);
+ if (code == null || code === token.text) {
+ return --pending || done();
+ }
+ token.text = code;
+ token.escaped = true;
+ --pending || done();
+ });
+ })(tokens[i]);
+ }
+
+ return;
+ }
+ try {
+ if (opt) opt = merge({}, marked.defaults, opt);
+ return Parser.parse(Lexer.lex(src, opt), opt);
+ } catch (e) {
+ e.message += '\nPlease report this to https://github.com/chjj/marked.';
+ if ((opt || marked.defaults).silent) {
+ return '<p>An error occured:</p><pre>'
+ + escape(e.message + '', true)
+ + '</pre>';
+ }
+ throw e;
+ }
+}
+
+/**
+ * Options
+ */
+
+marked.options =
+marked.setOptions = function(opt) {
+ merge(marked.defaults, opt);
+ return marked;
+};
+
+marked.defaults = {
+ gfm: true,
+ tables: true,
+ breaks: false,
+ pedantic: false,
+ sanitize: false,
+ smartLists: false,
+ silent: false,
+ highlight: null,
+ langPrefix: 'lang-',
+ smartypants: false,
+ headerPrefix: '',
+ renderer: new Renderer,
+ xhtml: false
+};
+
+/**
+ * Expose
+ */
+
+marked.Parser = Parser;
+marked.parser = Parser.parse;
+
+marked.Renderer = Renderer;
+
+marked.Lexer = Lexer;
+marked.lexer = Lexer.lex;
+
+marked.InlineLexer = InlineLexer;
+marked.inlineLexer = InlineLexer.output;
+
+marked.parse = marked;
+
+if (typeof module !== 'undefined' && typeof exports === 'object') {
+ module.exports = marked;
+} else if (typeof define === 'function' && define.amd) {
+ define(function() { return marked; });
+} else {
+ this.marked = marked;
+}
+
+}).call(function() {
+ return this || (typeof window !== 'undefined' ? window : global);
+}()); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/swagger-oauth.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/swagger-oauth.js
new file mode 100644
index 0000000..31e4e92
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/lib/swagger-oauth.js
@@ -0,0 +1,338 @@
+var appName;
+var popupMask;
+var popupDialog;
+var clientId;
+var realm;
+var redirect_uri;
+var clientSecret;
+var scopeSeparator;
+var additionalQueryStringParams;
+
+function handleLogin() {
+ var scopes = [];
+
+ var auths = window.swaggerUi.api.authSchemes || window.swaggerUi.api.securityDefinitions;
+ if(auths) {
+ var key;
+ var defs = auths;
+ for(key in defs) {
+ var auth = defs[key];
+ if(auth.type === 'oauth2' && auth.scopes) {
+ var scope;
+ if(Array.isArray(auth.scopes)) {
+ // 1.2 support
+ var i;
+ for(i = 0; i < auth.scopes.length; i++) {
+ scopes.push(auth.scopes[i]);
+ }
+ }
+ else {
+ // 2.0 support
+ for(scope in auth.scopes) {
+ scopes.push({scope: scope, description: auth.scopes[scope], OAuthSchemeKey: key});
+ }
+ }
+ }
+ }
+ }
+
+ if(window.swaggerUi.api
+ && window.swaggerUi.api.info) {
+ appName = window.swaggerUi.api.info.title;
+ }
+
+ $('.api-popup-dialog').remove();
+ popupDialog = $(
+ [
+ '<div class="api-popup-dialog">',
+ '<div class="api-popup-title">Select OAuth2.0 Scopes</div>',
+ '<div class="api-popup-content">',
+ '<p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.',
+ '<a href="#">Learn how to use</a>',
+ '</p>',
+ '<p><strong>' + appName + '</strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>',
+ '<ul class="api-popup-scopes">',
+ '</ul>',
+ '<p class="error-msg"></p>',
+ '<div class="api-popup-actions"><button class="api-popup-authbtn api-button green" type="button">Authorize</button><button class="api-popup-cancel api-button gray" type="button">Cancel</button></div>',
+ '</div>',
+ '</div>'].join(''));
+ $(document.body).append(popupDialog);
+
+ //TODO: only display applicable scopes (will need to pass them into handleLogin)
+ popup = popupDialog.find('ul.api-popup-scopes').empty();
+ for (i = 0; i < scopes.length; i ++) {
+ scope = scopes[i];
+ str = '<li><input type="checkbox" id="scope_' + i + '" scope="' + scope.scope + '"' +'" oauthtype="' + scope.OAuthSchemeKey +'"/>' + '<label for="scope_' + i + '">' + scope.scope ;
+ if (scope.description) {
+ if ($.map(auths, function(n, i) { return i; }).length > 1) //if we have more than one scheme, display schemes
+ str += '<br/><span class="api-scope-desc">' + scope.description + ' ('+ scope.OAuthSchemeKey+')' +'</span>';
+ else
+ str += '<br/><span class="api-scope-desc">' + scope.description + '</span>';
+ }
+ str += '</label></li>';
+ popup.append(str);
+ }
+
+ var $win = $(window),
+ dw = $win.width(),
+ dh = $win.height(),
+ st = $win.scrollTop(),
+ dlgWd = popupDialog.outerWidth(),
+ dlgHt = popupDialog.outerHeight(),
+ top = (dh -dlgHt)/2 + st,
+ left = (dw - dlgWd)/2;
+
+ popupDialog.css({
+ top: (top < 0? 0 : top) + 'px',
+ left: (left < 0? 0 : left) + 'px'
+ });
+
+ popupDialog.find('button.api-popup-cancel').click(function() {
+ popupMask.hide();
+ popupDialog.hide();
+ popupDialog.empty();
+ popupDialog = [];
+ });
+
+ $('button.api-popup-authbtn').unbind();
+ popupDialog.find('button.api-popup-authbtn').click(function() {
+ popupMask.hide();
+ popupDialog.hide();
+
+ var authSchemes = window.swaggerUi.api.authSchemes;
+ var host = window.location;
+ var pathname = location.pathname.substring(0, location.pathname.lastIndexOf("/"));
+ var defaultRedirectUrl = host.protocol + '//' + host.host + pathname + '/o2c.html';
+ var redirectUrl = window.oAuthRedirectUrl || defaultRedirectUrl;
+ var url = null;
+ var scopes = []
+ var o = popup.find('input:checked');
+ var OAuthSchemeKeys = [];
+ var state;
+ for(k =0; k < o.length; k++) {
+ var scope = $(o[k]).attr('scope');
+ if (scopes.indexOf(scope) === -1)
+ scopes.push(scope);
+ var OAuthSchemeKey = $(o[k]).attr('oauthtype');
+ if (OAuthSchemeKeys.indexOf(OAuthSchemeKey) === -1)
+ OAuthSchemeKeys.push(OAuthSchemeKey);
+ }
+
+ //TODO: merge not replace if scheme is different from any existing
+ //(needs to be aware of schemes to do so correctly)
+ window.enabledScopes=scopes;
+
+ for (var key in authSchemes) {
+ if (authSchemes.hasOwnProperty(key) && OAuthSchemeKeys.indexOf(key) != -1) { //only look at keys that match this scope.
+ var flow = authSchemes[key].flow;
+
+ if(authSchemes[key].type === 'oauth2' && flow && (flow === 'implicit' || flow === 'accessCode')) {
+ var dets = authSchemes[key];
+ url = dets.authorizationUrl + '?response_type=' + (flow === 'implicit' ? 'token' : 'code');
+ window.swaggerUi.tokenName = dets.tokenName || 'access_token';
+ window.swaggerUi.tokenUrl = (flow === 'accessCode' ? dets.tokenUrl : null);
+ state = key;
+ }
+ else if(authSchemes[key].type === 'oauth2' && flow && (flow === 'application')) {
+ var dets = authSchemes[key];
+ window.swaggerUi.tokenName = dets.tokenName || 'access_token';
+ clientCredentialsFlow(scopes, dets.tokenUrl, key);
+ return;
+ }
+ else if(authSchemes[key].grantTypes) {
+ // 1.2 support
+ var o = authSchemes[key].grantTypes;
+ for(var t in o) {
+ if(o.hasOwnProperty(t) && t === 'implicit') {
+ var dets = o[t];
+ var ep = dets.loginEndpoint.url;
+ url = dets.loginEndpoint.url + '?response_type=token';
+ window.swaggerUi.tokenName = dets.tokenName;
+ }
+ else if (o.hasOwnProperty(t) && t === 'accessCode') {
+ var dets = o[t];
+ var ep = dets.tokenRequestEndpoint.url;
+ url = dets.tokenRequestEndpoint.url + '?response_type=code';
+ window.swaggerUi.tokenName = dets.tokenName;
+ }
+ }
+ }
+ }
+ }
+
+ redirect_uri = redirectUrl;
+
+ url += '&redirect_uri=' + encodeURIComponent(redirectUrl);
+ url += '&realm=' + encodeURIComponent(realm);
+ url += '&client_id=' + encodeURIComponent(clientId);
+ url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator));
+ url += '&state=' + encodeURIComponent(state);
+ for (var key in additionalQueryStringParams) {
+ url += '&' + key + '=' + encodeURIComponent(additionalQueryStringParams[key]);
+ }
+
+ window.open(url);
+ });
+
+ popupMask.show();
+ popupDialog.show();
+ return;
+}
+
+
+function handleLogout() {
+ for(key in window.swaggerUi.api.clientAuthorizations.authz){
+ window.swaggerUi.api.clientAuthorizations.remove(key)
+ }
+ window.enabledScopes = null;
+ $('.api-ic.ic-on').addClass('ic-off');
+ $('.api-ic.ic-on').removeClass('ic-on');
+
+ // set the info box
+ $('.api-ic.ic-warning').addClass('ic-error');
+ $('.api-ic.ic-warning').removeClass('ic-warning');
+}
+
+function initOAuth(opts) {
+ var o = (opts||{});
+ var errors = [];
+
+ appName = (o.appName||errors.push('missing appName'));
+ popupMask = (o.popupMask||$('#api-common-mask'));
+ popupDialog = (o.popupDialog||$('.api-popup-dialog'));
+ clientId = (o.clientId||errors.push('missing client id'));
+ clientSecret = (o.clientSecret||null);
+ realm = (o.realm||errors.push('missing realm'));
+ scopeSeparator = (o.scopeSeparator||' ');
+ additionalQueryStringParams = (o.additionalQueryStringParams||{});
+
+ if(errors.length > 0){
+ log('auth unable initialize oauth: ' + errors);
+ return;
+ }
+
+ //$('pre code').each(function(i, e) {hljs.highlightBlock(e)});
+ $('.api-ic').unbind();
+ $('.api-ic').click(function(s) {
+ if($(s.target).hasClass('ic-off'))
+ handleLogin();
+ else {
+ handleLogout();
+ }
+ false;
+ });
+}
+
+function clientCredentialsFlow(scopes, tokenUrl, OAuthSchemeKey) {
+ var params = {
+ 'client_id': clientId,
+ 'client_secret': clientSecret,
+ 'scope': scopes.join(' '),
+ 'grant_type': 'client_credentials'
+ }
+ $.ajax(
+ {
+ url : tokenUrl,
+ type: "POST",
+ data: params,
+ success:function(data, textStatus, jqXHR)
+ {
+ onOAuthComplete(data,OAuthSchemeKey);
+ },
+ error: function(jqXHR, textStatus, errorThrown)
+ {
+ onOAuthComplete("");
+ }
+ });
+
+ }
+
+window.processOAuthCode = function processOAuthCode(data) {
+ var OAuthSchemeKey = data.state;
+ var params = {
+ 'client_id': clientId,
+ 'code': data.code,
+ 'grant_type': 'authorization_code',
+ 'redirect_uri': redirect_uri
+ };
+
+ if (clientSecret) {
+ params.client_secret = clientSecret;
+ }
+
+ $.ajax(
+ {
+ url : window.swaggerUi.tokenUrl,
+ type: "POST",
+ data: params,
+ success:function(data, textStatus, jqXHR)
+ {
+ onOAuthComplete(data, OAuthSchemeKey);
+ },
+ error: function(jqXHR, textStatus, errorThrown)
+ {
+ onOAuthComplete("");
+ }
+ });
+};
+
+window.onOAuthComplete = function onOAuthComplete(token,OAuthSchemeKey) {
+ if(token) {
+ if(token.error) {
+ var checkbox = $('input[type=checkbox],.secured')
+ checkbox.each(function(pos){
+ checkbox[pos].checked = false;
+ });
+ alert(token.error);
+ }
+ else {
+ var b = token[window.swaggerUi.tokenName];
+ if (!OAuthSchemeKey){
+ OAuthSchemeKey = token.state;
+ }
+ if(b){
+ // if all roles are satisfied
+ var o = null;
+ $.each($('.auth .api-ic .api_information_panel'), function(k, v) {
+ var children = v;
+ if(children && children.childNodes) {
+ var requiredScopes = [];
+ $.each((children.childNodes), function (k1, v1){
+ var inner = v1.innerHTML;
+ if(inner)
+ requiredScopes.push(inner);
+ });
+ var diff = [];
+ for(var i=0; i < requiredScopes.length; i++) {
+ var s = requiredScopes[i];
+ if(window.enabledScopes && window.enabledScopes.indexOf(s) == -1) {
+ diff.push(s);
+ }
+ }
+ if(diff.length > 0){
+ o = v.parentNode.parentNode;
+ $(o.parentNode).find('.api-ic.ic-on').addClass('ic-off');
+ $(o.parentNode).find('.api-ic.ic-on').removeClass('ic-on');
+
+ // sorry, not all scopes are satisfied
+ $(o).find('.api-ic').addClass('ic-warning');
+ $(o).find('.api-ic').removeClass('ic-error');
+ }
+ else {
+ o = v.parentNode.parentNode;
+ $(o.parentNode).find('.api-ic.ic-off').addClass('ic-on');
+ $(o.parentNode).find('.api-ic.ic-off').removeClass('ic-off');
+
+ // all scopes are satisfied
+ $(o).find('.api-ic').addClass('ic-info');
+ $(o).find('.api-ic').removeClass('ic-warning');
+ $(o).find('.api-ic').removeClass('ic-error');
+ }
+ }
+ });
+ window.swaggerUi.api.clientAuthorizations.add(OAuthSchemeKey, new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
+ }
+ }
+ }
+};
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/o2c.html b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/o2c.html
new file mode 100644
index 0000000..88e8bf1
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/o2c.html
@@ -0,0 +1,20 @@
+<script>
+var qp = null;
+if(window.location.hash) {
+ qp = location.hash.substring(1);
+}
+else {
+ qp = location.search.substring(1);
+}
+qp = qp ? JSON.parse('{"' + qp.replace(/&/g, '","').replace(/=/g,'":"') + '"}',
+ function(key, value) {
+ return key===""?value:decodeURIComponent(value) }
+ ):{}
+
+if (window.opener.swaggerUi.tokenUrl)
+ window.opener.processOAuthCode(qp);
+else
+ window.opener.onOAuthComplete(qp);
+
+window.close();
+</script> \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/swagger-ui.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/swagger-ui.js
new file mode 100644
index 0000000..839ee18
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/swagger-ui.js
@@ -0,0 +1,27461 @@
+/**
+ * swagger-ui - Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API
+ * @version v2.1.4
+ * @link http://swagger.io
+ * @license Apache-2.0
+ */
+(function(){this["Handlebars"] = this["Handlebars"] || {};
+this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {};
+this["Handlebars"]["templates"]["apikey_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return "<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'><label for='input_apiKey_entry'>"
+ + escapeExpression(((helper = (helper = helpers.keyName || (depth0 != null ? depth0.keyName : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"keyName","hash":{},"data":data}) : helper)))
+ + "</label></div>\n <input placeholder='api_key' class='auth_input' id='input_apiKey_entry' name='apiKey' type='text'/>\n <div class='auth_submit'><a class='auth_submit_button' id='apply_api_key' href='#' data-sw-translate>apply</a></div>\n </div>\n</div>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["basic_auth_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ return "<div class='auth_button' id='basic_auth_button'><img class='auth_icon' src='images/password.jpeg'></div>\n<div class='auth_container' id='basic_auth_container'>\n <div class='key_input_container'>\n <div class=\"auth_label\"><label for=\"input_username\" data-sw-translate>Username</label></div>\n <input placeholder=\"username\" class=\"auth_input\" id=\"input_username\" name=\"username\" type=\"text\"/>\n <div class=\"auth_label\"><label for=\"password\" data-sw-translate>Password</label></div>\n <input placeholder=\"password\" class=\"auth_input\" id=\"input_password\" name=\"password\" type=\"password\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_basic_auth\" href=\"#\">apply</a></div>\n </div>\n</div>\n\n";
+ },"useData":true});
+this["Handlebars"]["templates"]["content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"2":function(depth0,helpers,partials,data) {
+ var lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return " <option value=\""
+ + escapeExpression(lambda(depth0, depth0))
+ + "\">"
+ + escapeExpression(lambda(depth0, depth0))
+ + "</option>\n";
+},"4":function(depth0,helpers,partials,data) {
+ return " <option value=\"application/json\">application/json</option>\n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<label data-sw-translate for=\""
+ + escapeExpression(((helper = (helper = helpers.contentTypeId || (depth0 != null ? depth0.contentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"contentTypeId","hash":{},"data":data}) : helper)))
+ + "\">Response Content Type</label>\n<select name=\"contentType\" id=\""
+ + escapeExpression(((helper = (helper = helpers.contentTypeId || (depth0 != null ? depth0.contentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"contentTypeId","hash":{},"data":data}) : helper)))
+ + "\">\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(4, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</select>\n";
+},"useData":true});
+'use strict';
+
+
+$(function() {
+
+ // Helper function for vertically aligning DOM elements
+ // http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/
+ $.fn.vAlign = function() {
+ return this.each(function(){
+ var ah = $(this).height();
+ var ph = $(this).parent().height();
+ var mh = (ph - ah) / 2;
+ $(this).css('margin-top', mh);
+ });
+ };
+
+ $.fn.stretchFormtasticInputWidthToParent = function() {
+ return this.each(function(){
+ var p_width = $(this).closest("form").innerWidth();
+ var p_padding = parseInt($(this).closest("form").css('padding-left') ,10) + parseInt($(this).closest('form').css('padding-right'), 10);
+ var this_padding = parseInt($(this).css('padding-left'), 10) + parseInt($(this).css('padding-right'), 10);
+ $(this).css('width', p_width - p_padding - this_padding);
+ });
+ };
+
+ $('form.formtastic li.string input, form.formtastic textarea').stretchFormtasticInputWidthToParent();
+
+ // Vertically center these paragraphs
+ // Parent may need a min-height for this to work..
+ $('ul.downplayed li div.content p').vAlign();
+
+ // When a sandbox form is submitted..
+ $("form.sandbox").submit(function(){
+
+ var error_free = true;
+
+ // Cycle through the forms required inputs
+ $(this).find("input.required").each(function() {
+
+ // Remove any existing error styles from the input
+ $(this).removeClass('error');
+
+ // Tack the error style on if the input is empty..
+ if ($(this).val() === '') {
+ $(this).addClass('error');
+ $(this).wiggle();
+ error_free = false;
+ }
+
+ });
+
+ return error_free;
+ });
+
+});
+
+function clippyCopiedCallback() {
+ $('#api_key_copied').fadeIn().delay(1000).fadeOut();
+
+ // var b = $("#clippy_tooltip_" + a);
+ // b.length != 0 && (b.attr("title", "copied!").trigger("tipsy.reload"), setTimeout(function() {
+ // b.attr("title", "copy to clipboard")
+ // },
+ // 500))
+}
+
+// Logging function that accounts for browsers that don't have window.console
+function log(){
+ log.history = log.history || [];
+ log.history.push(arguments);
+ if(this.console){
+ console.log( Array.prototype.slice.call(arguments)[0] );
+ }
+}
+
+// Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
+if (Function.prototype.bind && console && typeof console.log === "object") {
+ [
+ "log","info","warn","error","assert","dir","clear","profile","profileEnd"
+ ].forEach(function (method) {
+ console[method] = this.bind(console[method], console);
+ }, Function.prototype.call);
+}
+
+window.Docs = {
+
+ shebang: function() {
+
+ // If shebang has an operation nickname in it..
+ // e.g. /docs/#!/words/get_search
+ var fragments = $.param.fragment().split('/');
+ fragments.shift(); // get rid of the bang
+
+ switch (fragments.length) {
+ case 1:
+ if (fragments[0].length > 0) { // prevent matching "#/"
+ // Expand all operations for the resource and scroll to it
+ var dom_id = 'resource_' + fragments[0];
+
+ Docs.expandEndpointListForResource(fragments[0]);
+ $("#"+dom_id).slideto({highlight: false});
+ }
+ break;
+ case 2:
+ // Refer to the endpoint DOM element, e.g. #words_get_search
+
+ // Expand Resource
+ Docs.expandEndpointListForResource(fragments[0]);
+ $("#"+dom_id).slideto({highlight: false});
+
+ // Expand operation
+ var li_dom_id = fragments.join('_');
+ var li_content_dom_id = li_dom_id + "_content";
+
+
+ Docs.expandOperation($('#'+li_content_dom_id));
+ $('#'+li_dom_id).slideto({highlight: false});
+ break;
+ }
+ },
+
+ toggleEndpointListForResource: function(resource) {
+ var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints');
+ if (elem.is(':visible')) {
+ $.bbq.pushState('#/', 2);
+ Docs.collapseEndpointListForResource(resource);
+ } else {
+ $.bbq.pushState('#/' + resource, 2);
+ Docs.expandEndpointListForResource(resource);
+ }
+ },
+
+ // Expand resource
+ expandEndpointListForResource: function(resource) {
+ var resource = Docs.escapeResourceName(resource);
+ if (resource == '') {
+ $('.resource ul.endpoints').slideDown();
+ return;
+ }
+
+ $('li#resource_' + resource).addClass('active');
+
+ var elem = $('li#resource_' + resource + ' ul.endpoints');
+ elem.slideDown();
+ },
+
+ // Collapse resource and mark as explicitly closed
+ collapseEndpointListForResource: function(resource) {
+ var resource = Docs.escapeResourceName(resource);
+ if (resource == '') {
+ $('.resource ul.endpoints').slideUp();
+ return;
+ }
+
+ $('li#resource_' + resource).removeClass('active');
+
+ var elem = $('li#resource_' + resource + ' ul.endpoints');
+ elem.slideUp();
+ },
+
+ expandOperationsForResource: function(resource) {
+ // Make sure the resource container is open..
+ Docs.expandEndpointListForResource(resource);
+
+ if (resource == '') {
+ $('.resource ul.endpoints li.operation div.content').slideDown();
+ return;
+ }
+
+ $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
+ Docs.expandOperation($(this));
+ });
+ },
+
+ collapseOperationsForResource: function(resource) {
+ // Make sure the resource container is open..
+ Docs.expandEndpointListForResource(resource);
+
+ if (resource == '') {
+ $('.resource ul.endpoints li.operation div.content').slideUp();
+ return;
+ }
+
+ $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
+ Docs.collapseOperation($(this));
+ });
+ },
+
+ escapeResourceName: function(resource) {
+ return resource.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&");
+ },
+
+ expandOperation: function(elem) {
+ elem.slideDown();
+ },
+
+ collapseOperation: function(elem) {
+ elem.slideUp();
+ }
+};
+
+'use strict';
+
+Handlebars.registerHelper('sanitize', function(html) {
+ // Strip the script tags from the html, and return it as a Handlebars.SafeString
+ html = html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
+ return new Handlebars.SafeString(html);
+});
+
+Handlebars.registerHelper('renderTextParam', function(param) {
+ var result, type = 'text', idAtt = '';
+ var paramType = param.type || param.schema.type || '';
+ var isArray = paramType.toLowerCase() === 'array' || param.allowMultiple;
+ var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
+
+ var dataVendorExtensions = Object.keys(param).filter(function(property) {
+ // filter X-data- properties
+ return property.match(/^X-data-/i) !== null;
+ }).reduce(function(result, property) {
+ // remove X- from property name, so it results in html attributes like data-foo='bar'
+ return result += ' ' + property.substring(2, property.length) + '=\'' + param[property] + '\'';
+ }, '');
+
+ if (typeof defaultValue === 'undefined') {
+ defaultValue = '';
+ }
+
+ if(param.format && param.format === 'password') {
+ type = 'password';
+ }
+
+ if(param.valueId) {
+ idAtt = ' id=\'' + param.valueId + '\'';
+ }
+
+ if (typeof defaultValue === 'string' || defaultValue instanceof String) {
+ defaultValue = defaultValue.replace(/'/g,'&apos;');
+ }
+
+ if(isArray) {
+ result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt + dataVendorExtensions;
+ result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>';
+ result += defaultValue + '</textarea>';
+ } else {
+ var parameterClass = 'parameter';
+ if(param.required) {
+ parameterClass += ' required';
+ }
+ result = '<input class=\'' + parameterClass + '\' minlength=\'' + (param.required ? 1 : 0) + '\'';
+ result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'' + idAtt + dataVendorExtensions;
+ result += ' type=\'' + type + '\' value=\'' + defaultValue + '\'/>';
+ }
+ return new Handlebars.SafeString(result);
+});
+
+this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <div class=\"info_title\">"
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0))
+ + "</div>\n <div class=\"info_description markdown\">";
+ stack1 = lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.description : stack1), depth0);
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</div>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.externalDocs : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += " ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1), {"name":"if","hash":{},"fn":this.program(6, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), {"name":"if","hash":{},"fn":this.program(8, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1), {"name":"if","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1), {"name":"if","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "\n";
+},"2":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return " <p>"
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.description : stack1), depth0))
+ + "</p>\n <a href=\""
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.url : stack1), depth0))
+ + "\" target=\"_blank\">"
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.url : stack1), depth0))
+ + "</a>\n";
+},"4":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return "<div class=\"info_tos\"><a href=\""
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1), depth0))
+ + "\" data-sw-translate>Terms of service</a></div>";
+},"6":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return "<div class='info_name' data-sw-translate>Created by "
+ + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1), depth0))
+ + "</div>";
+},"8":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return "<div class='info_url' data-sw-translate>See more at <a href=\""
+ + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), depth0))
+ + "\">"
+ + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), depth0))
+ + "</a></div>";
+},"10":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return "<div class='info_email'><a target=\"_parent\" href=\"mailto:"
+ + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1), depth0))
+ + "?subject="
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0))
+ + "\" data-sw-translate>Contact the developer</a></div>";
+},"12":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return "<div class='info_license'><a href='"
+ + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1)) != null ? stack1.url : stack1), depth0))
+ + "'>"
+ + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1)) != null ? stack1.name : stack1), depth0))
+ + "</a></div>";
+},"14":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return " , <span style=\"font-variant: small-caps\" data-sw-translate>api version</span>: "
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), depth0))
+ + "\n ";
+},"16":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <span style=\"float:right\"><a href=\""
+ + escapeExpression(((helper = (helper = helpers.validatorUrl || (depth0 != null ? depth0.validatorUrl : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"validatorUrl","hash":{},"data":data}) : helper)))
+ + "/debug?url="
+ + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper)))
+ + "\"><img id=\"validator\" src=\""
+ + escapeExpression(((helper = (helper = helpers.validatorUrl || (depth0 != null ? depth0.validatorUrl : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"validatorUrl","hash":{},"data":data}) : helper)))
+ + "?url="
+ + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper)))
+ + "\"></a>\n </span>\n";
+},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class='info' id='api_info'>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.info : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</div>\n<div class='container' id='resources_container'>\n <ul id='resources'></ul>\n\n <div class=\"footer\">\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: "
+ + escapeExpression(((helper = (helper = helpers.basePath || (depth0 != null ? depth0.basePath : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"basePath","hash":{},"data":data}) : helper)))
+ + "\n";
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), {"name":"if","hash":{},"fn":this.program(14, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "]\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.validatorUrl : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </h4>\n </div>\n</div>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ return "deprecated";
+ },"3":function(depth0,helpers,partials,data) {
+ return " <h4><span data-sw-translate>Warning: Deprecated</span></h4>\n";
+ },"5":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = " <h4><span data-sw-translate>Implementation Notes</span></h4>\n <div class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</div>\n";
+},"7":function(depth0,helpers,partials,data) {
+ return " <div class=\"auth\">\n <span class=\"api-ic ic-error\">";
+ },"9":function(depth0,helpers,partials,data) {
+ var stack1, buffer = " <div class=\"api_information_panel\">\n";
+ stack1 = helpers.each.call(depth0, depth0, {"name":"each","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </div>\n";
+},"10":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <div title='";
+ stack1 = lambda((depth0 != null ? depth0.description : depth0), depth0);
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "'>"
+ + escapeExpression(lambda((depth0 != null ? depth0.scope : depth0), depth0))
+ + "</div>\n";
+},"12":function(depth0,helpers,partials,data) {
+ return "</span></div>";
+ },"14":function(depth0,helpers,partials,data) {
+ return " <div class='access'>\n <span class=\"api-ic ic-off\" title=\"click to authenticate\"></span>\n </div>\n";
+ },"16":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = " <div class=\"response-class\">\n <h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> "
+ + escapeExpression(((helper = (helper = helpers.successCode || (depth0 != null ? depth0.successCode : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"successCode","hash":{},"data":data}) : helper)))
+ + ")</h4>\n ";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.successDescription : depth0), {"name":"if","hash":{},"fn":this.program(17, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "\n <p><span class=\"model-signature\" /></p>\n <br/>\n <div class=\"response-content-type\" />\n </div>\n";
+},"17":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = "<div class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.successDescription || (depth0 != null ? depth0.successDescription : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"successDescription","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</div>";
+},"19":function(depth0,helpers,partials,data) {
+ var stack1, buffer = " <h4 data-sw-translate>Headers</h4>\n <table class=\"headers\">\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Header</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Description</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Type</th>\n <th style=\"width: 320px; max-width: 320px\" data-sw-translate>Other</th>\n </tr>\n </thead>\n <tbody>\n";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.headers : depth0), {"name":"each","hash":{},"fn":this.program(20, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </tbody>\n </table>\n";
+},"20":function(depth0,helpers,partials,data) {
+ var lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return " <tr>\n <td>"
+ + escapeExpression(lambda((data && data.key), depth0))
+ + "</td>\n <td>"
+ + escapeExpression(lambda((depth0 != null ? depth0.description : depth0), depth0))
+ + "</td>\n <td>"
+ + escapeExpression(lambda((depth0 != null ? depth0.type : depth0), depth0))
+ + "</td>\n <td>"
+ + escapeExpression(lambda((depth0 != null ? depth0.other : depth0), depth0))
+ + "</td>\n </tr>\n";
+},"22":function(depth0,helpers,partials,data) {
+ return " <h4 data-sw-translate>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Value</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Description</th>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter Type</th>\n <th style=\"width: 220px; max-width: 230px\" data-sw-translate>Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n";
+ },"24":function(depth0,helpers,partials,data) {
+ return " <div style='margin:0;padding:0;display:inline'></div>\n <h4 data-sw-translate>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th data-sw-translate>HTTP Status Code</th>\n <th data-sw-translate>Reason</th>\n <th data-sw-translate>Response Model</th>\n <th data-sw-translate>Headers</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n </tbody>\n </table>\n";
+ },"26":function(depth0,helpers,partials,data) {
+ return "";
+},"28":function(depth0,helpers,partials,data) {
+ return " <div class='sandbox_header'>\n <input class='submit' type='submit' value='Try it out!' data-sw-translate/>\n <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n";
+ },"30":function(depth0,helpers,partials,data) {
+ return " <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = " <ul class='operations' >\n <li class='"
+ + escapeExpression(((helper = (helper = helpers.method || (depth0 != null ? depth0.method : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"method","hash":{},"data":data}) : helper)))
+ + " operation' id='"
+ + escapeExpression(((helper = (helper = helpers.parentId || (depth0 != null ? depth0.parentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parentId","hash":{},"data":data}) : helper)))
+ + "_"
+ + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper)))
+ + "'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/"
+ + escapeExpression(((helper = (helper = helpers.encodedParentId || (depth0 != null ? depth0.encodedParentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"encodedParentId","hash":{},"data":data}) : helper)))
+ + "/"
+ + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper)))
+ + "' class=\"toggleOperation\">"
+ + escapeExpression(((helper = (helper = helpers.method || (depth0 != null ? depth0.method : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"method","hash":{},"data":data}) : helper)))
+ + "</a>\n </span>\n <span class='path'>\n <a href='#!/"
+ + escapeExpression(((helper = (helper = helpers.encodedParentId || (depth0 != null ? depth0.encodedParentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"encodedParentId","hash":{},"data":data}) : helper)))
+ + "/"
+ + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper)))
+ + "' class=\"toggleOperation ";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.deprecated : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\">"
+ + escapeExpression(((helper = (helper = helpers.path || (depth0 != null ? depth0.path : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"path","hash":{},"data":data}) : helper)))
+ + "</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/"
+ + escapeExpression(((helper = (helper = helpers.encodedParentId || (depth0 != null ? depth0.encodedParentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"encodedParentId","hash":{},"data":data}) : helper)))
+ + "/"
+ + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper)))
+ + "' class=\"toggleOperation\">";
+ stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"summary","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</a>\n </li>\n </ul>\n </div>\n <div class='content' id='"
+ + escapeExpression(((helper = (helper = helpers.parentId || (depth0 != null ? depth0.parentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parentId","hash":{},"data":data}) : helper)))
+ + "_"
+ + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper)))
+ + "_content' style='display:none'>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.deprecated : depth0), {"name":"if","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.description : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = ((helper = (helper = helpers.oauth || (depth0 != null ? depth0.oauth : depth0)) != null ? helper : helperMissing),(options={"name":"oauth","hash":{},"fn":this.program(7, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
+ if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.oauth : depth0), {"name":"each","hash":{},"fn":this.program(9, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += " ";
+ stack1 = ((helper = (helper = helpers.oauth || (depth0 != null ? depth0.oauth : depth0)) != null ? helper : helperMissing),(options={"name":"oauth","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
+ if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n";
+ stack1 = ((helper = (helper = helpers.oauth || (depth0 != null ? depth0.oauth : depth0)) != null ? helper : helperMissing),(options={"name":"oauth","hash":{},"fn":this.program(14, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
+ if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.type : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.headers : depth0), {"name":"if","hash":{},"fn":this.program(19, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.parameters : depth0), {"name":"if","hash":{},"fn":this.program(22, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.responseMessages : depth0), {"name":"if","hash":{},"fn":this.program(24, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isReadOnly : depth0), {"name":"if","hash":{},"fn":this.program(26, data),"inverse":this.program(28, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += " </form>\n <div class='response' style='display:none'>\n <h4 class='curl'>Curl</h4>\n <div class='block curl'></div>\n <h4 data-sw-translate>Request URL</h4>\n <div class='block request_url'></div>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showRequestHeaders : depth0), {"name":"if","hash":{},"fn":this.program(30, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " <h4 data-sw-translate>Response Body</h4>\n <div class='block response_body'></div>\n <h4 data-sw-translate>Response Code</h4>\n <div class='block response_code'></div>\n <h4 data-sw-translate>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["param_list"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ return " required";
+ },"3":function(depth0,helpers,partials,data) {
+ return " multiple=\"multiple\"";
+ },"5":function(depth0,helpers,partials,data) {
+ return " required ";
+ },"7":function(depth0,helpers,partials,data) {
+ var stack1, buffer = " <option ";
+ stack1 = helpers.unless.call(depth0, (depth0 != null ? depth0.hasDefault : depth0), {"name":"unless","hash":{},"fn":this.program(8, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " value=''></option>\n";
+},"8":function(depth0,helpers,partials,data) {
+ return " selected=\"\" ";
+ },"10":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "\n <option ";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isDefault : depth0), {"name":"if","hash":{},"fn":this.program(11, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += " value='"
+ + escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper)))
+ + "'> "
+ + escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper)))
+ + " ";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isDefault : depth0), {"name":"if","hash":{},"fn":this.program(13, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </option>\n\n";
+},"11":function(depth0,helpers,partials,data) {
+ return " selected=\"\" ";
+ },"13":function(depth0,helpers,partials,data) {
+ return " (default) ";
+ },"15":function(depth0,helpers,partials,data) {
+ return "<strong>";
+ },"17":function(depth0,helpers,partials,data) {
+ return "</strong>";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "'><label for='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</label></td>\n<td>\n <select ";
+ stack1 = ((helpers.isArray || (depth0 && depth0.isArray) || helperMissing).call(depth0, depth0, {"name":"isArray","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data}));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += " class=\"parameter ";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\" name=\""
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "\" id=\""
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "\">\n\n";
+ stack1 = helpers.unless.call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"unless","hash":{},"fn":this.program(7, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n";
+ stack1 = helpers.each.call(depth0, ((stack1 = (depth0 != null ? depth0.allowableValues : depth0)) != null ? stack1.descriptiveValues : stack1), {"name":"each","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n </select>\n</td>\n<td class=\"markdown\">";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(15, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(17, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td>";
+ stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["param_readonly_required"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ + "</textarea>\n";
+},"3":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"4":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " "
+ + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ + "\n";
+},"6":function(depth0,helpers,partials,data) {
+ return " (empty)\n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code required'><label for='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</label></td>\n<td>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(3, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td>";
+ stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["param_readonly"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <textarea class='body-textarea' readonly='readonly' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ + "</textarea>\n <div class=\"parameter-content-type\" />\n";
+},"3":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"4":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " "
+ + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ + "\n";
+},"6":function(depth0,helpers,partials,data) {
+ return " (empty)\n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code'><label for='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</label></td>\n<td>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(3, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td>";
+ stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["param_required"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"2":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <input type=\"file\" name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'/>\n";
+},"4":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.program(7, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"5":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <div class=\"editor_holder\"></div>\n <textarea class='body-textarea required' placeholder='(required)' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id=\""
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "\">"
+ + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ + "</textarea>\n <br />\n <div class=\"parameter-content-type\" />\n";
+},"7":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <textarea class='body-textarea required' placeholder='(required)' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'></textarea>\n <div class=\"editor_holder\"></div>\n <br />\n <div class=\"parameter-content-type\" />\n";
+},"9":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(10, data),"inverse":this.program(12, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"10":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <input class='parameter' class='required' type='file' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'/>\n";
+},"12":function(depth0,helpers,partials,data) {
+ var stack1, helperMissing=helpers.helperMissing, buffer = "";
+ stack1 = ((helpers.renderTextParam || (depth0 && depth0.renderTextParam) || helperMissing).call(depth0, depth0, {"name":"renderTextParam","hash":{},"fn":this.program(13, data),"inverse":this.noop,"data":data}));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"13":function(depth0,helpers,partials,data) {
+ return "";
+},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code required'><label for='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</label></td>\n<td>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(9, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td>\n <strong><span class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</span></strong>\n</td>\n<td>";
+ stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["param"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"2":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <input type=\"file\" name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'/>\n <div class=\"parameter-content-type\" />\n";
+},"4":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.program(7, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"5":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <div class=\"editor_holder\"></div>\n <textarea class='body-textarea' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ + "</textarea>\n <br />\n <div class=\"parameter-content-type\" />\n";
+},"7":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <textarea class='body-textarea' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'></textarea>\n <div class=\"editor_holder\"></div>\n <br />\n <div class=\"parameter-content-type\" />\n";
+},"9":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(10, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"10":function(depth0,helpers,partials,data) {
+ var stack1, helperMissing=helpers.helperMissing, buffer = "";
+ stack1 = ((helpers.renderTextParam || (depth0 && depth0.renderTextParam) || helperMissing).call(depth0, depth0, {"name":"renderTextParam","hash":{},"fn":this.program(11, data),"inverse":this.noop,"data":data}));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"11":function(depth0,helpers,partials,data) {
+ return "";
+},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code'><label for='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</label></td>\n<td>\n\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(9, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n</td>\n<td class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td>";
+ stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</td>\n<td>\n <span class=\"model-signature\"></span>\n</td>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["parameter_content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.consumes : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"2":function(depth0,helpers,partials,data) {
+ var lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return " <option value=\""
+ + escapeExpression(lambda(depth0, depth0))
+ + "\">"
+ + escapeExpression(lambda(depth0, depth0))
+ + "</option>\n";
+},"4":function(depth0,helpers,partials,data) {
+ return " <option value=\"application/json\">application/json</option>\n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<label for=\""
+ + escapeExpression(((helper = (helper = helpers.parameterContentTypeId || (depth0 != null ? depth0.parameterContentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parameterContentTypeId","hash":{},"data":data}) : helper)))
+ + "\" data-sw-translate>Parameter content type:</label>\n<select name=\"parameterContentType\" id=\""
+ + escapeExpression(((helper = (helper = helpers.parameterContentTypeId || (depth0 != null ? depth0.parameterContentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parameterContentTypeId","hash":{},"data":data}) : helper)))
+ + "\">\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.consumes : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(4, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</select>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["resource"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ return " : ";
+ },"3":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <li>\n <a href='"
+ + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper)))
+ + "' data-sw-translate>Raw</a>\n </li>\n";
+},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "<div class='heading'>\n <h2>\n <a href='#!/"
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "' class=\"toggleEndpointList\" data-id=\""
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "\">"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</a> ";
+ stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helperMissing),(options={"name":"summary","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
+ if (!helpers.summary) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"summary","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/"
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "' id='endpointListTogger_"
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "' class=\"toggleEndpointList\" data-id=\""
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "\" data-sw-translate>Show/Hide</a>\n </li>\n <li>\n <a href='#' class=\"collapseResource\" data-id=\""
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "\" data-sw-translate>\n List Operations\n </a>\n </li>\n <li>\n <a href='#' class=\"expandResource\" data-id=\""
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "\" data-sw-translate>\n Expand Operations\n </a>\n </li>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.url : depth0), {"name":"if","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </ul>\n</div>\n<ul class='endpoints' id='"
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "_endpoint_list' style='display:none'>\n\n</ul>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["response_content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"2":function(depth0,helpers,partials,data) {
+ var lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return " <option value=\""
+ + escapeExpression(lambda(depth0, depth0))
+ + "\">"
+ + escapeExpression(lambda(depth0, depth0))
+ + "</option>\n";
+},"4":function(depth0,helpers,partials,data) {
+ return " <option value=\"application/json\">application/json</option>\n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<label data-sw-translate for=\""
+ + escapeExpression(((helper = (helper = helpers.responseContentTypeId || (depth0 != null ? depth0.responseContentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"responseContentTypeId","hash":{},"data":data}) : helper)))
+ + "\">Response Content Type</label>\n<select name=\"responseContentType\" id=\""
+ + escapeExpression(((helper = (helper = helpers.responseContentTypeId || (depth0 != null ? depth0.responseContentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"responseContentTypeId","hash":{},"data":data}) : helper)))
+ + "\">\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(4, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</select>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["signature"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = " <div class=\"snippet_json\">\n <pre><code>"
+ + escapeExpression(((helper = (helper = helpers.sampleJSON || (depth0 != null ? depth0.sampleJSON : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"sampleJSON","hash":{},"data":data}) : helper)))
+ + "</code></pre>\n ";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isParam : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "\n </div>\n";
+},"2":function(depth0,helpers,partials,data) {
+ return "<small class=\"notice\" data-sw-translate></small>";
+ },"4":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = " <div class=\"snippet_xml\">\n <pre><code>"
+ + escapeExpression(((helper = (helper = helpers.sampleXML || (depth0 != null ? depth0.sampleXML : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"sampleXML","hash":{},"data":data}) : helper)))
+ + "</code></pre>\n ";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isParam : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "\n </div>\n";
+},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = "<div>\n<ul class=\"signature-nav\">\n <li><a class=\"description-link\" href=\"#\" data-sw-translate>Model</a></li>\n <li><a class=\"snippet-link\" href=\"#\" data-sw-translate>Example Value</a></li>\n</ul>\n<div>\n\n<div class=\"signature-container\">\n <div class=\"description\">\n ";
+ stack1 = ((helper = (helper = helpers.signature || (depth0 != null ? depth0.signature : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signature","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n </div>\n\n <div class=\"snippet\">\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.sampleJSON : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.sampleXML : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </div>\n</div>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["status_code"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return " <tr>\n <td>"
+ + escapeExpression(lambda((data && data.key), depth0))
+ + "</td>\n <td>"
+ + escapeExpression(lambda((depth0 != null ? depth0.description : depth0), depth0))
+ + "</td>\n <td>"
+ + escapeExpression(lambda((depth0 != null ? depth0.type : depth0), depth0))
+ + "</td>\n </tr>\n";
+},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td width='15%' class='code'>"
+ + escapeExpression(((helper = (helper = helpers.code || (depth0 != null ? depth0.code : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"code","hash":{},"data":data}) : helper)))
+ + "</td>\n<td class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.message || (depth0 != null ? depth0.message : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"message","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td width='50%'><span class=\"model-signature\" /></td>\n<td class=\"headers\">\n <table>\n <tbody>\n";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.headers : depth0), {"name":"each","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </tbody>\n </table>\n</td>";
+},"useData":true});
+/**
+ * swagger-client - swagger-client is a javascript client for use with swaggering APIs.
+ * @version v2.1.11
+ * @link http://swagger.io
+ * @license Apache-2.0
+ */
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.SwaggerClient = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
+'use strict';
+
+var auth = require('./lib/auth');
+var helpers = require('./lib/helpers');
+var SwaggerClient = require('./lib/client');
+var deprecationWrapper = function (url, options) {
+ helpers.log('This is deprecated, use "new SwaggerClient" instead.');
+
+ return new SwaggerClient(url, options);
+};
+
+/* Here for IE8 Support */
+if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function(obj, start) {
+ for (var i = (start || 0), j = this.length; i < j; i++) {
+ if (this[i] === obj) { return i; }
+ }
+ return -1;
+ };
+}
+
+/* Here for IE8 Support */
+if (!String.prototype.trim) {
+ String.prototype.trim = function () {
+ return this.replace(/^\s+|\s+$/g, '');
+ };
+}
+
+/* Here for node 10.x support */
+if (!String.prototype.endsWith) {
+ String.prototype.endsWith = function(suffix) {
+ return this.indexOf(suffix, this.length - suffix.length) !== -1;
+ };
+}
+
+module.exports = SwaggerClient;
+
+SwaggerClient.ApiKeyAuthorization = auth.ApiKeyAuthorization;
+SwaggerClient.PasswordAuthorization = auth.PasswordAuthorization;
+SwaggerClient.CookieAuthorization = auth.CookieAuthorization;
+SwaggerClient.SwaggerApi = deprecationWrapper;
+SwaggerClient.SwaggerClient = deprecationWrapper;
+SwaggerClient.SchemaMarkup = require('./lib/schema-markup');
+
+},{"./lib/auth":2,"./lib/client":3,"./lib/helpers":4,"./lib/schema-markup":7}],2:[function(require,module,exports){
+'use strict';
+
+var helpers = require('./helpers');
+var btoa = require('btoa'); // jshint ignore:line
+var CookieJar = require('cookiejar').CookieJar;
+var _ = {
+ each: require('lodash-compat/collection/each'),
+ includes: require('lodash-compat/collection/includes'),
+ isObject: require('lodash-compat/lang/isObject'),
+ isArray: require('lodash-compat/lang/isArray')
+};
+
+/**
+ * SwaggerAuthorizations applys the correct authorization to an operation being executed
+ */
+var SwaggerAuthorizations = module.exports.SwaggerAuthorizations = function (authz) {
+ this.authz = authz || {};
+};
+
+/**
+ * Add auths to the hash
+ * Will overwrite any existing
+ *
+ */
+SwaggerAuthorizations.prototype.add = function (name, auth) {
+ if(_.isObject(name)) {
+ for (var key in name) {
+ this.authz[key] = name[key];
+ }
+ } else if(typeof name === 'string' ){
+ this.authz[name] = auth;
+ }
+
+ return auth;
+};
+
+SwaggerAuthorizations.prototype.remove = function (name) {
+ return delete this.authz[name];
+};
+
+SwaggerAuthorizations.prototype.apply = function (obj, securities) {
+ var status = true;
+ var applyAll = !securities;
+ var flattenedSecurities = [];
+
+ // Securities could be [ {} ]
+ _.each(securities, function (obj, key) {
+
+ // Make sure we account for securities being [ str ]
+ if(typeof key === 'string') {
+ flattenedSecurities.push(key);
+ }
+
+ // Flatten keys in to our array
+ _.each(obj, function (val, key) {
+ flattenedSecurities.push(key);
+ });
+ });
+
+ _.each(this.authz, function (auth, authName) {
+ if(applyAll || _.includes(flattenedSecurities, authName)) {
+ var newStatus = auth.apply(obj);
+ status = status && !!newStatus; // logical ORs regarding status
+ }
+ });
+
+ return status;
+};
+
+/**
+ * ApiKeyAuthorization allows a query param or header to be injected
+ */
+var ApiKeyAuthorization = module.exports.ApiKeyAuthorization = function (name, value, type) {
+ this.name = name;
+ this.value = value;
+ this.type = type;
+};
+
+ApiKeyAuthorization.prototype.apply = function (obj) {
+ if (this.type === 'query') {
+ // see if already applied. If so, don't do it again
+
+ var qp;
+ if (obj.url.indexOf('?') > 0) {
+ qp = obj.url.substring(obj.url.indexOf('?') + 1);
+ var parts = qp.split('&');
+ if(parts && parts.length > 0) {
+ for(var i = 0; i < parts.length; i++) {
+ var kv = parts[i].split('=');
+ if(kv && kv.length > 0) {
+ if (kv[0] === this.name) {
+ // skip it
+ return false;
+ }
+ }
+ }
+ }
+ }
+
+ if (obj.url.indexOf('?') > 0) {
+ obj.url = obj.url + '&' + this.name + '=' + this.value;
+ } else {
+ obj.url = obj.url + '?' + this.name + '=' + this.value;
+ }
+
+ return true;
+ } else if (this.type === 'header') {
+ if(typeof obj.headers[this.name] === 'undefined') {
+ obj.headers[this.name] = this.value;
+ }
+
+ return true;
+ }
+};
+
+var CookieAuthorization = module.exports.CookieAuthorization = function (cookie) {
+ this.cookie = cookie;
+};
+
+CookieAuthorization.prototype.apply = function (obj) {
+ obj.cookieJar = obj.cookieJar || new CookieJar();
+ obj.cookieJar.setCookie(this.cookie);
+
+ return true;
+};
+
+/**
+ * Password Authorization is a basic auth implementation
+ */
+var PasswordAuthorization = module.exports.PasswordAuthorization = function (username, password) {
+ if (arguments.length === 3) {
+ helpers.log('PasswordAuthorization: the \'name\' argument has been removed, pass only username and password');
+ username = arguments[1];
+ password = arguments[2];
+ }
+ this.username = username;
+ this.password = password;
+};
+
+PasswordAuthorization.prototype.apply = function (obj) {
+ if(typeof obj.headers.Authorization === 'undefined') {
+ obj.headers.Authorization = 'Basic ' + btoa(this.username + ':' + this.password);
+ }
+
+ return true;
+};
+
+},{"./helpers":4,"btoa":14,"cookiejar":19,"lodash-compat/collection/each":56,"lodash-compat/collection/includes":59,"lodash-compat/lang/isArray":144,"lodash-compat/lang/isObject":148}],3:[function(require,module,exports){
+'use strict';
+
+var _ = {
+ bind: require('lodash-compat/function/bind'),
+ cloneDeep: require('lodash-compat/lang/cloneDeep'),
+ find: require('lodash-compat/collection/find'),
+ forEach: require('lodash-compat/collection/forEach'),
+ indexOf: require('lodash-compat/array/indexOf'),
+ isArray: require('lodash-compat/lang/isArray'),
+ isObject: require('lodash-compat/lang/isObject'),
+ isFunction: require('lodash-compat/lang/isFunction'),
+ isPlainObject: require('lodash-compat/lang/isPlainObject'),
+ isUndefined: require('lodash-compat/lang/isUndefined')
+};
+var auth = require('./auth');
+var helpers = require('./helpers');
+var Model = require('./types/model');
+var Operation = require('./types/operation');
+var OperationGroup = require('./types/operationGroup');
+var Resolver = require('./resolver');
+var SwaggerHttp = require('./http');
+var SwaggerSpecConverter = require('./spec-converter');
+var Q = require('q');
+
+// We have to keep track of the function/property names to avoid collisions for tag names which are used to allow the
+// following usage: 'client.{tagName}'
+var reservedClientTags = [
+ 'apis',
+ 'authorizationScheme',
+ 'authorizations',
+ 'basePath',
+ 'build',
+ 'buildFrom1_1Spec',
+ 'buildFrom1_2Spec',
+ 'buildFromSpec',
+ 'clientAuthorizations',
+ 'convertInfo',
+ 'debug',
+ 'defaultErrorCallback',
+ 'defaultSuccessCallback',
+ 'enableCookies',
+ 'fail',
+ 'failure',
+ 'finish',
+ 'help',
+ 'idFromOp',
+ 'info',
+ 'initialize',
+ 'isBuilt',
+ 'isValid',
+ 'modelPropertyMacro',
+ 'models',
+ 'modelsArray',
+ 'options',
+ 'parameterMacro',
+ 'parseUri',
+ 'progress',
+ 'resourceCount',
+ 'sampleModels',
+ 'selfReflect',
+ 'setConsolidatedModels',
+ 'spec',
+ 'supportedSubmitMethods',
+ 'swaggerRequestHeaders',
+ 'tagFromLabel',
+ 'title',
+ 'url',
+ 'useJQuery'
+];
+// We have to keep track of the function/property names to avoid collisions for tag names which are used to allow the
+// following usage: 'client.apis.{tagName}'
+var reservedApiTags = [
+ 'apis',
+ 'asCurl',
+ 'description',
+ 'externalDocs',
+ 'help',
+ 'label',
+ 'name',
+ 'operation',
+ 'operations',
+ 'operationsArray',
+ 'path',
+ 'tag'
+];
+var supportedOperationMethods = ['delete', 'get', 'head', 'options', 'patch', 'post', 'put'];
+var SwaggerClient = module.exports = function (url, options) {
+ this.authorizations = null;
+ this.authorizationScheme = null;
+ this.basePath = null;
+ this.debug = false;
+ this.enableCookies = false;
+ this.info = null;
+ this.isBuilt = false;
+ this.isValid = false;
+ this.modelsArray = [];
+ this.resourceCount = 0;
+ this.url = null;
+ this.useJQuery = false;
+ this.swaggerObject = {};
+ this.deferredClient = Q.defer();
+
+ this.clientAuthorizations = new auth.SwaggerAuthorizations();
+
+ if (typeof url !== 'undefined') {
+ return this.initialize(url, options);
+ } else {
+ return this;
+ }
+};
+
+SwaggerClient.prototype.initialize = function (url, options) {
+ this.models = {};
+ this.sampleModels = {};
+
+ if (typeof url === 'string') {
+ this.url = url;
+ } else if (_.isObject(url)) {
+ options = url;
+ this.url = options.url;
+ }
+
+ options = options || {};
+ this.clientAuthorizations.add(options.authorizations);
+ this.swaggerRequestHeaders = options.swaggerRequestHeaders || 'application/json;charset=utf-8,*/*';
+ this.defaultSuccessCallback = options.defaultSuccessCallback || null;
+ this.defaultErrorCallback = options.defaultErrorCallback || null;
+ this.modelPropertyMacro = options.modelPropertyMacro || null;
+ this.parameterMacro = options.parameterMacro || null;
+ this.usePromise = options.usePromise || null;
+
+ if (typeof options.success === 'function') {
+ this.success = options.success;
+ }
+
+ if (options.useJQuery) {
+ this.useJQuery = options.useJQuery;
+ }
+
+ if (options.enableCookies) {
+ this.enableCookies = options.enableCookies;
+ }
+
+ this.options = options || {};
+
+ this.supportedSubmitMethods = options.supportedSubmitMethods || [];
+ this.failure = options.failure || function (err) { throw err; };
+ this.progress = options.progress || function () {};
+ this.spec = _.cloneDeep(options.spec); // Clone so we do not alter the provided document
+
+ if (options.scheme) {
+ this.scheme = options.scheme;
+ }
+
+ if (this.usePromise || typeof options.success === 'function') {
+ this.ready = true;
+ return this.build();
+ }
+};
+
+SwaggerClient.prototype.build = function (mock) {
+ if (this.isBuilt) {
+ return this;
+ }
+
+ var self = this;
+
+ this.progress('fetching resource list: ' + this.url + '; Please wait.');
+
+ var obj = {
+ useJQuery: this.useJQuery,
+ url: this.url,
+ method: 'get',
+ headers: {
+ accept: this.swaggerRequestHeaders
+ },
+ on: {
+ error: function (response) {
+ if (self.url.substring(0, 4) !== 'http') {
+ return self.fail('Please specify the protocol for ' + self.url);
+ } else if (response.status === 0) {
+ return self.fail('Can\'t read from server. It may not have the appropriate access-control-origin settings.');
+ } else if (response.status === 404) {
+ return self.fail('Can\'t read swagger JSON from ' + self.url);
+ } else {
+ return self.fail(response.status + ' : ' + response.statusText + ' ' + self.url);
+ }
+ },
+ response: function (resp) {
+
+ var responseObj = resp.obj;
+ if(!responseObj) {
+ return self.fail('failed to parse JSON/YAML response');
+ }
+
+ self.swaggerVersion = responseObj.swaggerVersion;
+ self.swaggerObject = responseObj;
+
+ if (responseObj.swagger && parseInt(responseObj.swagger) === 2) {
+ self.swaggerVersion = responseObj.swagger;
+
+ new Resolver().resolve(responseObj, self.url, self.buildFromSpec, self);
+
+ self.isValid = true;
+ } else {
+ var converter = new SwaggerSpecConverter();
+ self.oldSwaggerObject = self.swaggerObject;
+
+ converter.setDocumentationLocation(self.url);
+ converter.convert(responseObj, self.clientAuthorizations, self.options, function(spec) {
+ self.swaggerObject = spec;
+ new Resolver().resolve(spec, self.url, self.buildFromSpec, self);
+ self.isValid = true;
+ });
+ }
+ }
+ }
+ };
+
+ if (this.spec) {
+ self.swaggerObject = this.spec;
+ setTimeout(function () {
+ new Resolver().resolve(self.spec, self.buildFromSpec, self);
+ }, 10);
+ } else {
+ this.clientAuthorizations.apply(obj);
+
+ if (mock) {
+ return obj;
+ }
+
+ new SwaggerHttp().execute(obj, this.options);
+ }
+
+ return (this.usePromise) ? this.deferredClient.promise : this;
+};
+
+SwaggerClient.prototype.buildFromSpec = function (response) {
+ if (this.isBuilt) {
+ return this;
+ }
+
+ this.apis = {};
+ this.apisArray = [];
+ this.basePath = response.basePath || '';
+ this.consumes = response.consumes;
+ this.host = response.host || '';
+ this.info = response.info || {};
+ this.produces = response.produces;
+ this.schemes = response.schemes || [];
+ this.securityDefinitions = response.securityDefinitions;
+ this.title = response.title || '';
+
+ if (response.externalDocs) {
+ this.externalDocs = response.externalDocs;
+ }
+
+ // legacy support
+ this.authSchemes = response.securityDefinitions;
+
+ var definedTags = {};
+ var k;
+
+ if (Array.isArray(response.tags)) {
+ definedTags = {};
+
+ for (k = 0; k < response.tags.length; k++) {
+ var t = response.tags[k];
+ definedTags[t.name] = t;
+ }
+ }
+
+ var location;
+
+ if (typeof this.url === 'string') {
+ location = this.parseUri(this.url);
+ if (typeof this.scheme === 'undefined' && typeof this.schemes === 'undefined' || this.schemes.length === 0) {
+ this.scheme = location.scheme || 'http';
+ } else if (typeof this.scheme === 'undefined') {
+ this.scheme = this.schemes[0] || location.scheme;
+ }
+
+ if (typeof this.host === 'undefined' || this.host === '') {
+ this.host = location.host;
+
+ if (location.port) {
+ this.host = this.host + ':' + location.port;
+ }
+ }
+ }
+ else {
+ if (typeof this.schemes === 'undefined' || this.schemes.length === 0) {
+ this.scheme = 'http';
+ }
+ else if (typeof this.scheme === 'undefined') {
+ this.scheme = this.schemes[0];
+ }
+ }
+
+ this.definitions = response.definitions;
+
+ var key;
+
+ for (key in this.definitions) {
+ var model = new Model(key, this.definitions[key], this.models, this.modelPropertyMacro);
+
+ if (model) {
+ this.models[key] = model;
+ }
+ }
+
+ // get paths, create functions for each operationId
+ var self = this;
+
+ // Bind help to 'client.apis'
+ self.apis.help = _.bind(self.help, self);
+
+ _.forEach(response.paths, function (pathObj, path) {
+ // Only process a path if it's an object
+ if (!_.isPlainObject(pathObj)) {
+ return;
+ }
+
+ _.forEach(supportedOperationMethods, function (method) {
+ var operation = pathObj[method];
+
+ if (_.isUndefined(operation)) {
+ // Operation does not exist
+ return;
+ } else if (!_.isPlainObject(operation)) {
+ // Operation exists but it is not an Operation Object. Since this is invalid, log it.
+ helpers.log('The \'' + method + '\' operation for \'' + path + '\' path is not an Operation Object');
+
+ return;
+ }
+
+ var tags = operation.tags;
+
+ if (_.isUndefined(tags) || !_.isArray(tags) || tags.length === 0) {
+ tags = operation.tags = [ 'default' ];
+ }
+
+ var operationId = self.idFromOp(path, method, operation);
+
+ var operationObject = new Operation(self,
+ operation.scheme,
+ operationId,
+ method,
+ path,
+ operation,
+ self.definitions,
+ self.models,
+ self.clientAuthorizations);
+
+ // bind self operation's execute command to the api
+ _.forEach(tags, function (tag) {
+ var clientProperty = _.indexOf(reservedClientTags, tag) > -1 ? '_' + tag : tag;
+ var apiProperty = _.indexOf(reservedApiTags, tag) > -1 ? '_' + tag : tag;
+ var operationGroup = self[clientProperty];
+
+ if (clientProperty !== tag) {
+ helpers.log('The \'' + tag + '\' tag conflicts with a SwaggerClient function/property name. Use \'client.' +
+ clientProperty + '\' or \'client.apis.' + tag + '\' instead of \'client.' + tag + '\'.');
+ }
+
+ if (apiProperty !== tag) {
+ helpers.log('The \'' + tag + '\' tag conflicts with a SwaggerClient operation function/property name. Use ' +
+ '\'client.apis.' + apiProperty + '\' instead of \'client.apis.' + tag + '\'.');
+ }
+
+ if (_.indexOf(reservedApiTags, operationId) > -1) {
+ helpers.log('The \'' + operationId + '\' operationId conflicts with a SwaggerClient operation ' +
+ 'function/property name. Use \'client.apis.' + apiProperty + '._' + operationId +
+ '\' instead of \'client.apis.' + apiProperty + '.' + operationId + '\'.');
+
+ operationId = '_' + operationId;
+ operationObject.nickname = operationId; // So 'client.apis.[tag].operationId.help() works properly
+ }
+
+ if (_.isUndefined(operationGroup)) {
+ operationGroup = self[clientProperty] = self.apis[apiProperty] = {};
+
+ operationGroup.operations = {};
+ operationGroup.label = apiProperty;
+ operationGroup.apis = {};
+
+ var tagDef = definedTags[tag];
+
+ if (!_.isUndefined(tagDef)) {
+ operationGroup.description = tagDef.description;
+ operationGroup.externalDocs = tagDef.externalDocs;
+ }
+
+ self[clientProperty].help = _.bind(self.help, operationGroup);
+ self.apisArray.push(new OperationGroup(tag, operationGroup.description, operationGroup.externalDocs, operationObject));
+ }
+
+ operationId = self.makeUniqueOperationId(operationId, self.apis[apiProperty]);
+
+ // Bind tag help
+ if (!_.isFunction(operationGroup.help)) {
+ operationGroup.help = _.bind(self.help, operationGroup);
+ }
+
+ // bind to the apis object
+ self.apis[apiProperty][operationId] = operationGroup[operationId] = _.bind(operationObject.execute,
+ operationObject);
+ self.apis[apiProperty][operationId].help = operationGroup[operationId].help = _.bind(operationObject.help,
+ operationObject);
+ self.apis[apiProperty][operationId].asCurl = operationGroup[operationId].asCurl = _.bind(operationObject.asCurl,
+ operationObject);
+
+ operationGroup.apis[operationId] = operationGroup.operations[operationId] = operationObject;
+
+ // legacy UI feature
+ var api = _.find(self.apisArray, function (api) {
+ return api.tag === tag;
+ });
+
+ if (api) {
+ api.operationsArray.push(operationObject);
+ }
+ });
+ });
+ });
+
+ this.isBuilt = true;
+
+ if (this.usePromise) {
+ this.isValid = true;
+ this.isBuilt = true;
+ this.deferredClient.resolve(this);
+
+ return this.deferredClient.promise;
+ }
+
+ if (this.success) {
+ this.success();
+ }
+
+ return this;
+};
+
+SwaggerClient.prototype.makeUniqueOperationId = function(operationId, api) {
+ var count = 0;
+ var name = operationId;
+
+ // make unique across this operation group
+ while(true) {
+ var matched = false;
+ _.forEach(api.operations, function (operation) {
+ if(operation.nickname === name) {
+ matched = true;
+ }
+ });
+ if(!matched) {
+ return name;
+ }
+ name = operationId + '_' + count;
+ count ++;
+ }
+
+ return operationId;
+};
+
+SwaggerClient.prototype.parseUri = function (uri) {
+ var urlParseRE = /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/;
+ var parts = urlParseRE.exec(uri);
+
+ return {
+ scheme: parts[4] ? parts[4].replace(':','') : undefined,
+ host: parts[11],
+ port: parts[12],
+ path: parts[15]
+ };
+};
+
+SwaggerClient.prototype.help = function (dontPrint) {
+ var output = '';
+
+ if (this instanceof SwaggerClient) {
+ _.forEach(this.apis, function (api, name) {
+ if (_.isPlainObject(api)) {
+ output += 'operations for the \'' + name + '\' tag\n';
+
+ _.forEach(api.operations, function (operation, name) {
+ output += ' * ' + name + ': ' + operation.summary + '\n';
+ });
+ }
+ });
+ } else if (this instanceof OperationGroup || _.isPlainObject(this)) {
+ output += 'operations for the \'' + this.label + '\' tag\n';
+
+ _.forEach(this.apis, function (operation, name) {
+ output += ' * ' + name + ': ' + operation.summary + '\n';
+ });
+ }
+
+ if (dontPrint) {
+ return output;
+ } else {
+ helpers.log(output);
+
+ return output;
+ }
+};
+
+SwaggerClient.prototype.tagFromLabel = function (label) {
+ return label;
+};
+
+SwaggerClient.prototype.idFromOp = function (path, httpMethod, op) {
+ if(!op || !op.operationId) {
+ op = op || {};
+ op.operationId = httpMethod + '_' + path;
+ }
+ var opId = op.operationId.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|.\/?,\\'""-]/g, '_') || (path.substring(1) + '_' + httpMethod);
+
+ opId = opId.replace(/((_){2,})/g, '_');
+ opId = opId.replace(/^(_)*/g, '');
+ opId = opId.replace(/([_])*$/g, '');
+
+ return opId;
+};
+
+SwaggerClient.prototype.setHost = function (host) {
+ this.host = host;
+
+ if(this.apis) {
+ _.forEach(this.apis, function(api) {
+ if(api.operations) {
+ _.forEach(api.operations, function(operation) {
+ operation.host = host;
+ });
+ }
+ });
+ }
+};
+
+SwaggerClient.prototype.setBasePath = function (basePath) {
+ this.basePath = basePath;
+
+ if(this.apis) {
+ _.forEach(this.apis, function(api) {
+ if(api.operations) {
+ _.forEach(api.operations, function(operation) {
+ operation.basePath = basePath;
+ });
+ }
+ });
+ }
+};
+
+SwaggerClient.prototype.fail = function (message) {
+ if (this.usePromise) {
+ this.deferredClient.reject(message);
+ return this.deferredClient.promise;
+ } else {
+ if (this.failure) {
+ this.failure(message);
+ }
+ else {
+ this.failure(message);
+ }
+ }
+};
+
+},{"./auth":2,"./helpers":4,"./http":5,"./resolver":6,"./spec-converter":8,"./types/model":9,"./types/operation":10,"./types/operationGroup":11,"lodash-compat/array/indexOf":53,"lodash-compat/collection/find":57,"lodash-compat/collection/forEach":58,"lodash-compat/function/bind":62,"lodash-compat/lang/cloneDeep":142,"lodash-compat/lang/isArray":144,"lodash-compat/lang/isFunction":146,"lodash-compat/lang/isObject":148,"lodash-compat/lang/isPlainObject":149,"lodash-compat/lang/isUndefined":152,"q":161}],4:[function(require,module,exports){
+(function (process){
+'use strict';
+
+var _ = {
+ isPlainObject: require('lodash-compat/lang/isPlainObject'),
+ indexOf: require('lodash-compat/array/indexOf')
+};
+
+module.exports.__bind = function (fn, me) {
+ return function(){
+ return fn.apply(me, arguments);
+ };
+};
+
+var log = module.exports.log = function() {
+ // Only log if available and we're not testing
+ if (console && process.env.NODE_ENV !== 'test') {
+ console.log(Array.prototype.slice.call(arguments)[0]);
+ }
+};
+
+module.exports.fail = function (message) {
+ log(message);
+};
+
+var optionHtml = module.exports.optionHtml = function (label, value) {
+ return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>';
+};
+
+var resolveSchema = module.exports.resolveSchema = function (schema) {
+ if (_.isPlainObject(schema.schema)) {
+ schema = resolveSchema(schema.schema);
+ }
+
+ return schema;
+};
+
+var simpleRef = module.exports.simpleRef = function (name) {
+ if (typeof name === 'undefined') {
+ return null;
+ }
+
+ if (name.indexOf('#/definitions/') === 0) {
+ return name.substring('#/definitions/'.length);
+ } else {
+ return name;
+ }
+};
+
+
+}).call(this,require('_process'))
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9oZWxwZXJzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtB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aW9uIChsYWJlbCwgdmFsdWUpIHtcbiAgcmV0dXJuICc8dHI+PHRkIGNsYXNzPVwib3B0aW9uTmFtZVwiPicgKyBsYWJlbCArICc6PC90ZD48dGQ+JyArIHZhbHVlICsgJzwvdGQ+PC90cj4nO1xufTtcblxudmFyIHJlc29sdmVTY2hlbWEgPSBtb2R1bGUuZXhwb3J0cy5yZXNvbHZlU2NoZW1hID0gZnVuY3Rpb24gKHNjaGVtYSkge1xuICBpZiAoXy5pc1BsYWluT2JqZWN0KHNjaGVtYS5zY2hlbWEpKSB7XG4gICAgc2NoZW1hID0gcmVzb2x2ZVNjaGVtYShzY2hlbWEuc2NoZW1hKTtcbiAgfVxuXG4gIHJldHVybiBzY2hlbWE7XG59O1xuXG52YXIgc2ltcGxlUmVmID0gbW9kdWxlLmV4cG9ydHMuc2ltcGxlUmVmID0gZnVuY3Rpb24gKG5hbWUpIHtcbiAgaWYgKHR5cGVvZiBuYW1lID09PSAndW5kZWZpbmVkJykge1xuICAgIHJldHVybiBudWxsO1xuICB9XG5cbiAgaWYgKG5hbWUuaW5kZXhPZignIy9kZWZpbml0aW9ucy8nKSA9PT0gMCkge1xuICAgIHJldHVybiBuYW1lLnN1YnN0cmluZygnIy9kZWZpbml0aW9ucy8nLmxlbmd0aCk7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIG5hbWU7XG4gIH1cbn07XG5cbiJdfQ==
+},{"_process":13,"lodash-compat/array/indexOf":53,"lodash-compat/lang/isPlainObject":149}],5:[function(require,module,exports){
+'use strict';
+
+var helpers = require('./helpers');
+var request = require('superagent');
+var jsyaml = require('js-yaml');
+var _ = {
+ isObject: require('lodash-compat/lang/isObject')
+};
+
+/*
+ * JQueryHttpClient is a light-weight, node or browser HTTP client
+ */
+var JQueryHttpClient = function () {
+ this.type = 'JQueryHttpClient';
+};
+
+/*
+ * SuperagentHttpClient is a light-weight, node or browser HTTP client
+ */
+var SuperagentHttpClient = function () {
+ this.type = 'SuperagentHttpClient';
+};
+
+/**
+ * SwaggerHttp is a wrapper for executing requests
+ */
+var SwaggerHttp = module.exports = function () {};
+
+SwaggerHttp.prototype.execute = function (obj, opts) {
+ var client;
+
+ if(opts && opts.client) {
+ client = opts.client;
+ }
+ else {
+ client = new SuperagentHttpClient(opts);
+ }
+ client.opts = opts || {};
+
+ // legacy support
+ var hasJQuery = false;
+ if(typeof window !== 'undefined') {
+ if(typeof window.jQuery !== 'undefined') {
+ hasJQuery = true;
+ }
+ }
+ // OPTIONS support
+ if(obj.method.toLowerCase() === 'options' && client.type === 'SuperagentHttpClient') {
+ log('forcing jQuery as OPTIONS are not supported by SuperAgent');
+ obj.useJQuery = true;
+ }
+ if(this.isInternetExplorer() && (obj.useJQuery === false || !hasJQuery )) {
+ throw new Error('Unsupported configuration! JQuery is required but not available');
+ }
+ if ((obj && obj.useJQuery === true) || this.isInternetExplorer() && hasJQuery) {
+ client = new JQueryHttpClient(opts);
+ }
+
+ var success = obj.on.response;
+
+ var requestInterceptor = function(data) {
+ if(opts && opts.requestInterceptor) {
+ data = opts.requestInterceptor.apply(data);
+ }
+ return data;
+ };
+
+ var responseInterceptor = function(data) {
+ if(opts && opts.responseInterceptor) {
+ data = opts.responseInterceptor.apply(data);
+ }
+ return success(data);
+ };
+
+ obj.on.response = function(data) {
+ responseInterceptor(data);
+ };
+
+
+ if (_.isObject(obj) && _.isObject(obj.body)) {
+ // special processing for file uploads via jquery
+ if (obj.body.type && obj.body.type === 'formData'){
+ obj.contentType = false;
+ obj.processData = false;
+
+ delete obj.headers['Content-Type'];
+ } else {
+ obj.body = JSON.stringify(obj.body);
+ }
+ }
+
+ client.execute(requestInterceptor(obj));
+
+ return (obj.deferred) ? obj.deferred.promise : obj;
+};
+
+SwaggerHttp.prototype.isInternetExplorer = function () {
+ var detectedIE = false;
+
+ if (typeof navigator !== 'undefined' && navigator.userAgent) {
+ var nav = navigator.userAgent.toLowerCase();
+
+ if (nav.indexOf('msie') !== -1) {
+ var version = parseInt(nav.split('msie')[1]);
+
+ if (version <= 8) {
+ detectedIE = true;
+ }
+ }
+ }
+
+ return detectedIE;
+};
+
+JQueryHttpClient.prototype.execute = function (obj) {
+ var jq = this.jQuery || (typeof window !== 'undefined' && window.jQuery);
+ var cb = obj.on;
+ var request = obj;
+
+ if(typeof jq === 'undefined' || jq === false) {
+ throw new Error('Unsupported configuration! JQuery is required but not available');
+ }
+
+ obj.type = obj.method;
+ obj.cache = false;
+ delete obj.useJQuery;
+
+ /*
+ obj.beforeSend = function (xhr) {
+ var key, results;
+ if (obj.headers) {
+ results = [];
+ for (key in obj.headers) {
+ if (key.toLowerCase() === 'content-type') {
+ results.push(obj.contentType = obj.headers[key]);
+ } else if (key.toLowerCase() === 'accept') {
+ results.push(obj.accepts = obj.headers[key]);
+ } else {
+ results.push(xhr.setRequestHeader(key, obj.headers[key]));
+ }
+ }
+ return results;
+ }
+ };*/
+
+ obj.data = obj.body;
+
+ delete obj.body;
+
+ obj.complete = function (response) {
+ var headers = {};
+ var headerArray = response.getAllResponseHeaders().split('\n');
+
+ for (var i = 0; i < headerArray.length; i++) {
+ var toSplit = headerArray[i].trim();
+
+ if (toSplit.length === 0) {
+ continue;
+ }
+
+ var separator = toSplit.indexOf(':');
+
+ if (separator === -1) {
+ // Name but no value in the header
+ headers[toSplit] = null;
+
+ continue;
+ }
+
+ var name = toSplit.substring(0, separator).trim();
+ var value = toSplit.substring(separator + 1).trim();
+
+ headers[name] = value;
+ }
+
+ var out = {
+ url: request.url,
+ method: request.method,
+ status: response.status,
+ statusText: response.statusText,
+ data: response.responseText,
+ headers: headers
+ };
+
+ try {
+ var possibleObj = response.responseJSON || jsyaml.safeLoad(response.responseText);
+ out.obj = (typeof possibleObj === 'string') ? {} : possibleObj;
+ } catch (ex) {
+ // do not set out.obj
+ helpers.log('unable to parse JSON/YAML content');
+ }
+
+ // I can throw, or parse null?
+ out.obj = out.obj || null;
+
+ if (response.status >= 200 && response.status < 300) {
+ cb.response(out);
+ } else if (response.status === 0 || (response.status >= 400 && response.status < 599)) {
+ cb.error(out);
+ } else {
+ return cb.response(out);
+ }
+ };
+
+ jq.support.cors = true;
+
+ return jq.ajax(obj);
+};
+
+SuperagentHttpClient.prototype.execute = function (obj) {
+ var method = obj.method.toLowerCase();
+
+ if (method === 'delete') {
+ method = 'del';
+ }
+ var headers = obj.headers || {};
+ var r = request[method](obj.url);
+ var name;
+ for (name in headers) {
+ r.set(name, headers[name]);
+ }
+
+ if (obj.enableCookies) {
+ r.withCredentials();
+ }
+
+ if (obj.body) {
+ r.send(obj.body);
+ }
+
+ if(typeof r.buffer === 'function') {
+ r.buffer(); // force superagent to populate res.text with the raw response data
+ }
+
+ r.end(function (err, res) {
+ res = res || {
+ status: 0,
+ headers: {error: 'no response from server'}
+ };
+ var response = {
+ url: obj.url,
+ method: obj.method,
+ headers: res.headers
+ };
+ var cb;
+
+ if (!err && res.error) {
+ err = res.error;
+ }
+
+ if (err && obj.on && obj.on.error) {
+ response.errObj = err;
+ response.status = res ? res.status : 500;
+ response.statusText = res ? res.text : err.message;
+ if(res.headers && res.headers['content-type']) {
+ if(res.headers['content-type'].indexOf('application/json') >= 0) {
+ try {
+ response.obj = JSON.parse(response.statusText);
+ }
+ catch (e) {
+ response.obj = null;
+ }
+ }
+ }
+ cb = obj.on.error;
+ } else if (res && obj.on && obj.on.response) {
+ var possibleObj;
+
+ // Already parsed by by superagent?
+ if(res.body && Object.keys(res.body).length > 0) {
+ possibleObj = res.body;
+ } else {
+ try {
+ possibleObj = jsyaml.safeLoad(res.text);
+ // can parse into a string... which we don't need running around in the system
+ possibleObj = (typeof possibleObj === 'string') ? null : possibleObj;
+ } catch(e) {
+ helpers.log('cannot parse JSON/YAML content');
+ }
+ }
+
+ // null means we can't parse into object
+ response.obj = (typeof possibleObj === 'object') ? possibleObj : null;
+
+ response.status = res.status;
+ response.statusText = res.text;
+ cb = obj.on.response;
+ }
+ response.data = response.statusText;
+
+ if (cb) {
+ cb(response);
+ }
+ });
+};
+
+},{"./helpers":4,"js-yaml":20,"lodash-compat/lang/isObject":148,"superagent":162}],6:[function(require,module,exports){
+'use strict';
+
+var SwaggerHttp = require('./http');
+var _ = {
+ isObject: require('lodash-compat/lang/isObject'),
+ cloneDeep: require('lodash-compat/lang/cloneDeep'),
+ isArray: require('lodash-compat/lang/isArray')
+};
+
+
+/**
+ * Resolves a spec's remote references
+ */
+var Resolver = module.exports = function () {};
+
+Resolver.prototype.processAllOf = function(root, name, definition, resolutionTable, unresolvedRefs, spec) {
+ var i, location, property;
+
+ definition['x-resolved-from'] = [ '#/definitions/' + name ];
+ var allOf = definition.allOf;
+ // the refs go first
+ allOf.sort(function(a, b) {
+ if(a.$ref && b.$ref) { return 0; }
+ else if(a.$ref) { return -1; }
+ else { return 1; }
+ });
+ for (i = 0; i < allOf.length; i++) {
+ property = allOf[i];
+ location = '/definitions/' + name + '/allOf';
+ this.resolveInline(root, spec, property, resolutionTable, unresolvedRefs, location);
+ }
+};
+
+Resolver.prototype.resolve = function (spec, arg1, arg2, arg3) {
+ this.spec = spec;
+ var root = arg1, callback = arg2, scope = arg3, opts = {}, location, i;
+ if(typeof arg1 === 'function') {
+ root = null;
+ callback = arg1;
+ scope = arg2;
+ }
+ var _root = root;
+ this.scope = (scope || this);
+ this.iteration = this.iteration || 0;
+
+ if(this.scope.options && this.scope.options.requestInterceptor){
+ opts.requestInterceptor = this.scope.options.requestInterceptor;
+ }
+
+ if(this.scope.options && this.scope.options.responseInterceptor){
+ opts.responseInterceptor = this.scope.options.responseInterceptor;
+ }
+
+ var name, path, property, propertyName;
+ var processedCalls = 0, resolvedRefs = {}, unresolvedRefs = {};
+ var resolutionTable = []; // store objects for dereferencing
+
+ spec.definitions = spec.definitions || {};
+ // definitions
+ for (name in spec.definitions) {
+ var definition = spec.definitions[name];
+ for (propertyName in definition.properties) {
+ property = definition.properties[propertyName];
+ if(_.isArray(property.allOf)) {
+ this.processAllOf(root, name, property, resolutionTable, unresolvedRefs, spec);
+ }
+ else {
+ this.resolveTo(root, property, resolutionTable, '/definitions');
+ }
+ }
+
+ if(definition.allOf) {
+ this.processAllOf(root, name, definition, resolutionTable, unresolvedRefs, spec);
+ }
+ }
+
+ // operations
+ for (name in spec.paths) {
+ var method, operation, responseCode;
+ path = spec.paths[name];
+
+ for (method in path) {
+ // operation reference
+ if(method === '$ref') {
+ // location = path[method];
+ location = '/paths' + name;
+ this.resolveInline(root, spec, path, resolutionTable, unresolvedRefs, location);
+ }
+ else {
+ operation = path[method];
+ var sharedParameters = path.parameters || [];
+ var parameters = operation.parameters || [];
+
+ for (i in sharedParameters) {
+ var parameter = sharedParameters[i];
+ parameters.unshift(parameter);
+ }
+ if(method !== 'parameters' && _.isObject(operation)) {
+ operation.parameters = operation.parameters || parameters;
+ }
+
+ for (i in parameters) {
+ var parameter = parameters[i];
+ location = '/paths' + name + '/' + method + '/parameters';
+
+ if (parameter.in === 'body' && parameter.schema) {
+ if(_.isArray(parameter.schema.allOf)) {
+ // move to a definition
+ var modelName = 'inline_model';
+ var name = modelName;
+ var done = false; var counter = 0;
+ while(!done) {
+ if(typeof spec.definitions[name] === 'undefined') {
+ done = true;
+ break;
+ }
+ name = modelName + '_' + counter;
+ counter ++;
+ }
+ spec.definitions[name] = { allOf: parameter.schema.allOf };
+ delete parameter.schema.allOf;
+ parameter.schema.$ref = '#/definitions/' + name;
+ this.processAllOf(root, name, spec.definitions[name], resolutionTable, unresolvedRefs, spec);
+ }
+ else {
+ this.resolveTo(root, parameter.schema, resolutionTable, location);
+ }
+ }
+
+ if (parameter.$ref) {
+ // parameter reference
+ this.resolveInline(root, spec, parameter, resolutionTable, unresolvedRefs, parameter.$ref);
+ }
+ }
+
+ for (responseCode in operation.responses) {
+ var response = operation.responses[responseCode];
+ location = '/paths' + name + '/' + method + '/responses/' + responseCode;
+
+ if(_.isObject(response)) {
+ if(response.$ref) {
+ // response reference
+ this.resolveInline(root, spec, response, resolutionTable, unresolvedRefs, location);
+ }
+ if (response.schema) {
+ var responseObj = response;
+ if(_.isArray(responseObj.schema.allOf)) {
+ // move to a definition
+ var modelName = 'inline_model';
+ var name = modelName;
+ var done = false; var counter = 0;
+ while(!done) {
+ if(typeof spec.definitions[name] === 'undefined') {
+ done = true;
+ break;
+ }
+ name = modelName + '_' + counter;
+ counter ++;
+ }
+ spec.definitions[name] = { allOf: responseObj.schema.allOf };
+ delete responseObj.schema.allOf;
+ delete responseObj.schema.type;
+ responseObj.schema.$ref = '#/definitions/' + name;
+ this.processAllOf(root, name, spec.definitions[name], resolutionTable, unresolvedRefs, spec);
+ }
+ else {
+ this.resolveTo(root, response.schema, resolutionTable, location);
+ }
+ }
+ }
+ }
+ }
+ }
+ // clear them out to avoid multiple resolutions
+ path.parameters = [];
+ }
+
+ var expectedCalls = 0, toResolve = [];
+ // if the root is same as obj[i].root we can resolve locally
+ var all = resolutionTable;
+
+ var parts;
+ for(i = 0; i < all.length; i++) {
+ var a = all[i];
+ if(root === a.root) {
+ if(a.resolveAs === 'ref') {
+ // resolve any path walking
+ var joined = ((a.root || '') + '/' + a.key).split('/');
+ var normalized = [];
+ var url = '';
+ var k;
+
+ if(a.key.indexOf('../') >= 0) {
+ for(var j = 0; j < joined.length; j++) {
+ if(joined[j] === '..') {
+ normalized = normalized.slice(0, normalized.length-1);
+ }
+ else {
+ normalized.push(joined[j]);
+ }
+ }
+ for(k = 0; k < normalized.length; k ++) {
+ if(k > 0) {
+ url += '/';
+ }
+ url += normalized[k];
+ }
+ // we now have to remote resolve this because the path has changed
+ a.root = url;
+ toResolve.push(a);
+ }
+ else {
+ parts = a.key.split('#');
+ if(parts.length === 2) {
+ if(parts[0].indexOf('http://') === 0 || parts[0].indexOf('https://') === 0) {
+ a.root = parts[0];
+ }
+ location = parts[1].split('/');
+ var r;
+ var s = spec;
+ for(k = 0; k < location.length; k++) {
+ var part = location[k];
+ if(part !== '') {
+ s = s[part];
+ if(typeof s !== 'undefined') {
+ r = s;
+ }
+ else {
+ r = null;
+ break;
+ }
+ }
+ }
+ if(r === null) {
+ // must resolve this too
+ toResolve.push(a);
+ }
+ }
+ }
+ }
+ else {
+ if (a.resolveAs === 'inline') {
+ if(a.key && a.key.indexOf('#') === -1 && a.key.charAt(0) !== '/') {
+ // handle relative schema
+ parts = a.root.split('/');
+ location = '';
+ for(i = 0; i < parts.length - 1; i++) {
+ location += parts[i] + '/';
+ }
+ location += a.key;
+ a.root = location;
+ a.location = '';
+ }
+ toResolve.push(a);
+ }
+ }
+ }
+ else {
+ toResolve.push(a);
+ }
+ }
+ expectedCalls = toResolve.length;
+
+ // resolve anything that is local
+ for(var ii = 0; ii < toResolve.length; ii++) {
+ (function(item, spec, self) {
+ if(item.root === null || item.root === root) {
+ // local resolve
+ self.resolveItem(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, item);
+ processedCalls += 1;
+
+ if(processedCalls === expectedCalls) {
+ self.finish(spec, root, resolutionTable, resolvedRefs, unresolvedRefs, callback, true);
+ }
+ }
+ else {
+ var obj = {
+ useJQuery: false, // TODO
+ url: item.root,
+ method: 'get',
+ headers: {
+ accept: self.scope.swaggerRequestHeaders || 'application/json'
+ },
+ on: {
+ error: function (error) {
+ processedCalls += 1;
+ unresolvedRefs[item.key] = {
+ root: item.root,
+ location: item.location
+ };
+
+ if (processedCalls === expectedCalls) {
+ self.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
+ }
+ }, // jshint ignore:line
+ response: function (response) {
+ var swagger = response.obj;
+ self.resolveItem(swagger, item.root, resolutionTable, resolvedRefs, unresolvedRefs, item);
+ processedCalls += 1;
+
+ if (processedCalls === expectedCalls) {
+ self.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
+ }
+ }
+ } // jshint ignore:line
+ };
+
+ if (scope && scope.clientAuthorizations) {
+ scope.clientAuthorizations.apply(obj);
+ }
+
+ new SwaggerHttp().execute(obj, opts);
+ }
+ }(toResolve[ii], spec, this));
+ }
+
+ if (Object.keys(toResolve).length === 0) {
+ this.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
+ }
+};
+
+Resolver.prototype.resolveItem = function(spec, root, resolutionTable, resolvedRefs, unresolvedRefs, item) {
+ var path = item.location;
+ var location = spec, parts = path.split('/');
+ if(path !== '') {
+ for (var j = 0; j < parts.length; j++) {
+ var segment = parts[j];
+ if (segment.indexOf('~1') !== -1) {
+ segment = parts[j].replace(/~0/g, '~').replace(/~1/g, '/');
+ if (segment.charAt(0) !== '/') {
+ segment = '/' + segment;
+ }
+ }
+ if (typeof location === 'undefined' || location === null) {
+ break;
+ }
+ if (segment === '' && j === (parts.length - 1) && parts.length > 1) {
+ location = null;
+ break;
+ }
+ if (segment.length > 0) {
+ location = location[segment];
+ }
+ }
+ }
+ var resolved = item.key;
+ parts = item.key.split('/');
+ var resolvedName = parts[parts.length-1];
+
+ if(resolvedName.indexOf('#') >= 0) {
+ resolvedName = resolvedName.split('#')[1];
+ }
+
+ if (location !== null && typeof location !== 'undefined') {
+ resolvedRefs[resolved] = {
+ name: resolvedName,
+ obj: location,
+ key: item.key,
+ root: item.root
+ };
+ } else {
+ unresolvedRefs[resolved] = {
+ root: item.root,
+ location: item.location
+ };
+ }
+};
+
+Resolver.prototype.finish = function (spec, root, resolutionTable, resolvedRefs, unresolvedRefs, callback, localResolve) {
+ // walk resolution table and replace with resolved refs
+ var ref;
+ for (ref in resolutionTable) {
+ var item = resolutionTable[ref];
+
+ var key = item.key;
+ var resolvedTo = resolvedRefs[key];
+ if (resolvedTo) {
+ spec.definitions = spec.definitions || {};
+ if (item.resolveAs === 'ref') {
+ if (localResolve !== true) {
+ // don't retain root for local definitions
+ for (key in resolvedTo.obj) {
+ var abs = this.retainRoot(resolvedTo.obj[key], item.root);
+ }
+ }
+ spec.definitions[resolvedTo.name] = resolvedTo.obj;
+ item.obj.$ref = '#/definitions/' + resolvedTo.name;
+ } else if (item.resolveAs === 'inline') {
+ var targetObj = item.obj;
+ targetObj['x-resolved-from'] = [ item.key ];
+ delete targetObj.$ref;
+
+ for (key in resolvedTo.obj) {
+ var abs = resolvedTo.obj[key];
+
+ if (localResolve !== true) {
+ // don't retain root for local definitions
+ abs = this.retainRoot(resolvedTo.obj[key], item.root);
+ }
+ targetObj[key] = abs;
+ }
+ }
+ }
+ }
+ var existingUnresolved = this.countUnresolvedRefs(spec);
+
+ if(existingUnresolved === 0 || this.iteration > 5) {
+ this.resolveAllOf(spec.definitions);
+ callback.call(this.scope, spec, unresolvedRefs);
+ }
+ else {
+ this.iteration += 1;
+ this.resolve(spec, root, callback, this.scope);
+ }
+};
+
+Resolver.prototype.countUnresolvedRefs = function(spec) {
+ var i;
+ var refs = this.getRefs(spec);
+ var keys = [];
+ var unresolvedKeys = [];
+ for(i in refs) {
+ if(i.indexOf('#') === 0) {
+ keys.push(i.substring(1));
+ }
+ else {
+ unresolvedKeys.push(i);
+ }
+ }
+
+ // verify possible keys
+ for (i = 0; i < keys.length; i++) {
+ var part = keys[i];
+ var parts = part.split('/');
+ var obj = spec;
+
+ for (var k = 0; k < parts.length; k++) {
+ var key = parts[k];
+ if(key !== '') {
+ obj = obj[key];
+ if(typeof obj === 'undefined') {
+ unresolvedKeys.push(part);
+ break;
+ }
+ }
+ }
+ }
+ return unresolvedKeys.length;
+};
+
+Resolver.prototype.getRefs = function(spec, obj) {
+ obj = obj || spec;
+ var output = {};
+ for(var key in obj) {
+ if (!obj.hasOwnProperty(key)) {
+ continue;
+ }
+ var item = obj[key];
+ if(key === '$ref' && typeof item === 'string') {
+ output[item] = null;
+ }
+ else if(_.isObject(item)) {
+ var o = this.getRefs(item);
+ for(var k in o) {
+ output[k] = null;
+ }
+ }
+ }
+ return output;
+};
+
+Resolver.prototype.retainRoot = function(obj, root) {
+ // walk object and look for relative $refs
+ for(var key in obj) {
+ var item = obj[key];
+ if(key === '$ref' && typeof item === 'string') {
+ // stop and inspect
+ if(item.indexOf('http://') !== 0 && item.indexOf('https://') !== 0) {
+ // TODO: check if root ends in '/'. If not, AND item has no protocol, make relative
+ var appendHash = true;
+ var oldRoot = root;
+ if(root) {
+ var lastChar = root.slice(-1);
+ if(lastChar !== '/' && (item.indexOf('#') !== 0 && item.indexOf('http://') !== 0 && item.indexOf('https://'))) {
+ console.log('working with ' + item);
+ appendHash = false;
+ var parts = root.split('\/');
+ parts = parts.splice(0, parts.length - 1);
+ root = '';
+ for(var i = 0; i < parts.length; i++) {
+ root += parts[i] + '/';
+ }
+ }
+ }
+ if(item.indexOf('#') !== 0 && appendHash) {
+ item = '#' + item;
+ }
+
+ item = (root || '') + item;
+ obj[key] = item;
+ }
+ }
+ else if(_.isObject(item)) {
+ this.retainRoot(item, root);
+ }
+ }
+ return obj;
+};
+
+/**
+ * immediately in-lines local refs, queues remote refs
+ * for inline resolution
+ */
+Resolver.prototype.resolveInline = function (root, spec, property, resolutionTable, unresolvedRefs, location) {
+ var key = property.$ref, ref = property.$ref, i, p, p2, rs;
+ var rootTrimmed = false;
+ if (ref) {
+ if(ref.indexOf('../') === 0) {
+ // reset root
+ p = ref.split('../');
+ p2 = root.split('/');
+ ref = '';
+ for(i = 0; i < p.length; i++) {
+ if(p[i] === '') {
+ p2 = p2.slice(0, p2.length-1);
+ }
+ else {
+ ref += p[i];
+ }
+ }
+ root = '';
+ for(i = 0; i < p2.length - 1; i++) {
+ if(i > 0) { root += '/'; }
+ root += p2[i];
+ }
+ rootTrimmed = true;
+ }
+ if(ref.indexOf('#') >= 0) {
+ if(ref.indexOf('/') === 0) {
+ rs = ref.split('#');
+ p = root.split('//');
+ p2 = p[1].split('/');
+ root = p[0] + '//' + p2[0] + rs[0];
+ location = rs[1];
+ }
+ else {
+ rs = ref.split('#');
+ if(rs[0] !== '') {
+ p2 = root.split('/');
+ p2 = p2.slice(0, p2.length - 1);
+ if(!rootTrimmed) {
+ root = '';
+ for (var k = 0; k < p2.length; k++) {
+ if(k > 0) { root += '/'; }
+ root += p2[k];
+ }
+ }
+ root += '/' + ref.split('#')[0];
+ }
+ location = rs[1];
+ }
+ }
+ if (ref.indexOf('http') === 0) {
+ if(ref.indexOf('#') >= 0) {
+ root = ref.split('#')[0];
+ location = ref.split('#')[1];
+ }
+ else {
+ root = ref;
+ location = '';
+ }
+ resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
+ } else if (ref.indexOf('#') === 0) {
+ location = ref.split('#')[1];
+ resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
+ }
+ else {
+ resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
+ }
+ }
+ else if (property.type === 'array') {
+ this.resolveTo(root, property.items, resolutionTable, location);
+ }
+};
+
+Resolver.prototype.resolveTo = function (root, property, resolutionTable, location) {
+ var sp, i;
+ var ref = property.$ref;
+ var lroot = root;
+ if ((typeof ref !== 'undefined') && (ref !== null)) {
+ if(ref.indexOf('#') >= 0) {
+ var parts = ref.split('#');
+
+ // #/definitions/foo
+ // foo.json#/bar
+ if(parts[0] && ref.indexOf('/') === 0) {
+
+ }
+ else if(parts[0] && parts[0].indexOf('http') === 0) {
+ lroot = parts[0];
+ ref = parts[1];
+ }
+ else if(parts[0] && parts[0].length > 0) {
+ // relative file
+ sp = root.split('/');
+ lroot = '';
+ for(i = 0; i < sp.length - 1; i++) {
+ lroot += sp[i] + '/';
+ }
+ lroot += parts[0];
+ }
+ else {
+
+ }
+
+ location = parts[1];
+ }
+ else if (ref.indexOf('http://') === 0 || ref.indexOf('https://') === 0) {
+ lroot = ref;
+ location = '';
+ }
+ else {
+ // relative file
+ sp = root.split('/');
+ lroot = '';
+ for(i = 0; i < sp.length - 1; i++) {
+ lroot += sp[i] + '/';
+ }
+ lroot += ref;
+ location = '';
+ }
+ resolutionTable.push({
+ obj: property, resolveAs: 'ref', root: lroot, key: ref, location: location
+ });
+ } else if (property.type === 'array') {
+ var items = property.items;
+ this.resolveTo(root, items, resolutionTable, location);
+ } else {
+ if(property && property.properties) {
+ var name = this.uniqueName('inline_model');
+ this.spec.definitions[name] = _.cloneDeep(property);
+ property['$ref'] = '#/definitions/' + name;
+ delete property.type;
+ delete property.properties;
+ }
+ }
+};
+
+Resolver.prototype.uniqueName = function(base) {
+ var name = base;
+ var count = 0;
+ while(true) {
+ if(!_.isObject(this.spec.definitions[name])) {
+ return name;
+ }
+ name = base + '_' + count;
+ count++;
+ }
+};
+
+Resolver.prototype.resolveAllOf = function(spec, obj, depth) {
+ depth = depth || 0;
+ obj = obj || spec;
+ var name;
+ for(var key in obj) {
+ if (!obj.hasOwnProperty(key)) {
+ continue;
+ }
+ var item = obj[key];
+ if(item === null) {
+ throw new TypeError('Swagger 2.0 does not support null types (' + obj + '). See https://github.com/swagger-api/swagger-spec/issues/229.');
+ }
+ if(typeof item === 'object') {
+ this.resolveAllOf(spec, item, depth + 1);
+ }
+ if(item && typeof item.allOf !== 'undefined') {
+ var allOf = item.allOf;
+ if(_.isArray(allOf)) {
+ var output = _.cloneDeep(item);
+ delete output.allOf;
+
+ output['x-composed'] = true;
+ if (typeof item['x-resolved-from'] !== 'undefined') {
+ output['x-resolved-from'] = item['x-resolved-from'];
+ }
+
+ for(var i = 0; i < allOf.length; i++) {
+ var component = allOf[i];
+ var source = 'self';
+ if(typeof component['x-resolved-from'] !== 'undefined') {
+ source = component['x-resolved-from'][0];
+ }
+
+ for(var part in component) {
+ if(!output.hasOwnProperty(part)) {
+ output[part] = _.cloneDeep(component[part]);
+ if(part === 'properties') {
+ for(name in output[part]) {
+ output[part][name]['x-resolved-from'] = source;
+ }
+ }
+ }
+ else {
+ if(part === 'properties') {
+ var properties = component[part];
+ for(name in properties) {
+ output.properties[name] = _.cloneDeep(properties[name]);
+ var resolvedFrom = properties[name]['x-resolved-from'];
+ if (typeof resolvedFrom === 'undefined' || resolvedFrom === 'self') {
+ resolvedFrom = source;
+ }
+ output.properties[name]['x-resolved-from'] = resolvedFrom;
+ }
+ }
+ else if(part === 'required') {
+ // merge & dedup the required array
+ var a = output.required.concat(component[part]);
+ for(var k = 0; k < a.length; ++k) {
+ for(var j = k + 1; j < a.length; ++j) {
+ if(a[k] === a[j]) { a.splice(j--, 1); }
+ }
+ }
+ output.required = a;
+ }
+ else if(part === 'x-resolved-from') {
+ output['x-resolved-from'].push(source);
+ }
+ else {
+ // TODO: need to merge this property
+ // console.log('what to do with ' + part)
+ }
+ }
+ }
+ }
+ obj[key] = output;
+ }
+ }
+ if(_.isObject(item)) {
+ this.resolveAllOf(spec, item, depth + 1);
+ }
+ }
+};
+
+},{"./http":5,"lodash-compat/lang/cloneDeep":142,"lodash-compat/lang/isArray":144,"lodash-compat/lang/isObject":148}],7:[function(require,module,exports){
+'use strict';
+
+var Helpers = require('./helpers');
+
+var _ = {
+ isPlainObject: require('lodash-compat/lang/isPlainObject'),
+ isUndefined: require('lodash-compat/lang/isUndefined'),
+ isArray: require('lodash-compat/lang/isArray'),
+ isObject: require('lodash-compat/lang/isObject'),
+ isEmpty: require('lodash-compat/lang/isEmpty'),
+ map: require('lodash-compat/collection/map'),
+ indexOf: require('lodash-compat/array/indexOf'),
+ cloneDeep: require('lodash-compat/lang/cloneDeep'),
+ keys: require('lodash-compat/object/keys'),
+ forEach: require('lodash-compat/collection/forEach')
+};
+
+module.exports.optionHtml = optionHtml;
+module.exports.typeFromJsonSchema = typeFromJsonSchema;
+module.exports.getStringSignature = getStringSignature;
+module.exports.schemaToHTML = schemaToHTML;
+module.exports.schemaToJSON = schemaToJSON;
+
+function optionHtml(label, value) {
+ return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>';
+}
+
+function typeFromJsonSchema(type, format) {
+ var str;
+
+ if (type === 'integer' && format === 'int32') {
+ str = 'integer';
+ } else if (type === 'integer' && format === 'int64') {
+ str = 'long';
+ } else if (type === 'integer' && typeof format === 'undefined') {
+ str = 'long';
+ } else if (type === 'string' && format === 'date-time') {
+ str = 'date-time';
+ } else if (type === 'string' && format === 'date') {
+ str = 'date';
+ } else if (type === 'number' && format === 'float') {
+ str = 'float';
+ } else if (type === 'number' && format === 'double') {
+ str = 'double';
+ } else if (type === 'number' && typeof format === 'undefined') {
+ str = 'double';
+ } else if (type === 'boolean') {
+ str = 'boolean';
+ } else if (type === 'string') {
+ str = 'string';
+ }
+
+ return str;
+}
+
+function getStringSignature(obj, baseComponent) {
+ var str = '';
+
+ if (typeof obj.$ref !== 'undefined') {
+ str += Helpers.simpleRef(obj.$ref);
+ } else if (typeof obj.type === 'undefined') {
+ str += 'object';
+ } else if (obj.type === 'array') {
+ if (baseComponent) {
+ str += getStringSignature((obj.items || obj.$ref || {}));
+ } else {
+ str += 'Array[';
+ str += getStringSignature((obj.items || obj.$ref || {}));
+ str += ']';
+ }
+ } else if (obj.type === 'integer' && obj.format === 'int32') {
+ str += 'integer';
+ } else if (obj.type === 'integer' && obj.format === 'int64') {
+ str += 'long';
+ } else if (obj.type === 'integer' && typeof obj.format === 'undefined') {
+ str += 'long';
+ } else if (obj.type === 'string' && obj.format === 'date-time') {
+ str += 'date-time';
+ } else if (obj.type === 'string' && obj.format === 'date') {
+ str += 'date';
+ } else if (obj.type === 'string' && typeof obj.format === 'undefined') {
+ str += 'string';
+ } else if (obj.type === 'number' && obj.format === 'float') {
+ str += 'float';
+ } else if (obj.type === 'number' && obj.format === 'double') {
+ str += 'double';
+ } else if (obj.type === 'number' && typeof obj.format === 'undefined') {
+ str += 'double';
+ } else if (obj.type === 'boolean') {
+ str += 'boolean';
+ } else if (obj.$ref) {
+ str += Helpers.simpleRef(obj.$ref);
+ } else {
+ str += obj.type;
+ }
+
+ return str;
+}
+
+function schemaToJSON(schema, models, modelsToIgnore, modelPropertyMacro) {
+ // Resolve the schema (Handle nested schemas)
+ schema = Helpers.resolveSchema(schema);
+
+ if(typeof modelPropertyMacro !== 'function') {
+ modelPropertyMacro = function(prop){
+ return (prop || {}).default;
+ };
+ }
+
+ modelsToIgnore= modelsToIgnore || {};
+
+ var type = schema.type || 'object';
+ var format = schema.format;
+ var model;
+ var output;
+
+ if (!_.isUndefined(schema.example)) {
+ output = schema.example;
+ } else if (_.isUndefined(schema.items) && _.isArray(schema.enum)) {
+ output = schema.enum[0];
+ }
+
+ if (_.isUndefined(output)) {
+ if (schema.$ref) {
+ model = models[Helpers.simpleRef(schema.$ref)];
+
+ if (!_.isUndefined(model)) {
+ if (_.isUndefined(modelsToIgnore[model.name])) {
+ modelsToIgnore[model.name] = model;
+ output = schemaToJSON(model.definition, models, modelsToIgnore, modelPropertyMacro);
+ delete modelsToIgnore[model.name];
+ } else {
+ if (model.type === 'array') {
+ output = [];
+ } else {
+ output = {};
+ }
+ }
+ }
+ } else if (!_.isUndefined(schema.default)) {
+ output = schema.default;
+ } else if (type === 'string') {
+ if (format === 'date-time') {
+ output = new Date().toISOString();
+ } else if (format === 'date') {
+ output = new Date().toISOString().split('T')[0];
+ } else {
+ output = 'string';
+ }
+ } else if (type === 'integer') {
+ output = 0;
+ } else if (type === 'number') {
+ output = 0.0;
+ } else if (type === 'boolean') {
+ output = true;
+ } else if (type === 'object') {
+ output = {};
+
+ _.forEach(schema.properties, function (property, name) {
+ var cProperty = _.cloneDeep(property);
+
+ // Allow macro to set the default value
+ cProperty.default = modelPropertyMacro(property);
+
+ output[name] = schemaToJSON(cProperty, models, modelsToIgnore, modelPropertyMacro);
+ });
+ } else if (type === 'array') {
+ output = [];
+
+ if (_.isArray(schema.items)) {
+ _.forEach(schema.items, function (item) {
+ output.push(schemaToJSON(item, models, modelsToIgnore, modelPropertyMacro));
+ });
+ } else if (_.isPlainObject(schema.items)) {
+ output.push(schemaToJSON(schema.items, models, modelsToIgnore, modelPropertyMacro));
+ } else if (_.isUndefined(schema.items)) {
+ output.push({});
+ } else {
+ Helpers.log('Array type\'s \'items\' property is not an array or an object, cannot process');
+ }
+ }
+ }
+
+ return output;
+}
+
+function schemaToHTML(name, schema, models, modelPropertyMacro) {
+
+ var strongOpen = '<span class="strong">';
+ var strongClose = '</span>';
+
+ // Allow for ignoring the 'name' argument.... shifting the rest
+ if(_.isObject(arguments[0])) {
+ name = void 0;
+ schema = arguments[0];
+ models = arguments[1];
+ modelPropertyMacro = arguments[2];
+ }
+
+ models = models || {};
+
+ // Resolve the schema (Handle nested schemas)
+ schema = Helpers.resolveSchema(schema);
+
+ // Return for empty object
+ if(_.isEmpty(schema)) {
+ return strongOpen + 'Empty' + strongClose;
+ }
+
+ // Dereference $ref from 'models'
+ if(typeof schema.$ref === 'string') {
+ name = Helpers.simpleRef(schema.$ref);
+ schema = models[name];
+ if(typeof schema === 'undefined')
+ {
+ return strongOpen + name + ' is not defined!' + strongClose;
+ }
+ }
+
+ if(typeof name !== 'string') {
+ name = schema.title || 'Inline Model';
+ }
+
+ // If we are a Model object... adjust accordingly
+ if(schema.definition) {
+ schema = schema.definition;
+ }
+
+ if(typeof modelPropertyMacro !== 'function') {
+ modelPropertyMacro = function(prop){
+ return (prop || {}).default;
+ };
+ }
+
+ var references = {};
+ var seenModels = [];
+ var inlineModels = 0;
+
+
+
+ // Generate current HTML
+ var html = processModel(schema, name);
+
+ // Generate references HTML
+ while (_.keys(references).length > 0) {
+ /* jshint ignore:start */
+ _.forEach(references, function (schema, name) {
+ var seenModel = _.indexOf(seenModels, name) > -1;
+
+ delete references[name];
+
+ if (!seenModel) {
+ seenModels.push(name);
+
+ html += '<br />' + processModel(schema, name);
+ }
+ });
+ /* jshint ignore:end */
+ }
+
+ return html;
+
+ /////////////////////////////////
+
+ function addReference(schema, name, skipRef) {
+ var modelName = name;
+ var model;
+
+ if (schema.$ref) {
+ modelName = schema.title || Helpers.simpleRef(schema.$ref);
+ model = models[modelName];
+ } else if (_.isUndefined(name)) {
+ modelName = schema.title || 'Inline Model ' + (++inlineModels);
+ model = {definition: schema};
+ }
+
+ if (skipRef !== true) {
+ references[modelName] = _.isUndefined(model) ? {} : model.definition;
+ }
+
+ return modelName;
+ }
+
+ function primitiveToHTML(schema) {
+ var html = '<span class="propType">';
+ var type = schema.type || 'object';
+
+ if (schema.$ref) {
+ html += addReference(schema, Helpers.simpleRef(schema.$ref));
+ } else if (type === 'object') {
+ if (!_.isUndefined(schema.properties)) {
+ html += addReference(schema);
+ } else {
+ html += 'object';
+ }
+ } else if (type === 'array') {
+ html += 'Array[';
+
+ if (_.isArray(schema.items)) {
+ html += _.map(schema.items, addReference).join(',');
+ } else if (_.isPlainObject(schema.items)) {
+ if (_.isUndefined(schema.items.$ref)) {
+ if (!_.isUndefined(schema.items.type) && _.indexOf(['array', 'object'], schema.items.type) === -1) {
+ html += schema.items.type;
+ } else {
+ html += addReference(schema.items);
+ }
+ } else {
+ html += addReference(schema.items, Helpers.simpleRef(schema.items.$ref));
+ }
+ } else {
+ Helpers.log('Array type\'s \'items\' schema is not an array or an object, cannot process');
+ html += 'object';
+ }
+
+ html += ']';
+ } else {
+ html += schema.type;
+ }
+
+ html += '</span>';
+
+ return html;
+ }
+
+ function primitiveToOptionsHTML(schema, html) {
+ var options = '';
+ var type = schema.type || 'object';
+ var isArray = type === 'array';
+
+ if (isArray) {
+ if (_.isPlainObject(schema.items) && !_.isUndefined(schema.items.type)) {
+ type = schema.items.type;
+ } else {
+ type = 'object';
+ }
+ }
+
+ if (!_.isUndefined(schema.default)) {
+ options += optionHtml('Default', schema.default);
+ }
+
+ switch (type) {
+ case 'string':
+ if (schema.minLength) {
+ options += optionHtml('Min. Length', schema.minLength);
+ }
+
+ if (schema.maxLength) {
+ options += optionHtml('Max. Length', schema.maxLength);
+ }
+
+ if (schema.pattern) {
+ options += optionHtml('Reg. Exp.', schema.pattern);
+ }
+ break;
+ case 'integer':
+ case 'number':
+ if (schema.minimum) {
+ options += optionHtml('Min. Value', schema.minimum);
+ }
+
+ if (schema.exclusiveMinimum) {
+ options += optionHtml('Exclusive Min.', 'true');
+ }
+
+ if (schema.maximum) {
+ options += optionHtml('Max. Value', schema.maximum);
+ }
+
+ if (schema.exclusiveMaximum) {
+ options += optionHtml('Exclusive Max.', 'true');
+ }
+
+ if (schema.multipleOf) {
+ options += optionHtml('Multiple Of', schema.multipleOf);
+ }
+
+ break;
+ }
+
+ if (isArray) {
+ if (schema.minItems) {
+ options += optionHtml('Min. Items', schema.minItems);
+ }
+
+ if (schema.maxItems) {
+ options += optionHtml('Max. Items', schema.maxItems);
+ }
+
+ if (schema.uniqueItems) {
+ options += optionHtml('Unique Items', 'true');
+ }
+
+ if (schema.collectionFormat) {
+ options += optionHtml('Coll. Format', schema.collectionFormat);
+ }
+ }
+
+ if (_.isUndefined(schema.items)) {
+ if (_.isArray(schema.enum)) {
+ var enumString;
+
+ if (type === 'number' || type === 'integer') {
+ enumString = schema.enum.join(', ');
+ } else {
+ enumString = '"' + schema.enum.join('", "') + '"';
+ }
+
+ options += optionHtml('Enum', enumString);
+ }
+ }
+
+ if (options.length > 0) {
+ html = '<span class="propWrap">' + html + '<table class="optionsWrapper"><tr><th colspan="2">' + type + '</th></tr>' + options + '</table></span>';
+ }
+
+ return html;
+ }
+
+ function processModel(schema, name) {
+ var type = schema.type || 'object';
+ var isArray = schema.type === 'array';
+ var html = strongOpen + name + ' ' + (isArray ? '[' : '{') + strongClose;
+
+ if (name) {
+ seenModels.push(name);
+ }
+
+ if (isArray) {
+ if (_.isArray(schema.items)) {
+ html += '<div>' + _.map(schema.items, function (item) {
+ var type = item.type || 'object';
+
+ if (_.isUndefined(item.$ref)) {
+ if (_.indexOf(['array', 'object'], type) > -1) {
+ if (type === 'object' && _.isUndefined(item.properties)) {
+ return 'object';
+ } else {
+ return addReference(item);
+ }
+ } else {
+ return primitiveToOptionsHTML(item, type);
+ }
+ } else {
+ return addReference(item, Helpers.simpleRef(item.$ref));
+ }
+ }).join(',</div><div>');
+ } else if (_.isPlainObject(schema.items)) {
+ if (_.isUndefined(schema.items.$ref)) {
+ if (_.indexOf(['array', 'object'], schema.items.type || 'object') > -1) {
+ if ((_.isUndefined(schema.items.type) || schema.items.type === 'object') && _.isUndefined(schema.items.properties)) {
+ html += '<div>object</div>';
+ } else {
+ html += '<div>' + addReference(schema.items) + '</div>';
+ }
+ } else {
+ html += '<div>' + primitiveToOptionsHTML(schema.items, schema.items.type) + '</div>';
+ }
+ } else {
+ html += '<div>' + addReference(schema.items, Helpers.simpleRef(schema.items.$ref)) + '</div>';
+ }
+ } else {
+ Helpers.log('Array type\'s \'items\' property is not an array or an object, cannot process');
+ html += '<div>object</div>';
+ }
+ } else {
+ if (schema.$ref) {
+ html += '<div>' + addReference(schema, name) + '</div>';
+ } else if (type === 'object') {
+ if (_.isPlainObject(schema.properties)) {
+ var contents = _.map(schema.properties, function (property, name) {
+ var propertyIsRequired = (_.indexOf(schema.required, name) >= 0);
+ var cProperty = _.cloneDeep(property);
+
+ var requiredClass = propertyIsRequired ? 'required' : '';
+ var html = '<div' + (property.readOnly ? ' class="readOnly"' : '') + '><span class="propName ' + requiredClass + '">' + name + '</span> (';
+ var model;
+ var propDescription;
+
+ // Allow macro to set the default value
+ cProperty.default = modelPropertyMacro(cProperty);
+
+ // Resolve the schema (Handle nested schemas)
+ cProperty = Helpers.resolveSchema(cProperty);
+
+ propDescription = property.description || cProperty.description;
+
+ // We need to handle property references to primitives (Issue 339)
+ if (!_.isUndefined(cProperty.$ref)) {
+ model = models[Helpers.simpleRef(cProperty.$ref)];
+
+ if (!_.isUndefined(model) && _.indexOf([undefined, 'array', 'object'], model.definition.type) === -1) {
+ // Use referenced schema
+ cProperty = Helpers.resolveSchema(model.definition);
+ }
+ }
+
+ html += primitiveToHTML(cProperty);
+
+ if(!propertyIsRequired) {
+ html += ', <span class="propOptKey">optional</span>';
+ }
+
+ if(property.readOnly) {
+ html += ', <span class="propReadOnly">read only</span>';
+ }
+
+ html += ')';
+
+ if (!_.isUndefined(propDescription)) {
+ html += ': ' + '<span class="propDesc">' + propDescription + '</span>';
+ }
+
+ if (cProperty.enum) {
+ html += ' = <span class="propVals">[\'' + cProperty.enum.join('\', \'') + '\']</span>';
+ }
+
+ return primitiveToOptionsHTML(cProperty, html);
+ }).join(',</div>');
+ }
+
+ if (contents) {
+ html += contents + '</div>';
+ }
+ } else {
+ html += '<div>' + primitiveToOptionsHTML(schema, type) + '</div>';
+ }
+ }
+
+ return html + strongOpen + (isArray ? ']' : '}') + strongClose;
+ }
+}
+
+},{"./helpers":4,"lodash-compat/array/indexOf":53,"lodash-compat/collection/forEach":58,"lodash-compat/collection/map":60,"lodash-compat/lang/cloneDeep":142,"lodash-compat/lang/isArray":144,"lodash-compat/lang/isEmpty":145,"lodash-compat/lang/isObject":148,"lodash-compat/lang/isPlainObject":149,"lodash-compat/lang/isUndefined":152,"lodash-compat/object/keys":153}],8:[function(require,module,exports){
+'use strict';
+
+var SwaggerHttp = require('./http');
+var _ = {
+ isObject: require('lodash-compat/lang/isObject')
+};
+
+var SwaggerSpecConverter = module.exports = function () {
+ this.errors = [];
+ this.warnings = [];
+ this.modelMap = {};
+};
+
+SwaggerSpecConverter.prototype.setDocumentationLocation = function (location) {
+ this.docLocation = location;
+};
+
+/**
+ * converts a resource listing OR api declaration
+ **/
+SwaggerSpecConverter.prototype.convert = function (obj, clientAuthorizations, opts, callback) {
+ // not a valid spec
+ if(!obj || !Array.isArray(obj.apis)) {
+ return this.finish(callback, null);
+ }
+ this.clientAuthorizations = clientAuthorizations;
+
+ // create a new swagger object to return
+ var swagger = { swagger: '2.0' };
+
+ swagger.originalVersion = obj.swaggerVersion;
+
+ // add the info
+ this.apiInfo(obj, swagger);
+
+ // add security definitions
+ this.securityDefinitions(obj, swagger);
+
+ // take basePath into account
+ if (obj.basePath) {
+ this.setDocumentationLocation(obj.basePath);
+ }
+
+ // see if this is a single-file swagger definition
+ var isSingleFileSwagger = false;
+ var i;
+ for(i = 0; i < obj.apis.length; i++) {
+ var api = obj.apis[i];
+ if(Array.isArray(api.operations)) {
+ isSingleFileSwagger = true;
+ }
+ }
+ if(isSingleFileSwagger) {
+ this.declaration(obj, swagger);
+ this.finish(callback, swagger);
+ }
+ else {
+ this.resourceListing(obj, swagger, opts, callback);
+ }
+};
+
+SwaggerSpecConverter.prototype.declaration = function(obj, swagger) {
+ var name, i, p, pos;
+ if(!obj.apis) {
+ return;
+ }
+
+ if (obj.basePath.indexOf('http://') === 0) {
+ p = obj.basePath.substring('http://'.length);
+ pos = p.indexOf('/');
+ if (pos > 0) {
+ swagger.host = p.substring(0, pos);
+ swagger.basePath = p.substring(pos);
+ }
+ else {
+ swagger.host = p;
+ swagger.basePath = '/';
+ }
+ } else if (obj.basePath.indexOf('https://') === 0) {
+ p = obj.basePath.substring('https://'.length);
+ pos = p.indexOf('/');
+ if (pos > 0) {
+ swagger.host = p.substring(0, pos);
+ swagger.basePath = p.substring(pos);
+ }
+ else {
+ swagger.host = p;
+ swagger.basePath = '/';
+ }
+ } else {
+ swagger.basePath = obj.basePath;
+ }
+
+ var resourceLevelAuth;
+ if(obj.authorizations) {
+ resourceLevelAuth = obj.authorizations;
+ }
+ if(obj.consumes) {
+ swagger.consumes = obj.consumes;
+ }
+ if(obj.produces) {
+ swagger.produces = obj.produces;
+ }
+
+ // build a mapping of id to name for 1.0 model resolutions
+ if(_.isObject(obj)) {
+ for(name in obj.models) {
+ var existingModel = obj.models[name];
+ var key = (existingModel.id || name);
+ this.modelMap[key] = name;
+ }
+ }
+
+ for(i = 0; i < obj.apis.length; i++) {
+ var api = obj.apis[i];
+ var path = api.path;
+ var operations = api.operations;
+ this.operations(path, obj.resourcePath, operations, resourceLevelAuth, swagger);
+ }
+
+ var models = obj.models || {};
+ this.models(models, swagger);
+};
+
+SwaggerSpecConverter.prototype.models = function(obj, swagger) {
+ if(!_.isObject(obj)) {
+ return;
+ }
+ var name;
+
+ swagger.definitions = swagger.definitions || {};
+ for(name in obj) {
+ var existingModel = obj[name];
+ var _enum = [];
+ var schema = { properties: {}};
+ var propertyName;
+ for(propertyName in existingModel.properties) {
+ var existingProperty = existingModel.properties[propertyName];
+ var property = {};
+ this.dataType(existingProperty, property);
+ if(existingProperty.description) {
+ property.description = existingProperty.description;
+ }
+ if(existingProperty['enum']) {
+ property['enum'] = existingProperty['enum'];
+ }
+ if(typeof existingProperty.required === 'boolean' && existingProperty.required === true) {
+ _enum.push(propertyName);
+ }
+ if(typeof existingProperty.required === 'string' && existingProperty.required === 'true') {
+ _enum.push(propertyName);
+ }
+ schema.properties[propertyName] = property;
+ }
+ if(_enum.length > 0) {
+ schema['enum'] = _enum;
+ }
+
+ schema.required = existingModel.required;
+ swagger.definitions[name] = schema;
+ }
+};
+
+SwaggerSpecConverter.prototype.extractTag = function(resourcePath) {
+ var pathString = resourcePath || 'default';
+ if(pathString.indexOf('http:') === 0 || pathString.indexOf('https:') === 0) {
+ pathString = pathString.split(['/']);
+ pathString = pathString[pathString.length -1].substring();
+ }
+ if(pathString.endsWith('.json')) {
+ pathString = pathString.substring(0, pathString.length - '.json'.length);
+ }
+ return pathString.replace('/','');
+};
+
+SwaggerSpecConverter.prototype.operations = function(path, resourcePath, obj, resourceLevelAuth, swagger) {
+ if(!Array.isArray(obj)) {
+ return;
+ }
+ var i;
+
+ if(!swagger.paths) {
+ swagger.paths = {};
+ }
+
+ var pathObj = swagger.paths[path] || {};
+ var tag = this.extractTag(resourcePath);
+ swagger.tags = swagger.tags || [];
+ var matched = false;
+ for(i = 0; i < swagger.tags.length; i++) {
+ var tagObject = swagger.tags[i];
+ if(tagObject.name === tag) {
+ matched = true;
+ }
+ }
+ if(!matched) {
+ swagger.tags.push({name: tag});
+ }
+
+ for(i = 0; i < obj.length; i++) {
+ var existingOperation = obj[i];
+ var method = (existingOperation.method || existingOperation.httpMethod).toLowerCase();
+ var operation = {tags: [tag]};
+ var existingAuthorizations = existingOperation.authorizations;
+
+ if(existingAuthorizations && Object.keys(existingAuthorizations).length === 0) {
+ existingAuthorizations = resourceLevelAuth;
+ }
+
+ if(typeof existingAuthorizations !== 'undefined') {
+ var scopesObject;
+ for(var key in existingAuthorizations) {
+ operation.security = operation.security || [];
+ var scopes = existingAuthorizations[key];
+ if(scopes) {
+ var securityScopes = [];
+ for(var j in scopes) {
+ securityScopes.push(scopes[j].scope);
+ }
+ scopesObject = {};
+ scopesObject[key] = securityScopes;
+ operation.security.push(scopesObject);
+ }
+ else {
+ scopesObject = {};
+ scopesObject[key] = [];
+ operation.security.push(scopesObject);
+ }
+ }
+ }
+
+ if(existingOperation.consumes) {
+ operation.consumes = existingOperation.consumes;
+ }
+ else if(swagger.consumes) {
+ operation.consumes = swagger.consumes;
+ }
+ if(existingOperation.produces) {
+ operation.produces = existingOperation.produces;
+ }
+ else if(swagger.produces) {
+ operation.produces = swagger.produces;
+ }
+ if(existingOperation.summary) {
+ operation.summary = existingOperation.summary;
+ }
+ if(existingOperation.notes) {
+ operation.description = existingOperation.notes;
+ }
+ if(existingOperation.nickname) {
+ operation.operationId = existingOperation.nickname;
+ }
+ if(existingOperation.deprecated) {
+ operation.deprecated = existingOperation.deprecated;
+ }
+
+ this.authorizations(existingAuthorizations, swagger);
+ this.parameters(operation, existingOperation.parameters, swagger);
+ this.responseMessages(operation, existingOperation, swagger);
+
+ pathObj[method] = operation;
+ }
+
+ swagger.paths[path] = pathObj;
+};
+
+SwaggerSpecConverter.prototype.responseMessages = function(operation, existingOperation) {
+ if(!_.isObject(existingOperation)) {
+ return;
+ }
+ // build default response from the operation (1.x)
+ var defaultResponse = {};
+ this.dataType(existingOperation, defaultResponse);
+ // TODO: look into the real problem of rendering responses in swagger-ui
+ // ....should reponseType have an implicit schema?
+ if(!defaultResponse.schema && defaultResponse.type) {
+ defaultResponse = {schema: defaultResponse};
+ }
+
+ operation.responses = operation.responses || {};
+
+ // grab from responseMessages (1.2)
+ var has200 = false;
+ if(Array.isArray(existingOperation.responseMessages)) {
+ var i;
+ var existingResponses = existingOperation.responseMessages;
+ for(i = 0; i < existingResponses.length; i++) {
+ var existingResponse = existingResponses[i];
+ var response = { description: existingResponse.message };
+ if(existingResponse.code === 200) {
+ has200 = true;
+ }
+ // Convert responseModel -> schema{$ref: responseModel}
+ if(existingResponse.responseModel) {
+ response.schema = {'$ref': '#/definitions/' + existingResponse.responseModel};
+ }
+ operation.responses['' + existingResponse.code] = response;
+ }
+ }
+
+ if(has200) {
+ operation.responses['default'] = defaultResponse;
+ }
+ else {
+ operation.responses['200'] = defaultResponse;
+ }
+};
+
+SwaggerSpecConverter.prototype.authorizations = function(obj) {
+ // TODO
+ if(!_.isObject(obj)) {
+ return;
+ }
+};
+
+SwaggerSpecConverter.prototype.parameters = function(operation, obj) {
+ if(!Array.isArray(obj)) {
+ return;
+ }
+ var i;
+ for(i = 0; i < obj.length; i++) {
+ var existingParameter = obj[i];
+ var parameter = {};
+ parameter.name = existingParameter.name;
+ parameter.description = existingParameter.description;
+ parameter.required = existingParameter.required;
+ parameter.in = existingParameter.paramType;
+
+ // per #168
+ if(parameter.in === 'body') {
+ parameter.name = 'body';
+ }
+ if(parameter.in === 'form') {
+ parameter.in = 'formData';
+ }
+
+ if(existingParameter.enum) {
+ parameter.enum = existingParameter.enum;
+ }
+
+ if(existingParameter.allowMultiple === true || existingParameter.allowMultiple === 'true') {
+ var innerType = {};
+ this.dataType(existingParameter, innerType);
+ parameter.type = 'array';
+ parameter.items = innerType;
+
+ if(existingParameter.allowableValues) {
+ var av = existingParameter.allowableValues;
+ if(av.valueType === 'LIST') {
+ parameter['enum'] = av.values;
+ }
+ }
+ }
+ else {
+ this.dataType(existingParameter, parameter);
+ }
+ if(typeof existingParameter.defaultValue !== 'undefined') {
+ parameter.default = existingParameter.defaultValue;
+ }
+
+ operation.parameters = operation.parameters || [];
+ operation.parameters.push(parameter);
+ }
+};
+
+SwaggerSpecConverter.prototype.dataType = function(source, target) {
+ if(!_.isObject(source)) {
+ return;
+ }
+
+ if(source.minimum) {
+ target.minimum = source.minimum;
+ }
+ if(source.maximum) {
+ target.maximum = source.maximum;
+ }
+ if (source.format) {
+ target.format = source.format;
+ }
+
+ // default can be 'false'
+ if(typeof source.defaultValue !== 'undefined') {
+ target.default = source.defaultValue;
+ }
+
+ var jsonSchemaType = this.toJsonSchema(source);
+ if(jsonSchemaType) {
+ target = target || {};
+ if(jsonSchemaType.type) {
+ target.type = jsonSchemaType.type;
+ }
+ if(jsonSchemaType.format) {
+ target.format = jsonSchemaType.format;
+ }
+ if(jsonSchemaType.$ref) {
+ target.schema = {$ref: jsonSchemaType.$ref};
+ }
+ if(jsonSchemaType.items) {
+ target.items = jsonSchemaType.items;
+ }
+ }
+};
+
+SwaggerSpecConverter.prototype.toJsonSchema = function(source) {
+ if(!source) {
+ return 'object';
+ }
+ var detectedType = (source.type || source.dataType || source.responseClass || '');
+ var lcType = detectedType.toLowerCase();
+ var format = (source.format || '').toLowerCase();
+
+ if(lcType.indexOf('list[') === 0) {
+ var innerType = detectedType.substring(5, detectedType.length - 1);
+ var jsonType = this.toJsonSchema({type: innerType});
+ return {type: 'array', items: jsonType};
+ } else if(lcType === 'int' || (lcType === 'integer' && format === 'int32')) {
+ {return {type: 'integer', format: 'int32'};}
+ } else if(lcType === 'long' || (lcType === 'integer' && format === 'int64')) {
+ {return {type: 'integer', format: 'int64'};}
+ } else if(lcType === 'integer') {
+ {return {type: 'integer', format: 'int64'};}
+ } else if(lcType === 'float' || (lcType === 'number' && format === 'float')) {
+ {return {type: 'number', format: 'float'};}
+ } else if(lcType === 'double' || (lcType === 'number' && format === 'double')) {
+ {return {type: 'number', format: 'double'};}
+ } else if((lcType === 'string' && format === 'date-time') || (lcType === 'date')) {
+ {return {type: 'string', format: 'date-time'};}
+ } else if(lcType === 'string') {
+ {return {type: 'string'};}
+ } else if(lcType === 'file') {
+ {return {type: 'file'};}
+ } else if(lcType === 'boolean') {
+ {return {type: 'boolean'};}
+ } else if(lcType === 'boolean') {
+ {return {type: 'boolean'};}
+ } else if(lcType === 'array' || lcType === 'list') {
+ if(source.items) {
+ var it = this.toJsonSchema(source.items);
+ return {type: 'array', items: it};
+ }
+ else {
+ return {type: 'array', items: {type: 'object'}};
+ }
+ } else if(source.$ref) {
+ return {$ref: this.modelMap[source.$ref] ? '#/definitions/' + this.modelMap[source.$ref] : source.$ref};
+ } else if(lcType === 'void' || lcType === '') {
+ {return {};}
+ } else if (this.modelMap[source.type]) {
+ // If this a model using `type` instead of `$ref`, that's fine.
+ return {$ref: '#/definitions/' + this.modelMap[source.type]};
+ } else {
+ // Unknown model type or 'object', pass it along.
+ return {type: source.type};
+ }
+};
+
+SwaggerSpecConverter.prototype.resourceListing = function(obj, swagger, opts, callback) {
+ var i;
+ var processedCount = 0; // jshint ignore:line
+ var self = this; // jshint ignore:line
+ var expectedCount = obj.apis.length;
+ var _swagger = swagger; // jshint ignore:line
+ var _opts = {};
+
+ if(opts && opts.requestInterceptor){
+ _opts.requestInterceptor = opts.requestInterceptor;
+ }
+
+ if(opts && opts.responseInterceptor){
+ _opts.responseInterceptor = opts.responseInterceptor;
+ }
+
+ if(expectedCount === 0) {
+ this.finish(callback, swagger);
+ }
+
+ for(i = 0; i < expectedCount; i++) {
+ var api = obj.apis[i];
+ var path = api.path;
+ var absolutePath = this.getAbsolutePath(obj.swaggerVersion, this.docLocation, path);
+
+ if(api.description) {
+ swagger.tags = swagger.tags || [];
+ swagger.tags.push({
+ name : this.extractTag(api.path),
+ description : api.description || ''
+ });
+ }
+ var http = {
+ url: absolutePath,
+ headers: {accept: 'application/json'},
+ on: {},
+ method: 'get'
+ };
+ /* jshint ignore:start */
+ http.on.response = function(data) {
+ processedCount += 1;
+ var obj = data.obj;
+ if(obj) {
+ self.declaration(obj, _swagger);
+ }
+ if(processedCount === expectedCount) {
+ self.finish(callback, _swagger);
+ }
+ };
+ http.on.error = function(data) {
+ console.error(data);
+ processedCount += 1;
+ if(processedCount === expectedCount) {
+ self.finish(callback, _swagger);
+ }
+ };
+ /* jshint ignore:end */
+
+ if(this.clientAuthorizations && typeof this.clientAuthorizations.apply === 'function') {
+ this.clientAuthorizations.apply(http);
+ }
+
+ new SwaggerHttp().execute(http, _opts);
+ }
+};
+
+SwaggerSpecConverter.prototype.getAbsolutePath = function(version, docLocation, path) {
+ if(version === '1.0') {
+ if(docLocation.endsWith('.json')) {
+ // get root path
+ var pos = docLocation.lastIndexOf('/');
+ if(pos > 0) {
+ docLocation = docLocation.substring(0, pos);
+ }
+ }
+ }
+
+ var location = docLocation;
+ if(path.indexOf('http://') === 0 || path.indexOf('https://') === 0) {
+ location = path;
+ }
+ else {
+ if(docLocation.endsWith('/')) {
+ location = docLocation.substring(0, docLocation.length - 1);
+ }
+ location += path;
+ }
+ location = location.replace('{format}', 'json');
+ return location;
+};
+
+SwaggerSpecConverter.prototype.securityDefinitions = function(obj, swagger) {
+ if(obj.authorizations) {
+ var name;
+ for(name in obj.authorizations) {
+ var isValid = false;
+ var securityDefinition = {};
+ var definition = obj.authorizations[name];
+ if(definition.type === 'apiKey') {
+ securityDefinition.type = 'apiKey';
+ securityDefinition.in = definition.passAs;
+ securityDefinition.name = definition.keyname || name;
+ isValid = true;
+ }
+ else if(definition.type === 'basicAuth') {
+ securityDefinition.type = 'basicAuth';
+ isValid = true;
+ }
+ else if(definition.type === 'oauth2') {
+ var existingScopes = definition.scopes || [];
+ var scopes = {};
+ var i;
+ for(i in existingScopes) {
+ var scope = existingScopes[i];
+ scopes[scope.scope] = scope.description;
+ }
+ securityDefinition.type = 'oauth2';
+ if(i > 0) {
+ securityDefinition.scopes = scopes;
+ }
+ if(definition.grantTypes) {
+ if(definition.grantTypes.implicit) {
+ var implicit = definition.grantTypes.implicit;
+ securityDefinition.flow = 'implicit';
+ securityDefinition.authorizationUrl = implicit.loginEndpoint;
+ isValid = true;
+ }
+ /* jshint ignore:start */
+ if(definition.grantTypes['authorization_code']) {
+ if(!securityDefinition.flow) {
+ // cannot set if flow is already defined
+ var authCode = definition.grantTypes['authorization_code'];
+ securityDefinition.flow = 'accessCode';
+ securityDefinition.authorizationUrl = authCode.tokenRequestEndpoint.url;
+ securityDefinition.tokenUrl = authCode.tokenEndpoint.url;
+ isValid = true;
+ }
+ }
+ /* jshint ignore:end */
+ }
+ }
+ if(isValid) {
+ swagger.securityDefinitions = swagger.securityDefinitions || {};
+ swagger.securityDefinitions[name] = securityDefinition;
+ }
+ }
+ }
+};
+
+SwaggerSpecConverter.prototype.apiInfo = function(obj, swagger) {
+ // info section
+ if(obj.info) {
+ var info = obj.info;
+ swagger.info = {};
+
+ if(info.contact) {
+ swagger.info.contact = {};
+ swagger.info.contact.email = info.contact;
+ }
+ if(info.description) {
+ swagger.info.description = info.description;
+ }
+ if(info.title) {
+ swagger.info.title = info.title;
+ }
+ if(info.termsOfServiceUrl) {
+ swagger.info.termsOfService = info.termsOfServiceUrl;
+ }
+ if(info.license || info.licenseUrl) {
+ swagger.license = {};
+ if(info.license) {
+ swagger.license.name = info.license;
+ }
+ if(info.licenseUrl) {
+ swagger.license.url = info.licenseUrl;
+ }
+ }
+ }
+ else {
+ this.warnings.push('missing info section');
+ }
+};
+
+SwaggerSpecConverter.prototype.finish = function (callback, obj) {
+ callback(obj);
+};
+
+},{"./http":5,"lodash-compat/lang/isObject":148}],9:[function(require,module,exports){
+'use strict';
+
+var log = require('../helpers').log;
+var _ = {
+ isPlainObject: require('lodash-compat/lang/isPlainObject'),
+ isString: require('lodash-compat/lang/isString'),
+};
+
+var SchemaMarkup = require('../schema-markup.js');
+var jsyaml = require('js-yaml');
+
+var Model = module.exports = function (name, definition, models, modelPropertyMacro) {
+ this.definition = definition || {};
+ this.isArray = definition.type === 'array';
+ this.models = models || {};
+ this.name = definition.title || name || 'Inline Model';
+ this.modelPropertyMacro = modelPropertyMacro || function (property) {
+ return property.default;
+ };
+
+ return this;
+};
+
+// Note! This function will be removed in 2.2.x!
+Model.prototype.createJSONSample = Model.prototype.getSampleValue = function (modelsToIgnore) {
+ modelsToIgnore = modelsToIgnore || {};
+
+ modelsToIgnore[this.name] = this;
+
+ // Response support
+ if (this.examples && _.isPlainObject(this.examples) && this.examples['application/json']) {
+ this.definition.example = this.examples['application/json'];
+
+ if (_.isString(this.definition.example)) {
+ this.definition.example = jsyaml.safeLoad(this.definition.example);
+ }
+ } else if (!this.definition.example) {
+ this.definition.example = this.examples;
+ }
+
+ return SchemaMarkup.schemaToJSON(this.definition, this.models, modelsToIgnore, this.modelPropertyMacro);
+};
+
+Model.prototype.getMockSignature = function () {
+ return SchemaMarkup.schemaToHTML(this.name, this.definition, this.models, this.modelPropertyMacro);
+};
+
+},{"../helpers":4,"../schema-markup.js":7,"js-yaml":20,"lodash-compat/lang/isPlainObject":149,"lodash-compat/lang/isString":150}],10:[function(require,module,exports){
+'use strict';
+
+var _ = {
+ cloneDeep: require('lodash-compat/lang/cloneDeep'),
+ isUndefined: require('lodash-compat/lang/isUndefined'),
+ isEmpty: require('lodash-compat/lang/isEmpty'),
+ isObject: require('lodash-compat/lang/isObject')
+};
+var helpers = require('../helpers');
+var Model = require('./model');
+var SwaggerHttp = require('../http');
+var Q = require('q');
+
+var Operation = module.exports = function (parent, scheme, operationId, httpMethod, path, args, definitions, models, clientAuthorizations) {
+ var errors = [];
+
+ parent = parent || {};
+ args = args || {};
+
+ if(parent && parent.options) {
+ this.client = parent.options.client || null;
+ this.requestInterceptor = parent.options.requestInterceptor || null;
+ this.responseInterceptor = parent.options.responseInterceptor || null;
+ }
+ this.authorizations = args.security;
+ this.basePath = parent.basePath || '/';
+ this.clientAuthorizations = clientAuthorizations;
+ this.consumes = args.consumes || parent.consumes || ['application/json'];
+ this.produces = args.produces || parent.produces || ['application/json'];
+ this.deprecated = args.deprecated;
+ this.description = args.description;
+ this.host = parent.host || 'localhost';
+ this.method = (httpMethod || errors.push('Operation ' + operationId + ' is missing method.'));
+ this.models = models || {};
+ this.nickname = (operationId || errors.push('Operations must have a nickname.'));
+ this.operation = args;
+ this.operations = {};
+ this.parameters = args !== null ? (args.parameters || []) : {};
+ this.parent = parent;
+ this.path = (path || errors.push('Operation ' + this.nickname + ' is missing path.'));
+ this.responses = (args.responses || {});
+ this.scheme = scheme || parent.scheme || 'http';
+ this.schemes = args.schemes || parent.schemes;
+ this.security = args.security;
+ this.summary = args.summary || '';
+ this.type = null;
+ this.useJQuery = parent.useJQuery;
+ this.enableCookies = parent.enableCookies;
+ this.parameterMacro = parent.parameterMacro || function (operation, parameter) {
+ return parameter.default;
+ };
+
+ this.inlineModels = [];
+
+ if (typeof this.deprecated === 'string') {
+ switch(this.deprecated.toLowerCase()) {
+ case 'true': case 'yes': case '1': {
+ this.deprecated = true;
+ break;
+ }
+
+ case 'false': case 'no': case '0': case null: {
+ this.deprecated = false;
+ break;
+ }
+
+ default: this.deprecated = Boolean(this.deprecated);
+ }
+ }
+
+ var i, model;
+
+ if (definitions) {
+ // add to global models
+ var key;
+
+ for (key in definitions) {
+ model = new Model(key, definitions[key], this.models, parent.modelPropertyMacro);
+
+ if (model) {
+ this.models[key] = model;
+ }
+ }
+ }
+ else {
+ definitions = {};
+ }
+
+ for (i = 0; i < this.parameters.length; i++) {
+ var param = this.parameters[i];
+
+ // Allow macro to set the default value
+ param.default = this.parameterMacro(this, param);
+
+ if (param.type === 'array') {
+ param.isList = true;
+ param.allowMultiple = true;
+ // the enum can be defined at the items level
+ //if (param.items && param.items.enum) {
+ // param['enum'] = param.items.enum;
+ //}
+ }
+
+ var innerType = this.getType(param);
+
+ if (innerType && innerType.toString().toLowerCase() === 'boolean') {
+ param.allowableValues = {};
+ param.isList = true;
+ param['enum'] = [true, false]; // use actual primitives
+ }
+
+ if(typeof param['x-example'] !== 'undefined') {
+ var d = param['x-example'];
+ param.default = d;
+ }
+ if(param['x-examples']) {
+ var d = param['x-examples'].default;
+ if(typeof d !== 'undefined') {
+ param.default = d;
+ }
+ }
+
+ if (typeof param['enum'] !== 'undefined') {
+ var id;
+
+ param.allowableValues = {};
+ param.allowableValues.values = [];
+ param.allowableValues.descriptiveValues = [];
+
+ for (id = 0; id < param['enum'].length; id++) {
+ var value = param['enum'][id];
+ var isDefault = (value === param.default || value+'' === param.default);
+
+ param.allowableValues.values.push(value);
+ // Always have string for descriptive values....
+ param.allowableValues.descriptiveValues.push({value : value+'', isDefault: isDefault});
+ }
+ }
+
+ if (param.type === 'array') {
+ innerType = [innerType];
+
+ if (typeof param.allowableValues === 'undefined') {
+ // can't show as a list if no values to select from
+ delete param.isList;
+ delete param.allowMultiple;
+ }
+ }
+
+ param.modelSignature = {type: innerType, definitions: this.models};
+ param.signature = this.getModelSignature(innerType, this.models).toString();
+ param.sampleJSON = this.getModelSampleJSON(innerType, this.models);
+ param.responseClassSignature = param.signature;
+ }
+
+ var defaultResponseCode, response, responses = this.responses;
+
+ if (responses['200']) {
+ response = responses['200'];
+ defaultResponseCode = '200';
+ } else if (responses['201']) {
+ response = responses['201'];
+ defaultResponseCode = '201';
+ } else if (responses['202']) {
+ response = responses['202'];
+ defaultResponseCode = '202';
+ } else if (responses['203']) {
+ response = responses['203'];
+ defaultResponseCode = '203';
+ } else if (responses['204']) {
+ response = responses['204'];
+ defaultResponseCode = '204';
+ } else if (responses['205']) {
+ response = responses['205'];
+ defaultResponseCode = '205';
+ } else if (responses['206']) {
+ response = responses['206'];
+ defaultResponseCode = '206';
+ } else if (responses['default']) {
+ response = responses['default'];
+ defaultResponseCode = 'default';
+ }
+
+ if (response && response.schema) {
+ var resolvedModel = this.resolveModel(response.schema, definitions);
+ var successResponse;
+
+ delete responses[defaultResponseCode];
+
+ if (resolvedModel) {
+ this.successResponse = {};
+ successResponse = this.successResponse[defaultResponseCode] = resolvedModel;
+ } else if (!response.schema.type || response.schema.type === 'object' || response.schema.type === 'array') {
+ // Inline model
+ this.successResponse = {};
+ successResponse = this.successResponse[defaultResponseCode] = new Model(undefined, response.schema || {}, this.models, parent.modelPropertyMacro);
+ } else {
+ // Primitive
+ this.successResponse = {};
+ successResponse = this.successResponse[defaultResponseCode] = response.schema;
+ }
+
+ if (successResponse) {
+ // Attach response properties
+ if (response.description) {
+ successResponse.description = response.description;
+ }
+
+ if (response.examples) {
+ successResponse.examples = response.examples;
+ }
+
+ if (response.headers) {
+ successResponse.headers = response.headers;
+ }
+ }
+
+ this.type = response;
+ }
+
+ if (errors.length > 0) {
+ if (this.resource && this.resource.api && this.resource.api.fail) {
+ this.resource.api.fail(errors);
+ }
+ }
+
+ return this;
+};
+
+Operation.prototype.isDefaultArrayItemValue = function(value, param) {
+ if (param.default && Array.isArray(param.default)) {
+ return param.default.indexOf(value) !== -1;
+ }
+ return value === param.default;
+};
+
+Operation.prototype.getType = function (param) {
+ var type = param.type;
+ var format = param.format;
+ var isArray = false;
+ var str;
+
+ if (type === 'integer' && format === 'int32') {
+ str = 'integer';
+ } else if (type === 'integer' && format === 'int64') {
+ str = 'long';
+ } else if (type === 'integer') {
+ str = 'integer';
+ } else if (type === 'string') {
+ if (format === 'date-time') {
+ str = 'date-time';
+ } else if (format === 'date') {
+ str = 'date';
+ } else {
+ str = 'string';
+ }
+ } else if (type === 'number' && format === 'float') {
+ str = 'float';
+ } else if (type === 'number' && format === 'double') {
+ str = 'double';
+ } else if (type === 'number') {
+ str = 'double';
+ } else if (type === 'boolean') {
+ str = 'boolean';
+ } else if (type === 'array') {
+ isArray = true;
+
+ if (param.items) {
+ str = this.getType(param.items);
+ }
+ } else if (type === 'file') {
+ str = 'file';
+ }
+
+ if (param.$ref) {
+ str = helpers.simpleRef(param.$ref);
+ }
+
+ var schema = param.schema;
+
+ if (schema) {
+ var ref = schema.$ref;
+
+ if (ref) {
+ ref = helpers.simpleRef(ref);
+
+ if (isArray) {
+ return [ ref ];
+ } else {
+ return ref;
+ }
+ } else {
+ // If inline schema, we add it our interal hash -> which gives us it's ID (int)
+ if(schema.type === 'object') {
+ return this.addInlineModel(schema);
+ }
+ return this.getType(schema);
+ }
+ }
+ if (isArray) {
+ return [ str ];
+ } else {
+ return str;
+ }
+};
+
+/**
+ * adds an inline schema (model) to a hash, where we can ref it later
+ * @param {object} schema a schema
+ * @return {number} the ID of the schema being added, or null
+ **/
+Operation.prototype.addInlineModel = function (schema) {
+ var len = this.inlineModels.length;
+ var model = this.resolveModel(schema, {});
+ if(model) {
+ this.inlineModels.push(model);
+ return 'Inline Model '+len; // return string ref of the inline model (used with #getInlineModel)
+ }
+ return null; // report errors?
+};
+
+/**
+ * gets the internal ref to an inline model
+ * @param {string} inline_str a string reference to an inline model
+ * @return {Model} the model being referenced. Or null
+ **/
+Operation.prototype.getInlineModel = function(inlineStr) {
+ if(/^Inline Model \d+$/.test(inlineStr)) {
+ var id = parseInt(inlineStr.substr('Inline Model'.length).trim(),10); //
+ var model = this.inlineModels[id];
+ return model;
+ }
+ // I'm returning null here, should I rather throw an error?
+ return null;
+};
+
+Operation.prototype.resolveModel = function (schema, definitions) {
+ if (typeof schema.$ref !== 'undefined') {
+ var ref = schema.$ref;
+
+ if (ref.indexOf('#/definitions/') === 0) {
+ ref = ref.substring('#/definitions/'.length);
+ }
+
+ if (definitions[ref]) {
+ return new Model(ref, definitions[ref], this.models, this.parent.modelPropertyMacro);
+ }
+ // schema must at least be an object to get resolved to an inline Model
+ } else if (schema && typeof schema === 'object' &&
+ (schema.type === 'object' || _.isUndefined(schema.type))) {
+ return new Model(undefined, schema, this.models, this.parent.modelPropertyMacro);
+ }
+
+ return null;
+};
+
+Operation.prototype.help = function (dontPrint) {
+ var out = this.nickname + ': ' + this.summary + '\n';
+
+ for (var i = 0; i < this.parameters.length; i++) {
+ var param = this.parameters[i];
+ var typeInfo = param.signature;
+
+ out += '\n * ' + param.name + ' (' + typeInfo + '): ' + param.description;
+ }
+
+ if (typeof dontPrint === 'undefined') {
+ helpers.log(out);
+ }
+
+ return out;
+};
+
+Operation.prototype.getModelSignature = function (type, definitions) {
+ var isPrimitive, listType;
+
+ if (type instanceof Array) {
+ listType = true;
+ type = type[0];
+ }
+
+ // Convert undefined to string of 'undefined'
+ if (typeof type === 'undefined') {
+ type = 'undefined';
+ isPrimitive = true;
+
+ } else if (definitions[type]){
+ // a model def exists?
+ type = definitions[type]; /* Model */
+ isPrimitive = false;
+
+ } else if (this.getInlineModel(type)) {
+ type = this.getInlineModel(type); /* Model */
+ isPrimitive = false;
+
+ } else {
+ // We default to primitive
+ isPrimitive = true;
+ }
+
+ if (isPrimitive) {
+ if (listType) {
+ return 'Array[' + type + ']';
+ } else {
+ return type.toString();
+ }
+ } else {
+ if (listType) {
+ return 'Array[' + type.getMockSignature() + ']';
+ } else {
+ return type.getMockSignature();
+ }
+ }
+};
+
+Operation.prototype.supportHeaderParams = function () {
+ return true;
+};
+
+Operation.prototype.supportedSubmitMethods = function () {
+ return this.parent.supportedSubmitMethods;
+};
+
+Operation.prototype.getHeaderParams = function (args) {
+ var headers = this.setContentTypes(args, {});
+
+ for (var i = 0; i < this.parameters.length; i++) {
+ var param = this.parameters[i];
+
+ if (typeof args[param.name] !== 'undefined') {
+ if (param.in === 'header') {
+ var value = args[param.name];
+
+ if (Array.isArray(value)) {
+ value = value.toString();
+ }
+
+ headers[param.name] = value;
+ }
+ }
+ }
+
+ return headers;
+};
+
+Operation.prototype.urlify = function (args) {
+ var formParams = {};
+ var requestUrl = this.path;
+ var querystring = ''; // grab params from the args, build the querystring along the way
+
+ for (var i = 0; i < this.parameters.length; i++) {
+ var param = this.parameters[i];
+
+ if (typeof args[param.name] !== 'undefined') {
+ if (param.in === 'path') {
+ var reg = new RegExp('\{' + param.name + '\}', 'gi');
+ var value = args[param.name];
+
+ if (Array.isArray(value)) {
+ value = this.encodePathCollection(param.collectionFormat, param.name, value);
+ } else {
+ value = this.encodePathParam(value);
+ }
+
+ requestUrl = requestUrl.replace(reg, value);
+ } else if (param.in === 'query' && typeof args[param.name] !== 'undefined') {
+ if (querystring === '') {
+ querystring += '?';
+ } else {
+ querystring += '&';
+ }
+
+ if (typeof param.collectionFormat !== 'undefined') {
+ var qp = args[param.name];
+
+ if (Array.isArray(qp)) {
+ querystring += this.encodeQueryCollection(param.collectionFormat, param.name, qp);
+ } else {
+ querystring += this.encodeQueryParam(param.name) + '=' + this.encodeQueryParam(args[param.name]);
+ }
+ } else {
+ querystring += this.encodeQueryParam(param.name) + '=' + this.encodeQueryParam(args[param.name]);
+ }
+ } else if (param.in === 'formData') {
+ formParams[param.name] = args[param.name];
+ }
+ }
+ }
+ var url = this.scheme + '://' + this.host;
+
+ if (this.basePath !== '/') {
+ url += this.basePath;
+ }
+ return url + requestUrl + querystring;
+};
+
+Operation.prototype.getMissingParams = function (args) {
+ var missingParams = []; // check required params, track the ones that are missing
+ var i;
+
+ for (i = 0; i < this.parameters.length; i++) {
+ var param = this.parameters[i];
+
+ if (param.required === true) {
+ if (typeof args[param.name] === 'undefined') {
+ missingParams = param.name;
+ }
+ }
+ }
+
+ return missingParams;
+};
+
+Operation.prototype.getBody = function (headers, args, opts) {
+ var formParams = {}, hasFormParams, body, key, value, hasBody = false;
+
+ // look at each param and put form params in an object
+ for (var i = 0; i < this.parameters.length; i++) {
+ var param = this.parameters[i];
+ if (typeof args[param.name] !== 'undefined') {
+ if (param.in === 'body') {
+ body = args[param.name];
+ } else if (param.in === 'formData') {
+ formParams[param.name] = args[param.name];
+ hasFormParams = true;
+ }
+ }
+ else {
+ if(param.in === 'body') {
+ hasBody = true;
+ }
+ }
+ }
+
+ // if body is null and hasBody is true, AND a JSON body is requested, send empty {}
+ if(hasBody && typeof body === 'undefined') {
+ var contentType = headers['Content-Type'];
+ if(contentType && contentType.indexOf('application/json') === 0) {
+ body = '{}';
+ }
+ }
+
+ var isMultiPart = false;
+ if(headers['Content-Type'] && headers['Content-Type'].indexOf('multipart/form-data') >= 0) {
+ isMultiPart = true;
+ }
+
+ // handle form params
+ if (hasFormParams && !isMultiPart) {
+ var encoded = '';
+
+ for (key in formParams) {
+ value = formParams[key];
+
+ if (typeof value !== 'undefined') {
+ if (encoded !== '') {
+ encoded += '&';
+ }
+
+ encoded += encodeURIComponent(key) + '=' + encodeURIComponent(value);
+ }
+ }
+
+ body = encoded;
+ } else if (isMultiPart) {
+ if (opts.useJQuery) {
+ var bodyParam = new FormData();
+
+ bodyParam.type = 'formData';
+
+ for (key in formParams) {
+ value = args[key];
+
+ if (typeof value !== 'undefined') {
+ // required for jquery file upload
+ if (value.type === 'file' && value.value) {
+ delete headers['Content-Type'];
+
+ bodyParam.append(key, value.value);
+ } else {
+ bodyParam.append(key, value);
+ }
+ }
+ }
+
+ body = bodyParam;
+ }
+ }
+
+ return body;
+};
+
+/**
+ * gets sample response for a single operation
+ **/
+Operation.prototype.getModelSampleJSON = function (type, models) {
+ var listType, sampleJson, innerType;
+ models = models || {};
+
+ listType = (type instanceof Array);
+ innerType = listType ? type[0] : type;
+
+ if(models[innerType]) {
+ sampleJson = models[innerType].createJSONSample();
+ } else if (this.getInlineModel(innerType)){
+ sampleJson = this.getInlineModel(innerType).createJSONSample(); // may return null, if type isn't correct
+ }
+
+
+ if (sampleJson) {
+ sampleJson = listType ? [sampleJson] : sampleJson;
+
+ if (typeof sampleJson === 'string') {
+ return sampleJson;
+ } else if (_.isObject(sampleJson)) {
+ var t = sampleJson;
+
+ if (sampleJson instanceof Array && sampleJson.length > 0) {
+ t = sampleJson[0];
+ }
+
+ if (t.nodeName && typeof t === 'Node') {
+ var xmlString = new XMLSerializer().serializeToString(t);
+
+ return this.formatXml(xmlString);
+ } else {
+ return JSON.stringify(sampleJson, null, 2);
+ }
+ } else {
+ return sampleJson;
+ }
+ }
+};
+
+/**
+ * legacy binding
+ **/
+Operation.prototype.do = function (args, opts, callback, error, parent) {
+ return this.execute(args, opts, callback, error, parent);
+};
+
+/**
+ * executes an operation
+ **/
+Operation.prototype.execute = function (arg1, arg2, arg3, arg4, parent) {
+ var args = arg1 || {};
+ var opts = {}, success, error, deferred;
+
+ if (_.isObject(arg2)) {
+ opts = arg2;
+ success = arg3;
+ error = arg4;
+ }
+
+ if(this.client) {
+ opts.client = this.client;
+ }
+
+ // add the request interceptor from parent, if none sent from client
+ if(!opts.requestInterceptor && this.requestInterceptor ) {
+ opts.requestInterceptor = this.requestInterceptor ;
+ }
+
+ if(!opts.responseInterceptor && this.responseInterceptor) {
+ opts.responseInterceptor = this.responseInterceptor;
+ }
+
+ if (typeof arg2 === 'function') {
+ success = arg2;
+ error = arg3;
+ }
+
+ if (this.parent.usePromise) {
+ deferred = Q.defer();
+ } else {
+ success = (success || this.parent.defaultSuccessCallback || helpers.log);
+ error = (error || this.parent.defaultErrorCallback || helpers.log);
+ }
+
+
+ if (typeof opts.useJQuery === 'undefined') {
+ opts.useJQuery = this.useJQuery;
+ }
+
+ if (typeof opts.enableCookies === 'undefined') {
+ opts.enableCookies = this.enableCookies;
+ }
+
+ var missingParams = this.getMissingParams(args);
+
+ if (missingParams.length > 0) {
+ var message = 'missing required params: ' + missingParams;
+
+ helpers.fail(message);
+
+ if (this.parent.usePromise) {
+ deferred.reject(message);
+ return deferred.promise;
+ } else {
+ error(message, parent);
+ return {};
+ }
+ }
+
+ var allHeaders = this.getHeaderParams(args);
+ var contentTypeHeaders = this.setContentTypes(args, opts);
+ var headers = {}, attrname;
+
+ for (attrname in allHeaders) { headers[attrname] = allHeaders[attrname]; }
+ for (attrname in contentTypeHeaders) { headers[attrname] = contentTypeHeaders[attrname]; }
+
+ var body = this.getBody(contentTypeHeaders, args, opts);
+ var url = this.urlify(args);
+
+ if(url.indexOf('.{format}') > 0) {
+ if(headers) {
+ var format = headers.Accept || headers.accept;
+ if(format && format.indexOf('json') > 0) {
+ url = url.replace('.{format}', '.json');
+ }
+ else if(format && format.indexOf('xml') > 0) {
+ url = url.replace('.{format}', '.xml');
+ }
+ }
+ }
+
+ var obj = {
+ url: url,
+ method: this.method.toUpperCase(),
+ body: body,
+ enableCookies: opts.enableCookies,
+ useJQuery: opts.useJQuery,
+ deferred: deferred,
+ headers: headers,
+ on: {
+ response: function (response) {
+ if (deferred) {
+ deferred.resolve(response);
+ return deferred.promise;
+ } else {
+ return success(response, parent);
+ }
+ },
+ error: function (response) {
+ if (deferred) {
+ deferred.reject(response);
+ return deferred.promise;
+ } else {
+ return error(response, parent);
+ }
+ }
+ }
+ };
+
+ this.clientAuthorizations.apply(obj, this.operation.security);
+ if (opts.mock === true) {
+ return obj;
+ } else {
+ return new SwaggerHttp().execute(obj, opts);
+ }
+};
+
+function itemByPriority(col, itemPriority) {
+
+ // No priorities? return first...
+ if(_.isEmpty(itemPriority)) {
+ return col[0];
+ }
+
+ for (var i = 0, len = itemPriority.length; i < len; i++) {
+ if(col.indexOf(itemPriority[i]) > -1) {
+ return itemPriority[i];
+ }
+ }
+
+ // Otherwise return first
+ return col[0];
+}
+
+Operation.prototype.setContentTypes = function (args, opts) {
+ // default type
+ var allDefinedParams = this.parameters;
+ var body;
+ var consumes = args.parameterContentType || itemByPriority(this.consumes, ['application/json', 'application/yaml']);
+ var accepts = opts.responseContentType || itemByPriority(this.produces, ['application/json', 'application/yaml']);
+ var definedFileParams = [];
+ var definedFormParams = [];
+ var headers = {};
+ var i;
+
+ // get params from the operation and set them in definedFileParams, definedFormParams, headers
+ for (i = 0; i < allDefinedParams.length; i++) {
+ var param = allDefinedParams[i];
+
+ if (param.in === 'formData') {
+ if (param.type === 'file') {
+ definedFileParams.push(param);
+ } else {
+ definedFormParams.push(param);
+ }
+ } else if (param.in === 'header' && opts) {
+ var key = param.name;
+ var headerValue = opts[param.name];
+
+ if (typeof opts[param.name] !== 'undefined') {
+ headers[key] = headerValue;
+ }
+ } else if (param.in === 'body' && typeof args[param.name] !== 'undefined') {
+ body = args[param.name];
+ }
+ }
+
+ // if there's a body, need to set the consumes header via requestContentType
+ if (this.method === 'post' || this.method === 'put' || this.method === 'patch' ||
+ ((this.method === 'delete' || this.method === 'get') && body) ) {
+ if (opts.requestContentType) {
+ consumes = opts.requestContentType;
+ }
+ // if any form params, content type must be set
+ if (definedFormParams.length > 0) {
+ if (opts.requestContentType) { // override if set
+ consumes = opts.requestContentType;
+ } else if (definedFileParams.length > 0) { // if a file, must be multipart/form-data
+ consumes = 'multipart/form-data';
+ } else { // default to x-www-from-urlencoded
+ consumes = 'application/x-www-form-urlencoded';
+ }
+ }
+ }
+ else {
+ consumes = null;
+ }
+
+ if (consumes && this.consumes) {
+ if (this.consumes.indexOf(consumes) === -1) {
+ helpers.log('server doesn\'t consume ' + consumes + ', try ' + JSON.stringify(this.consumes));
+ }
+ }
+
+ if (!this.matchesAccept(accepts)) {
+ helpers.log('server can\'t produce ' + accepts);
+ }
+
+ if ((consumes && body !== '') || (consumes === 'application/x-www-form-urlencoded')) {
+ headers['Content-Type'] = consumes;
+ }
+
+ if (accepts) {
+ headers.Accept = accepts;
+ }
+
+ return headers;
+};
+
+/**
+ * Returns true if the request accepts header matches anything in this.produces.
+ * If this.produces contains * / *, ignore the accept header.
+ * @param {string=} accepts The client request accept header.
+ * @return {boolean}
+ */
+Operation.prototype.matchesAccept = function(accepts) {
+ // no accepts or produces, no problem!
+ if (!accepts || !this.produces) {
+ return true;
+ }
+ return this.produces.indexOf(accepts) !== -1 || this.produces.indexOf('*/*') !== -1;
+};
+
+Operation.prototype.asCurl = function (args1, args2) {
+ var opts = {mock: true};
+ if (typeof args2 === 'object') {
+ for (var argKey in args2) {
+ opts[argKey] = args2[argKey];
+ }
+ }
+ var obj = this.execute(args1, opts);
+
+ this.clientAuthorizations.apply(obj, this.operation.security);
+
+ var results = [];
+
+ results.push('-X ' + this.method.toUpperCase());
+
+ if (typeof obj.headers !== 'undefined') {
+ var key;
+
+ for (key in obj.headers) {
+ var value = obj.headers[key];
+ if(typeof value === 'string'){
+ value = value.replace(/\'/g, '\\u0027');
+ }
+ results.push('--header \'' + key + ': ' + value + '\'');
+ }
+ }
+
+ if (obj.body) {
+ var body;
+
+ if (_.isObject(obj.body)) {
+ body = JSON.stringify(obj.body);
+ } else {
+ body = obj.body;
+ }
+
+ results.push('-d \'' + body.replace(/\'/g, '\\u0027') + '\'');
+ }
+
+ return 'curl ' + (results.join(' ')) + ' \'' + obj.url + '\'';
+};
+
+Operation.prototype.encodePathCollection = function (type, name, value) {
+ var encoded = '';
+ var i;
+ var separator = '';
+
+ if (type === 'ssv') {
+ separator = '%20';
+ } else if (type === 'tsv') {
+ separator = '\\t';
+ } else if (type === 'pipes') {
+ separator = '|';
+ } else {
+ separator = ',';
+ }
+
+ for (i = 0; i < value.length; i++) {
+ if (i === 0) {
+ encoded = this.encodeQueryParam(value[i]);
+ } else {
+ encoded += separator + this.encodeQueryParam(value[i]);
+ }
+ }
+
+ return encoded;
+};
+
+Operation.prototype.encodeQueryCollection = function (type, name, value) {
+ var encoded = '';
+ var i;
+
+ if (type === 'default' || type === 'multi') {
+ for (i = 0; i < value.length; i++) {
+ if (i > 0) {encoded += '&';}
+
+ encoded += this.encodeQueryParam(name) + '=' + this.encodeQueryParam(value[i]);
+ }
+ } else {
+ var separator = '';
+
+ if (type === 'csv') {
+ separator = ',';
+ } else if (type === 'ssv') {
+ separator = '%20';
+ } else if (type === 'tsv') {
+ separator = '\\t';
+ } else if (type === 'pipes') {
+ separator = '|';
+ } else if (type === 'brackets') {
+ for (i = 0; i < value.length; i++) {
+ if (i !== 0) {
+ encoded += '&';
+ }
+
+ encoded += this.encodeQueryParam(name) + '[]=' + this.encodeQueryParam(value[i]);
+ }
+ }
+
+ if (separator !== '') {
+ for (i = 0; i < value.length; i++) {
+ if (i === 0) {
+ encoded = this.encodeQueryParam(name) + '=' + this.encodeQueryParam(value[i]);
+ } else {
+ encoded += separator + this.encodeQueryParam(value[i]);
+ }
+ }
+ }
+ }
+
+ return encoded;
+};
+
+Operation.prototype.encodeQueryParam = function (arg) {
+ return encodeURIComponent(arg);
+};
+
+/**
+ * TODO revisit, might not want to leave '/'
+ **/
+Operation.prototype.encodePathParam = function (pathParam) {
+ return encodeURIComponent(pathParam);
+};
+
+},{"../helpers":4,"../http":5,"./model":9,"lodash-compat/lang/cloneDeep":142,"lodash-compat/lang/isEmpty":145,"lodash-compat/lang/isObject":148,"lodash-compat/lang/isUndefined":152,"q":161}],11:[function(require,module,exports){
+'use strict';
+
+var OperationGroup = module.exports = function (tag, description, externalDocs, operation) {
+ this.description = description;
+ this.externalDocs = externalDocs;
+ this.name = tag;
+ this.operation = operation;
+ this.operationsArray = [];
+ this.path = tag;
+ this.tag = tag;
+};
+
+OperationGroup.prototype.sort = function () {
+
+};
+
+
+},{}],12:[function(require,module,exports){
+
+},{}],13:[function(require,module,exports){
+// shim for using process in browser
+
+var process = module.exports = {};
+var queue = [];
+var draining = false;
+
+function drainQueue() {
+ if (draining) {
+ return;
+ }
+ draining = true;
+ var currentQueue;
+ var len = queue.length;
+ while(len) {
+ currentQueue = queue;
+ queue = [];
+ var i = -1;
+ while (++i < len) {
+ currentQueue[i]();
+ }
+ len = queue.length;
+ }
+ draining = false;
+}
+process.nextTick = function (fun) {
+ queue.push(fun);
+ if (!draining) {
+ setTimeout(drainQueue, 0);
+ }
+};
+
+process.title = 'browser';
+process.browser = true;
+process.env = {};
+process.argv = [];
+process.version = ''; // empty string to avoid regexp issues
+process.versions = {};
+
+function noop() {}
+
+process.on = noop;
+process.addListener = noop;
+process.once = noop;
+process.off = noop;
+process.removeListener = noop;
+process.removeAllListeners = noop;
+process.emit = noop;
+
+process.binding = function (name) {
+ throw new Error('process.binding is not supported');
+};
+
+// TODO(shtylman)
+process.cwd = function () { return '/' };
+process.chdir = function (dir) {
+ throw new Error('process.chdir is not supported');
+};
+process.umask = function() { return 0; };
+
+},{}],14:[function(require,module,exports){
+(function (Buffer){
+(function () {
+ "use strict";
+
+ function btoa(str) {
+ var buffer
+ ;
+
+ if (str instanceof Buffer) {
+ buffer = str;
+ } else {
+ buffer = new Buffer(str.toString(), 'binary');
+ }
+
+ return buffer.toString('base64');
+ }
+
+ module.exports = btoa;
+}());
+
+}).call(this,require("buffer").Buffer)
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9idG9hL2luZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsImZpbGUiOiJnZW5lcmF0ZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlc0NvbnRlbnQiOlsiKGZ1bmN0aW9uICgpIHtcbiAgXCJ1c2Ugc3RyaWN0XCI7XG5cbiAgZnVuY3Rpb24gYnRvYShzdHIpIHtcbiAgICB2YXIgYnVmZmVyXG4gICAgICA7XG5cbiAgICBpZiAoc3RyIGluc3RhbmNlb2YgQnVmZmVyKSB7XG4gICAgICBidWZmZXIgPSBzdHI7XG4gICAgfSBlbHNlIHtcbiAgICAgIGJ1ZmZlciA9IG5ldyBCdWZmZXIoc3RyLnRvU3RyaW5nKCksICdiaW5hcnknKTtcbiAgICB9XG5cbiAgICByZXR1cm4gYnVmZmVyLnRvU3RyaW5nKCdiYXNlNjQnKTtcbiAgfVxuXG4gIG1vZHVsZS5leHBvcnRzID0gYnRvYTtcbn0oKSk7XG4iXX0=
+},{"buffer":15}],15:[function(require,module,exports){
+/*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
+ * @license MIT
+ */
+
+var base64 = require('base64-js')
+var ieee754 = require('ieee754')
+var isArray = require('is-array')
+
+exports.Buffer = Buffer
+exports.SlowBuffer = SlowBuffer
+exports.INSPECT_MAX_BYTES = 50
+Buffer.poolSize = 8192 // not used by this implementation
+
+var rootParent = {}
+
+/**
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
+ * === true Use Uint8Array implementation (fastest)
+ * === false Use Object implementation (most compatible, even IE6)
+ *
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
+ * Opera 11.6+, iOS 4.2+.
+ *
+ * Due to various browser bugs, sometimes the Object implementation will be used even
+ * when the browser supports typed arrays.
+ *
+ * Note:
+ *
+ * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
+ * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
+ *
+ * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property
+ * on objects.
+ *
+ * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
+ *
+ * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
+ * incorrect length in some situations.
+
+ * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
+ * get the Object implementation, which is slower but behaves correctly.
+ */
+Buffer.TYPED_ARRAY_SUPPORT = (function () {
+ function Bar () {}
+ try {
+ var arr = new Uint8Array(1)
+ arr.foo = function () { return 42 }
+ arr.constructor = Bar
+ return arr.foo() === 42 && // typed array instances can be augmented
+ arr.constructor === Bar && // constructor can be set
+ typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
+ arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
+ } catch (e) {
+ return false
+ }
+})()
+
+function kMaxLength () {
+ return Buffer.TYPED_ARRAY_SUPPORT
+ ? 0x7fffffff
+ : 0x3fffffff
+}
+
+/**
+ * Class: Buffer
+ * =============
+ *
+ * The Buffer constructor returns instances of `Uint8Array` that are augmented
+ * with function properties for all the node `Buffer` API functions. We use
+ * `Uint8Array` so that square bracket notation works as expected -- it returns
+ * a single octet.
+ *
+ * By augmenting the instances, we can avoid modifying the `Uint8Array`
+ * prototype.
+ */
+function Buffer (arg) {
+ if (!(this instanceof Buffer)) {
+ // Avoid going through an ArgumentsAdaptorTrampoline in the common case.
+ if (arguments.length > 1) return new Buffer(arg, arguments[1])
+ return new Buffer(arg)
+ }
+
+ this.length = 0
+ this.parent = undefined
+
+ // Common case.
+ if (typeof arg === 'number') {
+ return fromNumber(this, arg)
+ }
+
+ // Slightly less common case.
+ if (typeof arg === 'string') {
+ return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')
+ }
+
+ // Unusual.
+ return fromObject(this, arg)
+}
+
+function fromNumber (that, length) {
+ that = allocate(that, length < 0 ? 0 : checked(length) | 0)
+ if (!Buffer.TYPED_ARRAY_SUPPORT) {
+ for (var i = 0; i < length; i++) {
+ that[i] = 0
+ }
+ }
+ return that
+}
+
+function fromString (that, string, encoding) {
+ if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8'
+
+ // Assumption: byteLength() return value is always < kMaxLength.
+ var length = byteLength(string, encoding) | 0
+ that = allocate(that, length)
+
+ that.write(string, encoding)
+ return that
+}
+
+function fromObject (that, object) {
+ if (Buffer.isBuffer(object)) return fromBuffer(that, object)
+
+ if (isArray(object)) return fromArray(that, object)
+
+ if (object == null) {
+ throw new TypeError('must start with number, buffer, array or string')
+ }
+
+ if (typeof ArrayBuffer !== 'undefined') {
+ if (object.buffer instanceof ArrayBuffer) {
+ return fromTypedArray(that, object)
+ }
+ if (object instanceof ArrayBuffer) {
+ return fromArrayBuffer(that, object)
+ }
+ }
+
+ if (object.length) return fromArrayLike(that, object)
+
+ return fromJsonObject(that, object)
+}
+
+function fromBuffer (that, buffer) {
+ var length = checked(buffer.length) | 0
+ that = allocate(that, length)
+ buffer.copy(that, 0, 0, length)
+ return that
+}
+
+function fromArray (that, array) {
+ var length = checked(array.length) | 0
+ that = allocate(that, length)
+ for (var i = 0; i < length; i += 1) {
+ that[i] = array[i] & 255
+ }
+ return that
+}
+
+// Duplicate of fromArray() to keep fromArray() monomorphic.
+function fromTypedArray (that, array) {
+ var length = checked(array.length) | 0
+ that = allocate(that, length)
+ // Truncating the elements is probably not what people expect from typed
+ // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior
+ // of the old Buffer constructor.
+ for (var i = 0; i < length; i += 1) {
+ that[i] = array[i] & 255
+ }
+ return that
+}
+
+function fromArrayBuffer (that, array) {
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ // Return an augmented `Uint8Array` instance, for best performance
+ array.byteLength
+ that = Buffer._augment(new Uint8Array(array))
+ } else {
+ // Fallback: Return an object instance of the Buffer class
+ that = fromTypedArray(that, new Uint8Array(array))
+ }
+ return that
+}
+
+function fromArrayLike (that, array) {
+ var length = checked(array.length) | 0
+ that = allocate(that, length)
+ for (var i = 0; i < length; i += 1) {
+ that[i] = array[i] & 255
+ }
+ return that
+}
+
+// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object.
+// Returns a zero-length buffer for inputs that don't conform to the spec.
+function fromJsonObject (that, object) {
+ var array
+ var length = 0
+
+ if (object.type === 'Buffer' && isArray(object.data)) {
+ array = object.data
+ length = checked(array.length) | 0
+ }
+ that = allocate(that, length)
+
+ for (var i = 0; i < length; i += 1) {
+ that[i] = array[i] & 255
+ }
+ return that
+}
+
+function allocate (that, length) {
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ // Return an augmented `Uint8Array` instance, for best performance
+ that = Buffer._augment(new Uint8Array(length))
+ } else {
+ // Fallback: Return an object instance of the Buffer class
+ that.length = length
+ that._isBuffer = true
+ }
+
+ var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1
+ if (fromPool) that.parent = rootParent
+
+ return that
+}
+
+function checked (length) {
+ // Note: cannot use `length < kMaxLength` here because that fails when
+ // length is NaN (which is otherwise coerced to zero.)
+ if (length >= kMaxLength()) {
+ throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
+ 'size: 0x' + kMaxLength().toString(16) + ' bytes')
+ }
+ return length | 0
+}
+
+function SlowBuffer (subject, encoding) {
+ if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding)
+
+ var buf = new Buffer(subject, encoding)
+ delete buf.parent
+ return buf
+}
+
+Buffer.isBuffer = function isBuffer (b) {
+ return !!(b != null && b._isBuffer)
+}
+
+Buffer.compare = function compare (a, b) {
+ if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
+ throw new TypeError('Arguments must be Buffers')
+ }
+
+ if (a === b) return 0
+
+ var x = a.length
+ var y = b.length
+
+ var i = 0
+ var len = Math.min(x, y)
+ while (i < len) {
+ if (a[i] !== b[i]) break
+
+ ++i
+ }
+
+ if (i !== len) {
+ x = a[i]
+ y = b[i]
+ }
+
+ if (x < y) return -1
+ if (y < x) return 1
+ return 0
+}
+
+Buffer.isEncoding = function isEncoding (encoding) {
+ switch (String(encoding).toLowerCase()) {
+ case 'hex':
+ case 'utf8':
+ case 'utf-8':
+ case 'ascii':
+ case 'binary':
+ case 'base64':
+ case 'raw':
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return true
+ default:
+ return false
+ }
+}
+
+Buffer.concat = function concat (list, length) {
+ if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.')
+
+ if (list.length === 0) {
+ return new Buffer(0)
+ }
+
+ var i
+ if (length === undefined) {
+ length = 0
+ for (i = 0; i < list.length; i++) {
+ length += list[i].length
+ }
+ }
+
+ var buf = new Buffer(length)
+ var pos = 0
+ for (i = 0; i < list.length; i++) {
+ var item = list[i]
+ item.copy(buf, pos)
+ pos += item.length
+ }
+ return buf
+}
+
+function byteLength (string, encoding) {
+ if (typeof string !== 'string') string = '' + string
+
+ var len = string.length
+ if (len === 0) return 0
+
+ // Use a for loop to avoid recursion
+ var loweredCase = false
+ for (;;) {
+ switch (encoding) {
+ case 'ascii':
+ case 'binary':
+ // Deprecated
+ case 'raw':
+ case 'raws':
+ return len
+ case 'utf8':
+ case 'utf-8':
+ return utf8ToBytes(string).length
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return len * 2
+ case 'hex':
+ return len >>> 1
+ case 'base64':
+ return base64ToBytes(string).length
+ default:
+ if (loweredCase) return utf8ToBytes(string).length // assume utf8
+ encoding = ('' + encoding).toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+Buffer.byteLength = byteLength
+
+// pre-set for values that may exist in the future
+Buffer.prototype.length = undefined
+Buffer.prototype.parent = undefined
+
+function slowToString (encoding, start, end) {
+ var loweredCase = false
+
+ start = start | 0
+ end = end === undefined || end === Infinity ? this.length : end | 0
+
+ if (!encoding) encoding = 'utf8'
+ if (start < 0) start = 0
+ if (end > this.length) end = this.length
+ if (end <= start) return ''
+
+ while (true) {
+ switch (encoding) {
+ case 'hex':
+ return hexSlice(this, start, end)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Slice(this, start, end)
+
+ case 'ascii':
+ return asciiSlice(this, start, end)
+
+ case 'binary':
+ return binarySlice(this, start, end)
+
+ case 'base64':
+ return base64Slice(this, start, end)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return utf16leSlice(this, start, end)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = (encoding + '').toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+
+Buffer.prototype.toString = function toString () {
+ var length = this.length | 0
+ if (length === 0) return ''
+ if (arguments.length === 0) return utf8Slice(this, 0, length)
+ return slowToString.apply(this, arguments)
+}
+
+Buffer.prototype.equals = function equals (b) {
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
+ if (this === b) return true
+ return Buffer.compare(this, b) === 0
+}
+
+Buffer.prototype.inspect = function inspect () {
+ var str = ''
+ var max = exports.INSPECT_MAX_BYTES
+ if (this.length > 0) {
+ str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
+ if (this.length > max) str += ' ... '
+ }
+ return '<Buffer ' + str + '>'
+}
+
+Buffer.prototype.compare = function compare (b) {
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
+ if (this === b) return 0
+ return Buffer.compare(this, b)
+}
+
+Buffer.prototype.indexOf = function indexOf (val, byteOffset) {
+ if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff
+ else if (byteOffset < -0x80000000) byteOffset = -0x80000000
+ byteOffset >>= 0
+
+ if (this.length === 0) return -1
+ if (byteOffset >= this.length) return -1
+
+ // Negative offsets start from the end of the buffer
+ if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0)
+
+ if (typeof val === 'string') {
+ if (val.length === 0) return -1 // special case: looking for empty string always fails
+ return String.prototype.indexOf.call(this, val, byteOffset)
+ }
+ if (Buffer.isBuffer(val)) {
+ return arrayIndexOf(this, val, byteOffset)
+ }
+ if (typeof val === 'number') {
+ if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') {
+ return Uint8Array.prototype.indexOf.call(this, val, byteOffset)
+ }
+ return arrayIndexOf(this, [ val ], byteOffset)
+ }
+
+ function arrayIndexOf (arr, val, byteOffset) {
+ var foundIndex = -1
+ for (var i = 0; byteOffset + i < arr.length; i++) {
+ if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) {
+ if (foundIndex === -1) foundIndex = i
+ if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex
+ } else {
+ foundIndex = -1
+ }
+ }
+ return -1
+ }
+
+ throw new TypeError('val must be string, number or Buffer')
+}
+
+// `get` is deprecated
+Buffer.prototype.get = function get (offset) {
+ console.log('.get() is deprecated. Access using array indexes instead.')
+ return this.readUInt8(offset)
+}
+
+// `set` is deprecated
+Buffer.prototype.set = function set (v, offset) {
+ console.log('.set() is deprecated. Access using array indexes instead.')
+ return this.writeUInt8(v, offset)
+}
+
+function hexWrite (buf, string, offset, length) {
+ offset = Number(offset) || 0
+ var remaining = buf.length - offset
+ if (!length) {
+ length = remaining
+ } else {
+ length = Number(length)
+ if (length > remaining) {
+ length = remaining
+ }
+ }
+
+ // must be an even number of digits
+ var strLen = string.length
+ if (strLen % 2 !== 0) throw new Error('Invalid hex string')
+
+ if (length > strLen / 2) {
+ length = strLen / 2
+ }
+ for (var i = 0; i < length; i++) {
+ var parsed = parseInt(string.substr(i * 2, 2), 16)
+ if (isNaN(parsed)) throw new Error('Invalid hex string')
+ buf[offset + i] = parsed
+ }
+ return i
+}
+
+function utf8Write (buf, string, offset, length) {
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
+}
+
+function asciiWrite (buf, string, offset, length) {
+ return blitBuffer(asciiToBytes(string), buf, offset, length)
+}
+
+function binaryWrite (buf, string, offset, length) {
+ return asciiWrite(buf, string, offset, length)
+}
+
+function base64Write (buf, string, offset, length) {
+ return blitBuffer(base64ToBytes(string), buf, offset, length)
+}
+
+function ucs2Write (buf, string, offset, length) {
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
+}
+
+Buffer.prototype.write = function write (string, offset, length, encoding) {
+ // Buffer#write(string)
+ if (offset === undefined) {
+ encoding = 'utf8'
+ length = this.length
+ offset = 0
+ // Buffer#write(string, encoding)
+ } else if (length === undefined && typeof offset === 'string') {
+ encoding = offset
+ length = this.length
+ offset = 0
+ // Buffer#write(string, offset[, length][, encoding])
+ } else if (isFinite(offset)) {
+ offset = offset | 0
+ if (isFinite(length)) {
+ length = length | 0
+ if (encoding === undefined) encoding = 'utf8'
+ } else {
+ encoding = length
+ length = undefined
+ }
+ // legacy write(string, encoding, offset, length) - remove in v0.13
+ } else {
+ var swap = encoding
+ encoding = offset
+ offset = length | 0
+ length = swap
+ }
+
+ var remaining = this.length - offset
+ if (length === undefined || length > remaining) length = remaining
+
+ if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
+ throw new RangeError('attempt to write outside buffer bounds')
+ }
+
+ if (!encoding) encoding = 'utf8'
+
+ var loweredCase = false
+ for (;;) {
+ switch (encoding) {
+ case 'hex':
+ return hexWrite(this, string, offset, length)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Write(this, string, offset, length)
+
+ case 'ascii':
+ return asciiWrite(this, string, offset, length)
+
+ case 'binary':
+ return binaryWrite(this, string, offset, length)
+
+ case 'base64':
+ // Warning: maxLength not taken into account in base64Write
+ return base64Write(this, string, offset, length)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return ucs2Write(this, string, offset, length)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = ('' + encoding).toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+
+Buffer.prototype.toJSON = function toJSON () {
+ return {
+ type: 'Buffer',
+ data: Array.prototype.slice.call(this._arr || this, 0)
+ }
+}
+
+function base64Slice (buf, start, end) {
+ if (start === 0 && end === buf.length) {
+ return base64.fromByteArray(buf)
+ } else {
+ return base64.fromByteArray(buf.slice(start, end))
+ }
+}
+
+function utf8Slice (buf, start, end) {
+ end = Math.min(buf.length, end)
+ var res = []
+
+ var i = start
+ while (i < end) {
+ var firstByte = buf[i]
+ var codePoint = null
+ var bytesPerSequence = (firstByte > 0xEF) ? 4
+ : (firstByte > 0xDF) ? 3
+ : (firstByte > 0xBF) ? 2
+ : 1
+
+ if (i + bytesPerSequence <= end) {
+ var secondByte, thirdByte, fourthByte, tempCodePoint
+
+ switch (bytesPerSequence) {
+ case 1:
+ if (firstByte < 0x80) {
+ codePoint = firstByte
+ }
+ break
+ case 2:
+ secondByte = buf[i + 1]
+ if ((secondByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
+ if (tempCodePoint > 0x7F) {
+ codePoint = tempCodePoint
+ }
+ }
+ break
+ case 3:
+ secondByte = buf[i + 1]
+ thirdByte = buf[i + 2]
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
+ if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
+ codePoint = tempCodePoint
+ }
+ }
+ break
+ case 4:
+ secondByte = buf[i + 1]
+ thirdByte = buf[i + 2]
+ fourthByte = buf[i + 3]
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
+ if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
+ codePoint = tempCodePoint
+ }
+ }
+ }
+ }
+
+ if (codePoint === null) {
+ // we did not generate a valid codePoint so insert a
+ // replacement char (U+FFFD) and advance only 1 byte
+ codePoint = 0xFFFD
+ bytesPerSequence = 1
+ } else if (codePoint > 0xFFFF) {
+ // encode to utf16 (surrogate pair dance)
+ codePoint -= 0x10000
+ res.push(codePoint >>> 10 & 0x3FF | 0xD800)
+ codePoint = 0xDC00 | codePoint & 0x3FF
+ }
+
+ res.push(codePoint)
+ i += bytesPerSequence
+ }
+
+ return decodeCodePointsArray(res)
+}
+
+// Based on http://stackoverflow.com/a/22747272/680742, the browser with
+// the lowest limit is Chrome, with 0x10000 args.
+// We go 1 magnitude less, for safety
+var MAX_ARGUMENTS_LENGTH = 0x1000
+
+function decodeCodePointsArray (codePoints) {
+ var len = codePoints.length
+ if (len <= MAX_ARGUMENTS_LENGTH) {
+ return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
+ }
+
+ // Decode in chunks to avoid "call stack size exceeded".
+ var res = ''
+ var i = 0
+ while (i < len) {
+ res += String.fromCharCode.apply(
+ String,
+ codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
+ )
+ }
+ return res
+}
+
+function asciiSlice (buf, start, end) {
+ var ret = ''
+ end = Math.min(buf.length, end)
+
+ for (var i = start; i < end; i++) {
+ ret += String.fromCharCode(buf[i] & 0x7F)
+ }
+ return ret
+}
+
+function binarySlice (buf, start, end) {
+ var ret = ''
+ end = Math.min(buf.length, end)
+
+ for (var i = start; i < end; i++) {
+ ret += String.fromCharCode(buf[i])
+ }
+ return ret
+}
+
+function hexSlice (buf, start, end) {
+ var len = buf.length
+
+ if (!start || start < 0) start = 0
+ if (!end || end < 0 || end > len) end = len
+
+ var out = ''
+ for (var i = start; i < end; i++) {
+ out += toHex(buf[i])
+ }
+ return out
+}
+
+function utf16leSlice (buf, start, end) {
+ var bytes = buf.slice(start, end)
+ var res = ''
+ for (var i = 0; i < bytes.length; i += 2) {
+ res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
+ }
+ return res
+}
+
+Buffer.prototype.slice = function slice (start, end) {
+ var len = this.length
+ start = ~~start
+ end = end === undefined ? len : ~~end
+
+ if (start < 0) {
+ start += len
+ if (start < 0) start = 0
+ } else if (start > len) {
+ start = len
+ }
+
+ if (end < 0) {
+ end += len
+ if (end < 0) end = 0
+ } else if (end > len) {
+ end = len
+ }
+
+ if (end < start) end = start
+
+ var newBuf
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ newBuf = Buffer._augment(this.subarray(start, end))
+ } else {
+ var sliceLen = end - start
+ newBuf = new Buffer(sliceLen, undefined)
+ for (var i = 0; i < sliceLen; i++) {
+ newBuf[i] = this[i + start]
+ }
+ }
+
+ if (newBuf.length) newBuf.parent = this.parent || this
+
+ return newBuf
+}
+
+/*
+ * Need to make sure that buffer isn't trying to write out of bounds.
+ */
+function checkOffset (offset, ext, length) {
+ if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
+ if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
+}
+
+Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var val = this[offset]
+ var mul = 1
+ var i = 0
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul
+ }
+
+ return val
+}
+
+Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) {
+ checkOffset(offset, byteLength, this.length)
+ }
+
+ var val = this[offset + --byteLength]
+ var mul = 1
+ while (byteLength > 0 && (mul *= 0x100)) {
+ val += this[offset + --byteLength] * mul
+ }
+
+ return val
+}
+
+Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 1, this.length)
+ return this[offset]
+}
+
+Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ return this[offset] | (this[offset + 1] << 8)
+}
+
+Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ return (this[offset] << 8) | this[offset + 1]
+}
+
+Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return ((this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16)) +
+ (this[offset + 3] * 0x1000000)
+}
+
+Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset] * 0x1000000) +
+ ((this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ this[offset + 3])
+}
+
+Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var val = this[offset]
+ var mul = 1
+ var i = 0
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul
+ }
+ mul *= 0x80
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+ return val
+}
+
+Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var i = byteLength
+ var mul = 1
+ var val = this[offset + --i]
+ while (i > 0 && (mul *= 0x100)) {
+ val += this[offset + --i] * mul
+ }
+ mul *= 0x80
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+ return val
+}
+
+Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 1, this.length)
+ if (!(this[offset] & 0x80)) return (this[offset])
+ return ((0xff - this[offset] + 1) * -1)
+}
+
+Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ var val = this[offset] | (this[offset + 1] << 8)
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+}
+
+Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ var val = this[offset + 1] | (this[offset] << 8)
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+}
+
+Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16) |
+ (this[offset + 3] << 24)
+}
+
+Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset] << 24) |
+ (this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ (this[offset + 3])
+}
+
+Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+ return ieee754.read(this, offset, true, 23, 4)
+}
+
+Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+ return ieee754.read(this, offset, false, 23, 4)
+}
+
+Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 8, this.length)
+ return ieee754.read(this, offset, true, 52, 8)
+}
+
+Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 8, this.length)
+ return ieee754.read(this, offset, false, 52, 8)
+}
+
+function checkInt (buf, value, offset, ext, max, min) {
+ if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance')
+ if (value > max || value < min) throw new RangeError('value is out of bounds')
+ if (offset + ext > buf.length) throw new RangeError('index out of range')
+}
+
+Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
+
+ var mul = 1
+ var i = 0
+ this[offset] = value & 0xFF
+ while (++i < byteLength && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
+
+ var i = byteLength - 1
+ var mul = 1
+ this[offset + i] = value & 0xFF
+ while (--i >= 0 && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
+ this[offset] = value
+ return offset + 1
+}
+
+function objectWriteUInt16 (buf, value, offset, littleEndian) {
+ if (value < 0) value = 0xffff + value + 1
+ for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) {
+ buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
+ (littleEndian ? i : 1 - i) * 8
+ }
+}
+
+Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value
+ this[offset + 1] = (value >>> 8)
+ } else {
+ objectWriteUInt16(this, value, offset, true)
+ }
+ return offset + 2
+}
+
+Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 8)
+ this[offset + 1] = value
+ } else {
+ objectWriteUInt16(this, value, offset, false)
+ }
+ return offset + 2
+}
+
+function objectWriteUInt32 (buf, value, offset, littleEndian) {
+ if (value < 0) value = 0xffffffff + value + 1
+ for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) {
+ buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
+ }
+}
+
+Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset + 3] = (value >>> 24)
+ this[offset + 2] = (value >>> 16)
+ this[offset + 1] = (value >>> 8)
+ this[offset] = value
+ } else {
+ objectWriteUInt32(this, value, offset, true)
+ }
+ return offset + 4
+}
+
+Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 24)
+ this[offset + 1] = (value >>> 16)
+ this[offset + 2] = (value >>> 8)
+ this[offset + 3] = value
+ } else {
+ objectWriteUInt32(this, value, offset, false)
+ }
+ return offset + 4
+}
+
+Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) {
+ var limit = Math.pow(2, 8 * byteLength - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
+ }
+
+ var i = 0
+ var mul = 1
+ var sub = value < 0 ? 1 : 0
+ this[offset] = value & 0xFF
+ while (++i < byteLength && (mul *= 0x100)) {
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) {
+ var limit = Math.pow(2, 8 * byteLength - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
+ }
+
+ var i = byteLength - 1
+ var mul = 1
+ var sub = value < 0 ? 1 : 0
+ this[offset + i] = value & 0xFF
+ while (--i >= 0 && (mul *= 0x100)) {
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
+ if (value < 0) value = 0xff + value + 1
+ this[offset] = value
+ return offset + 1
+}
+
+Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value
+ this[offset + 1] = (value >>> 8)
+ } else {
+ objectWriteUInt16(this, value, offset, true)
+ }
+ return offset + 2
+}
+
+Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 8)
+ this[offset + 1] = value
+ } else {
+ objectWriteUInt16(this, value, offset, false)
+ }
+ return offset + 2
+}
+
+Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value
+ this[offset + 1] = (value >>> 8)
+ this[offset + 2] = (value >>> 16)
+ this[offset + 3] = (value >>> 24)
+ } else {
+ objectWriteUInt32(this, value, offset, true)
+ }
+ return offset + 4
+}
+
+Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+ if (value < 0) value = 0xffffffff + value + 1
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 24)
+ this[offset + 1] = (value >>> 16)
+ this[offset + 2] = (value >>> 8)
+ this[offset + 3] = value
+ } else {
+ objectWriteUInt32(this, value, offset, false)
+ }
+ return offset + 4
+}
+
+function checkIEEE754 (buf, value, offset, ext, max, min) {
+ if (value > max || value < min) throw new RangeError('value is out of bounds')
+ if (offset + ext > buf.length) throw new RangeError('index out of range')
+ if (offset < 0) throw new RangeError('index out of range')
+}
+
+function writeFloat (buf, value, offset, littleEndian, noAssert) {
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
+ }
+ ieee754.write(buf, value, offset, littleEndian, 23, 4)
+ return offset + 4
+}
+
+Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, true, noAssert)
+}
+
+Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, false, noAssert)
+}
+
+function writeDouble (buf, value, offset, littleEndian, noAssert) {
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
+ }
+ ieee754.write(buf, value, offset, littleEndian, 52, 8)
+ return offset + 8
+}
+
+Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, true, noAssert)
+}
+
+Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, false, noAssert)
+}
+
+// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
+Buffer.prototype.copy = function copy (target, targetStart, start, end) {
+ if (!start) start = 0
+ if (!end && end !== 0) end = this.length
+ if (targetStart >= target.length) targetStart = target.length
+ if (!targetStart) targetStart = 0
+ if (end > 0 && end < start) end = start
+
+ // Copy 0 bytes; we're done
+ if (end === start) return 0
+ if (target.length === 0 || this.length === 0) return 0
+
+ // Fatal error conditions
+ if (targetStart < 0) {
+ throw new RangeError('targetStart out of bounds')
+ }
+ if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
+ if (end < 0) throw new RangeError('sourceEnd out of bounds')
+
+ // Are we oob?
+ if (end > this.length) end = this.length
+ if (target.length - targetStart < end - start) {
+ end = target.length - targetStart + start
+ }
+
+ var len = end - start
+ var i
+
+ if (this === target && start < targetStart && targetStart < end) {
+ // descending copy from end
+ for (i = len - 1; i >= 0; i--) {
+ target[i + targetStart] = this[i + start]
+ }
+ } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
+ // ascending copy from start
+ for (i = 0; i < len; i++) {
+ target[i + targetStart] = this[i + start]
+ }
+ } else {
+ target._set(this.subarray(start, start + len), targetStart)
+ }
+
+ return len
+}
+
+// fill(value, start=0, end=buffer.length)
+Buffer.prototype.fill = function fill (value, start, end) {
+ if (!value) value = 0
+ if (!start) start = 0
+ if (!end) end = this.length
+
+ if (end < start) throw new RangeError('end < start')
+
+ // Fill 0 bytes; we're done
+ if (end === start) return
+ if (this.length === 0) return
+
+ if (start < 0 || start >= this.length) throw new RangeError('start out of bounds')
+ if (end < 0 || end > this.length) throw new RangeError('end out of bounds')
+
+ var i
+ if (typeof value === 'number') {
+ for (i = start; i < end; i++) {
+ this[i] = value
+ }
+ } else {
+ var bytes = utf8ToBytes(value.toString())
+ var len = bytes.length
+ for (i = start; i < end; i++) {
+ this[i] = bytes[i % len]
+ }
+ }
+
+ return this
+}
+
+/**
+ * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
+ * Added in Node 0.12. Only available in browsers that support ArrayBuffer.
+ */
+Buffer.prototype.toArrayBuffer = function toArrayBuffer () {
+ if (typeof Uint8Array !== 'undefined') {
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ return (new Buffer(this)).buffer
+ } else {
+ var buf = new Uint8Array(this.length)
+ for (var i = 0, len = buf.length; i < len; i += 1) {
+ buf[i] = this[i]
+ }
+ return buf.buffer
+ }
+ } else {
+ throw new TypeError('Buffer.toArrayBuffer not supported in this browser')
+ }
+}
+
+// HELPER FUNCTIONS
+// ================
+
+var BP = Buffer.prototype
+
+/**
+ * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
+ */
+Buffer._augment = function _augment (arr) {
+ arr.constructor = Buffer
+ arr._isBuffer = true
+
+ // save reference to original Uint8Array set method before overwriting
+ arr._set = arr.set
+
+ // deprecated
+ arr.get = BP.get
+ arr.set = BP.set
+
+ arr.write = BP.write
+ arr.toString = BP.toString
+ arr.toLocaleString = BP.toString
+ arr.toJSON = BP.toJSON
+ arr.equals = BP.equals
+ arr.compare = BP.compare
+ arr.indexOf = BP.indexOf
+ arr.copy = BP.copy
+ arr.slice = BP.slice
+ arr.readUIntLE = BP.readUIntLE
+ arr.readUIntBE = BP.readUIntBE
+ arr.readUInt8 = BP.readUInt8
+ arr.readUInt16LE = BP.readUInt16LE
+ arr.readUInt16BE = BP.readUInt16BE
+ arr.readUInt32LE = BP.readUInt32LE
+ arr.readUInt32BE = BP.readUInt32BE
+ arr.readIntLE = BP.readIntLE
+ arr.readIntBE = BP.readIntBE
+ arr.readInt8 = BP.readInt8
+ arr.readInt16LE = BP.readInt16LE
+ arr.readInt16BE = BP.readInt16BE
+ arr.readInt32LE = BP.readInt32LE
+ arr.readInt32BE = BP.readInt32BE
+ arr.readFloatLE = BP.readFloatLE
+ arr.readFloatBE = BP.readFloatBE
+ arr.readDoubleLE = BP.readDoubleLE
+ arr.readDoubleBE = BP.readDoubleBE
+ arr.writeUInt8 = BP.writeUInt8
+ arr.writeUIntLE = BP.writeUIntLE
+ arr.writeUIntBE = BP.writeUIntBE
+ arr.writeUInt16LE = BP.writeUInt16LE
+ arr.writeUInt16BE = BP.writeUInt16BE
+ arr.writeUInt32LE = BP.writeUInt32LE
+ arr.writeUInt32BE = BP.writeUInt32BE
+ arr.writeIntLE = BP.writeIntLE
+ arr.writeIntBE = BP.writeIntBE
+ arr.writeInt8 = BP.writeInt8
+ arr.writeInt16LE = BP.writeInt16LE
+ arr.writeInt16BE = BP.writeInt16BE
+ arr.writeInt32LE = BP.writeInt32LE
+ arr.writeInt32BE = BP.writeInt32BE
+ arr.writeFloatLE = BP.writeFloatLE
+ arr.writeFloatBE = BP.writeFloatBE
+ arr.writeDoubleLE = BP.writeDoubleLE
+ arr.writeDoubleBE = BP.writeDoubleBE
+ arr.fill = BP.fill
+ arr.inspect = BP.inspect
+ arr.toArrayBuffer = BP.toArrayBuffer
+
+ return arr
+}
+
+var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
+
+function base64clean (str) {
+ // Node strips out invalid characters like \n and \t from the string, base64-js does not
+ str = stringtrim(str).replace(INVALID_BASE64_RE, '')
+ // Node converts strings with length < 2 to ''
+ if (str.length < 2) return ''
+ // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
+ while (str.length % 4 !== 0) {
+ str = str + '='
+ }
+ return str
+}
+
+function stringtrim (str) {
+ if (str.trim) return str.trim()
+ return str.replace(/^\s+|\s+$/g, '')
+}
+
+function toHex (n) {
+ if (n < 16) return '0' + n.toString(16)
+ return n.toString(16)
+}
+
+function utf8ToBytes (string, units) {
+ units = units || Infinity
+ var codePoint
+ var length = string.length
+ var leadSurrogate = null
+ var bytes = []
+
+ for (var i = 0; i < length; i++) {
+ codePoint = string.charCodeAt(i)
+
+ // is surrogate component
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
+ // last char was a lead
+ if (!leadSurrogate) {
+ // no lead yet
+ if (codePoint > 0xDBFF) {
+ // unexpected trail
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ continue
+ } else if (i + 1 === length) {
+ // unpaired lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ continue
+ }
+
+ // valid lead
+ leadSurrogate = codePoint
+
+ continue
+ }
+
+ // 2 leads in a row
+ if (codePoint < 0xDC00) {
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ leadSurrogate = codePoint
+ continue
+ }
+
+ // valid surrogate pair
+ codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000
+ } else if (leadSurrogate) {
+ // valid bmp char, but last char was a lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ }
+
+ leadSurrogate = null
+
+ // encode utf8
+ if (codePoint < 0x80) {
+ if ((units -= 1) < 0) break
+ bytes.push(codePoint)
+ } else if (codePoint < 0x800) {
+ if ((units -= 2) < 0) break
+ bytes.push(
+ codePoint >> 0x6 | 0xC0,
+ codePoint & 0x3F | 0x80
+ )
+ } else if (codePoint < 0x10000) {
+ if ((units -= 3) < 0) break
+ bytes.push(
+ codePoint >> 0xC | 0xE0,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ )
+ } else if (codePoint < 0x110000) {
+ if ((units -= 4) < 0) break
+ bytes.push(
+ codePoint >> 0x12 | 0xF0,
+ codePoint >> 0xC & 0x3F | 0x80,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ )
+ } else {
+ throw new Error('Invalid code point')
+ }
+ }
+
+ return bytes
+}
+
+function asciiToBytes (str) {
+ var byteArray = []
+ for (var i = 0; i < str.length; i++) {
+ // Node's code seems to be doing this and not & 0x7F..
+ byteArray.push(str.charCodeAt(i) & 0xFF)
+ }
+ return byteArray
+}
+
+function utf16leToBytes (str, units) {
+ var c, hi, lo
+ var byteArray = []
+ for (var i = 0; i < str.length; i++) {
+ if ((units -= 2) < 0) break
+
+ c = str.charCodeAt(i)
+ hi = c >> 8
+ lo = c % 256
+ byteArray.push(lo)
+ byteArray.push(hi)
+ }
+
+ return byteArray
+}
+
+function base64ToBytes (str) {
+ return base64.toByteArray(base64clean(str))
+}
+
+function blitBuffer (src, dst, offset, length) {
+ for (var i = 0; i < length; i++) {
+ if ((i + offset >= dst.length) || (i >= src.length)) break
+ dst[i + offset] = src[i]
+ }
+ return i
+}
+
+},{"base64-js":16,"ieee754":17,"is-array":18}],16:[function(require,module,exports){
+var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+
+;(function (exports) {
+ 'use strict';
+
+ var Arr = (typeof Uint8Array !== 'undefined')
+ ? Uint8Array
+ : Array
+
+ var PLUS = '+'.charCodeAt(0)
+ var SLASH = '/'.charCodeAt(0)
+ var NUMBER = '0'.charCodeAt(0)
+ var LOWER = 'a'.charCodeAt(0)
+ var UPPER = 'A'.charCodeAt(0)
+ var PLUS_URL_SAFE = '-'.charCodeAt(0)
+ var SLASH_URL_SAFE = '_'.charCodeAt(0)
+
+ function decode (elt) {
+ var code = elt.charCodeAt(0)
+ if (code === PLUS ||
+ code === PLUS_URL_SAFE)
+ return 62 // '+'
+ if (code === SLASH ||
+ code === SLASH_URL_SAFE)
+ return 63 // '/'
+ if (code < NUMBER)
+ return -1 //no match
+ if (code < NUMBER + 10)
+ return code - NUMBER + 26 + 26
+ if (code < UPPER + 26)
+ return code - UPPER
+ if (code < LOWER + 26)
+ return code - LOWER + 26
+ }
+
+ function b64ToByteArray (b64) {
+ var i, j, l, tmp, placeHolders, arr
+
+ if (b64.length % 4 > 0) {
+ throw new Error('Invalid string. Length must be a multiple of 4')
+ }
+
+ // the number of equal signs (place holders)
+ // if there are two placeholders, than the two characters before it
+ // represent one byte
+ // if there is only one, then the three characters before it represent 2 bytes
+ // this is just a cheap hack to not do indexOf twice
+ var len = b64.length
+ placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
+
+ // base64 is 4/3 + up to two characters of the original data
+ arr = new Arr(b64.length * 3 / 4 - placeHolders)
+
+ // if there are placeholders, only get up to the last complete 4 chars
+ l = placeHolders > 0 ? b64.length - 4 : b64.length
+
+ var L = 0
+
+ function push (v) {
+ arr[L++] = v
+ }
+
+ for (i = 0, j = 0; i < l; i += 4, j += 3) {
+ tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
+ push((tmp & 0xFF0000) >> 16)
+ push((tmp & 0xFF00) >> 8)
+ push(tmp & 0xFF)
+ }
+
+ if (placeHolders === 2) {
+ tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
+ push(tmp & 0xFF)
+ } else if (placeHolders === 1) {
+ tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
+ push((tmp >> 8) & 0xFF)
+ push(tmp & 0xFF)
+ }
+
+ return arr
+ }
+
+ function uint8ToBase64 (uint8) {
+ var i,
+ extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
+ output = "",
+ temp, length
+
+ function encode (num) {
+ return lookup.charAt(num)
+ }
+
+ function tripletToBase64 (num) {
+ return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
+ }
+
+ // go through the array every three bytes, we'll deal with trailing stuff later
+ for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
+ temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
+ output += tripletToBase64(temp)
+ }
+
+ // pad the end with zeros, but make sure to not forget the extra bytes
+ switch (extraBytes) {
+ case 1:
+ temp = uint8[uint8.length - 1]
+ output += encode(temp >> 2)
+ output += encode((temp << 4) & 0x3F)
+ output += '=='
+ break
+ case 2:
+ temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
+ output += encode(temp >> 10)
+ output += encode((temp >> 4) & 0x3F)
+ output += encode((temp << 2) & 0x3F)
+ output += '='
+ break
+ }
+
+ return output
+ }
+
+ exports.toByteArray = b64ToByteArray
+ exports.fromByteArray = uint8ToBase64
+}(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
+
+},{}],17:[function(require,module,exports){
+exports.read = function (buffer, offset, isLE, mLen, nBytes) {
+ var e, m
+ var eLen = nBytes * 8 - mLen - 1
+ var eMax = (1 << eLen) - 1
+ var eBias = eMax >> 1
+ var nBits = -7
+ var i = isLE ? (nBytes - 1) : 0
+ var d = isLE ? -1 : 1
+ var s = buffer[offset + i]
+
+ i += d
+
+ e = s & ((1 << (-nBits)) - 1)
+ s >>= (-nBits)
+ nBits += eLen
+ for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
+
+ m = e & ((1 << (-nBits)) - 1)
+ e >>= (-nBits)
+ nBits += mLen
+ for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
+
+ if (e === 0) {
+ e = 1 - eBias
+ } else if (e === eMax) {
+ return m ? NaN : ((s ? -1 : 1) * Infinity)
+ } else {
+ m = m + Math.pow(2, mLen)
+ e = e - eBias
+ }
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
+}
+
+exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
+ var e, m, c
+ var eLen = nBytes * 8 - mLen - 1
+ var eMax = (1 << eLen) - 1
+ var eBias = eMax >> 1
+ var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
+ var i = isLE ? 0 : (nBytes - 1)
+ var d = isLE ? 1 : -1
+ var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
+
+ value = Math.abs(value)
+
+ if (isNaN(value) || value === Infinity) {
+ m = isNaN(value) ? 1 : 0
+ e = eMax
+ } else {
+ e = Math.floor(Math.log(value) / Math.LN2)
+ if (value * (c = Math.pow(2, -e)) < 1) {
+ e--
+ c *= 2
+ }
+ if (e + eBias >= 1) {
+ value += rt / c
+ } else {
+ value += rt * Math.pow(2, 1 - eBias)
+ }
+ if (value * c >= 2) {
+ e++
+ c /= 2
+ }
+
+ if (e + eBias >= eMax) {
+ m = 0
+ e = eMax
+ } else if (e + eBias >= 1) {
+ m = (value * c - 1) * Math.pow(2, mLen)
+ e = e + eBias
+ } else {
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
+ e = 0
+ }
+ }
+
+ for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
+
+ e = (e << mLen) | m
+ eLen += mLen
+ for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
+
+ buffer[offset + i - d] |= s * 128
+}
+
+},{}],18:[function(require,module,exports){
+
+/**
+ * isArray
+ */
+
+var isArray = Array.isArray;
+
+/**
+ * toString
+ */
+
+var str = Object.prototype.toString;
+
+/**
+ * Whether or not the given `val`
+ * is an array.
+ *
+ * example:
+ *
+ * isArray([]);
+ * // > true
+ * isArray(arguments);
+ * // > false
+ * isArray('');
+ * // > false
+ *
+ * @param {mixed} val
+ * @return {bool}
+ */
+
+module.exports = isArray || function (val) {
+ return !! val && '[object Array]' == str.call(val);
+};
+
+},{}],19:[function(require,module,exports){
+/* jshint node: true */
+(function () {
+ "use strict";
+
+ function CookieAccessInfo(domain, path, secure, script) {
+ if (this instanceof CookieAccessInfo) {
+ this.domain = domain || undefined;
+ this.path = path || "/";
+ this.secure = !!secure;
+ this.script = !!script;
+ return this;
+ }
+ return new CookieAccessInfo(domain, path, secure, script);
+ }
+ exports.CookieAccessInfo = CookieAccessInfo;
+
+ function Cookie(cookiestr, request_domain, request_path) {
+ if (cookiestr instanceof Cookie) {
+ return cookiestr;
+ }
+ if (this instanceof Cookie) {
+ this.name = null;
+ this.value = null;
+ this.expiration_date = Infinity;
+ this.path = String(request_path || "/");
+ this.explicit_path = false;
+ this.domain = request_domain || null;
+ this.explicit_domain = false;
+ this.secure = false; //how to define default?
+ this.noscript = false; //httponly
+ if (cookiestr) {
+ this.parse(cookiestr, request_domain, request_path);
+ }
+ return this;
+ }
+ return new Cookie(cookiestr, request_domain, request_path);
+ }
+ exports.Cookie = Cookie;
+
+ Cookie.prototype.toString = function toString() {
+ var str = [this.name + "=" + this.value];
+ if (this.expiration_date !== Infinity) {
+ str.push("expires=" + (new Date(this.expiration_date)).toGMTString());
+ }
+ if (this.domain) {
+ str.push("domain=" + this.domain);
+ }
+ if (this.path) {
+ str.push("path=" + this.path);
+ }
+ if (this.secure) {
+ str.push("secure");
+ }
+ if (this.noscript) {
+ str.push("httponly");
+ }
+ return str.join("; ");
+ };
+
+ Cookie.prototype.toValueString = function toValueString() {
+ return this.name + "=" + this.value;
+ };
+
+ var cookie_str_splitter = /[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;
+ Cookie.prototype.parse = function parse(str, request_domain, request_path) {
+ if (this instanceof Cookie) {
+ var parts = str.split(";").filter(function (value) {
+ return !!value;
+ }),
+ pair = parts[0].match(/([^=]+)=([\s\S]*)/),
+ key = pair[1],
+ value = pair[2],
+ i;
+ this.name = key;
+ this.value = value;
+
+ for (i = 1; i < parts.length; i += 1) {
+ pair = parts[i].match(/([^=]+)(?:=([\s\S]*))?/);
+ key = pair[1].trim().toLowerCase();
+ value = pair[2];
+ switch (key) {
+ case "httponly":
+ this.noscript = true;
+ break;
+ case "expires":
+ this.expiration_date = value ?
+ Number(Date.parse(value)) :
+ Infinity;
+ break;
+ case "path":
+ this.path = value ?
+ value.trim() :
+ "";
+ this.explicit_path = true;
+ break;
+ case "domain":
+ this.domain = value ?
+ value.trim() :
+ "";
+ this.explicit_domain = !!this.domain;
+ break;
+ case "secure":
+ this.secure = true;
+ break;
+ }
+ }
+
+ if (!this.explicit_path) {
+ this.path = request_path || "/";
+ }
+ if (!this.explicit_domain) {
+ this.domain = request_domain;
+ }
+
+ return this;
+ }
+ return new Cookie().parse(str, request_domain, request_path);
+ };
+
+ Cookie.prototype.matches = function matches(access_info) {
+ if (this.noscript && access_info.script ||
+ this.secure && !access_info.secure ||
+ !this.collidesWith(access_info)) {
+ return false;
+ }
+ return true;
+ };
+
+ Cookie.prototype.collidesWith = function collidesWith(access_info) {
+ if ((this.path && !access_info.path) || (this.domain && !access_info.domain)) {
+ return false;
+ }
+ if (this.path && access_info.path.indexOf(this.path) !== 0) {
+ return false;
+ }
+ if (this.explicit_path && access_info.path.indexOf( this.path ) !== 0) {
+ return false;
+ }
+ var access_domain = access_info.domain && access_info.domain.replace(/^[\.]/,'');
+ var cookie_domain = this.domain && this.domain.replace(/^[\.]/,'');
+ if (cookie_domain === access_domain) {
+ return true;
+ }
+ if (cookie_domain) {
+ if (!this.explicit_domain) {
+ return false; // we already checked if the domains were exactly the same
+ }
+ var wildcard = access_domain.indexOf(cookie_domain);
+ if (wildcard === -1 || wildcard !== access_domain.length - cookie_domain.length) {
+ return false;
+ }
+ return true;
+ }
+ return true;
+ };
+
+ function CookieJar() {
+ var cookies, cookies_list, collidable_cookie;
+ if (this instanceof CookieJar) {
+ cookies = Object.create(null); //name: [Cookie]
+
+ this.setCookie = function setCookie(cookie, request_domain, request_path) {
+ var remove, i;
+ cookie = new Cookie(cookie, request_domain, request_path);
+ //Delete the cookie if the set is past the current time
+ remove = cookie.expiration_date <= Date.now();
+ if (cookies[cookie.name] !== undefined) {
+ cookies_list = cookies[cookie.name];
+ for (i = 0; i < cookies_list.length; i += 1) {
+ collidable_cookie = cookies_list[i];
+ if (collidable_cookie.collidesWith(cookie)) {
+ if (remove) {
+ cookies_list.splice(i, 1);
+ if (cookies_list.length === 0) {
+ delete cookies[cookie.name];
+ }
+ return false;
+ }
+ cookies_list[i] = cookie;
+ return cookie;
+ }
+ }
+ if (remove) {
+ return false;
+ }
+ cookies_list.push(cookie);
+ return cookie;
+ }
+ if (remove) {
+ return false;
+ }
+ cookies[cookie.name] = [cookie];
+ return cookies[cookie.name];
+ };
+ //returns a cookie
+ this.getCookie = function getCookie(cookie_name, access_info) {
+ var cookie, i;
+ cookies_list = cookies[cookie_name];
+ if (!cookies_list) {
+ return;
+ }
+ for (i = 0; i < cookies_list.length; i += 1) {
+ cookie = cookies_list[i];
+ if (cookie.expiration_date <= Date.now()) {
+ if (cookies_list.length === 0) {
+ delete cookies[cookie.name];
+ }
+ continue;
+ }
+
+ if (cookie.matches(access_info)) {
+ return cookie;
+ }
+ }
+ };
+ //returns a list of cookies
+ this.getCookies = function getCookies(access_info) {
+ var matches = [], cookie_name, cookie;
+ for (cookie_name in cookies) {
+ cookie = this.getCookie(cookie_name, access_info);
+ if (cookie) {
+ matches.push(cookie);
+ }
+ }
+ matches.toString = function toString() {
+ return matches.join(":");
+ };
+ matches.toValueString = function toValueString() {
+ return matches.map(function (c) {
+ return c.toValueString();
+ }).join(';');
+ };
+ return matches;
+ };
+
+ return this;
+ }
+ return new CookieJar();
+ }
+ exports.CookieJar = CookieJar;
+
+ //returns list of cookies that were set correctly. Cookies that are expired and removed are not returned.
+ CookieJar.prototype.setCookies = function setCookies(cookies, request_domain, request_path) {
+ cookies = Array.isArray(cookies) ?
+ cookies :
+ cookies.split(cookie_str_splitter);
+ var successful = [],
+ i,
+ cookie;
+ cookies = cookies.map(function(item){
+ return new Cookie(item, request_domain, request_path);
+ });
+ for (i = 0; i < cookies.length; i += 1) {
+ cookie = cookies[i];
+ if (this.setCookie(cookie, request_domain, request_path)) {
+ successful.push(cookie);
+ }
+ }
+ return successful;
+ };
+}());
+
+},{}],20:[function(require,module,exports){
+'use strict';
+
+
+var yaml = require('./lib/js-yaml.js');
+
+
+module.exports = yaml;
+
+},{"./lib/js-yaml.js":21}],21:[function(require,module,exports){
+'use strict';
+
+
+var loader = require('./js-yaml/loader');
+var dumper = require('./js-yaml/dumper');
+
+
+function deprecated(name) {
+ return function () {
+ throw new Error('Function ' + name + ' is deprecated and cannot be used.');
+ };
+}
+
+
+module.exports.Type = require('./js-yaml/type');
+module.exports.Schema = require('./js-yaml/schema');
+module.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe');
+module.exports.JSON_SCHEMA = require('./js-yaml/schema/json');
+module.exports.CORE_SCHEMA = require('./js-yaml/schema/core');
+module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
+module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full');
+module.exports.load = loader.load;
+module.exports.loadAll = loader.loadAll;
+module.exports.safeLoad = loader.safeLoad;
+module.exports.safeLoadAll = loader.safeLoadAll;
+module.exports.dump = dumper.dump;
+module.exports.safeDump = dumper.safeDump;
+module.exports.YAMLException = require('./js-yaml/exception');
+
+// Deprecated schema names from JS-YAML 2.0.x
+module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe');
+module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
+module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full');
+
+// Deprecated functions from JS-YAML 1.x.x
+module.exports.scan = deprecated('scan');
+module.exports.parse = deprecated('parse');
+module.exports.compose = deprecated('compose');
+module.exports.addConstructor = deprecated('addConstructor');
+
+},{"./js-yaml/dumper":23,"./js-yaml/exception":24,"./js-yaml/loader":25,"./js-yaml/schema":27,"./js-yaml/schema/core":28,"./js-yaml/schema/default_full":29,"./js-yaml/schema/default_safe":30,"./js-yaml/schema/failsafe":31,"./js-yaml/schema/json":32,"./js-yaml/type":33}],22:[function(require,module,exports){
+'use strict';
+
+
+function isNothing(subject) {
+ return (typeof subject === 'undefined') || (null === subject);
+}
+
+
+function isObject(subject) {
+ return (typeof subject === 'object') && (null !== subject);
+}
+
+
+function toArray(sequence) {
+ if (Array.isArray(sequence)) {
+ return sequence;
+ } else if (isNothing(sequence)) {
+ return [];
+ }
+ return [ sequence ];
+}
+
+
+function extend(target, source) {
+ var index, length, key, sourceKeys;
+
+ if (source) {
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, length = sourceKeys.length; index < length; index += 1) {
+ key = sourceKeys[index];
+ target[key] = source[key];
+ }
+ }
+
+ return target;
+}
+
+
+function repeat(string, count) {
+ var result = '', cycle;
+
+ for (cycle = 0; cycle < count; cycle += 1) {
+ result += string;
+ }
+
+ return result;
+}
+
+
+function isNegativeZero(number) {
+ return (0 === number) && (Number.NEGATIVE_INFINITY === 1 / number);
+}
+
+
+module.exports.isNothing = isNothing;
+module.exports.isObject = isObject;
+module.exports.toArray = toArray;
+module.exports.repeat = repeat;
+module.exports.isNegativeZero = isNegativeZero;
+module.exports.extend = extend;
+
+},{}],23:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable no-use-before-define*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
+var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
+
+var _toString = Object.prototype.toString;
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+var CHAR_TAB = 0x09; /* Tab */
+var CHAR_LINE_FEED = 0x0A; /* LF */
+var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
+var CHAR_SPACE = 0x20; /* Space */
+var CHAR_EXCLAMATION = 0x21; /* ! */
+var CHAR_DOUBLE_QUOTE = 0x22; /* " */
+var CHAR_SHARP = 0x23; /* # */
+var CHAR_PERCENT = 0x25; /* % */
+var CHAR_AMPERSAND = 0x26; /* & */
+var CHAR_SINGLE_QUOTE = 0x27; /* ' */
+var CHAR_ASTERISK = 0x2A; /* * */
+var CHAR_COMMA = 0x2C; /* , */
+var CHAR_MINUS = 0x2D; /* - */
+var CHAR_COLON = 0x3A; /* : */
+var CHAR_GREATER_THAN = 0x3E; /* > */
+var CHAR_QUESTION = 0x3F; /* ? */
+var CHAR_COMMERCIAL_AT = 0x40; /* @ */
+var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
+var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
+var CHAR_GRAVE_ACCENT = 0x60; /* ` */
+var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
+var CHAR_VERTICAL_LINE = 0x7C; /* | */
+var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
+
+var ESCAPE_SEQUENCES = {};
+
+ESCAPE_SEQUENCES[0x00] = '\\0';
+ESCAPE_SEQUENCES[0x07] = '\\a';
+ESCAPE_SEQUENCES[0x08] = '\\b';
+ESCAPE_SEQUENCES[0x09] = '\\t';
+ESCAPE_SEQUENCES[0x0A] = '\\n';
+ESCAPE_SEQUENCES[0x0B] = '\\v';
+ESCAPE_SEQUENCES[0x0C] = '\\f';
+ESCAPE_SEQUENCES[0x0D] = '\\r';
+ESCAPE_SEQUENCES[0x1B] = '\\e';
+ESCAPE_SEQUENCES[0x22] = '\\"';
+ESCAPE_SEQUENCES[0x5C] = '\\\\';
+ESCAPE_SEQUENCES[0x85] = '\\N';
+ESCAPE_SEQUENCES[0xA0] = '\\_';
+ESCAPE_SEQUENCES[0x2028] = '\\L';
+ESCAPE_SEQUENCES[0x2029] = '\\P';
+
+var DEPRECATED_BOOLEANS_SYNTAX = [
+ 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
+ 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
+];
+
+function compileStyleMap(schema, map) {
+ var result, keys, index, length, tag, style, type;
+
+ if (null === map) {
+ return {};
+ }
+
+ result = {};
+ keys = Object.keys(map);
+
+ for (index = 0, length = keys.length; index < length; index += 1) {
+ tag = keys[index];
+ style = String(map[tag]);
+
+ if ('!!' === tag.slice(0, 2)) {
+ tag = 'tag:yaml.org,2002:' + tag.slice(2);
+ }
+
+ type = schema.compiledTypeMap[tag];
+
+ if (type && _hasOwnProperty.call(type.styleAliases, style)) {
+ style = type.styleAliases[style];
+ }
+
+ result[tag] = style;
+ }
+
+ return result;
+}
+
+function encodeHex(character) {
+ var string, handle, length;
+
+ string = character.toString(16).toUpperCase();
+
+ if (character <= 0xFF) {
+ handle = 'x';
+ length = 2;
+ } else if (character <= 0xFFFF) {
+ handle = 'u';
+ length = 4;
+ } else if (character <= 0xFFFFFFFF) {
+ handle = 'U';
+ length = 8;
+ } else {
+ throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
+ }
+
+ return '\\' + handle + common.repeat('0', length - string.length) + string;
+}
+
+function State(options) {
+ this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
+ this.indent = Math.max(1, (options['indent'] || 2));
+ this.skipInvalid = options['skipInvalid'] || false;
+ this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
+ this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
+ this.sortKeys = options['sortKeys'] || false;
+ this.lineWidth = options['lineWidth'] || 80;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.explicitTypes = this.schema.compiledExplicit;
+
+ this.tag = null;
+ this.result = '';
+
+ this.duplicates = [];
+ this.usedDuplicates = null;
+}
+
+function indentString(string, spaces) {
+ var ind = common.repeat(' ', spaces),
+ position = 0,
+ next = -1,
+ result = '',
+ line,
+ length = string.length;
+
+ while (position < length) {
+ next = string.indexOf('\n', position);
+ if (next === -1) {
+ line = string.slice(position);
+ position = length;
+ } else {
+ line = string.slice(position, next + 1);
+ position = next + 1;
+ }
+ if (line.length && line !== '\n') {
+ result += ind;
+ }
+ result += line;
+ }
+
+ return result;
+}
+
+function generateNextLine(state, level) {
+ return '\n' + common.repeat(' ', state.indent * level);
+}
+
+function testImplicitResolving(state, str) {
+ var index, length, type;
+
+ for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
+ type = state.implicitTypes[index];
+
+ if (type.resolve(str)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function StringBuilder(source) {
+ this.source = source;
+ this.result = '';
+ this.checkpoint = 0;
+}
+
+StringBuilder.prototype.takeUpTo = function (position) {
+ var er;
+
+ if (position < this.checkpoint) {
+ er = new Error('position should be > checkpoint');
+ er.position = position;
+ er.checkpoint = this.checkpoint;
+ throw er;
+ }
+
+ this.result += this.source.slice(this.checkpoint, position);
+ this.checkpoint = position;
+ return this;
+};
+
+StringBuilder.prototype.escapeChar = function () {
+ var character, esc;
+
+ character = this.source.charCodeAt(this.checkpoint);
+ esc = ESCAPE_SEQUENCES[character] || encodeHex(character);
+ this.result += esc;
+ this.checkpoint += 1;
+
+ return this;
+};
+
+StringBuilder.prototype.finish = function () {
+ if (this.source.length > this.checkpoint) {
+ this.takeUpTo(this.source.length);
+ }
+};
+
+function writeScalar(state, object, level, iskey) {
+ var simple, first, spaceWrap, folded, literal, single, double,
+ sawLineFeed, linePosition, longestLine, indent, max, character,
+ position, escapeSeq, hexEsc, previous, lineLength, modifier,
+ trailingLineBreaks, result;
+
+ if (0 === object.length) {
+ state.dump = "''";
+ return;
+ }
+
+ if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(object)) {
+ state.dump = "'" + object + "'";
+ return;
+ }
+
+ simple = true;
+ first = object.length ? object.charCodeAt(0) : 0;
+ spaceWrap = (CHAR_SPACE === first ||
+ CHAR_SPACE === object.charCodeAt(object.length - 1));
+
+ // Simplified check for restricted first characters
+ // http://www.yaml.org/spec/1.2/spec.html#ns-plain-first%28c%29
+ if (CHAR_MINUS === first ||
+ CHAR_QUESTION === first ||
+ CHAR_COMMERCIAL_AT === first ||
+ CHAR_GRAVE_ACCENT === first) {
+ simple = false;
+ }
+
+ // can only use > and | if not wrapped in spaces or is not a key.
+ if (spaceWrap) {
+ simple = false;
+ folded = false;
+ literal = false;
+ } else {
+ folded = !iskey;
+ literal = !iskey;
+ }
+
+ single = true;
+ double = new StringBuilder(object);
+
+ sawLineFeed = false;
+ linePosition = 0;
+ longestLine = 0;
+
+ indent = state.indent * level;
+ max = state.lineWidth;
+ if (max === -1) {
+ // Replace -1 with biggest ingeger number according to
+ // http://ecma262-5.com/ELS5_HTML.htm#Section_8.5
+ max = 9007199254740991;
+ }
+
+ if (indent < 40) {
+ max -= indent;
+ } else {
+ max = 40;
+ }
+
+ for (position = 0; position < object.length; position++) {
+ character = object.charCodeAt(position);
+ if (simple) {
+ // Characters that can never appear in the simple scalar
+ if (!simpleChar(character)) {
+ simple = false;
+ } else {
+ // Still simple. If we make it all the way through like
+ // this, then we can just dump the string as-is.
+ continue;
+ }
+ }
+
+ if (single && character === CHAR_SINGLE_QUOTE) {
+ single = false;
+ }
+
+ escapeSeq = ESCAPE_SEQUENCES[character];
+ hexEsc = needsHexEscape(character);
+
+ if (!escapeSeq && !hexEsc) {
+ continue;
+ }
+
+ if (character !== CHAR_LINE_FEED &&
+ character !== CHAR_DOUBLE_QUOTE &&
+ character !== CHAR_SINGLE_QUOTE) {
+ folded = false;
+ literal = false;
+ } else if (character === CHAR_LINE_FEED) {
+ sawLineFeed = true;
+ single = false;
+ if (position > 0) {
+ previous = object.charCodeAt(position - 1);
+ if (previous === CHAR_SPACE) {
+ literal = false;
+ folded = false;
+ }
+ }
+ if (folded) {
+ lineLength = position - linePosition;
+ linePosition = position;
+ if (lineLength > longestLine) {
+ longestLine = lineLength;
+ }
+ }
+ }
+
+ if (character !== CHAR_DOUBLE_QUOTE) {
+ single = false;
+ }
+
+ double.takeUpTo(position);
+ double.escapeChar();
+ }
+
+ if (simple && testImplicitResolving(state, object)) {
+ simple = false;
+ }
+
+ modifier = '';
+ if (folded || literal) {
+ trailingLineBreaks = 0;
+ if (object.charCodeAt(object.length - 1) === CHAR_LINE_FEED) {
+ trailingLineBreaks += 1;
+ if (object.charCodeAt(object.length - 2) === CHAR_LINE_FEED) {
+ trailingLineBreaks += 1;
+ }
+ }
+
+ if (trailingLineBreaks === 0) {
+ modifier = '-';
+ } else if (trailingLineBreaks === 2) {
+ modifier = '+';
+ }
+ }
+
+ if (literal && longestLine < max) {
+ folded = false;
+ }
+
+ // If it's literally one line, then don't bother with the literal.
+ // We may still want to do a fold, though, if it's a super long line.
+ if (!sawLineFeed) {
+ literal = false;
+ }
+
+ if (simple) {
+ state.dump = object;
+ } else if (single) {
+ state.dump = '\'' + object + '\'';
+ } else if (folded) {
+ result = fold(object, max);
+ state.dump = '>' + modifier + '\n' + indentString(result, indent);
+ } else if (literal) {
+ if (!modifier) {
+ object = object.replace(/\n$/, '');
+ }
+ state.dump = '|' + modifier + '\n' + indentString(object, indent);
+ } else if (double) {
+ double.finish();
+ state.dump = '"' + double.result + '"';
+ } else {
+ throw new Error('Failed to dump scalar value');
+ }
+
+ return;
+}
+
+// The `trailing` var is a regexp match of any trailing `\n` characters.
+//
+// There are three cases we care about:
+//
+// 1. One trailing `\n` on the string. Just use `|` or `>`.
+// This is the assumed default. (trailing = null)
+// 2. No trailing `\n` on the string. Use `|-` or `>-` to "chomp" the end.
+// 3. More than one trailing `\n` on the string. Use `|+` or `>+`.
+//
+// In the case of `>+`, these line breaks are *not* doubled (like the line
+// breaks within the string), so it's important to only end with the exact
+// same number as we started.
+function fold(object, max) {
+ var result = '',
+ position = 0,
+ length = object.length,
+ trailing = /\n+$/.exec(object),
+ newLine;
+
+ if (trailing) {
+ length = trailing.index + 1;
+ }
+
+ while (position < length) {
+ newLine = object.indexOf('\n', position);
+ if (newLine > length || newLine === -1) {
+ if (result) {
+ result += '\n\n';
+ }
+ result += foldLine(object.slice(position, length), max);
+ position = length;
+ } else {
+ if (result) {
+ result += '\n\n';
+ }
+ result += foldLine(object.slice(position, newLine), max);
+ position = newLine + 1;
+ }
+ }
+ if (trailing && trailing[0] !== '\n') {
+ result += trailing[0];
+ }
+
+ return result;
+}
+
+function foldLine(line, max) {
+ if (line === '') {
+ return line;
+ }
+
+ var foldRe = /[^\s] [^\s]/g,
+ result = '',
+ prevMatch = 0,
+ foldStart = 0,
+ match = foldRe.exec(line),
+ index,
+ foldEnd,
+ folded;
+
+ while (match) {
+ index = match.index;
+
+ // when we cross the max len, if the previous match would've
+ // been ok, use that one, and carry on. If there was no previous
+ // match on this fold section, then just have a long line.
+ if (index - foldStart > max) {
+ if (prevMatch !== foldStart) {
+ foldEnd = prevMatch;
+ } else {
+ foldEnd = index;
+ }
+
+ if (result) {
+ result += '\n';
+ }
+ folded = line.slice(foldStart, foldEnd);
+ result += folded;
+ foldStart = foldEnd + 1;
+ }
+ prevMatch = index + 1;
+ match = foldRe.exec(line);
+ }
+
+ if (result) {
+ result += '\n';
+ }
+
+ // if we end up with one last word at the end, then the last bit might
+ // be slightly bigger than we wanted, because we exited out of the loop.
+ if (foldStart !== prevMatch && line.length - foldStart > max) {
+ result += line.slice(foldStart, prevMatch) + '\n' +
+ line.slice(prevMatch + 1);
+ } else {
+ result += line.slice(foldStart);
+ }
+
+ return result;
+}
+
+// Returns true if character can be found in a simple scalar
+function simpleChar(character) {
+ return CHAR_TAB !== character &&
+ CHAR_LINE_FEED !== character &&
+ CHAR_CARRIAGE_RETURN !== character &&
+ CHAR_COMMA !== character &&
+ CHAR_LEFT_SQUARE_BRACKET !== character &&
+ CHAR_RIGHT_SQUARE_BRACKET !== character &&
+ CHAR_LEFT_CURLY_BRACKET !== character &&
+ CHAR_RIGHT_CURLY_BRACKET !== character &&
+ CHAR_SHARP !== character &&
+ CHAR_AMPERSAND !== character &&
+ CHAR_ASTERISK !== character &&
+ CHAR_EXCLAMATION !== character &&
+ CHAR_VERTICAL_LINE !== character &&
+ CHAR_GREATER_THAN !== character &&
+ CHAR_SINGLE_QUOTE !== character &&
+ CHAR_DOUBLE_QUOTE !== character &&
+ CHAR_PERCENT !== character &&
+ CHAR_COLON !== character &&
+ !ESCAPE_SEQUENCES[character] &&
+ !needsHexEscape(character);
+}
+
+// Returns true if the character code needs to be escaped.
+function needsHexEscape(character) {
+ return !((0x00020 <= character && character <= 0x00007E) ||
+ (0x00085 === character) ||
+ (0x000A0 <= character && character <= 0x00D7FF) ||
+ (0x0E000 <= character && character <= 0x00FFFD) ||
+ (0x10000 <= character && character <= 0x10FFFF));
+}
+
+function writeFlowSequence(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ // Write only valid elements.
+ if (writeNode(state, level, object[index], false, false)) {
+ if (0 !== index) {
+ _result += ', ';
+ }
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = '[' + _result + ']';
+}
+
+function writeBlockSequence(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ // Write only valid elements.
+ if (writeNode(state, level + 1, object[index], true, true)) {
+ if (!compact || 0 !== index) {
+ _result += generateNextLine(state, level);
+ }
+ _result += '- ' + state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '[]'; // Empty sequence if no valid values.
+}
+
+function writeFlowMapping(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ pairBuffer;
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ pairBuffer = '';
+
+ if (0 !== index) {
+ pairBuffer += ', ';
+ }
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (!writeNode(state, level, objectKey, false, false)) {
+ continue; // Skip this pair because of invalid key;
+ }
+
+ if (state.dump.length > 1024) {
+ pairBuffer += '? ';
+ }
+
+ pairBuffer += state.dump + ': ';
+
+ if (!writeNode(state, level, objectValue, false, false)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = '{' + _result + '}';
+}
+
+function writeBlockMapping(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ explicitPair,
+ pairBuffer;
+
+ // Allow sorting keys so that the output file is deterministic
+ if (state.sortKeys === true) {
+ // Default sorting
+ objectKeyList.sort();
+ } else if (typeof state.sortKeys === 'function') {
+ // Custom sort function
+ objectKeyList.sort(state.sortKeys);
+ } else if (state.sortKeys) {
+ // Something is wrong
+ throw new YAMLException('sortKeys must be a boolean or a function');
+ }
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ pairBuffer = '';
+
+ if (!compact || 0 !== index) {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (!writeNode(state, level + 1, objectKey, true, true, true)) {
+ continue; // Skip this pair because of invalid key.
+ }
+
+ explicitPair = (null !== state.tag && '?' !== state.tag) ||
+ (state.dump && state.dump.length > 1024);
+
+ if (explicitPair) {
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += '?';
+ } else {
+ pairBuffer += '? ';
+ }
+ }
+
+ pairBuffer += state.dump;
+
+ if (explicitPair) {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += ':';
+ } else {
+ pairBuffer += ': ';
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '{}'; // Empty mapping if no valid pairs.
+}
+
+function detectType(state, object, explicit) {
+ var _result, typeList, index, length, type, style;
+
+ typeList = explicit ? state.explicitTypes : state.implicitTypes;
+
+ for (index = 0, length = typeList.length; index < length; index += 1) {
+ type = typeList[index];
+
+ if ((type.instanceOf || type.predicate) &&
+ (!type.instanceOf || (('object' === typeof object) && (object instanceof type.instanceOf))) &&
+ (!type.predicate || type.predicate(object))) {
+
+ state.tag = explicit ? type.tag : '?';
+
+ if (type.represent) {
+ style = state.styleMap[type.tag] || type.defaultStyle;
+
+ if ('[object Function]' === _toString.call(type.represent)) {
+ _result = type.represent(object, style);
+ } else if (_hasOwnProperty.call(type.represent, style)) {
+ _result = type.represent[style](object, style);
+ } else {
+ throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
+ }
+
+ state.dump = _result;
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// Serializes `object` and writes it to global `result`.
+// Returns true on success, or false on invalid object.
+//
+function writeNode(state, level, object, block, compact, iskey) {
+ state.tag = null;
+ state.dump = object;
+
+ if (!detectType(state, object, false)) {
+ detectType(state, object, true);
+ }
+
+ var type = _toString.call(state.dump);
+
+ if (block) {
+ block = (0 > state.flowLevel || state.flowLevel > level);
+ }
+
+ var objectOrArray = '[object Object]' === type || '[object Array]' === type,
+ duplicateIndex,
+ duplicate;
+
+ if (objectOrArray) {
+ duplicateIndex = state.duplicates.indexOf(object);
+ duplicate = duplicateIndex !== -1;
+ }
+
+ if ((null !== state.tag && '?' !== state.tag) || duplicate || (2 !== state.indent && level > 0)) {
+ compact = false;
+ }
+
+ if (duplicate && state.usedDuplicates[duplicateIndex]) {
+ state.dump = '*ref_' + duplicateIndex;
+ } else {
+ if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
+ state.usedDuplicates[duplicateIndex] = true;
+ }
+ if ('[object Object]' === type) {
+ if (block && (0 !== Object.keys(state.dump).length)) {
+ writeBlockMapping(state, level, state.dump, compact);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + state.dump;
+ }
+ } else {
+ writeFlowMapping(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if ('[object Array]' === type) {
+ if (block && (0 !== state.dump.length)) {
+ writeBlockSequence(state, level, state.dump, compact);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + state.dump;
+ }
+ } else {
+ writeFlowSequence(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if ('[object String]' === type) {
+ if ('?' !== state.tag) {
+ writeScalar(state, state.dump, level, iskey);
+ }
+ } else {
+ if (state.skipInvalid) {
+ return false;
+ }
+ throw new YAMLException('unacceptable kind of an object to dump ' + type);
+ }
+
+ if (null !== state.tag && '?' !== state.tag) {
+ state.dump = '!<' + state.tag + '> ' + state.dump;
+ }
+ }
+
+ return true;
+}
+
+function getDuplicateReferences(object, state) {
+ var objects = [],
+ duplicatesIndexes = [],
+ index,
+ length;
+
+ inspectNode(object, objects, duplicatesIndexes);
+
+ for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
+ state.duplicates.push(objects[duplicatesIndexes[index]]);
+ }
+ state.usedDuplicates = new Array(length);
+}
+
+function inspectNode(object, objects, duplicatesIndexes) {
+ var objectKeyList,
+ index,
+ length;
+
+ if (null !== object && 'object' === typeof object) {
+ index = objects.indexOf(object);
+ if (-1 !== index) {
+ if (-1 === duplicatesIndexes.indexOf(index)) {
+ duplicatesIndexes.push(index);
+ }
+ } else {
+ objects.push(object);
+
+ if (Array.isArray(object)) {
+ for (index = 0, length = object.length; index < length; index += 1) {
+ inspectNode(object[index], objects, duplicatesIndexes);
+ }
+ } else {
+ objectKeyList = Object.keys(object);
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
+ }
+ }
+ }
+ }
+}
+
+function dump(input, options) {
+ options = options || {};
+
+ var state = new State(options);
+
+ getDuplicateReferences(input, state);
+
+ if (writeNode(state, 0, input, true, true)) {
+ return state.dump + '\n';
+ }
+ return '';
+}
+
+function safeDump(input, options) {
+ return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+module.exports.dump = dump;
+module.exports.safeDump = safeDump;
+
+},{"./common":22,"./exception":24,"./schema/default_full":29,"./schema/default_safe":30}],24:[function(require,module,exports){
+// YAML error class. http://stackoverflow.com/questions/8458984
+//
+'use strict';
+
+
+var inherits = require('inherit');
+
+
+function YAMLException(reason, mark) {
+ // Super constructor
+ Error.call(this);
+
+ // Include stack trace in error object
+ if (Error.captureStackTrace) {
+ // Chrome and NodeJS
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ // FF, IE 10+ and Safari 6+. Fallback for others
+ this.stack = (new Error()).stack || '';
+ }
+
+ this.name = 'YAMLException';
+ this.reason = reason;
+ this.mark = mark;
+ this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');
+}
+
+
+// Inherit from Error
+inherits(YAMLException, Error);
+
+
+YAMLException.prototype.toString = function toString(compact) {
+ var result = this.name + ': ';
+
+ result += this.reason || '(unknown reason)';
+
+ if (!compact && this.mark) {
+ result += ' ' + this.mark.toString();
+ }
+
+ return result;
+};
+
+
+module.exports = YAMLException;
+
+},{"inherit":51}],25:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable max-len,no-use-before-define*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var Mark = require('./mark');
+var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
+var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
+
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+
+var CONTEXT_FLOW_IN = 1;
+var CONTEXT_FLOW_OUT = 2;
+var CONTEXT_BLOCK_IN = 3;
+var CONTEXT_BLOCK_OUT = 4;
+
+
+var CHOMPING_CLIP = 1;
+var CHOMPING_STRIP = 2;
+var CHOMPING_KEEP = 3;
+
+
+var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
+var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
+var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
+var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
+var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
+
+
+function is_EOL(c) {
+ return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
+}
+
+function is_WHITE_SPACE(c) {
+ return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
+}
+
+function is_WS_OR_EOL(c) {
+ return (c === 0x09/* Tab */) ||
+ (c === 0x20/* Space */) ||
+ (c === 0x0A/* LF */) ||
+ (c === 0x0D/* CR */);
+}
+
+function is_FLOW_INDICATOR(c) {
+ return 0x2C/* , */ === c ||
+ 0x5B/* [ */ === c ||
+ 0x5D/* ] */ === c ||
+ 0x7B/* { */ === c ||
+ 0x7D/* } */ === c;
+}
+
+function fromHexCode(c) {
+ var lc;
+
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ /*eslint-disable no-bitwise*/
+ lc = c | 0x20;
+
+ if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
+ return lc - 0x61 + 10;
+ }
+
+ return -1;
+}
+
+function escapedHexLen(c) {
+ if (c === 0x78/* x */) { return 2; }
+ if (c === 0x75/* u */) { return 4; }
+ if (c === 0x55/* U */) { return 8; }
+ return 0;
+}
+
+function fromDecimalCode(c) {
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ return -1;
+}
+
+function simpleEscapeSequence(c) {
+ return (c === 0x30/* 0 */) ? '\x00' :
+ (c === 0x61/* a */) ? '\x07' :
+ (c === 0x62/* b */) ? '\x08' :
+ (c === 0x74/* t */) ? '\x09' :
+ (c === 0x09/* Tab */) ? '\x09' :
+ (c === 0x6E/* n */) ? '\x0A' :
+ (c === 0x76/* v */) ? '\x0B' :
+ (c === 0x66/* f */) ? '\x0C' :
+ (c === 0x72/* r */) ? '\x0D' :
+ (c === 0x65/* e */) ? '\x1B' :
+ (c === 0x20/* Space */) ? ' ' :
+ (c === 0x22/* " */) ? '\x22' :
+ (c === 0x2F/* / */) ? '/' :
+ (c === 0x5C/* \ */) ? '\x5C' :
+ (c === 0x4E/* N */) ? '\x85' :
+ (c === 0x5F/* _ */) ? '\xA0' :
+ (c === 0x4C/* L */) ? '\u2028' :
+ (c === 0x50/* P */) ? '\u2029' : '';
+}
+
+function charFromCodepoint(c) {
+ if (c <= 0xFFFF) {
+ return String.fromCharCode(c);
+ }
+ // Encode UTF-16 surrogate pair
+ // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
+ return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800,
+ ((c - 0x010000) & 0x03FF) + 0xDC00);
+}
+
+var simpleEscapeCheck = new Array(256); // integer, for fast access
+var simpleEscapeMap = new Array(256);
+for (var i = 0; i < 256; i++) {
+ simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
+ simpleEscapeMap[i] = simpleEscapeSequence(i);
+}
+
+
+function State(input, options) {
+ this.input = input;
+
+ this.filename = options['filename'] || null;
+ this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
+ this.onWarning = options['onWarning'] || null;
+ this.legacy = options['legacy'] || false;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.typeMap = this.schema.compiledTypeMap;
+
+ this.length = input.length;
+ this.position = 0;
+ this.line = 0;
+ this.lineStart = 0;
+ this.lineIndent = 0;
+
+ this.documents = [];
+
+ /*
+ this.version;
+ this.checkLineBreaks;
+ this.tagMap;
+ this.anchorMap;
+ this.tag;
+ this.anchor;
+ this.kind;
+ this.result;*/
+
+}
+
+
+function generateError(state, message) {
+ return new YAMLException(
+ message,
+ new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
+}
+
+function throwError(state, message) {
+ throw generateError(state, message);
+}
+
+function throwWarning(state, message) {
+ if (state.onWarning) {
+ state.onWarning.call(null, generateError(state, message));
+ }
+}
+
+
+var directiveHandlers = {
+
+ YAML: function handleYamlDirective(state, name, args) {
+
+ var match, major, minor;
+
+ if (null !== state.version) {
+ throwError(state, 'duplication of %YAML directive');
+ }
+
+ if (1 !== args.length) {
+ throwError(state, 'YAML directive accepts exactly one argument');
+ }
+
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
+
+ if (null === match) {
+ throwError(state, 'ill-formed argument of the YAML directive');
+ }
+
+ major = parseInt(match[1], 10);
+ minor = parseInt(match[2], 10);
+
+ if (1 !== major) {
+ throwError(state, 'unacceptable YAML version of the document');
+ }
+
+ state.version = args[0];
+ state.checkLineBreaks = (minor < 2);
+
+ if (1 !== minor && 2 !== minor) {
+ throwWarning(state, 'unsupported YAML version of the document');
+ }
+ },
+
+ TAG: function handleTagDirective(state, name, args) {
+
+ var handle, prefix;
+
+ if (2 !== args.length) {
+ throwError(state, 'TAG directive accepts exactly two arguments');
+ }
+
+ handle = args[0];
+ prefix = args[1];
+
+ if (!PATTERN_TAG_HANDLE.test(handle)) {
+ throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
+ }
+
+ if (_hasOwnProperty.call(state.tagMap, handle)) {
+ throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
+ }
+
+ if (!PATTERN_TAG_URI.test(prefix)) {
+ throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
+ }
+
+ state.tagMap[handle] = prefix;
+ }
+};
+
+
+function captureSegment(state, start, end, checkJson) {
+ var _position, _length, _character, _result;
+
+ if (start < end) {
+ _result = state.input.slice(start, end);
+
+ if (checkJson) {
+ for (_position = 0, _length = _result.length;
+ _position < _length;
+ _position += 1) {
+ _character = _result.charCodeAt(_position);
+ if (!(0x09 === _character ||
+ 0x20 <= _character && _character <= 0x10FFFF)) {
+ throwError(state, 'expected valid JSON character');
+ }
+ }
+ } else if (PATTERN_NON_PRINTABLE.test(_result)) {
+ throwError(state, 'the stream contains non-printable characters');
+ }
+
+ state.result += _result;
+ }
+}
+
+function mergeMappings(state, destination, source) {
+ var sourceKeys, key, index, quantity;
+
+ if (!common.isObject(source)) {
+ throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
+ }
+
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
+ key = sourceKeys[index];
+
+ if (!_hasOwnProperty.call(destination, key)) {
+ destination[key] = source[key];
+ }
+ }
+}
+
+function storeMappingPair(state, _result, keyTag, keyNode, valueNode) {
+ var index, quantity;
+
+ keyNode = String(keyNode);
+
+ if (null === _result) {
+ _result = {};
+ }
+
+ if ('tag:yaml.org,2002:merge' === keyTag) {
+ if (Array.isArray(valueNode)) {
+ for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
+ mergeMappings(state, _result, valueNode[index]);
+ }
+ } else {
+ mergeMappings(state, _result, valueNode);
+ }
+ } else {
+ _result[keyNode] = valueNode;
+ }
+
+ return _result;
+}
+
+function readLineBreak(state) {
+ var ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x0A/* LF */ === ch) {
+ state.position++;
+ } else if (0x0D/* CR */ === ch) {
+ state.position++;
+ if (0x0A/* LF */ === state.input.charCodeAt(state.position)) {
+ state.position++;
+ }
+ } else {
+ throwError(state, 'a line break is expected');
+ }
+
+ state.line += 1;
+ state.lineStart = state.position;
+}
+
+function skipSeparationSpace(state, allowComments, checkIndent) {
+ var lineBreaks = 0,
+ ch = state.input.charCodeAt(state.position);
+
+ while (0 !== ch) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (allowComments && 0x23/* # */ === ch) {
+ do {
+ ch = state.input.charCodeAt(++state.position);
+ } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && 0 !== ch);
+ }
+
+ if (is_EOL(ch)) {
+ readLineBreak(state);
+
+ ch = state.input.charCodeAt(state.position);
+ lineBreaks++;
+ state.lineIndent = 0;
+
+ while (0x20/* Space */ === ch) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) {
+ throwWarning(state, 'deficient indentation');
+ }
+
+ return lineBreaks;
+}
+
+function testDocumentSeparator(state) {
+ var _position = state.position,
+ ch;
+
+ ch = state.input.charCodeAt(_position);
+
+ // Condition state.position === state.lineStart is tested
+ // in parent on each call, for efficiency. No needs to test here again.
+ if ((0x2D/* - */ === ch || 0x2E/* . */ === ch) &&
+ state.input.charCodeAt(_position + 1) === ch &&
+ state.input.charCodeAt(_position + 2) === ch) {
+
+ _position += 3;
+
+ ch = state.input.charCodeAt(_position);
+
+ if (ch === 0 || is_WS_OR_EOL(ch)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function writeFoldedLines(state, count) {
+ if (1 === count) {
+ state.result += ' ';
+ } else if (count > 1) {
+ state.result += common.repeat('\n', count - 1);
+ }
+}
+
+
+function readPlainScalar(state, nodeIndent, withinFlowCollection) {
+ var preceding,
+ following,
+ captureStart,
+ captureEnd,
+ hasPendingContent,
+ _line,
+ _lineStart,
+ _lineIndent,
+ _kind = state.kind,
+ _result = state.result,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (is_WS_OR_EOL(ch) ||
+ is_FLOW_INDICATOR(ch) ||
+ 0x23/* # */ === ch ||
+ 0x26/* & */ === ch ||
+ 0x2A/* * */ === ch ||
+ 0x21/* ! */ === ch ||
+ 0x7C/* | */ === ch ||
+ 0x3E/* > */ === ch ||
+ 0x27/* ' */ === ch ||
+ 0x22/* " */ === ch ||
+ 0x25/* % */ === ch ||
+ 0x40/* @ */ === ch ||
+ 0x60/* ` */ === ch) {
+ return false;
+ }
+
+ if (0x3F/* ? */ === ch || 0x2D/* - */ === ch) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ return false;
+ }
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+
+ while (0 !== ch) {
+ if (0x3A/* : */ === ch) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ break;
+ }
+
+ } else if (0x23/* # */ === ch) {
+ preceding = state.input.charCodeAt(state.position - 1);
+
+ if (is_WS_OR_EOL(preceding)) {
+ break;
+ }
+
+ } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
+ withinFlowCollection && is_FLOW_INDICATOR(ch)) {
+ break;
+
+ } else if (is_EOL(ch)) {
+ _line = state.line;
+ _lineStart = state.lineStart;
+ _lineIndent = state.lineIndent;
+ skipSeparationSpace(state, false, -1);
+
+ if (state.lineIndent >= nodeIndent) {
+ hasPendingContent = true;
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ } else {
+ state.position = captureEnd;
+ state.line = _line;
+ state.lineStart = _lineStart;
+ state.lineIndent = _lineIndent;
+ break;
+ }
+ }
+
+ if (hasPendingContent) {
+ captureSegment(state, captureStart, captureEnd, false);
+ writeFoldedLines(state, state.line - _line);
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+ }
+
+ if (!is_WHITE_SPACE(ch)) {
+ captureEnd = state.position + 1;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, captureEnd, false);
+
+ if (state.result) {
+ return true;
+ }
+
+ state.kind = _kind;
+ state.result = _result;
+ return false;
+}
+
+function readSingleQuotedScalar(state, nodeIndent) {
+ var ch,
+ captureStart, captureEnd;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x27/* ' */ !== ch) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while (0 !== (ch = state.input.charCodeAt(state.position))) {
+ if (0x27/* ' */ === ch) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (0x27/* ' */ === ch) {
+ captureStart = captureEnd = state.position;
+ state.position++;
+ } else {
+ return true;
+ }
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a single quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a single quoted scalar');
+}
+
+function readDoubleQuotedScalar(state, nodeIndent) {
+ var captureStart,
+ captureEnd,
+ hexLength,
+ hexResult,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x22/* " */ !== ch) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while (0 !== (ch = state.input.charCodeAt(state.position))) {
+ if (0x22/* " */ === ch) {
+ captureSegment(state, captureStart, state.position, true);
+ state.position++;
+ return true;
+
+ } else if (0x5C/* \ */ === ch) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (is_EOL(ch)) {
+ skipSeparationSpace(state, false, nodeIndent);
+
+ // TODO: rework to inline fn with no type cast?
+ } else if (ch < 256 && simpleEscapeCheck[ch]) {
+ state.result += simpleEscapeMap[ch];
+ state.position++;
+
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
+ hexLength = tmp;
+ hexResult = 0;
+
+ for (; hexLength > 0; hexLength--) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if ((tmp = fromHexCode(ch)) >= 0) {
+ hexResult = (hexResult << 4) + tmp;
+
+ } else {
+ throwError(state, 'expected hexadecimal character');
+ }
+ }
+
+ state.result += charFromCodepoint(hexResult);
+
+ state.position++;
+
+ } else {
+ throwError(state, 'unknown escape sequence');
+ }
+
+ captureStart = captureEnd = state.position;
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a double quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a double quoted scalar');
+}
+
+function readFlowCollection(state, nodeIndent) {
+ var readNext = true,
+ _line,
+ _tag = state.tag,
+ _result,
+ _anchor = state.anchor,
+ following,
+ terminator,
+ isPair,
+ isExplicitPair,
+ isMapping,
+ keyNode,
+ keyTag,
+ valueNode,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x5B/* [ */) {
+ terminator = 0x5D;/* ] */
+ isMapping = false;
+ _result = [];
+ } else if (ch === 0x7B/* { */) {
+ terminator = 0x7D;/* } */
+ isMapping = true;
+ _result = {};
+ } else {
+ return false;
+ }
+
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ while (0 !== ch) {
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === terminator) {
+ state.position++;
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = isMapping ? 'mapping' : 'sequence';
+ state.result = _result;
+ return true;
+ } else if (!readNext) {
+ throwError(state, 'missed comma between flow collection entries');
+ }
+
+ keyTag = keyNode = valueNode = null;
+ isPair = isExplicitPair = false;
+
+ if (0x3F/* ? */ === ch) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following)) {
+ isPair = isExplicitPair = true;
+ state.position++;
+ skipSeparationSpace(state, true, nodeIndent);
+ }
+ }
+
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ keyTag = state.tag;
+ keyNode = state.result;
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((isExplicitPair || state.line === _line) && 0x3A/* : */ === ch) {
+ isPair = true;
+ ch = state.input.charCodeAt(++state.position);
+ skipSeparationSpace(state, true, nodeIndent);
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ valueNode = state.result;
+ }
+
+ if (isMapping) {
+ storeMappingPair(state, _result, keyTag, keyNode, valueNode);
+ } else if (isPair) {
+ _result.push(storeMappingPair(state, null, keyTag, keyNode, valueNode));
+ } else {
+ _result.push(keyNode);
+ }
+
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x2C/* , */ === ch) {
+ readNext = true;
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ readNext = false;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a flow collection');
+}
+
+function readBlockScalar(state, nodeIndent) {
+ var captureStart,
+ folding,
+ chomping = CHOMPING_CLIP,
+ detectedIndent = false,
+ textIndent = nodeIndent,
+ emptyLines = 0,
+ atMoreIndented = false,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x7C/* | */) {
+ folding = false;
+ } else if (ch === 0x3E/* > */) {
+ folding = true;
+ } else {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+
+ while (0 !== ch) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (0x2B/* + */ === ch || 0x2D/* - */ === ch) {
+ if (CHOMPING_CLIP === chomping) {
+ chomping = (0x2B/* + */ === ch) ? CHOMPING_KEEP : CHOMPING_STRIP;
+ } else {
+ throwError(state, 'repeat of a chomping mode identifier');
+ }
+
+ } else if ((tmp = fromDecimalCode(ch)) >= 0) {
+ if (tmp === 0) {
+ throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
+ } else if (!detectedIndent) {
+ textIndent = nodeIndent + tmp - 1;
+ detectedIndent = true;
+ } else {
+ throwError(state, 'repeat of an indentation width identifier');
+ }
+
+ } else {
+ break;
+ }
+ }
+
+ if (is_WHITE_SPACE(ch)) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (is_WHITE_SPACE(ch));
+
+ if (0x23/* # */ === ch) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (!is_EOL(ch) && (0 !== ch));
+ }
+ }
+
+ while (0 !== ch) {
+ readLineBreak(state);
+ state.lineIndent = 0;
+
+ ch = state.input.charCodeAt(state.position);
+
+ while ((!detectedIndent || state.lineIndent < textIndent) &&
+ (0x20/* Space */ === ch)) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (!detectedIndent && state.lineIndent > textIndent) {
+ textIndent = state.lineIndent;
+ }
+
+ if (is_EOL(ch)) {
+ emptyLines++;
+ continue;
+ }
+
+ // End of the scalar.
+ if (state.lineIndent < textIndent) {
+
+ // Perform the chomping.
+ if (chomping === CHOMPING_KEEP) {
+ state.result += common.repeat('\n', emptyLines);
+ } else if (chomping === CHOMPING_CLIP) {
+ if (detectedIndent) { // i.e. only if the scalar is not empty.
+ state.result += '\n';
+ }
+ }
+
+ // Break this `while` cycle and go to the funciton's epilogue.
+ break;
+ }
+
+ // Folded style: use fancy rules to handle line breaks.
+ if (folding) {
+
+ // Lines starting with white space characters (more-indented lines) are not folded.
+ if (is_WHITE_SPACE(ch)) {
+ atMoreIndented = true;
+ state.result += common.repeat('\n', emptyLines + 1);
+
+ // End of more-indented block.
+ } else if (atMoreIndented) {
+ atMoreIndented = false;
+ state.result += common.repeat('\n', emptyLines + 1);
+
+ // Just one line break - perceive as the same line.
+ } else if (0 === emptyLines) {
+ if (detectedIndent) { // i.e. only if we have already read some scalar content.
+ state.result += ' ';
+ }
+
+ // Several line breaks - perceive as different lines.
+ } else {
+ state.result += common.repeat('\n', emptyLines);
+ }
+
+ // Literal style: just add exact number of line breaks between content lines.
+ } else if (detectedIndent) {
+ // If current line isn't the first one - count line break from the last content line.
+ state.result += common.repeat('\n', emptyLines + 1);
+ } else {
+ // In case of the first content line - count only empty lines.
+ state.result += common.repeat('\n', emptyLines);
+ }
+
+ detectedIndent = true;
+ emptyLines = 0;
+ captureStart = state.position;
+
+ while (!is_EOL(ch) && (0 !== ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, state.position, false);
+ }
+
+ return true;
+}
+
+function readBlockSequence(state, nodeIndent) {
+ var _line,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = [],
+ following,
+ detected = false,
+ ch;
+
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (0 !== ch) {
+
+ if (0x2D/* - */ !== ch) {
+ break;
+ }
+
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (!is_WS_OR_EOL(following)) {
+ break;
+ }
+
+ detected = true;
+ state.position++;
+
+ if (skipSeparationSpace(state, true, -1)) {
+ if (state.lineIndent <= nodeIndent) {
+ _result.push(null);
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ }
+ }
+
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
+ _result.push(state.result);
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (0 !== ch)) {
+ throwError(state, 'bad indentation of a sequence entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'sequence';
+ state.result = _result;
+ return true;
+ }
+ return false;
+}
+
+function readBlockMapping(state, nodeIndent, flowIndent) {
+ var following,
+ allowCompact,
+ _line,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = {},
+ keyTag = null,
+ keyNode = null,
+ valueNode = null,
+ atExplicitKey = false,
+ detected = false,
+ ch;
+
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (0 !== ch) {
+ following = state.input.charCodeAt(state.position + 1);
+ _line = state.line; // Save the current line.
+
+ //
+ // Explicit notation case. There are two separate blocks:
+ // first for the key (denoted by "?") and second for the value (denoted by ":")
+ //
+ if ((0x3F/* ? */ === ch || 0x3A/* : */ === ch) && is_WS_OR_EOL(following)) {
+
+ if (0x3F/* ? */ === ch) {
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, keyTag, keyNode, null);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = true;
+ allowCompact = true;
+
+ } else if (atExplicitKey) {
+ // i.e. 0x3A/* : */ === character after the explicit key.
+ atExplicitKey = false;
+ allowCompact = true;
+
+ } else {
+ throwError(state, 'incomplete explicit mapping pair; a key node is missed');
+ }
+
+ state.position += 1;
+ ch = following;
+
+ //
+ // Implicit notation case. Flow-style node as the key first, then ":", and the value.
+ //
+ } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
+
+ if (state.line === _line) {
+ ch = state.input.charCodeAt(state.position);
+
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (0x3A/* : */ === ch) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (!is_WS_OR_EOL(ch)) {
+ throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
+ }
+
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, keyTag, keyNode, null);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = false;
+ allowCompact = false;
+ keyTag = state.tag;
+ keyNode = state.result;
+
+ } else if (detected) {
+ throwError(state, 'can not read an implicit mapping pair; a colon is missed');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+
+ } else if (detected) {
+ throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+
+ } else {
+ break; // Reading is done. Go to the epilogue.
+ }
+
+ //
+ // Common reading code for both explicit and implicit notations.
+ //
+ if (state.line === _line || state.lineIndent > nodeIndent) {
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
+ if (atExplicitKey) {
+ keyNode = state.result;
+ } else {
+ valueNode = state.result;
+ }
+ }
+
+ if (!atExplicitKey) {
+ storeMappingPair(state, _result, keyTag, keyNode, valueNode);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ skipSeparationSpace(state, true, -1);
+ ch = state.input.charCodeAt(state.position);
+ }
+
+ if (state.lineIndent > nodeIndent && (0 !== ch)) {
+ throwError(state, 'bad indentation of a mapping entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ //
+ // Epilogue.
+ //
+
+ // Special case: last mapping's node contains only the key in explicit notation.
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, keyTag, keyNode, null);
+ }
+
+ // Expose the resulting mapping.
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'mapping';
+ state.result = _result;
+ }
+
+ return detected;
+}
+
+function readTagProperty(state) {
+ var _position,
+ isVerbatim = false,
+ isNamed = false,
+ tagHandle,
+ tagName,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x21/* ! */ !== ch) {
+ return false;
+ }
+
+ if (null !== state.tag) {
+ throwError(state, 'duplication of a tag property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ if (0x3C/* < */ === ch) {
+ isVerbatim = true;
+ ch = state.input.charCodeAt(++state.position);
+
+ } else if (0x21/* ! */ === ch) {
+ isNamed = true;
+ tagHandle = '!!';
+ ch = state.input.charCodeAt(++state.position);
+
+ } else {
+ tagHandle = '!';
+ }
+
+ _position = state.position;
+
+ if (isVerbatim) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (0 !== ch && 0x3E/* > */ !== ch);
+
+ if (state.position < state.length) {
+ tagName = state.input.slice(_position, state.position);
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ throwError(state, 'unexpected end of the stream within a verbatim tag');
+ }
+ } else {
+ while (0 !== ch && !is_WS_OR_EOL(ch)) {
+
+ if (0x21/* ! */ === ch) {
+ if (!isNamed) {
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
+
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
+ throwError(state, 'named tag handle cannot contain such characters');
+ }
+
+ isNamed = true;
+ _position = state.position + 1;
+ } else {
+ throwError(state, 'tag suffix cannot contain exclamation marks');
+ }
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ tagName = state.input.slice(_position, state.position);
+
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) {
+ throwError(state, 'tag suffix cannot contain flow indicator characters');
+ }
+ }
+
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) {
+ throwError(state, 'tag name cannot contain such characters: ' + tagName);
+ }
+
+ if (isVerbatim) {
+ state.tag = tagName;
+
+ } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
+ state.tag = state.tagMap[tagHandle] + tagName;
+
+ } else if ('!' === tagHandle) {
+ state.tag = '!' + tagName;
+
+ } else if ('!!' === tagHandle) {
+ state.tag = 'tag:yaml.org,2002:' + tagName;
+
+ } else {
+ throwError(state, 'undeclared tag handle "' + tagHandle + '"');
+ }
+
+ return true;
+}
+
+function readAnchorProperty(state) {
+ var _position,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x26/* & */ !== ch) {
+ return false;
+ }
+
+ if (null !== state.anchor) {
+ throwError(state, 'duplication of an anchor property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an anchor node must contain at least one character');
+ }
+
+ state.anchor = state.input.slice(_position, state.position);
+ return true;
+}
+
+function readAlias(state) {
+ var _position, alias,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x2A/* * */ !== ch) {
+ return false;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an alias node must contain at least one character');
+ }
+
+ alias = state.input.slice(_position, state.position);
+
+ if (!state.anchorMap.hasOwnProperty(alias)) {
+ throwError(state, 'unidentified alias "' + alias + '"');
+ }
+
+ state.result = state.anchorMap[alias];
+ skipSeparationSpace(state, true, -1);
+ return true;
+}
+
+function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
+ var allowBlockStyles,
+ allowBlockScalars,
+ allowBlockCollections,
+ indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
+ atNewLine = false,
+ hasContent = false,
+ typeIndex,
+ typeQuantity,
+ type,
+ flowIndent,
+ blockIndent;
+
+ state.tag = null;
+ state.anchor = null;
+ state.kind = null;
+ state.result = null;
+
+ allowBlockStyles = allowBlockScalars = allowBlockCollections =
+ CONTEXT_BLOCK_OUT === nodeContext ||
+ CONTEXT_BLOCK_IN === nodeContext;
+
+ if (allowToSeek) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ }
+ }
+
+ if (1 === indentStatus) {
+ while (readTagProperty(state) || readAnchorProperty(state)) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+ allowBlockCollections = allowBlockStyles;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ } else {
+ allowBlockCollections = false;
+ }
+ }
+ }
+
+ if (allowBlockCollections) {
+ allowBlockCollections = atNewLine || allowCompact;
+ }
+
+ if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) {
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
+ flowIndent = parentIndent;
+ } else {
+ flowIndent = parentIndent + 1;
+ }
+
+ blockIndent = state.position - state.lineStart;
+
+ if (1 === indentStatus) {
+ if (allowBlockCollections &&
+ (readBlockSequence(state, blockIndent) ||
+ readBlockMapping(state, blockIndent, flowIndent)) ||
+ readFlowCollection(state, flowIndent)) {
+ hasContent = true;
+ } else {
+ if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
+ readSingleQuotedScalar(state, flowIndent) ||
+ readDoubleQuotedScalar(state, flowIndent)) {
+ hasContent = true;
+
+ } else if (readAlias(state)) {
+ hasContent = true;
+
+ if (null !== state.tag || null !== state.anchor) {
+ throwError(state, 'alias node should not have any properties');
+ }
+
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
+ hasContent = true;
+
+ if (null === state.tag) {
+ state.tag = '?';
+ }
+ }
+
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ } else if (0 === indentStatus) {
+ // Special case: block sequences are allowed to have same indentation level as the parent.
+ // http://www.yaml.org/spec/1.2/spec.html#id2799784
+ hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
+ }
+ }
+
+ if (null !== state.tag && '!' !== state.tag) {
+ if ('?' === state.tag) {
+ for (typeIndex = 0, typeQuantity = state.implicitTypes.length;
+ typeIndex < typeQuantity;
+ typeIndex += 1) {
+ type = state.implicitTypes[typeIndex];
+
+ // Implicit resolving is not allowed for non-scalar types, and '?'
+ // non-specific tag is only assigned to plain scalars. So, it isn't
+ // needed to check for 'kind' conformity.
+
+ if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ state.result = type.construct(state.result);
+ state.tag = type.tag;
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ break;
+ }
+ }
+ } else if (_hasOwnProperty.call(state.typeMap, state.tag)) {
+ type = state.typeMap[state.tag];
+
+ if (null !== state.result && type.kind !== state.kind) {
+ throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
+ }
+
+ if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
+ } else {
+ state.result = type.construct(state.result);
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ } else {
+ throwError(state, 'unknown tag !<' + state.tag + '>');
+ }
+ }
+
+ return null !== state.tag || null !== state.anchor || hasContent;
+}
+
+function readDocument(state) {
+ var documentStart = state.position,
+ _position,
+ directiveName,
+ directiveArgs,
+ hasDirectives = false,
+ ch;
+
+ state.version = null;
+ state.checkLineBreaks = state.legacy;
+ state.tagMap = {};
+ state.anchorMap = {};
+
+ while (0 !== (ch = state.input.charCodeAt(state.position))) {
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (state.lineIndent > 0 || 0x25/* % */ !== ch) {
+ break;
+ }
+
+ hasDirectives = true;
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (0 !== ch && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveName = state.input.slice(_position, state.position);
+ directiveArgs = [];
+
+ if (directiveName.length < 1) {
+ throwError(state, 'directive name must not be less than one character in length');
+ }
+
+ while (0 !== ch) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (0x23/* # */ === ch) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (0 !== ch && !is_EOL(ch));
+ break;
+ }
+
+ if (is_EOL(ch)) {
+ break;
+ }
+
+ _position = state.position;
+
+ while (0 !== ch && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveArgs.push(state.input.slice(_position, state.position));
+ }
+
+ if (0 !== ch) {
+ readLineBreak(state);
+ }
+
+ if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
+ directiveHandlers[directiveName](state, directiveName, directiveArgs);
+ } else {
+ throwWarning(state, 'unknown document directive "' + directiveName + '"');
+ }
+ }
+
+ skipSeparationSpace(state, true, -1);
+
+ if (0 === state.lineIndent &&
+ 0x2D/* - */ === state.input.charCodeAt(state.position) &&
+ 0x2D/* - */ === state.input.charCodeAt(state.position + 1) &&
+ 0x2D/* - */ === state.input.charCodeAt(state.position + 2)) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+
+ } else if (hasDirectives) {
+ throwError(state, 'directives end mark is expected');
+ }
+
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
+ skipSeparationSpace(state, true, -1);
+
+ if (state.checkLineBreaks &&
+ PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
+ throwWarning(state, 'non-ASCII line breaks are interpreted as content');
+ }
+
+ state.documents.push(state.result);
+
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
+
+ if (0x2E/* . */ === state.input.charCodeAt(state.position)) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+ }
+ return;
+ }
+
+ if (state.position < (state.length - 1)) {
+ throwError(state, 'end of the stream or a document separator is expected');
+ } else {
+ return;
+ }
+}
+
+
+function loadDocuments(input, options) {
+ input = String(input);
+ options = options || {};
+
+ if (input.length !== 0) {
+
+ // Add tailing `\n` if not exists
+ if (0x0A/* LF */ !== input.charCodeAt(input.length - 1) &&
+ 0x0D/* CR */ !== input.charCodeAt(input.length - 1)) {
+ input += '\n';
+ }
+
+ // Strip BOM
+ if (input.charCodeAt(0) === 0xFEFF) {
+ input = input.slice(1);
+ }
+ }
+
+ var state = new State(input, options);
+
+ // Use 0 as string terminator. That significantly simplifies bounds check.
+ state.input += '\0';
+
+ while (0x20/* Space */ === state.input.charCodeAt(state.position)) {
+ state.lineIndent += 1;
+ state.position += 1;
+ }
+
+ while (state.position < (state.length - 1)) {
+ readDocument(state);
+ }
+
+ return state.documents;
+}
+
+
+function loadAll(input, iterator, options) {
+ var documents = loadDocuments(input, options), index, length;
+
+ for (index = 0, length = documents.length; index < length; index += 1) {
+ iterator(documents[index]);
+ }
+}
+
+
+function load(input, options) {
+ var documents = loadDocuments(input, options);
+
+ if (0 === documents.length) {
+ /*eslint-disable no-undefined*/
+ return undefined;
+ } else if (1 === documents.length) {
+ return documents[0];
+ }
+ throw new YAMLException('expected a single document in the stream, but found more');
+}
+
+
+function safeLoadAll(input, output, options) {
+ loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+
+function safeLoad(input, options) {
+ return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+
+module.exports.loadAll = loadAll;
+module.exports.load = load;
+module.exports.safeLoadAll = safeLoadAll;
+module.exports.safeLoad = safeLoad;
+
+},{"./common":22,"./exception":24,"./mark":26,"./schema/default_full":29,"./schema/default_safe":30}],26:[function(require,module,exports){
+'use strict';
+
+
+var common = require('./common');
+
+
+function Mark(name, buffer, position, line, column) {
+ this.name = name;
+ this.buffer = buffer;
+ this.position = position;
+ this.line = line;
+ this.column = column;
+}
+
+
+Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
+ var head, start, tail, end, snippet;
+
+ if (!this.buffer) {
+ return null;
+ }
+
+ indent = indent || 4;
+ maxLength = maxLength || 75;
+
+ head = '';
+ start = this.position;
+
+ while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) {
+ start -= 1;
+ if (this.position - start > (maxLength / 2 - 1)) {
+ head = ' ... ';
+ start += 5;
+ break;
+ }
+ }
+
+ tail = '';
+ end = this.position;
+
+ while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) {
+ end += 1;
+ if (end - this.position > (maxLength / 2 - 1)) {
+ tail = ' ... ';
+ end -= 5;
+ break;
+ }
+ }
+
+ snippet = this.buffer.slice(start, end);
+
+ return common.repeat(' ', indent) + head + snippet + tail + '\n' +
+ common.repeat(' ', indent + this.position - start + head.length) + '^';
+};
+
+
+Mark.prototype.toString = function toString(compact) {
+ var snippet, where = '';
+
+ if (this.name) {
+ where += 'in "' + this.name + '" ';
+ }
+
+ where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
+
+ if (!compact) {
+ snippet = this.getSnippet();
+
+ if (snippet) {
+ where += ':\n' + snippet;
+ }
+ }
+
+ return where;
+};
+
+
+module.exports = Mark;
+
+},{"./common":22}],27:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable max-len*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var Type = require('./type');
+
+
+function compileList(schema, name, result) {
+ var exclude = [];
+
+ schema.include.forEach(function (includedSchema) {
+ result = compileList(includedSchema, name, result);
+ });
+
+ schema[name].forEach(function (currentType) {
+ result.forEach(function (previousType, previousIndex) {
+ if (previousType.tag === currentType.tag) {
+ exclude.push(previousIndex);
+ }
+ });
+
+ result.push(currentType);
+ });
+
+ return result.filter(function (type, index) {
+ return -1 === exclude.indexOf(index);
+ });
+}
+
+
+function compileMap(/* lists... */) {
+ var result = {}, index, length;
+
+ function collectType(type) {
+ result[type.tag] = type;
+ }
+
+ for (index = 0, length = arguments.length; index < length; index += 1) {
+ arguments[index].forEach(collectType);
+ }
+
+ return result;
+}
+
+
+function Schema(definition) {
+ this.include = definition.include || [];
+ this.implicit = definition.implicit || [];
+ this.explicit = definition.explicit || [];
+
+ this.implicit.forEach(function (type) {
+ if (type.loadKind && 'scalar' !== type.loadKind) {
+ throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
+ }
+ });
+
+ this.compiledImplicit = compileList(this, 'implicit', []);
+ this.compiledExplicit = compileList(this, 'explicit', []);
+ this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
+}
+
+
+Schema.DEFAULT = null;
+
+
+Schema.create = function createSchema() {
+ var schemas, types;
+
+ switch (arguments.length) {
+ case 1:
+ schemas = Schema.DEFAULT;
+ types = arguments[0];
+ break;
+
+ case 2:
+ schemas = arguments[0];
+ types = arguments[1];
+ break;
+
+ default:
+ throw new YAMLException('Wrong number of arguments for Schema.create function');
+ }
+
+ schemas = common.toArray(schemas);
+ types = common.toArray(types);
+
+ if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
+ throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
+ }
+
+ if (!types.every(function (type) { return type instanceof Type; })) {
+ throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+ }
+
+ return new Schema({
+ include: schemas,
+ explicit: types
+ });
+};
+
+
+module.exports = Schema;
+
+},{"./common":22,"./exception":24,"./type":33}],28:[function(require,module,exports){
+// Standard YAML's Core schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2804923
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, Core schema has no distinctions from JSON schema is JS-YAML.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ include: [
+ require('./json')
+ ]
+});
+
+},{"../schema":27,"./json":32}],29:[function(require,module,exports){
+// JS-YAML's default schema for `load` function.
+// It is not described in the YAML specification.
+//
+// This schema is based on JS-YAML's default safe schema and includes
+// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
+//
+// Also this schema is used as default base schema at `Schema.create` function.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = Schema.DEFAULT = new Schema({
+ include: [
+ require('./default_safe')
+ ],
+ explicit: [
+ require('../type/js/undefined'),
+ require('../type/js/regexp'),
+ require('../type/js/function')
+ ]
+});
+
+},{"../schema":27,"../type/js/function":38,"../type/js/regexp":39,"../type/js/undefined":40,"./default_safe":30}],30:[function(require,module,exports){
+// JS-YAML's default schema for `safeLoad` function.
+// It is not described in the YAML specification.
+//
+// This schema is based on standard YAML's Core schema and includes most of
+// extra types described at YAML tag repository. (http://yaml.org/type/)
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ include: [
+ require('./core')
+ ],
+ implicit: [
+ require('../type/timestamp'),
+ require('../type/merge')
+ ],
+ explicit: [
+ require('../type/binary'),
+ require('../type/omap'),
+ require('../type/pairs'),
+ require('../type/set')
+ ]
+});
+
+},{"../schema":27,"../type/binary":34,"../type/merge":42,"../type/omap":44,"../type/pairs":45,"../type/set":47,"../type/timestamp":49,"./core":28}],31:[function(require,module,exports){
+// Standard YAML's Failsafe schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2802346
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ explicit: [
+ require('../type/str'),
+ require('../type/seq'),
+ require('../type/map')
+ ]
+});
+
+},{"../schema":27,"../type/map":41,"../type/seq":46,"../type/str":48}],32:[function(require,module,exports){
+// Standard YAML's JSON schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2803231
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, this schema is not such strict as defined in the YAML specification.
+// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ include: [
+ require('./failsafe')
+ ],
+ implicit: [
+ require('../type/null'),
+ require('../type/bool'),
+ require('../type/int'),
+ require('../type/float')
+ ]
+});
+
+},{"../schema":27,"../type/bool":35,"../type/float":36,"../type/int":37,"../type/null":43,"./failsafe":31}],33:[function(require,module,exports){
+'use strict';
+
+var YAMLException = require('./exception');
+
+var TYPE_CONSTRUCTOR_OPTIONS = [
+ 'kind',
+ 'resolve',
+ 'construct',
+ 'instanceOf',
+ 'predicate',
+ 'represent',
+ 'defaultStyle',
+ 'styleAliases'
+];
+
+var YAML_NODE_KINDS = [
+ 'scalar',
+ 'sequence',
+ 'mapping'
+];
+
+function compileStyleAliases(map) {
+ var result = {};
+
+ if (null !== map) {
+ Object.keys(map).forEach(function (style) {
+ map[style].forEach(function (alias) {
+ result[String(alias)] = style;
+ });
+ });
+ }
+
+ return result;
+}
+
+function Type(tag, options) {
+ options = options || {};
+
+ Object.keys(options).forEach(function (name) {
+ if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) {
+ throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
+ }
+ });
+
+ // TODO: Add tag format check.
+ this.tag = tag;
+ this.kind = options['kind'] || null;
+ this.resolve = options['resolve'] || function () { return true; };
+ this.construct = options['construct'] || function (data) { return data; };
+ this.instanceOf = options['instanceOf'] || null;
+ this.predicate = options['predicate'] || null;
+ this.represent = options['represent'] || null;
+ this.defaultStyle = options['defaultStyle'] || null;
+ this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
+
+ if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) {
+ throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
+ }
+}
+
+module.exports = Type;
+
+},{"./exception":24}],34:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable no-bitwise*/
+
+// A trick for browserified version.
+// Since we make browserifier to ignore `buffer` module, NodeBuffer will be undefined
+var NodeBuffer = require('buffer').Buffer;
+var Type = require('../type');
+
+
+// [ 64, 65, 66 ] -> [ padding, CR, LF ]
+var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
+
+
+function resolveYamlBinary(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
+
+ // Convert one by one.
+ for (idx = 0; idx < max; idx++) {
+ code = map.indexOf(data.charAt(idx));
+
+ // Skip CR/LF
+ if (code > 64) { continue; }
+
+ // Fail on illegal characters
+ if (code < 0) { return false; }
+
+ bitlen += 6;
+ }
+
+ // If there are any bits left, source was corrupted
+ return (bitlen % 8) === 0;
+}
+
+function constructYamlBinary(data) {
+ var idx, tailbits,
+ input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
+ max = input.length,
+ map = BASE64_MAP,
+ bits = 0,
+ result = [];
+
+ // Collect by 6*4 bits (3 bytes)
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 4 === 0) && idx) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ }
+
+ bits = (bits << 6) | map.indexOf(input.charAt(idx));
+ }
+
+ // Dump tail
+
+ tailbits = (max % 4) * 6;
+
+ if (tailbits === 0) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ } else if (tailbits === 18) {
+ result.push((bits >> 10) & 0xFF);
+ result.push((bits >> 2) & 0xFF);
+ } else if (tailbits === 12) {
+ result.push((bits >> 4) & 0xFF);
+ }
+
+ // Wrap into Buffer for NodeJS and leave Array for browser
+ if (NodeBuffer) {
+ return new NodeBuffer(result);
+ }
+
+ return result;
+}
+
+function representYamlBinary(object /*, style*/) {
+ var result = '', bits = 0, idx, tail,
+ max = object.length,
+ map = BASE64_MAP;
+
+ // Convert every three bytes to 4 ASCII characters.
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 3 === 0) && idx) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ }
+
+ bits = (bits << 8) + object[idx];
+ }
+
+ // Dump tail
+
+ tail = max % 3;
+
+ if (tail === 0) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ } else if (tail === 2) {
+ result += map[(bits >> 10) & 0x3F];
+ result += map[(bits >> 4) & 0x3F];
+ result += map[(bits << 2) & 0x3F];
+ result += map[64];
+ } else if (tail === 1) {
+ result += map[(bits >> 2) & 0x3F];
+ result += map[(bits << 4) & 0x3F];
+ result += map[64];
+ result += map[64];
+ }
+
+ return result;
+}
+
+function isBinary(object) {
+ return NodeBuffer && NodeBuffer.isBuffer(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:binary', {
+ kind: 'scalar',
+ resolve: resolveYamlBinary,
+ construct: constructYamlBinary,
+ predicate: isBinary,
+ represent: representYamlBinary
+});
+
+},{"../type":33,"buffer":12}],35:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlBoolean(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var max = data.length;
+
+ return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
+ (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
+}
+
+function constructYamlBoolean(data) {
+ return data === 'true' ||
+ data === 'True' ||
+ data === 'TRUE';
+}
+
+function isBoolean(object) {
+ return '[object Boolean]' === Object.prototype.toString.call(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:bool', {
+ kind: 'scalar',
+ resolve: resolveYamlBoolean,
+ construct: constructYamlBoolean,
+ predicate: isBoolean,
+ represent: {
+ lowercase: function (object) { return object ? 'true' : 'false'; },
+ uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
+ camelcase: function (object) { return object ? 'True' : 'False'; }
+ },
+ defaultStyle: 'lowercase'
+});
+
+},{"../type":33}],36:[function(require,module,exports){
+'use strict';
+
+var common = require('../common');
+var Type = require('../type');
+
+var YAML_FLOAT_PATTERN = new RegExp(
+ '^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' +
+ '|\\.[0-9_]+(?:[eE][-+][0-9]+)?' +
+ '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
+ '|[-+]?\\.(?:inf|Inf|INF)' +
+ '|\\.(?:nan|NaN|NAN))$');
+
+function resolveYamlFloat(data) {
+ if (null === data) {
+ return false;
+ }
+
+ if (!YAML_FLOAT_PATTERN.test(data)) {
+ return false;
+ }
+ return true;
+}
+
+function constructYamlFloat(data) {
+ var value, sign, base, digits;
+
+ value = data.replace(/_/g, '').toLowerCase();
+ sign = '-' === value[0] ? -1 : 1;
+ digits = [];
+
+ if (0 <= '+-'.indexOf(value[0])) {
+ value = value.slice(1);
+ }
+
+ if ('.inf' === value) {
+ return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
+
+ } else if ('.nan' === value) {
+ return NaN;
+
+ } else if (0 <= value.indexOf(':')) {
+ value.split(':').forEach(function (v) {
+ digits.unshift(parseFloat(v, 10));
+ });
+
+ value = 0.0;
+ base = 1;
+
+ digits.forEach(function (d) {
+ value += d * base;
+ base *= 60;
+ });
+
+ return sign * value;
+
+ }
+ return sign * parseFloat(value, 10);
+}
+
+
+var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
+
+function representYamlFloat(object, style) {
+ var res;
+
+ if (isNaN(object)) {
+ switch (style) {
+ case 'lowercase':
+ return '.nan';
+ case 'uppercase':
+ return '.NAN';
+ case 'camelcase':
+ return '.NaN';
+ }
+ } else if (Number.POSITIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase':
+ return '.inf';
+ case 'uppercase':
+ return '.INF';
+ case 'camelcase':
+ return '.Inf';
+ }
+ } else if (Number.NEGATIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase':
+ return '-.inf';
+ case 'uppercase':
+ return '-.INF';
+ case 'camelcase':
+ return '-.Inf';
+ }
+ } else if (common.isNegativeZero(object)) {
+ return '-0.0';
+ }
+
+ res = object.toString(10);
+
+ // JS stringifier can build scientific format without dots: 5e-100,
+ // while YAML requres dot: 5.e-100. Fix it with simple hack
+
+ return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
+}
+
+function isFloat(object) {
+ return ('[object Number]' === Object.prototype.toString.call(object)) &&
+ (0 !== object % 1 || common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:float', {
+ kind: 'scalar',
+ resolve: resolveYamlFloat,
+ construct: constructYamlFloat,
+ predicate: isFloat,
+ represent: representYamlFloat,
+ defaultStyle: 'lowercase'
+});
+
+},{"../common":22,"../type":33}],37:[function(require,module,exports){
+'use strict';
+
+var common = require('../common');
+var Type = require('../type');
+
+function isHexCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
+ ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
+ ((0x61/* a */ <= c) && (c <= 0x66/* f */));
+}
+
+function isOctCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
+}
+
+function isDecCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
+}
+
+function resolveYamlInteger(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var max = data.length,
+ index = 0,
+ hasDigits = false,
+ ch;
+
+ if (!max) { return false; }
+
+ ch = data[index];
+
+ // sign
+ if (ch === '-' || ch === '+') {
+ ch = data[++index];
+ }
+
+ if (ch === '0') {
+ // 0
+ if (index + 1 === max) { return true; }
+ ch = data[++index];
+
+ // base 2, base 8, base 16
+
+ if (ch === 'b') {
+ // base 2
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') { continue; }
+ if (ch !== '0' && ch !== '1') {
+ return false;
+ }
+ hasDigits = true;
+ }
+ return hasDigits;
+ }
+
+
+ if (ch === 'x') {
+ // base 16
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') { continue; }
+ if (!isHexCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+ return hasDigits;
+ }
+
+ // base 8
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') { continue; }
+ if (!isOctCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+ return hasDigits;
+ }
+
+ // base 10 (except 0) or base 60
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') { continue; }
+ if (ch === ':') { break; }
+ if (!isDecCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+
+ if (!hasDigits) { return false; }
+
+ // if !base60 - done;
+ if (ch !== ':') { return true; }
+
+ // base60 almost not used, no needs to optimize
+ return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
+}
+
+function constructYamlInteger(data) {
+ var value = data, sign = 1, ch, base, digits = [];
+
+ if (value.indexOf('_') !== -1) {
+ value = value.replace(/_/g, '');
+ }
+
+ ch = value[0];
+
+ if (ch === '-' || ch === '+') {
+ if (ch === '-') { sign = -1; }
+ value = value.slice(1);
+ ch = value[0];
+ }
+
+ if ('0' === value) {
+ return 0;
+ }
+
+ if (ch === '0') {
+ if (value[1] === 'b') {
+ return sign * parseInt(value.slice(2), 2);
+ }
+ if (value[1] === 'x') {
+ return sign * parseInt(value, 16);
+ }
+ return sign * parseInt(value, 8);
+
+ }
+
+ if (value.indexOf(':') !== -1) {
+ value.split(':').forEach(function (v) {
+ digits.unshift(parseInt(v, 10));
+ });
+
+ value = 0;
+ base = 1;
+
+ digits.forEach(function (d) {
+ value += (d * base);
+ base *= 60;
+ });
+
+ return sign * value;
+
+ }
+
+ return sign * parseInt(value, 10);
+}
+
+function isInteger(object) {
+ return ('[object Number]' === Object.prototype.toString.call(object)) &&
+ (0 === object % 1 && !common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:int', {
+ kind: 'scalar',
+ resolve: resolveYamlInteger,
+ construct: constructYamlInteger,
+ predicate: isInteger,
+ represent: {
+ binary: function (object) { return '0b' + object.toString(2); },
+ octal: function (object) { return '0' + object.toString(8); },
+ decimal: function (object) { return object.toString(10); },
+ hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); }
+ },
+ defaultStyle: 'decimal',
+ styleAliases: {
+ binary: [ 2, 'bin' ],
+ octal: [ 8, 'oct' ],
+ decimal: [ 10, 'dec' ],
+ hexadecimal: [ 16, 'hex' ]
+ }
+});
+
+},{"../common":22,"../type":33}],38:[function(require,module,exports){
+'use strict';
+
+var esprima;
+
+// Browserified version does not have esprima
+//
+// 1. For node.js just require module as deps
+// 2. For browser try to require mudule via external AMD system.
+// If not found - try to fallback to window.esprima. If not
+// found too - then fail to parse.
+//
+try {
+ esprima = require('esprima');
+} catch (_) {
+ /*global window */
+ if (typeof window !== 'undefined') { esprima = window.esprima; }
+}
+
+var Type = require('../../type');
+
+function resolveJavascriptFunction(data) {
+ if (null === data) {
+ return false;
+ }
+
+ try {
+ var source = '(' + data + ')',
+ ast = esprima.parse(source, { range: true });
+
+ if ('Program' !== ast.type ||
+ 1 !== ast.body.length ||
+ 'ExpressionStatement' !== ast.body[0].type ||
+ 'FunctionExpression' !== ast.body[0].expression.type) {
+ return false;
+ }
+
+ return true;
+ } catch (err) {
+ return false;
+ }
+}
+
+function constructJavascriptFunction(data) {
+ /*jslint evil:true*/
+
+ var source = '(' + data + ')',
+ ast = esprima.parse(source, { range: true }),
+ params = [],
+ body;
+
+ if ('Program' !== ast.type ||
+ 1 !== ast.body.length ||
+ 'ExpressionStatement' !== ast.body[0].type ||
+ 'FunctionExpression' !== ast.body[0].expression.type) {
+ throw new Error('Failed to resolve function');
+ }
+
+ ast.body[0].expression.params.forEach(function (param) {
+ params.push(param.name);
+ });
+
+ body = ast.body[0].expression.body.range;
+
+ // Esprima's ranges include the first '{' and the last '}' characters on
+ // function expressions. So cut them out.
+ /*eslint-disable no-new-func*/
+ return new Function(params, source.slice(body[0] + 1, body[1] - 1));
+}
+
+function representJavascriptFunction(object /*, style*/) {
+ return object.toString();
+}
+
+function isFunction(object) {
+ return '[object Function]' === Object.prototype.toString.call(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/function', {
+ kind: 'scalar',
+ resolve: resolveJavascriptFunction,
+ construct: constructJavascriptFunction,
+ predicate: isFunction,
+ represent: representJavascriptFunction
+});
+
+},{"../../type":33,"esprima":50}],39:[function(require,module,exports){
+'use strict';
+
+var Type = require('../../type');
+
+function resolveJavascriptRegExp(data) {
+ if (null === data) {
+ return false;
+ }
+
+ if (0 === data.length) {
+ return false;
+ }
+
+ var regexp = data,
+ tail = /\/([gim]*)$/.exec(data),
+ modifiers = '';
+
+ // if regexp starts with '/' it can have modifiers and must be properly closed
+ // `/foo/gim` - modifiers tail can be maximum 3 chars
+ if ('/' === regexp[0]) {
+ if (tail) {
+ modifiers = tail[1];
+ }
+
+ if (modifiers.length > 3) { return false; }
+ // if expression starts with /, is should be properly terminated
+ if (regexp[regexp.length - modifiers.length - 1] !== '/') { return false; }
+
+ regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
+ }
+
+ try {
+ return true;
+ } catch (error) {
+ return false;
+ }
+}
+
+function constructJavascriptRegExp(data) {
+ var regexp = data,
+ tail = /\/([gim]*)$/.exec(data),
+ modifiers = '';
+
+ // `/foo/gim` - tail can be maximum 4 chars
+ if ('/' === regexp[0]) {
+ if (tail) {
+ modifiers = tail[1];
+ }
+ regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
+ }
+
+ return new RegExp(regexp, modifiers);
+}
+
+function representJavascriptRegExp(object /*, style*/) {
+ var result = '/' + object.source + '/';
+
+ if (object.global) {
+ result += 'g';
+ }
+
+ if (object.multiline) {
+ result += 'm';
+ }
+
+ if (object.ignoreCase) {
+ result += 'i';
+ }
+
+ return result;
+}
+
+function isRegExp(object) {
+ return '[object RegExp]' === Object.prototype.toString.call(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/regexp', {
+ kind: 'scalar',
+ resolve: resolveJavascriptRegExp,
+ construct: constructJavascriptRegExp,
+ predicate: isRegExp,
+ represent: representJavascriptRegExp
+});
+
+},{"../../type":33}],40:[function(require,module,exports){
+'use strict';
+
+var Type = require('../../type');
+
+function resolveJavascriptUndefined() {
+ return true;
+}
+
+function constructJavascriptUndefined() {
+ /*eslint-disable no-undefined*/
+ return undefined;
+}
+
+function representJavascriptUndefined() {
+ return '';
+}
+
+function isUndefined(object) {
+ return 'undefined' === typeof object;
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/undefined', {
+ kind: 'scalar',
+ resolve: resolveJavascriptUndefined,
+ construct: constructJavascriptUndefined,
+ predicate: isUndefined,
+ represent: representJavascriptUndefined
+});
+
+},{"../../type":33}],41:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:map', {
+ kind: 'mapping',
+ construct: function (data) { return null !== data ? data : {}; }
+});
+
+},{"../type":33}],42:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlMerge(data) {
+ return '<<' === data || null === data;
+}
+
+module.exports = new Type('tag:yaml.org,2002:merge', {
+ kind: 'scalar',
+ resolve: resolveYamlMerge
+});
+
+},{"../type":33}],43:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlNull(data) {
+ if (null === data) {
+ return true;
+ }
+
+ var max = data.length;
+
+ return (max === 1 && data === '~') ||
+ (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
+}
+
+function constructYamlNull() {
+ return null;
+}
+
+function isNull(object) {
+ return null === object;
+}
+
+module.exports = new Type('tag:yaml.org,2002:null', {
+ kind: 'scalar',
+ resolve: resolveYamlNull,
+ construct: constructYamlNull,
+ predicate: isNull,
+ represent: {
+ canonical: function () { return '~'; },
+ lowercase: function () { return 'null'; },
+ uppercase: function () { return 'NULL'; },
+ camelcase: function () { return 'Null'; }
+ },
+ defaultStyle: 'lowercase'
+});
+
+},{"../type":33}],44:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+var _toString = Object.prototype.toString;
+
+function resolveYamlOmap(data) {
+ if (null === data) {
+ return true;
+ }
+
+ var objectKeys = [], index, length, pair, pairKey, pairHasKey,
+ object = data;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+ pairHasKey = false;
+
+ if ('[object Object]' !== _toString.call(pair)) {
+ return false;
+ }
+
+ for (pairKey in pair) {
+ if (_hasOwnProperty.call(pair, pairKey)) {
+ if (!pairHasKey) {
+ pairHasKey = true;
+ } else {
+ return false;
+ }
+ }
+ }
+
+ if (!pairHasKey) {
+ return false;
+ }
+
+ if (-1 === objectKeys.indexOf(pairKey)) {
+ objectKeys.push(pairKey);
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+function constructYamlOmap(data) {
+ return null !== data ? data : [];
+}
+
+module.exports = new Type('tag:yaml.org,2002:omap', {
+ kind: 'sequence',
+ resolve: resolveYamlOmap,
+ construct: constructYamlOmap
+});
+
+},{"../type":33}],45:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var _toString = Object.prototype.toString;
+
+function resolveYamlPairs(data) {
+ if (null === data) {
+ return true;
+ }
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ if ('[object Object]' !== _toString.call(pair)) {
+ return false;
+ }
+
+ keys = Object.keys(pair);
+
+ if (1 !== keys.length) {
+ return false;
+ }
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return true;
+}
+
+function constructYamlPairs(data) {
+ if (null === data) {
+ return [];
+ }
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ keys = Object.keys(pair);
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return result;
+}
+
+module.exports = new Type('tag:yaml.org,2002:pairs', {
+ kind: 'sequence',
+ resolve: resolveYamlPairs,
+ construct: constructYamlPairs
+});
+
+},{"../type":33}],46:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:seq', {
+ kind: 'sequence',
+ construct: function (data) { return null !== data ? data : []; }
+});
+
+},{"../type":33}],47:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+function resolveYamlSet(data) {
+ if (null === data) {
+ return true;
+ }
+
+ var key, object = data;
+
+ for (key in object) {
+ if (_hasOwnProperty.call(object, key)) {
+ if (null !== object[key]) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+function constructYamlSet(data) {
+ return null !== data ? data : {};
+}
+
+module.exports = new Type('tag:yaml.org,2002:set', {
+ kind: 'mapping',
+ resolve: resolveYamlSet,
+ construct: constructYamlSet
+});
+
+},{"../type":33}],48:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:str', {
+ kind: 'scalar',
+ construct: function (data) { return null !== data ? data : ''; }
+});
+
+},{"../type":33}],49:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var YAML_TIMESTAMP_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9]?)' + // [2] month
+ '-([0-9][0-9]?)' + // [3] day
+ '(?:(?:[Tt]|[ \\t]+)' + // ...
+ '([0-9][0-9]?)' + // [4] hour
+ ':([0-9][0-9])' + // [5] minute
+ ':([0-9][0-9])' + // [6] second
+ '(?:\\.([0-9]*))?' + // [7] fraction
+ '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
+ '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute
+
+function resolveYamlTimestamp(data) {
+ if (null === data) {
+ return false;
+ }
+
+ if (YAML_TIMESTAMP_REGEXP.exec(data) === null) {
+ return false;
+ }
+
+ return true;
+}
+
+function constructYamlTimestamp(data) {
+ var match, year, month, day, hour, minute, second, fraction = 0,
+ delta = null, tz_hour, tz_minute, date;
+
+ match = YAML_TIMESTAMP_REGEXP.exec(data);
+
+ if (null === match) {
+ throw new Error('Date resolve error');
+ }
+
+ // match: [1] year [2] month [3] day
+
+ year = +(match[1]);
+ month = +(match[2]) - 1; // JS month starts with 0
+ day = +(match[3]);
+
+ if (!match[4]) { // no hour
+ return new Date(Date.UTC(year, month, day));
+ }
+
+ // match: [4] hour [5] minute [6] second [7] fraction
+
+ hour = +(match[4]);
+ minute = +(match[5]);
+ second = +(match[6]);
+
+ if (match[7]) {
+ fraction = match[7].slice(0, 3);
+ while (fraction.length < 3) { // milli-seconds
+ fraction += '0';
+ }
+ fraction = +fraction;
+ }
+
+ // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
+
+ if (match[9]) {
+ tz_hour = +(match[10]);
+ tz_minute = +(match[11] || 0);
+ delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
+ if ('-' === match[9]) {
+ delta = -delta;
+ }
+ }
+
+ date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
+
+ if (delta) {
+ date.setTime(date.getTime() - delta);
+ }
+
+ return date;
+}
+
+function representYamlTimestamp(object /*, style*/) {
+ return object.toISOString();
+}
+
+module.exports = new Type('tag:yaml.org,2002:timestamp', {
+ kind: 'scalar',
+ resolve: resolveYamlTimestamp,
+ construct: constructYamlTimestamp,
+ instanceOf: Date,
+ represent: representYamlTimestamp
+});
+
+},{"../type":33}],50:[function(require,module,exports){
+/*
+ Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+(function (root, factory) {
+ 'use strict';
+
+ // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,
+ // Rhino, and plain browser loading.
+
+ /* istanbul ignore next */
+ if (typeof define === 'function' && define.amd) {
+ define(['exports'], factory);
+ } else if (typeof exports !== 'undefined') {
+ factory(exports);
+ } else {
+ factory((root.esprima = {}));
+ }
+}(this, function (exports) {
+ 'use strict';
+
+ var Token,
+ TokenName,
+ FnExprTokens,
+ Syntax,
+ PlaceHolders,
+ Messages,
+ Regex,
+ source,
+ strict,
+ index,
+ lineNumber,
+ lineStart,
+ hasLineTerminator,
+ lastIndex,
+ lastLineNumber,
+ lastLineStart,
+ startIndex,
+ startLineNumber,
+ startLineStart,
+ scanning,
+ length,
+ lookahead,
+ state,
+ extra,
+ isBindingElement,
+ isAssignmentTarget,
+ firstCoverInitializedNameError;
+
+ Token = {
+ BooleanLiteral: 1,
+ EOF: 2,
+ Identifier: 3,
+ Keyword: 4,
+ NullLiteral: 5,
+ NumericLiteral: 6,
+ Punctuator: 7,
+ StringLiteral: 8,
+ RegularExpression: 9,
+ Template: 10
+ };
+
+ TokenName = {};
+ TokenName[Token.BooleanLiteral] = 'Boolean';
+ TokenName[Token.EOF] = '<end>';
+ TokenName[Token.Identifier] = 'Identifier';
+ TokenName[Token.Keyword] = 'Keyword';
+ TokenName[Token.NullLiteral] = 'Null';
+ TokenName[Token.NumericLiteral] = 'Numeric';
+ TokenName[Token.Punctuator] = 'Punctuator';
+ TokenName[Token.StringLiteral] = 'String';
+ TokenName[Token.RegularExpression] = 'RegularExpression';
+ TokenName[Token.Template] = 'Template';
+
+ // A function following one of those tokens is an expression.
+ FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',
+ 'return', 'case', 'delete', 'throw', 'void',
+ // assignment operators
+ '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',
+ '&=', '|=', '^=', ',',
+ // binary/unary operators
+ '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',
+ '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',
+ '<=', '<', '>', '!=', '!=='];
+
+ Syntax = {
+ AssignmentExpression: 'AssignmentExpression',
+ AssignmentPattern: 'AssignmentPattern',
+ ArrayExpression: 'ArrayExpression',
+ ArrayPattern: 'ArrayPattern',
+ ArrowFunctionExpression: 'ArrowFunctionExpression',
+ BlockStatement: 'BlockStatement',
+ BinaryExpression: 'BinaryExpression',
+ BreakStatement: 'BreakStatement',
+ CallExpression: 'CallExpression',
+ CatchClause: 'CatchClause',
+ ClassBody: 'ClassBody',
+ ClassDeclaration: 'ClassDeclaration',
+ ClassExpression: 'ClassExpression',
+ ConditionalExpression: 'ConditionalExpression',
+ ContinueStatement: 'ContinueStatement',
+ DoWhileStatement: 'DoWhileStatement',
+ DebuggerStatement: 'DebuggerStatement',
+ EmptyStatement: 'EmptyStatement',
+ ExportAllDeclaration: 'ExportAllDeclaration',
+ ExportDefaultDeclaration: 'ExportDefaultDeclaration',
+ ExportNamedDeclaration: 'ExportNamedDeclaration',
+ ExportSpecifier: 'ExportSpecifier',
+ ExpressionStatement: 'ExpressionStatement',
+ ForStatement: 'ForStatement',
+ ForOfStatement: 'ForOfStatement',
+ ForInStatement: 'ForInStatement',
+ FunctionDeclaration: 'FunctionDeclaration',
+ FunctionExpression: 'FunctionExpression',
+ Identifier: 'Identifier',
+ IfStatement: 'IfStatement',
+ ImportDeclaration: 'ImportDeclaration',
+ ImportDefaultSpecifier: 'ImportDefaultSpecifier',
+ ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
+ ImportSpecifier: 'ImportSpecifier',
+ Literal: 'Literal',
+ LabeledStatement: 'LabeledStatement',
+ LogicalExpression: 'LogicalExpression',
+ MemberExpression: 'MemberExpression',
+ MetaProperty: 'MetaProperty',
+ MethodDefinition: 'MethodDefinition',
+ NewExpression: 'NewExpression',
+ ObjectExpression: 'ObjectExpression',
+ ObjectPattern: 'ObjectPattern',
+ Program: 'Program',
+ Property: 'Property',
+ RestElement: 'RestElement',
+ ReturnStatement: 'ReturnStatement',
+ SequenceExpression: 'SequenceExpression',
+ SpreadElement: 'SpreadElement',
+ Super: 'Super',
+ SwitchCase: 'SwitchCase',
+ SwitchStatement: 'SwitchStatement',
+ TaggedTemplateExpression: 'TaggedTemplateExpression',
+ TemplateElement: 'TemplateElement',
+ TemplateLiteral: 'TemplateLiteral',
+ ThisExpression: 'ThisExpression',
+ ThrowStatement: 'ThrowStatement',
+ TryStatement: 'TryStatement',
+ UnaryExpression: 'UnaryExpression',
+ UpdateExpression: 'UpdateExpression',
+ VariableDeclaration: 'VariableDeclaration',
+ VariableDeclarator: 'VariableDeclarator',
+ WhileStatement: 'WhileStatement',
+ WithStatement: 'WithStatement',
+ YieldExpression: 'YieldExpression'
+ };
+
+ PlaceHolders = {
+ ArrowParameterPlaceHolder: 'ArrowParameterPlaceHolder'
+ };
+
+ // Error messages should be identical to V8.
+ Messages = {
+ UnexpectedToken: 'Unexpected token %0',
+ UnexpectedNumber: 'Unexpected number',
+ UnexpectedString: 'Unexpected string',
+ UnexpectedIdentifier: 'Unexpected identifier',
+ UnexpectedReserved: 'Unexpected reserved word',
+ UnexpectedTemplate: 'Unexpected quasi %0',
+ UnexpectedEOS: 'Unexpected end of input',
+ NewlineAfterThrow: 'Illegal newline after throw',
+ InvalidRegExp: 'Invalid regular expression',
+ UnterminatedRegExp: 'Invalid regular expression: missing /',
+ InvalidLHSInAssignment: 'Invalid left-hand side in assignment',
+ InvalidLHSInForIn: 'Invalid left-hand side in for-in',
+ InvalidLHSInForLoop: 'Invalid left-hand side in for-loop',
+ MultipleDefaultsInSwitch: 'More than one default clause in switch statement',
+ NoCatchOrFinally: 'Missing catch or finally after try',
+ UnknownLabel: 'Undefined label \'%0\'',
+ Redeclaration: '%0 \'%1\' has already been declared',
+ IllegalContinue: 'Illegal continue statement',
+ IllegalBreak: 'Illegal break statement',
+ IllegalReturn: 'Illegal return statement',
+ StrictModeWith: 'Strict mode code may not include a with statement',
+ StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
+ StrictVarName: 'Variable name may not be eval or arguments in strict mode',
+ StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
+ StrictParamDupe: 'Strict mode function may not have duplicate parameter names',
+ StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
+ StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
+ StrictDelete: 'Delete of an unqualified identifier in strict mode.',
+ StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
+ StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
+ StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
+ StrictReservedWord: 'Use of future reserved word in strict mode',
+ TemplateOctalLiteral: 'Octal literals are not allowed in template strings.',
+ ParameterAfterRestParameter: 'Rest parameter must be last formal parameter',
+ DefaultRestParameter: 'Unexpected token =',
+ ObjectPatternAsRestParameter: 'Unexpected token {',
+ DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals',
+ ConstructorSpecialMethod: 'Class constructor may not be an accessor',
+ DuplicateConstructor: 'A class may only have one constructor',
+ StaticPrototype: 'Classes may not have static property named prototype',
+ MissingFromClause: 'Unexpected token',
+ NoAsAfterImportNamespace: 'Unexpected token',
+ InvalidModuleSpecifier: 'Unexpected token',
+ IllegalImportDeclaration: 'Unexpected token',
+ IllegalExportDeclaration: 'Unexpected token',
+ DuplicateBinding: 'Duplicate binding %0'
+ };
+
+ // See also tools/generate-unicode-regex.js.
+ Regex = {
+ // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart:
+ NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\u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F72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/,
+
+ // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart:
+ NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A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E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\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00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF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\uDE1D]|\uDB40[\uDD00-\uDDEF]/
+ };
+
+ // Ensure the condition is true, otherwise throw an error.
+ // This is only to have a better contract semantic, i.e. another safety net
+ // to catch a logic error. The condition shall be fulfilled in normal case.
+ // Do NOT use this to enforce a certain condition on any user input.
+
+ function assert(condition, message) {
+ /* istanbul ignore if */
+ if (!condition) {
+ throw new Error('ASSERT: ' + message);
+ }
+ }
+
+ function isDecimalDigit(ch) {
+ return (ch >= 0x30 && ch <= 0x39); // 0..9
+ }
+
+ function isHexDigit(ch) {
+ return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;
+ }
+
+ function isOctalDigit(ch) {
+ return '01234567'.indexOf(ch) >= 0;
+ }
+
+ function octalToDecimal(ch) {
+ // \0 is not octal escape sequence
+ var octal = (ch !== '0'), code = '01234567'.indexOf(ch);
+
+ if (index < length && isOctalDigit(source[index])) {
+ octal = true;
+ code = code * 8 + '01234567'.indexOf(source[index++]);
+
+ // 3 digits are only allowed when string starts
+ // with 0, 1, 2, 3
+ if ('0123'.indexOf(ch) >= 0 &&
+ index < length &&
+ isOctalDigit(source[index])) {
+ code = code * 8 + '01234567'.indexOf(source[index++]);
+ }
+ }
+
+ return {
+ code: code,
+ octal: octal
+ };
+ }
+
+ // ECMA-262 11.2 White Space
+
+ function isWhiteSpace(ch) {
+ return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||
+ (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);
+ }
+
+ // ECMA-262 11.3 Line Terminators
+
+ function isLineTerminator(ch) {
+ return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);
+ }
+
+ // ECMA-262 11.6 Identifier Names and Identifiers
+
+ function fromCodePoint(cp) {
+ return (cp < 0x10000) ? String.fromCharCode(cp) :
+ String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) +
+ String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));
+ }
+
+ function isIdentifierStart(ch) {
+ return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)
+ (ch >= 0x41 && ch <= 0x5A) || // A..Z
+ (ch >= 0x61 && ch <= 0x7A) || // a..z
+ (ch === 0x5C) || // \ (backslash)
+ ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)));
+ }
+
+ function isIdentifierPart(ch) {
+ return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)
+ (ch >= 0x41 && ch <= 0x5A) || // A..Z
+ (ch >= 0x61 && ch <= 0x7A) || // a..z
+ (ch >= 0x30 && ch <= 0x39) || // 0..9
+ (ch === 0x5C) || // \ (backslash)
+ ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)));
+ }
+
+ // ECMA-262 11.6.2.2 Future Reserved Words
+
+ function isFutureReservedWord(id) {
+ switch (id) {
+ case 'enum':
+ case 'export':
+ case 'import':
+ case 'super':
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ function isStrictModeReservedWord(id) {
+ switch (id) {
+ case 'implements':
+ case 'interface':
+ case 'package':
+ case 'private':
+ case 'protected':
+ case 'public':
+ case 'static':
+ case 'yield':
+ case 'let':
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ function isRestrictedWord(id) {
+ return id === 'eval' || id === 'arguments';
+ }
+
+ // ECMA-262 11.6.2.1 Keywords
+
+ function isKeyword(id) {
+ switch (id.length) {
+ case 2:
+ return (id === 'if') || (id === 'in') || (id === 'do');
+ case 3:
+ return (id === 'var') || (id === 'for') || (id === 'new') ||
+ (id === 'try') || (id === 'let');
+ case 4:
+ return (id === 'this') || (id === 'else') || (id === 'case') ||
+ (id === 'void') || (id === 'with') || (id === 'enum');
+ case 5:
+ return (id === 'while') || (id === 'break') || (id === 'catch') ||
+ (id === 'throw') || (id === 'const') || (id === 'yield') ||
+ (id === 'class') || (id === 'super');
+ case 6:
+ return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
+ (id === 'switch') || (id === 'export') || (id === 'import');
+ case 7:
+ return (id === 'default') || (id === 'finally') || (id === 'extends');
+ case 8:
+ return (id === 'function') || (id === 'continue') || (id === 'debugger');
+ case 10:
+ return (id === 'instanceof');
+ default:
+ return false;
+ }
+ }
+
+ // ECMA-262 11.4 Comments
+
+ function addComment(type, value, start, end, loc) {
+ var comment;
+
+ assert(typeof start === 'number', 'Comment must have valid position');
+
+ state.lastCommentStart = start;
+
+ comment = {
+ type: type,
+ value: value
+ };
+ if (extra.range) {
+ comment.range = [start, end];
+ }
+ if (extra.loc) {
+ comment.loc = loc;
+ }
+ extra.comments.push(comment);
+ if (extra.attachComment) {
+ extra.leadingComments.push(comment);
+ extra.trailingComments.push(comment);
+ }
+ if (extra.tokenize) {
+ comment.type = comment.type + 'Comment';
+ if (extra.delegate) {
+ comment = extra.delegate(comment);
+ }
+ extra.tokens.push(comment);
+ }
+ }
+
+ function skipSingleLineComment(offset) {
+ var start, loc, ch, comment;
+
+ start = index - offset;
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart - offset
+ }
+ };
+
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ ++index;
+ if (isLineTerminator(ch)) {
+ hasLineTerminator = true;
+ if (extra.comments) {
+ comment = source.slice(start + offset, index - 1);
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart - 1
+ };
+ addComment('Line', comment, start, index - 1, loc);
+ }
+ if (ch === 13 && source.charCodeAt(index) === 10) {
+ ++index;
+ }
+ ++lineNumber;
+ lineStart = index;
+ return;
+ }
+ }
+
+ if (extra.comments) {
+ comment = source.slice(start + offset, index);
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ addComment('Line', comment, start, index, loc);
+ }
+ }
+
+ function skipMultiLineComment() {
+ var start, loc, ch, comment;
+
+ if (extra.comments) {
+ start = index - 2;
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart - 2
+ }
+ };
+ }
+
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (isLineTerminator(ch)) {
+ if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {
+ ++index;
+ }
+ hasLineTerminator = true;
+ ++lineNumber;
+ ++index;
+ lineStart = index;
+ } else if (ch === 0x2A) {
+ // Block comment ends with '*/'.
+ if (source.charCodeAt(index + 1) === 0x2F) {
+ ++index;
+ ++index;
+ if (extra.comments) {
+ comment = source.slice(start + 2, index - 2);
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ addComment('Block', comment, start, index, loc);
+ }
+ return;
+ }
+ ++index;
+ } else {
+ ++index;
+ }
+ }
+
+ // Ran off the end of the file - the whole thing is a comment
+ if (extra.comments) {
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ comment = source.slice(start + 2, index);
+ addComment('Block', comment, start, index, loc);
+ }
+ tolerateUnexpectedToken();
+ }
+
+ function skipComment() {
+ var ch, start;
+ hasLineTerminator = false;
+
+ start = (index === 0);
+ while (index < length) {
+ ch = source.charCodeAt(index);
+
+ if (isWhiteSpace(ch)) {
+ ++index;
+ } else if (isLineTerminator(ch)) {
+ hasLineTerminator = true;
+ ++index;
+ if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {
+ ++index;
+ }
+ ++lineNumber;
+ lineStart = index;
+ start = true;
+ } else if (ch === 0x2F) { // U+002F is '/'
+ ch = source.charCodeAt(index + 1);
+ if (ch === 0x2F) {
+ ++index;
+ ++index;
+ skipSingleLineComment(2);
+ start = true;
+ } else if (ch === 0x2A) { // U+002A is '*'
+ ++index;
+ ++index;
+ skipMultiLineComment();
+ } else {
+ break;
+ }
+ } else if (start && ch === 0x2D) { // U+002D is '-'
+ // U+003E is '>'
+ if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {
+ // '-->' is a single-line comment
+ index += 3;
+ skipSingleLineComment(3);
+ } else {
+ break;
+ }
+ } else if (ch === 0x3C) { // U+003C is '<'
+ if (source.slice(index + 1, index + 4) === '!--') {
+ ++index; // `<`
+ ++index; // `!`
+ ++index; // `-`
+ ++index; // `-`
+ skipSingleLineComment(4);
+ } else {
+ break;
+ }
+ } else {
+ break;
+ }
+ }
+ }
+
+ function scanHexEscape(prefix) {
+ var i, len, ch, code = 0;
+
+ len = (prefix === 'u') ? 4 : 2;
+ for (i = 0; i < len; ++i) {
+ if (index < length && isHexDigit(source[index])) {
+ ch = source[index++];
+ code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
+ } else {
+ return '';
+ }
+ }
+ return String.fromCharCode(code);
+ }
+
+ function scanUnicodeCodePointEscape() {
+ var ch, code;
+
+ ch = source[index];
+ code = 0;
+
+ // At least, one hex digit is required.
+ if (ch === '}') {
+ throwUnexpectedToken();
+ }
+
+ while (index < length) {
+ ch = source[index++];
+ if (!isHexDigit(ch)) {
+ break;
+ }
+ code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
+ }
+
+ if (code > 0x10FFFF || ch !== '}') {
+ throwUnexpectedToken();
+ }
+
+ return fromCodePoint(code);
+ }
+
+ function codePointAt(i) {
+ var cp, first, second;
+
+ cp = source.charCodeAt(i);
+ if (cp >= 0xD800 && cp <= 0xDBFF) {
+ second = source.charCodeAt(i + 1);
+ if (second >= 0xDC00 && second <= 0xDFFF) {
+ first = cp;
+ cp = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
+ }
+ }
+
+ return cp;
+ }
+
+ function getComplexIdentifier() {
+ var cp, ch, id;
+
+ cp = codePointAt(index);
+ id = fromCodePoint(cp);
+ index += id.length;
+
+ // '\u' (U+005C, U+0075) denotes an escaped character.
+ if (cp === 0x5C) {
+ if (source.charCodeAt(index) !== 0x75) {
+ throwUnexpectedToken();
+ }
+ ++index;
+ if (source[index] === '{') {
+ ++index;
+ ch = scanUnicodeCodePointEscape();
+ } else {
+ ch = scanHexEscape('u');
+ cp = ch.charCodeAt(0);
+ if (!ch || ch === '\\' || !isIdentifierStart(cp)) {
+ throwUnexpectedToken();
+ }
+ }
+ id = ch;
+ }
+
+ while (index < length) {
+ cp = codePointAt(index);
+ if (!isIdentifierPart(cp)) {
+ break;
+ }
+ ch = fromCodePoint(cp);
+ id += ch;
+ index += ch.length;
+
+ // '\u' (U+005C, U+0075) denotes an escaped character.
+ if (cp === 0x5C) {
+ id = id.substr(0, id.length - 1);
+ if (source.charCodeAt(index) !== 0x75) {
+ throwUnexpectedToken();
+ }
+ ++index;
+ if (source[index] === '{') {
+ ++index;
+ ch = scanUnicodeCodePointEscape();
+ } else {
+ ch = scanHexEscape('u');
+ cp = ch.charCodeAt(0);
+ if (!ch || ch === '\\' || !isIdentifierPart(cp)) {
+ throwUnexpectedToken();
+ }
+ }
+ id += ch;
+ }
+ }
+
+ return id;
+ }
+
+ function getIdentifier() {
+ var start, ch;
+
+ start = index++;
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (ch === 0x5C) {
+ // Blackslash (U+005C) marks Unicode escape sequence.
+ index = start;
+ return getComplexIdentifier();
+ } else if (ch >= 0xD800 && ch < 0xDFFF) {
+ // Need to handle surrogate pairs.
+ index = start;
+ return getComplexIdentifier();
+ }
+ if (isIdentifierPart(ch)) {
+ ++index;
+ } else {
+ break;
+ }
+ }
+
+ return source.slice(start, index);
+ }
+
+ function scanIdentifier() {
+ var start, id, type;
+
+ start = index;
+
+ // Backslash (U+005C) starts an escaped character.
+ id = (source.charCodeAt(index) === 0x5C) ? getComplexIdentifier() : getIdentifier();
+
+ // There is no keyword or literal with only one character.
+ // Thus, it must be an identifier.
+ if (id.length === 1) {
+ type = Token.Identifier;
+ } else if (isKeyword(id)) {
+ type = Token.Keyword;
+ } else if (id === 'null') {
+ type = Token.NullLiteral;
+ } else if (id === 'true' || id === 'false') {
+ type = Token.BooleanLiteral;
+ } else {
+ type = Token.Identifier;
+ }
+
+ return {
+ type: type,
+ value: id,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+
+ // ECMA-262 11.7 Punctuators
+
+ function scanPunctuator() {
+ var token, str;
+
+ token = {
+ type: Token.Punctuator,
+ value: '',
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: index,
+ end: index
+ };
+
+ // Check for most common single-character punctuators.
+ str = source[index];
+ switch (str) {
+
+ case '(':
+ if (extra.tokenize) {
+ extra.openParenToken = extra.tokenValues.length;
+ }
+ ++index;
+ break;
+
+ case '{':
+ if (extra.tokenize) {
+ extra.openCurlyToken = extra.tokenValues.length;
+ }
+ state.curlyStack.push('{');
+ ++index;
+ break;
+
+ case '.':
+ ++index;
+ if (source[index] === '.' && source[index + 1] === '.') {
+ // Spread operator: ...
+ index += 2;
+ str = '...';
+ }
+ break;
+
+ case '}':
+ ++index;
+ state.curlyStack.pop();
+ break;
+ case ')':
+ case ';':
+ case ',':
+ case '[':
+ case ']':
+ case ':':
+ case '?':
+ case '~':
+ ++index;
+ break;
+
+ default:
+ // 4-character punctuator.
+ str = source.substr(index, 4);
+ if (str === '>>>=') {
+ index += 4;
+ } else {
+
+ // 3-character punctuators.
+ str = str.substr(0, 3);
+ if (str === '===' || str === '!==' || str === '>>>' ||
+ str === '<<=' || str === '>>=') {
+ index += 3;
+ } else {
+
+ // 2-character punctuators.
+ str = str.substr(0, 2);
+ if (str === '&&' || str === '||' || str === '==' || str === '!=' ||
+ str === '+=' || str === '-=' || str === '*=' || str === '/=' ||
+ str === '++' || str === '--' || str === '<<' || str === '>>' ||
+ str === '&=' || str === '|=' || str === '^=' || str === '%=' ||
+ str === '<=' || str === '>=' || str === '=>') {
+ index += 2;
+ } else {
+
+ // 1-character punctuators.
+ str = source[index];
+ if ('<>=!+-*%&|^/'.indexOf(str) >= 0) {
+ ++index;
+ }
+ }
+ }
+ }
+ }
+
+ if (index === token.start) {
+ throwUnexpectedToken();
+ }
+
+ token.end = index;
+ token.value = str;
+ return token;
+ }
+
+ // ECMA-262 11.8.3 Numeric Literals
+
+ function scanHexLiteral(start) {
+ var number = '';
+
+ while (index < length) {
+ if (!isHexDigit(source[index])) {
+ break;
+ }
+ number += source[index++];
+ }
+
+ if (number.length === 0) {
+ throwUnexpectedToken();
+ }
+
+ if (isIdentifierStart(source.charCodeAt(index))) {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseInt('0x' + number, 16),
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function scanBinaryLiteral(start) {
+ var ch, number;
+
+ number = '';
+
+ while (index < length) {
+ ch = source[index];
+ if (ch !== '0' && ch !== '1') {
+ break;
+ }
+ number += source[index++];
+ }
+
+ if (number.length === 0) {
+ // only 0b or 0B
+ throwUnexpectedToken();
+ }
+
+ if (index < length) {
+ ch = source.charCodeAt(index);
+ /* istanbul ignore else */
+ if (isIdentifierStart(ch) || isDecimalDigit(ch)) {
+ throwUnexpectedToken();
+ }
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseInt(number, 2),
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function scanOctalLiteral(prefix, start) {
+ var number, octal;
+
+ if (isOctalDigit(prefix)) {
+ octal = true;
+ number = '0' + source[index++];
+ } else {
+ octal = false;
+ ++index;
+ number = '';
+ }
+
+ while (index < length) {
+ if (!isOctalDigit(source[index])) {
+ break;
+ }
+ number += source[index++];
+ }
+
+ if (!octal && number.length === 0) {
+ // only 0o or 0O
+ throwUnexpectedToken();
+ }
+
+ if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseInt(number, 8),
+ octal: octal,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function isImplicitOctalLiteral() {
+ var i, ch;
+
+ // Implicit octal, unless there is a non-octal digit.
+ // (Annex B.1.1 on Numeric Literals)
+ for (i = index + 1; i < length; ++i) {
+ ch = source[i];
+ if (ch === '8' || ch === '9') {
+ return false;
+ }
+ if (!isOctalDigit(ch)) {
+ return true;
+ }
+ }
+
+ return true;
+ }
+
+ function scanNumericLiteral() {
+ var number, start, ch;
+
+ ch = source[index];
+ assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),
+ 'Numeric literal must start with a decimal digit or a decimal point');
+
+ start = index;
+ number = '';
+ if (ch !== '.') {
+ number = source[index++];
+ ch = source[index];
+
+ // Hex number starts with '0x'.
+ // Octal number starts with '0'.
+ // Octal number in ES6 starts with '0o'.
+ // Binary number in ES6 starts with '0b'.
+ if (number === '0') {
+ if (ch === 'x' || ch === 'X') {
+ ++index;
+ return scanHexLiteral(start);
+ }
+ if (ch === 'b' || ch === 'B') {
+ ++index;
+ return scanBinaryLiteral(start);
+ }
+ if (ch === 'o' || ch === 'O') {
+ return scanOctalLiteral(ch, start);
+ }
+
+ if (isOctalDigit(ch)) {
+ if (isImplicitOctalLiteral()) {
+ return scanOctalLiteral(ch, start);
+ }
+ }
+ }
+
+ while (isDecimalDigit(source.charCodeAt(index))) {
+ number += source[index++];
+ }
+ ch = source[index];
+ }
+
+ if (ch === '.') {
+ number += source[index++];
+ while (isDecimalDigit(source.charCodeAt(index))) {
+ number += source[index++];
+ }
+ ch = source[index];
+ }
+
+ if (ch === 'e' || ch === 'E') {
+ number += source[index++];
+
+ ch = source[index];
+ if (ch === '+' || ch === '-') {
+ number += source[index++];
+ }
+ if (isDecimalDigit(source.charCodeAt(index))) {
+ while (isDecimalDigit(source.charCodeAt(index))) {
+ number += source[index++];
+ }
+ } else {
+ throwUnexpectedToken();
+ }
+ }
+
+ if (isIdentifierStart(source.charCodeAt(index))) {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseFloat(number),
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ // ECMA-262 11.8.4 String Literals
+
+ function scanStringLiteral() {
+ var str = '', quote, start, ch, unescaped, octToDec, octal = false;
+
+ quote = source[index];
+ assert((quote === '\'' || quote === '"'),
+ 'String literal must starts with a quote');
+
+ start = index;
+ ++index;
+
+ while (index < length) {
+ ch = source[index++];
+
+ if (ch === quote) {
+ quote = '';
+ break;
+ } else if (ch === '\\') {
+ ch = source[index++];
+ if (!ch || !isLineTerminator(ch.charCodeAt(0))) {
+ switch (ch) {
+ case 'u':
+ case 'x':
+ if (source[index] === '{') {
+ ++index;
+ str += scanUnicodeCodePointEscape();
+ } else {
+ unescaped = scanHexEscape(ch);
+ if (!unescaped) {
+ throw throwUnexpectedToken();
+ }
+ str += unescaped;
+ }
+ break;
+ case 'n':
+ str += '\n';
+ break;
+ case 'r':
+ str += '\r';
+ break;
+ case 't':
+ str += '\t';
+ break;
+ case 'b':
+ str += '\b';
+ break;
+ case 'f':
+ str += '\f';
+ break;
+ case 'v':
+ str += '\x0B';
+ break;
+ case '8':
+ case '9':
+ str += ch;
+ tolerateUnexpectedToken();
+ break;
+
+ default:
+ if (isOctalDigit(ch)) {
+ octToDec = octalToDecimal(ch);
+
+ octal = octToDec.octal || octal;
+ str += String.fromCharCode(octToDec.code);
+ } else {
+ str += ch;
+ }
+ break;
+ }
+ } else {
+ ++lineNumber;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
+ }
+ lineStart = index;
+ }
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
+ break;
+ } else {
+ str += ch;
+ }
+ }
+
+ if (quote !== '') {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.StringLiteral,
+ value: str,
+ octal: octal,
+ lineNumber: startLineNumber,
+ lineStart: startLineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ // ECMA-262 11.8.6 Template Literal Lexical Components
+
+ function scanTemplate() {
+ var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;
+
+ terminated = false;
+ tail = false;
+ start = index;
+ head = (source[index] === '`');
+ rawOffset = 2;
+
+ ++index;
+
+ while (index < length) {
+ ch = source[index++];
+ if (ch === '`') {
+ rawOffset = 1;
+ tail = true;
+ terminated = true;
+ break;
+ } else if (ch === '$') {
+ if (source[index] === '{') {
+ state.curlyStack.push('${');
+ ++index;
+ terminated = true;
+ break;
+ }
+ cooked += ch;
+ } else if (ch === '\\') {
+ ch = source[index++];
+ if (!isLineTerminator(ch.charCodeAt(0))) {
+ switch (ch) {
+ case 'n':
+ cooked += '\n';
+ break;
+ case 'r':
+ cooked += '\r';
+ break;
+ case 't':
+ cooked += '\t';
+ break;
+ case 'u':
+ case 'x':
+ if (source[index] === '{') {
+ ++index;
+ cooked += scanUnicodeCodePointEscape();
+ } else {
+ restore = index;
+ unescaped = scanHexEscape(ch);
+ if (unescaped) {
+ cooked += unescaped;
+ } else {
+ index = restore;
+ cooked += ch;
+ }
+ }
+ break;
+ case 'b':
+ cooked += '\b';
+ break;
+ case 'f':
+ cooked += '\f';
+ break;
+ case 'v':
+ cooked += '\v';
+ break;
+
+ default:
+ if (ch === '0') {
+ if (isDecimalDigit(source.charCodeAt(index))) {
+ // Illegal: \01 \02 and so on
+ throwError(Messages.TemplateOctalLiteral);
+ }
+ cooked += '\0';
+ } else if (isOctalDigit(ch)) {
+ // Illegal: \1 \2
+ throwError(Messages.TemplateOctalLiteral);
+ } else {
+ cooked += ch;
+ }
+ break;
+ }
+ } else {
+ ++lineNumber;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
+ }
+ lineStart = index;
+ }
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
+ ++lineNumber;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
+ }
+ lineStart = index;
+ cooked += '\n';
+ } else {
+ cooked += ch;
+ }
+ }
+
+ if (!terminated) {
+ throwUnexpectedToken();
+ }
+
+ if (!head) {
+ state.curlyStack.pop();
+ }
+
+ return {
+ type: Token.Template,
+ value: {
+ cooked: cooked,
+ raw: source.slice(start + 1, index - rawOffset)
+ },
+ head: head,
+ tail: tail,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ // ECMA-262 11.8.5 Regular Expression Literals
+
+ function testRegExp(pattern, flags) {
+ // The BMP character to use as a replacement for astral symbols when
+ // translating an ES6 "u"-flagged pattern to an ES5-compatible
+ // approximation.
+ // Note: replacing with '\uFFFF' enables false positives in unlikely
+ // scenarios. For example, `[\u{1044f}-\u{10440}]` is an invalid
+ // pattern that would not be detected by this substitution.
+ var astralSubstitute = '\uFFFF',
+ tmp = pattern;
+
+ if (flags.indexOf('u') >= 0) {
+ tmp = tmp
+ // Replace every Unicode escape sequence with the equivalent
+ // BMP character or a constant ASCII code point in the case of
+ // astral symbols. (See the above note on `astralSubstitute`
+ // for more information.)
+ .replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {
+ var codePoint = parseInt($1 || $2, 16);
+ if (codePoint > 0x10FFFF) {
+ throwUnexpectedToken(null, Messages.InvalidRegExp);
+ }
+ if (codePoint <= 0xFFFF) {
+ return String.fromCharCode(codePoint);
+ }
+ return astralSubstitute;
+ })
+ // Replace each paired surrogate with a single ASCII symbol to
+ // avoid throwing on regular expressions that are only valid in
+ // combination with the "u" flag.
+ .replace(
+ /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
+ astralSubstitute
+ );
+ }
+
+ // First, detect invalid regular expressions.
+ try {
+ RegExp(tmp);
+ } catch (e) {
+ throwUnexpectedToken(null, Messages.InvalidRegExp);
+ }
+
+ // Return a regular expression object for this pattern-flag pair, or
+ // `null` in case the current environment doesn't support the flags it
+ // uses.
+ try {
+ return new RegExp(pattern, flags);
+ } catch (exception) {
+ return null;
+ }
+ }
+
+ function scanRegExpBody() {
+ var ch, str, classMarker, terminated, body;
+
+ ch = source[index];
+ assert(ch === '/', 'Regular expression literal must start with a slash');
+ str = source[index++];
+
+ classMarker = false;
+ terminated = false;
+ while (index < length) {
+ ch = source[index++];
+ str += ch;
+ if (ch === '\\') {
+ ch = source[index++];
+ // ECMA-262 7.8.5
+ if (isLineTerminator(ch.charCodeAt(0))) {
+ throwUnexpectedToken(null, Messages.UnterminatedRegExp);
+ }
+ str += ch;
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
+ throwUnexpectedToken(null, Messages.UnterminatedRegExp);
+ } else if (classMarker) {
+ if (ch === ']') {
+ classMarker = false;
+ }
+ } else {
+ if (ch === '/') {
+ terminated = true;
+ break;
+ } else if (ch === '[') {
+ classMarker = true;
+ }
+ }
+ }
+
+ if (!terminated) {
+ throwUnexpectedToken(null, Messages.UnterminatedRegExp);
+ }
+
+ // Exclude leading and trailing slash.
+ body = str.substr(1, str.length - 2);
+ return {
+ value: body,
+ literal: str
+ };
+ }
+
+ function scanRegExpFlags() {
+ var ch, str, flags, restore;
+
+ str = '';
+ flags = '';
+ while (index < length) {
+ ch = source[index];
+ if (!isIdentifierPart(ch.charCodeAt(0))) {
+ break;
+ }
+
+ ++index;
+ if (ch === '\\' && index < length) {
+ ch = source[index];
+ if (ch === 'u') {
+ ++index;
+ restore = index;
+ ch = scanHexEscape('u');
+ if (ch) {
+ flags += ch;
+ for (str += '\\u'; restore < index; ++restore) {
+ str += source[restore];
+ }
+ } else {
+ index = restore;
+ flags += 'u';
+ str += '\\u';
+ }
+ tolerateUnexpectedToken();
+ } else {
+ str += '\\';
+ tolerateUnexpectedToken();
+ }
+ } else {
+ flags += ch;
+ str += ch;
+ }
+ }
+
+ return {
+ value: flags,
+ literal: str
+ };
+ }
+
+ function scanRegExp() {
+ var start, body, flags, value;
+ scanning = true;
+
+ lookahead = null;
+ skipComment();
+ start = index;
+
+ body = scanRegExpBody();
+ flags = scanRegExpFlags();
+ value = testRegExp(body.value, flags.value);
+ scanning = false;
+ if (extra.tokenize) {
+ return {
+ type: Token.RegularExpression,
+ value: value,
+ regex: {
+ pattern: body.value,
+ flags: flags.value
+ },
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ return {
+ literal: body.literal + flags.literal,
+ value: value,
+ regex: {
+ pattern: body.value,
+ flags: flags.value
+ },
+ start: start,
+ end: index
+ };
+ }
+
+ function collectRegex() {
+ var pos, loc, regex, token;
+
+ skipComment();
+
+ pos = index;
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart
+ }
+ };
+
+ regex = scanRegExp();
+
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+
+ /* istanbul ignore next */
+ if (!extra.tokenize) {
+ // Pop the previous token, which is likely '/' or '/='
+ if (extra.tokens.length > 0) {
+ token = extra.tokens[extra.tokens.length - 1];
+ if (token.range[0] === pos && token.type === 'Punctuator') {
+ if (token.value === '/' || token.value === '/=') {
+ extra.tokens.pop();
+ }
+ }
+ }
+
+ extra.tokens.push({
+ type: 'RegularExpression',
+ value: regex.literal,
+ regex: regex.regex,
+ range: [pos, index],
+ loc: loc
+ });
+ }
+
+ return regex;
+ }
+
+ function isIdentifierName(token) {
+ return token.type === Token.Identifier ||
+ token.type === Token.Keyword ||
+ token.type === Token.BooleanLiteral ||
+ token.type === Token.NullLiteral;
+ }
+
+ // Using the following algorithm:
+ // https://github.com/mozilla/sweet.js/wiki/design
+
+ function advanceSlash() {
+ var regex, previous, check;
+
+ function testKeyword(value) {
+ return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z');
+ }
+
+ previous = extra.tokenValues[extra.tokens.length - 1];
+ regex = (previous !== null);
+
+ switch (previous) {
+ case 'this':
+ case ']':
+ regex = false;
+ break;
+
+ case ')':
+ check = extra.tokenValues[extra.openParenToken - 1];
+ regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with');
+ break;
+
+ case '}':
+ // Dividing a function by anything makes little sense,
+ // but we have to check for that.
+ regex = false;
+ if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) {
+ // Anonymous function, e.g. function(){} /42
+ check = extra.tokenValues[extra.openCurlyToken - 4];
+ regex = check ? (FnExprTokens.indexOf(check) < 0) : false;
+ } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) {
+ // Named function, e.g. function f(){} /42/
+ check = extra.tokenValues[extra.openCurlyToken - 5];
+ regex = check ? (FnExprTokens.indexOf(check) < 0) : true;
+ }
+ }
+
+ return regex ? collectRegex() : scanPunctuator();
+ }
+
+ function advance() {
+ var cp, token;
+
+ if (index >= length) {
+ return {
+ type: Token.EOF,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: index,
+ end: index
+ };
+ }
+
+ cp = source.charCodeAt(index);
+
+ if (isIdentifierStart(cp)) {
+ token = scanIdentifier();
+ if (strict && isStrictModeReservedWord(token.value)) {
+ token.type = Token.Keyword;
+ }
+ return token;
+ }
+
+ // Very common: ( and ) and ;
+ if (cp === 0x28 || cp === 0x29 || cp === 0x3B) {
+ return scanPunctuator();
+ }
+
+ // String literal starts with single quote (U+0027) or double quote (U+0022).
+ if (cp === 0x27 || cp === 0x22) {
+ return scanStringLiteral();
+ }
+
+ // Dot (.) U+002E can also start a floating-point number, hence the need
+ // to check the next character.
+ if (cp === 0x2E) {
+ if (isDecimalDigit(source.charCodeAt(index + 1))) {
+ return scanNumericLiteral();
+ }
+ return scanPunctuator();
+ }
+
+ if (isDecimalDigit(cp)) {
+ return scanNumericLiteral();
+ }
+
+ // Slash (/) U+002F can also start a regex.
+ if (extra.tokenize && cp === 0x2F) {
+ return advanceSlash();
+ }
+
+ // Template literals start with ` (U+0060) for template head
+ // or } (U+007D) for template middle or template tail.
+ if (cp === 0x60 || (cp === 0x7D && state.curlyStack[state.curlyStack.length - 1] === '${')) {
+ return scanTemplate();
+ }
+
+ // Possible identifier start in a surrogate pair.
+ if (cp >= 0xD800 && cp < 0xDFFF) {
+ cp = codePointAt(index);
+ if (isIdentifierStart(cp)) {
+ return scanIdentifier();
+ }
+ }
+
+ return scanPunctuator();
+ }
+
+ function collectToken() {
+ var loc, token, value, entry;
+
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart
+ }
+ };
+
+ token = advance();
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+
+ if (token.type !== Token.EOF) {
+ value = source.slice(token.start, token.end);
+ entry = {
+ type: TokenName[token.type],
+ value: value,
+ range: [token.start, token.end],
+ loc: loc
+ };
+ if (token.regex) {
+ entry.regex = {
+ pattern: token.regex.pattern,
+ flags: token.regex.flags
+ };
+ }
+ if (extra.tokenValues) {
+ extra.tokenValues.push((entry.type === 'Punctuator' || entry.type === 'Keyword') ? entry.value : null);
+ }
+ if (extra.tokenize) {
+ if (!extra.range) {
+ delete entry.range;
+ }
+ if (!extra.loc) {
+ delete entry.loc;
+ }
+ if (extra.delegate) {
+ entry = extra.delegate(entry);
+ }
+ }
+ extra.tokens.push(entry);
+ }
+
+ return token;
+ }
+
+ function lex() {
+ var token;
+ scanning = true;
+
+ lastIndex = index;
+ lastLineNumber = lineNumber;
+ lastLineStart = lineStart;
+
+ skipComment();
+
+ token = lookahead;
+
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+
+ lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();
+ scanning = false;
+ return token;
+ }
+
+ function peek() {
+ scanning = true;
+
+ skipComment();
+
+ lastIndex = index;
+ lastLineNumber = lineNumber;
+ lastLineStart = lineStart;
+
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+
+ lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();
+ scanning = false;
+ }
+
+ function Position() {
+ this.line = startLineNumber;
+ this.column = startIndex - startLineStart;
+ }
+
+ function SourceLocation() {
+ this.start = new Position();
+ this.end = null;
+ }
+
+ function WrappingSourceLocation(startToken) {
+ this.start = {
+ line: startToken.lineNumber,
+ column: startToken.start - startToken.lineStart
+ };
+ this.end = null;
+ }
+
+ function Node() {
+ if (extra.range) {
+ this.range = [startIndex, 0];
+ }
+ if (extra.loc) {
+ this.loc = new SourceLocation();
+ }
+ }
+
+ function WrappingNode(startToken) {
+ if (extra.range) {
+ this.range = [startToken.start, 0];
+ }
+ if (extra.loc) {
+ this.loc = new WrappingSourceLocation(startToken);
+ }
+ }
+
+ WrappingNode.prototype = Node.prototype = {
+
+ processComment: function () {
+ var lastChild,
+ innerComments,
+ leadingComments,
+ trailingComments,
+ bottomRight = extra.bottomRightStack,
+ i,
+ comment,
+ last = bottomRight[bottomRight.length - 1];
+
+ if (this.type === Syntax.Program) {
+ if (this.body.length > 0) {
+ return;
+ }
+ }
+ /**
+ * patch innnerComments for properties empty block
+ * `function a() {/** comments **\/}`
+ */
+
+ if (this.type === Syntax.BlockStatement && this.body.length === 0) {
+ innerComments = [];
+ for (i = extra.leadingComments.length - 1; i >= 0; --i) {
+ comment = extra.leadingComments[i];
+ if (this.range[1] >= comment.range[1]) {
+ innerComments.unshift(comment);
+ extra.leadingComments.splice(i, 1);
+ extra.trailingComments.splice(i, 1);
+ }
+ }
+ if (innerComments.length) {
+ this.innerComments = innerComments;
+ //bottomRight.push(this);
+ return;
+ }
+ }
+
+ if (extra.trailingComments.length > 0) {
+ trailingComments = [];
+ for (i = extra.trailingComments.length - 1; i >= 0; --i) {
+ comment = extra.trailingComments[i];
+ if (comment.range[0] >= this.range[1]) {
+ trailingComments.unshift(comment);
+ extra.trailingComments.splice(i, 1);
+ }
+ }
+ extra.trailingComments = [];
+ } else {
+ if (last && last.trailingComments && last.trailingComments[0].range[0] >= this.range[1]) {
+ trailingComments = last.trailingComments;
+ delete last.trailingComments;
+ }
+ }
+
+ // Eating the stack.
+ while (last && last.range[0] >= this.range[0]) {
+ lastChild = bottomRight.pop();
+ last = bottomRight[bottomRight.length - 1];
+ }
+
+ if (lastChild) {
+ if (lastChild.leadingComments) {
+ leadingComments = [];
+ for (i = lastChild.leadingComments.length - 1; i >= 0; --i) {
+ comment = lastChild.leadingComments[i];
+ if (comment.range[1] <= this.range[0]) {
+ leadingComments.unshift(comment);
+ lastChild.leadingComments.splice(i, 1);
+ }
+ }
+
+ if (!lastChild.leadingComments.length) {
+ lastChild.leadingComments = undefined;
+ }
+ }
+ } else if (extra.leadingComments.length > 0) {
+ leadingComments = [];
+ for (i = extra.leadingComments.length - 1; i >= 0; --i) {
+ comment = extra.leadingComments[i];
+ if (comment.range[1] <= this.range[0]) {
+ leadingComments.unshift(comment);
+ extra.leadingComments.splice(i, 1);
+ }
+ }
+ }
+
+
+ if (leadingComments && leadingComments.length > 0) {
+ this.leadingComments = leadingComments;
+ }
+ if (trailingComments && trailingComments.length > 0) {
+ this.trailingComments = trailingComments;
+ }
+
+ bottomRight.push(this);
+ },
+
+ finish: function () {
+ if (extra.range) {
+ this.range[1] = lastIndex;
+ }
+ if (extra.loc) {
+ this.loc.end = {
+ line: lastLineNumber,
+ column: lastIndex - lastLineStart
+ };
+ if (extra.source) {
+ this.loc.source = extra.source;
+ }
+ }
+
+ if (extra.attachComment) {
+ this.processComment();
+ }
+ },
+
+ finishArrayExpression: function (elements) {
+ this.type = Syntax.ArrayExpression;
+ this.elements = elements;
+ this.finish();
+ return this;
+ },
+
+ finishArrayPattern: function (elements) {
+ this.type = Syntax.ArrayPattern;
+ this.elements = elements;
+ this.finish();
+ return this;
+ },
+
+ finishArrowFunctionExpression: function (params, defaults, body, expression) {
+ this.type = Syntax.ArrowFunctionExpression;
+ this.id = null;
+ this.params = params;
+ this.defaults = defaults;
+ this.body = body;
+ this.generator = false;
+ this.expression = expression;
+ this.finish();
+ return this;
+ },
+
+ finishAssignmentExpression: function (operator, left, right) {
+ this.type = Syntax.AssignmentExpression;
+ this.operator = operator;
+ this.left = left;
+ this.right = right;
+ this.finish();
+ return this;
+ },
+
+ finishAssignmentPattern: function (left, right) {
+ this.type = Syntax.AssignmentPattern;
+ this.left = left;
+ this.right = right;
+ this.finish();
+ return this;
+ },
+
+ finishBinaryExpression: function (operator, left, right) {
+ this.type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression : Syntax.BinaryExpression;
+ this.operator = operator;
+ this.left = left;
+ this.right = right;
+ this.finish();
+ return this;
+ },
+
+ finishBlockStatement: function (body) {
+ this.type = Syntax.BlockStatement;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishBreakStatement: function (label) {
+ this.type = Syntax.BreakStatement;
+ this.label = label;
+ this.finish();
+ return this;
+ },
+
+ finishCallExpression: function (callee, args) {
+ this.type = Syntax.CallExpression;
+ this.callee = callee;
+ this.arguments = args;
+ this.finish();
+ return this;
+ },
+
+ finishCatchClause: function (param, body) {
+ this.type = Syntax.CatchClause;
+ this.param = param;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishClassBody: function (body) {
+ this.type = Syntax.ClassBody;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishClassDeclaration: function (id, superClass, body) {
+ this.type = Syntax.ClassDeclaration;
+ this.id = id;
+ this.superClass = superClass;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishClassExpression: function (id, superClass, body) {
+ this.type = Syntax.ClassExpression;
+ this.id = id;
+ this.superClass = superClass;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishConditionalExpression: function (test, consequent, alternate) {
+ this.type = Syntax.ConditionalExpression;
+ this.test = test;
+ this.consequent = consequent;
+ this.alternate = alternate;
+ this.finish();
+ return this;
+ },
+
+ finishContinueStatement: function (label) {
+ this.type = Syntax.ContinueStatement;
+ this.label = label;
+ this.finish();
+ return this;
+ },
+
+ finishDebuggerStatement: function () {
+ this.type = Syntax.DebuggerStatement;
+ this.finish();
+ return this;
+ },
+
+ finishDoWhileStatement: function (body, test) {
+ this.type = Syntax.DoWhileStatement;
+ this.body = body;
+ this.test = test;
+ this.finish();
+ return this;
+ },
+
+ finishEmptyStatement: function () {
+ this.type = Syntax.EmptyStatement;
+ this.finish();
+ return this;
+ },
+
+ finishExpressionStatement: function (expression) {
+ this.type = Syntax.ExpressionStatement;
+ this.expression = expression;
+ this.finish();
+ return this;
+ },
+
+ finishForStatement: function (init, test, update, body) {
+ this.type = Syntax.ForStatement;
+ this.init = init;
+ this.test = test;
+ this.update = update;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishForOfStatement: function (left, right, body) {
+ this.type = Syntax.ForOfStatement;
+ this.left = left;
+ this.right = right;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishForInStatement: function (left, right, body) {
+ this.type = Syntax.ForInStatement;
+ this.left = left;
+ this.right = right;
+ this.body = body;
+ this.each = false;
+ this.finish();
+ return this;
+ },
+
+ finishFunctionDeclaration: function (id, params, defaults, body, generator) {
+ this.type = Syntax.FunctionDeclaration;
+ this.id = id;
+ this.params = params;
+ this.defaults = defaults;
+ this.body = body;
+ this.generator = generator;
+ this.expression = false;
+ this.finish();
+ return this;
+ },
+
+ finishFunctionExpression: function (id, params, defaults, body, generator) {
+ this.type = Syntax.FunctionExpression;
+ this.id = id;
+ this.params = params;
+ this.defaults = defaults;
+ this.body = body;
+ this.generator = generator;
+ this.expression = false;
+ this.finish();
+ return this;
+ },
+
+ finishIdentifier: function (name) {
+ this.type = Syntax.Identifier;
+ this.name = name;
+ this.finish();
+ return this;
+ },
+
+ finishIfStatement: function (test, consequent, alternate) {
+ this.type = Syntax.IfStatement;
+ this.test = test;
+ this.consequent = consequent;
+ this.alternate = alternate;
+ this.finish();
+ return this;
+ },
+
+ finishLabeledStatement: function (label, body) {
+ this.type = Syntax.LabeledStatement;
+ this.label = label;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishLiteral: function (token) {
+ this.type = Syntax.Literal;
+ this.value = token.value;
+ this.raw = source.slice(token.start, token.end);
+ if (token.regex) {
+ this.regex = token.regex;
+ }
+ this.finish();
+ return this;
+ },
+
+ finishMemberExpression: function (accessor, object, property) {
+ this.type = Syntax.MemberExpression;
+ this.computed = accessor === '[';
+ this.object = object;
+ this.property = property;
+ this.finish();
+ return this;
+ },
+
+ finishMetaProperty: function (meta, property) {
+ this.type = Syntax.MetaProperty;
+ this.meta = meta;
+ this.property = property;
+ this.finish();
+ return this;
+ },
+
+ finishNewExpression: function (callee, args) {
+ this.type = Syntax.NewExpression;
+ this.callee = callee;
+ this.arguments = args;
+ this.finish();
+ return this;
+ },
+
+ finishObjectExpression: function (properties) {
+ this.type = Syntax.ObjectExpression;
+ this.properties = properties;
+ this.finish();
+ return this;
+ },
+
+ finishObjectPattern: function (properties) {
+ this.type = Syntax.ObjectPattern;
+ this.properties = properties;
+ this.finish();
+ return this;
+ },
+
+ finishPostfixExpression: function (operator, argument) {
+ this.type = Syntax.UpdateExpression;
+ this.operator = operator;
+ this.argument = argument;
+ this.prefix = false;
+ this.finish();
+ return this;
+ },
+
+ finishProgram: function (body, sourceType) {
+ this.type = Syntax.Program;
+ this.body = body;
+ this.sourceType = sourceType;
+ this.finish();
+ return this;
+ },
+
+ finishProperty: function (kind, key, computed, value, method, shorthand) {
+ this.type = Syntax.Property;
+ this.key = key;
+ this.computed = computed;
+ this.value = value;
+ this.kind = kind;
+ this.method = method;
+ this.shorthand = shorthand;
+ this.finish();
+ return this;
+ },
+
+ finishRestElement: function (argument) {
+ this.type = Syntax.RestElement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishReturnStatement: function (argument) {
+ this.type = Syntax.ReturnStatement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishSequenceExpression: function (expressions) {
+ this.type = Syntax.SequenceExpression;
+ this.expressions = expressions;
+ this.finish();
+ return this;
+ },
+
+ finishSpreadElement: function (argument) {
+ this.type = Syntax.SpreadElement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishSwitchCase: function (test, consequent) {
+ this.type = Syntax.SwitchCase;
+ this.test = test;
+ this.consequent = consequent;
+ this.finish();
+ return this;
+ },
+
+ finishSuper: function () {
+ this.type = Syntax.Super;
+ this.finish();
+ return this;
+ },
+
+ finishSwitchStatement: function (discriminant, cases) {
+ this.type = Syntax.SwitchStatement;
+ this.discriminant = discriminant;
+ this.cases = cases;
+ this.finish();
+ return this;
+ },
+
+ finishTaggedTemplateExpression: function (tag, quasi) {
+ this.type = Syntax.TaggedTemplateExpression;
+ this.tag = tag;
+ this.quasi = quasi;
+ this.finish();
+ return this;
+ },
+
+ finishTemplateElement: function (value, tail) {
+ this.type = Syntax.TemplateElement;
+ this.value = value;
+ this.tail = tail;
+ this.finish();
+ return this;
+ },
+
+ finishTemplateLiteral: function (quasis, expressions) {
+ this.type = Syntax.TemplateLiteral;
+ this.quasis = quasis;
+ this.expressions = expressions;
+ this.finish();
+ return this;
+ },
+
+ finishThisExpression: function () {
+ this.type = Syntax.ThisExpression;
+ this.finish();
+ return this;
+ },
+
+ finishThrowStatement: function (argument) {
+ this.type = Syntax.ThrowStatement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishTryStatement: function (block, handler, finalizer) {
+ this.type = Syntax.TryStatement;
+ this.block = block;
+ this.guardedHandlers = [];
+ this.handlers = handler ? [handler] : [];
+ this.handler = handler;
+ this.finalizer = finalizer;
+ this.finish();
+ return this;
+ },
+
+ finishUnaryExpression: function (operator, argument) {
+ this.type = (operator === '++' || operator === '--') ? Syntax.UpdateExpression : Syntax.UnaryExpression;
+ this.operator = operator;
+ this.argument = argument;
+ this.prefix = true;
+ this.finish();
+ return this;
+ },
+
+ finishVariableDeclaration: function (declarations) {
+ this.type = Syntax.VariableDeclaration;
+ this.declarations = declarations;
+ this.kind = 'var';
+ this.finish();
+ return this;
+ },
+
+ finishLexicalDeclaration: function (declarations, kind) {
+ this.type = Syntax.VariableDeclaration;
+ this.declarations = declarations;
+ this.kind = kind;
+ this.finish();
+ return this;
+ },
+
+ finishVariableDeclarator: function (id, init) {
+ this.type = Syntax.VariableDeclarator;
+ this.id = id;
+ this.init = init;
+ this.finish();
+ return this;
+ },
+
+ finishWhileStatement: function (test, body) {
+ this.type = Syntax.WhileStatement;
+ this.test = test;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishWithStatement: function (object, body) {
+ this.type = Syntax.WithStatement;
+ this.object = object;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishExportSpecifier: function (local, exported) {
+ this.type = Syntax.ExportSpecifier;
+ this.exported = exported || local;
+ this.local = local;
+ this.finish();
+ return this;
+ },
+
+ finishImportDefaultSpecifier: function (local) {
+ this.type = Syntax.ImportDefaultSpecifier;
+ this.local = local;
+ this.finish();
+ return this;
+ },
+
+ finishImportNamespaceSpecifier: function (local) {
+ this.type = Syntax.ImportNamespaceSpecifier;
+ this.local = local;
+ this.finish();
+ return this;
+ },
+
+ finishExportNamedDeclaration: function (declaration, specifiers, src) {
+ this.type = Syntax.ExportNamedDeclaration;
+ this.declaration = declaration;
+ this.specifiers = specifiers;
+ this.source = src;
+ this.finish();
+ return this;
+ },
+
+ finishExportDefaultDeclaration: function (declaration) {
+ this.type = Syntax.ExportDefaultDeclaration;
+ this.declaration = declaration;
+ this.finish();
+ return this;
+ },
+
+ finishExportAllDeclaration: function (src) {
+ this.type = Syntax.ExportAllDeclaration;
+ this.source = src;
+ this.finish();
+ return this;
+ },
+
+ finishImportSpecifier: function (local, imported) {
+ this.type = Syntax.ImportSpecifier;
+ this.local = local || imported;
+ this.imported = imported;
+ this.finish();
+ return this;
+ },
+
+ finishImportDeclaration: function (specifiers, src) {
+ this.type = Syntax.ImportDeclaration;
+ this.specifiers = specifiers;
+ this.source = src;
+ this.finish();
+ return this;
+ },
+
+ finishYieldExpression: function (argument, delegate) {
+ this.type = Syntax.YieldExpression;
+ this.argument = argument;
+ this.delegate = delegate;
+ this.finish();
+ return this;
+ }
+ };
+
+
+ function recordError(error) {
+ var e, existing;
+
+ for (e = 0; e < extra.errors.length; e++) {
+ existing = extra.errors[e];
+ // Prevent duplicated error.
+ /* istanbul ignore next */
+ if (existing.index === error.index && existing.message === error.message) {
+ return;
+ }
+ }
+
+ extra.errors.push(error);
+ }
+
+ function constructError(msg, column) {
+ var error = new Error(msg);
+ try {
+ throw error;
+ } catch (base) {
+ /* istanbul ignore else */
+ if (Object.create && Object.defineProperty) {
+ error = Object.create(base);
+ Object.defineProperty(error, 'column', { value: column });
+ }
+ } finally {
+ return error;
+ }
+ }
+
+ function createError(line, pos, description) {
+ var msg, column, error;
+
+ msg = 'Line ' + line + ': ' + description;
+ column = pos - (scanning ? lineStart : lastLineStart) + 1;
+ error = constructError(msg, column);
+ error.lineNumber = line;
+ error.description = description;
+ error.index = pos;
+ return error;
+ }
+
+ // Throw an exception
+
+ function throwError(messageFormat) {
+ var args, msg;
+
+ args = Array.prototype.slice.call(arguments, 1);
+ msg = messageFormat.replace(/%(\d)/g,
+ function (whole, idx) {
+ assert(idx < args.length, 'Message reference must be in range');
+ return args[idx];
+ }
+ );
+
+ throw createError(lastLineNumber, lastIndex, msg);
+ }
+
+ function tolerateError(messageFormat) {
+ var args, msg, error;
+
+ args = Array.prototype.slice.call(arguments, 1);
+ /* istanbul ignore next */
+ msg = messageFormat.replace(/%(\d)/g,
+ function (whole, idx) {
+ assert(idx < args.length, 'Message reference must be in range');
+ return args[idx];
+ }
+ );
+
+ error = createError(lineNumber, lastIndex, msg);
+ if (extra.errors) {
+ recordError(error);
+ } else {
+ throw error;
+ }
+ }
+
+ // Throw an exception because of the token.
+
+ function unexpectedTokenError(token, message) {
+ var value, msg = message || Messages.UnexpectedToken;
+
+ if (token) {
+ if (!message) {
+ msg = (token.type === Token.EOF) ? Messages.UnexpectedEOS :
+ (token.type === Token.Identifier) ? Messages.UnexpectedIdentifier :
+ (token.type === Token.NumericLiteral) ? Messages.UnexpectedNumber :
+ (token.type === Token.StringLiteral) ? Messages.UnexpectedString :
+ (token.type === Token.Template) ? Messages.UnexpectedTemplate :
+ Messages.UnexpectedToken;
+
+ if (token.type === Token.Keyword) {
+ if (isFutureReservedWord(token.value)) {
+ msg = Messages.UnexpectedReserved;
+ } else if (strict && isStrictModeReservedWord(token.value)) {
+ msg = Messages.StrictReservedWord;
+ }
+ }
+ }
+
+ value = (token.type === Token.Template) ? token.value.raw : token.value;
+ } else {
+ value = 'ILLEGAL';
+ }
+
+ msg = msg.replace('%0', value);
+
+ return (token && typeof token.lineNumber === 'number') ?
+ createError(token.lineNumber, token.start, msg) :
+ createError(scanning ? lineNumber : lastLineNumber, scanning ? index : lastIndex, msg);
+ }
+
+ function throwUnexpectedToken(token, message) {
+ throw unexpectedTokenError(token, message);
+ }
+
+ function tolerateUnexpectedToken(token, message) {
+ var error = unexpectedTokenError(token, message);
+ if (extra.errors) {
+ recordError(error);
+ } else {
+ throw error;
+ }
+ }
+
+ // Expect the next token to match the specified punctuator.
+ // If not, an exception will be thrown.
+
+ function expect(value) {
+ var token = lex();
+ if (token.type !== Token.Punctuator || token.value !== value) {
+ throwUnexpectedToken(token);
+ }
+ }
+
+ /**
+ * @name expectCommaSeparator
+ * @description Quietly expect a comma when in tolerant mode, otherwise delegates
+ * to <code>expect(value)</code>
+ * @since 2.0
+ */
+ function expectCommaSeparator() {
+ var token;
+
+ if (extra.errors) {
+ token = lookahead;
+ if (token.type === Token.Punctuator && token.value === ',') {
+ lex();
+ } else if (token.type === Token.Punctuator && token.value === ';') {
+ lex();
+ tolerateUnexpectedToken(token);
+ } else {
+ tolerateUnexpectedToken(token, Messages.UnexpectedToken);
+ }
+ } else {
+ expect(',');
+ }
+ }
+
+ // Expect the next token to match the specified keyword.
+ // If not, an exception will be thrown.
+
+ function expectKeyword(keyword) {
+ var token = lex();
+ if (token.type !== Token.Keyword || token.value !== keyword) {
+ throwUnexpectedToken(token);
+ }
+ }
+
+ // Return true if the next token matches the specified punctuator.
+
+ function match(value) {
+ return lookahead.type === Token.Punctuator && lookahead.value === value;
+ }
+
+ // Return true if the next token matches the specified keyword
+
+ function matchKeyword(keyword) {
+ return lookahead.type === Token.Keyword && lookahead.value === keyword;
+ }
+
+ // Return true if the next token matches the specified contextual keyword
+ // (where an identifier is sometimes a keyword depending on the context)
+
+ function matchContextualKeyword(keyword) {
+ return lookahead.type === Token.Identifier && lookahead.value === keyword;
+ }
+
+ // Return true if the next token is an assignment operator
+
+ function matchAssign() {
+ var op;
+
+ if (lookahead.type !== Token.Punctuator) {
+ return false;
+ }
+ op = lookahead.value;
+ return op === '=' ||
+ op === '*=' ||
+ op === '/=' ||
+ op === '%=' ||
+ op === '+=' ||
+ op === '-=' ||
+ op === '<<=' ||
+ op === '>>=' ||
+ op === '>>>=' ||
+ op === '&=' ||
+ op === '^=' ||
+ op === '|=';
+ }
+
+ function consumeSemicolon() {
+ // Catch the very common case first: immediately a semicolon (U+003B).
+ if (source.charCodeAt(startIndex) === 0x3B || match(';')) {
+ lex();
+ return;
+ }
+
+ if (hasLineTerminator) {
+ return;
+ }
+
+ // FIXME(ikarienator): this is seemingly an issue in the previous location info convention.
+ lastIndex = startIndex;
+ lastLineNumber = startLineNumber;
+ lastLineStart = startLineStart;
+
+ if (lookahead.type !== Token.EOF && !match('}')) {
+ throwUnexpectedToken(lookahead);
+ }
+ }
+
+ // Cover grammar support.
+ //
+ // When an assignment expression position starts with an left parenthesis, the determination of the type
+ // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead)
+ // or the first comma. This situation also defers the determination of all the expressions nested in the pair.
+ //
+ // There are three productions that can be parsed in a parentheses pair that needs to be determined
+ // after the outermost pair is closed. They are:
+ //
+ // 1. AssignmentExpression
+ // 2. BindingElements
+ // 3. AssignmentTargets
+ //
+ // In order to avoid exponential backtracking, we use two flags to denote if the production can be
+ // binding element or assignment target.
+ //
+ // The three productions have the relationship:
+ //
+ // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression
+ //
+ // with a single exception that CoverInitializedName when used directly in an Expression, generates
+ // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the
+ // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair.
+ //
+ // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not
+ // effect the current flags. This means the production the parser parses is only used as an expression. Therefore
+ // the CoverInitializedName check is conducted.
+ //
+ // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates
+ // the flags outside of the parser. This means the production the parser parses is used as a part of a potential
+ // pattern. The CoverInitializedName check is deferred.
+ function isolateCoverGrammar(parser) {
+ var oldIsBindingElement = isBindingElement,
+ oldIsAssignmentTarget = isAssignmentTarget,
+ oldFirstCoverInitializedNameError = firstCoverInitializedNameError,
+ result;
+ isBindingElement = true;
+ isAssignmentTarget = true;
+ firstCoverInitializedNameError = null;
+ result = parser();
+ if (firstCoverInitializedNameError !== null) {
+ throwUnexpectedToken(firstCoverInitializedNameError);
+ }
+ isBindingElement = oldIsBindingElement;
+ isAssignmentTarget = oldIsAssignmentTarget;
+ firstCoverInitializedNameError = oldFirstCoverInitializedNameError;
+ return result;
+ }
+
+ function inheritCoverGrammar(parser) {
+ var oldIsBindingElement = isBindingElement,
+ oldIsAssignmentTarget = isAssignmentTarget,
+ oldFirstCoverInitializedNameError = firstCoverInitializedNameError,
+ result;
+ isBindingElement = true;
+ isAssignmentTarget = true;
+ firstCoverInitializedNameError = null;
+ result = parser();
+ isBindingElement = isBindingElement && oldIsBindingElement;
+ isAssignmentTarget = isAssignmentTarget && oldIsAssignmentTarget;
+ firstCoverInitializedNameError = oldFirstCoverInitializedNameError || firstCoverInitializedNameError;
+ return result;
+ }
+
+ // ECMA-262 13.3.3 Destructuring Binding Patterns
+
+ function parseArrayPattern(params, kind) {
+ var node = new Node(), elements = [], rest, restNode;
+ expect('[');
+
+ while (!match(']')) {
+ if (match(',')) {
+ lex();
+ elements.push(null);
+ } else {
+ if (match('...')) {
+ restNode = new Node();
+ lex();
+ params.push(lookahead);
+ rest = parseVariableIdentifier(kind);
+ elements.push(restNode.finishRestElement(rest));
+ break;
+ } else {
+ elements.push(parsePatternWithDefault(params, kind));
+ }
+ if (!match(']')) {
+ expect(',');
+ }
+ }
+
+ }
+
+ expect(']');
+
+ return node.finishArrayPattern(elements);
+ }
+
+ function parsePropertyPattern(params, kind) {
+ var node = new Node(), key, keyToken, computed = match('['), init;
+ if (lookahead.type === Token.Identifier) {
+ keyToken = lookahead;
+ key = parseVariableIdentifier();
+ if (match('=')) {
+ params.push(keyToken);
+ lex();
+ init = parseAssignmentExpression();
+
+ return node.finishProperty(
+ 'init', key, false,
+ new WrappingNode(keyToken).finishAssignmentPattern(key, init), false, false);
+ } else if (!match(':')) {
+ params.push(keyToken);
+ return node.finishProperty('init', key, false, key, false, true);
+ }
+ } else {
+ key = parseObjectPropertyKey();
+ }
+ expect(':');
+ init = parsePatternWithDefault(params, kind);
+ return node.finishProperty('init', key, computed, init, false, false);
+ }
+
+ function parseObjectPattern(params, kind) {
+ var node = new Node(), properties = [];
+
+ expect('{');
+
+ while (!match('}')) {
+ properties.push(parsePropertyPattern(params, kind));
+ if (!match('}')) {
+ expect(',');
+ }
+ }
+
+ lex();
+
+ return node.finishObjectPattern(properties);
+ }
+
+ function parsePattern(params, kind) {
+ if (match('[')) {
+ return parseArrayPattern(params, kind);
+ } else if (match('{')) {
+ return parseObjectPattern(params, kind);
+ } else if (matchKeyword('let')) {
+ if (kind === 'const' || kind === 'let') {
+ tolerateUnexpectedToken(lookahead, Messages.UnexpectedToken);
+ }
+ }
+
+ params.push(lookahead);
+ return parseVariableIdentifier(kind);
+ }
+
+ function parsePatternWithDefault(params, kind) {
+ var startToken = lookahead, pattern, previousAllowYield, right;
+ pattern = parsePattern(params, kind);
+ if (match('=')) {
+ lex();
+ previousAllowYield = state.allowYield;
+ state.allowYield = true;
+ right = isolateCoverGrammar(parseAssignmentExpression);
+ state.allowYield = previousAllowYield;
+ pattern = new WrappingNode(startToken).finishAssignmentPattern(pattern, right);
+ }
+ return pattern;
+ }
+
+ // ECMA-262 12.2.5 Array Initializer
+
+ function parseArrayInitializer() {
+ var elements = [], node = new Node(), restSpread;
+
+ expect('[');
+
+ while (!match(']')) {
+ if (match(',')) {
+ lex();
+ elements.push(null);
+ } else if (match('...')) {
+ restSpread = new Node();
+ lex();
+ restSpread.finishSpreadElement(inheritCoverGrammar(parseAssignmentExpression));
+
+ if (!match(']')) {
+ isAssignmentTarget = isBindingElement = false;
+ expect(',');
+ }
+ elements.push(restSpread);
+ } else {
+ elements.push(inheritCoverGrammar(parseAssignmentExpression));
+
+ if (!match(']')) {
+ expect(',');
+ }
+ }
+ }
+
+ lex();
+
+ return node.finishArrayExpression(elements);
+ }
+
+ // ECMA-262 12.2.6 Object Initializer
+
+ function parsePropertyFunction(node, paramInfo, isGenerator) {
+ var previousStrict, body;
+
+ isAssignmentTarget = isBindingElement = false;
+
+ previousStrict = strict;
+ body = isolateCoverGrammar(parseFunctionSourceElements);
+
+ if (strict && paramInfo.firstRestricted) {
+ tolerateUnexpectedToken(paramInfo.firstRestricted, paramInfo.message);
+ }
+ if (strict && paramInfo.stricted) {
+ tolerateUnexpectedToken(paramInfo.stricted, paramInfo.message);
+ }
+
+ strict = previousStrict;
+ return node.finishFunctionExpression(null, paramInfo.params, paramInfo.defaults, body, isGenerator);
+ }
+
+ function parsePropertyMethodFunction() {
+ var params, method, node = new Node(),
+ previousAllowYield = state.allowYield;
+
+ state.allowYield = false;
+ params = parseParams();
+ state.allowYield = previousAllowYield;
+
+ state.allowYield = false;
+ method = parsePropertyFunction(node, params, false);
+ state.allowYield = previousAllowYield;
+
+ return method;
+ }
+
+ function parseObjectPropertyKey() {
+ var token, node = new Node(), expr;
+
+ token = lex();
+
+ // Note: This function is called only from parseObjectProperty(), where
+ // EOF and Punctuator tokens are already filtered out.
+
+ switch (token.type) {
+ case Token.StringLiteral:
+ case Token.NumericLiteral:
+ if (strict && token.octal) {
+ tolerateUnexpectedToken(token, Messages.StrictOctalLiteral);
+ }
+ return node.finishLiteral(token);
+ case Token.Identifier:
+ case Token.BooleanLiteral:
+ case Token.NullLiteral:
+ case Token.Keyword:
+ return node.finishIdentifier(token.value);
+ case Token.Punctuator:
+ if (token.value === '[') {
+ expr = isolateCoverGrammar(parseAssignmentExpression);
+ expect(']');
+ return expr;
+ }
+ break;
+ }
+ throwUnexpectedToken(token);
+ }
+
+ function lookaheadPropertyName() {
+ switch (lookahead.type) {
+ case Token.Identifier:
+ case Token.StringLiteral:
+ case Token.BooleanLiteral:
+ case Token.NullLiteral:
+ case Token.NumericLiteral:
+ case Token.Keyword:
+ return true;
+ case Token.Punctuator:
+ return lookahead.value === '[';
+ }
+ return false;
+ }
+
+ // This function is to try to parse a MethodDefinition as defined in 14.3. But in the case of object literals,
+ // it might be called at a position where there is in fact a short hand identifier pattern or a data property.
+ // This can only be determined after we consumed up to the left parentheses.
+ //
+ // In order to avoid back tracking, it returns `null` if the position is not a MethodDefinition and the caller
+ // is responsible to visit other options.
+ function tryParseMethodDefinition(token, key, computed, node) {
+ var value, options, methodNode, params,
+ previousAllowYield = state.allowYield;
+
+ if (token.type === Token.Identifier) {
+ // check for `get` and `set`;
+
+ if (token.value === 'get' && lookaheadPropertyName()) {
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ methodNode = new Node();
+ expect('(');
+ expect(')');
+
+ state.allowYield = false;
+ value = parsePropertyFunction(methodNode, {
+ params: [],
+ defaults: [],
+ stricted: null,
+ firstRestricted: null,
+ message: null
+ }, false);
+ state.allowYield = previousAllowYield;
+
+ return node.finishProperty('get', key, computed, value, false, false);
+ } else if (token.value === 'set' && lookaheadPropertyName()) {
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ methodNode = new Node();
+ expect('(');
+
+ options = {
+ params: [],
+ defaultCount: 0,
+ defaults: [],
+ firstRestricted: null,
+ paramSet: {}
+ };
+ if (match(')')) {
+ tolerateUnexpectedToken(lookahead);
+ } else {
+ state.allowYield = false;
+ parseParam(options);
+ state.allowYield = previousAllowYield;
+ if (options.defaultCount === 0) {
+ options.defaults = [];
+ }
+ }
+ expect(')');
+
+ state.allowYield = false;
+ value = parsePropertyFunction(methodNode, options, false);
+ state.allowYield = previousAllowYield;
+
+ return node.finishProperty('set', key, computed, value, false, false);
+ }
+ } else if (token.type === Token.Punctuator && token.value === '*' && lookaheadPropertyName()) {
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ methodNode = new Node();
+
+ state.allowYield = true;
+ params = parseParams();
+ state.allowYield = previousAllowYield;
+
+ state.allowYield = false;
+ value = parsePropertyFunction(methodNode, params, true);
+ state.allowYield = previousAllowYield;
+
+ return node.finishProperty('init', key, computed, value, true, false);
+ }
+
+ if (key && match('(')) {
+ value = parsePropertyMethodFunction();
+ return node.finishProperty('init', key, computed, value, true, false);
+ }
+
+ // Not a MethodDefinition.
+ return null;
+ }
+
+ function parseObjectProperty(hasProto) {
+ var token = lookahead, node = new Node(), computed, key, maybeMethod, proto, value;
+
+ computed = match('[');
+ if (match('*')) {
+ lex();
+ } else {
+ key = parseObjectPropertyKey();
+ }
+ maybeMethod = tryParseMethodDefinition(token, key, computed, node);
+ if (maybeMethod) {
+ return maybeMethod;
+ }
+
+ if (!key) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ // Check for duplicated __proto__
+ if (!computed) {
+ proto = (key.type === Syntax.Identifier && key.name === '__proto__') ||
+ (key.type === Syntax.Literal && key.value === '__proto__');
+ if (hasProto.value && proto) {
+ tolerateError(Messages.DuplicateProtoProperty);
+ }
+ hasProto.value |= proto;
+ }
+
+ if (match(':')) {
+ lex();
+ value = inheritCoverGrammar(parseAssignmentExpression);
+ return node.finishProperty('init', key, computed, value, false, false);
+ }
+
+ if (token.type === Token.Identifier) {
+ if (match('=')) {
+ firstCoverInitializedNameError = lookahead;
+ lex();
+ value = isolateCoverGrammar(parseAssignmentExpression);
+ return node.finishProperty('init', key, computed,
+ new WrappingNode(token).finishAssignmentPattern(key, value), false, true);
+ }
+ return node.finishProperty('init', key, computed, key, false, true);
+ }
+
+ throwUnexpectedToken(lookahead);
+ }
+
+ function parseObjectInitializer() {
+ var properties = [], hasProto = {value: false}, node = new Node();
+
+ expect('{');
+
+ while (!match('}')) {
+ properties.push(parseObjectProperty(hasProto));
+
+ if (!match('}')) {
+ expectCommaSeparator();
+ }
+ }
+
+ expect('}');
+
+ return node.finishObjectExpression(properties);
+ }
+
+ function reinterpretExpressionAsPattern(expr) {
+ var i;
+ switch (expr.type) {
+ case Syntax.Identifier:
+ case Syntax.MemberExpression:
+ case Syntax.RestElement:
+ case Syntax.AssignmentPattern:
+ break;
+ case Syntax.SpreadElement:
+ expr.type = Syntax.RestElement;
+ reinterpretExpressionAsPattern(expr.argument);
+ break;
+ case Syntax.ArrayExpression:
+ expr.type = Syntax.ArrayPattern;
+ for (i = 0; i < expr.elements.length; i++) {
+ if (expr.elements[i] !== null) {
+ reinterpretExpressionAsPattern(expr.elements[i]);
+ }
+ }
+ break;
+ case Syntax.ObjectExpression:
+ expr.type = Syntax.ObjectPattern;
+ for (i = 0; i < expr.properties.length; i++) {
+ reinterpretExpressionAsPattern(expr.properties[i].value);
+ }
+ break;
+ case Syntax.AssignmentExpression:
+ expr.type = Syntax.AssignmentPattern;
+ reinterpretExpressionAsPattern(expr.left);
+ break;
+ default:
+ // Allow other node type for tolerant parsing.
+ break;
+ }
+ }
+
+ // ECMA-262 12.2.9 Template Literals
+
+ function parseTemplateElement(option) {
+ var node, token;
+
+ if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {
+ throwUnexpectedToken();
+ }
+
+ node = new Node();
+ token = lex();
+
+ return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);
+ }
+
+ function parseTemplateLiteral() {
+ var quasi, quasis, expressions, node = new Node();
+
+ quasi = parseTemplateElement({ head: true });
+ quasis = [quasi];
+ expressions = [];
+
+ while (!quasi.tail) {
+ expressions.push(parseExpression());
+ quasi = parseTemplateElement({ head: false });
+ quasis.push(quasi);
+ }
+
+ return node.finishTemplateLiteral(quasis, expressions);
+ }
+
+ // ECMA-262 12.2.10 The Grouping Operator
+
+ function parseGroupExpression() {
+ var expr, expressions, startToken, i, params = [];
+
+ expect('(');
+
+ if (match(')')) {
+ lex();
+ if (!match('=>')) {
+ expect('=>');
+ }
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: [],
+ rawParams: []
+ };
+ }
+
+ startToken = lookahead;
+ if (match('...')) {
+ expr = parseRestElement(params);
+ expect(')');
+ if (!match('=>')) {
+ expect('=>');
+ }
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: [expr]
+ };
+ }
+
+ isBindingElement = true;
+ expr = inheritCoverGrammar(parseAssignmentExpression);
+
+ if (match(',')) {
+ isAssignmentTarget = false;
+ expressions = [expr];
+
+ while (startIndex < length) {
+ if (!match(',')) {
+ break;
+ }
+ lex();
+
+ if (match('...')) {
+ if (!isBindingElement) {
+ throwUnexpectedToken(lookahead);
+ }
+ expressions.push(parseRestElement(params));
+ expect(')');
+ if (!match('=>')) {
+ expect('=>');
+ }
+ isBindingElement = false;
+ for (i = 0; i < expressions.length; i++) {
+ reinterpretExpressionAsPattern(expressions[i]);
+ }
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: expressions
+ };
+ }
+
+ expressions.push(inheritCoverGrammar(parseAssignmentExpression));
+ }
+
+ expr = new WrappingNode(startToken).finishSequenceExpression(expressions);
+ }
+
+
+ expect(')');
+
+ if (match('=>')) {
+ if (expr.type === Syntax.Identifier && expr.name === 'yield') {
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: [expr]
+ };
+ }
+
+ if (!isBindingElement) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ if (expr.type === Syntax.SequenceExpression) {
+ for (i = 0; i < expr.expressions.length; i++) {
+ reinterpretExpressionAsPattern(expr.expressions[i]);
+ }
+ } else {
+ reinterpretExpressionAsPattern(expr);
+ }
+
+ expr = {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: expr.type === Syntax.SequenceExpression ? expr.expressions : [expr]
+ };
+ }
+ isBindingElement = false;
+ return expr;
+ }
+
+
+ // ECMA-262 12.2 Primary Expressions
+
+ function parsePrimaryExpression() {
+ var type, token, expr, node;
+
+ if (match('(')) {
+ isBindingElement = false;
+ return inheritCoverGrammar(parseGroupExpression);
+ }
+
+ if (match('[')) {
+ return inheritCoverGrammar(parseArrayInitializer);
+ }
+
+ if (match('{')) {
+ return inheritCoverGrammar(parseObjectInitializer);
+ }
+
+ type = lookahead.type;
+ node = new Node();
+
+ if (type === Token.Identifier) {
+ if (state.sourceType === 'module' && lookahead.value === 'await') {
+ tolerateUnexpectedToken(lookahead);
+ }
+ expr = node.finishIdentifier(lex().value);
+ } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {
+ isAssignmentTarget = isBindingElement = false;
+ if (strict && lookahead.octal) {
+ tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);
+ }
+ expr = node.finishLiteral(lex());
+ } else if (type === Token.Keyword) {
+ if (!strict && state.allowYield && matchKeyword('yield')) {
+ return parseNonComputedProperty();
+ }
+ if (!strict && matchKeyword('let')) {
+ return node.finishIdentifier(lex().value);
+ }
+ isAssignmentTarget = isBindingElement = false;
+ if (matchKeyword('function')) {
+ return parseFunctionExpression();
+ }
+ if (matchKeyword('this')) {
+ lex();
+ return node.finishThisExpression();
+ }
+ if (matchKeyword('class')) {
+ return parseClassExpression();
+ }
+ throwUnexpectedToken(lex());
+ } else if (type === Token.BooleanLiteral) {
+ isAssignmentTarget = isBindingElement = false;
+ token = lex();
+ token.value = (token.value === 'true');
+ expr = node.finishLiteral(token);
+ } else if (type === Token.NullLiteral) {
+ isAssignmentTarget = isBindingElement = false;
+ token = lex();
+ token.value = null;
+ expr = node.finishLiteral(token);
+ } else if (match('/') || match('/=')) {
+ isAssignmentTarget = isBindingElement = false;
+ index = startIndex;
+
+ if (typeof extra.tokens !== 'undefined') {
+ token = collectRegex();
+ } else {
+ token = scanRegExp();
+ }
+ lex();
+ expr = node.finishLiteral(token);
+ } else if (type === Token.Template) {
+ expr = parseTemplateLiteral();
+ } else {
+ throwUnexpectedToken(lex());
+ }
+
+ return expr;
+ }
+
+ // ECMA-262 12.3 Left-Hand-Side Expressions
+
+ function parseArguments() {
+ var args = [], expr;
+
+ expect('(');
+
+ if (!match(')')) {
+ while (startIndex < length) {
+ if (match('...')) {
+ expr = new Node();
+ lex();
+ expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression));
+ } else {
+ expr = isolateCoverGrammar(parseAssignmentExpression);
+ }
+ args.push(expr);
+ if (match(')')) {
+ break;
+ }
+ expectCommaSeparator();
+ }
+ }
+
+ expect(')');
+
+ return args;
+ }
+
+ function parseNonComputedProperty() {
+ var token, node = new Node();
+
+ token = lex();
+
+ if (!isIdentifierName(token)) {
+ throwUnexpectedToken(token);
+ }
+
+ return node.finishIdentifier(token.value);
+ }
+
+ function parseNonComputedMember() {
+ expect('.');
+
+ return parseNonComputedProperty();
+ }
+
+ function parseComputedMember() {
+ var expr;
+
+ expect('[');
+
+ expr = isolateCoverGrammar(parseExpression);
+
+ expect(']');
+
+ return expr;
+ }
+
+ // ECMA-262 12.3.3 The new Operator
+
+ function parseNewExpression() {
+ var callee, args, node = new Node();
+
+ expectKeyword('new');
+
+ if (match('.')) {
+ lex();
+ if (lookahead.type === Token.Identifier && lookahead.value === 'target') {
+ if (state.inFunctionBody) {
+ lex();
+ return node.finishMetaProperty('new', 'target');
+ }
+ }
+ throwUnexpectedToken(lookahead);
+ }
+
+ callee = isolateCoverGrammar(parseLeftHandSideExpression);
+ args = match('(') ? parseArguments() : [];
+
+ isAssignmentTarget = isBindingElement = false;
+
+ return node.finishNewExpression(callee, args);
+ }
+
+ // ECMA-262 12.3.4 Function Calls
+
+ function parseLeftHandSideExpressionAllowCall() {
+ var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;
+
+ startToken = lookahead;
+ state.allowIn = true;
+
+ if (matchKeyword('super') && state.inFunctionBody) {
+ expr = new Node();
+ lex();
+ expr = expr.finishSuper();
+ if (!match('(') && !match('.') && !match('[')) {
+ throwUnexpectedToken(lookahead);
+ }
+ } else {
+ expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);
+ }
+
+ for (;;) {
+ if (match('.')) {
+ isBindingElement = false;
+ isAssignmentTarget = true;
+ property = parseNonComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);
+ } else if (match('(')) {
+ isBindingElement = false;
+ isAssignmentTarget = false;
+ args = parseArguments();
+ expr = new WrappingNode(startToken).finishCallExpression(expr, args);
+ } else if (match('[')) {
+ isBindingElement = false;
+ isAssignmentTarget = true;
+ property = parseComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);
+ } else if (lookahead.type === Token.Template && lookahead.head) {
+ quasi = parseTemplateLiteral();
+ expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);
+ } else {
+ break;
+ }
+ }
+ state.allowIn = previousAllowIn;
+
+ return expr;
+ }
+
+ // ECMA-262 12.3 Left-Hand-Side Expressions
+
+ function parseLeftHandSideExpression() {
+ var quasi, expr, property, startToken;
+ assert(state.allowIn, 'callee of new expression always allow in keyword.');
+
+ startToken = lookahead;
+
+ if (matchKeyword('super') && state.inFunctionBody) {
+ expr = new Node();
+ lex();
+ expr = expr.finishSuper();
+ if (!match('[') && !match('.')) {
+ throwUnexpectedToken(lookahead);
+ }
+ } else {
+ expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);
+ }
+
+ for (;;) {
+ if (match('[')) {
+ isBindingElement = false;
+ isAssignmentTarget = true;
+ property = parseComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);
+ } else if (match('.')) {
+ isBindingElement = false;
+ isAssignmentTarget = true;
+ property = parseNonComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);
+ } else if (lookahead.type === Token.Template && lookahead.head) {
+ quasi = parseTemplateLiteral();
+ expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);
+ } else {
+ break;
+ }
+ }
+ return expr;
+ }
+
+ // ECMA-262 12.4 Postfix Expressions
+
+ function parsePostfixExpression() {
+ var expr, token, startToken = lookahead;
+
+ expr = inheritCoverGrammar(parseLeftHandSideExpressionAllowCall);
+
+ if (!hasLineTerminator && lookahead.type === Token.Punctuator) {
+ if (match('++') || match('--')) {
+ // ECMA-262 11.3.1, 11.3.2
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
+ tolerateError(Messages.StrictLHSPostfix);
+ }
+
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInAssignment);
+ }
+
+ isAssignmentTarget = isBindingElement = false;
+
+ token = lex();
+ expr = new WrappingNode(startToken).finishPostfixExpression(token.value, expr);
+ }
+ }
+
+ return expr;
+ }
+
+ // ECMA-262 12.5 Unary Operators
+
+ function parseUnaryExpression() {
+ var token, expr, startToken;
+
+ if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
+ expr = parsePostfixExpression();
+ } else if (match('++') || match('--')) {
+ startToken = lookahead;
+ token = lex();
+ expr = inheritCoverGrammar(parseUnaryExpression);
+ // ECMA-262 11.4.4, 11.4.5
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
+ tolerateError(Messages.StrictLHSPrefix);
+ }
+
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInAssignment);
+ }
+ expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr);
+ isAssignmentTarget = isBindingElement = false;
+ } else if (match('+') || match('-') || match('~') || match('!')) {
+ startToken = lookahead;
+ token = lex();
+ expr = inheritCoverGrammar(parseUnaryExpression);
+ expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr);
+ isAssignmentTarget = isBindingElement = false;
+ } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {
+ startToken = lookahead;
+ token = lex();
+ expr = inheritCoverGrammar(parseUnaryExpression);
+ expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr);
+ if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {
+ tolerateError(Messages.StrictDelete);
+ }
+ isAssignmentTarget = isBindingElement = false;
+ } else {
+ expr = parsePostfixExpression();
+ }
+
+ return expr;
+ }
+
+ function binaryPrecedence(token, allowIn) {
+ var prec = 0;
+
+ if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {
+ return 0;
+ }
+
+ switch (token.value) {
+ case '||':
+ prec = 1;
+ break;
+
+ case '&&':
+ prec = 2;
+ break;
+
+ case '|':
+ prec = 3;
+ break;
+
+ case '^':
+ prec = 4;
+ break;
+
+ case '&':
+ prec = 5;
+ break;
+
+ case '==':
+ case '!=':
+ case '===':
+ case '!==':
+ prec = 6;
+ break;
+
+ case '<':
+ case '>':
+ case '<=':
+ case '>=':
+ case 'instanceof':
+ prec = 7;
+ break;
+
+ case 'in':
+ prec = allowIn ? 7 : 0;
+ break;
+
+ case '<<':
+ case '>>':
+ case '>>>':
+ prec = 8;
+ break;
+
+ case '+':
+ case '-':
+ prec = 9;
+ break;
+
+ case '*':
+ case '/':
+ case '%':
+ prec = 11;
+ break;
+
+ default:
+ break;
+ }
+
+ return prec;
+ }
+
+ // ECMA-262 12.6 Multiplicative Operators
+ // ECMA-262 12.7 Additive Operators
+ // ECMA-262 12.8 Bitwise Shift Operators
+ // ECMA-262 12.9 Relational Operators
+ // ECMA-262 12.10 Equality Operators
+ // ECMA-262 12.11 Binary Bitwise Operators
+ // ECMA-262 12.12 Binary Logical Operators
+
+ function parseBinaryExpression() {
+ var marker, markers, expr, token, prec, stack, right, operator, left, i;
+
+ marker = lookahead;
+ left = inheritCoverGrammar(parseUnaryExpression);
+
+ token = lookahead;
+ prec = binaryPrecedence(token, state.allowIn);
+ if (prec === 0) {
+ return left;
+ }
+ isAssignmentTarget = isBindingElement = false;
+ token.prec = prec;
+ lex();
+
+ markers = [marker, lookahead];
+ right = isolateCoverGrammar(parseUnaryExpression);
+
+ stack = [left, token, right];
+
+ while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {
+
+ // Reduce: make a binary expression from the three topmost entries.
+ while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {
+ right = stack.pop();
+ operator = stack.pop().value;
+ left = stack.pop();
+ markers.pop();
+ expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);
+ stack.push(expr);
+ }
+
+ // Shift.
+ token = lex();
+ token.prec = prec;
+ stack.push(token);
+ markers.push(lookahead);
+ expr = isolateCoverGrammar(parseUnaryExpression);
+ stack.push(expr);
+ }
+
+ // Final reduce to clean-up the stack.
+ i = stack.length - 1;
+ expr = stack[i];
+ markers.pop();
+ while (i > 1) {
+ expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);
+ i -= 2;
+ }
+
+ return expr;
+ }
+
+
+ // ECMA-262 12.13 Conditional Operator
+
+ function parseConditionalExpression() {
+ var expr, previousAllowIn, consequent, alternate, startToken;
+
+ startToken = lookahead;
+
+ expr = inheritCoverGrammar(parseBinaryExpression);
+ if (match('?')) {
+ lex();
+ previousAllowIn = state.allowIn;
+ state.allowIn = true;
+ consequent = isolateCoverGrammar(parseAssignmentExpression);
+ state.allowIn = previousAllowIn;
+ expect(':');
+ alternate = isolateCoverGrammar(parseAssignmentExpression);
+
+ expr = new WrappingNode(startToken).finishConditionalExpression(expr, consequent, alternate);
+ isAssignmentTarget = isBindingElement = false;
+ }
+
+ return expr;
+ }
+
+ // ECMA-262 14.2 Arrow Function Definitions
+
+ function parseConciseBody() {
+ if (match('{')) {
+ return parseFunctionSourceElements();
+ }
+ return isolateCoverGrammar(parseAssignmentExpression);
+ }
+
+ function checkPatternParam(options, param) {
+ var i;
+ switch (param.type) {
+ case Syntax.Identifier:
+ validateParam(options, param, param.name);
+ break;
+ case Syntax.RestElement:
+ checkPatternParam(options, param.argument);
+ break;
+ case Syntax.AssignmentPattern:
+ checkPatternParam(options, param.left);
+ break;
+ case Syntax.ArrayPattern:
+ for (i = 0; i < param.elements.length; i++) {
+ if (param.elements[i] !== null) {
+ checkPatternParam(options, param.elements[i]);
+ }
+ }
+ break;
+ case Syntax.YieldExpression:
+ break;
+ default:
+ assert(param.type === Syntax.ObjectPattern, 'Invalid type');
+ for (i = 0; i < param.properties.length; i++) {
+ checkPatternParam(options, param.properties[i].value);
+ }
+ break;
+ }
+ }
+ function reinterpretAsCoverFormalsList(expr) {
+ var i, len, param, params, defaults, defaultCount, options, token;
+
+ defaults = [];
+ defaultCount = 0;
+ params = [expr];
+
+ switch (expr.type) {
+ case Syntax.Identifier:
+ break;
+ case PlaceHolders.ArrowParameterPlaceHolder:
+ params = expr.params;
+ break;
+ default:
+ return null;
+ }
+
+ options = {
+ paramSet: {}
+ };
+
+ for (i = 0, len = params.length; i < len; i += 1) {
+ param = params[i];
+ switch (param.type) {
+ case Syntax.AssignmentPattern:
+ params[i] = param.left;
+ if (param.right.type === Syntax.YieldExpression) {
+ if (param.right.argument) {
+ throwUnexpectedToken(lookahead);
+ }
+ param.right.type = Syntax.Identifier;
+ param.right.name = 'yield';
+ delete param.right.argument;
+ delete param.right.delegate;
+ }
+ defaults.push(param.right);
+ ++defaultCount;
+ checkPatternParam(options, param.left);
+ break;
+ default:
+ checkPatternParam(options, param);
+ params[i] = param;
+ defaults.push(null);
+ break;
+ }
+ }
+
+ if (strict || !state.allowYield) {
+ for (i = 0, len = params.length; i < len; i += 1) {
+ param = params[i];
+ if (param.type === Syntax.YieldExpression) {
+ throwUnexpectedToken(lookahead);
+ }
+ }
+ }
+
+ if (options.message === Messages.StrictParamDupe) {
+ token = strict ? options.stricted : options.firstRestricted;
+ throwUnexpectedToken(token, options.message);
+ }
+
+ if (defaultCount === 0) {
+ defaults = [];
+ }
+
+ return {
+ params: params,
+ defaults: defaults,
+ stricted: options.stricted,
+ firstRestricted: options.firstRestricted,
+ message: options.message
+ };
+ }
+
+ function parseArrowFunctionExpression(options, node) {
+ var previousStrict, previousAllowYield, body;
+
+ if (hasLineTerminator) {
+ tolerateUnexpectedToken(lookahead);
+ }
+ expect('=>');
+
+ previousStrict = strict;
+ previousAllowYield = state.allowYield;
+ state.allowYield = true;
+
+ body = parseConciseBody();
+
+ if (strict && options.firstRestricted) {
+ throwUnexpectedToken(options.firstRestricted, options.message);
+ }
+ if (strict && options.stricted) {
+ tolerateUnexpectedToken(options.stricted, options.message);
+ }
+
+ strict = previousStrict;
+ state.allowYield = previousAllowYield;
+
+ return node.finishArrowFunctionExpression(options.params, options.defaults, body, body.type !== Syntax.BlockStatement);
+ }
+
+ // ECMA-262 14.4 Yield expression
+
+ function parseYieldExpression() {
+ var argument, expr, delegate, previousAllowYield;
+
+ argument = null;
+ expr = new Node();
+ delegate = false;
+
+ expectKeyword('yield');
+
+ if (!hasLineTerminator) {
+ previousAllowYield = state.allowYield;
+ state.allowYield = false;
+ delegate = match('*');
+ if (delegate) {
+ lex();
+ argument = parseAssignmentExpression();
+ } else {
+ if (!match(';') && !match('}') && !match(')') && lookahead.type !== Token.EOF) {
+ argument = parseAssignmentExpression();
+ }
+ }
+ state.allowYield = previousAllowYield;
+ }
+
+ return expr.finishYieldExpression(argument, delegate);
+ }
+
+ // ECMA-262 12.14 Assignment Operators
+
+ function parseAssignmentExpression() {
+ var token, expr, right, list, startToken;
+
+ startToken = lookahead;
+ token = lookahead;
+
+ if (!state.allowYield && matchKeyword('yield')) {
+ return parseYieldExpression();
+ }
+
+ expr = parseConditionalExpression();
+
+ if (expr.type === PlaceHolders.ArrowParameterPlaceHolder || match('=>')) {
+ isAssignmentTarget = isBindingElement = false;
+ list = reinterpretAsCoverFormalsList(expr);
+
+ if (list) {
+ firstCoverInitializedNameError = null;
+ return parseArrowFunctionExpression(list, new WrappingNode(startToken));
+ }
+
+ return expr;
+ }
+
+ if (matchAssign()) {
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInAssignment);
+ }
+
+ // ECMA-262 12.1.1
+ if (strict && expr.type === Syntax.Identifier) {
+ if (isRestrictedWord(expr.name)) {
+ tolerateUnexpectedToken(token, Messages.StrictLHSAssignment);
+ }
+ if (isStrictModeReservedWord(expr.name)) {
+ tolerateUnexpectedToken(token, Messages.StrictReservedWord);
+ }
+ }
+
+ if (!match('=')) {
+ isAssignmentTarget = isBindingElement = false;
+ } else {
+ reinterpretExpressionAsPattern(expr);
+ }
+
+ token = lex();
+ right = isolateCoverGrammar(parseAssignmentExpression);
+ expr = new WrappingNode(startToken).finishAssignmentExpression(token.value, expr, right);
+ firstCoverInitializedNameError = null;
+ }
+
+ return expr;
+ }
+
+ // ECMA-262 12.15 Comma Operator
+
+ function parseExpression() {
+ var expr, startToken = lookahead, expressions;
+
+ expr = isolateCoverGrammar(parseAssignmentExpression);
+
+ if (match(',')) {
+ expressions = [expr];
+
+ while (startIndex < length) {
+ if (!match(',')) {
+ break;
+ }
+ lex();
+ expressions.push(isolateCoverGrammar(parseAssignmentExpression));
+ }
+
+ expr = new WrappingNode(startToken).finishSequenceExpression(expressions);
+ }
+
+ return expr;
+ }
+
+ // ECMA-262 13.2 Block
+
+ function parseStatementListItem() {
+ if (lookahead.type === Token.Keyword) {
+ switch (lookahead.value) {
+ case 'export':
+ if (state.sourceType !== 'module') {
+ tolerateUnexpectedToken(lookahead, Messages.IllegalExportDeclaration);
+ }
+ return parseExportDeclaration();
+ case 'import':
+ if (state.sourceType !== 'module') {
+ tolerateUnexpectedToken(lookahead, Messages.IllegalImportDeclaration);
+ }
+ return parseImportDeclaration();
+ case 'const':
+ return parseLexicalDeclaration({inFor: false});
+ case 'function':
+ return parseFunctionDeclaration(new Node());
+ case 'class':
+ return parseClassDeclaration();
+ }
+ }
+
+ if (matchKeyword('let') && isLexicalDeclaration()) {
+ return parseLexicalDeclaration({inFor: false});
+ }
+
+ return parseStatement();
+ }
+
+ function parseStatementList() {
+ var list = [];
+ while (startIndex < length) {
+ if (match('}')) {
+ break;
+ }
+ list.push(parseStatementListItem());
+ }
+
+ return list;
+ }
+
+ function parseBlock() {
+ var block, node = new Node();
+
+ expect('{');
+
+ block = parseStatementList();
+
+ expect('}');
+
+ return node.finishBlockStatement(block);
+ }
+
+ // ECMA-262 13.3.2 Variable Statement
+
+ function parseVariableIdentifier(kind) {
+ var token, node = new Node();
+
+ token = lex();
+
+ if (token.type === Token.Keyword && token.value === 'yield') {
+ if (strict) {
+ tolerateUnexpectedToken(token, Messages.StrictReservedWord);
+ } if (!state.allowYield) {
+ throwUnexpectedToken(token);
+ }
+ } else if (token.type !== Token.Identifier) {
+ if (strict && token.type === Token.Keyword && isStrictModeReservedWord(token.value)) {
+ tolerateUnexpectedToken(token, Messages.StrictReservedWord);
+ } else {
+ if (strict || token.value !== 'let' || kind !== 'var') {
+ throwUnexpectedToken(token);
+ }
+ }
+ } else if (state.sourceType === 'module' && token.type === Token.Identifier && token.value === 'await') {
+ tolerateUnexpectedToken(token);
+ }
+
+ return node.finishIdentifier(token.value);
+ }
+
+ function parseVariableDeclaration(options) {
+ var init = null, id, node = new Node(), params = [];
+
+ id = parsePattern(params, 'var');
+
+ // ECMA-262 12.2.1
+ if (strict && isRestrictedWord(id.name)) {
+ tolerateError(Messages.StrictVarName);
+ }
+
+ if (match('=')) {
+ lex();
+ init = isolateCoverGrammar(parseAssignmentExpression);
+ } else if (id.type !== Syntax.Identifier && !options.inFor) {
+ expect('=');
+ }
+
+ return node.finishVariableDeclarator(id, init);
+ }
+
+ function parseVariableDeclarationList(options) {
+ var opt, list;
+
+ opt = { inFor: options.inFor };
+ list = [parseVariableDeclaration(opt)];
+
+ while (match(',')) {
+ lex();
+ list.push(parseVariableDeclaration(opt));
+ }
+
+ return list;
+ }
+
+ function parseVariableStatement(node) {
+ var declarations;
+
+ expectKeyword('var');
+
+ declarations = parseVariableDeclarationList({ inFor: false });
+
+ consumeSemicolon();
+
+ return node.finishVariableDeclaration(declarations);
+ }
+
+ // ECMA-262 13.3.1 Let and Const Declarations
+
+ function parseLexicalBinding(kind, options) {
+ var init = null, id, node = new Node(), params = [];
+
+ id = parsePattern(params, kind);
+
+ // ECMA-262 12.2.1
+ if (strict && id.type === Syntax.Identifier && isRestrictedWord(id.name)) {
+ tolerateError(Messages.StrictVarName);
+ }
+
+ if (kind === 'const') {
+ if (!matchKeyword('in') && !matchContextualKeyword('of')) {
+ expect('=');
+ init = isolateCoverGrammar(parseAssignmentExpression);
+ }
+ } else if ((!options.inFor && id.type !== Syntax.Identifier) || match('=')) {
+ expect('=');
+ init = isolateCoverGrammar(parseAssignmentExpression);
+ }
+
+ return node.finishVariableDeclarator(id, init);
+ }
+
+ function parseBindingList(kind, options) {
+ var list = [parseLexicalBinding(kind, options)];
+
+ while (match(',')) {
+ lex();
+ list.push(parseLexicalBinding(kind, options));
+ }
+
+ return list;
+ }
+
+
+ function tokenizerState() {
+ return {
+ index: index,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ hasLineTerminator: hasLineTerminator,
+ lastIndex: lastIndex,
+ lastLineNumber: lastLineNumber,
+ lastLineStart: lastLineStart,
+ startIndex: startIndex,
+ startLineNumber: startLineNumber,
+ startLineStart: startLineStart,
+ lookahead: lookahead,
+ tokenCount: extra.tokens ? extra.tokens.length : 0
+ };
+ }
+
+ function resetTokenizerState(ts) {
+ index = ts.index;
+ lineNumber = ts.lineNumber;
+ lineStart = ts.lineStart;
+ hasLineTerminator = ts.hasLineTerminator;
+ lastIndex = ts.lastIndex;
+ lastLineNumber = ts.lastLineNumber;
+ lastLineStart = ts.lastLineStart;
+ startIndex = ts.startIndex;
+ startLineNumber = ts.startLineNumber;
+ startLineStart = ts.startLineStart;
+ lookahead = ts.lookahead;
+ if (extra.tokens) {
+ extra.tokens.splice(ts.tokenCount, extra.tokens.length);
+ }
+ }
+
+ function isLexicalDeclaration() {
+ var lexical, ts;
+
+ ts = tokenizerState();
+
+ lex();
+ lexical = (lookahead.type === Token.Identifier) || match('[') || match('{') ||
+ matchKeyword('let') || matchKeyword('yield');
+
+ resetTokenizerState(ts);
+
+ return lexical;
+ }
+
+ function parseLexicalDeclaration(options) {
+ var kind, declarations, node = new Node();
+
+ kind = lex().value;
+ assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const');
+
+ declarations = parseBindingList(kind, options);
+
+ consumeSemicolon();
+
+ return node.finishLexicalDeclaration(declarations, kind);
+ }
+
+ function parseRestElement(params) {
+ var param, node = new Node();
+
+ lex();
+
+ if (match('{')) {
+ throwError(Messages.ObjectPatternAsRestParameter);
+ }
+
+ params.push(lookahead);
+
+ param = parseVariableIdentifier();
+
+ if (match('=')) {
+ throwError(Messages.DefaultRestParameter);
+ }
+
+ if (!match(')')) {
+ throwError(Messages.ParameterAfterRestParameter);
+ }
+
+ return node.finishRestElement(param);
+ }
+
+ // ECMA-262 13.4 Empty Statement
+
+ function parseEmptyStatement(node) {
+ expect(';');
+ return node.finishEmptyStatement();
+ }
+
+ // ECMA-262 12.4 Expression Statement
+
+ function parseExpressionStatement(node) {
+ var expr = parseExpression();
+ consumeSemicolon();
+ return node.finishExpressionStatement(expr);
+ }
+
+ // ECMA-262 13.6 If statement
+
+ function parseIfStatement(node) {
+ var test, consequent, alternate;
+
+ expectKeyword('if');
+
+ expect('(');
+
+ test = parseExpression();
+
+ expect(')');
+
+ consequent = parseStatement();
+
+ if (matchKeyword('else')) {
+ lex();
+ alternate = parseStatement();
+ } else {
+ alternate = null;
+ }
+
+ return node.finishIfStatement(test, consequent, alternate);
+ }
+
+ // ECMA-262 13.7 Iteration Statements
+
+ function parseDoWhileStatement(node) {
+ var body, test, oldInIteration;
+
+ expectKeyword('do');
+
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
+ body = parseStatement();
+
+ state.inIteration = oldInIteration;
+
+ expectKeyword('while');
+
+ expect('(');
+
+ test = parseExpression();
+
+ expect(')');
+
+ if (match(';')) {
+ lex();
+ }
+
+ return node.finishDoWhileStatement(body, test);
+ }
+
+ function parseWhileStatement(node) {
+ var test, body, oldInIteration;
+
+ expectKeyword('while');
+
+ expect('(');
+
+ test = parseExpression();
+
+ expect(')');
+
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
+ body = parseStatement();
+
+ state.inIteration = oldInIteration;
+
+ return node.finishWhileStatement(test, body);
+ }
+
+ function parseForStatement(node) {
+ var init, forIn, initSeq, initStartToken, test, update, left, right, kind, declarations,
+ body, oldInIteration, previousAllowIn = state.allowIn;
+
+ init = test = update = null;
+ forIn = true;
+
+ expectKeyword('for');
+
+ expect('(');
+
+ if (match(';')) {
+ lex();
+ } else {
+ if (matchKeyword('var')) {
+ init = new Node();
+ lex();
+
+ state.allowIn = false;
+ declarations = parseVariableDeclarationList({ inFor: true });
+ state.allowIn = previousAllowIn;
+
+ if (declarations.length === 1 && matchKeyword('in')) {
+ init = init.finishVariableDeclaration(declarations);
+ lex();
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else if (declarations.length === 1 && declarations[0].init === null && matchContextualKeyword('of')) {
+ init = init.finishVariableDeclaration(declarations);
+ lex();
+ left = init;
+ right = parseAssignmentExpression();
+ init = null;
+ forIn = false;
+ } else {
+ init = init.finishVariableDeclaration(declarations);
+ expect(';');
+ }
+ } else if (matchKeyword('const') || matchKeyword('let')) {
+ init = new Node();
+ kind = lex().value;
+
+ if (!strict && lookahead.value === 'in') {
+ init = init.finishIdentifier(kind);
+ lex();
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else {
+ state.allowIn = false;
+ declarations = parseBindingList(kind, {inFor: true});
+ state.allowIn = previousAllowIn;
+
+ if (declarations.length === 1 && declarations[0].init === null && matchKeyword('in')) {
+ init = init.finishLexicalDeclaration(declarations, kind);
+ lex();
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else if (declarations.length === 1 && declarations[0].init === null && matchContextualKeyword('of')) {
+ init = init.finishLexicalDeclaration(declarations, kind);
+ lex();
+ left = init;
+ right = parseAssignmentExpression();
+ init = null;
+ forIn = false;
+ } else {
+ consumeSemicolon();
+ init = init.finishLexicalDeclaration(declarations, kind);
+ }
+ }
+ } else {
+ initStartToken = lookahead;
+ state.allowIn = false;
+ init = inheritCoverGrammar(parseAssignmentExpression);
+ state.allowIn = previousAllowIn;
+
+ if (matchKeyword('in')) {
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInForIn);
+ }
+
+ lex();
+ reinterpretExpressionAsPattern(init);
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else if (matchContextualKeyword('of')) {
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInForLoop);
+ }
+
+ lex();
+ reinterpretExpressionAsPattern(init);
+ left = init;
+ right = parseAssignmentExpression();
+ init = null;
+ forIn = false;
+ } else {
+ if (match(',')) {
+ initSeq = [init];
+ while (match(',')) {
+ lex();
+ initSeq.push(isolateCoverGrammar(parseAssignmentExpression));
+ }
+ init = new WrappingNode(initStartToken).finishSequenceExpression(initSeq);
+ }
+ expect(';');
+ }
+ }
+ }
+
+ if (typeof left === 'undefined') {
+
+ if (!match(';')) {
+ test = parseExpression();
+ }
+ expect(';');
+
+ if (!match(')')) {
+ update = parseExpression();
+ }
+ }
+
+ expect(')');
+
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
+ body = isolateCoverGrammar(parseStatement);
+
+ state.inIteration = oldInIteration;
+
+ return (typeof left === 'undefined') ?
+ node.finishForStatement(init, test, update, body) :
+ forIn ? node.finishForInStatement(left, right, body) :
+ node.finishForOfStatement(left, right, body);
+ }
+
+ // ECMA-262 13.8 The continue statement
+
+ function parseContinueStatement(node) {
+ var label = null, key;
+
+ expectKeyword('continue');
+
+ // Optimize the most common form: 'continue;'.
+ if (source.charCodeAt(startIndex) === 0x3B) {
+ lex();
+
+ if (!state.inIteration) {
+ throwError(Messages.IllegalContinue);
+ }
+
+ return node.finishContinueStatement(null);
+ }
+
+ if (hasLineTerminator) {
+ if (!state.inIteration) {
+ throwError(Messages.IllegalContinue);
+ }
+
+ return node.finishContinueStatement(null);
+ }
+
+ if (lookahead.type === Token.Identifier) {
+ label = parseVariableIdentifier();
+
+ key = '$' + label.name;
+ if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
+ throwError(Messages.UnknownLabel, label.name);
+ }
+ }
+
+ consumeSemicolon();
+
+ if (label === null && !state.inIteration) {
+ throwError(Messages.IllegalContinue);
+ }
+
+ return node.finishContinueStatement(label);
+ }
+
+ // ECMA-262 13.9 The break statement
+
+ function parseBreakStatement(node) {
+ var label = null, key;
+
+ expectKeyword('break');
+
+ // Catch the very common case first: immediately a semicolon (U+003B).
+ if (source.charCodeAt(lastIndex) === 0x3B) {
+ lex();
+
+ if (!(state.inIteration || state.inSwitch)) {
+ throwError(Messages.IllegalBreak);
+ }
+
+ return node.finishBreakStatement(null);
+ }
+
+ if (hasLineTerminator) {
+ if (!(state.inIteration || state.inSwitch)) {
+ throwError(Messages.IllegalBreak);
+ }
+ } else if (lookahead.type === Token.Identifier) {
+ label = parseVariableIdentifier();
+
+ key = '$' + label.name;
+ if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
+ throwError(Messages.UnknownLabel, label.name);
+ }
+ }
+
+ consumeSemicolon();
+
+ if (label === null && !(state.inIteration || state.inSwitch)) {
+ throwError(Messages.IllegalBreak);
+ }
+
+ return node.finishBreakStatement(label);
+ }
+
+ // ECMA-262 13.10 The return statement
+
+ function parseReturnStatement(node) {
+ var argument = null;
+
+ expectKeyword('return');
+
+ if (!state.inFunctionBody) {
+ tolerateError(Messages.IllegalReturn);
+ }
+
+ // 'return' followed by a space and an identifier is very common.
+ if (source.charCodeAt(lastIndex) === 0x20) {
+ if (isIdentifierStart(source.charCodeAt(lastIndex + 1))) {
+ argument = parseExpression();
+ consumeSemicolon();
+ return node.finishReturnStatement(argument);
+ }
+ }
+
+ if (hasLineTerminator) {
+ // HACK
+ return node.finishReturnStatement(null);
+ }
+
+ if (!match(';')) {
+ if (!match('}') && lookahead.type !== Token.EOF) {
+ argument = parseExpression();
+ }
+ }
+
+ consumeSemicolon();
+
+ return node.finishReturnStatement(argument);
+ }
+
+ // ECMA-262 13.11 The with statement
+
+ function parseWithStatement(node) {
+ var object, body;
+
+ if (strict) {
+ tolerateError(Messages.StrictModeWith);
+ }
+
+ expectKeyword('with');
+
+ expect('(');
+
+ object = parseExpression();
+
+ expect(')');
+
+ body = parseStatement();
+
+ return node.finishWithStatement(object, body);
+ }
+
+ // ECMA-262 13.12 The switch statement
+
+ function parseSwitchCase() {
+ var test, consequent = [], statement, node = new Node();
+
+ if (matchKeyword('default')) {
+ lex();
+ test = null;
+ } else {
+ expectKeyword('case');
+ test = parseExpression();
+ }
+ expect(':');
+
+ while (startIndex < length) {
+ if (match('}') || matchKeyword('default') || matchKeyword('case')) {
+ break;
+ }
+ statement = parseStatementListItem();
+ consequent.push(statement);
+ }
+
+ return node.finishSwitchCase(test, consequent);
+ }
+
+ function parseSwitchStatement(node) {
+ var discriminant, cases, clause, oldInSwitch, defaultFound;
+
+ expectKeyword('switch');
+
+ expect('(');
+
+ discriminant = parseExpression();
+
+ expect(')');
+
+ expect('{');
+
+ cases = [];
+
+ if (match('}')) {
+ lex();
+ return node.finishSwitchStatement(discriminant, cases);
+ }
+
+ oldInSwitch = state.inSwitch;
+ state.inSwitch = true;
+ defaultFound = false;
+
+ while (startIndex < length) {
+ if (match('}')) {
+ break;
+ }
+ clause = parseSwitchCase();
+ if (clause.test === null) {
+ if (defaultFound) {
+ throwError(Messages.MultipleDefaultsInSwitch);
+ }
+ defaultFound = true;
+ }
+ cases.push(clause);
+ }
+
+ state.inSwitch = oldInSwitch;
+
+ expect('}');
+
+ return node.finishSwitchStatement(discriminant, cases);
+ }
+
+ // ECMA-262 13.14 The throw statement
+
+ function parseThrowStatement(node) {
+ var argument;
+
+ expectKeyword('throw');
+
+ if (hasLineTerminator) {
+ throwError(Messages.NewlineAfterThrow);
+ }
+
+ argument = parseExpression();
+
+ consumeSemicolon();
+
+ return node.finishThrowStatement(argument);
+ }
+
+ // ECMA-262 13.15 The try statement
+
+ function parseCatchClause() {
+ var param, params = [], paramMap = {}, key, i, body, node = new Node();
+
+ expectKeyword('catch');
+
+ expect('(');
+ if (match(')')) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ param = parsePattern(params);
+ for (i = 0; i < params.length; i++) {
+ key = '$' + params[i].value;
+ if (Object.prototype.hasOwnProperty.call(paramMap, key)) {
+ tolerateError(Messages.DuplicateBinding, params[i].value);
+ }
+ paramMap[key] = true;
+ }
+
+ // ECMA-262 12.14.1
+ if (strict && isRestrictedWord(param.name)) {
+ tolerateError(Messages.StrictCatchVariable);
+ }
+
+ expect(')');
+ body = parseBlock();
+ return node.finishCatchClause(param, body);
+ }
+
+ function parseTryStatement(node) {
+ var block, handler = null, finalizer = null;
+
+ expectKeyword('try');
+
+ block = parseBlock();
+
+ if (matchKeyword('catch')) {
+ handler = parseCatchClause();
+ }
+
+ if (matchKeyword('finally')) {
+ lex();
+ finalizer = parseBlock();
+ }
+
+ if (!handler && !finalizer) {
+ throwError(Messages.NoCatchOrFinally);
+ }
+
+ return node.finishTryStatement(block, handler, finalizer);
+ }
+
+ // ECMA-262 13.16 The debugger statement
+
+ function parseDebuggerStatement(node) {
+ expectKeyword('debugger');
+
+ consumeSemicolon();
+
+ return node.finishDebuggerStatement();
+ }
+
+ // 13 Statements
+
+ function parseStatement() {
+ var type = lookahead.type,
+ expr,
+ labeledBody,
+ key,
+ node;
+
+ if (type === Token.EOF) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ if (type === Token.Punctuator && lookahead.value === '{') {
+ return parseBlock();
+ }
+ isAssignmentTarget = isBindingElement = true;
+ node = new Node();
+
+ if (type === Token.Punctuator) {
+ switch (lookahead.value) {
+ case ';':
+ return parseEmptyStatement(node);
+ case '(':
+ return parseExpressionStatement(node);
+ default:
+ break;
+ }
+ } else if (type === Token.Keyword) {
+ switch (lookahead.value) {
+ case 'break':
+ return parseBreakStatement(node);
+ case 'continue':
+ return parseContinueStatement(node);
+ case 'debugger':
+ return parseDebuggerStatement(node);
+ case 'do':
+ return parseDoWhileStatement(node);
+ case 'for':
+ return parseForStatement(node);
+ case 'function':
+ return parseFunctionDeclaration(node);
+ case 'if':
+ return parseIfStatement(node);
+ case 'return':
+ return parseReturnStatement(node);
+ case 'switch':
+ return parseSwitchStatement(node);
+ case 'throw':
+ return parseThrowStatement(node);
+ case 'try':
+ return parseTryStatement(node);
+ case 'var':
+ return parseVariableStatement(node);
+ case 'while':
+ return parseWhileStatement(node);
+ case 'with':
+ return parseWithStatement(node);
+ default:
+ break;
+ }
+ }
+
+ expr = parseExpression();
+
+ // ECMA-262 12.12 Labelled Statements
+ if ((expr.type === Syntax.Identifier) && match(':')) {
+ lex();
+
+ key = '$' + expr.name;
+ if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
+ throwError(Messages.Redeclaration, 'Label', expr.name);
+ }
+
+ state.labelSet[key] = true;
+ labeledBody = parseStatement();
+ delete state.labelSet[key];
+ return node.finishLabeledStatement(expr, labeledBody);
+ }
+
+ consumeSemicolon();
+
+ return node.finishExpressionStatement(expr);
+ }
+
+ // ECMA-262 14.1 Function Definition
+
+ function parseFunctionSourceElements() {
+ var statement, body = [], token, directive, firstRestricted,
+ oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount,
+ node = new Node();
+
+ expect('{');
+
+ while (startIndex < length) {
+ if (lookahead.type !== Token.StringLiteral) {
+ break;
+ }
+ token = lookahead;
+
+ statement = parseStatementListItem();
+ body.push(statement);
+ if (statement.expression.type !== Syntax.Literal) {
+ // this is not directive
+ break;
+ }
+ directive = source.slice(token.start + 1, token.end - 1);
+ if (directive === 'use strict') {
+ strict = true;
+ if (firstRestricted) {
+ tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral);
+ }
+ } else {
+ if (!firstRestricted && token.octal) {
+ firstRestricted = token;
+ }
+ }
+ }
+
+ oldLabelSet = state.labelSet;
+ oldInIteration = state.inIteration;
+ oldInSwitch = state.inSwitch;
+ oldInFunctionBody = state.inFunctionBody;
+ oldParenthesisCount = state.parenthesizedCount;
+
+ state.labelSet = {};
+ state.inIteration = false;
+ state.inSwitch = false;
+ state.inFunctionBody = true;
+ state.parenthesizedCount = 0;
+
+ while (startIndex < length) {
+ if (match('}')) {
+ break;
+ }
+ body.push(parseStatementListItem());
+ }
+
+ expect('}');
+
+ state.labelSet = oldLabelSet;
+ state.inIteration = oldInIteration;
+ state.inSwitch = oldInSwitch;
+ state.inFunctionBody = oldInFunctionBody;
+ state.parenthesizedCount = oldParenthesisCount;
+
+ return node.finishBlockStatement(body);
+ }
+
+ function validateParam(options, param, name) {
+ var key = '$' + name;
+ if (strict) {
+ if (isRestrictedWord(name)) {
+ options.stricted = param;
+ options.message = Messages.StrictParamName;
+ }
+ if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
+ options.stricted = param;
+ options.message = Messages.StrictParamDupe;
+ }
+ } else if (!options.firstRestricted) {
+ if (isRestrictedWord(name)) {
+ options.firstRestricted = param;
+ options.message = Messages.StrictParamName;
+ } else if (isStrictModeReservedWord(name)) {
+ options.firstRestricted = param;
+ options.message = Messages.StrictReservedWord;
+ } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
+ options.stricted = param;
+ options.message = Messages.StrictParamDupe;
+ }
+ }
+ options.paramSet[key] = true;
+ }
+
+ function parseParam(options) {
+ var token, param, params = [], i, def;
+
+ token = lookahead;
+ if (token.value === '...') {
+ param = parseRestElement(params);
+ validateParam(options, param.argument, param.argument.name);
+ options.params.push(param);
+ options.defaults.push(null);
+ return false;
+ }
+
+ param = parsePatternWithDefault(params);
+ for (i = 0; i < params.length; i++) {
+ validateParam(options, params[i], params[i].value);
+ }
+
+ if (param.type === Syntax.AssignmentPattern) {
+ def = param.right;
+ param = param.left;
+ ++options.defaultCount;
+ }
+
+ options.params.push(param);
+ options.defaults.push(def);
+
+ return !match(')');
+ }
+
+ function parseParams(firstRestricted) {
+ var options;
+
+ options = {
+ params: [],
+ defaultCount: 0,
+ defaults: [],
+ firstRestricted: firstRestricted
+ };
+
+ expect('(');
+
+ if (!match(')')) {
+ options.paramSet = {};
+ while (startIndex < length) {
+ if (!parseParam(options)) {
+ break;
+ }
+ expect(',');
+ }
+ }
+
+ expect(')');
+
+ if (options.defaultCount === 0) {
+ options.defaults = [];
+ }
+
+ return {
+ params: options.params,
+ defaults: options.defaults,
+ stricted: options.stricted,
+ firstRestricted: options.firstRestricted,
+ message: options.message
+ };
+ }
+
+ function parseFunctionDeclaration(node, identifierIsOptional) {
+ var id = null, params = [], defaults = [], body, token, stricted, tmp, firstRestricted, message, previousStrict,
+ isGenerator, previousAllowYield;
+
+ previousAllowYield = state.allowYield;
+
+ expectKeyword('function');
+
+ isGenerator = match('*');
+ if (isGenerator) {
+ lex();
+ }
+
+ if (!identifierIsOptional || !match('(')) {
+ token = lookahead;
+ id = parseVariableIdentifier();
+ if (strict) {
+ if (isRestrictedWord(token.value)) {
+ tolerateUnexpectedToken(token, Messages.StrictFunctionName);
+ }
+ } else {
+ if (isRestrictedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictFunctionName;
+ } else if (isStrictModeReservedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictReservedWord;
+ }
+ }
+ }
+
+ state.allowYield = !isGenerator;
+ tmp = parseParams(firstRestricted);
+ params = tmp.params;
+ defaults = tmp.defaults;
+ stricted = tmp.stricted;
+ firstRestricted = tmp.firstRestricted;
+ if (tmp.message) {
+ message = tmp.message;
+ }
+
+
+ previousStrict = strict;
+ body = parseFunctionSourceElements();
+ if (strict && firstRestricted) {
+ throwUnexpectedToken(firstRestricted, message);
+ }
+ if (strict && stricted) {
+ tolerateUnexpectedToken(stricted, message);
+ }
+
+ strict = previousStrict;
+ state.allowYield = previousAllowYield;
+
+ return node.finishFunctionDeclaration(id, params, defaults, body, isGenerator);
+ }
+
+ function parseFunctionExpression() {
+ var token, id = null, stricted, firstRestricted, message, tmp,
+ params = [], defaults = [], body, previousStrict, node = new Node(),
+ isGenerator, previousAllowYield;
+
+ previousAllowYield = state.allowYield;
+
+ expectKeyword('function');
+
+ isGenerator = match('*');
+ if (isGenerator) {
+ lex();
+ }
+
+ state.allowYield = !isGenerator;
+ if (!match('(')) {
+ token = lookahead;
+ id = (!strict && !isGenerator && matchKeyword('yield')) ? parseNonComputedProperty() : parseVariableIdentifier();
+ if (strict) {
+ if (isRestrictedWord(token.value)) {
+ tolerateUnexpectedToken(token, Messages.StrictFunctionName);
+ }
+ } else {
+ if (isRestrictedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictFunctionName;
+ } else if (isStrictModeReservedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictReservedWord;
+ }
+ }
+ }
+
+ tmp = parseParams(firstRestricted);
+ params = tmp.params;
+ defaults = tmp.defaults;
+ stricted = tmp.stricted;
+ firstRestricted = tmp.firstRestricted;
+ if (tmp.message) {
+ message = tmp.message;
+ }
+
+ previousStrict = strict;
+ body = parseFunctionSourceElements();
+ if (strict && firstRestricted) {
+ throwUnexpectedToken(firstRestricted, message);
+ }
+ if (strict && stricted) {
+ tolerateUnexpectedToken(stricted, message);
+ }
+ strict = previousStrict;
+ state.allowYield = previousAllowYield;
+
+ return node.finishFunctionExpression(id, params, defaults, body, isGenerator);
+ }
+
+ // ECMA-262 14.5 Class Definitions
+
+ function parseClassBody() {
+ var classBody, token, isStatic, hasConstructor = false, body, method, computed, key;
+
+ classBody = new Node();
+
+ expect('{');
+ body = [];
+ while (!match('}')) {
+ if (match(';')) {
+ lex();
+ } else {
+ method = new Node();
+ token = lookahead;
+ isStatic = false;
+ computed = match('[');
+ if (match('*')) {
+ lex();
+ } else {
+ key = parseObjectPropertyKey();
+ if (key.name === 'static' && (lookaheadPropertyName() || match('*'))) {
+ token = lookahead;
+ isStatic = true;
+ computed = match('[');
+ if (match('*')) {
+ lex();
+ } else {
+ key = parseObjectPropertyKey();
+ }
+ }
+ }
+ method = tryParseMethodDefinition(token, key, computed, method);
+ if (method) {
+ method['static'] = isStatic; // jscs:ignore requireDotNotation
+ if (method.kind === 'init') {
+ method.kind = 'method';
+ }
+ if (!isStatic) {
+ if (!method.computed && (method.key.name || method.key.value.toString()) === 'constructor') {
+ if (method.kind !== 'method' || !method.method || method.value.generator) {
+ throwUnexpectedToken(token, Messages.ConstructorSpecialMethod);
+ }
+ if (hasConstructor) {
+ throwUnexpectedToken(token, Messages.DuplicateConstructor);
+ } else {
+ hasConstructor = true;
+ }
+ method.kind = 'constructor';
+ }
+ } else {
+ if (!method.computed && (method.key.name || method.key.value.toString()) === 'prototype') {
+ throwUnexpectedToken(token, Messages.StaticPrototype);
+ }
+ }
+ method.type = Syntax.MethodDefinition;
+ delete method.method;
+ delete method.shorthand;
+ body.push(method);
+ } else {
+ throwUnexpectedToken(lookahead);
+ }
+ }
+ }
+ lex();
+ return classBody.finishClassBody(body);
+ }
+
+ function parseClassDeclaration(identifierIsOptional) {
+ var id = null, superClass = null, classNode = new Node(), classBody, previousStrict = strict;
+ strict = true;
+
+ expectKeyword('class');
+
+ if (!identifierIsOptional || lookahead.type === Token.Identifier) {
+ id = parseVariableIdentifier();
+ }
+
+ if (matchKeyword('extends')) {
+ lex();
+ superClass = isolateCoverGrammar(parseLeftHandSideExpressionAllowCall);
+ }
+ classBody = parseClassBody();
+ strict = previousStrict;
+
+ return classNode.finishClassDeclaration(id, superClass, classBody);
+ }
+
+ function parseClassExpression() {
+ var id = null, superClass = null, classNode = new Node(), classBody, previousStrict = strict;
+ strict = true;
+
+ expectKeyword('class');
+
+ if (lookahead.type === Token.Identifier) {
+ id = parseVariableIdentifier();
+ }
+
+ if (matchKeyword('extends')) {
+ lex();
+ superClass = isolateCoverGrammar(parseLeftHandSideExpressionAllowCall);
+ }
+ classBody = parseClassBody();
+ strict = previousStrict;
+
+ return classNode.finishClassExpression(id, superClass, classBody);
+ }
+
+ // ECMA-262 15.2 Modules
+
+ function parseModuleSpecifier() {
+ var node = new Node();
+
+ if (lookahead.type !== Token.StringLiteral) {
+ throwError(Messages.InvalidModuleSpecifier);
+ }
+ return node.finishLiteral(lex());
+ }
+
+ // ECMA-262 15.2.3 Exports
+
+ function parseExportSpecifier() {
+ var exported, local, node = new Node(), def;
+ if (matchKeyword('default')) {
+ // export {default} from 'something';
+ def = new Node();
+ lex();
+ local = def.finishIdentifier('default');
+ } else {
+ local = parseVariableIdentifier();
+ }
+ if (matchContextualKeyword('as')) {
+ lex();
+ exported = parseNonComputedProperty();
+ }
+ return node.finishExportSpecifier(local, exported);
+ }
+
+ function parseExportNamedDeclaration(node) {
+ var declaration = null,
+ isExportFromIdentifier,
+ src = null, specifiers = [];
+
+ // non-default export
+ if (lookahead.type === Token.Keyword) {
+ // covers:
+ // export var f = 1;
+ switch (lookahead.value) {
+ case 'let':
+ case 'const':
+ declaration = parseLexicalDeclaration({inFor: false});
+ return node.finishExportNamedDeclaration(declaration, specifiers, null);
+ case 'var':
+ case 'class':
+ case 'function':
+ declaration = parseStatementListItem();
+ return node.finishExportNamedDeclaration(declaration, specifiers, null);
+ }
+ }
+
+ expect('{');
+ while (!match('}')) {
+ isExportFromIdentifier = isExportFromIdentifier || matchKeyword('default');
+ specifiers.push(parseExportSpecifier());
+ if (!match('}')) {
+ expect(',');
+ if (match('}')) {
+ break;
+ }
+ }
+ }
+ expect('}');
+
+ if (matchContextualKeyword('from')) {
+ // covering:
+ // export {default} from 'foo';
+ // export {foo} from 'foo';
+ lex();
+ src = parseModuleSpecifier();
+ consumeSemicolon();
+ } else if (isExportFromIdentifier) {
+ // covering:
+ // export {default}; // missing fromClause
+ throwError(lookahead.value ?
+ Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value);
+ } else {
+ // cover
+ // export {foo};
+ consumeSemicolon();
+ }
+ return node.finishExportNamedDeclaration(declaration, specifiers, src);
+ }
+
+ function parseExportDefaultDeclaration(node) {
+ var declaration = null,
+ expression = null;
+
+ // covers:
+ // export default ...
+ expectKeyword('default');
+
+ if (matchKeyword('function')) {
+ // covers:
+ // export default function foo () {}
+ // export default function () {}
+ declaration = parseFunctionDeclaration(new Node(), true);
+ return node.finishExportDefaultDeclaration(declaration);
+ }
+ if (matchKeyword('class')) {
+ declaration = parseClassDeclaration(true);
+ return node.finishExportDefaultDeclaration(declaration);
+ }
+
+ if (matchContextualKeyword('from')) {
+ throwError(Messages.UnexpectedToken, lookahead.value);
+ }
+
+ // covers:
+ // export default {};
+ // export default [];
+ // export default (1 + 2);
+ if (match('{')) {
+ expression = parseObjectInitializer();
+ } else if (match('[')) {
+ expression = parseArrayInitializer();
+ } else {
+ expression = parseAssignmentExpression();
+ }
+ consumeSemicolon();
+ return node.finishExportDefaultDeclaration(expression);
+ }
+
+ function parseExportAllDeclaration(node) {
+ var src;
+
+ // covers:
+ // export * from 'foo';
+ expect('*');
+ if (!matchContextualKeyword('from')) {
+ throwError(lookahead.value ?
+ Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value);
+ }
+ lex();
+ src = parseModuleSpecifier();
+ consumeSemicolon();
+
+ return node.finishExportAllDeclaration(src);
+ }
+
+ function parseExportDeclaration() {
+ var node = new Node();
+ if (state.inFunctionBody) {
+ throwError(Messages.IllegalExportDeclaration);
+ }
+
+ expectKeyword('export');
+
+ if (matchKeyword('default')) {
+ return parseExportDefaultDeclaration(node);
+ }
+ if (match('*')) {
+ return parseExportAllDeclaration(node);
+ }
+ return parseExportNamedDeclaration(node);
+ }
+
+ // ECMA-262 15.2.2 Imports
+
+ function parseImportSpecifier() {
+ // import {<foo as bar>} ...;
+ var local, imported, node = new Node();
+
+ imported = parseNonComputedProperty();
+ if (matchContextualKeyword('as')) {
+ lex();
+ local = parseVariableIdentifier();
+ }
+
+ return node.finishImportSpecifier(local, imported);
+ }
+
+ function parseNamedImports() {
+ var specifiers = [];
+ // {foo, bar as bas}
+ expect('{');
+ while (!match('}')) {
+ specifiers.push(parseImportSpecifier());
+ if (!match('}')) {
+ expect(',');
+ if (match('}')) {
+ break;
+ }
+ }
+ }
+ expect('}');
+ return specifiers;
+ }
+
+ function parseImportDefaultSpecifier() {
+ // import <foo> ...;
+ var local, node = new Node();
+
+ local = parseNonComputedProperty();
+
+ return node.finishImportDefaultSpecifier(local);
+ }
+
+ function parseImportNamespaceSpecifier() {
+ // import <* as foo> ...;
+ var local, node = new Node();
+
+ expect('*');
+ if (!matchContextualKeyword('as')) {
+ throwError(Messages.NoAsAfterImportNamespace);
+ }
+ lex();
+ local = parseNonComputedProperty();
+
+ return node.finishImportNamespaceSpecifier(local);
+ }
+
+ function parseImportDeclaration() {
+ var specifiers = [], src, node = new Node();
+
+ if (state.inFunctionBody) {
+ throwError(Messages.IllegalImportDeclaration);
+ }
+
+ expectKeyword('import');
+
+ if (lookahead.type === Token.StringLiteral) {
+ // import 'foo';
+ src = parseModuleSpecifier();
+ } else {
+
+ if (match('{')) {
+ // import {bar}
+ specifiers = specifiers.concat(parseNamedImports());
+ } else if (match('*')) {
+ // import * as foo
+ specifiers.push(parseImportNamespaceSpecifier());
+ } else if (isIdentifierName(lookahead) && !matchKeyword('default')) {
+ // import foo
+ specifiers.push(parseImportDefaultSpecifier());
+ if (match(',')) {
+ lex();
+ if (match('*')) {
+ // import foo, * as foo
+ specifiers.push(parseImportNamespaceSpecifier());
+ } else if (match('{')) {
+ // import foo, {bar}
+ specifiers = specifiers.concat(parseNamedImports());
+ } else {
+ throwUnexpectedToken(lookahead);
+ }
+ }
+ } else {
+ throwUnexpectedToken(lex());
+ }
+
+ if (!matchContextualKeyword('from')) {
+ throwError(lookahead.value ?
+ Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value);
+ }
+ lex();
+ src = parseModuleSpecifier();
+ }
+
+ consumeSemicolon();
+ return node.finishImportDeclaration(specifiers, src);
+ }
+
+ // ECMA-262 15.1 Scripts
+
+ function parseScriptBody() {
+ var statement, body = [], token, directive, firstRestricted;
+
+ while (startIndex < length) {
+ token = lookahead;
+ if (token.type !== Token.StringLiteral) {
+ break;
+ }
+
+ statement = parseStatementListItem();
+ body.push(statement);
+ if (statement.expression.type !== Syntax.Literal) {
+ // this is not directive
+ break;
+ }
+ directive = source.slice(token.start + 1, token.end - 1);
+ if (directive === 'use strict') {
+ strict = true;
+ if (firstRestricted) {
+ tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral);
+ }
+ } else {
+ if (!firstRestricted && token.octal) {
+ firstRestricted = token;
+ }
+ }
+ }
+
+ while (startIndex < length) {
+ statement = parseStatementListItem();
+ /* istanbul ignore if */
+ if (typeof statement === 'undefined') {
+ break;
+ }
+ body.push(statement);
+ }
+ return body;
+ }
+
+ function parseProgram() {
+ var body, node;
+
+ peek();
+ node = new Node();
+
+ body = parseScriptBody();
+ return node.finishProgram(body, state.sourceType);
+ }
+
+ function filterTokenLocation() {
+ var i, entry, token, tokens = [];
+
+ for (i = 0; i < extra.tokens.length; ++i) {
+ entry = extra.tokens[i];
+ token = {
+ type: entry.type,
+ value: entry.value
+ };
+ if (entry.regex) {
+ token.regex = {
+ pattern: entry.regex.pattern,
+ flags: entry.regex.flags
+ };
+ }
+ if (extra.range) {
+ token.range = entry.range;
+ }
+ if (extra.loc) {
+ token.loc = entry.loc;
+ }
+ tokens.push(token);
+ }
+
+ extra.tokens = tokens;
+ }
+
+ function tokenize(code, options, delegate) {
+ var toString,
+ tokens;
+
+ toString = String;
+ if (typeof code !== 'string' && !(code instanceof String)) {
+ code = toString(code);
+ }
+
+ source = code;
+ index = 0;
+ lineNumber = (source.length > 0) ? 1 : 0;
+ lineStart = 0;
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+ length = source.length;
+ lookahead = null;
+ state = {
+ allowIn: true,
+ allowYield: true,
+ labelSet: {},
+ inFunctionBody: false,
+ inIteration: false,
+ inSwitch: false,
+ lastCommentStart: -1,
+ curlyStack: []
+ };
+
+ extra = {};
+
+ // Options matching.
+ options = options || {};
+
+ // Of course we collect tokens here.
+ options.tokens = true;
+ extra.tokens = [];
+ extra.tokenValues = [];
+ extra.tokenize = true;
+ extra.delegate = delegate;
+
+ // The following two fields are necessary to compute the Regex tokens.
+ extra.openParenToken = -1;
+ extra.openCurlyToken = -1;
+
+ extra.range = (typeof options.range === 'boolean') && options.range;
+ extra.loc = (typeof options.loc === 'boolean') && options.loc;
+
+ if (typeof options.comment === 'boolean' && options.comment) {
+ extra.comments = [];
+ }
+ if (typeof options.tolerant === 'boolean' && options.tolerant) {
+ extra.errors = [];
+ }
+
+ try {
+ peek();
+ if (lookahead.type === Token.EOF) {
+ return extra.tokens;
+ }
+
+ lex();
+ while (lookahead.type !== Token.EOF) {
+ try {
+ lex();
+ } catch (lexError) {
+ if (extra.errors) {
+ recordError(lexError);
+ // We have to break on the first error
+ // to avoid infinite loops.
+ break;
+ } else {
+ throw lexError;
+ }
+ }
+ }
+
+ tokens = extra.tokens;
+ if (typeof extra.errors !== 'undefined') {
+ tokens.errors = extra.errors;
+ }
+ } catch (e) {
+ throw e;
+ } finally {
+ extra = {};
+ }
+ return tokens;
+ }
+
+ function parse(code, options) {
+ var program, toString;
+
+ toString = String;
+ if (typeof code !== 'string' && !(code instanceof String)) {
+ code = toString(code);
+ }
+
+ source = code;
+ index = 0;
+ lineNumber = (source.length > 0) ? 1 : 0;
+ lineStart = 0;
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+ length = source.length;
+ lookahead = null;
+ state = {
+ allowIn: true,
+ allowYield: true,
+ labelSet: {},
+ inFunctionBody: false,
+ inIteration: false,
+ inSwitch: false,
+ lastCommentStart: -1,
+ curlyStack: [],
+ sourceType: 'script'
+ };
+ strict = false;
+
+ extra = {};
+ if (typeof options !== 'undefined') {
+ extra.range = (typeof options.range === 'boolean') && options.range;
+ extra.loc = (typeof options.loc === 'boolean') && options.loc;
+ extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;
+
+ if (extra.loc && options.source !== null && options.source !== undefined) {
+ extra.source = toString(options.source);
+ }
+
+ if (typeof options.tokens === 'boolean' && options.tokens) {
+ extra.tokens = [];
+ }
+ if (typeof options.comment === 'boolean' && options.comment) {
+ extra.comments = [];
+ }
+ if (typeof options.tolerant === 'boolean' && options.tolerant) {
+ extra.errors = [];
+ }
+ if (extra.attachComment) {
+ extra.range = true;
+ extra.comments = [];
+ extra.bottomRightStack = [];
+ extra.trailingComments = [];
+ extra.leadingComments = [];
+ }
+ if (options.sourceType === 'module') {
+ // very restrictive condition for now
+ state.sourceType = options.sourceType;
+ strict = true;
+ }
+ }
+
+ try {
+ program = parseProgram();
+ if (typeof extra.comments !== 'undefined') {
+ program.comments = extra.comments;
+ }
+ if (typeof extra.tokens !== 'undefined') {
+ filterTokenLocation();
+ program.tokens = extra.tokens;
+ }
+ if (typeof extra.errors !== 'undefined') {
+ program.errors = extra.errors;
+ }
+ } catch (e) {
+ throw e;
+ } finally {
+ extra = {};
+ }
+
+ return program;
+ }
+
+ // Sync with *.json manifests.
+ exports.version = '2.7.1';
+
+ exports.tokenize = tokenize;
+
+ exports.parse = parse;
+
+ // Deep copy.
+ /* istanbul ignore next */
+ exports.Syntax = (function () {
+ var name, types = {};
+
+ if (typeof Object.create === 'function') {
+ types = Object.create(null);
+ }
+
+ for (name in Syntax) {
+ if (Syntax.hasOwnProperty(name)) {
+ types[name] = Syntax[name];
+ }
+ }
+
+ if (typeof Object.freeze === 'function') {
+ Object.freeze(types);
+ }
+
+ return types;
+ }());
+
+}));
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+},{}],51:[function(require,module,exports){
+/*!
+ * node-inherit
+ * Copyright(c) 2011 Dmitry Filatov <dfilatov@yandex-team.ru>
+ * MIT Licensed
+ */
+
+module.exports = require('./lib/inherit');
+
+},{"./lib/inherit":52}],52:[function(require,module,exports){
+/**
+ * @module inherit
+ * @version 2.2.2
+ * @author Filatov Dmitry <dfilatov@yandex-team.ru>
+ * @description This module provides some syntax sugar for "class" declarations, constructors, mixins, "super" calls and static members.
+ */
+
+(function(global) {
+
+var hasIntrospection = (function(){'_';}).toString().indexOf('_') > -1,
+ emptyBase = function() {},
+ hasOwnProperty = Object.prototype.hasOwnProperty,
+ objCreate = Object.create || function(ptp) {
+ var inheritance = function() {};
+ inheritance.prototype = ptp;
+ return new inheritance();
+ },
+ objKeys = Object.keys || function(obj) {
+ var res = [];
+ for(var i in obj) {
+ hasOwnProperty.call(obj, i) && res.push(i);
+ }
+ return res;
+ },
+ extend = function(o1, o2) {
+ for(var i in o2) {
+ hasOwnProperty.call(o2, i) && (o1[i] = o2[i]);
+ }
+
+ return o1;
+ },
+ toStr = Object.prototype.toString,
+ isArray = Array.isArray || function(obj) {
+ return toStr.call(obj) === '[object Array]';
+ },
+ isFunction = function(obj) {
+ return toStr.call(obj) === '[object Function]';
+ },
+ noOp = function() {},
+ needCheckProps = true,
+ testPropObj = { toString : '' };
+
+for(var i in testPropObj) { // fucking ie hasn't toString, valueOf in for
+ testPropObj.hasOwnProperty(i) && (needCheckProps = false);
+}
+
+var specProps = needCheckProps? ['toString', 'valueOf'] : null;
+
+function getPropList(obj) {
+ var res = objKeys(obj);
+ if(needCheckProps) {
+ var specProp, i = 0;
+ while(specProp = specProps[i++]) {
+ obj.hasOwnProperty(specProp) && res.push(specProp);
+ }
+ }
+
+ return res;
+}
+
+function override(base, res, add) {
+ var addList = getPropList(add),
+ j = 0, len = addList.length,
+ name, prop;
+ while(j < len) {
+ if((name = addList[j++]) === '__self') {
+ continue;
+ }
+ prop = add[name];
+ if(isFunction(prop) &&
+ (!hasIntrospection || prop.toString().indexOf('.__base') > -1)) {
+ res[name] = (function(name, prop) {
+ var baseMethod = base[name]?
+ base[name] :
+ name === '__constructor'? // case of inheritance from plane function
+ res.__self.__parent :
+ noOp;
+ return function() {
+ var baseSaved = this.__base;
+ this.__base = baseMethod;
+ var res = prop.apply(this, arguments);
+ this.__base = baseSaved;
+ return res;
+ };
+ })(name, prop);
+ } else {
+ res[name] = prop;
+ }
+ }
+}
+
+function applyMixins(mixins, res) {
+ var i = 1, mixin;
+ while(mixin = mixins[i++]) {
+ res?
+ isFunction(mixin)?
+ inherit.self(res, mixin.prototype, mixin) :
+ inherit.self(res, mixin) :
+ res = isFunction(mixin)?
+ inherit(mixins[0], mixin.prototype, mixin) :
+ inherit(mixins[0], mixin);
+ }
+ return res || mixins[0];
+}
+
+/**
+* Creates class
+* @exports
+* @param {Function|Array} [baseClass|baseClassAndMixins] class (or class and mixins) to inherit from
+* @param {Object} prototypeFields
+* @param {Object} [staticFields]
+* @returns {Function} class
+*/
+function inherit() {
+ var args = arguments,
+ withMixins = isArray(args[0]),
+ hasBase = withMixins || isFunction(args[0]),
+ base = hasBase? withMixins? applyMixins(args[0]) : args[0] : emptyBase,
+ props = args[hasBase? 1 : 0] || {},
+ staticProps = args[hasBase? 2 : 1],
+ res = props.__constructor || (hasBase && base.prototype.__constructor)?
+ function() {
+ return this.__constructor.apply(this, arguments);
+ } :
+ hasBase?
+ function() {
+ return base.apply(this, arguments);
+ } :
+ function() {};
+
+ if(!hasBase) {
+ res.prototype = props;
+ res.prototype.__self = res.prototype.constructor = res;
+ return extend(res, staticProps);
+ }
+
+ extend(res, base);
+
+ res.__parent = base;
+
+ var basePtp = base.prototype,
+ resPtp = res.prototype = objCreate(basePtp);
+
+ resPtp.__self = resPtp.constructor = res;
+
+ props && override(basePtp, resPtp, props);
+ staticProps && override(base, res, staticProps);
+
+ return res;
+}
+
+inherit.self = function() {
+ var args = arguments,
+ withMixins = isArray(args[0]),
+ base = withMixins? applyMixins(args[0], args[0][0]) : args[0],
+ props = args[1],
+ staticProps = args[2],
+ basePtp = base.prototype;
+
+ props && override(basePtp, basePtp, props);
+ staticProps && override(base, base, staticProps);
+
+ return base;
+};
+
+var defineAsGlobal = true;
+if(typeof exports === 'object') {
+ module.exports = inherit;
+ defineAsGlobal = false;
+}
+
+if(typeof modules === 'object') {
+ modules.define('inherit', function(provide) {
+ provide(inherit);
+ });
+ defineAsGlobal = false;
+}
+
+if(typeof define === 'function') {
+ define(function(require, exports, module) {
+ module.exports = inherit;
+ });
+ defineAsGlobal = false;
+}
+
+defineAsGlobal && (global.inherit = inherit);
+
+})(this);
+
+},{}],53:[function(require,module,exports){
+var baseIndexOf = require('../internal/baseIndexOf'),
+ binaryIndex = require('../internal/binaryIndex');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Gets the index at which the first occurrence of `value` is found in `array`
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it's used as the offset
+ * from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
+ * performs a faster binary search.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {boolean|number} [fromIndex=0] The index to search from or `true`
+ * to perform a binary search on a sorted array.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.indexOf([1, 2, 1, 2], 2);
+ * // => 1
+ *
+ * // using `fromIndex`
+ * _.indexOf([1, 2, 1, 2], 2, 2);
+ * // => 3
+ *
+ * // performing a binary search
+ * _.indexOf([1, 1, 2, 2], 2, true);
+ * // => 2
+ */
+function indexOf(array, value, fromIndex) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return -1;
+ }
+ if (typeof fromIndex == 'number') {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
+ } else if (fromIndex) {
+ var index = binaryIndex(array, value);
+ if (index < length &&
+ (value === value ? (value === array[index]) : (array[index] !== array[index]))) {
+ return index;
+ }
+ return -1;
+ }
+ return baseIndexOf(array, value, fromIndex || 0);
+}
+
+module.exports = indexOf;
+
+},{"../internal/baseIndexOf":82,"../internal/binaryIndex":96}],54:[function(require,module,exports){
+/**
+ * Gets the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the last element of `array`.
+ * @example
+ *
+ * _.last([1, 2, 3]);
+ * // => 3
+ */
+function last(array) {
+ var length = array ? array.length : 0;
+ return length ? array[length - 1] : undefined;
+}
+
+module.exports = last;
+
+},{}],55:[function(require,module,exports){
+var LazyWrapper = require('../internal/LazyWrapper'),
+ LodashWrapper = require('../internal/LodashWrapper'),
+ baseLodash = require('../internal/baseLodash'),
+ isArray = require('../lang/isArray'),
+ isObjectLike = require('../internal/isObjectLike'),
+ wrapperClone = require('../internal/wrapperClone');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates a `lodash` object which wraps `value` to enable implicit chaining.
+ * Methods that operate on and return arrays, collections, and functions can
+ * be chained together. Methods that retrieve a single value or may return a
+ * primitive value will automatically end the chain returning the unwrapped
+ * value. Explicit chaining may be enabled using `_.chain`. The execution of
+ * chained methods is lazy, that is, execution is deferred until `_#value`
+ * is implicitly or explicitly called.
+ *
+ * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
+ * fusion is an optimization strategy which merge iteratee calls; this can help
+ * to avoid the creation of intermediate data structures and greatly reduce the
+ * number of iteratee executions.
+ *
+ * Chaining is supported in custom builds as long as the `_#value` method is
+ * directly or indirectly included in the build.
+ *
+ * In addition to lodash methods, wrappers have `Array` and `String` methods.
+ *
+ * The wrapper `Array` methods are:
+ * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
+ * `splice`, and `unshift`
+ *
+ * The wrapper `String` methods are:
+ * `replace` and `split`
+ *
+ * The wrapper methods that support shortcut fusion are:
+ * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
+ * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
+ * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
+ * and `where`
+ *
+ * The chainable wrapper methods are:
+ * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
+ * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
+ * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`,
+ * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`,
+ * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`,
+ * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
+ * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
+ * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`,
+ * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`,
+ * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
+ * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
+ * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`,
+ * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`,
+ * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`,
+ * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
+ * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
+ * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
+ *
+ * The wrapper methods that are **not** chainable by default are:
+ * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
+ * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
+ * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
+ * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
+ * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
+ * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
+ * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
+ * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
+ * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
+ * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
+ * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
+ * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
+ * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
+ * `unescape`, `uniqueId`, `value`, and `words`
+ *
+ * The wrapper method `sample` will return a wrapped value when `n` is provided,
+ * otherwise an unwrapped value is returned.
+ *
+ * @name _
+ * @constructor
+ * @category Chain
+ * @param {*} value The value to wrap in a `lodash` instance.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var wrapped = _([1, 2, 3]);
+ *
+ * // returns an unwrapped value
+ * wrapped.reduce(function(total, n) {
+ * return total + n;
+ * });
+ * // => 6
+ *
+ * // returns a wrapped value
+ * var squares = wrapped.map(function(n) {
+ * return n * n;
+ * });
+ *
+ * _.isArray(squares);
+ * // => false
+ *
+ * _.isArray(squares.value());
+ * // => true
+ */
+function lodash(value) {
+ if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
+ if (value instanceof LodashWrapper) {
+ return value;
+ }
+ if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
+ return wrapperClone(value);
+ }
+ }
+ return new LodashWrapper(value);
+}
+
+// Ensure wrappers are instances of `baseLodash`.
+lodash.prototype = baseLodash.prototype;
+
+module.exports = lodash;
+
+},{"../internal/LazyWrapper":64,"../internal/LodashWrapper":65,"../internal/baseLodash":86,"../internal/isObjectLike":130,"../internal/wrapperClone":141,"../lang/isArray":144}],56:[function(require,module,exports){
+module.exports = require('./forEach');
+
+},{"./forEach":58}],57:[function(require,module,exports){
+var baseEach = require('../internal/baseEach'),
+ createFind = require('../internal/createFind');
+
+/**
+ * Iterates over elements of `collection`, returning the first element
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias detect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false },
+ * { 'user': 'pebbles', 'age': 1, 'active': true }
+ * ];
+ *
+ * _.result(_.find(users, function(chr) {
+ * return chr.age < 40;
+ * }), 'user');
+ * // => 'barney'
+ *
+ * // using the `_.matches` callback shorthand
+ * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
+ * // => 'pebbles'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.result(_.find(users, 'active', false), 'user');
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.result(_.find(users, 'active'), 'user');
+ * // => 'barney'
+ */
+var find = createFind(baseEach);
+
+module.exports = find;
+
+},{"../internal/baseEach":75,"../internal/createFind":106}],58:[function(require,module,exports){
+var arrayEach = require('../internal/arrayEach'),
+ baseEach = require('../internal/baseEach'),
+ createForEach = require('../internal/createForEach');
+
+/**
+ * Iterates over elements of `collection` invoking `iteratee` for each element.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection). Iteratee functions may exit iteration early
+ * by explicitly returning `false`.
+ *
+ * **Note:** As with other "Collections" methods, objects with a "length" property
+ * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
+ * may be used for object iteration.
+ *
+ * @static
+ * @memberOf _
+ * @alias each
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array|Object|string} Returns `collection`.
+ * @example
+ *
+ * _([1, 2]).forEach(function(n) {
+ * console.log(n);
+ * }).value();
+ * // => logs each value from left to right and returns the array
+ *
+ * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
+ * console.log(n, key);
+ * });
+ * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
+ */
+var forEach = createForEach(arrayEach, baseEach);
+
+module.exports = forEach;
+
+},{"../internal/arrayEach":67,"../internal/baseEach":75,"../internal/createForEach":107}],59:[function(require,module,exports){
+var baseIndexOf = require('../internal/baseIndexOf'),
+ getLength = require('../internal/getLength'),
+ isArray = require('../lang/isArray'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ isLength = require('../internal/isLength'),
+ isString = require('../lang/isString'),
+ values = require('../object/values');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Checks if `target` is in `collection` using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it's used as the offset
+ * from the end of `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @alias contains, include
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {*} target The value to search for.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+ * @returns {boolean} Returns `true` if a matching element is found, else `false`.
+ * @example
+ *
+ * _.includes([1, 2, 3], 1);
+ * // => true
+ *
+ * _.includes([1, 2, 3], 1, 2);
+ * // => false
+ *
+ * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
+ * // => true
+ *
+ * _.includes('pebbles', 'eb');
+ * // => true
+ */
+function includes(collection, target, fromIndex, guard) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ collection = values(collection);
+ length = collection.length;
+ }
+ if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
+ fromIndex = 0;
+ } else {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
+ }
+ return (typeof collection == 'string' || !isArray(collection) && isString(collection))
+ ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1)
+ : (!!length && baseIndexOf(collection, target, fromIndex) > -1);
+}
+
+module.exports = includes;
+
+},{"../internal/baseIndexOf":82,"../internal/getLength":116,"../internal/isIterateeCall":126,"../internal/isLength":129,"../lang/isArray":144,"../lang/isString":150,"../object/values":156}],60:[function(require,module,exports){
+var arrayMap = require('../internal/arrayMap'),
+ baseCallback = require('../internal/baseCallback'),
+ baseMap = require('../internal/baseMap'),
+ isArray = require('../lang/isArray');
+
+/**
+ * Creates an array of values by running each element in `collection` through
+ * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * Many lodash methods are guarded to work as iteratees for methods like
+ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
+ *
+ * The guarded methods are:
+ * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
+ * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
+ * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
+ * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
+ * `sum`, `uniq`, and `words`
+ *
+ * @static
+ * @memberOf _
+ * @alias collect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new mapped array.
+ * @example
+ *
+ * function timesThree(n) {
+ * return n * 3;
+ * }
+ *
+ * _.map([1, 2], timesThree);
+ * // => [3, 6]
+ *
+ * _.map({ 'a': 1, 'b': 2 }, timesThree);
+ * // => [3, 6] (iteration order is not guaranteed)
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * // using the `_.property` callback shorthand
+ * _.map(users, 'user');
+ * // => ['barney', 'fred']
+ */
+function map(collection, iteratee, thisArg) {
+ var func = isArray(collection) ? arrayMap : baseMap;
+ iteratee = baseCallback(iteratee, thisArg, 3);
+ return func(collection, iteratee);
+}
+
+module.exports = map;
+
+},{"../internal/arrayMap":68,"../internal/baseCallback":71,"../internal/baseMap":87,"../lang/isArray":144}],61:[function(require,module,exports){
+var getNative = require('../internal/getNative');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeNow = getNative(Date, 'now');
+
+/**
+ * Gets the number of milliseconds that have elapsed since the Unix epoch
+ * (1 January 1970 00:00:00 UTC).
+ *
+ * @static
+ * @memberOf _
+ * @category Date
+ * @example
+ *
+ * _.defer(function(stamp) {
+ * console.log(_.now() - stamp);
+ * }, _.now());
+ * // => logs the number of milliseconds it took for the deferred function to be invoked
+ */
+var now = nativeNow || function() {
+ return new Date().getTime();
+};
+
+module.exports = now;
+
+},{"../internal/getNative":118}],62:[function(require,module,exports){
+var createWrapper = require('../internal/createWrapper'),
+ replaceHolders = require('../internal/replaceHolders'),
+ restParam = require('./restParam');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ PARTIAL_FLAG = 32;
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of `thisArg`
+ * and prepends any additional `_.bind` arguments to those provided to the
+ * bound function.
+ *
+ * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
+ * may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** Unlike native `Function#bind` this method does not set the "length"
+ * property of bound functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new bound function.
+ * @example
+ *
+ * var greet = function(greeting, punctuation) {
+ * return greeting + ' ' + this.user + punctuation;
+ * };
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * var bound = _.bind(greet, object, 'hi');
+ * bound('!');
+ * // => 'hi fred!'
+ *
+ * // using placeholders
+ * var bound = _.bind(greet, object, _, '!');
+ * bound('hi');
+ * // => 'hi fred!'
+ */
+var bind = restParam(function(func, thisArg, partials) {
+ var bitmask = BIND_FLAG;
+ if (partials.length) {
+ var holders = replaceHolders(partials, bind.placeholder);
+ bitmask |= PARTIAL_FLAG;
+ }
+ return createWrapper(func, bitmask, thisArg, partials, holders);
+});
+
+// Assign default placeholders.
+bind.placeholder = {};
+
+module.exports = bind;
+
+},{"../internal/createWrapper":110,"../internal/replaceHolders":136,"./restParam":63}],63:[function(require,module,exports){
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of the
+ * created function and arguments from `start` and beyond provided as an array.
+ *
+ * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.restParam(function(what, names) {
+ * return what + ' ' + _.initial(names).join(', ') +
+ * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
+ * });
+ *
+ * say('hello', 'fred', 'barney', 'pebbles');
+ * // => 'hello fred, barney, & pebbles'
+ */
+function restParam(func, start) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
+ return function() {
+ var args = arguments,
+ index = -1,
+ length = nativeMax(args.length - start, 0),
+ rest = Array(length);
+
+ while (++index < length) {
+ rest[index] = args[start + index];
+ }
+ switch (start) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, args[0], rest);
+ case 2: return func.call(this, args[0], args[1], rest);
+ }
+ var otherArgs = Array(start + 1);
+ index = -1;
+ while (++index < start) {
+ otherArgs[index] = args[index];
+ }
+ otherArgs[start] = rest;
+ return func.apply(this, otherArgs);
+ };
+}
+
+module.exports = restParam;
+
+},{}],64:[function(require,module,exports){
+var baseCreate = require('./baseCreate'),
+ baseLodash = require('./baseLodash');
+
+/** Used as references for `-Infinity` and `Infinity`. */
+var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
+
+/**
+ * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ */
+function LazyWrapper(value) {
+ this.__wrapped__ = value;
+ this.__actions__ = [];
+ this.__dir__ = 1;
+ this.__filtered__ = false;
+ this.__iteratees__ = [];
+ this.__takeCount__ = POSITIVE_INFINITY;
+ this.__views__ = [];
+}
+
+LazyWrapper.prototype = baseCreate(baseLodash.prototype);
+LazyWrapper.prototype.constructor = LazyWrapper;
+
+module.exports = LazyWrapper;
+
+},{"./baseCreate":74,"./baseLodash":86}],65:[function(require,module,exports){
+var baseCreate = require('./baseCreate'),
+ baseLodash = require('./baseLodash');
+
+/**
+ * The base constructor for creating `lodash` wrapper objects.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ * @param {boolean} [chainAll] Enable chaining for all wrapper methods.
+ * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.
+ */
+function LodashWrapper(value, chainAll, actions) {
+ this.__wrapped__ = value;
+ this.__actions__ = actions || [];
+ this.__chain__ = !!chainAll;
+}
+
+LodashWrapper.prototype = baseCreate(baseLodash.prototype);
+LodashWrapper.prototype.constructor = LodashWrapper;
+
+module.exports = LodashWrapper;
+
+},{"./baseCreate":74,"./baseLodash":86}],66:[function(require,module,exports){
+/**
+ * Copies the values of `source` to `array`.
+ *
+ * @private
+ * @param {Array} source The array to copy values from.
+ * @param {Array} [array=[]] The array to copy values to.
+ * @returns {Array} Returns `array`.
+ */
+function arrayCopy(source, array) {
+ var index = -1,
+ length = source.length;
+
+ array || (array = Array(length));
+ while (++index < length) {
+ array[index] = source[index];
+ }
+ return array;
+}
+
+module.exports = arrayCopy;
+
+},{}],67:[function(require,module,exports){
+/**
+ * A specialized version of `_.forEach` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+function arrayEach(array, iteratee) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+}
+
+module.exports = arrayEach;
+
+},{}],68:[function(require,module,exports){
+/**
+ * A specialized version of `_.map` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+}
+
+module.exports = arrayMap;
+
+},{}],69:[function(require,module,exports){
+/**
+ * A specialized version of `_.some` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+function arraySome(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (predicate(array[index], index, array)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+module.exports = arraySome;
+
+},{}],70:[function(require,module,exports){
+var baseCopy = require('./baseCopy'),
+ keys = require('../object/keys');
+
+/**
+ * The base implementation of `_.assign` without support for argument juggling,
+ * multiple sources, and `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+function baseAssign(object, source) {
+ return source == null
+ ? object
+ : baseCopy(source, keys(source), object);
+}
+
+module.exports = baseAssign;
+
+},{"../object/keys":153,"./baseCopy":73}],71:[function(require,module,exports){
+var baseMatches = require('./baseMatches'),
+ baseMatchesProperty = require('./baseMatchesProperty'),
+ bindCallback = require('./bindCallback'),
+ identity = require('../utility/identity'),
+ property = require('../utility/property');
+
+/**
+ * The base implementation of `_.callback` which supports specifying the
+ * number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {*} [func=_.identity] The value to convert to a callback.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function baseCallback(func, thisArg, argCount) {
+ var type = typeof func;
+ if (type == 'function') {
+ return thisArg === undefined
+ ? func
+ : bindCallback(func, thisArg, argCount);
+ }
+ if (func == null) {
+ return identity;
+ }
+ if (type == 'object') {
+ return baseMatches(func);
+ }
+ return thisArg === undefined
+ ? property(func)
+ : baseMatchesProperty(func, thisArg);
+}
+
+module.exports = baseCallback;
+
+},{"../utility/identity":158,"../utility/property":160,"./baseMatches":88,"./baseMatchesProperty":89,"./bindCallback":98}],72:[function(require,module,exports){
+var arrayCopy = require('./arrayCopy'),
+ arrayEach = require('./arrayEach'),
+ baseAssign = require('./baseAssign'),
+ baseForOwn = require('./baseForOwn'),
+ initCloneArray = require('./initCloneArray'),
+ initCloneByTag = require('./initCloneByTag'),
+ initCloneObject = require('./initCloneObject'),
+ isArray = require('../lang/isArray'),
+ isHostObject = require('./isHostObject'),
+ isObject = require('../lang/isObject');
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values supported by `_.clone`. */
+var cloneableTags = {};
+cloneableTags[argsTag] = cloneableTags[arrayTag] =
+cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
+cloneableTags[dateTag] = cloneableTags[float32Tag] =
+cloneableTags[float64Tag] = cloneableTags[int8Tag] =
+cloneableTags[int16Tag] = cloneableTags[int32Tag] =
+cloneableTags[numberTag] = cloneableTags[objectTag] =
+cloneableTags[regexpTag] = cloneableTags[stringTag] =
+cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
+cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
+cloneableTags[errorTag] = cloneableTags[funcTag] =
+cloneableTags[mapTag] = cloneableTags[setTag] =
+cloneableTags[weakMapTag] = false;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * The base implementation of `_.clone` without support for argument juggling
+ * and `this` binding `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {string} [key] The key of `value`.
+ * @param {Object} [object] The object `value` belongs to.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates clones with source counterparts.
+ * @returns {*} Returns the cloned value.
+ */
+function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
+ var result;
+ if (customizer) {
+ result = object ? customizer(value, key, object) : customizer(value);
+ }
+ if (result !== undefined) {
+ return result;
+ }
+ if (!isObject(value)) {
+ return value;
+ }
+ var isArr = isArray(value);
+ if (isArr) {
+ result = initCloneArray(value);
+ if (!isDeep) {
+ return arrayCopy(value, result);
+ }
+ } else {
+ var tag = objToString.call(value),
+ isFunc = tag == funcTag;
+
+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
+ if (isHostObject(value)) {
+ return object ? value : {};
+ }
+ result = initCloneObject(isFunc ? {} : value);
+ if (!isDeep) {
+ return baseAssign(result, value);
+ }
+ } else {
+ return cloneableTags[tag]
+ ? initCloneByTag(value, tag, isDeep)
+ : (object ? value : {});
+ }
+ }
+ // Check for circular references and return its corresponding clone.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == value) {
+ return stackB[length];
+ }
+ }
+ // Add the source value to the stack of traversed objects and associate it with its clone.
+ stackA.push(value);
+ stackB.push(result);
+
+ // Recursively populate clone (susceptible to call stack limits).
+ (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
+ result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
+ });
+ return result;
+}
+
+module.exports = baseClone;
+
+},{"../lang/isArray":144,"../lang/isObject":148,"./arrayCopy":66,"./arrayEach":67,"./baseAssign":70,"./baseForOwn":80,"./initCloneArray":120,"./initCloneByTag":121,"./initCloneObject":122,"./isHostObject":124}],73:[function(require,module,exports){
+/**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property names to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @returns {Object} Returns `object`.
+ */
+function baseCopy(source, props, object) {
+ object || (object = {});
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ object[key] = source[key];
+ }
+ return object;
+}
+
+module.exports = baseCopy;
+
+},{}],74:[function(require,module,exports){
+var isObject = require('../lang/isObject');
+
+/**
+ * The base implementation of `_.create` without support for assigning
+ * properties to the created object.
+ *
+ * @private
+ * @param {Object} prototype The object to inherit from.
+ * @returns {Object} Returns the new object.
+ */
+var baseCreate = (function() {
+ function object() {}
+ return function(prototype) {
+ if (isObject(prototype)) {
+ object.prototype = prototype;
+ var result = new object;
+ object.prototype = undefined;
+ }
+ return result || {};
+ };
+}());
+
+module.exports = baseCreate;
+
+},{"../lang/isObject":148}],75:[function(require,module,exports){
+var baseForOwn = require('./baseForOwn'),
+ createBaseEach = require('./createBaseEach');
+
+/**
+ * The base implementation of `_.forEach` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object|string} Returns `collection`.
+ */
+var baseEach = createBaseEach(baseForOwn);
+
+module.exports = baseEach;
+
+},{"./baseForOwn":80,"./createBaseEach":102}],76:[function(require,module,exports){
+/**
+ * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
+ * without support for callback shorthands and `this` binding, which iterates
+ * over `collection` using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @param {boolean} [retKey] Specify returning the key of the found element
+ * instead of the element itself.
+ * @returns {*} Returns the found element or its key, else `undefined`.
+ */
+function baseFind(collection, predicate, eachFunc, retKey) {
+ var result;
+ eachFunc(collection, function(value, key, collection) {
+ if (predicate(value, key, collection)) {
+ result = retKey ? key : value;
+ return false;
+ }
+ });
+ return result;
+}
+
+module.exports = baseFind;
+
+},{}],77:[function(require,module,exports){
+/**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseFindIndex(array, predicate, fromRight) {
+ var length = array.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseFindIndex;
+
+},{}],78:[function(require,module,exports){
+var createBaseFor = require('./createBaseFor');
+
+/**
+ * The base implementation of `baseForIn` and `baseForOwn` which iterates
+ * over `object` properties returned by `keysFunc` invoking `iteratee` for
+ * each property. Iteratee functions may exit iteration early by explicitly
+ * returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+var baseFor = createBaseFor();
+
+module.exports = baseFor;
+
+},{"./createBaseFor":103}],79:[function(require,module,exports){
+var baseFor = require('./baseFor'),
+ keysIn = require('../object/keysIn');
+
+/**
+ * The base implementation of `_.forIn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForIn(object, iteratee) {
+ return baseFor(object, iteratee, keysIn);
+}
+
+module.exports = baseForIn;
+
+},{"../object/keysIn":154,"./baseFor":78}],80:[function(require,module,exports){
+var baseFor = require('./baseFor'),
+ keys = require('../object/keys');
+
+/**
+ * The base implementation of `_.forOwn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForOwn(object, iteratee) {
+ return baseFor(object, iteratee, keys);
+}
+
+module.exports = baseForOwn;
+
+},{"../object/keys":153,"./baseFor":78}],81:[function(require,module,exports){
+var toObject = require('./toObject');
+
+/**
+ * The base implementation of `get` without support for string paths
+ * and default values.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} path The path of the property to get.
+ * @param {string} [pathKey] The key representation of path.
+ * @returns {*} Returns the resolved value.
+ */
+function baseGet(object, path, pathKey) {
+ if (object == null) {
+ return;
+ }
+ object = toObject(object);
+ if (pathKey !== undefined && pathKey in object) {
+ path = [pathKey];
+ }
+ var index = 0,
+ length = path.length;
+
+ while (object != null && index < length) {
+ object = toObject(object)[path[index++]];
+ }
+ return (index && index == length) ? object : undefined;
+}
+
+module.exports = baseGet;
+
+},{"./toObject":139}],82:[function(require,module,exports){
+var indexOfNaN = require('./indexOfNaN');
+
+/**
+ * The base implementation of `_.indexOf` without support for binary searches.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseIndexOf(array, value, fromIndex) {
+ if (value !== value) {
+ return indexOfNaN(array, fromIndex);
+ }
+ var index = fromIndex - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseIndexOf;
+
+},{"./indexOfNaN":119}],83:[function(require,module,exports){
+var baseIsEqualDeep = require('./baseIsEqualDeep'),
+ isObject = require('../lang/isObject'),
+ isObjectLike = require('./isObjectLike');
+
+/**
+ * The base implementation of `_.isEqual` without support for `this` binding
+ * `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ */
+function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
+ if (value === other) {
+ return true;
+ }
+ if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
+ return value !== value && other !== other;
+ }
+ return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
+}
+
+module.exports = baseIsEqual;
+
+},{"../lang/isObject":148,"./baseIsEqualDeep":84,"./isObjectLike":130}],84:[function(require,module,exports){
+var equalArrays = require('./equalArrays'),
+ equalByTag = require('./equalByTag'),
+ equalObjects = require('./equalObjects'),
+ isArray = require('../lang/isArray'),
+ isHostObject = require('./isHostObject'),
+ isTypedArray = require('../lang/isTypedArray');
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
+ * deep comparisons and tracks traversed objects enabling objects with circular
+ * references to be compared.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA=[]] Tracks traversed `value` objects.
+ * @param {Array} [stackB=[]] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objIsArr = isArray(object),
+ othIsArr = isArray(other),
+ objTag = arrayTag,
+ othTag = arrayTag;
+
+ if (!objIsArr) {
+ objTag = objToString.call(object);
+ if (objTag == argsTag) {
+ objTag = objectTag;
+ } else if (objTag != objectTag) {
+ objIsArr = isTypedArray(object);
+ }
+ }
+ if (!othIsArr) {
+ othTag = objToString.call(other);
+ if (othTag == argsTag) {
+ othTag = objectTag;
+ } else if (othTag != objectTag) {
+ othIsArr = isTypedArray(other);
+ }
+ }
+ var objIsObj = objTag == objectTag && !isHostObject(object),
+ othIsObj = othTag == objectTag && !isHostObject(other),
+ isSameTag = objTag == othTag;
+
+ if (isSameTag && !(objIsArr || objIsObj)) {
+ return equalByTag(object, other, objTag);
+ }
+ if (!isLoose) {
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+
+ if (objIsWrapped || othIsWrapped) {
+ return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
+ }
+ }
+ if (!isSameTag) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ // For more information on detecting circular references see https://es5.github.io/#JO.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == object) {
+ return stackB[length] == other;
+ }
+ }
+ // Add `object` and `other` to the stack of traversed objects.
+ stackA.push(object);
+ stackB.push(other);
+
+ var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
+
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+}
+
+module.exports = baseIsEqualDeep;
+
+},{"../lang/isArray":144,"../lang/isTypedArray":151,"./equalArrays":111,"./equalByTag":112,"./equalObjects":113,"./isHostObject":124}],85:[function(require,module,exports){
+var baseIsEqual = require('./baseIsEqual'),
+ toObject = require('./toObject');
+
+/**
+ * The base implementation of `_.isMatch` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} matchData The propery names, values, and compare flags to match.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ */
+function baseIsMatch(object, matchData, customizer) {
+ var index = matchData.length,
+ length = index,
+ noCustomizer = !customizer;
+
+ if (object == null) {
+ return !length;
+ }
+ object = toObject(object);
+ while (index--) {
+ var data = matchData[index];
+ if ((noCustomizer && data[2])
+ ? data[1] !== object[data[0]]
+ : !(data[0] in object)
+ ) {
+ return false;
+ }
+ }
+ while (++index < length) {
+ data = matchData[index];
+ var key = data[0],
+ objValue = object[key],
+ srcValue = data[1];
+
+ if (noCustomizer && data[2]) {
+ if (objValue === undefined && !(key in object)) {
+ return false;
+ }
+ } else {
+ var result = customizer ? customizer(objValue, srcValue, key) : undefined;
+ if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+module.exports = baseIsMatch;
+
+},{"./baseIsEqual":83,"./toObject":139}],86:[function(require,module,exports){
+/**
+ * The function whose prototype all chaining wrappers inherit from.
+ *
+ * @private
+ */
+function baseLodash() {
+ // No operation performed.
+}
+
+module.exports = baseLodash;
+
+},{}],87:[function(require,module,exports){
+var baseEach = require('./baseEach'),
+ isArrayLike = require('./isArrayLike');
+
+/**
+ * The base implementation of `_.map` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function baseMap(collection, iteratee) {
+ var index = -1,
+ result = isArrayLike(collection) ? Array(collection.length) : [];
+
+ baseEach(collection, function(value, key, collection) {
+ result[++index] = iteratee(value, key, collection);
+ });
+ return result;
+}
+
+module.exports = baseMap;
+
+},{"./baseEach":75,"./isArrayLike":123}],88:[function(require,module,exports){
+var baseIsMatch = require('./baseIsMatch'),
+ getMatchData = require('./getMatchData'),
+ toObject = require('./toObject');
+
+/**
+ * The base implementation of `_.matches` which does not clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new function.
+ */
+function baseMatches(source) {
+ var matchData = getMatchData(source);
+ if (matchData.length == 1 && matchData[0][2]) {
+ var key = matchData[0][0],
+ value = matchData[0][1];
+
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ object = toObject(object);
+ return object[key] === value && (value !== undefined || (key in object));
+ };
+ }
+ return function(object) {
+ return baseIsMatch(object, matchData);
+ };
+}
+
+module.exports = baseMatches;
+
+},{"./baseIsMatch":85,"./getMatchData":117,"./toObject":139}],89:[function(require,module,exports){
+var baseGet = require('./baseGet'),
+ baseIsEqual = require('./baseIsEqual'),
+ baseSlice = require('./baseSlice'),
+ isArray = require('../lang/isArray'),
+ isKey = require('./isKey'),
+ isStrictComparable = require('./isStrictComparable'),
+ last = require('../array/last'),
+ toObject = require('./toObject'),
+ toPath = require('./toPath');
+
+/**
+ * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
+ *
+ * @private
+ * @param {string} path The path of the property to get.
+ * @param {*} srcValue The value to compare.
+ * @returns {Function} Returns the new function.
+ */
+function baseMatchesProperty(path, srcValue) {
+ var isArr = isArray(path),
+ isCommon = isKey(path) && isStrictComparable(srcValue),
+ pathKey = (path + '');
+
+ path = toPath(path);
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ var key = pathKey;
+ object = toObject(object);
+ if ((isArr || !isCommon) && !(key in object)) {
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
+ key = last(path);
+ object = toObject(object);
+ }
+ return object[key] === srcValue
+ ? (srcValue !== undefined || (key in object))
+ : baseIsEqual(srcValue, object[key], undefined, true);
+ };
+}
+
+module.exports = baseMatchesProperty;
+
+},{"../array/last":54,"../lang/isArray":144,"./baseGet":81,"./baseIsEqual":83,"./baseSlice":93,"./isKey":127,"./isStrictComparable":131,"./toObject":139,"./toPath":140}],90:[function(require,module,exports){
+var toObject = require('./toObject');
+
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : toObject(object)[key];
+ };
+}
+
+module.exports = baseProperty;
+
+},{"./toObject":139}],91:[function(require,module,exports){
+var baseGet = require('./baseGet'),
+ toPath = require('./toPath');
+
+/**
+ * A specialized version of `baseProperty` which supports deep paths.
+ *
+ * @private
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function basePropertyDeep(path) {
+ var pathKey = (path + '');
+ path = toPath(path);
+ return function(object) {
+ return baseGet(object, path, pathKey);
+ };
+}
+
+module.exports = basePropertyDeep;
+
+},{"./baseGet":81,"./toPath":140}],92:[function(require,module,exports){
+var identity = require('../utility/identity'),
+ metaMap = require('./metaMap');
+
+/**
+ * The base implementation of `setData` without support for hot loop detection.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+var baseSetData = !metaMap ? identity : function(func, data) {
+ metaMap.set(func, data);
+ return func;
+};
+
+module.exports = baseSetData;
+
+},{"../utility/identity":158,"./metaMap":133}],93:[function(require,module,exports){
+/**
+ * The base implementation of `_.slice` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+function baseSlice(array, start, end) {
+ var index = -1,
+ length = array.length;
+
+ start = start == null ? 0 : (+start || 0);
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = (end === undefined || end > length) ? length : (+end || 0);
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : ((end - start) >>> 0);
+ start >>>= 0;
+
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = array[index + start];
+ }
+ return result;
+}
+
+module.exports = baseSlice;
+
+},{}],94:[function(require,module,exports){
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` or `undefined` values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ return value == null ? '' : (value + '');
+}
+
+module.exports = baseToString;
+
+},{}],95:[function(require,module,exports){
+/**
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
+ * array of `object` property values corresponding to the property names
+ * of `props`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} props The property names to get values for.
+ * @returns {Object} Returns the array of property values.
+ */
+function baseValues(object, props) {
+ var index = -1,
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = object[props[index]];
+ }
+ return result;
+}
+
+module.exports = baseValues;
+
+},{}],96:[function(require,module,exports){
+var binaryIndexBy = require('./binaryIndexBy'),
+ identity = require('../utility/identity');
+
+/** Used as references for the maximum length and index of an array. */
+var MAX_ARRAY_LENGTH = 4294967295,
+ HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
+
+/**
+ * Performs a binary search of `array` to determine the index at which `value`
+ * should be inserted into `array` in order to maintain its sort order.
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ */
+function binaryIndex(array, value, retHighest) {
+ var low = 0,
+ high = array ? array.length : low;
+
+ if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
+ while (low < high) {
+ var mid = (low + high) >>> 1,
+ computed = array[mid];
+
+ if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return high;
+ }
+ return binaryIndexBy(array, value, identity, retHighest);
+}
+
+module.exports = binaryIndex;
+
+},{"../utility/identity":158,"./binaryIndexBy":97}],97:[function(require,module,exports){
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor,
+ nativeMin = Math.min;
+
+/** Used as references for the maximum length and index of an array. */
+var MAX_ARRAY_LENGTH = 4294967295,
+ MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
+
+/**
+ * This function is like `binaryIndex` except that it invokes `iteratee` for
+ * `value` and each element of `array` to compute their sort ranking. The
+ * iteratee is invoked with one argument; (value).
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ */
+function binaryIndexBy(array, value, iteratee, retHighest) {
+ value = iteratee(value);
+
+ var low = 0,
+ high = array ? array.length : 0,
+ valIsNaN = value !== value,
+ valIsNull = value === null,
+ valIsUndef = value === undefined;
+
+ while (low < high) {
+ var mid = nativeFloor((low + high) / 2),
+ computed = iteratee(array[mid]),
+ isDef = computed !== undefined,
+ isReflexive = computed === computed;
+
+ if (valIsNaN) {
+ var setLow = isReflexive || retHighest;
+ } else if (valIsNull) {
+ setLow = isReflexive && isDef && (retHighest || computed != null);
+ } else if (valIsUndef) {
+ setLow = isReflexive && (retHighest || isDef);
+ } else if (computed == null) {
+ setLow = false;
+ } else {
+ setLow = retHighest ? (computed <= value) : (computed < value);
+ }
+ if (setLow) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return nativeMin(high, MAX_ARRAY_INDEX);
+}
+
+module.exports = binaryIndexBy;
+
+},{}],98:[function(require,module,exports){
+var identity = require('../utility/identity');
+
+/**
+ * A specialized version of `baseCallback` which only supports `this` binding
+ * and specifying the number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function bindCallback(func, thisArg, argCount) {
+ if (typeof func != 'function') {
+ return identity;
+ }
+ if (thisArg === undefined) {
+ return func;
+ }
+ switch (argCount) {
+ case 1: return function(value) {
+ return func.call(thisArg, value);
+ };
+ case 3: return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ case 4: return function(accumulator, value, index, collection) {
+ return func.call(thisArg, accumulator, value, index, collection);
+ };
+ case 5: return function(value, other, key, object, source) {
+ return func.call(thisArg, value, other, key, object, source);
+ };
+ }
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+}
+
+module.exports = bindCallback;
+
+},{"../utility/identity":158}],99:[function(require,module,exports){
+(function (global){
+/** Native method references. */
+var ArrayBuffer = global.ArrayBuffer,
+ Uint8Array = global.Uint8Array;
+
+/**
+ * Creates a clone of the given array buffer.
+ *
+ * @private
+ * @param {ArrayBuffer} buffer The array buffer to clone.
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
+ */
+function bufferClone(buffer) {
+ var result = new ArrayBuffer(buffer.byteLength),
+ view = new Uint8Array(result);
+
+ view.set(new Uint8Array(buffer));
+ return result;
+}
+
+module.exports = bufferClone;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2J1ZmZlckNsb25lLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJmaWxlIjoiZ2VuZXJhdGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBOYXRpdmUgbWV0aG9kIHJlZmVyZW5jZXMuICovXG52YXIgQXJyYXlCdWZmZXIgPSBnbG9iYWwuQXJyYXlCdWZmZXIsXG4gICAgVWludDhBcnJheSA9IGdsb2JhbC5VaW50OEFycmF5O1xuXG4vKipcbiAqIENyZWF0ZXMgYSBjbG9uZSBvZiB0aGUgZ2l2ZW4gYXJyYXkgYnVmZmVyLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0FycmF5QnVmZmVyfSBidWZmZXIgVGhlIGFycmF5IGJ1ZmZlciB0byBjbG9uZS5cbiAqIEByZXR1cm5zIHtBcnJheUJ1ZmZlcn0gUmV0dXJucyB0aGUgY2xvbmVkIGFycmF5IGJ1ZmZlci5cbiAqL1xuZnVuY3Rpb24gYnVmZmVyQ2xvbmUoYnVmZmVyKSB7XG4gIHZhciByZXN1bHQgPSBuZXcgQXJyYXlCdWZmZXIoYnVmZmVyLmJ5dGVMZW5ndGgpLFxuICAgICAgdmlldyA9IG5ldyBVaW50OEFycmF5KHJlc3VsdCk7XG5cbiAgdmlldy5zZXQobmV3IFVpbnQ4QXJyYXkoYnVmZmVyKSk7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYnVmZmVyQ2xvbmU7XG4iXX0=
+},{}],100:[function(require,module,exports){
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates an array that is the composition of partially applied arguments,
+ * placeholders, and provided arguments into a single array of arguments.
+ *
+ * @private
+ * @param {Array|Object} args The provided arguments.
+ * @param {Array} partials The arguments to prepend to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @returns {Array} Returns the new array of composed arguments.
+ */
+function composeArgs(args, partials, holders) {
+ var holdersLength = holders.length,
+ argsIndex = -1,
+ argsLength = nativeMax(args.length - holdersLength, 0),
+ leftIndex = -1,
+ leftLength = partials.length,
+ result = Array(leftLength + argsLength);
+
+ while (++leftIndex < leftLength) {
+ result[leftIndex] = partials[leftIndex];
+ }
+ while (++argsIndex < holdersLength) {
+ result[holders[argsIndex]] = args[argsIndex];
+ }
+ while (argsLength--) {
+ result[leftIndex++] = args[argsIndex++];
+ }
+ return result;
+}
+
+module.exports = composeArgs;
+
+},{}],101:[function(require,module,exports){
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * This function is like `composeArgs` except that the arguments composition
+ * is tailored for `_.partialRight`.
+ *
+ * @private
+ * @param {Array|Object} args The provided arguments.
+ * @param {Array} partials The arguments to append to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @returns {Array} Returns the new array of composed arguments.
+ */
+function composeArgsRight(args, partials, holders) {
+ var holdersIndex = -1,
+ holdersLength = holders.length,
+ argsIndex = -1,
+ argsLength = nativeMax(args.length - holdersLength, 0),
+ rightIndex = -1,
+ rightLength = partials.length,
+ result = Array(argsLength + rightLength);
+
+ while (++argsIndex < argsLength) {
+ result[argsIndex] = args[argsIndex];
+ }
+ var offset = argsIndex;
+ while (++rightIndex < rightLength) {
+ result[offset + rightIndex] = partials[rightIndex];
+ }
+ while (++holdersIndex < holdersLength) {
+ result[offset + holders[holdersIndex]] = args[argsIndex++];
+ }
+ return result;
+}
+
+module.exports = composeArgsRight;
+
+},{}],102:[function(require,module,exports){
+var getLength = require('./getLength'),
+ isLength = require('./isLength'),
+ toObject = require('./toObject');
+
+/**
+ * Creates a `baseEach` or `baseEachRight` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseEach(eachFunc, fromRight) {
+ return function(collection, iteratee) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ return eachFunc(collection, iteratee);
+ }
+ var index = fromRight ? length : -1,
+ iterable = toObject(collection);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (iteratee(iterable[index], index, iterable) === false) {
+ break;
+ }
+ }
+ return collection;
+ };
+}
+
+module.exports = createBaseEach;
+
+},{"./getLength":116,"./isLength":129,"./toObject":139}],103:[function(require,module,exports){
+var toObject = require('./toObject');
+
+/**
+ * Creates a base function for `_.forIn` or `_.forInRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var iterable = toObject(object),
+ props = keysFunc(object),
+ length = props.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var key = props[index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+}
+
+module.exports = createBaseFor;
+
+},{"./toObject":139}],104:[function(require,module,exports){
+(function (global){
+var createCtorWrapper = require('./createCtorWrapper');
+
+/**
+ * Creates a function that wraps `func` and invokes it with the `this`
+ * binding of `thisArg`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @returns {Function} Returns the new bound function.
+ */
+function createBindWrapper(func, thisArg) {
+ var Ctor = createCtorWrapper(func);
+
+ function wrapper() {
+ var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
+ return fn.apply(thisArg, arguments);
+ }
+ return wrapper;
+}
+
+module.exports = createBindWrapper;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2NyZWF0ZUJpbmRXcmFwcGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6ImdlbmVyYXRlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY3JlYXRlQ3RvcldyYXBwZXIgPSByZXF1aXJlKCcuL2NyZWF0ZUN0b3JXcmFwcGVyJyk7XG5cbi8qKlxuICogQ3JlYXRlcyBhIGZ1bmN0aW9uIHRoYXQgd3JhcHMgYGZ1bmNgIGFuZCBpbnZva2VzIGl0IHdpdGggdGhlIGB0aGlzYFxuICogYmluZGluZyBvZiBgdGhpc0FyZ2AuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7RnVuY3Rpb259IGZ1bmMgVGhlIGZ1bmN0aW9uIHRvIGJpbmQuXG4gKiBAcGFyYW0geyp9IFt0aGlzQXJnXSBUaGUgYHRoaXNgIGJpbmRpbmcgb2YgYGZ1bmNgLlxuICogQHJldHVybnMge0Z1bmN0aW9ufSBSZXR1cm5zIHRoZSBuZXcgYm91bmQgZnVuY3Rpb24uXG4gKi9cbmZ1bmN0aW9uIGNyZWF0ZUJpbmRXcmFwcGVyKGZ1bmMsIHRoaXNBcmcpIHtcbiAgdmFyIEN0b3IgPSBjcmVhdGVDdG9yV3JhcHBlcihmdW5jKTtcblxuICBmdW5jdGlvbiB3cmFwcGVyKCkge1xuICAgIHZhciBmbiA9ICh0aGlzICYmIHRoaXMgIT09IGdsb2JhbCAmJiB0aGlzIGluc3RhbmNlb2Ygd3JhcHBlcikgPyBDdG9yIDogZnVuYztcbiAgICByZXR1cm4gZm4uYXBwbHkodGhpc0FyZywgYXJndW1lbnRzKTtcbiAgfVxuICByZXR1cm4gd3JhcHBlcjtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBjcmVhdGVCaW5kV3JhcHBlcjtcbiJdfQ==
+},{"./createCtorWrapper":105}],105:[function(require,module,exports){
+var baseCreate = require('./baseCreate'),
+ isObject = require('../lang/isObject');
+
+/**
+ * Creates a function that produces an instance of `Ctor` regardless of
+ * whether it was invoked as part of a `new` expression or by `call` or `apply`.
+ *
+ * @private
+ * @param {Function} Ctor The constructor to wrap.
+ * @returns {Function} Returns the new wrapped function.
+ */
+function createCtorWrapper(Ctor) {
+ return function() {
+ // Use a `switch` statement to work with class constructors.
+ // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
+ // for more details.
+ var args = arguments;
+ switch (args.length) {
+ case 0: return new Ctor;
+ case 1: return new Ctor(args[0]);
+ case 2: return new Ctor(args[0], args[1]);
+ case 3: return new Ctor(args[0], args[1], args[2]);
+ case 4: return new Ctor(args[0], args[1], args[2], args[3]);
+ case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
+ case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
+ case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
+ }
+ var thisBinding = baseCreate(Ctor.prototype),
+ result = Ctor.apply(thisBinding, args);
+
+ // Mimic the constructor's `return` behavior.
+ // See https://es5.github.io/#x13.2.2 for more details.
+ return isObject(result) ? result : thisBinding;
+ };
+}
+
+module.exports = createCtorWrapper;
+
+},{"../lang/isObject":148,"./baseCreate":74}],106:[function(require,module,exports){
+var baseCallback = require('./baseCallback'),
+ baseFind = require('./baseFind'),
+ baseFindIndex = require('./baseFindIndex'),
+ isArray = require('../lang/isArray');
+
+/**
+ * Creates a `_.find` or `_.findLast` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new find function.
+ */
+function createFind(eachFunc, fromRight) {
+ return function(collection, predicate, thisArg) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ if (isArray(collection)) {
+ var index = baseFindIndex(collection, predicate, fromRight);
+ return index > -1 ? collection[index] : undefined;
+ }
+ return baseFind(collection, predicate, eachFunc);
+ };
+}
+
+module.exports = createFind;
+
+},{"../lang/isArray":144,"./baseCallback":71,"./baseFind":76,"./baseFindIndex":77}],107:[function(require,module,exports){
+var bindCallback = require('./bindCallback'),
+ isArray = require('../lang/isArray');
+
+/**
+ * Creates a function for `_.forEach` or `_.forEachRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+function createForEach(arrayFunc, eachFunc) {
+ return function(collection, iteratee, thisArg) {
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee)
+ : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
+ };
+}
+
+module.exports = createForEach;
+
+},{"../lang/isArray":144,"./bindCallback":98}],108:[function(require,module,exports){
+(function (global){
+var arrayCopy = require('./arrayCopy'),
+ composeArgs = require('./composeArgs'),
+ composeArgsRight = require('./composeArgsRight'),
+ createCtorWrapper = require('./createCtorWrapper'),
+ isLaziable = require('./isLaziable'),
+ reorder = require('./reorder'),
+ replaceHolders = require('./replaceHolders'),
+ setData = require('./setData');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ BIND_KEY_FLAG = 2,
+ CURRY_BOUND_FLAG = 4,
+ CURRY_FLAG = 8,
+ CURRY_RIGHT_FLAG = 16,
+ PARTIAL_FLAG = 32,
+ PARTIAL_RIGHT_FLAG = 64,
+ ARY_FLAG = 128;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that wraps `func` and invokes it with optional `this`
+ * binding of, partial application, and currying.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to reference.
+ * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to prepend to those provided to the new function.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [partialsRight] The arguments to append to those provided to the new function.
+ * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */
+function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
+ var isAry = bitmask & ARY_FLAG,
+ isBind = bitmask & BIND_FLAG,
+ isBindKey = bitmask & BIND_KEY_FLAG,
+ isCurry = bitmask & CURRY_FLAG,
+ isCurryBound = bitmask & CURRY_BOUND_FLAG,
+ isCurryRight = bitmask & CURRY_RIGHT_FLAG,
+ Ctor = isBindKey ? undefined : createCtorWrapper(func);
+
+ function wrapper() {
+ // Avoid `arguments` object use disqualifying optimizations by
+ // converting it to an array before providing it to other functions.
+ var length = arguments.length,
+ index = length,
+ args = Array(length);
+
+ while (index--) {
+ args[index] = arguments[index];
+ }
+ if (partials) {
+ args = composeArgs(args, partials, holders);
+ }
+ if (partialsRight) {
+ args = composeArgsRight(args, partialsRight, holdersRight);
+ }
+ if (isCurry || isCurryRight) {
+ var placeholder = wrapper.placeholder,
+ argsHolders = replaceHolders(args, placeholder);
+
+ length -= argsHolders.length;
+ if (length < arity) {
+ var newArgPos = argPos ? arrayCopy(argPos) : undefined,
+ newArity = nativeMax(arity - length, 0),
+ newsHolders = isCurry ? argsHolders : undefined,
+ newHoldersRight = isCurry ? undefined : argsHolders,
+ newPartials = isCurry ? args : undefined,
+ newPartialsRight = isCurry ? undefined : args;
+
+ bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
+ bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
+
+ if (!isCurryBound) {
+ bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
+ }
+ var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
+ result = createHybridWrapper.apply(undefined, newData);
+
+ if (isLaziable(func)) {
+ setData(result, newData);
+ }
+ result.placeholder = placeholder;
+ return result;
+ }
+ }
+ var thisBinding = isBind ? thisArg : this,
+ fn = isBindKey ? thisBinding[func] : func;
+
+ if (argPos) {
+ args = reorder(args, argPos);
+ }
+ if (isAry && ary < args.length) {
+ args.length = ary;
+ }
+ if (this && this !== global && this instanceof wrapper) {
+ fn = Ctor || createCtorWrapper(func);
+ }
+ return fn.apply(thisBinding, args);
+ }
+ return wrapper;
+}
+
+module.exports = createHybridWrapper;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2NyZWF0ZUh5YnJpZFdyYXBwZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0F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XG4gICAgICAgIGZuID0gaXNCaW5kS2V5ID8gdGhpc0JpbmRpbmdbZnVuY10gOiBmdW5jO1xuXG4gICAgaWYgKGFyZ1Bvcykge1xuICAgICAgYXJncyA9IHJlb3JkZXIoYXJncywgYXJnUG9zKTtcbiAgICB9XG4gICAgaWYgKGlzQXJ5ICYmIGFyeSA8IGFyZ3MubGVuZ3RoKSB7XG4gICAgICBhcmdzLmxlbmd0aCA9IGFyeTtcbiAgICB9XG4gICAgaWYgKHRoaXMgJiYgdGhpcyAhPT0gZ2xvYmFsICYmIHRoaXMgaW5zdGFuY2VvZiB3cmFwcGVyKSB7XG4gICAgICBmbiA9IEN0b3IgfHwgY3JlYXRlQ3RvcldyYXBwZXIoZnVuYyk7XG4gICAgfVxuICAgIHJldHVybiBmbi5hcHBseSh0aGlzQmluZGluZywgYXJncyk7XG4gIH1cbiAgcmV0dXJuIHdyYXBwZXI7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gY3JlYXRlSHlicmlkV3JhcHBlcjtcbiJdfQ==
+},{"./arrayCopy":66,"./composeArgs":100,"./composeArgsRight":101,"./createCtorWrapper":105,"./isLaziable":128,"./reorder":135,"./replaceHolders":136,"./setData":137}],109:[function(require,module,exports){
+(function (global){
+var createCtorWrapper = require('./createCtorWrapper');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1;
+
+/**
+ * Creates a function that wraps `func` and invokes it with the optional `this`
+ * binding of `thisArg` and the `partials` prepended to those provided to
+ * the wrapper.
+ *
+ * @private
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {Array} partials The arguments to prepend to those provided to the new function.
+ * @returns {Function} Returns the new bound function.
+ */
+function createPartialWrapper(func, bitmask, thisArg, partials) {
+ var isBind = bitmask & BIND_FLAG,
+ Ctor = createCtorWrapper(func);
+
+ function wrapper() {
+ // Avoid `arguments` object use disqualifying optimizations by
+ // converting it to an array before providing it `func`.
+ var argsIndex = -1,
+ argsLength = arguments.length,
+ leftIndex = -1,
+ leftLength = partials.length,
+ args = Array(leftLength + argsLength);
+
+ while (++leftIndex < leftLength) {
+ args[leftIndex] = partials[leftIndex];
+ }
+ while (argsLength--) {
+ args[leftIndex++] = arguments[++argsIndex];
+ }
+ var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
+ return fn.apply(isBind ? thisArg : this, args);
+ }
+ return wrapper;
+}
+
+module.exports = createPartialWrapper;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2NyZWF0ZVBhcnRpYWxXcmFwcGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6ImdlbmVyYXRlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY3JlYXRlQ3RvcldyYXBwZXIgPSByZXF1aXJlKCcuL2NyZWF0ZUN0b3JXcmFwcGVyJyk7XG5cbi8qKiBVc2VkIHRvIGNvbXBvc2UgYml0bWFza3MgZm9yIHdyYXBwZXIgbWV0YWRhdGEu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ZWN0IHVzZSBkaXNxdWFsaWZ5aW5nIG9wdGltaXphdGlvbnMgYnlcbiAgICAvLyBjb252ZXJ0aW5nIGl0IHRvIGFuIGFycmF5IGJlZm9yZSBwcm92aWRpbmcgaXQgYGZ1bmNgLlxuICAgIHZhciBhcmdzSW5kZXggPSAtMSxcbiAgICAgICAgYXJnc0xlbmd0aCA9IGFyZ3VtZW50cy5sZW5ndGgsXG4gICAgICAgIGxlZnRJbmRleCA9IC0xLFxuICAgICAgICBsZWZ0TGVuZ3RoID0gcGFydGlhbHMubGVuZ3RoLFxuICAgICAgICBhcmdzID0gQXJyYXkobGVmdExlbmd0aCArIGFyZ3NMZW5ndGgpO1xuXG4gICAgd2hpbGUgKCsrbGVmdEluZGV4IDwgbGVmdExlbmd0aCkge1xuICAgICAgYXJnc1tsZWZ0SW5kZXhdID0gcGFydGlhbHNbbGVmdEluZGV4XTtcbiAgICB9XG4gICAgd2hpbGUgKGFyZ3NMZW5ndGgtLSkge1xuICAgICAgYXJnc1tsZWZ0SW5kZXgrK10gPSBhcmd1bWVudHNbKythcmdzSW5kZXhdO1xuICAgIH1cbiAgICB2YXIgZm4gPSAodGhpcyAmJiB0aGlzICE9PSBnbG9iYWwgJiYgdGhpcyBpbnN0YW5jZW9mIHdyYXBwZXIpID8gQ3RvciA6IGZ1bmM7XG4gICAgcmV0dXJuIGZuLmFwcGx5KGlzQmluZCA/IHRoaXNBcmcgOiB0aGlzLCBhcmdzKTtcbiAgfVxuICByZXR1cm4gd3JhcHBlcjtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBjcmVhdGVQYXJ0aWFsV3JhcHBlcjtcbiJdfQ==
+},{"./createCtorWrapper":105}],110:[function(require,module,exports){
+var baseSetData = require('./baseSetData'),
+ createBindWrapper = require('./createBindWrapper'),
+ createHybridWrapper = require('./createHybridWrapper'),
+ createPartialWrapper = require('./createPartialWrapper'),
+ getData = require('./getData'),
+ mergeData = require('./mergeData'),
+ setData = require('./setData');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ BIND_KEY_FLAG = 2,
+ PARTIAL_FLAG = 32,
+ PARTIAL_RIGHT_FLAG = 64;
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that either curries or invokes `func` with optional
+ * `this` binding and partially applied arguments.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to reference.
+ * @param {number} bitmask The bitmask of flags.
+ * The bitmask may be composed of the following flags:
+ * 1 - `_.bind`
+ * 2 - `_.bindKey`
+ * 4 - `_.curry` or `_.curryRight` of a bound function
+ * 8 - `_.curry`
+ * 16 - `_.curryRight`
+ * 32 - `_.partial`
+ * 64 - `_.partialRight`
+ * 128 - `_.rearg`
+ * 256 - `_.ary`
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to be partially applied.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */
+function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
+ var isBindKey = bitmask & BIND_KEY_FLAG;
+ if (!isBindKey && typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var length = partials ? partials.length : 0;
+ if (!length) {
+ bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
+ partials = holders = undefined;
+ }
+ length -= (holders ? holders.length : 0);
+ if (bitmask & PARTIAL_RIGHT_FLAG) {
+ var partialsRight = partials,
+ holdersRight = holders;
+
+ partials = holders = undefined;
+ }
+ var data = isBindKey ? undefined : getData(func),
+ newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
+
+ if (data) {
+ mergeData(newData, data);
+ bitmask = newData[1];
+ arity = newData[9];
+ }
+ newData[9] = arity == null
+ ? (isBindKey ? 0 : func.length)
+ : (nativeMax(arity - length, 0) || 0);
+
+ if (bitmask == BIND_FLAG) {
+ var result = createBindWrapper(newData[0], newData[2]);
+ } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
+ result = createPartialWrapper.apply(undefined, newData);
+ } else {
+ result = createHybridWrapper.apply(undefined, newData);
+ }
+ var setter = data ? baseSetData : setData;
+ return setter(result, newData);
+}
+
+module.exports = createWrapper;
+
+},{"./baseSetData":92,"./createBindWrapper":104,"./createHybridWrapper":108,"./createPartialWrapper":109,"./getData":114,"./mergeData":132,"./setData":137}],111:[function(require,module,exports){
+var arraySome = require('./arraySome');
+
+/**
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Array} array The array to compare.
+ * @param {Array} other The other array to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing arrays.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+ */
+function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var index = -1,
+ arrLength = array.length,
+ othLength = other.length;
+
+ if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
+ return false;
+ }
+ // Ignore non-index properties.
+ while (++index < arrLength) {
+ var arrValue = array[index],
+ othValue = other[index],
+ result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
+
+ if (result !== undefined) {
+ if (result) {
+ continue;
+ }
+ return false;
+ }
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (isLoose) {
+ if (!arraySome(other, function(othValue) {
+ return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ })) {
+ return false;
+ }
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = equalArrays;
+
+},{"./arraySome":69}],112:[function(require,module,exports){
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ numberTag = '[object Number]',
+ regexpTag = '[object RegExp]',
+ stringTag = '[object String]';
+
+/**
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
+ * the same `toStringTag`.
+ *
+ * **Note:** This function only supports comparing values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {string} tag The `toStringTag` of the objects to compare.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalByTag(object, other, tag) {
+ switch (tag) {
+ case boolTag:
+ case dateTag:
+ // Coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
+ return +object == +other;
+
+ case errorTag:
+ return object.name == other.name && object.message == other.message;
+
+ case numberTag:
+ // Treat `NaN` vs. `NaN` as equal.
+ return (object != +object)
+ ? other != +other
+ : object == +other;
+
+ case regexpTag:
+ case stringTag:
+ // Coerce regexes to strings and treat strings primitives and string
+ // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
+ return object == (other + '');
+ }
+ return false;
+}
+
+module.exports = equalByTag;
+
+},{}],113:[function(require,module,exports){
+var keys = require('../object/keys');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A specialized version of `baseIsEqualDeep` for objects with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objProps = keys(object),
+ objLength = objProps.length,
+ othProps = keys(other),
+ othLength = othProps.length;
+
+ if (objLength != othLength && !isLoose) {
+ return false;
+ }
+ var index = objLength;
+ while (index--) {
+ var key = objProps[index];
+ if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
+ return false;
+ }
+ }
+ var skipCtor = isLoose;
+ while (++index < objLength) {
+ key = objProps[index];
+ var objValue = object[key],
+ othValue = other[key],
+ result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;
+
+ // Recursively compare objects (susceptible to call stack limits).
+ if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
+ return false;
+ }
+ skipCtor || (skipCtor = key == 'constructor');
+ }
+ if (!skipCtor) {
+ var objCtor = object.constructor,
+ othCtor = other.constructor;
+
+ // Non `Object` object instances with different constructors are not equal.
+ if (objCtor != othCtor &&
+ ('constructor' in object && 'constructor' in other) &&
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = equalObjects;
+
+},{"../object/keys":153}],114:[function(require,module,exports){
+var metaMap = require('./metaMap'),
+ noop = require('../utility/noop');
+
+/**
+ * Gets metadata for `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {*} Returns the metadata for `func`.
+ */
+var getData = !metaMap ? noop : function(func) {
+ return metaMap.get(func);
+};
+
+module.exports = getData;
+
+},{"../utility/noop":159,"./metaMap":133}],115:[function(require,module,exports){
+var realNames = require('./realNames');
+
+/**
+ * Gets the name of `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {string} Returns the function name.
+ */
+function getFuncName(func) {
+ var result = (func.name + ''),
+ array = realNames[result],
+ length = array ? array.length : 0;
+
+ while (length--) {
+ var data = array[length],
+ otherFunc = data.func;
+ if (otherFunc == null || otherFunc == func) {
+ return data.name;
+ }
+ }
+ return result;
+}
+
+module.exports = getFuncName;
+
+},{"./realNames":134}],116:[function(require,module,exports){
+var baseProperty = require('./baseProperty');
+
+/**
+ * Gets the "length" property value of `object`.
+ *
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {*} Returns the "length" value.
+ */
+var getLength = baseProperty('length');
+
+module.exports = getLength;
+
+},{"./baseProperty":90}],117:[function(require,module,exports){
+var isStrictComparable = require('./isStrictComparable'),
+ pairs = require('../object/pairs');
+
+/**
+ * Gets the propery names, values, and compare flags of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the match data of `object`.
+ */
+function getMatchData(object) {
+ var result = pairs(object),
+ length = result.length;
+
+ while (length--) {
+ result[length][2] = isStrictComparable(result[length][1]);
+ }
+ return result;
+}
+
+module.exports = getMatchData;
+
+},{"../object/pairs":155,"./isStrictComparable":131}],118:[function(require,module,exports){
+var isNative = require('../lang/isNative');
+
+/**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+function getNative(object, key) {
+ var value = object == null ? undefined : object[key];
+ return isNative(value) ? value : undefined;
+}
+
+module.exports = getNative;
+
+},{"../lang/isNative":147}],119:[function(require,module,exports){
+/**
+ * Gets the index at which the first occurrence of `NaN` is found in `array`.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {number} fromIndex The index to search from.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched `NaN`, else `-1`.
+ */
+function indexOfNaN(array, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 0 : -1);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var other = array[index];
+ if (other !== other) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = indexOfNaN;
+
+},{}],120:[function(require,module,exports){
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Initializes an array clone.
+ *
+ * @private
+ * @param {Array} array The array to clone.
+ * @returns {Array} Returns the initialized clone.
+ */
+function initCloneArray(array) {
+ var length = array.length,
+ result = new array.constructor(length);
+
+ // Add array properties assigned by `RegExp#exec`.
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
+ result.index = array.index;
+ result.input = array.input;
+ }
+ return result;
+}
+
+module.exports = initCloneArray;
+
+},{}],121:[function(require,module,exports){
+(function (global){
+var bufferClone = require('./bufferClone');
+
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ numberTag = '[object Number]',
+ regexpTag = '[object RegExp]',
+ stringTag = '[object String]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to match `RegExp` flags from their coerced string values. */
+var reFlags = /\w*$/;
+
+/** Native method references. */
+var Uint8Array = global.Uint8Array;
+
+/** Used to lookup a type array constructors by `toStringTag`. */
+var ctorByTag = {};
+ctorByTag[float32Tag] = global.Float32Array;
+ctorByTag[float64Tag] = global.Float64Array;
+ctorByTag[int8Tag] = global.Int8Array;
+ctorByTag[int16Tag] = global.Int16Array;
+ctorByTag[int32Tag] = global.Int32Array;
+ctorByTag[uint8Tag] = Uint8Array;
+ctorByTag[uint8ClampedTag] = global.Uint8ClampedArray;
+ctorByTag[uint16Tag] = global.Uint16Array;
+ctorByTag[uint32Tag] = global.Uint32Array;
+
+/**
+ * Initializes an object clone based on its `toStringTag`.
+ *
+ * **Note:** This function only supports cloning values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @param {string} tag The `toStringTag` of the object to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+function initCloneByTag(object, tag, isDeep) {
+ var Ctor = object.constructor;
+ switch (tag) {
+ case arrayBufferTag:
+ return bufferClone(object);
+
+ case boolTag:
+ case dateTag:
+ return new Ctor(+object);
+
+ case float32Tag: case float64Tag:
+ case int8Tag: case int16Tag: case int32Tag:
+ case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
+ // Safari 5 mobile incorrectly has `Object` as the constructor of typed arrays.
+ if (Ctor instanceof Ctor) {
+ Ctor = ctorByTag[tag];
+ }
+ var buffer = object.buffer;
+ return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
+
+ case numberTag:
+ case stringTag:
+ return new Ctor(object);
+
+ case regexpTag:
+ var result = new Ctor(object.source, reFlags.exec(object));
+ result.lastIndex = object.lastIndex;
+ }
+ return result;
+}
+
+module.exports = initCloneByTag;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2luaXRDbG9uZUJ5VGFnLmpzIl0sIm5hbWVzI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luZGV4O1xuICB9XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gaW5pdENsb25lQnlUYWc7XG4iXX0=
+},{"./bufferClone":99}],122:[function(require,module,exports){
+/**
+ * Initializes an object clone.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+function initCloneObject(object) {
+ var Ctor = object.constructor;
+ if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
+ Ctor = Object;
+ }
+ return new Ctor;
+}
+
+module.exports = initCloneObject;
+
+},{}],123:[function(require,module,exports){
+var getLength = require('./getLength'),
+ isLength = require('./isLength');
+
+/**
+ * Checks if `value` is array-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ */
+function isArrayLike(value) {
+ return value != null && isLength(getLength(value));
+}
+
+module.exports = isArrayLike;
+
+},{"./getLength":116,"./isLength":129}],124:[function(require,module,exports){
+/**
+ * Checks if `value` is a host object in IE < 9.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
+ */
+var isHostObject = (function() {
+ try {
+ Object({ 'toString': 0 } + '');
+ } catch(e) {
+ return function() { return false; };
+ }
+ return function(value) {
+ // IE < 9 presents many host objects as `Object` objects that can coerce
+ // to strings despite having improperly defined `toString` methods.
+ return typeof value.toString != 'function' && typeof (value + '') == 'string';
+ };
+}());
+
+module.exports = isHostObject;
+
+},{}],125:[function(require,module,exports){
+/** Used to detect unsigned integer values. */
+var reIsUint = /^\d+$/;
+
+/**
+ * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return value > -1 && value % 1 == 0 && value < length;
+}
+
+module.exports = isIndex;
+
+},{}],126:[function(require,module,exports){
+var isArrayLike = require('./isArrayLike'),
+ isIndex = require('./isIndex'),
+ isObject = require('../lang/isObject');
+
+/**
+ * Checks if the provided arguments are from an iteratee call.
+ *
+ * @private
+ * @param {*} value The potential iteratee value argument.
+ * @param {*} index The potential iteratee index or key argument.
+ * @param {*} object The potential iteratee object argument.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
+ */
+function isIterateeCall(value, index, object) {
+ if (!isObject(object)) {
+ return false;
+ }
+ var type = typeof index;
+ if (type == 'number'
+ ? (isArrayLike(object) && isIndex(index, object.length))
+ : (type == 'string' && index in object)) {
+ var other = object[index];
+ return value === value ? (value === other) : (other !== other);
+ }
+ return false;
+}
+
+module.exports = isIterateeCall;
+
+},{"../lang/isObject":148,"./isArrayLike":123,"./isIndex":125}],127:[function(require,module,exports){
+var isArray = require('../lang/isArray'),
+ toObject = require('./toObject');
+
+/** Used to match property names within property paths. */
+var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
+ reIsPlainProp = /^\w*$/;
+
+/**
+ * Checks if `value` is a property name and not a property path.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+ */
+function isKey(value, object) {
+ var type = typeof value;
+ if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
+ return true;
+ }
+ if (isArray(value)) {
+ return false;
+ }
+ var result = !reIsDeepProp.test(value);
+ return result || (object != null && value in toObject(object));
+}
+
+module.exports = isKey;
+
+},{"../lang/isArray":144,"./toObject":139}],128:[function(require,module,exports){
+var LazyWrapper = require('./LazyWrapper'),
+ getData = require('./getData'),
+ getFuncName = require('./getFuncName'),
+ lodash = require('../chain/lodash');
+
+/**
+ * Checks if `func` has a lazy counterpart.
+ *
+ * @private
+ * @param {Function} func The function to check.
+ * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
+ */
+function isLaziable(func) {
+ var funcName = getFuncName(func),
+ other = lodash[funcName];
+
+ if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
+ return false;
+ }
+ if (func === other) {
+ return true;
+ }
+ var data = getData(other);
+ return !!data && func === data[0];
+}
+
+module.exports = isLaziable;
+
+},{"../chain/lodash":55,"./LazyWrapper":64,"./getData":114,"./getFuncName":115}],129:[function(require,module,exports){
+/**
+ * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+module.exports = isLength;
+
+},{}],130:[function(require,module,exports){
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+module.exports = isObjectLike;
+
+},{}],131:[function(require,module,exports){
+var isObject = require('../lang/isObject');
+
+/**
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
+ * equality comparisons, else `false`.
+ */
+function isStrictComparable(value) {
+ return value === value && !isObject(value);
+}
+
+module.exports = isStrictComparable;
+
+},{"../lang/isObject":148}],132:[function(require,module,exports){
+var arrayCopy = require('./arrayCopy'),
+ composeArgs = require('./composeArgs'),
+ composeArgsRight = require('./composeArgsRight'),
+ replaceHolders = require('./replaceHolders');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ CURRY_BOUND_FLAG = 4,
+ CURRY_FLAG = 8,
+ ARY_FLAG = 128,
+ REARG_FLAG = 256;
+
+/** Used as the internal argument placeholder. */
+var PLACEHOLDER = '__lodash_placeholder__';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * Merges the function metadata of `source` into `data`.
+ *
+ * Merging metadata reduces the number of wrappers required to invoke a function.
+ * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
+ * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`
+ * augment function arguments, making the order in which they are executed important,
+ * preventing the merging of metadata. However, we make an exception for a safe
+ * common case where curried functions have `_.ary` and or `_.rearg` applied.
+ *
+ * @private
+ * @param {Array} data The destination metadata.
+ * @param {Array} source The source metadata.
+ * @returns {Array} Returns `data`.
+ */
+function mergeData(data, source) {
+ var bitmask = data[1],
+ srcBitmask = source[1],
+ newBitmask = bitmask | srcBitmask,
+ isCommon = newBitmask < ARY_FLAG;
+
+ var isCombo =
+ (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
+ (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
+ (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
+
+ // Exit early if metadata can't be merged.
+ if (!(isCommon || isCombo)) {
+ return data;
+ }
+ // Use source `thisArg` if available.
+ if (srcBitmask & BIND_FLAG) {
+ data[2] = source[2];
+ // Set when currying a bound function.
+ newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
+ }
+ // Compose partial arguments.
+ var value = source[3];
+ if (value) {
+ var partials = data[3];
+ data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
+ data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
+ }
+ // Compose partial right arguments.
+ value = source[5];
+ if (value) {
+ partials = data[5];
+ data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
+ data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
+ }
+ // Use source `argPos` if available.
+ value = source[7];
+ if (value) {
+ data[7] = arrayCopy(value);
+ }
+ // Use source `ary` if it's smaller.
+ if (srcBitmask & ARY_FLAG) {
+ data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
+ }
+ // Use source `arity` if one is not provided.
+ if (data[9] == null) {
+ data[9] = source[9];
+ }
+ // Use source `func` and merge bitmasks.
+ data[0] = source[0];
+ data[1] = newBitmask;
+
+ return data;
+}
+
+module.exports = mergeData;
+
+},{"./arrayCopy":66,"./composeArgs":100,"./composeArgsRight":101,"./replaceHolders":136}],133:[function(require,module,exports){
+(function (global){
+var getNative = require('./getNative');
+
+/** Native method references. */
+var WeakMap = getNative(global, 'WeakMap');
+
+/** Used to store function metadata. */
+var metaMap = WeakMap && new WeakMap;
+
+module.exports = metaMap;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL21ldGFNYXAuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6ImdlbmVyYXRlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2V0TmF0aXZlID0gcmVxdWlyZSgnLi9nZXROYXRpdmUnKTtcblxuLyoqIE5hdGl2ZSBtZXRob2QgcmVmZXJlbmNlcy4gKi9cbnZhciBXZWFrTWFwID0gZ2V0TmF0aXZlKGdsb2JhbCwgJ1dlYWtNYXAnKTtcblxuLyoqIFVzZWQgdG8gc3RvcmUgZnVuY3Rpb24gbWV0YWRhdGEuICovXG52YXIgbWV0YU1hcCA9IFdlYWtNYXAgJiYgbmV3IFdlYWtNYXA7XG5cbm1vZHVsZS5leHBvcnRzID0gbWV0YU1hcDtcbiJdfQ==
+},{"./getNative":118}],134:[function(require,module,exports){
+/** Used to lookup unminified function names. */
+var realNames = {};
+
+module.exports = realNames;
+
+},{}],135:[function(require,module,exports){
+var arrayCopy = require('./arrayCopy'),
+ isIndex = require('./isIndex');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * Reorder `array` according to the specified indexes where the element at
+ * the first index is assigned as the first element, the element at
+ * the second index is assigned as the second element, and so on.
+ *
+ * @private
+ * @param {Array} array The array to reorder.
+ * @param {Array} indexes The arranged array indexes.
+ * @returns {Array} Returns `array`.
+ */
+function reorder(array, indexes) {
+ var arrLength = array.length,
+ length = nativeMin(indexes.length, arrLength),
+ oldArray = arrayCopy(array);
+
+ while (length--) {
+ var index = indexes[length];
+ array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
+ }
+ return array;
+}
+
+module.exports = reorder;
+
+},{"./arrayCopy":66,"./isIndex":125}],136:[function(require,module,exports){
+/** Used as the internal argument placeholder. */
+var PLACEHOLDER = '__lodash_placeholder__';
+
+/**
+ * Replaces all `placeholder` elements in `array` with an internal placeholder
+ * and returns an array of their indexes.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {*} placeholder The placeholder to replace.
+ * @returns {Array} Returns the new array of placeholder indexes.
+ */
+function replaceHolders(array, placeholder) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ if (array[index] === placeholder) {
+ array[index] = PLACEHOLDER;
+ result[++resIndex] = index;
+ }
+ }
+ return result;
+}
+
+module.exports = replaceHolders;
+
+},{}],137:[function(require,module,exports){
+var baseSetData = require('./baseSetData'),
+ now = require('../date/now');
+
+/** Used to detect when a function becomes hot. */
+var HOT_COUNT = 150,
+ HOT_SPAN = 16;
+
+/**
+ * Sets metadata for `func`.
+ *
+ * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
+ * period of time, it will trip its breaker and transition to an identity function
+ * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
+ * for more details.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+var setData = (function() {
+ var count = 0,
+ lastCalled = 0;
+
+ return function(key, value) {
+ var stamp = now(),
+ remaining = HOT_SPAN - (stamp - lastCalled);
+
+ lastCalled = stamp;
+ if (remaining > 0) {
+ if (++count >= HOT_COUNT) {
+ return key;
+ }
+ } else {
+ count = 0;
+ }
+ return baseSetData(key, value);
+ };
+}());
+
+module.exports = setData;
+
+},{"../date/now":61,"./baseSetData":92}],138:[function(require,module,exports){
+var isArguments = require('../lang/isArguments'),
+ isArray = require('../lang/isArray'),
+ isIndex = require('./isIndex'),
+ isLength = require('./isLength'),
+ isString = require('../lang/isString'),
+ keysIn = require('../object/keysIn');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A fallback implementation of `Object.keys` which creates an array of the
+ * own enumerable property names of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function shimKeys(object) {
+ var props = keysIn(object),
+ propsLength = props.length,
+ length = propsLength && object.length;
+
+ var allowIndexes = !!length && isLength(length) &&
+ (isArray(object) || isArguments(object) || isString(object));
+
+ var index = -1,
+ result = [];
+
+ while (++index < propsLength) {
+ var key = props[index];
+ if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = shimKeys;
+
+},{"../lang/isArguments":143,"../lang/isArray":144,"../lang/isString":150,"../object/keysIn":154,"./isIndex":125,"./isLength":129}],139:[function(require,module,exports){
+var isObject = require('../lang/isObject'),
+ isString = require('../lang/isString'),
+ support = require('../support');
+
+/**
+ * Converts `value` to an object if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Object} Returns the object.
+ */
+function toObject(value) {
+ if (support.unindexedChars && isString(value)) {
+ var index = -1,
+ length = value.length,
+ result = Object(value);
+
+ while (++index < length) {
+ result[index] = value.charAt(index);
+ }
+ return result;
+ }
+ return isObject(value) ? value : Object(value);
+}
+
+module.exports = toObject;
+
+},{"../lang/isObject":148,"../lang/isString":150,"../support":157}],140:[function(require,module,exports){
+var baseToString = require('./baseToString'),
+ isArray = require('../lang/isArray');
+
+/** Used to match property names within property paths. */
+var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
+
+/** Used to match backslashes in property paths. */
+var reEscapeChar = /\\(\\)?/g;
+
+/**
+ * Converts `value` to property path array if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Array} Returns the property path array.
+ */
+function toPath(value) {
+ if (isArray(value)) {
+ return value;
+ }
+ var result = [];
+ baseToString(value).replace(rePropName, function(match, number, quote, string) {
+ result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
+ });
+ return result;
+}
+
+module.exports = toPath;
+
+},{"../lang/isArray":144,"./baseToString":94}],141:[function(require,module,exports){
+var LazyWrapper = require('./LazyWrapper'),
+ LodashWrapper = require('./LodashWrapper'),
+ arrayCopy = require('./arrayCopy');
+
+/**
+ * Creates a clone of `wrapper`.
+ *
+ * @private
+ * @param {Object} wrapper The wrapper to clone.
+ * @returns {Object} Returns the cloned wrapper.
+ */
+function wrapperClone(wrapper) {
+ return wrapper instanceof LazyWrapper
+ ? wrapper.clone()
+ : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
+}
+
+module.exports = wrapperClone;
+
+},{"./LazyWrapper":64,"./LodashWrapper":65,"./arrayCopy":66}],142:[function(require,module,exports){
+var baseClone = require('../internal/baseClone'),
+ bindCallback = require('../internal/bindCallback');
+
+/**
+ * Creates a deep clone of `value`. If `customizer` is provided it's invoked
+ * to produce the cloned values. If `customizer` returns `undefined` cloning
+ * is handled by the method instead. The `customizer` is bound to `thisArg`
+ * and invoked with up to three argument; (value [, index|key, object]).
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
+ * The enumerable properties of `arguments` objects and objects created by
+ * constructors other than `Object` are cloned to plain `Object` objects. An
+ * empty object is returned for uncloneable values such as functions, DOM nodes,
+ * Maps, Sets, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {*} Returns the deep cloned value.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * var deep = _.cloneDeep(users);
+ * deep[0] === users[0];
+ * // => false
+ *
+ * // using a customizer callback
+ * var el = _.cloneDeep(document.body, function(value) {
+ * if (_.isElement(value)) {
+ * return value.cloneNode(true);
+ * }
+ * });
+ *
+ * el === document.body
+ * // => false
+ * el.nodeName
+ * // => BODY
+ * el.childNodes.length;
+ * // => 20
+ */
+function cloneDeep(value, customizer, thisArg) {
+ return typeof customizer == 'function'
+ ? baseClone(value, true, bindCallback(customizer, thisArg, 3))
+ : baseClone(value, true);
+}
+
+module.exports = cloneDeep;
+
+},{"../internal/baseClone":72,"../internal/bindCallback":98}],143:[function(require,module,exports){
+var isArrayLike = require('../internal/isArrayLike'),
+ isObjectLike = require('../internal/isObjectLike');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/** Native method references. */
+var propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+/**
+ * Checks if `value` is classified as an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+function isArguments(value) {
+ return isObjectLike(value) && isArrayLike(value) &&
+ hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
+}
+
+module.exports = isArguments;
+
+},{"../internal/isArrayLike":123,"../internal/isObjectLike":130}],144:[function(require,module,exports){
+var getNative = require('../internal/getNative'),
+ isLength = require('../internal/isLength'),
+ isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var arrayTag = '[object Array]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsArray = getNative(Array, 'isArray');
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(function() { return arguments; }());
+ * // => false
+ */
+var isArray = nativeIsArray || function(value) {
+ return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
+};
+
+module.exports = isArray;
+
+},{"../internal/getNative":118,"../internal/isLength":129,"../internal/isObjectLike":130}],145:[function(require,module,exports){
+var isArguments = require('./isArguments'),
+ isArray = require('./isArray'),
+ isArrayLike = require('../internal/isArrayLike'),
+ isFunction = require('./isFunction'),
+ isObjectLike = require('../internal/isObjectLike'),
+ isString = require('./isString'),
+ keys = require('../object/keys');
+
+/**
+ * Checks if `value` is empty. A value is considered empty unless it's an
+ * `arguments` object, array, string, or jQuery-like collection with a length
+ * greater than `0` or an object with own enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {Array|Object|string} value The value to inspect.
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
+ * @example
+ *
+ * _.isEmpty(null);
+ * // => true
+ *
+ * _.isEmpty(true);
+ * // => true
+ *
+ * _.isEmpty(1);
+ * // => true
+ *
+ * _.isEmpty([1, 2, 3]);
+ * // => false
+ *
+ * _.isEmpty({ 'a': 1 });
+ * // => false
+ */
+function isEmpty(value) {
+ if (value == null) {
+ return true;
+ }
+ if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
+ (isObjectLike(value) && isFunction(value.splice)))) {
+ return !value.length;
+ }
+ return !keys(value).length;
+}
+
+module.exports = isEmpty;
+
+},{"../internal/isArrayLike":123,"../internal/isObjectLike":130,"../object/keys":153,"./isArguments":143,"./isArray":144,"./isFunction":146,"./isString":150}],146:[function(require,module,exports){
+var isObject = require('./isObject');
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in older versions of Chrome and Safari which return 'function' for regexes
+ // and Safari 8 which returns 'object' for typed array constructors.
+ return isObject(value) && objToString.call(value) == funcTag;
+}
+
+module.exports = isFunction;
+
+},{"./isObject":148}],147:[function(require,module,exports){
+var isFunction = require('./isFunction'),
+ isHostObject = require('../internal/isHostObject'),
+ isObjectLike = require('../internal/isObjectLike');
+
+/** Used to detect host constructors (Safari > 5). */
+var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to resolve the decompiled source of functions. */
+var fnToString = Function.prototype.toString;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/** Used to detect if a method is native. */
+var reIsNative = RegExp('^' +
+ fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+);
+
+/**
+ * Checks if `value` is a native function.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
+ * @example
+ *
+ * _.isNative(Array.prototype.push);
+ * // => true
+ *
+ * _.isNative(_);
+ * // => false
+ */
+function isNative(value) {
+ if (value == null) {
+ return false;
+ }
+ if (isFunction(value)) {
+ return reIsNative.test(fnToString.call(value));
+ }
+ return isObjectLike(value) && (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);
+}
+
+module.exports = isNative;
+
+},{"../internal/isHostObject":124,"../internal/isObjectLike":130,"./isFunction":146}],148:[function(require,module,exports){
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+module.exports = isObject;
+
+},{}],149:[function(require,module,exports){
+var baseForIn = require('../internal/baseForIn'),
+ isArguments = require('./isArguments'),
+ isHostObject = require('../internal/isHostObject'),
+ isObjectLike = require('../internal/isObjectLike'),
+ support = require('../support');
+
+/** `Object#toString` result references. */
+var objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * **Note:** This method assumes objects created by the `Object` constructor
+ * have no inherited enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */
+function isPlainObject(value) {
+ var Ctor;
+
+ // Exit early for non `Object` objects.
+ if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isHostObject(value) && !isArguments(value)) ||
+ (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
+ return false;
+ }
+ // IE < 9 iterates inherited properties before own properties. If the first
+ // iterated property is an object's own property then there are no inherited
+ // enumerable properties.
+ var result;
+ if (support.ownLast) {
+ baseForIn(value, function(subValue, key, object) {
+ result = hasOwnProperty.call(object, key);
+ return false;
+ });
+ return result !== false;
+ }
+ // In most environments an object's own properties are iterated before
+ // its inherited properties. If the last iterated property is an object's
+ // own property then there are no inherited enumerable properties.
+ baseForIn(value, function(subValue, key) {
+ result = key;
+ });
+ return result === undefined || hasOwnProperty.call(value, result);
+}
+
+module.exports = isPlainObject;
+
+},{"../internal/baseForIn":79,"../internal/isHostObject":124,"../internal/isObjectLike":130,"../support":157,"./isArguments":143}],150:[function(require,module,exports){
+var isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var stringTag = '[object String]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `String` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isString('abc');
+ * // => true
+ *
+ * _.isString(1);
+ * // => false
+ */
+function isString(value) {
+ return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
+}
+
+module.exports = isString;
+
+},{"../internal/isObjectLike":130}],151:[function(require,module,exports){
+var isLength = require('../internal/isLength'),
+ isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values of typed arrays. */
+var typedArrayTags = {};
+typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
+typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
+typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
+typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
+typedArrayTags[uint32Tag] = true;
+typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
+typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
+typedArrayTags[dateTag] = typedArrayTags[errorTag] =
+typedArrayTags[funcTag] = typedArrayTags[mapTag] =
+typedArrayTags[numberTag] = typedArrayTags[objectTag] =
+typedArrayTags[regexpTag] = typedArrayTags[setTag] =
+typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+function isTypedArray(value) {
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
+}
+
+module.exports = isTypedArray;
+
+},{"../internal/isLength":129,"../internal/isObjectLike":130}],152:[function(require,module,exports){
+/**
+ * Checks if `value` is `undefined`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
+ * @example
+ *
+ * _.isUndefined(void 0);
+ * // => true
+ *
+ * _.isUndefined(null);
+ * // => false
+ */
+function isUndefined(value) {
+ return value === undefined;
+}
+
+module.exports = isUndefined;
+
+},{}],153:[function(require,module,exports){
+var getNative = require('../internal/getNative'),
+ isArrayLike = require('../internal/isArrayLike'),
+ isObject = require('../lang/isObject'),
+ shimKeys = require('../internal/shimKeys'),
+ support = require('../support');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeKeys = getNative(Object, 'keys');
+
+/**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+var keys = !nativeKeys ? shimKeys : function(object) {
+ var Ctor = object == null ? undefined : object.constructor;
+ if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
+ (typeof object == 'function' ? support.enumPrototypes : isArrayLike(object))) {
+ return shimKeys(object);
+ }
+ return isObject(object) ? nativeKeys(object) : [];
+};
+
+module.exports = keys;
+
+},{"../internal/getNative":118,"../internal/isArrayLike":123,"../internal/shimKeys":138,"../lang/isObject":148,"../support":157}],154:[function(require,module,exports){
+var arrayEach = require('../internal/arrayEach'),
+ isArguments = require('../lang/isArguments'),
+ isArray = require('../lang/isArray'),
+ isFunction = require('../lang/isFunction'),
+ isIndex = require('../internal/isIndex'),
+ isLength = require('../internal/isLength'),
+ isObject = require('../lang/isObject'),
+ isString = require('../lang/isString'),
+ support = require('../support');
+
+/** `Object#toString` result references. */
+var arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ stringTag = '[object String]';
+
+/** Used to fix the JScript `[[DontEnum]]` bug. */
+var shadowProps = [
+ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',
+ 'toLocaleString', 'toString', 'valueOf'
+];
+
+/** Used for native method references. */
+var errorProto = Error.prototype,
+ objectProto = Object.prototype,
+ stringProto = String.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Used to avoid iterating over non-enumerable properties in IE < 9. */
+var nonEnumProps = {};
+nonEnumProps[arrayTag] = nonEnumProps[dateTag] = nonEnumProps[numberTag] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
+nonEnumProps[boolTag] = nonEnumProps[stringTag] = { 'constructor': true, 'toString': true, 'valueOf': true };
+nonEnumProps[errorTag] = nonEnumProps[funcTag] = nonEnumProps[regexpTag] = { 'constructor': true, 'toString': true };
+nonEnumProps[objectTag] = { 'constructor': true };
+
+arrayEach(shadowProps, function(key) {
+ for (var tag in nonEnumProps) {
+ if (hasOwnProperty.call(nonEnumProps, tag)) {
+ var props = nonEnumProps[tag];
+ props[key] = hasOwnProperty.call(props, key);
+ }
+ }
+});
+
+/**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+function keysIn(object) {
+ if (object == null) {
+ return [];
+ }
+ if (!isObject(object)) {
+ object = Object(object);
+ }
+ var length = object.length;
+
+ length = (length && isLength(length) &&
+ (isArray(object) || isArguments(object) || isString(object)) && length) || 0;
+
+ var Ctor = object.constructor,
+ index = -1,
+ proto = (isFunction(Ctor) && Ctor.prototype) || objectProto,
+ isProto = proto === object,
+ result = Array(length),
+ skipIndexes = length > 0,
+ skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error),
+ skipProto = support.enumPrototypes && isFunction(object);
+
+ while (++index < length) {
+ result[index] = (index + '');
+ }
+ // lodash skips the `constructor` property when it infers it's iterating
+ // over a `prototype` object because IE < 9 can't set the `[[Enumerable]]`
+ // attribute of an existing property and the `constructor` property of a
+ // prototype defaults to non-enumerable.
+ for (var key in object) {
+ if (!(skipProto && key == 'prototype') &&
+ !(skipErrorProps && (key == 'message' || key == 'name')) &&
+ !(skipIndexes && isIndex(key, length)) &&
+ !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
+ result.push(key);
+ }
+ }
+ if (support.nonEnumShadows && object !== objectProto) {
+ var tag = object === stringProto ? stringTag : (object === errorProto ? errorTag : objToString.call(object)),
+ nonEnums = nonEnumProps[tag] || nonEnumProps[objectTag];
+
+ if (tag == objectTag) {
+ proto = objectProto;
+ }
+ length = shadowProps.length;
+ while (length--) {
+ key = shadowProps[length];
+ var nonEnum = nonEnums[key];
+ if (!(isProto && nonEnum) &&
+ (nonEnum ? hasOwnProperty.call(object, key) : object[key] !== proto[key])) {
+ result.push(key);
+ }
+ }
+ }
+ return result;
+}
+
+module.exports = keysIn;
+
+},{"../internal/arrayEach":67,"../internal/isIndex":125,"../internal/isLength":129,"../lang/isArguments":143,"../lang/isArray":144,"../lang/isFunction":146,"../lang/isObject":148,"../lang/isString":150,"../support":157}],155:[function(require,module,exports){
+var keys = require('./keys'),
+ toObject = require('../internal/toObject');
+
+/**
+ * Creates a two dimensional array of the key-value pairs for `object`,
+ * e.g. `[[key1, value1], [key2, value2]]`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the new array of key-value pairs.
+ * @example
+ *
+ * _.pairs({ 'barney': 36, 'fred': 40 });
+ * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
+ */
+function pairs(object) {
+ object = toObject(object);
+
+ var index = -1,
+ props = keys(object),
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ var key = props[index];
+ result[index] = [key, object[key]];
+ }
+ return result;
+}
+
+module.exports = pairs;
+
+},{"../internal/toObject":139,"./keys":153}],156:[function(require,module,exports){
+var baseValues = require('../internal/baseValues'),
+ keys = require('./keys');
+
+/**
+ * Creates an array of the own enumerable property values of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.values(new Foo);
+ * // => [1, 2] (iteration order is not guaranteed)
+ *
+ * _.values('hi');
+ * // => ['h', 'i']
+ */
+function values(object) {
+ return baseValues(object, keys(object));
+}
+
+module.exports = values;
+
+},{"../internal/baseValues":95,"./keys":153}],157:[function(require,module,exports){
+/** Used for native method references. */
+var arrayProto = Array.prototype,
+ errorProto = Error.prototype,
+ objectProto = Object.prototype;
+
+/** Native method references. */
+var propertyIsEnumerable = objectProto.propertyIsEnumerable,
+ splice = arrayProto.splice;
+
+/**
+ * An object environment feature flags.
+ *
+ * @static
+ * @memberOf _
+ * @type Object
+ */
+var support = {};
+
+(function(x) {
+ var Ctor = function() { this.x = x; },
+ object = { '0': x, 'length': x },
+ props = [];
+
+ Ctor.prototype = { 'valueOf': x, 'y': x };
+ for (var key in new Ctor) { props.push(key); }
+
+ /**
+ * Detect if `name` or `message` properties of `Error.prototype` are
+ * enumerable by default (IE < 9, Safari < 5.1).
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') ||
+ propertyIsEnumerable.call(errorProto, 'name');
+
+ /**
+ * Detect if `prototype` properties are enumerable by default.
+ *
+ * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1
+ * (if the prototype or a property on the prototype has been set)
+ * incorrectly set the `[[Enumerable]]` value of a function's `prototype`
+ * property to `true`.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.enumPrototypes = propertyIsEnumerable.call(Ctor, 'prototype');
+
+ /**
+ * Detect if properties shadowing those on `Object.prototype` are non-enumerable.
+ *
+ * In IE < 9 an object's own properties, shadowing non-enumerable ones,
+ * are made non-enumerable as well (a.k.a the JScript `[[DontEnum]]` bug).
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.nonEnumShadows = !/valueOf/.test(props);
+
+ /**
+ * Detect if own properties are iterated after inherited properties (IE < 9).
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.ownLast = props[0] != 'x';
+
+ /**
+ * Detect if `Array#shift` and `Array#splice` augment array-like objects
+ * correctly.
+ *
+ * Firefox < 10, compatibility modes of IE 8, and IE < 9 have buggy Array
+ * `shift()` and `splice()` functions that fail to remove the last element,
+ * `value[0]`, of array-like objects even though the "length" property is
+ * set to `0`. The `shift()` method is buggy in compatibility modes of IE 8,
+ * while `splice()` is buggy regardless of mode in IE < 9.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.spliceObjects = (splice.call(object, 0, 1), !object[0]);
+
+ /**
+ * Detect lack of support for accessing string characters by index.
+ *
+ * IE < 8 can't access characters by index. IE 8 can only access characters
+ * by index on string literals, not string objects.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx';
+}(1, 0));
+
+module.exports = support;
+
+},{}],158:[function(require,module,exports){
+/**
+ * This method returns the first argument provided to it.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.identity(object) === object;
+ * // => true
+ */
+function identity(value) {
+ return value;
+}
+
+module.exports = identity;
+
+},{}],159:[function(require,module,exports){
+/**
+ * A no-operation function that returns `undefined` regardless of the
+ * arguments it receives.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.noop(object) === undefined;
+ * // => true
+ */
+function noop() {
+ // No operation performed.
+}
+
+module.exports = noop;
+
+},{}],160:[function(require,module,exports){
+var baseProperty = require('../internal/baseProperty'),
+ basePropertyDeep = require('../internal/basePropertyDeep'),
+ isKey = require('../internal/isKey');
+
+/**
+ * Creates a function that returns the property value at `path` on a
+ * given object.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': { 'c': 2 } } },
+ * { 'a': { 'b': { 'c': 1 } } }
+ * ];
+ *
+ * _.map(objects, _.property('a.b.c'));
+ * // => [2, 1]
+ *
+ * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
+ * // => [1, 2]
+ */
+function property(path) {
+ return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
+}
+
+module.exports = property;
+
+},{"../internal/baseProperty":90,"../internal/basePropertyDeep":91,"../internal/isKey":127}],161:[function(require,module,exports){
+(function (process){
+// vim:ts=4:sts=4:sw=4:
+/*!
+ *
+ * Copyright 2009-2012 Kris Kowal under the terms of the MIT
+ * license found at http://github.com/kriskowal/q/raw/master/LICENSE
+ *
+ * With parts by Tyler Close
+ * Copyright 2007-2009 Tyler Close under the terms of the MIT X license found
+ * at http://www.opensource.org/licenses/mit-license.html
+ * Forked at ref_send.js version: 2009-05-11
+ *
+ * With parts by Mark Miller
+ * Copyright (C) 2011 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+(function (definition) {
+ "use strict";
+
+ // This file will function properly as a <script> tag, or a module
+ // using CommonJS and NodeJS or RequireJS module formats. In
+ // Common/Node/RequireJS, the module exports the Q API and when
+ // executed as a simple <script>, it creates a Q global instead.
+
+ // Montage Require
+ if (typeof bootstrap === "function") {
+ bootstrap("promise", definition);
+
+ // CommonJS
+ } else if (typeof exports === "object" && typeof module === "object") {
+ module.exports = definition();
+
+ // RequireJS
+ } else if (typeof define === "function" && define.amd) {
+ define(definition);
+
+ // SES (Secure EcmaScript)
+ } else if (typeof ses !== "undefined") {
+ if (!ses.ok()) {
+ return;
+ } else {
+ ses.makeQ = definition;
+ }
+
+ // <script>
+ } else if (typeof window !== "undefined" || typeof self !== "undefined") {
+ // Prefer window over self for add-on scripts. Use self for
+ // non-windowed contexts.
+ var global = typeof window !== "undefined" ? window : self;
+
+ // Get the `window` object, save the previous Q global
+ // and initialize Q as a global.
+ var previousQ = global.Q;
+ global.Q = definition();
+
+ // Add a noConflict function so Q can be removed from the
+ // global namespace.
+ global.Q.noConflict = function () {
+ global.Q = previousQ;
+ return this;
+ };
+
+ } else {
+ throw new Error("This environment was not anticipated by Q. Please file a bug.");
+ }
+
+})(function () {
+"use strict";
+
+var hasStacks = false;
+try {
+ throw new Error();
+} catch (e) {
+ hasStacks = !!e.stack;
+}
+
+// All code after this point will be filtered from stack traces reported
+// by Q.
+var qStartingLine = captureLine();
+var qFileName;
+
+// shims
+
+// used for fallback in "allResolved"
+var noop = function () {};
+
+// Use the fastest possible means to execute a task in a future turn
+// of the event loop.
+var nextTick =(function () {
+ // linked list of tasks (single, with head node)
+ var head = {task: void 0, next: null};
+ var tail = head;
+ var flushing = false;
+ var requestTick = void 0;
+ var isNodeJS = false;
+ // queue for late tasks, used by unhandled rejection tracking
+ var laterQueue = [];
+
+ function flush() {
+ /* jshint loopfunc: true */
+ var task, domain;
+
+ while (head.next) {
+ head = head.next;
+ task = head.task;
+ head.task = void 0;
+ domain = head.domain;
+
+ if (domain) {
+ head.domain = void 0;
+ domain.enter();
+ }
+ runSingle(task, domain);
+
+ }
+ while (laterQueue.length) {
+ task = laterQueue.pop();
+ runSingle(task);
+ }
+ flushing = false;
+ }
+ // runs a single function in the async queue
+ function runSingle(task, domain) {
+ try {
+ task();
+
+ } catch (e) {
+ if (isNodeJS) {
+ // In node, uncaught exceptions are considered fatal errors.
+ // Re-throw them synchronously to interrupt flushing!
+
+ // Ensure continuation if the uncaught exception is suppressed
+ // listening "uncaughtException" events (as domains does).
+ // Continue in next event to avoid tick recursion.
+ if (domain) {
+ domain.exit();
+ }
+ setTimeout(flush, 0);
+ if (domain) {
+ domain.enter();
+ }
+
+ throw e;
+
+ } else {
+ // In browsers, uncaught exceptions are not fatal.
+ // Re-throw them asynchronously to avoid slow-downs.
+ setTimeout(function () {
+ throw e;
+ }, 0);
+ }
+ }
+
+ if (domain) {
+ domain.exit();
+ }
+ }
+
+ nextTick = function (task) {
+ tail = tail.next = {
+ task: task,
+ domain: isNodeJS && process.domain,
+ next: null
+ };
+
+ if (!flushing) {
+ flushing = true;
+ requestTick();
+ }
+ };
+
+ if (typeof process === "object" &&
+ process.toString() === "[object process]" && process.nextTick) {
+ // Ensure Q is in a real Node environment, with a `process.nextTick`.
+ // To see through fake Node environments:
+ // * Mocha test runner - exposes a `process` global without a `nextTick`
+ // * Browserify - exposes a `process.nexTick` function that uses
+ // `setTimeout`. In this case `setImmediate` is preferred because
+ // it is faster. Browserify's `process.toString()` yields
+ // "[object Object]", while in a real Node environment
+ // `process.nextTick()` yields "[object process]".
+ isNodeJS = true;
+
+ requestTick = function () {
+ process.nextTick(flush);
+ };
+
+ } else if (typeof setImmediate === "function") {
+ // In IE10, Node.js 0.9+, or https://github.com/NobleJS/setImmediate
+ if (typeof window !== "undefined") {
+ requestTick = setImmediate.bind(window, flush);
+ } else {
+ requestTick = function () {
+ setImmediate(flush);
+ };
+ }
+
+ } else if (typeof MessageChannel !== "undefined") {
+ // modern browsers
+ // http://www.nonblocking.io/2011/06/windownexttick.html
+ var channel = new MessageChannel();
+ // At least Safari Version 6.0.5 (8536.30.1) intermittently cannot create
+ // working message ports the first time a page loads.
+ channel.port1.onmessage = function () {
+ requestTick = requestPortTick;
+ channel.port1.onmessage = flush;
+ flush();
+ };
+ var requestPortTick = function () {
+ // Opera requires us to provide a message payload, regardless of
+ // whether we use it.
+ channel.port2.postMessage(0);
+ };
+ requestTick = function () {
+ setTimeout(flush, 0);
+ requestPortTick();
+ };
+
+ } else {
+ // old browsers
+ requestTick = function () {
+ setTimeout(flush, 0);
+ };
+ }
+ // runs a task after all other tasks have been run
+ // this is useful for unhandled rejection tracking that needs to happen
+ // after all `then`d tasks have been run.
+ nextTick.runAfter = function (task) {
+ laterQueue.push(task);
+ if (!flushing) {
+ flushing = true;
+ requestTick();
+ }
+ };
+ return nextTick;
+})();
+
+// Attempt to make generics safe in the face of downstream
+// modifications.
+// There is no situation where this is necessary.
+// If you need a security guarantee, these primordials need to be
+// deeply frozen anyway, and if you don’t need a security guarantee,
+// this is just plain paranoid.
+// However, this **might** have the nice side-effect of reducing the size of
+// the minified code by reducing x.call() to merely x()
+// See Mark Miller’s explanation of what this does.
+// http://wiki.ecmascript.org/doku.php?id=conventions:safe_meta_programming
+var call = Function.call;
+function uncurryThis(f) {
+ return function () {
+ return call.apply(f, arguments);
+ };
+}
+// This is equivalent, but slower:
+// uncurryThis = Function_bind.bind(Function_bind.call);
+// http://jsperf.com/uncurrythis
+
+var array_slice = uncurryThis(Array.prototype.slice);
+
+var array_reduce = uncurryThis(
+ Array.prototype.reduce || function (callback, basis) {
+ var index = 0,
+ length = this.length;
+ // concerning the initial value, if one is not provided
+ if (arguments.length === 1) {
+ // seek to the first value in the array, accounting
+ // for the possibility that is is a sparse array
+ do {
+ if (index in this) {
+ basis = this[index++];
+ break;
+ }
+ if (++index >= length) {
+ throw new TypeError();
+ }
+ } while (1);
+ }
+ // reduce
+ for (; index < length; index++) {
+ // account for the possibility that the array is sparse
+ if (index in this) {
+ basis = callback(basis, this[index], index);
+ }
+ }
+ return basis;
+ }
+);
+
+var array_indexOf = uncurryThis(
+ Array.prototype.indexOf || function (value) {
+ // not a very good shim, but good enough for our one use of it
+ for (var i = 0; i < this.length; i++) {
+ if (this[i] === value) {
+ return i;
+ }
+ }
+ return -1;
+ }
+);
+
+var array_map = uncurryThis(
+ Array.prototype.map || function (callback, thisp) {
+ var self = this;
+ var collect = [];
+ array_reduce(self, function (undefined, value, index) {
+ collect.push(callback.call(thisp, value, index, self));
+ }, void 0);
+ return collect;
+ }
+);
+
+var object_create = Object.create || function (prototype) {
+ function Type() { }
+ Type.prototype = prototype;
+ return new Type();
+};
+
+var object_hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);
+
+var object_keys = Object.keys || function (object) {
+ var keys = [];
+ for (var key in object) {
+ if (object_hasOwnProperty(object, key)) {
+ keys.push(key);
+ }
+ }
+ return keys;
+};
+
+var object_toString = uncurryThis(Object.prototype.toString);
+
+function isObject(value) {
+ return value === Object(value);
+}
+
+// generator related shims
+
+// FIXME: Remove this function once ES6 generators are in SpiderMonkey.
+function isStopIteration(exception) {
+ return (
+ object_toString(exception) === "[object StopIteration]" ||
+ exception instanceof QReturnValue
+ );
+}
+
+// FIXME: Remove this helper and Q.return once ES6 generators are in
+// SpiderMonkey.
+var QReturnValue;
+if (typeof ReturnValue !== "undefined") {
+ QReturnValue = ReturnValue;
+} else {
+ QReturnValue = function (value) {
+ this.value = value;
+ };
+}
+
+// long stack traces
+
+var STACK_JUMP_SEPARATOR = "From previous event:";
+
+function makeStackTraceLong(error, promise) {
+ // If possible, transform the error stack trace by removing Node and Q
+ // cruft, then concatenating with the stack trace of `promise`. See #57.
+ if (hasStacks &&
+ promise.stack &&
+ typeof error === "object" &&
+ error !== null &&
+ error.stack &&
+ error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
+ ) {
+ var stacks = [];
+ for (var p = promise; !!p; p = p.source) {
+ if (p.stack) {
+ stacks.unshift(p.stack);
+ }
+ }
+ stacks.unshift(error.stack);
+
+ var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
+ error.stack = filterStackString(concatedStacks);
+ }
+}
+
+function filterStackString(stackString) {
+ var lines = stackString.split("\n");
+ var desiredLines = [];
+ for (var i = 0; i < lines.length; ++i) {
+ var line = lines[i];
+
+ if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
+ desiredLines.push(line);
+ }
+ }
+ return desiredLines.join("\n");
+}
+
+function isNodeFrame(stackLine) {
+ return stackLine.indexOf("(module.js:") !== -1 ||
+ stackLine.indexOf("(node.js:") !== -1;
+}
+
+function getFileNameAndLineNumber(stackLine) {
+ // Named functions: "at functionName (filename:lineNumber:columnNumber)"
+ // In IE10 function name can have spaces ("Anonymous function") O_o
+ var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
+ if (attempt1) {
+ return [attempt1[1], Number(attempt1[2])];
+ }
+
+ // Anonymous functions: "at filename:lineNumber:columnNumber"
+ var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
+ if (attempt2) {
+ return [attempt2[1], Number(attempt2[2])];
+ }
+
+ // Firefox style: "function@filename:lineNumber or @filename:lineNumber"
+ var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
+ if (attempt3) {
+ return [attempt3[1], Number(attempt3[2])];
+ }
+}
+
+function isInternalFrame(stackLine) {
+ var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
+
+ if (!fileNameAndLineNumber) {
+ return false;
+ }
+
+ var fileName = fileNameAndLineNumber[0];
+ var lineNumber = fileNameAndLineNumber[1];
+
+ return fileName === qFileName &&
+ lineNumber >= qStartingLine &&
+ lineNumber <= qEndingLine;
+}
+
+// discover own file name and line number range for filtering stack
+// traces
+function captureLine() {
+ if (!hasStacks) {
+ return;
+ }
+
+ try {
+ throw new Error();
+ } catch (e) {
+ var lines = e.stack.split("\n");
+ var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
+ var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
+ if (!fileNameAndLineNumber) {
+ return;
+ }
+
+ qFileName = fileNameAndLineNumber[0];
+ return fileNameAndLineNumber[1];
+ }
+}
+
+function deprecate(callback, name, alternative) {
+ return function () {
+ if (typeof console !== "undefined" &&
+ typeof console.warn === "function") {
+ console.warn(name + " is deprecated, use " + alternative +
+ " instead.", new Error("").stack);
+ }
+ return callback.apply(callback, arguments);
+ };
+}
+
+// end of shims
+// beginning of real work
+
+/**
+ * Constructs a promise for an immediate reference, passes promises through, or
+ * coerces promises from different systems.
+ * @param value immediate reference or promise
+ */
+function Q(value) {
+ // If the object is already a Promise, return it directly. This enables
+ // the resolve function to both be used to created references from objects,
+ // but to tolerably coerce non-promises to promises.
+ if (value instanceof Promise) {
+ return value;
+ }
+
+ // assimilate thenables
+ if (isPromiseAlike(value)) {
+ return coerce(value);
+ } else {
+ return fulfill(value);
+ }
+}
+Q.resolve = Q;
+
+/**
+ * Performs a task in a future turn of the event loop.
+ * @param {Function} task
+ */
+Q.nextTick = nextTick;
+
+/**
+ * Controls whether or not long stack traces will be on
+ */
+Q.longStackSupport = false;
+
+// enable long stacks if Q_DEBUG is set
+if (typeof process === "object" && process && process.env && process.env.Q_DEBUG) {
+ Q.longStackSupport = true;
+}
+
+/**
+ * Constructs a {promise, resolve, reject} object.
+ *
+ * `resolve` is a callback to invoke with a more resolved value for the
+ * promise. To fulfill the promise, invoke `resolve` with any value that is
+ * not a thenable. To reject the promise, invoke `resolve` with a rejected
+ * thenable, or invoke `reject` with the reason directly. To resolve the
+ * promise to another thenable, thus putting it in the same state, invoke
+ * `resolve` with that other thenable.
+ */
+Q.defer = defer;
+function defer() {
+ // if "messages" is an "Array", that indicates that the promise has not yet
+ // been resolved. If it is "undefined", it has been resolved. Each
+ // element of the messages array is itself an array of complete arguments to
+ // forward to the resolved promise. We coerce the resolution value to a
+ // promise using the `resolve` function because it handles both fully
+ // non-thenable values and other thenables gracefully.
+ var messages = [], progressListeners = [], resolvedPromise;
+
+ var deferred = object_create(defer.prototype);
+ var promise = object_create(Promise.prototype);
+
+ promise.promiseDispatch = function (resolve, op, operands) {
+ var args = array_slice(arguments);
+ if (messages) {
+ messages.push(args);
+ if (op === "when" && operands[1]) { // progress operand
+ progressListeners.push(operands[1]);
+ }
+ } else {
+ Q.nextTick(function () {
+ resolvedPromise.promiseDispatch.apply(resolvedPromise, args);
+ });
+ }
+ };
+
+ // XXX deprecated
+ promise.valueOf = function () {
+ if (messages) {
+ return promise;
+ }
+ var nearerValue = nearer(resolvedPromise);
+ if (isPromise(nearerValue)) {
+ resolvedPromise = nearerValue; // shorten chain
+ }
+ return nearerValue;
+ };
+
+ promise.inspect = function () {
+ if (!resolvedPromise) {
+ return { state: "pending" };
+ }
+ return resolvedPromise.inspect();
+ };
+
+ if (Q.longStackSupport && hasStacks) {
+ try {
+ throw new Error();
+ } catch (e) {
+ // NOTE: don't try to use `Error.captureStackTrace` or transfer the
+ // accessor around; that causes memory leaks as per GH-111. Just
+ // reify the stack trace as a string ASAP.
+ //
+ // At the same time, cut off the first line; it's always just
+ // "[object Promise]\n", as per the `toString`.
+ promise.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
+ }
+ }
+
+ // NOTE: we do the checks for `resolvedPromise` in each method, instead of
+ // consolidating them into `become`, since otherwise we'd create new
+ // promises with the lines `become(whatever(value))`. See e.g. GH-252.
+
+ function become(newPromise) {
+ resolvedPromise = newPromise;
+ promise.source = newPromise;
+
+ array_reduce(messages, function (undefined, message) {
+ Q.nextTick(function () {
+ newPromise.promiseDispatch.apply(newPromise, message);
+ });
+ }, void 0);
+
+ messages = void 0;
+ progressListeners = void 0;
+ }
+
+ deferred.promise = promise;
+ deferred.resolve = function (value) {
+ if (resolvedPromise) {
+ return;
+ }
+
+ become(Q(value));
+ };
+
+ deferred.fulfill = function (value) {
+ if (resolvedPromise) {
+ return;
+ }
+
+ become(fulfill(value));
+ };
+ deferred.reject = function (reason) {
+ if (resolvedPromise) {
+ return;
+ }
+
+ become(reject(reason));
+ };
+ deferred.notify = function (progress) {
+ if (resolvedPromise) {
+ return;
+ }
+
+ array_reduce(progressListeners, function (undefined, progressListener) {
+ Q.nextTick(function () {
+ progressListener(progress);
+ });
+ }, void 0);
+ };
+
+ return deferred;
+}
+
+/**
+ * Creates a Node-style callback that will resolve or reject the deferred
+ * promise.
+ * @returns a nodeback
+ */
+defer.prototype.makeNodeResolver = function () {
+ var self = this;
+ return function (error, value) {
+ if (error) {
+ self.reject(error);
+ } else if (arguments.length > 2) {
+ self.resolve(array_slice(arguments, 1));
+ } else {
+ self.resolve(value);
+ }
+ };
+};
+
+/**
+ * @param resolver {Function} a function that returns nothing and accepts
+ * the resolve, reject, and notify functions for a deferred.
+ * @returns a promise that may be resolved with the given resolve and reject
+ * functions, or rejected by a thrown exception in resolver
+ */
+Q.Promise = promise; // ES6
+Q.promise = promise;
+function promise(resolver) {
+ if (typeof resolver !== "function") {
+ throw new TypeError("resolver must be a function.");
+ }
+ var deferred = defer();
+ try {
+ resolver(deferred.resolve, deferred.reject, deferred.notify);
+ } catch (reason) {
+ deferred.reject(reason);
+ }
+ return deferred.promise;
+}
+
+promise.race = race; // ES6
+promise.all = all; // ES6
+promise.reject = reject; // ES6
+promise.resolve = Q; // ES6
+
+// XXX experimental. This method is a way to denote that a local value is
+// serializable and should be immediately dispatched to a remote upon request,
+// instead of passing a reference.
+Q.passByCopy = function (object) {
+ //freeze(object);
+ //passByCopies.set(object, true);
+ return object;
+};
+
+Promise.prototype.passByCopy = function () {
+ //freeze(object);
+ //passByCopies.set(object, true);
+ return this;
+};
+
+/**
+ * If two promises eventually fulfill to the same value, promises that value,
+ * but otherwise rejects.
+ * @param x {Any*}
+ * @param y {Any*}
+ * @returns {Any*} a promise for x and y if they are the same, but a rejection
+ * otherwise.
+ *
+ */
+Q.join = function (x, y) {
+ return Q(x).join(y);
+};
+
+Promise.prototype.join = function (that) {
+ return Q([this, that]).spread(function (x, y) {
+ if (x === y) {
+ // TODO: "===" should be Object.is or equiv
+ return x;
+ } else {
+ throw new Error("Can't join: not the same: " + x + " " + y);
+ }
+ });
+};
+
+/**
+ * Returns a promise for the first of an array of promises to become settled.
+ * @param answers {Array[Any*]} promises to race
+ * @returns {Any*} the first promise to be settled
+ */
+Q.race = race;
+function race(answerPs) {
+ return promise(function (resolve, reject) {
+ // Switch to this once we can assume at least ES5
+ // answerPs.forEach(function (answerP) {
+ // Q(answerP).then(resolve, reject);
+ // });
+ // Use this in the meantime
+ for (var i = 0, len = answerPs.length; i < len; i++) {
+ Q(answerPs[i]).then(resolve, reject);
+ }
+ });
+}
+
+Promise.prototype.race = function () {
+ return this.then(Q.race);
+};
+
+/**
+ * Constructs a Promise with a promise descriptor object and optional fallback
+ * function. The descriptor contains methods like when(rejected), get(name),
+ * set(name, value), post(name, args), and delete(name), which all
+ * return either a value, a promise for a value, or a rejection. The fallback
+ * accepts the operation name, a resolver, and any further arguments that would
+ * have been forwarded to the appropriate method above had a method been
+ * provided with the proper name. The API makes no guarantees about the nature
+ * of the returned object, apart from that it is usable whereever promises are
+ * bought and sold.
+ */
+Q.makePromise = Promise;
+function Promise(descriptor, fallback, inspect) {
+ if (fallback === void 0) {
+ fallback = function (op) {
+ return reject(new Error(
+ "Promise does not support operation: " + op
+ ));
+ };
+ }
+ if (inspect === void 0) {
+ inspect = function () {
+ return {state: "unknown"};
+ };
+ }
+
+ var promise = object_create(Promise.prototype);
+
+ promise.promiseDispatch = function (resolve, op, args) {
+ var result;
+ try {
+ if (descriptor[op]) {
+ result = descriptor[op].apply(promise, args);
+ } else {
+ result = fallback.call(promise, op, args);
+ }
+ } catch (exception) {
+ result = reject(exception);
+ }
+ if (resolve) {
+ resolve(result);
+ }
+ };
+
+ promise.inspect = inspect;
+
+ // XXX deprecated `valueOf` and `exception` support
+ if (inspect) {
+ var inspected = inspect();
+ if (inspected.state === "rejected") {
+ promise.exception = inspected.reason;
+ }
+
+ promise.valueOf = function () {
+ var inspected = inspect();
+ if (inspected.state === "pending" ||
+ inspected.state === "rejected") {
+ return promise;
+ }
+ return inspected.value;
+ };
+ }
+
+ return promise;
+}
+
+Promise.prototype.toString = function () {
+ return "[object Promise]";
+};
+
+Promise.prototype.then = function (fulfilled, rejected, progressed) {
+ var self = this;
+ var deferred = defer();
+ var done = false; // ensure the untrusted promise makes at most a
+ // single call to one of the callbacks
+
+ function _fulfilled(value) {
+ try {
+ return typeof fulfilled === "function" ? fulfilled(value) : value;
+ } catch (exception) {
+ return reject(exception);
+ }
+ }
+
+ function _rejected(exception) {
+ if (typeof rejected === "function") {
+ makeStackTraceLong(exception, self);
+ try {
+ return rejected(exception);
+ } catch (newException) {
+ return reject(newException);
+ }
+ }
+ return reject(exception);
+ }
+
+ function _progressed(value) {
+ return typeof progressed === "function" ? progressed(value) : value;
+ }
+
+ Q.nextTick(function () {
+ self.promiseDispatch(function (value) {
+ if (done) {
+ return;
+ }
+ done = true;
+
+ deferred.resolve(_fulfilled(value));
+ }, "when", [function (exception) {
+ if (done) {
+ return;
+ }
+ done = true;
+
+ deferred.resolve(_rejected(exception));
+ }]);
+ });
+
+ // Progress propagator need to be attached in the current tick.
+ self.promiseDispatch(void 0, "when", [void 0, function (value) {
+ var newValue;
+ var threw = false;
+ try {
+ newValue = _progressed(value);
+ } catch (e) {
+ threw = true;
+ if (Q.onerror) {
+ Q.onerror(e);
+ } else {
+ throw e;
+ }
+ }
+
+ if (!threw) {
+ deferred.notify(newValue);
+ }
+ }]);
+
+ return deferred.promise;
+};
+
+Q.tap = function (promise, callback) {
+ return Q(promise).tap(callback);
+};
+
+/**
+ * Works almost like "finally", but not called for rejections.
+ * Original resolution value is passed through callback unaffected.
+ * Callback may return a promise that will be awaited for.
+ * @param {Function} callback
+ * @returns {Q.Promise}
+ * @example
+ * doSomething()
+ * .then(...)
+ * .tap(console.log)
+ * .then(...);
+ */
+Promise.prototype.tap = function (callback) {
+ callback = Q(callback);
+
+ return this.then(function (value) {
+ return callback.fcall(value).thenResolve(value);
+ });
+};
+
+/**
+ * Registers an observer on a promise.
+ *
+ * Guarantees:
+ *
+ * 1. that fulfilled and rejected will be called only once.
+ * 2. that either the fulfilled callback or the rejected callback will be
+ * called, but not both.
+ * 3. that fulfilled and rejected will not be called in this turn.
+ *
+ * @param value promise or immediate reference to observe
+ * @param fulfilled function to be called with the fulfilled value
+ * @param rejected function to be called with the rejection exception
+ * @param progressed function to be called on any progress notifications
+ * @return promise for the return value from the invoked callback
+ */
+Q.when = when;
+function when(value, fulfilled, rejected, progressed) {
+ return Q(value).then(fulfilled, rejected, progressed);
+}
+
+Promise.prototype.thenResolve = function (value) {
+ return this.then(function () { return value; });
+};
+
+Q.thenResolve = function (promise, value) {
+ return Q(promise).thenResolve(value);
+};
+
+Promise.prototype.thenReject = function (reason) {
+ return this.then(function () { throw reason; });
+};
+
+Q.thenReject = function (promise, reason) {
+ return Q(promise).thenReject(reason);
+};
+
+/**
+ * If an object is not a promise, it is as "near" as possible.
+ * If a promise is rejected, it is as "near" as possible too.
+ * If it’s a fulfilled promise, the fulfillment value is nearer.
+ * If it’s a deferred promise and the deferred has been resolved, the
+ * resolution is "nearer".
+ * @param object
+ * @returns most resolved (nearest) form of the object
+ */
+
+// XXX should we re-do this?
+Q.nearer = nearer;
+function nearer(value) {
+ if (isPromise(value)) {
+ var inspected = value.inspect();
+ if (inspected.state === "fulfilled") {
+ return inspected.value;
+ }
+ }
+ return value;
+}
+
+/**
+ * @returns whether the given object is a promise.
+ * Otherwise it is a fulfilled value.
+ */
+Q.isPromise = isPromise;
+function isPromise(object) {
+ return object instanceof Promise;
+}
+
+Q.isPromiseAlike = isPromiseAlike;
+function isPromiseAlike(object) {
+ return isObject(object) && typeof object.then === "function";
+}
+
+/**
+ * @returns whether the given object is a pending promise, meaning not
+ * fulfilled or rejected.
+ */
+Q.isPending = isPending;
+function isPending(object) {
+ return isPromise(object) && object.inspect().state === "pending";
+}
+
+Promise.prototype.isPending = function () {
+ return this.inspect().state === "pending";
+};
+
+/**
+ * @returns whether the given object is a value or fulfilled
+ * promise.
+ */
+Q.isFulfilled = isFulfilled;
+function isFulfilled(object) {
+ return !isPromise(object) || object.inspect().state === "fulfilled";
+}
+
+Promise.prototype.isFulfilled = function () {
+ return this.inspect().state === "fulfilled";
+};
+
+/**
+ * @returns whether the given object is a rejected promise.
+ */
+Q.isRejected = isRejected;
+function isRejected(object) {
+ return isPromise(object) && object.inspect().state === "rejected";
+}
+
+Promise.prototype.isRejected = function () {
+ return this.inspect().state === "rejected";
+};
+
+//// BEGIN UNHANDLED REJECTION TRACKING
+
+// This promise library consumes exceptions thrown in handlers so they can be
+// handled by a subsequent promise. The exceptions get added to this array when
+// they are created, and removed when they are handled. Note that in ES6 or
+// shimmed environments, this would naturally be a `Set`.
+var unhandledReasons = [];
+var unhandledRejections = [];
+var reportedUnhandledRejections = [];
+var trackUnhandledRejections = true;
+
+function resetUnhandledRejections() {
+ unhandledReasons.length = 0;
+ unhandledRejections.length = 0;
+
+ if (!trackUnhandledRejections) {
+ trackUnhandledRejections = true;
+ }
+}
+
+function trackRejection(promise, reason) {
+ if (!trackUnhandledRejections) {
+ return;
+ }
+ if (typeof process === "object" && typeof process.emit === "function") {
+ Q.nextTick.runAfter(function () {
+ if (array_indexOf(unhandledRejections, promise) !== -1) {
+ process.emit("unhandledRejection", reason, promise);
+ reportedUnhandledRejections.push(promise);
+ }
+ });
+ }
+
+ unhandledRejections.push(promise);
+ if (reason && typeof reason.stack !== "undefined") {
+ unhandledReasons.push(reason.stack);
+ } else {
+ unhandledReasons.push("(no stack) " + reason);
+ }
+}
+
+function untrackRejection(promise) {
+ if (!trackUnhandledRejections) {
+ return;
+ }
+
+ var at = array_indexOf(unhandledRejections, promise);
+ if (at !== -1) {
+ if (typeof process === "object" && typeof process.emit === "function") {
+ Q.nextTick.runAfter(function () {
+ var atReport = array_indexOf(reportedUnhandledRejections, promise);
+ if (atReport !== -1) {
+ process.emit("rejectionHandled", unhandledReasons[at], promise);
+ reportedUnhandledRejections.splice(atReport, 1);
+ }
+ });
+ }
+ unhandledRejections.splice(at, 1);
+ unhandledReasons.splice(at, 1);
+ }
+}
+
+Q.resetUnhandledRejections = resetUnhandledRejections;
+
+Q.getUnhandledReasons = function () {
+ // Make a copy so that consumers can't interfere with our internal state.
+ return unhandledReasons.slice();
+};
+
+Q.stopUnhandledRejectionTracking = function () {
+ resetUnhandledRejections();
+ trackUnhandledRejections = false;
+};
+
+resetUnhandledRejections();
+
+//// END UNHANDLED REJECTION TRACKING
+
+/**
+ * Constructs a rejected promise.
+ * @param reason value describing the failure
+ */
+Q.reject = reject;
+function reject(reason) {
+ var rejection = Promise({
+ "when": function (rejected) {
+ // note that the error has been handled
+ if (rejected) {
+ untrackRejection(this);
+ }
+ return rejected ? rejected(reason) : this;
+ }
+ }, function fallback() {
+ return this;
+ }, function inspect() {
+ return { state: "rejected", reason: reason };
+ });
+
+ // Note that the reason has not been handled.
+ trackRejection(rejection, reason);
+
+ return rejection;
+}
+
+/**
+ * Constructs a fulfilled promise for an immediate reference.
+ * @param value immediate reference
+ */
+Q.fulfill = fulfill;
+function fulfill(value) {
+ return Promise({
+ "when": function () {
+ return value;
+ },
+ "get": function (name) {
+ return value[name];
+ },
+ "set": function (name, rhs) {
+ value[name] = rhs;
+ },
+ "delete": function (name) {
+ delete value[name];
+ },
+ "post": function (name, args) {
+ // Mark Miller proposes that post with no name should apply a
+ // promised function.
+ if (name === null || name === void 0) {
+ return value.apply(void 0, args);
+ } else {
+ return value[name].apply(value, args);
+ }
+ },
+ "apply": function (thisp, args) {
+ return value.apply(thisp, args);
+ },
+ "keys": function () {
+ return object_keys(value);
+ }
+ }, void 0, function inspect() {
+ return { state: "fulfilled", value: value };
+ });
+}
+
+/**
+ * Converts thenables to Q promises.
+ * @param promise thenable promise
+ * @returns a Q promise
+ */
+function coerce(promise) {
+ var deferred = defer();
+ Q.nextTick(function () {
+ try {
+ promise.then(deferred.resolve, deferred.reject, deferred.notify);
+ } catch (exception) {
+ deferred.reject(exception);
+ }
+ });
+ return deferred.promise;
+}
+
+/**
+ * Annotates an object such that it will never be
+ * transferred away from this process over any promise
+ * communication channel.
+ * @param object
+ * @returns promise a wrapping of that object that
+ * additionally responds to the "isDef" message
+ * without a rejection.
+ */
+Q.master = master;
+function master(object) {
+ return Promise({
+ "isDef": function () {}
+ }, function fallback(op, args) {
+ return dispatch(object, op, args);
+ }, function () {
+ return Q(object).inspect();
+ });
+}
+
+/**
+ * Spreads the values of a promised array of arguments into the
+ * fulfillment callback.
+ * @param fulfilled callback that receives variadic arguments from the
+ * promised array
+ * @param rejected callback that receives the exception if the promise
+ * is rejected.
+ * @returns a promise for the return value or thrown exception of
+ * either callback.
+ */
+Q.spread = spread;
+function spread(value, fulfilled, rejected) {
+ return Q(value).spread(fulfilled, rejected);
+}
+
+Promise.prototype.spread = function (fulfilled, rejected) {
+ return this.all().then(function (array) {
+ return fulfilled.apply(void 0, array);
+ }, rejected);
+};
+
+/**
+ * The async function is a decorator for generator functions, turning
+ * them into asynchronous generators. Although generators are only part
+ * of the newest ECMAScript 6 drafts, this code does not cause syntax
+ * errors in older engines. This code should continue to work and will
+ * in fact improve over time as the language improves.
+ *
+ * ES6 generators are currently part of V8 version 3.19 with the
+ * --harmony-generators runtime flag enabled. SpiderMonkey has had them
+ * for longer, but under an older Python-inspired form. This function
+ * works on both kinds of generators.
+ *
+ * Decorates a generator function such that:
+ * - it may yield promises
+ * - execution will continue when that promise is fulfilled
+ * - the value of the yield expression will be the fulfilled value
+ * - it returns a promise for the return value (when the generator
+ * stops iterating)
+ * - the decorated function returns a promise for the return value
+ * of the generator or the first rejected promise among those
+ * yielded.
+ * - if an error is thrown in the generator, it propagates through
+ * every following yield until it is caught, or until it escapes
+ * the generator function altogether, and is translated into a
+ * rejection for the promise returned by the decorated generator.
+ */
+Q.async = async;
+function async(makeGenerator) {
+ return function () {
+ // when verb is "send", arg is a value
+ // when verb is "throw", arg is an exception
+ function continuer(verb, arg) {
+ var result;
+
+ // Until V8 3.19 / Chromium 29 is released, SpiderMonkey is the only
+ // engine that has a deployed base of browsers that support generators.
+ // However, SM's generators use the Python-inspired semantics of
+ // outdated ES6 drafts. We would like to support ES6, but we'd also
+ // like to make it possible to use generators in deployed browsers, so
+ // we also support Python-style generators. At some point we can remove
+ // this block.
+
+ if (typeof StopIteration === "undefined") {
+ // ES6 Generators
+ try {
+ result = generator[verb](arg);
+ } catch (exception) {
+ return reject(exception);
+ }
+ if (result.done) {
+ return Q(result.value);
+ } else {
+ return when(result.value, callback, errback);
+ }
+ } else {
+ // SpiderMonkey Generators
+ // FIXME: Remove this case when SM does ES6 generators.
+ try {
+ result = generator[verb](arg);
+ } catch (exception) {
+ if (isStopIteration(exception)) {
+ return Q(exception.value);
+ } else {
+ return reject(exception);
+ }
+ }
+ return when(result, callback, errback);
+ }
+ }
+ var generator = makeGenerator.apply(this, arguments);
+ var callback = continuer.bind(continuer, "next");
+ var errback = continuer.bind(continuer, "throw");
+ return callback();
+ };
+}
+
+/**
+ * The spawn function is a small wrapper around async that immediately
+ * calls the generator and also ends the promise chain, so that any
+ * unhandled errors are thrown instead of forwarded to the error
+ * handler. This is useful because it's extremely common to run
+ * generators at the top-level to work with libraries.
+ */
+Q.spawn = spawn;
+function spawn(makeGenerator) {
+ Q.done(Q.async(makeGenerator)());
+}
+
+// FIXME: Remove this interface once ES6 generators are in SpiderMonkey.
+/**
+ * Throws a ReturnValue exception to stop an asynchronous generator.
+ *
+ * This interface is a stop-gap measure to support generator return
+ * values in older Firefox/SpiderMonkey. In browsers that support ES6
+ * generators like Chromium 29, just use "return" in your generator
+ * functions.
+ *
+ * @param value the return value for the surrounding generator
+ * @throws ReturnValue exception with the value.
+ * @example
+ * // ES6 style
+ * Q.async(function* () {
+ * var foo = yield getFooPromise();
+ * var bar = yield getBarPromise();
+ * return foo + bar;
+ * })
+ * // Older SpiderMonkey style
+ * Q.async(function () {
+ * var foo = yield getFooPromise();
+ * var bar = yield getBarPromise();
+ * Q.return(foo + bar);
+ * })
+ */
+Q["return"] = _return;
+function _return(value) {
+ throw new QReturnValue(value);
+}
+
+/**
+ * The promised function decorator ensures that any promise arguments
+ * are settled and passed as values (`this` is also settled and passed
+ * as a value). It will also ensure that the result of a function is
+ * always a promise.
+ *
+ * @example
+ * var add = Q.promised(function (a, b) {
+ * return a + b;
+ * });
+ * add(Q(a), Q(B));
+ *
+ * @param {function} callback The function to decorate
+ * @returns {function} a function that has been decorated.
+ */
+Q.promised = promised;
+function promised(callback) {
+ return function () {
+ return spread([this, all(arguments)], function (self, args) {
+ return callback.apply(self, args);
+ });
+ };
+}
+
+/**
+ * sends a message to a value in a future turn
+ * @param object* the recipient
+ * @param op the name of the message operation, e.g., "when",
+ * @param args further arguments to be forwarded to the operation
+ * @returns result {Promise} a promise for the result of the operation
+ */
+Q.dispatch = dispatch;
+function dispatch(object, op, args) {
+ return Q(object).dispatch(op, args);
+}
+
+Promise.prototype.dispatch = function (op, args) {
+ var self = this;
+ var deferred = defer();
+ Q.nextTick(function () {
+ self.promiseDispatch(deferred.resolve, op, args);
+ });
+ return deferred.promise;
+};
+
+/**
+ * Gets the value of a property in a future turn.
+ * @param object promise or immediate reference for target object
+ * @param name name of property to get
+ * @return promise for the property value
+ */
+Q.get = function (object, key) {
+ return Q(object).dispatch("get", [key]);
+};
+
+Promise.prototype.get = function (key) {
+ return this.dispatch("get", [key]);
+};
+
+/**
+ * Sets the value of a property in a future turn.
+ * @param object promise or immediate reference for object object
+ * @param name name of property to set
+ * @param value new value of property
+ * @return promise for the return value
+ */
+Q.set = function (object, key, value) {
+ return Q(object).dispatch("set", [key, value]);
+};
+
+Promise.prototype.set = function (key, value) {
+ return this.dispatch("set", [key, value]);
+};
+
+/**
+ * Deletes a property in a future turn.
+ * @param object promise or immediate reference for target object
+ * @param name name of property to delete
+ * @return promise for the return value
+ */
+Q.del = // XXX legacy
+Q["delete"] = function (object, key) {
+ return Q(object).dispatch("delete", [key]);
+};
+
+Promise.prototype.del = // XXX legacy
+Promise.prototype["delete"] = function (key) {
+ return this.dispatch("delete", [key]);
+};
+
+/**
+ * Invokes a method in a future turn.
+ * @param object promise or immediate reference for target object
+ * @param name name of method to invoke
+ * @param value a value to post, typically an array of
+ * invocation arguments for promises that
+ * are ultimately backed with `resolve` values,
+ * as opposed to those backed with URLs
+ * wherein the posted value can be any
+ * JSON serializable object.
+ * @return promise for the return value
+ */
+// bound locally because it is used by other methods
+Q.mapply = // XXX As proposed by "Redsandro"
+Q.post = function (object, name, args) {
+ return Q(object).dispatch("post", [name, args]);
+};
+
+Promise.prototype.mapply = // XXX As proposed by "Redsandro"
+Promise.prototype.post = function (name, args) {
+ return this.dispatch("post", [name, args]);
+};
+
+/**
+ * Invokes a method in a future turn.
+ * @param object promise or immediate reference for target object
+ * @param name name of method to invoke
+ * @param ...args array of invocation arguments
+ * @return promise for the return value
+ */
+Q.send = // XXX Mark Miller's proposed parlance
+Q.mcall = // XXX As proposed by "Redsandro"
+Q.invoke = function (object, name /*...args*/) {
+ return Q(object).dispatch("post", [name, array_slice(arguments, 2)]);
+};
+
+Promise.prototype.send = // XXX Mark Miller's proposed parlance
+Promise.prototype.mcall = // XXX As proposed by "Redsandro"
+Promise.prototype.invoke = function (name /*...args*/) {
+ return this.dispatch("post", [name, array_slice(arguments, 1)]);
+};
+
+/**
+ * Applies the promised function in a future turn.
+ * @param object promise or immediate reference for target function
+ * @param args array of application arguments
+ */
+Q.fapply = function (object, args) {
+ return Q(object).dispatch("apply", [void 0, args]);
+};
+
+Promise.prototype.fapply = function (args) {
+ return this.dispatch("apply", [void 0, args]);
+};
+
+/**
+ * Calls the promised function in a future turn.
+ * @param object promise or immediate reference for target function
+ * @param ...args array of application arguments
+ */
+Q["try"] =
+Q.fcall = function (object /* ...args*/) {
+ return Q(object).dispatch("apply", [void 0, array_slice(arguments, 1)]);
+};
+
+Promise.prototype.fcall = function (/*...args*/) {
+ return this.dispatch("apply", [void 0, array_slice(arguments)]);
+};
+
+/**
+ * Binds the promised function, transforming return values into a fulfilled
+ * promise and thrown errors into a rejected one.
+ * @param object promise or immediate reference for target function
+ * @param ...args array of application arguments
+ */
+Q.fbind = function (object /*...args*/) {
+ var promise = Q(object);
+ var args = array_slice(arguments, 1);
+ return function fbound() {
+ return promise.dispatch("apply", [
+ this,
+ args.concat(array_slice(arguments))
+ ]);
+ };
+};
+Promise.prototype.fbind = function (/*...args*/) {
+ var promise = this;
+ var args = array_slice(arguments);
+ return function fbound() {
+ return promise.dispatch("apply", [
+ this,
+ args.concat(array_slice(arguments))
+ ]);
+ };
+};
+
+/**
+ * Requests the names of the owned properties of a promised
+ * object in a future turn.
+ * @param object promise or immediate reference for target object
+ * @return promise for the keys of the eventually settled object
+ */
+Q.keys = function (object) {
+ return Q(object).dispatch("keys", []);
+};
+
+Promise.prototype.keys = function () {
+ return this.dispatch("keys", []);
+};
+
+/**
+ * Turns an array of promises into a promise for an array. If any of
+ * the promises gets rejected, the whole array is rejected immediately.
+ * @param {Array*} an array (or promise for an array) of values (or
+ * promises for values)
+ * @returns a promise for an array of the corresponding values
+ */
+// By Mark Miller
+// http://wiki.ecmascript.org/doku.php?id=strawman:concurrency&rev=1308776521#allfulfilled
+Q.all = all;
+function all(promises) {
+ return when(promises, function (promises) {
+ var pendingCount = 0;
+ var deferred = defer();
+ array_reduce(promises, function (undefined, promise, index) {
+ var snapshot;
+ if (
+ isPromise(promise) &&
+ (snapshot = promise.inspect()).state === "fulfilled"
+ ) {
+ promises[index] = snapshot.value;
+ } else {
+ ++pendingCount;
+ when(
+ promise,
+ function (value) {
+ promises[index] = value;
+ if (--pendingCount === 0) {
+ deferred.resolve(promises);
+ }
+ },
+ deferred.reject,
+ function (progress) {
+ deferred.notify({ index: index, value: progress });
+ }
+ );
+ }
+ }, void 0);
+ if (pendingCount === 0) {
+ deferred.resolve(promises);
+ }
+ return deferred.promise;
+ });
+}
+
+Promise.prototype.all = function () {
+ return all(this);
+};
+
+/**
+ * Returns the first resolved promise of an array. Prior rejected promises are
+ * ignored. Rejects only if all promises are rejected.
+ * @param {Array*} an array containing values or promises for values
+ * @returns a promise fulfilled with the value of the first resolved promise,
+ * or a rejected promise if all promises are rejected.
+ */
+Q.any = any;
+
+function any(promises) {
+ if (promises.length === 0) {
+ return Q.resolve();
+ }
+
+ var deferred = Q.defer();
+ var pendingCount = 0;
+ array_reduce(promises, function (prev, current, index) {
+ var promise = promises[index];
+
+ pendingCount++;
+
+ when(promise, onFulfilled, onRejected, onProgress);
+ function onFulfilled(result) {
+ deferred.resolve(result);
+ }
+ function onRejected() {
+ pendingCount--;
+ if (pendingCount === 0) {
+ deferred.reject(new Error(
+ "Can't get fulfillment value from any promise, all " +
+ "promises were rejected."
+ ));
+ }
+ }
+ function onProgress(progress) {
+ deferred.notify({
+ index: index,
+ value: progress
+ });
+ }
+ }, undefined);
+
+ return deferred.promise;
+}
+
+Promise.prototype.any = function () {
+ return any(this);
+};
+
+/**
+ * Waits for all promises to be settled, either fulfilled or
+ * rejected. This is distinct from `all` since that would stop
+ * waiting at the first rejection. The promise returned by
+ * `allResolved` will never be rejected.
+ * @param promises a promise for an array (or an array) of promises
+ * (or values)
+ * @return a promise for an array of promises
+ */
+Q.allResolved = deprecate(allResolved, "allResolved", "allSettled");
+function allResolved(promises) {
+ return when(promises, function (promises) {
+ promises = array_map(promises, Q);
+ return when(all(array_map(promises, function (promise) {
+ return when(promise, noop, noop);
+ })), function () {
+ return promises;
+ });
+ });
+}
+
+Promise.prototype.allResolved = function () {
+ return allResolved(this);
+};
+
+/**
+ * @see Promise#allSettled
+ */
+Q.allSettled = allSettled;
+function allSettled(promises) {
+ return Q(promises).allSettled();
+}
+
+/**
+ * Turns an array of promises into a promise for an array of their states (as
+ * returned by `inspect`) when they have all settled.
+ * @param {Array[Any*]} values an array (or promise for an array) of values (or
+ * promises for values)
+ * @returns {Array[State]} an array of states for the respective values.
+ */
+Promise.prototype.allSettled = function () {
+ return this.then(function (promises) {
+ return all(array_map(promises, function (promise) {
+ promise = Q(promise);
+ function regardless() {
+ return promise.inspect();
+ }
+ return promise.then(regardless, regardless);
+ }));
+ });
+};
+
+/**
+ * Captures the failure of a promise, giving an oportunity to recover
+ * with a callback. If the given promise is fulfilled, the returned
+ * promise is fulfilled.
+ * @param {Any*} promise for something
+ * @param {Function} callback to fulfill the returned promise if the
+ * given promise is rejected
+ * @returns a promise for the return value of the callback
+ */
+Q.fail = // XXX legacy
+Q["catch"] = function (object, rejected) {
+ return Q(object).then(void 0, rejected);
+};
+
+Promise.prototype.fail = // XXX legacy
+Promise.prototype["catch"] = function (rejected) {
+ return this.then(void 0, rejected);
+};
+
+/**
+ * Attaches a listener that can respond to progress notifications from a
+ * promise's originating deferred. This listener receives the exact arguments
+ * passed to ``deferred.notify``.
+ * @param {Any*} promise for something
+ * @param {Function} callback to receive any progress notifications
+ * @returns the given promise, unchanged
+ */
+Q.progress = progress;
+function progress(object, progressed) {
+ return Q(object).then(void 0, void 0, progressed);
+}
+
+Promise.prototype.progress = function (progressed) {
+ return this.then(void 0, void 0, progressed);
+};
+
+/**
+ * Provides an opportunity to observe the settling of a promise,
+ * regardless of whether the promise is fulfilled or rejected. Forwards
+ * the resolution to the returned promise when the callback is done.
+ * The callback can return a promise to defer completion.
+ * @param {Any*} promise
+ * @param {Function} callback to observe the resolution of the given
+ * promise, takes no arguments.
+ * @returns a promise for the resolution of the given promise when
+ * ``fin`` is done.
+ */
+Q.fin = // XXX legacy
+Q["finally"] = function (object, callback) {
+ return Q(object)["finally"](callback);
+};
+
+Promise.prototype.fin = // XXX legacy
+Promise.prototype["finally"] = function (callback) {
+ callback = Q(callback);
+ return this.then(function (value) {
+ return callback.fcall().then(function () {
+ return value;
+ });
+ }, function (reason) {
+ // TODO attempt to recycle the rejection with "this".
+ return callback.fcall().then(function () {
+ throw reason;
+ });
+ });
+};
+
+/**
+ * Terminates a chain of promises, forcing rejections to be
+ * thrown as exceptions.
+ * @param {Any*} promise at the end of a chain of promises
+ * @returns nothing
+ */
+Q.done = function (object, fulfilled, rejected, progress) {
+ return Q(object).done(fulfilled, rejected, progress);
+};
+
+Promise.prototype.done = function (fulfilled, rejected, progress) {
+ var onUnhandledError = function (error) {
+ // forward to a future turn so that ``when``
+ // does not catch it and turn it into a rejection.
+ Q.nextTick(function () {
+ makeStackTraceLong(error, promise);
+ if (Q.onerror) {
+ Q.onerror(error);
+ } else {
+ throw error;
+ }
+ });
+ };
+
+ // Avoid unnecessary `nextTick`ing via an unnecessary `when`.
+ var promise = fulfilled || rejected || progress ?
+ this.then(fulfilled, rejected, progress) :
+ this;
+
+ if (typeof process === "object" && process && process.domain) {
+ onUnhandledError = process.domain.bind(onUnhandledError);
+ }
+
+ promise.then(void 0, onUnhandledError);
+};
+
+/**
+ * Causes a promise to be rejected if it does not get fulfilled before
+ * some milliseconds time out.
+ * @param {Any*} promise
+ * @param {Number} milliseconds timeout
+ * @param {Any*} custom error message or Error object (optional)
+ * @returns a promise for the resolution of the given promise if it is
+ * fulfilled before the timeout, otherwise rejected.
+ */
+Q.timeout = function (object, ms, error) {
+ return Q(object).timeout(ms, error);
+};
+
+Promise.prototype.timeout = function (ms, error) {
+ var deferred = defer();
+ var timeoutId = setTimeout(function () {
+ if (!error || "string" === typeof error) {
+ error = new Error(error || "Timed out after " + ms + " ms");
+ error.code = "ETIMEDOUT";
+ }
+ deferred.reject(error);
+ }, ms);
+
+ this.then(function (value) {
+ clearTimeout(timeoutId);
+ deferred.resolve(value);
+ }, function (exception) {
+ clearTimeout(timeoutId);
+ deferred.reject(exception);
+ }, deferred.notify);
+
+ return deferred.promise;
+};
+
+/**
+ * Returns a promise for the given value (or promised value), some
+ * milliseconds after it resolved. Passes rejections immediately.
+ * @param {Any*} promise
+ * @param {Number} milliseconds
+ * @returns a promise for the resolution of the given promise after milliseconds
+ * time has elapsed since the resolution of the given promise.
+ * If the given promise rejects, that is passed immediately.
+ */
+Q.delay = function (object, timeout) {
+ if (timeout === void 0) {
+ timeout = object;
+ object = void 0;
+ }
+ return Q(object).delay(timeout);
+};
+
+Promise.prototype.delay = function (timeout) {
+ return this.then(function (value) {
+ var deferred = defer();
+ setTimeout(function () {
+ deferred.resolve(value);
+ }, timeout);
+ return deferred.promise;
+ });
+};
+
+/**
+ * Passes a continuation to a Node function, which is called with the given
+ * arguments provided as an array, and returns a promise.
+ *
+ * Q.nfapply(FS.readFile, [__filename])
+ * .then(function (content) {
+ * })
+ *
+ */
+Q.nfapply = function (callback, args) {
+ return Q(callback).nfapply(args);
+};
+
+Promise.prototype.nfapply = function (args) {
+ var deferred = defer();
+ var nodeArgs = array_slice(args);
+ nodeArgs.push(deferred.makeNodeResolver());
+ this.fapply(nodeArgs).fail(deferred.reject);
+ return deferred.promise;
+};
+
+/**
+ * Passes a continuation to a Node function, which is called with the given
+ * arguments provided individually, and returns a promise.
+ * @example
+ * Q.nfcall(FS.readFile, __filename)
+ * .then(function (content) {
+ * })
+ *
+ */
+Q.nfcall = function (callback /*...args*/) {
+ var args = array_slice(arguments, 1);
+ return Q(callback).nfapply(args);
+};
+
+Promise.prototype.nfcall = function (/*...args*/) {
+ var nodeArgs = array_slice(arguments);
+ var deferred = defer();
+ nodeArgs.push(deferred.makeNodeResolver());
+ this.fapply(nodeArgs).fail(deferred.reject);
+ return deferred.promise;
+};
+
+/**
+ * Wraps a NodeJS continuation passing function and returns an equivalent
+ * version that returns a promise.
+ * @example
+ * Q.nfbind(FS.readFile, __filename)("utf-8")
+ * .then(console.log)
+ * .done()
+ */
+Q.nfbind =
+Q.denodeify = function (callback /*...args*/) {
+ var baseArgs = array_slice(arguments, 1);
+ return function () {
+ var nodeArgs = baseArgs.concat(array_slice(arguments));
+ var deferred = defer();
+ nodeArgs.push(deferred.makeNodeResolver());
+ Q(callback).fapply(nodeArgs).fail(deferred.reject);
+ return deferred.promise;
+ };
+};
+
+Promise.prototype.nfbind =
+Promise.prototype.denodeify = function (/*...args*/) {
+ var args = array_slice(arguments);
+ args.unshift(this);
+ return Q.denodeify.apply(void 0, args);
+};
+
+Q.nbind = function (callback, thisp /*...args*/) {
+ var baseArgs = array_slice(arguments, 2);
+ return function () {
+ var nodeArgs = baseArgs.concat(array_slice(arguments));
+ var deferred = defer();
+ nodeArgs.push(deferred.makeNodeResolver());
+ function bound() {
+ return callback.apply(thisp, arguments);
+ }
+ Q(bound).fapply(nodeArgs).fail(deferred.reject);
+ return deferred.promise;
+ };
+};
+
+Promise.prototype.nbind = function (/*thisp, ...args*/) {
+ var args = array_slice(arguments, 0);
+ args.unshift(this);
+ return Q.nbind.apply(void 0, args);
+};
+
+/**
+ * Calls a method of a Node-style object that accepts a Node-style
+ * callback with a given array of arguments, plus a provided callback.
+ * @param object an object that has the named method
+ * @param {String} name name of the method of object
+ * @param {Array} args arguments to pass to the method; the callback
+ * will be provided by Q and appended to these arguments.
+ * @returns a promise for the value or error
+ */
+Q.nmapply = // XXX As proposed by "Redsandro"
+Q.npost = function (object, name, args) {
+ return Q(object).npost(name, args);
+};
+
+Promise.prototype.nmapply = // XXX As proposed by "Redsandro"
+Promise.prototype.npost = function (name, args) {
+ var nodeArgs = array_slice(args || []);
+ var deferred = defer();
+ nodeArgs.push(deferred.makeNodeResolver());
+ this.dispatch("post", [name, nodeArgs]).fail(deferred.reject);
+ return deferred.promise;
+};
+
+/**
+ * Calls a method of a Node-style object that accepts a Node-style
+ * callback, forwarding the given variadic arguments, plus a provided
+ * callback argument.
+ * @param object an object that has the named method
+ * @param {String} name name of the method of object
+ * @param ...args arguments to pass to the method; the callback will
+ * be provided by Q and appended to these arguments.
+ * @returns a promise for the value or error
+ */
+Q.nsend = // XXX Based on Mark Miller's proposed "send"
+Q.nmcall = // XXX Based on "Redsandro's" proposal
+Q.ninvoke = function (object, name /*...args*/) {
+ var nodeArgs = array_slice(arguments, 2);
+ var deferred = defer();
+ nodeArgs.push(deferred.makeNodeResolver());
+ Q(object).dispatch("post", [name, nodeArgs]).fail(deferred.reject);
+ return deferred.promise;
+};
+
+Promise.prototype.nsend = // XXX Based on Mark Miller's proposed "send"
+Promise.prototype.nmcall = // XXX Based on "Redsandro's" proposal
+Promise.prototype.ninvoke = function (name /*...args*/) {
+ var nodeArgs = array_slice(arguments, 1);
+ var deferred = defer();
+ nodeArgs.push(deferred.makeNodeResolver());
+ this.dispatch("post", [name, nodeArgs]).fail(deferred.reject);
+ return deferred.promise;
+};
+
+/**
+ * If a function would like to support both Node continuation-passing-style and
+ * promise-returning-style, it can end its internal promise chain with
+ * `nodeify(nodeback)`, forwarding the optional nodeback argument. If the user
+ * elects to use a nodeback, the result will be sent there. If they do not
+ * pass a nodeback, they will receive the result promise.
+ * @param object a result (or a promise for a result)
+ * @param {Function} nodeback a Node.js-style callback
+ * @returns either the promise or nothing
+ */
+Q.nodeify = nodeify;
+function nodeify(object, nodeback) {
+ return Q(object).nodeify(nodeback);
+}
+
+Promise.prototype.nodeify = function (nodeback) {
+ if (nodeback) {
+ this.then(function (value) {
+ Q.nextTick(function () {
+ nodeback(null, value);
+ });
+ }, function (error) {
+ Q.nextTick(function () {
+ nodeback(error);
+ });
+ });
+ } else {
+ return this;
+ }
+};
+
+Q.noConflict = function() {
+ throw new Error("Q.noConflict only works when Q is used as a global");
+};
+
+// All code before this point will be filtered from stack traces.
+var qEndingLine = captureLine();
+
+return Q;
+
+});
+
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XG4gICAgICAgICAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgICAgICAgICBkb21haW4uZW50ZXIoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0aHJvdyBlO1xuXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIEluIGJyb3dzZXJzLCB1bmNhdWdodCBleGNlcHRpb25zIGFyZSBub3QgZmF0YWwuXG4gICAgICAgICAgICAgICAgLy8gUmUtdGhyb3cgdGhlbSBhc3luY2hyb25vdXNseSB0byBhdm9pZCBzbG93LWRvd25zLlxuICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICAgICAgICAgIH0sIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgZG9tYWluLmV4aXQoKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIG5leHRUaWNrID0gZnVuY3Rpb24gKHRhc2spIHtcbiAgICAgICAgdGFpbCA9IHRhaWwubmV4dCA9IHtcbiAgICAgICAgICAgIHRhc2s6IHRhc2ssXG4gICAgICAgICAgICBkb21haW46IGlzTm9kZUpTICYmIHByb2Nlc3MuZG9tYWluLFxuICAgICAgICAgICAgbmV4dDogbnVsbFxuICAgICAgICB9O1xuXG4gICAgICAgIGlmICghZmx1c2hpbmcpIHtcbiAgICAgICAgICAgIGZsdXNoaW5nID0gdHJ1ZTtcbiAgICAgICAgICAgIHJlcXVlc3RUaWNrKCk7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgaWYgKHR5cGVvZiBwcm9jZXNzID09PSBcIm9iamVjdFwiICYmXG4gICAgICAgIHByb2Nlc3MudG9TdHJpbmcoKSA9PT0gXCJbb2JqZWN0IHByb2Nlc3NdXCIgJiYgcHJvY2Vzcy5uZXh0VGljaykge1xu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IHVuY3VycnlUaGlzKEFycmF5LnByb3RvdHlwZS5zbGljZSk7XG5cbnZhciBhcnJheV9yZWR1Y2UgPSB1bmN1cnJ5VGhpcyhcbiAgICBBcnJheS5wcm90b3R5cGUucmVkdWNlIHx8IGZ1bmN0aW9uIChjYWxsYmFjaywgYmFzaXMpIHtcbiAgICAgICAgdmFyIGluZGV4ID0gMCxcbiAgICAgICAgICAgIGxlbmd0aCA9IHRoaXMubGVuZ3RoO1xuICAgICAgICAvLyBjb25jZXJuaW5nIHRoZSBpbml0aWFsIHZhbHVlLCBpZiBvbmUgaXMgbm90IHByb3ZpZGVkXG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICAvLyBzZWVrIHRvIHRoZSBmaXJzdCB2YWx1ZSBpbiB0aGUgYXJyYXksIGFjY291bnRpbmdcbiAgICAgICAgICAgIC8vIGZvciB0aGUgcG9zc2liaWxpdHkgdGhhdCBpcyBpcyBhIHNwYXJzZSBhcnJheVxuICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgIGlmIChpbmRleCBpbiB0aGlzKSB7XG4gICAgICAgICAgICAgICAgICAgIGJhc2lzID0gdGhpc1tpbmRleCsrXTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgrK2luZGV4ID49IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSB3aGlsZSAoMSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gcmVkdWNlXG4gICAgICAgIGZvciAoOyBpbmRleCA8IGxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICAgICAgLy8gYWNjb3VudCBmb3IgdGhlIHBvc3NpYmlsaXR5IHRoYXQgdGhlIGFycmF5IGlzIHNwYXJzZVxuICAgICAgICAgICA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AgIHByb2dyZXNzTGlzdGVuZXJzID0gdm9pZCAwO1xuICAgIH1cblxuICAgIGRlZmVycmVkLnByb21pc2UgPSBwcm9taXNlO1xuICAgIGRlZmVycmVkLnJlc29sdmUgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgaWYgKHJlc29sdmVkUHJvbWlzZSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgYmVjb21lKFEodmFsdWUpKTtcbiAgICB9O1xuXG4gICAgZGVmZXJyZWQuZnVsZmlsbCA9IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICBpZiAocmVzb2x2ZWRQcm9taXNlKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBiZWNvbWUoZnVsZmlsbCh2YWx1ZSkpO1xuICAgIH07XG4gICAgZGVmZXJyZWQucmVqZWN0ID0gZnVuY3Rpb24gKHJlYXNvbikge1xuICAgICAgICBpZiAocmVzb2x2ZWRQcm9taXNlKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBiZWNvbWUocmVqZWN0KHJlYXNvbikpO1xuICAgIH07XG4gICAgZGVmZXJyZWQubm90aWZ5ID0gZnVuY3Rpb24gKHByb2dyZXNzKSB7XG4gICAgICAgIGlmIChyZXNvbHZlZFByb21pc2UpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGFycmF5X3JlZHVjZShwcm9ncmVzc0xpc3RlbmVycywgZnVuY3Rpb24gKHVuZGVmaW5lZCwgcHJvZ3Jlc3NMaXN0ZW5lcikge1xuICAgICAgICAgICAgUS5uZXh0VGljayhmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcHJvZ3Jlc3NMaXN0ZW5lcihwcm9ncmVzcyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSwgdm9pZCAwKTtcbiAgICB9O1xuXG4gICAgcm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Y2VwdGlvbik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBfcmVqZWN0ZWQoZXhjZXB0aW9uKSB7XG4gICAgICAgIGlmICh0eXBlb2YgcmVqZWN0ZWQgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgbWFrZVN0YWNrVHJhY2VMb25nKGV4Y2VwdGlvbiwgc2VsZik7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHJldHVybiByZWplY3RlZChleGNlcHRpb24pO1xuICAgICAgICAgICAgfSBjYXRjaCAobmV3RXhjZXB0aW9uKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChuZXdFeGNlcHRpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZWplY3QoZXhjZXB0aW9uKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBfcHJvZ3Jlc3NlZCh2YWx1ZSkge1xuICAgICAgICByZXR1cm4gdHlwZW9mIHByb2dyZXNzZWQgPT09IFwiZnVuY3Rpb25cIiA/IHByb2dyZXNzZWQodmFsdWUpIDogdmFsdWU7XG4gICAgfVxuXG4gICAgUS5uZXh0VGljayhmdW5jdGlvbiAoKSB7XG4gICAgICAgIHNlbGYucHJvbWlzZURpc3BhdGNoKGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKGRvbmUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkb25lID0gdHJ1ZTtcblxuICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShfZnVsZmlsbGVkKHZhbHVlKSk7XG4gICAgICAgIH0sIFwid2hlblwiLCBbZnVuY3Rpb24gKGV4Y2VwdGlvbikge1xuICAgICAgICAgICAgaWYgKGRvbmUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkb25lID0g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vLyBTcGlkZXJNb25rZXkgR2VuZXJhdG9yc1xuICAgICAgICAgICAgICAgIC8vIEZJWE1FOiBSZW1vdmUgdGhpcyBjYXNlIHdoZW4gU00gZG9lcyBFUzYgZ2VuZXJhdG9ycy5cbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBnZW5lcmF0b3JbdmVyYl0oYXJnKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChleGNlcHRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzU3RvcEl0ZXJhdGlvbihleGNlcHRpb24pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUShleGNlcHRpb24udmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChleGNlcHRpb24pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiB3aGVuKHJlc3VsdCwgY2FsbGJhY2ssIGVycmJhY2spO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhciBnZW5lcmF0b3IgPSBtYWtlR2VuZXJhdG9yLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgIHZhciBjYWxsYmFjayA9IGNvbnRpbnVlci5iaW5kKGNvbnRpbnVlciwgXCJuZXh0XCIpO1xuICAgICAgICB2YXIgZXJyYmFjayA9IGNvbnRpbnVlci5iaW5kKGNvbnRpbnVlciwgXCJ0aHJvd1wiKTtcbiAgICAgICAgcmV0dXJuIGNhbGxiYWNrKCk7XG4gICAgfTtcbn1cblxuLyoqXG4gKiBUaGUgc3Bhd24gZnVuY3Rpb24gaXMgYSBzbWFsbCB3cmFwcGVyIGFyb3VuZCBhc3luYyB0aGF0IGltbWVkaWF0ZWx5XG4gKiBjYWxscyB0aGUgZ2VuZXJhdG9yIG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Jldj0xMzA4Nzc2NTIxI2FsbGZ1bGZpbGxlZFxuUS5hbGwgPSBhbGw7XG5mdW5jdGlvbiBhbGwocHJvbWlzZXMpIHtcbiAgICByZXR1cm4gd2hlbihwcm9taXNlcywgZnVuY3Rpb24gKHByb21pc2VzKSB7XG4gICAgICAgIHZhciBwZW5kaW5nQ291bnQgPSAwO1xuICAgICAgICB2YXIgZGVmZXJyZWQgPSBkZWZlcigpO1xuICAgICAgICBhcnJheV9yZWR1Y2UocHJvbWlzZXMsIGZ1bmN0aW9uICh1bmRlZmluZWQsIHByb21pc2UsIGluZGV4KSB7XG4gICAgICAgICAgICB2YXIgc25hcHNob3Q7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgaXNQcm9taXNlKHByb21pc2UpICYmXG4gICAgICAgICAgICAgICAgKHNuYXBzaG90ID0gcHJvbWlzZS5pbnNwZWN0KCkpLnN0YXRlID09PSBcImZ1bGZpbGxlZFwiXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBwcm9taXNlc1tpbmRleF0gPSBzbmFwc2hvdC52YWx1ZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgKytwZW5kaW5nQ291bnQ7XG4gICAgICAgICAgICAgICAgd2hlbihcbiAgICAgICAgICAgICAgICAgICAgcHJvbWlzZSxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9taXNlc1tpbmRleF0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgtLXBlbmRpbmdDb3VudCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlc29sdmUocHJvbWlzZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZWplY3QsXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChwcm9ncmVzcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQubm90aWZ5KHsgaW5kZXg6IGluZGV4LCB2YWx1ZTogcHJvZ3Jlc3MgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LCB2b2lkIDApO1xuICAgICAgICBpZiAocGVuZGluZ0NvdW50ID09PSAwKSB7XG4gICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKHByb21pc2VzKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZTtcbiAgICB9KTtcbn1cblxuUHJvbWlzZS5wcm90b3R5cGUuYWxsID0gZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiBhbGwodGhpcyk7XG59O1xuXG4vKipcbiAqIFJldHVybnMgdGhlIGZpcnN0IHJlc29sdmVkIHByb21pc2Ugb2YgYW4gYXJyYXkuIFByaW9yIHJlamVjdGVkIHByb21pc2VzIGFyZVxuICogaWdub3JlZC4gIFJlamVjdHMgb25seSBpZiBhbGwgcHJvbWlzZXMgYXJlIHJlamVjdGVkLlxuICogQHBhcmFtIHtBcnJheSp9IGFuIGFycmF5IGNvbnRhaW5pbmcgdmFsdWVzIG9yIHByb21pc2VzIGZvciB2YWx1ZXNcbiAqIEByZXR1cm5zIGEgcHJvbWlzZSBmdWxmaWxsZWQgd2l0aCB0aGUgdmFsdWUgb2YgdGhlIGZpcnN0IHJlc29sdmVkIHByb21pc2UsXG4gKiBvciBhIHJlamVjdGVkIHByb21pc2UgaWYgYWxsIHByb21pc2VzIGFyZSByZWplY3RlZC5cbiAqL1xuUS5hbnkgPSBhbnk7XG5cbmZ1bmN0aW9uIGFueShwcm9taXNlcykge1xuICAgIGlmIChwcm9taXNlcy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgcmV0dXJuIFEucmVzb2x2ZSgpO1xuICAgIH1cblxuICAgIHZhciBkZWZlcnJlZCA9IFEuZGVmZXIoKTtcbiAgICB2YXIgcGVuZGluZ0NvdW50ID0gMDtcbiAgICBhcnJheV9yZWR1Y2UocHJvbWlzZXMsIGZ1bmN0aW9uIChwcmV2LCBjdXJyZW50LCBpbmRleCkge1xuICAgICAgICB2YXIgcHJvbWlzZSA9IHByb21pc2VzW2luZGV4XTtcblxuICAgICAgICBwZW5kaW5nQ291bnQrKztcblxuICAgICAgICB3aGVuKHByb21pc2UsIG9uRnVsZmlsbGVkLCBvblJlamVjdGVkLCBvblByb2dyZXNzKTtcbiAgICAgICAgZnVuY3Rpb24gb25GdWxmaWxsZWQocmVzdWx0KSB7XG4gICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKHJlc3VsdCk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gb25SZWplY3RlZCgpIHtcbiAgICAgICAgICAgIHBlbmRpbmdDb3VudC0tO1xuICAgICAgICAgICAgaWYgKHBlbmRpbmdDb3VudCA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlamVjdChuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgIFwiQ2FuJ3QgZ2V0IGZ1bGZpbGxtZW50IHZhbHVlIGZyb20gYW55IHByb21pc2UsIGFsbCBcIiArXG4gICAgICAgICAgICAgICAgICAgIFwicHJvbWlzZXMgd2VyZSByZWplY3RlZC5cIlxuICAgICAgICAgICAgICAgICkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIG9uUHJvZ3Jlc3MocHJvZ3Jlc3MpIHtcbiAgICAgICAgICAgIGRlZmVycmVkLm5vdGlmeSh7XG4gICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxuICAgICAgICAgICAgICAgIHZhbHVlOiBwcm9ncmVzc1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9LCB1bmRlZmluZWQ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biAgICB9XG59O1xuXG5RLm5vQ29uZmxpY3QgPSBmdW5jdGlvbigpIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoXCJRLm5vQ29uZmxpY3Qgb25seSB3b3JrcyB3aGVuIFEgaXMgdXNlZCBhcyBhIGdsb2JhbFwiKTtcbn07XG5cbi8vIEFsbCBjb2RlIGJlZm9yZSB0aGlzIHBvaW50IHdpbGwgYmUgZmlsdGVyZWQgZnJvbSBzdGFjayB0cmFjZXMuXG52YXIgcUVuZGluZ0xpbmUgPSBjYXB0dXJlTGluZSgpO1xuXG5yZXR1cm4gUTtcblxufSk7XG4iXX0=
+},{"_process":13}],162:[function(require,module,exports){
+/**
+ * Module dependencies.
+ */
+
+var Emitter = require('emitter');
+var reduce = require('reduce');
+
+/**
+ * Root reference for iframes.
+ */
+
+var root;
+if (typeof window !== 'undefined') { // Browser window
+ root = window;
+} else if (typeof self !== 'undefined') { // Web Worker
+ root = self;
+} else { // Other environments
+ root = this;
+}
+
+/**
+ * Noop.
+ */
+
+function noop(){};
+
+/**
+ * Check if `obj` is a host object,
+ * we don't want to serialize these :)
+ *
+ * TODO: future proof, move to compoent land
+ *
+ * @param {Object} obj
+ * @return {Boolean}
+ * @api private
+ */
+
+function isHost(obj) {
+ var str = {}.toString.call(obj);
+
+ switch (str) {
+ case '[object File]':
+ case '[object Blob]':
+ case '[object FormData]':
+ return true;
+ default:
+ return false;
+ }
+}
+
+/**
+ * Determine XHR.
+ */
+
+request.getXHR = function () {
+ if (root.XMLHttpRequest
+ && (!root.location || 'file:' != root.location.protocol
+ || !root.ActiveXObject)) {
+ return new XMLHttpRequest;
+ } else {
+ try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {}
+ try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {}
+ try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {}
+ try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {}
+ }
+ return false;
+};
+
+/**
+ * Removes leading and trailing whitespace, added to support IE.
+ *
+ * @param {String} s
+ * @return {String}
+ * @api private
+ */
+
+var trim = ''.trim
+ ? function(s) { return s.trim(); }
+ : function(s) { return s.replace(/(^\s*|\s*$)/g, ''); };
+
+/**
+ * Check if `obj` is an object.
+ *
+ * @param {Object} obj
+ * @return {Boolean}
+ * @api private
+ */
+
+function isObject(obj) {
+ return obj === Object(obj);
+}
+
+/**
+ * Serialize the given `obj`.
+ *
+ * @param {Object} obj
+ * @return {String}
+ * @api private
+ */
+
+function serialize(obj) {
+ if (!isObject(obj)) return obj;
+ var pairs = [];
+ for (var key in obj) {
+ if (null != obj[key]) {
+ pushEncodedKeyValuePair(pairs, key, obj[key]);
+ }
+ }
+ return pairs.join('&');
+}
+
+/**
+ * Helps 'serialize' with serializing arrays.
+ * Mutates the pairs array.
+ *
+ * @param {Array} pairs
+ * @param {String} key
+ * @param {Mixed} val
+ */
+
+function pushEncodedKeyValuePair(pairs, key, val) {
+ if (Array.isArray(val)) {
+ return val.forEach(function(v) {
+ pushEncodedKeyValuePair(pairs, key, v);
+ });
+ }
+ pairs.push(encodeURIComponent(key)
+ + '=' + encodeURIComponent(val));
+}
+
+/**
+ * Expose serialization method.
+ */
+
+ request.serializeObject = serialize;
+
+ /**
+ * Parse the given x-www-form-urlencoded `str`.
+ *
+ * @param {String} str
+ * @return {Object}
+ * @api private
+ */
+
+function parseString(str) {
+ var obj = {};
+ var pairs = str.split('&');
+ var parts;
+ var pair;
+
+ for (var i = 0, len = pairs.length; i < len; ++i) {
+ pair = pairs[i];
+ parts = pair.split('=');
+ obj[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]);
+ }
+
+ return obj;
+}
+
+/**
+ * Expose parser.
+ */
+
+request.parseString = parseString;
+
+/**
+ * Default MIME type map.
+ *
+ * superagent.types.xml = 'application/xml';
+ *
+ */
+
+request.types = {
+ html: 'text/html',
+ json: 'application/json',
+ xml: 'application/xml',
+ urlencoded: 'application/x-www-form-urlencoded',
+ 'form': 'application/x-www-form-urlencoded',
+ 'form-data': 'application/x-www-form-urlencoded'
+};
+
+/**
+ * Default serialization map.
+ *
+ * superagent.serialize['application/xml'] = function(obj){
+ * return 'generated xml here';
+ * };
+ *
+ */
+
+ request.serialize = {
+ 'application/x-www-form-urlencoded': serialize,
+ 'application/json': JSON.stringify
+ };
+
+ /**
+ * Default parsers.
+ *
+ * superagent.parse['application/xml'] = function(str){
+ * return { object parsed from str };
+ * };
+ *
+ */
+
+request.parse = {
+ 'application/x-www-form-urlencoded': parseString,
+ 'application/json': JSON.parse
+};
+
+/**
+ * Parse the given header `str` into
+ * an object containing the mapped fields.
+ *
+ * @param {String} str
+ * @return {Object}
+ * @api private
+ */
+
+function parseHeader(str) {
+ var lines = str.split(/\r?\n/);
+ var fields = {};
+ var index;
+ var line;
+ var field;
+ var val;
+
+ lines.pop(); // trailing CRLF
+
+ for (var i = 0, len = lines.length; i < len; ++i) {
+ line = lines[i];
+ index = line.indexOf(':');
+ field = line.slice(0, index).toLowerCase();
+ val = trim(line.slice(index + 1));
+ fields[field] = val;
+ }
+
+ return fields;
+}
+
+/**
+ * Return the mime type for the given `str`.
+ *
+ * @param {String} str
+ * @return {String}
+ * @api private
+ */
+
+function type(str){
+ return str.split(/ *; */).shift();
+};
+
+/**
+ * Return header field parameters.
+ *
+ * @param {String} str
+ * @return {Object}
+ * @api private
+ */
+
+function params(str){
+ return reduce(str.split(/ *; */), function(obj, str){
+ var parts = str.split(/ *= */)
+ , key = parts.shift()
+ , val = parts.shift();
+
+ if (key && val) obj[key] = val;
+ return obj;
+ }, {});
+};
+
+/**
+ * Initialize a new `Response` with the given `xhr`.
+ *
+ * - set flags (.ok, .error, etc)
+ * - parse header
+ *
+ * Examples:
+ *
+ * Aliasing `superagent` as `request` is nice:
+ *
+ * request = superagent;
+ *
+ * We can use the promise-like API, or pass callbacks:
+ *
+ * request.get('/').end(function(res){});
+ * request.get('/', function(res){});
+ *
+ * Sending data can be chained:
+ *
+ * request
+ * .post('/user')
+ * .send({ name: 'tj' })
+ * .end(function(res){});
+ *
+ * Or passed to `.send()`:
+ *
+ * request
+ * .post('/user')
+ * .send({ name: 'tj' }, function(res){});
+ *
+ * Or passed to `.post()`:
+ *
+ * request
+ * .post('/user', { name: 'tj' })
+ * .end(function(res){});
+ *
+ * Or further reduced to a single call for simple cases:
+ *
+ * request
+ * .post('/user', { name: 'tj' }, function(res){});
+ *
+ * @param {XMLHTTPRequest} xhr
+ * @param {Object} options
+ * @api private
+ */
+
+function Response(req, options) {
+ options = options || {};
+ this.req = req;
+ this.xhr = this.req.xhr;
+ // responseText is accessible only if responseType is '' or 'text' and on older browsers
+ this.text = ((this.req.method !='HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text')) || typeof this.xhr.responseType === 'undefined')
+ ? this.xhr.responseText
+ : null;
+ this.statusText = this.req.xhr.statusText;
+ this.setStatusProperties(this.xhr.status);
+ this.header = this.headers = parseHeader(this.xhr.getAllResponseHeaders());
+ // getAllResponseHeaders sometimes falsely returns "" for CORS requests, but
+ // getResponseHeader still works. so we get content-type even if getting
+ // other headers fails.
+ this.header['content-type'] = this.xhr.getResponseHeader('content-type');
+ this.setHeaderProperties(this.header);
+ this.body = this.req.method != 'HEAD'
+ ? this.parseBody(this.text ? this.text : this.xhr.response)
+ : null;
+}
+
+/**
+ * Get case-insensitive `field` value.
+ *
+ * @param {String} field
+ * @return {String}
+ * @api public
+ */
+
+Response.prototype.get = function(field){
+ return this.header[field.toLowerCase()];
+};
+
+/**
+ * Set header related properties:
+ *
+ * - `.type` the content type without params
+ *
+ * A response of "Content-Type: text/plain; charset=utf-8"
+ * will provide you with a `.type` of "text/plain".
+ *
+ * @param {Object} header
+ * @api private
+ */
+
+Response.prototype.setHeaderProperties = function(header){
+ // content-type
+ var ct = this.header['content-type'] || '';
+ this.type = type(ct);
+
+ // params
+ var obj = params(ct);
+ for (var key in obj) this[key] = obj[key];
+};
+
+/**
+ * Parse the given body `str`.
+ *
+ * Used for auto-parsing of bodies. Parsers
+ * are defined on the `superagent.parse` object.
+ *
+ * @param {String} str
+ * @return {Mixed}
+ * @api private
+ */
+
+Response.prototype.parseBody = function(str){
+ var parse = request.parse[this.type];
+ return parse && str && (str.length || str instanceof Object)
+ ? parse(str)
+ : null;
+};
+
+/**
+ * Set flags such as `.ok` based on `status`.
+ *
+ * For example a 2xx response will give you a `.ok` of __true__
+ * whereas 5xx will be __false__ and `.error` will be __true__. The
+ * `.clientError` and `.serverError` are also available to be more
+ * specific, and `.statusType` is the class of error ranging from 1..5
+ * sometimes useful for mapping respond colors etc.
+ *
+ * "sugar" properties are also defined for common cases. Currently providing:
+ *
+ * - .noContent
+ * - .badRequest
+ * - .unauthorized
+ * - .notAcceptable
+ * - .notFound
+ *
+ * @param {Number} status
+ * @api private
+ */
+
+Response.prototype.setStatusProperties = function(status){
+ // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request
+ if (status === 1223) {
+ status = 204;
+ }
+
+ var type = status / 100 | 0;
+
+ // status / class
+ this.status = this.statusCode = status;
+ this.statusType = type;
+
+ // basics
+ this.info = 1 == type;
+ this.ok = 2 == type;
+ this.clientError = 4 == type;
+ this.serverError = 5 == type;
+ this.error = (4 == type || 5 == type)
+ ? this.toError()
+ : false;
+
+ // sugar
+ this.accepted = 202 == status;
+ this.noContent = 204 == status;
+ this.badRequest = 400 == status;
+ this.unauthorized = 401 == status;
+ this.notAcceptable = 406 == status;
+ this.notFound = 404 == status;
+ this.forbidden = 403 == status;
+};
+
+/**
+ * Return an `Error` representative of this response.
+ *
+ * @return {Error}
+ * @api public
+ */
+
+Response.prototype.toError = function(){
+ var req = this.req;
+ var method = req.method;
+ var url = req.url;
+
+ var msg = 'cannot ' + method + ' ' + url + ' (' + this.status + ')';
+ var err = new Error(msg);
+ err.status = this.status;
+ err.method = method;
+ err.url = url;
+
+ return err;
+};
+
+/**
+ * Expose `Response`.
+ */
+
+request.Response = Response;
+
+/**
+ * Initialize a new `Request` with the given `method` and `url`.
+ *
+ * @param {String} method
+ * @param {String} url
+ * @api public
+ */
+
+function Request(method, url) {
+ var self = this;
+ Emitter.call(this);
+ this._query = this._query || [];
+ this.method = method;
+ this.url = url;
+ this.header = {};
+ this._header = {};
+ this.on('end', function(){
+ var err = null;
+ var res = null;
+
+ try {
+ res = new Response(self);
+ } catch(e) {
+ err = new Error('Parser is unable to parse the response');
+ err.parse = true;
+ err.original = e;
+ return self.callback(err);
+ }
+
+ self.emit('response', res);
+
+ if (err) {
+ return self.callback(err, res);
+ }
+
+ if (res.status >= 200 && res.status < 300) {
+ return self.callback(err, res);
+ }
+
+ var new_err = new Error(res.statusText || 'Unsuccessful HTTP response');
+ new_err.original = err;
+ new_err.response = res;
+ new_err.status = res.status;
+
+ self.callback(new_err, res);
+ });
+}
+
+/**
+ * Mixin `Emitter`.
+ */
+
+Emitter(Request.prototype);
+
+/**
+ * Allow for extension
+ */
+
+Request.prototype.use = function(fn) {
+ fn(this);
+ return this;
+}
+
+/**
+ * Set timeout to `ms`.
+ *
+ * @param {Number} ms
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.timeout = function(ms){
+ this._timeout = ms;
+ return this;
+};
+
+/**
+ * Clear previous timeout.
+ *
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.clearTimeout = function(){
+ this._timeout = 0;
+ clearTimeout(this._timer);
+ return this;
+};
+
+/**
+ * Abort the request, and clear potential timeout.
+ *
+ * @return {Request}
+ * @api public
+ */
+
+Request.prototype.abort = function(){
+ if (this.aborted) return;
+ this.aborted = true;
+ this.xhr.abort();
+ this.clearTimeout();
+ this.emit('abort');
+ return this;
+};
+
+/**
+ * Set header `field` to `val`, or multiple fields with one object.
+ *
+ * Examples:
+ *
+ * req.get('/')
+ * .set('Accept', 'application/json')
+ * .set('X-API-Key', 'foobar')
+ * .end(callback);
+ *
+ * req.get('/')
+ * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' })
+ * .end(callback);
+ *
+ * @param {String|Object} field
+ * @param {String} val
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.set = function(field, val){
+ if (isObject(field)) {
+ for (var key in field) {
+ this.set(key, field[key]);
+ }
+ return this;
+ }
+ this._header[field.toLowerCase()] = val;
+ this.header[field] = val;
+ return this;
+};
+
+/**
+ * Remove header `field`.
+ *
+ * Example:
+ *
+ * req.get('/')
+ * .unset('User-Agent')
+ * .end(callback);
+ *
+ * @param {String} field
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.unset = function(field){
+ delete this._header[field.toLowerCase()];
+ delete this.header[field];
+ return this;
+};
+
+/**
+ * Get case-insensitive header `field` value.
+ *
+ * @param {String} field
+ * @return {String}
+ * @api private
+ */
+
+Request.prototype.getHeader = function(field){
+ return this._header[field.toLowerCase()];
+};
+
+/**
+ * Set Content-Type to `type`, mapping values from `request.types`.
+ *
+ * Examples:
+ *
+ * superagent.types.xml = 'application/xml';
+ *
+ * request.post('/')
+ * .type('xml')
+ * .send(xmlstring)
+ * .end(callback);
+ *
+ * request.post('/')
+ * .type('application/xml')
+ * .send(xmlstring)
+ * .end(callback);
+ *
+ * @param {String} type
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.type = function(type){
+ this.set('Content-Type', request.types[type] || type);
+ return this;
+};
+
+/**
+ * Force given parser
+ *
+ * Sets the body parser no matter type.
+ *
+ * @param {Function}
+ * @api public
+ */
+
+Request.prototype.parse = function(fn){
+ this._parser = fn;
+ return this;
+};
+
+/**
+ * Set Accept to `type`, mapping values from `request.types`.
+ *
+ * Examples:
+ *
+ * superagent.types.json = 'application/json';
+ *
+ * request.get('/agent')
+ * .accept('json')
+ * .end(callback);
+ *
+ * request.get('/agent')
+ * .accept('application/json')
+ * .end(callback);
+ *
+ * @param {String} accept
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.accept = function(type){
+ this.set('Accept', request.types[type] || type);
+ return this;
+};
+
+/**
+ * Set Authorization field value with `user` and `pass`.
+ *
+ * @param {String} user
+ * @param {String} pass
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.auth = function(user, pass){
+ var str = btoa(user + ':' + pass);
+ this.set('Authorization', 'Basic ' + str);
+ return this;
+};
+
+/**
+* Add query-string `val`.
+*
+* Examples:
+*
+* request.get('/shoes')
+* .query('size=10')
+* .query({ color: 'blue' })
+*
+* @param {Object|String} val
+* @return {Request} for chaining
+* @api public
+*/
+
+Request.prototype.query = function(val){
+ if ('string' != typeof val) val = serialize(val);
+ if (val) this._query.push(val);
+ return this;
+};
+
+/**
+ * Write the field `name` and `val` for "multipart/form-data"
+ * request bodies.
+ *
+ * ``` js
+ * request.post('/upload')
+ * .field('foo', 'bar')
+ * .end(callback);
+ * ```
+ *
+ * @param {String} name
+ * @param {String|Blob|File} val
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.field = function(name, val){
+ if (!this._formData) this._formData = new root.FormData();
+ this._formData.append(name, val);
+ return this;
+};
+
+/**
+ * Queue the given `file` as an attachment to the specified `field`,
+ * with optional `filename`.
+ *
+ * ``` js
+ * request.post('/upload')
+ * .attach(new Blob(['<a id="a"><b id="b">hey!</b></a>'], { type: "text/html"}))
+ * .end(callback);
+ * ```
+ *
+ * @param {String} field
+ * @param {Blob|File} file
+ * @param {String} filename
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.attach = function(field, file, filename){
+ if (!this._formData) this._formData = new root.FormData();
+ this._formData.append(field, file, filename);
+ return this;
+};
+
+/**
+ * Send `data`, defaulting the `.type()` to "json" when
+ * an object is given.
+ *
+ * Examples:
+ *
+ * // querystring
+ * request.get('/search')
+ * .end(callback)
+ *
+ * // multiple data "writes"
+ * request.get('/search')
+ * .send({ search: 'query' })
+ * .send({ range: '1..5' })
+ * .send({ order: 'desc' })
+ * .end(callback)
+ *
+ * // manual json
+ * request.post('/user')
+ * .type('json')
+ * .send('{"name":"tj"}')
+ * .end(callback)
+ *
+ * // auto json
+ * request.post('/user')
+ * .send({ name: 'tj' })
+ * .end(callback)
+ *
+ * // manual x-www-form-urlencoded
+ * request.post('/user')
+ * .type('form')
+ * .send('name=tj')
+ * .end(callback)
+ *
+ * // auto x-www-form-urlencoded
+ * request.post('/user')
+ * .type('form')
+ * .send({ name: 'tj' })
+ * .end(callback)
+ *
+ * // defaults to x-www-form-urlencoded
+ * request.post('/user')
+ * .send('name=tobi')
+ * .send('species=ferret')
+ * .end(callback)
+ *
+ * @param {String|Object} data
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.send = function(data){
+ var obj = isObject(data);
+ var type = this.getHeader('Content-Type');
+
+ // merge
+ if (obj && isObject(this._data)) {
+ for (var key in data) {
+ this._data[key] = data[key];
+ }
+ } else if ('string' == typeof data) {
+ if (!type) this.type('form');
+ type = this.getHeader('Content-Type');
+ if ('application/x-www-form-urlencoded' == type) {
+ this._data = this._data
+ ? this._data + '&' + data
+ : data;
+ } else {
+ this._data = (this._data || '') + data;
+ }
+ } else {
+ this._data = data;
+ }
+
+ if (!obj || isHost(data)) return this;
+ if (!type) this.type('json');
+ return this;
+};
+
+/**
+ * Invoke the callback with `err` and `res`
+ * and handle arity check.
+ *
+ * @param {Error} err
+ * @param {Response} res
+ * @api private
+ */
+
+Request.prototype.callback = function(err, res){
+ var fn = this._callback;
+ this.clearTimeout();
+ fn(err, res);
+};
+
+/**
+ * Invoke callback with x-domain error.
+ *
+ * @api private
+ */
+
+Request.prototype.crossDomainError = function(){
+ var err = new Error('Origin is not allowed by Access-Control-Allow-Origin');
+ err.crossDomain = true;
+ this.callback(err);
+};
+
+/**
+ * Invoke callback with timeout error.
+ *
+ * @api private
+ */
+
+Request.prototype.timeoutError = function(){
+ var timeout = this._timeout;
+ var err = new Error('timeout of ' + timeout + 'ms exceeded');
+ err.timeout = timeout;
+ this.callback(err);
+};
+
+/**
+ * Enable transmission of cookies with x-domain requests.
+ *
+ * Note that for this to work the origin must not be
+ * using "Access-Control-Allow-Origin" with a wildcard,
+ * and also must set "Access-Control-Allow-Credentials"
+ * to "true".
+ *
+ * @api public
+ */
+
+Request.prototype.withCredentials = function(){
+ this._withCredentials = true;
+ return this;
+};
+
+/**
+ * Initiate request, invoking callback `fn(res)`
+ * with an instanceof `Response`.
+ *
+ * @param {Function} fn
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.end = function(fn){
+ var self = this;
+ var xhr = this.xhr = request.getXHR();
+ var query = this._query.join('&');
+ var timeout = this._timeout;
+ var data = this._formData || this._data;
+
+ // store callback
+ this._callback = fn || noop;
+
+ // state change
+ xhr.onreadystatechange = function(){
+ if (4 != xhr.readyState) return;
+
+ // In IE9, reads to any property (e.g. status) off of an aborted XHR will
+ // result in the error "Could not complete the operation due to error c00c023f"
+ var status;
+ try { status = xhr.status } catch(e) { status = 0; }
+
+ if (0 == status) {
+ if (self.timedout) return self.timeoutError();
+ if (self.aborted) return;
+ return self.crossDomainError();
+ }
+ self.emit('end');
+ };
+
+ // progress
+ var handleProgress = function(e){
+ if (e.total > 0) {
+ e.percent = e.loaded / e.total * 100;
+ }
+ self.emit('progress', e);
+ };
+ if (this.hasListeners('progress')) {
+ xhr.onprogress = handleProgress;
+ }
+ try {
+ if (xhr.upload && this.hasListeners('progress')) {
+ xhr.upload.onprogress = handleProgress;
+ }
+ } catch(e) {
+ // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist.
+ // Reported here:
+ // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context
+ }
+
+ // timeout
+ if (timeout && !this._timer) {
+ this._timer = setTimeout(function(){
+ self.timedout = true;
+ self.abort();
+ }, timeout);
+ }
+
+ // querystring
+ if (query) {
+ query = request.serializeObject(query);
+ this.url += ~this.url.indexOf('?')
+ ? '&' + query
+ : '?' + query;
+ }
+
+ // initiate request
+ xhr.open(this.method, this.url, true);
+
+ // CORS
+ if (this._withCredentials) xhr.withCredentials = true;
+
+ // body
+ if ('GET' != this.method && 'HEAD' != this.method && 'string' != typeof data && !isHost(data)) {
+ // serialize stuff
+ var contentType = this.getHeader('Content-Type');
+ var serialize = this._parser || request.serialize[contentType ? contentType.split(';')[0] : ''];
+ if (serialize) data = serialize(data);
+ }
+
+ // set header fields
+ for (var field in this.header) {
+ if (null == this.header[field]) continue;
+ xhr.setRequestHeader(field, this.header[field]);
+ }
+
+ // send stuff
+ this.emit('request', this);
+
+ // IE11 xhr.send(undefined) sends 'undefined' string as POST payload (instead of nothing)
+ // We need null here if data is undefined
+ xhr.send(typeof data !== 'undefined' ? data : null);
+ return this;
+};
+
+/**
+ * Faux promise support
+ *
+ * @param {Function} fulfill
+ * @param {Function} reject
+ * @return {Request}
+ */
+
+Request.prototype.then = function (fulfill, reject) {
+ return this.end(function(err, res) {
+ err ? reject(err) : fulfill(res);
+ });
+}
+
+/**
+ * Expose `Request`.
+ */
+
+request.Request = Request;
+
+/**
+ * Issue a request:
+ *
+ * Examples:
+ *
+ * request('GET', '/users').end(callback)
+ * request('/users').end(callback)
+ * request('/users', callback)
+ *
+ * @param {String} method
+ * @param {String|Function} url or callback
+ * @return {Request}
+ * @api public
+ */
+
+function request(method, url) {
+ // callback
+ if ('function' == typeof url) {
+ return new Request('GET', method).end(url);
+ }
+
+ // url first
+ if (1 == arguments.length) {
+ return new Request('GET', method);
+ }
+
+ return new Request(method, url);
+}
+
+/**
+ * GET `url` with optional callback `fn(res)`.
+ *
+ * @param {String} url
+ * @param {Mixed|Function} data or fn
+ * @param {Function} fn
+ * @return {Request}
+ * @api public
+ */
+
+request.get = function(url, data, fn){
+ var req = request('GET', url);
+ if ('function' == typeof data) fn = data, data = null;
+ if (data) req.query(data);
+ if (fn) req.end(fn);
+ return req;
+};
+
+/**
+ * HEAD `url` with optional callback `fn(res)`.
+ *
+ * @param {String} url
+ * @param {Mixed|Function} data or fn
+ * @param {Function} fn
+ * @return {Request}
+ * @api public
+ */
+
+request.head = function(url, data, fn){
+ var req = request('HEAD', url);
+ if ('function' == typeof data) fn = data, data = null;
+ if (data) req.send(data);
+ if (fn) req.end(fn);
+ return req;
+};
+
+/**
+ * DELETE `url` with optional callback `fn(res)`.
+ *
+ * @param {String} url
+ * @param {Function} fn
+ * @return {Request}
+ * @api public
+ */
+
+function del(url, fn){
+ var req = request('DELETE', url);
+ if (fn) req.end(fn);
+ return req;
+};
+
+request.del = del;
+request.delete = del;
+
+/**
+ * PATCH `url` with optional `data` and callback `fn(res)`.
+ *
+ * @param {String} url
+ * @param {Mixed} data
+ * @param {Function} fn
+ * @return {Request}
+ * @api public
+ */
+
+request.patch = function(url, data, fn){
+ var req = request('PATCH', url);
+ if ('function' == typeof data) fn = data, data = null;
+ if (data) req.send(data);
+ if (fn) req.end(fn);
+ return req;
+};
+
+/**
+ * POST `url` with optional `data` and callback `fn(res)`.
+ *
+ * @param {String} url
+ * @param {Mixed} data
+ * @param {Function} fn
+ * @return {Request}
+ * @api public
+ */
+
+request.post = function(url, data, fn){
+ var req = request('POST', url);
+ if ('function' == typeof data) fn = data, data = null;
+ if (data) req.send(data);
+ if (fn) req.end(fn);
+ return req;
+};
+
+/**
+ * PUT `url` with optional `data` and callback `fn(res)`.
+ *
+ * @param {String} url
+ * @param {Mixed|Function} data or fn
+ * @param {Function} fn
+ * @return {Request}
+ * @api public
+ */
+
+request.put = function(url, data, fn){
+ var req = request('PUT', url);
+ if ('function' == typeof data) fn = data, data = null;
+ if (data) req.send(data);
+ if (fn) req.end(fn);
+ return req;
+};
+
+/**
+ * Expose `request`.
+ */
+
+module.exports = request;
+
+},{"emitter":163,"reduce":164}],163:[function(require,module,exports){
+
+/**
+ * Expose `Emitter`.
+ */
+
+module.exports = Emitter;
+
+/**
+ * Initialize a new `Emitter`.
+ *
+ * @api public
+ */
+
+function Emitter(obj) {
+ if (obj) return mixin(obj);
+};
+
+/**
+ * Mixin the emitter properties.
+ *
+ * @param {Object} obj
+ * @return {Object}
+ * @api private
+ */
+
+function mixin(obj) {
+ for (var key in Emitter.prototype) {
+ obj[key] = Emitter.prototype[key];
+ }
+ return obj;
+}
+
+/**
+ * Listen on the given `event` with `fn`.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+Emitter.prototype.on =
+Emitter.prototype.addEventListener = function(event, fn){
+ this._callbacks = this._callbacks || {};
+ (this._callbacks[event] = this._callbacks[event] || [])
+ .push(fn);
+ return this;
+};
+
+/**
+ * Adds an `event` listener that will be invoked a single
+ * time then automatically removed.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+Emitter.prototype.once = function(event, fn){
+ var self = this;
+ this._callbacks = this._callbacks || {};
+
+ function on() {
+ self.off(event, on);
+ fn.apply(this, arguments);
+ }
+
+ on.fn = fn;
+ this.on(event, on);
+ return this;
+};
+
+/**
+ * Remove the given callback for `event` or all
+ * registered callbacks.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+Emitter.prototype.off =
+Emitter.prototype.removeListener =
+Emitter.prototype.removeAllListeners =
+Emitter.prototype.removeEventListener = function(event, fn){
+ this._callbacks = this._callbacks || {};
+
+ // all
+ if (0 == arguments.length) {
+ this._callbacks = {};
+ return this;
+ }
+
+ // specific event
+ var callbacks = this._callbacks[event];
+ if (!callbacks) return this;
+
+ // remove all handlers
+ if (1 == arguments.length) {
+ delete this._callbacks[event];
+ return this;
+ }
+
+ // remove specific handler
+ var cb;
+ for (var i = 0; i < callbacks.length; i++) {
+ cb = callbacks[i];
+ if (cb === fn || cb.fn === fn) {
+ callbacks.splice(i, 1);
+ break;
+ }
+ }
+ return this;
+};
+
+/**
+ * Emit `event` with the given args.
+ *
+ * @param {String} event
+ * @param {Mixed} ...
+ * @return {Emitter}
+ */
+
+Emitter.prototype.emit = function(event){
+ this._callbacks = this._callbacks || {};
+ var args = [].slice.call(arguments, 1)
+ , callbacks = this._callbacks[event];
+
+ if (callbacks) {
+ callbacks = callbacks.slice(0);
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
+ callbacks[i].apply(this, args);
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Return array of callbacks for `event`.
+ *
+ * @param {String} event
+ * @return {Array}
+ * @api public
+ */
+
+Emitter.prototype.listeners = function(event){
+ this._callbacks = this._callbacks || {};
+ return this._callbacks[event] || [];
+};
+
+/**
+ * Check if this emitter has `event` handlers.
+ *
+ * @param {String} event
+ * @return {Boolean}
+ * @api public
+ */
+
+Emitter.prototype.hasListeners = function(event){
+ return !! this.listeners(event).length;
+};
+
+},{}],164:[function(require,module,exports){
+
+/**
+ * Reduce `arr` with `fn`.
+ *
+ * @param {Array} arr
+ * @param {Function} fn
+ * @param {Mixed} initial
+ *
+ * TODO: combatible error handling?
+ */
+
+module.exports = function(arr, fn, initial){
+ var idx = 0;
+ var len = arr.length;
+ var curr = arguments.length == 3
+ ? initial
+ : arr[idx++];
+
+ while (idx < len) {
+ curr = fn.call(null, curr, arr[idx], ++idx, arr);
+ }
+
+ return curr;
+};
+},{}]},{},[1])(1)
+});
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJpbmRleC5qcyIsImxpYi9hdXRoLmpzIiwibGliL2NsaWVudC5qcyIsImxpYi9oZWxwZXJzLmpzIiwibGliL2h0dHAuanMiLCJsaWIvcmVzb2x2ZXIuanMiLCJsaWIvc2NoZW1hLW1hcmt1cC5qcyIsImxpYi9zcGVjLWNvbnZlcnRlci5qcyIsImxpYi90eXBlcy9tb2RlbC5qcyIsImxpYi90eXBlcy9vcGVyYXRpb24uanMiLCJsaWIvdHlwZXMvb3BlcmF0aW9uR3JvdXAuanMiLCJub2RlX21vZHVsZXMvYnJvd3NlcmlmeS9ub2RlX21vZHVsZXMvYnJvd3Nlci1yZXNvbHZlL2VtcHR5LmpzIiwibm9kZV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cGUuYXBwbHkgPSBmdW5jdGlvbiAob2JqKSB7XG4gIGlmICh0aGlzLnR5cGUgPT09ICdxdWVyeScpIHtcbiAgICAvLyBzZWUgaWYgYWxyZWFkeSBhcHBsaWVkLiAgSWYgc28sIGRvbid0IGRvIGl0IGFnYWluXG5cbiAgICB2YXIgcXA7XG4gICAgaWYgKG9iai51cmwuaW5kZXhPZignPycpID4gMCkge1xuICAgICAgcXAgPSBvYmoudXJsLnN1YnN0cmluZyhvYmoudXJsLmluZGV4T2YoJz8nKSArIDEpO1xuICAgICAgdmFyIHBhcnRzID0gcXAuc3BsaXQoJyYnKTtcbiAgICAgIGlmKHBhcnRzICYmIHBhcnRzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgZm9yKHZhciBpID0gMDsgaSA8IHBhcnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgdmFyIGt2ID0gcGFydHNbaV0uc3BsaXQoJz0nKTtcbiAgICAgICAgICBpZihrdiAmJiBrdi5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBpZiAoa3ZbMF0gPT09IHRoaXMubmFtZSkge1xuICAgICAgICAgICAgICAvLyBza2lwIGl0XG4gICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAob2JqLnVybC5pbmRleE9mKCc/JykgPiAwKSB7XG4gICAgICBvYmoudXJsID0gb2JqLnVybCArICcmJyArIHRoaXMubmFtZSArICc9JyArIHRoaXMudmFsdWU7XG4gICAgfSBlbHNlIHtcbiAgICAgIG9iai51cmwgPSBvYmoudXJsICsgJz8nICsgdGhpcy5uYW1lICsgJz0nICsgdGhpcy52YWx1ZTtcbiAgICB9XG5cbiAgICByZXR1cm4gdHJ1ZTtcbiAgfSBlbHNlIGlmICh0aGlzLnR5cGUgPT09ICdoZWFkZXInKSB7XG4gICAgaWYodHlwZW9mIG9iai5oZWFkZ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yYXRpb25JZF0uaGVscCA9IF8uYmluZChvcGVyYXRpb25PYmplY3QuaGVscCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wZXJhdGlvbk9iamVjdCk7XG4gICAgICAgIHNlbGYuYXBpc1thcGlQcm9wZXJ0eV1bb3BlcmF0aW9uSWRdLmFzQ3VybCA9IG9wZXJhdGlvbkdyb3VwW29wZXJhdGlvbklkXS5hc0N1cmwgPSBfLmJpbmQob3BlcmF0aW9uT2JqZWN0LmFzQ3VybCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25PYmplY3QpO1xuXG4gICAgICAgIG9wZXJhdGlvbkdyb3VwLmFwaXNbb3BlcmF0aW9uSWRdID0gb3BlcmF0aW9uR3JvdXAub3BlcmF0aW9uc1tvcGVyYXRpb25JZF0gPSBvcGVyYXRpb25PYmplY3Q7XG5cbiAgICAgICAgLy8gbGVnYWN5IFVJIGZlYXR1cmVcbiAgICAgICAgdmFyIGFwaSA9IF8uZmluZChzZWxmLmFwaXNBcnJheSwgZnVuY3Rpb24gKGFwaSkge1xuICAgICAgICAgIHJldHVybiBhcGkudGFnID09PSB0YWc7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGlmIChhcGkpIHtcbiAgICAgICAgICBhcGkub3BlcmF0aW9uc0FycmF5LnB1c2gob3BlcmF0aW9uT2JqZWN0KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfSk7XG4gIH0pO1xuXG4gIHRoaXMuaXNCdWlsdCA9IHRydWU7XG5cbiAgaWYgKHRoaXMudXNlUHJvbWlzZSkge1xuICAgIHRoaXMuaXNWYWxpZCA9IHRydWU7XG4gICAgdGhpcy5pc0J1aWx0ID0gdHJ1ZT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Jlcy5lcnJvcjtcbiAgICB9XG5cbiAgICBpZiAoZXJyICYmIG9iai5vbiAmJiBvYmoub24uZXJyb3IpIHtcbiAgICAgIHJlc3BvbnNlLmVyck9iaiA9IGVycjtcbiAgICAgIHJlc3BvbnNlLnN0YXR1cyA9IHJlcyA/IHJlcy5zdGF0dXMgOiA1MDA7XG4gICAgICByZXNwb25zZS5zdGF0dXNUZXh0ID0gcmVzID8gcmVzLnRleHQgOiBlcnIubWVzc2FnZTtcbiAgICAgIGlmKHJlcy5oZWFkZXJzICYmIHJlcy5oZWFkZXJzWydjb250ZW50LXR5cGUnXSkge1xuICAgICAgICBpZihyZXMuaGVhZGVyc1snY29udGVudC10eXBlJ10uaW5kZXhPZignYXBwbGljYXRpb24vanNvbicpID49IDApIHtcbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmVzcG9uc2Uub2JqID0gSlNPTi5wYXJzZShyZXNwb25zZS5zdGF0dXNUZXh0KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHJlc3BvbnNlLm9iaiA9IG51bGw7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBjYiA9IG9iai5vbi5lcnJvcjtcbiAgICB9IGVsc2UgaWYgKHJlcyAmJiBvYmoub24gJiYgb2JqLm9uLnJlc3BvbnNlKSB7XG4gICAgICB2YXIgcG9zc2libGVPYmo7XG5cbiAgICAgIC8vIEFscmVhZHkgcGFyc2VkIGJ5IGJ5IHN1cGVyYWdlbnQ/XG4gICAgICBpZihyZXMuYm9keSAmJiBPYmplY3Qua2V5cyhyZXMuYm9keSkubGVuZ3RoID4gMCkge1xuICAgICAgICBwb3NzaWJsZU9iaiA9IHJlcy5ib2R5O1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgcG9zc2libGVPYmogPSBqc3lhbWwuc2FmZUxvYWQocmVzLnRleHQpO1xuICAgICAgICAgIC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Rlci5zY2hlbWEuYWxsT2YpKSB7XG4gICAgICAgICAgICAgIC8vIG1vdmUgdG8gYSBkZWZpbml0aW9uXG4gICAgICAgICAgICAgIHZhciBtb2RlbE5hbWUgPSAnaW5saW5lX21vZGVsJztcbiAgICAgICAgICAgICAgdmFyIG5hbWUgPSBtb2RlbE5hbWU7XG4gICAgICAgICAgICAgIHZhciBkb25lID0gZmFsc2U7IHZhciBjb3VudGVyID0gMDtcbiAgICAgICAgICAgICAgd2hpbGUoIWRvbmUpIHtcbiAgICAgICAgICAgICAgICBpZih0eXBlb2Ygc3BlYy5kZWZpbml0aW9uc1tuYW1lXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgIGRvbmUgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5hbWUgPSBtb2RlbE5hbWUgKyAnXycgKyBjb3VudGVyO1xuICAgICAgICAgICAgICAgIGNvdW50ZXIgKys7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgc3BlYy5kZWZpbml0aW9uc1tuYW1lXSA9IHsgYWxsT2Y6IHBhcmFtZXRlci5zY2hlbWEuYWxsT2YgfTtcbiAgICAgICAgICAgICAgZGVsZXRlIHBhcmFtZXRlci5zY2hlbWEuYWxsT2Y7XG4gICAgICAgICAgICAgIHBhcmFtZXRlci5zY2hlbWEuJHJlZiA9ICcjL2RlZmluaXRpb25zLycgKyBuYW1lO1xuICAgICAgICAgICAgICB0aGlzLnByb2Nlc3NBbGxPZihyb290LCBuYW1lLCBzcGVjLmRlZmluaXRpb25zW25hbWVdLCByZXNvbHV0aW9uVGFibGUsIHVucmVzb2x2ZWRSZWZzLCBzcGVjKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICB0aGlzLnJlc29sdmVUbyhyb290LCBwYXJhbWV0ZXIuc2NoZW1hLCByZXNvbHV0aW9uVGFibGUsIGxvY2F0aW9uKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAocGFyYW1ldGVyLiRyZWYpIHtcbiAgICAgICAgICAgIC8vIHBhcmFtZXRlciByZWZlcmVuY2VcbiAgICAgICAgICAgIHRoaXMucmVzb2x2ZUlubGluZShyb290LCBzcGVjLCBwYXJhbWV0ZXIsIHJlc29sdXRpb25UYWJsZSwgdW5yZXNvbHZlZFJlZnMsIHBhcmFtZXRlci4kcmVmKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKHJlc3BvbnNlQ29kZSBpbiBvcGVyYXRpb24ucmVzcG9uc2VzKSB7XG4gICAgICAgICAgdmFyIHJlc3BvbnNlID0gb3BlcmF0aW9uLnJlc3BvbnNlc1tyZXNwb25zZUNvZGVdO1xuICAgICAgICAgIGxvY2F0aW9uID0gJy9wYXRocycgKyBuYW1lICsgJy8nICsgbWV0aG9kICsgJy9yZXNwb25zZXMvJyArIHJlc3BvbnNlQ29kZTtcblxuICAgICAgICAgIGlmKF8uaXNPYmplY3QocmVzcG9uc2UpKSB7XG4gICAgICAgICAgICBpZihyZXNwb25zZS4kcmVmKSB7XG4gICAgICAgICAgICAgIC8vIHJlc3BvbnNlIHJlZmVyZW5jZVxuICAgICAgICAgICAgICB0aGlzLnJlc29sdmVJbmxpbmUocm9vdCwgc3BlYywgcmVzcG9uc2UsIHJlc29sdXRpb25UYWJsZSwgdW5yZXNvbHZlZFJlZnMsIGxvY2F0aW9uKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChyZXNwb25zZS5zY2hlbWEpIHtcbiAgICAgICAgICAgICAgdmFyIHJlc3BvbnNlT2JqID0gcmVzcG9uc2U7XG4gICAgICAgICAgICAgIGlmKF8uaXNBcnJheShyZXNwb25zZU9iai5zY2hlbWEuYWxsT2YpKSB7XG4gICAgICAgICAgICAgICAgLy8gbW92ZSB0byBhIGRlZmluaXRpb25cbiAgICAgICAgICAgICAgICB2YXIgbW9kZWxOYW1lID0gJ2lubGluZV9tb2RlbCc7XG4gICAgICAgICAgICAgICAgdmFyIG5hbWUgPSBtb2RlbE5hbWU7XG4gICAgICAgICAgICAgICAgdmFyIGRvbmUgPSBmYWxzZTsgdmFyIGNvdW50ZXIgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlKCFkb25lKSB7XG4gICAgICAgICAgICAgICAgICBpZih0eXBlb2Ygc3BlYy5kZWZpbml0aW9uc1tuYW1lXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgZG9uZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgbmFtZSA9IG1vZGVsTmFtZSArICdfJyArIGNvdW50ZXI7XG4gICAgICAgICAgICAgICAgICBjb3VudGVyICsrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzcGVjLmRlZmluaXRpb25zW25hbWVdID0geyBhbGxPZjogcmVzcG9uc2VPYmouc2NoZW1hLmFsbE9mIH07XG4gICAgICAgICAgICAgICAgZGVsZXRlIHJlc3BvbnNlT2JqLnNjaGVtYS5hbGxPZjtcbiAgICAgICAgICAgICAgICBkZWxldGUgcmVzcG9uc2VPYmouc2NoZW1hLnR5cGU7XG4gICAgICAgICAgICAgICAgcmVzcG9uc2VPYmouc2NoZW1hLiRyZWYgPSAnIy9kZWZpbml0aW9ucy8nICsgbmFtZTtcbiAgICAgICAgICAgICAgICB0aGlzLnByb2Nlc3NBbGxPZihyb290LCBuYW1lLCBzcGVjLmRlZmluaXRpb25zW25hbWVdLCByZXNvbHV0aW9uVGFibGUsIHVucmVzb2x2ZWRSZWZzLCBzcGVjKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJlc29sdmVUbyhyb290LCByZXNwb25zZS5zY2hlbWEsIHJlc29sdXRpb25UYWJsZSwgbG9jYXRpb24pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIC8vIGNsZWFyIHRoZW0gb3V0IHRvIGF2b2lkIG11bHRpcGxlIHJlc29sdXRpb25zXG4gICAgcGF0aC5wYXJhbWV0ZXJzID0gW107XG4gIH1cblxuICB2YXIgZXhwZWN0ZWRDYWxscyA9IDAsIHRvUmVzb2x2ZSA9IFtdO1xuICAvLyBpZiB0aGUgcm9vdCBpcyBzYW1lIGFzIG9ialtpXS5yb290IHdlIGNhbiByZXNvbHZlIGxvY2FsbHlcbiAgdmFyIGFsbCA9IHJlc29sdXRpb25UYWJsZTtcblxuICB2YXIgcGFydHM7XG4gIGZvcihpID0gMDsgaSA8IGFsbC5sZW5ndGg7IGkrKykge1xuICAgIHZhciBhID0gYWxsW2ldO1xuICAgIGlmKHJvb3QgPT09IGEucm9vdCkge1xuICAgICAgaWYoYS5yZXNvbHZlQXMgPT09ICdyZWYnKSB7XG4gICAgICAgIC8vIHJlc29sdmUgYW55IHBhdGggd2Fsa2luZ1xuICAgICAgICB2YXIgam9pbmVkID0gKChhLnJvb3QgfHwgJycpICsgJy8nICsgYS5rZXkpLnNwbGl0KCcvJyk7XG4gICAgICAgIHZhciBub3JtYWxpemVkID0gW107XG4gICAgICAgIHZhciB1cmwgPSAnJztcbiAgICAgICAgdmFyIGs7XG5cbiAgICAgICAgaWYoYS5rZXkuaW5kZXhPZignLi4vJykgPj0gMCkge1xuICAgICAgICAgIGZvcih2YXIgaiA9IDA7IGogPCBqb2luZWQubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgIGlmKGpvaW5lZFtqXSA9PT0gJy4uJykge1xuICAgICAgICAgICAgICBub3JtYWxpemVkID0gbm9ybWFsaXplZC5zbGljZSgwLCBub3JtYWxpemVkLmxlbmd0aC0xKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBub3JtYWxpemVkLnB1c2goam9pbmVkW2pdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZm9yKGsgPSAwOyBrIDwgbm9ybWFsaXplZC5sZW5ndGg7IGsgKyspIHtcbiAgICAgICAgICAgIGlmKGsgPiAwKSB7XG4gICAgICAgICAgICAgIHVybCArPSAnLyc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB1cmwgKz0gbm9ybWFsaXplZFtrXTtcbiAgICAgICAgICB9XG4gICAgICAgICAgLy8gd2Ugbm93IGhhdmUgdG8gcmVtb3RlIHJlc29sdmUgdGhpcyBiZWNhdXNlIHRoZSBwYXRoIGhhcyBjaGFuZ2VkXG4gICAgICAgICAgYS5yb290ID0gdXJsO1xuICAgICAgICAgIHRvUmVzb2x2ZS5wdXNoKGEpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIHBhcnRzID0gYS5rZXkuc3BsaXQoJyMnKTtcbiAgICAgICAgICBpZihwYXJ0cy5sZW5ndGggPT09IDIpIHtcbiAgICAgICAgICAgIGlmKHBhcnRzWzBdLmluZGV4T2YoJ2h0dHA6Ly8nKSA9PT0gMCB8fCBwYXJ0c1swXS5pbmRleE9mKCdodHRwczovLycpID09PSAwKSB7XG4gICAgICAgICAgICAgIGEucm9vdCA9IHBhcnRzWzBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbG9jYXRpb24gPSBwYXJ0c1sxXS5zcGxpdCgnLycpO1xuICAgICAgICAgICAgdmFyIHI7XG4gICAgICAgICAgICB2YXIgcyA9IHNwZWM7XG4gICAgICAgICAgICBmb3IoayA9IDA7IGsgPCBsb2NhdGlvbi5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICB2YXIgcGFydCA9IGxvY2F0aW9uW2tdO1xuICAgICAgICAgICAgICBpZihwYXJ0ICE9PSAnJykge1xuICAgICAgICAgICAgICAgIHMgPSBzW3BhcnRdO1xuICAgICAgICAgICAgICAgIGlmKHR5cGVvZiBzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgciA9IHM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmKHIgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgLy8gbXVzdCByZXNvbHZlIHRoaXMgdG9vXG4gICAgICAgICAgICAgIHRvUmVzb2x2ZS5wdXNoKGEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIGlmIChhLnJlc29sdmVBcyA9PT0gJ2lubGluZScpIHtcbiAgICAgICAgICBpZihhLmtleSAmJiBhLmtleS5pbmRleE9mKCcjJykgPT09IC0xICYmIGEua2V5LmNoYXJBdCgwKSAhPT0gJy8nKSB7XG4gICAgICAgICAgICAvLyBoYW5kbGUgcmVsYXRpdmUgc2NoZW1hXG4gICAgICAgICAgICBwYXJ0cyA9IGEucm9vdC5zcGxpdCgnLycpO1xuICAgICAgICAgICAgbG9jYXRpb24gPSAnJztcbiAgICAgICAgICAgIGZvcihpID0gMDsgaSA8IHBhcnRzLmxlbmd0aCAtIDE7IGkrKykge1xuICAgICAgICAgICAgICBsb2NhdGlvbiArPSBwYXJ0c1tpXSArICcvJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxvY2F0aW9uICs9IGEua2V5O1xuICAgICAgICAgICAgYS5yb290ID0gbG9jYXRpb247XG4gICAgICAgICAgICBhLmxvY2F0aW9uID0gJyc7XG4gICAgICAgICAgfVxuICAgICAgICAgIHRvUmVzb2x2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XJzIHx8ICdhcHBsaWNhdGlvbi9qc29uJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAgb246IHtcbiAgICAgICAgICAgIGVycm9yOiBmdW5jdGlvbiAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgcHJvY2Vzc2VkQ2FsbHMgKz0gMTtcbiAgICAgICAgICAgICAgdW5yZXNvbHZlZFJlZnNbaXRlbS5rZXldID0ge1xuICAgICAgICAgICAgICAgIHJvb3Q6IGl0ZW0ucm9vdCxcbiAgICAgICAgICAgICAgICBsb2NhdGlvbjogaXRlbS5sb2NhdGlvblxuICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgIGlmIChwcm9jZXNzZWRDYWxscyA9PT0gZXhwZWN0ZWRDYWxscykge1xuICAgICAgICAgICAgICAgIHNlbGYuZmluaXNoKHNwZWMsIF9yb290LCByZXNvbHV0aW9uVGFibGUsIHJlc29sdmVkUmVmcywgdW5yZXNvbHZlZFJlZnMsIGNhbGxiYWNrKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgIC8vIGpzaGludCBpZ25vcmU6bGluZVxuICAgICAgICAgICAgcmVzcG9uc2U6IGZ1bmN0aW9uIChyZXNwb25zZSkge1xuICAgICAgICAgICAgICB2YXIgc3dhZ2dlciA9IHJlc3BvbnNlLm9iajtcbiAgICAgICAgICAgICAgc2VsZi5yZXNvbHZlSXRlbShzd2FnZ2VyLCBpdGVtLnJvb3QsIHJlc29sdXRpb25UYWJsZSwgcmVzb2x2ZWRSZWZzLCB1bnJlc29sdmVkUmVmcywgaXRlbSk7XG4gICAgICAgICAgICAgIHByb2Nlc3NlZENhbGxzICs9IDE7XG5cbiAgICAgICAgICAgICAgaWYgKHByb2Nlc3NlZENhbGxzID09PSBleHBlY3RlZENhbGxzKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5maW5pc2goc3BlYywgX3Jvb3QsIHJlc29sdXRpb25UYWJsZSwgcmVzb2x2ZWRSZWZzLCB1bnJlc29sdm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aGFzIG5vIHByb3RvY29sLCBtYWtlIHJlbGF0aXZlXG4gICAgICAgIHZhciBhcHBlbmRIYXNoID0gdHJ1ZTtcbiAgICAgICAgdmFyIG9sZFJvb3QgPSByb290O1xuICAgICAgICBpZihyb290KSB7XG4gICAgICAgICAgdmFyIGxhc3RDaGFyID0gcm9vdC5zbGljZSgtMSk7XG4gICAgICAgICAgaWYobGFzdENoYXIgIT09ICcvJyAmJiAoaXRlbS5pbmRleE9mKCcjJykgIT09IDAgJiYgaXRlbS5pbmRleE9mKCdodHRwOi8vJykgIT09IDAgJiYgaXRlbS5pbmRleE9mKCdodHRwczovLycpKSkge1xuICAgICAgICAgICAgY29uc29sZS5sb2coJ3dvcmtpbmcgd2l0aCAnICsgaXRlbSk7XG4gICAgICAgICAgICBhcHBlbmRIYXNoID0gZmFsc2U7XG4gICAgICAgICAgICB2YXIgcGFydHMgPSByb290LnNwbGl0KCdcXC8nKTtcbiAgICAgICAgICAgIHBhcnRzID0gcGFydHMuc3BsaWNlKDAsIHBhcnRzLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgcm9vdCA9ICcnO1xuICAgICAgICAgICAgZm9yKHZhciBpID0gMDsgaSA8IHBhcnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgIHJvb3QgKz0gcGFydHNbaV0gKyAnLyc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmKGl0ZW0uaW5kZXhPZignIycpICE9PSAwICYmIGFwcGVuZEhhc2gpIHtcbiAgICAgICAgICBpdGVtID0gJyMnICsgaXRlbTtcbiAgICAgICAgfVxuXG4gICAgICAgIGl0ZW0gPSAocm9vdCB8fCAnJykgKyBpdGVtO1xuICAgICAgICBvYmpba2V5XSA9IGl0ZW07XG4gICAgICB9XG4gICAgfVxuICAgIGVsc2UgaWYoXy5pc09iamVjdChpdGVtKSkge1xuICAgICAgdGhpcy5yZXRhaW5Sb290KGl0ZW0sIHJvb3Q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leE9mKCcjJykgPj0gMCkge1xuICAgICAgaWYocmVmLmluZGV4T2YoJy8nKSA9PT0gMCkge1xuICAgICAgICBycyA9IHJlZi5zcGxpdCgnIycpO1xuICAgICAgICBwICA9IHJvb3Quc3BsaXQoJy8vJyk7XG4gICAgICAgIHAyID0gcFsxXS5zcGxpdCgnLycpO1xuICAgICAgICByb290ID0gcFswXSArICcvLycgKyBwMlswXSArIHJzWzBdO1xuICAgICAgICBsb2NhdGlvbiA9IHJzWzFdO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIHJzID0gcmVmLnNwbGl0KCcjJyk7XG4gICAgICAgIGlmKHJzWzBdICE9PSAnJykge1xuICAgICAgICAgIHAyID0gcm9vdC5zcGxpdCgnLycpO1xuICAgICAgICAgIHAyID0gcDIuc2xpY2UoMCwgcDIubGVuZ3RoIC0gMSk7XG4gICAgICAgICAgaWYoIXJvb3RUcmltbWVkKSB7XG4gICAgICAgICAgICByb290ID0gJyc7XG4gICAgICAgICAgICBmb3IgKHZhciBrID0gMDsgayA8IHAyLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgIGlmKGsgPiAwKSB7IHJvb3QgKz0gJy8nOyB9XG4gICAgICAgICAgICAgIHJvb3QgKz0gcDJba107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIHJvb3QgKz0gJy8nICsgcmVmLnNwbGl0KCcjJylbMF07XG4gICAgICAgIH1cbiAgICAgICAgbG9jYXRpb24gPSByc1sxXTtcbiAgICAgIH1cbiAgICB9XG4gICAgaWYgKHJlZi5pbmRleE9mKCdodHRwJykgPT09IDApIHtcbiAgICAgIGlmKHJlZi5pbmRleE9mKCcjJykgPj0gMCkge1xuICAgICAgICByb290ID0gcmVmLnNwbGl0KCcjJylbMF07XG4gICAgICAgIGxvY2F0aW9uID0gcmVmLnNwbGl0KCcjJylbMV07XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgcm9vdCA9IHJlZjtc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ICAgICB2YXIgcGFydHMgPSByZWYuc3BsaXQoJyMnKTtcblxuICAgICAgLy8gIy9kZWZpbml0aW9ucy9mb29cbiAgICAgIC8vIGZvby5qc29uIy9iYXJcbiAgICAgIGlmKHBhcnRzWzBdICYmIHJlZi5pbmRleE9mKCcvJykgPT09IDApIHtcblxuICAgICAgfVxuICAgICAgZWxzZSBpZihwYXJ0c1swXSAmJiBwYXJ0c1swXS5pbmRleE9mKCdodHRwJykgPT09IDApIHtcbiAgICAgICAgbHJvb3QgPSBwYXJ0c1swXTtcbiAgICAgICAgcmVmID0gcGFydHNbMV07XG4gICAgICB9XG4gICAgICBlbHNlIGlmKHBhcnRzWzBdICYmIHBhcnRzWzBdLmxlbmd0aCA+IDApIHtcbiAgICAgICAgLy8gcmVsYXRpdmUgZmlsZVxuICAgICAgICBzcCA9IHJvb3Quc3BsaXQoJy8nKTtcbiAgICAgICAgbHJvb3QgPSAnJztcbiAgICAgICAgZm9yKGkgPSAwOyBpIDwgc3AubGVuZ3RoIC0gMTsgaSsrKSB7XG4gICAgICAgICAgbHJvb3QgKz0gc3BbaV0gKyAnLyc7XG4gICAgICAgIH1cbiAgICAgICAgbHJvb3QgKz0gcGFydHNbMF07XG4gICAgICB9XG4gICAgICBlbHNlIHtcblxuICAgICAgfVxuXG4gICAgICBsb2NhdGlvbiA9IHBhcnRzWzFdO1xuICAgIH1cbiAgICBlbHNlIGlmIChyZWYuaW5kZXhPZignaHR0cDovLycpID09PSAwIHx8IHJlZi5pbmRleE9mKCdodHRwczovLycpID09PSAwKSB7XG4gICAgICBscm9vdCA9IHJlZjtcbiAgICAgIGxvY2F0aW9uID0gJyc7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgLy8gcmVsYXRpdmUgZmlsZVxuICAgICAgc3AgPSByb290LnNwbGl0KCcvJyk7XG4gICAgICBscm9vdCA9ICcnO1xuICAgICAgZm9yKGkgPSAwOyBpIDwgc3AubGVuZ3RoIC0gMTsgaSsrKSB7XG4gICAgICA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nXSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICBvdXRwdXRbJ3gtcmVzb2x2ZWQtZnJvbSddID0gaXRlbVsneC1yZXNvbHZlZC1mcm9tJ107XG4gICAgICAgIH1cblxuICAgICAgICBmb3IodmFyIGkgPSAwOyBpIDwgYWxsT2YubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICB2YXIgY29tcG9uZW50ID0gYWxsT2ZbaV07XG4gICAgICAgICAgdmFyIHNvdXJjZSA9ICdzZWxmJztcbiAgICAgICAgICBpZih0eXBlb2YgY29tcG9uZW50Wyd4LXJlc29sdmVkLWZyb20nXSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIHNvdXJjZSA9IGNvbXBvbmVudFsneC1yZXNvbHZlZC1mcm9tJ11bMF07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgZm9yKHZhciBwYXJ0IGluIGNvbXBvbmVudCkge1xuICAgICAgICAgICAgaWYoIW91dHB1dC5oYXNPd25Qcm9wZXJ0eShwYXJ0KSkge1xuICAgICAgICAgICAgICBvdXRwdXRbcGFydF0gPSBfLmNsb25lRGVlcChjb21wb25lbnRbcGFydF0pO1xuICAgICAgICAgICAgICBpZihwYXJ0ID09PSAncHJvcGVydGllcycpIHtcbiAgICAgICAgICAgICAgICBmb3IobmFtZSBpbiBvdXRwdXRbcGFydF0pIHtcbiAgICAgICAgICAgICAgICAgIG91dHB1dFtwYXJ0XVtuYW1lXVsneC1yZXNvbHZlZC1mcm9tJ10gPSBzb3VyY2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgaWYocGFydCA9PT0gJ3Byb3BlcnRpZXMnKSB7XG4gICAgICAgICAgICAgICAgdmFyIHByb3BlcnRpZXMgPSBjb21wb25lbnRbcGFydF07XG4gICAgICAgICAgICAgICAgZm9yKG5hbWUgaW4gcHJvcGVydGllcykge1xuICAgICAgICAgICAgICAgICAgb3V0cHV0LnByb3BlcnRpZXNbbmFtZV0gPSBfLmNsb25lRGVlcChwcm9wZXJ0aWVzW25hbWVdKTtcbiAgICAgICAgICAgICAgICAgIHZhciByZXNvbHZlZEZyb20gPSBwcm9wZXJ0aWVzW25hbWVdWyd4LXJlc29sdmVkLWZyb20nXTtcbiAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzb2x2ZWRGcm9tID09PSAndW5kZWZpbmVkJyB8fCByZXNvbHZlZEZyb20gPT09ICdzZWxmJykge1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlZEZyb20gPSBzb3VyY2U7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBvdXRwdXQucHJvcGVydGllc1tuYW1lXVsneC1yZXNvbHZlZC1mcm9tJ10gPSByZXNvbHZlZEZyb207XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGVsc2UgaWYocGFydCA9PT0gJ3JlcXVpcmVkJykge1xuICAgICAgICAgICAgICAgIC8vIG1lcmdlICYgZGVkdXAgdGhlIHJlcXVpcmVkIGFycmF5XG4gICAgICAgICAgICAgICAgdmFyIGEgPSBvdXRwdXQucmVxdWlyZWQuY29uY2F0KGNvbXBvbmVudFtwYXJ0XSk7XG4gICAgICAgICAgICAgICAgZm9yKHZhciBrID0gMDsgayA8IGEubGVuZ3RoOyArK2spIHtcbiAgICAgICAgICAgICAgICAgIGZvcih2YXIgaiA9IGsgKyAxOyBqIDwgYS5sZW5ndGg7ICsraikge1xuICAgICAgICAgICAgICAgICAgICBpZihhW2tdID09PSBhW2pdKSB7IGEuc3BsaWNlKGotLSwgMSk7IH1cbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgb3V0cHV0LnJlcXVpcmVkID0gYTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNl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gICAgICAgICAgIGlmIChfLmluZGV4T2YoWydhcnJheScsICdvYmplY3QnXSwgdHlwZSkgPiAtMSkge1xuICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gJ29iamVjdCcgJiYgXy5pc1VuZGVmaW5lZChpdGVtLnByb3BlcnRpZXMpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdvYmplY3QnO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBhZGRSZWZlcmVuY2UoaXRlbSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBwcmltaXRpdmVUb09wdGlvbnNIVE1MKGl0ZW0sIHR5cGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gYWRkUmVmZXJlbmNlKGl0ZW0sIEhlbHBlcnMuc2ltcGxlUmVmKGl0ZW0uJHJlZikpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSkuam9pbignLDwvZGl2PjxkaXY+Jyk7XG4gICAgICB9IGVsc2UgaWYgKF8uaXNQbGFpbk9iamVjdChzY2hlbWEuaXRlbXMpKSB7XG4gICAgICAgIGlmIChfLmlzVW5kZWZpbmVkKHNjaGVtYS5pdGVtcy4kcmVmKSkge1xuICAgICAgICAgIGlmIChfLmluZGV4T2YoWydhcnJheScsICdvYmplY3QnXSwgc2NoZW1hLml0ZW1zLnR5cGUgfHwgJ29iamVjdCcpID4gLTEpIHtcbiAgICAgICAgICAgIGlmICgoXy5pc1VuZGVmaW5lZChzY2hlbWEuaXRlbXMudHlwZSkgfHwgc2NoZW1hLml0ZW1zLnR5cGUgPT09ICdvYmplY3QnKSAmJiBfLmlzVW5kZWZpbmVkKHNjaGVtYS5pdGVtcy5wcm9wZXJ0aWVzKSkge1xuICAgICAgICAgICAgICBodG1sICs9ICc8ZGl2Pm9iamVjdDwvZGl2Pic7XG4g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ghXy5pc1VuZGVmaW5lZChjUHJvcGVydHkuJHJlZikpIHtcbiAgICAgICAgICAgICAgbW9kZWwgPSBtb2RlbHNbSGVscGVycy5zaW1wbGVSZWYoY1Byb3BlcnR5LiRyZWYpXTtcblxuICAgICAgICAgICAgICBpZiAoIV8uaXNVbmRlZmluZWQobW9kZWwpICYmIF8uaW5kZXhPZihbdW5kZWZpbmVkLCAnYXJyYXknLCAnb2JqZWN0J10sIG1vZGVsLmRlZmluaXRpb24udHlwZSkgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgLy8gVXNlIHJlZmVyZW5jZWQgc2NoZW1hXG4gICAgICAgICAgICAgICAgY1Byb3BlcnR5ID0gSGVscGVycy5yZXNvbHZlU2NoZW1hKG1vZGVsLmRlZmluaXRpb24pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGh0bWwgKz0gcHJpbWl0aXZlVG9IVE1MKGNQcm9wZXJ0eSk7XG5cbiAgICAgICAgICAgIGlmKCFwcm9wZXJ0eUlzUmVxdWlyZWQpIHtcbiAgICAgICAgICAgICAgaHRtbCArPSAnLCA8c3BhbiBjbGFzcz1cInByb3BPcHRLZXlcIj5vcHRpb25hbDwvc3Bhbj4nO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZihwcm9wZXJ0eS5yZWFkT25seSkge1xuICAgICAgICAgICAgICAgIGh0bWwgKz0gJywgPHNwYW4gY2xhc3M9XCJwcm9wUmVhZE9ubHlcIj5yZWFkIG9ubHk8L3NwYW4+JztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaHRtbCArPSAnKSc7XG5cbiAgICAgICAgICAgIGlmICghXy5pc1VuZGVmaW5lZChwcm9wRGVzY3JpcHRpb24pKSB7XG4gICAgICAgICAgICAgIGh0bWwgKz0gJzogJyArICc8c3BhbiBjbGFzcz1cInByb3BEZXNjXCI+JyArIHByb3BEZXNjcmlwdGlvbiArICc8L3NwYW4+JztcbiAgICA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BvcGVyYXRpb24uc2VjdXJpdHkgPSBvcGVyYXRpb24uc2VjdXJpdHkgfHwgW107XG4gICAgICAgIHZhciBzY29wZXMgPSBleGlzdGluZ0F1dGhvcml6YXRpb25zW2tleV07XG4gICAgICAgIGlmKHNjb3Blcykge1xuICAgICAgICAgIHZhciBzZWN1cml0eVNjb3BlcyA9IFtdO1xuICAgICAgICAgIGZvcih2YXIgaiBpbiBzY29wZXMpIHtcbiAgICAgICAgICAgIHNlY3VyaXR5U2NvcGVzLnB1c2goc2NvcGVzW2pdLnNjb3BlKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgc2NvcGVzT2JqZWN0ID0ge307XG4gICAgICAgICAgc2NvcGVzT2JqZWN0W2tleV0gPSBzZWN1cml0eVNjb3BlcztcbiAgICAgICAgICBvcGVyYXRpb24uc2VjdXJpdHkucHVzaChzY29wZXNPYmplY3QpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIHNjb3Blc09iamVjdCA9IHt9O1xuICAgICAgICAgIHNjb3Blc09iamVjdFtrZXldID0gW107XG4gICAgICAgICAgb3BlcmF0aW9uLnNlY3VyaXR5LnB1c2goc2NvcGVzT2JqZWN0KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIGlmKGV4aXN0aW5nT3BlcmF0aW9uLmNvbnN1bWVzKSB7XG4gICAgICBvcGVyYXRpb24uY29uc3VtZXMgPSBleGlzdGluZ09wZXJhdGlvbi5jb25zdW1lcztcbiAgICB9XG4gICAgZWxzZSBpZihzd2FnZ2VyLmNvbnN1bWVzKSB7XG4gICAgICBvcGVyYXRpb24uY29uc3VtZXMgPSBzd2FnZ2VyLmNvbnN1bWVzO1xuICAgIH1cbiAgICBpZihleGlzdGluZ09wZXJhdGlvbi5wcm9kdWNlcykge1xuICAgICAgb3BlcmF0aW9uLnByb2R1Y2VzID0gZXhpc3RpbmdPcGVyYXRpb24ucHJvZHVjZXM7XG4gICAgfVxuICAgIGVsc2U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b25zW25hbWVdO1xuICAgICAgaWYoZGVmaW5pdGlvbi50eXBlID09PSAnYXBpS2V5Jykge1xuICAgICAgICBzZWN1cml0eURlZmluaXRpb24udHlwZSA9ICdhcGlLZXknO1xuICAgICAgICBzZWN1cml0eURlZmluaXRpb24uaW4gPSBkZWZpbml0aW9uLnBhc3NBcztcbiAgICAgICAgc2VjdXJpdHlEZWZpbml0aW9uLm5hbWUgPSBkZWZpbml0aW9uLmtleW5hbWUgfHwgbmFtZTtcbiAgICAgICAgaXNWYWxpZCA9IHRydWU7XG4gICAgICB9XG4gICAgICBlbHNlIGlmKGRlZmluaXRpb24udHlwZSA9PT0gJ2Jhc2ljQXV0aCcpIHtcbiAgICAgICAgc2VjdXJpdHlEZWZpbml0aW9uLnR5cGUgPSAnYmFzaWNBdXRoJztcbiAgICAgICAgaXNWYWxpZCA9IHRydWU7XG4gICAgICB9XG4gICAgICBlbHNlIGlmKGRlZmluaXRpb24udHlwZSA9PT0gJ29hdXRoMicpIHtcbiAgICAgICAgdmFyIGV4aXN0aW5nU2NvcGVzID0gZGVmaW5pdGlvbi5zY29wZXMgfHwgW107XG4gICAgICAgIHZhciBzY29wZXMgPSB7fTtcbiAgICAgICAgdmFyIGk7XG4gICAgICAgIGZvcihpIGluIGV4aXN0aW5nU2NvcGVzKSB7XG4gICAgICAgICAgdmFyIHNjb3BlID0gZXhpc3RpbmdTY29wZXNbaV07XG4gICAgICAgICAgc2NvcGVzW3Njb3BlLnNjb3BlXSA9IHNjb3BlLmRlc2NyaXB0aW9uO1xuICAgICAgICB9XG4gICAgICAgIHNlY3VyaXR5RGVmaW5pdGlvbi50eXBlID0gJ29hdXRoMic7XG4gICAgICAgIGlmKGkgPiAwKSB7XG4gICAgICAgICAgc2VjdXJpdHlEZWZpbml0aW9uLnNjb3BlcyA9IHNjb3BlcztcbiAgICAgICAgfVxuICAgICAgICBpZihkZWZpbml0aW9uLmdyYW50VHlwZXMpIHtcbiAgICAgICAgICBpZihkZWZpbml0aW9uLmdyYW50VHlwZXMuaW1wbGljaXQpIHtcbiAgICAgICAgICAgIHZhciBpbXBsaWNpdCA9IGRlZmluaXRpb24uZ3JhbnRUeXBlcy5pbXBsaWNpdDtcbiAgICAgICAgICAgIHNlY3VyaXR5RGVmaW5pdGlvbi5mbG93ID0gJ2ltcGxpY2l0JztcbiAgICAgICAgICAgIHNlY3VyaXR5RGVmaW5pdGlvbi5hdXRob3JpemF0aW9uVXJsID0gaW1wbGljaXQubG9naW5FbmRwb2ludDtcbiAgICAgICAgICAgIGlzVmFsaWQgPSB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICAvKiBqc2hpbnQgaWdub3JlOnN0YXJ0ICovXG4gICAgICAgICAgaWYoZGVmaW5pdGlvbi5ncmFudFR5cGVzWydhdXRob3JpemF0aW9uX2NvZGUnXSkge1xuICAgICAgICAgICAgaWYoIXNlY3VyaXR5RGVmaW5pdGlvbi5mbG93KSB7XG4gICAgICAgICAgICAgIC8vIGNhbm5vdCBzZXQgaWYgZmxvdyBpcyBhbHJlYWR5IGRlZmluZWRcbiAgICAgICAgICAgICAgdmFyIGF1dGhDb2RlID0gZGVmaW5pdGlvbi5ncmFudFR5cGVzWydhdXRob3JpemF0aW9uX2NvZGUnXTtcbiAgICAgICAgICAgICAgc2VjdXJpdHlEZWZpbml0aW9uLmZsb3cgPSAnYWNjZXNzQ29kZSc7XG4gICAgICAgICAgICAgIHNlY3VyaXR5RGVmaW5pdGlvbi5hdXRob3JpemF0aW9uVXJsID0gYXV0aENvZGUudG9rZW5SZXF1ZXN0RW5kcG9pbnQudXJsO1xuICAgICAgICAgICAgICBzZWN1cml0eURlZmluaXRpb24udG9rZW5VcmwgPSBhdXRoQ29kZS50b2tlbkVuZHBvaW50LnVybDtcbiAgICAgICAgICAgICAgaXNWYWxpZCA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIC8qIGpzaGludCBpZ25vcmU6ZW5kICovXG4gICAgICAgIH1c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ID0gQlAucmVhZEludDMyQkVcbiAgYXJyLnJlYWRGbG9hdExFID0gQlAucmVhZEZsb2F0TEVcbiAgYXJyLnJlYWRGbG9hdEJFID0gQlAucmVhZEZsb2F0QkVcbiAgYXJyLnJlYWREb3VibGVMRSA9IEJQLnJlYWREb3VibGVMRVxuICBhcnIucmVhZERvdWJsZUJFID0gQlAucmVhZERvdWJsZUJFXG4gIGFyci53cml0ZVVJbnQ4ID0gQlAud3JpdGVVSW50OFxuICBhcnIud3JpdGVVSW50TEUgPSBCUC53cml0ZVVJbnRMRVxuICBhcnIud3JpdGVVSW50QkUgPSBCUC53cml0ZVVJbnRCRVxuICBhcnIud3JpdGVVSW50MTZMRSA9IEJQLndyaXRlVUludDE2TEVcbiAgYXJyLndyaXRlVUludDE2QkUgPSBCUC53cml0ZVVJbnQxNkJFXG4gIGFyci53cml0ZVVJbnQzMkxFID0gQlAud3JpdGVVSW50MzJMRVxuICBhcnIud3JpdGVVSW50MzJCRSA9IEJQLndyaXRlVUludDMyQkVcbiAgYXJyLndyaXRlSW50TEUgPSBCUC53cml0ZUludExFXG4gIGFyci53cml0ZUludEJFID0gQlAud3JpdGVJbnRCRVxuICBhcnIud3JpdGVJbnQ4ID0gQlAud3JpdGVJbnQ4XG4gIGFyci53cml0ZUludDE2TEUgPSBCUC53cml0ZUludDE2TEVcbiAgYXJyLndyaXRlSW50MTZCRSA9IEJQLndyaXRlSW50MTZCRVxuICBhcnIud3JpdGVJbnQzMkxFID0gQlAud3JpdGVJbnQzMkxFXG4gIGFyci53cml0ZUludDMyQkUgPSBCUC53cml0ZUludDMyQkVcbiAgYXJyLndyaXRlRmxvYXRMRSA9IEJQLndyaXRlRmxvYXRMRVxuICBhcnIud3JpdGVGbG9hdEJFID0gQlAud3JpdGVGbG9hdEJFXG4gIGFyci53cml0ZURvdWJsZUxFID0gQlAud3JpdGVEb3VibGVMRVxuICBhcnIud3JpdGVEb3VibGVCRSA9IEJQLndyaXRlRG91YmxlQkVcbiAgYXJ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VmZmVyW29mZnNldCArIGkgLSBkXSB8PSBzICogMTI4XG59XG4iLCJcbi8qKlxuICogaXNBcnJheVxuICovXG5cbnZhciBpc0FycmF5ID0gQXJyYXkuaXNBcnJheTtcblxuLyoqXG4gKiB0b1N0cmluZ1xuICovXG5cbnZhciBzdHIgPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nO1xuXG4vKipcbiAqIFdoZXRoZXIgb3Igbm90IHRoZSBnaXZlbiBgdmFsYFxuICogaXMgYW4gYXJyYXkuXG4gKlxuICogZXhhbXBsZTpcbiAqXG4gKiAgICAgICAgaXNBcnJheShbXSk7XG4gKiAgICAgICAgLy8gPiB0cnVlXG4gKiAgICAgICAgaXNBcnJheShhcmd1bWVudHMpO1xuICogICAgICAgIC8vID4gZmFsc2VcbiAqICAgICAgICBpc0FycmF5KCcnKTtcbiAqICAgICAgICAvLyA+IGZhbHNlXG4gKlxuICogQHBhcmFtIHttaXhlZH0gdmFsXG4gKiBAcmV0dXJuIHtib29sfVxuICovXG5cbm1vZHVsZS5leHBvcnRzID0gaXNBcnJheSB8fCBmdW5jdGlvbiAodmFsKSB7XG4gIHJldHVybiAhISB2YWwgJiYgJ1tvYmplY3QgQXJyYXldJyA9PSBzdHIuY2FsbCh2YWwpO1xufTtcbiIsIi8qIGpzaGludCBub2RlOiB0cnVlICovXG4oZnVuY3Rpb24gKCkge1xuICAgIFwidXNlIHN0cmljdFwiO1xuXG4gICAgZnVuY3Rpb24gQ29va2llQWNjZXNzSW5mbyhkb21haW4sIHBhdGgsIHNlY3VyZSwgc2NyaXB0KSB7XG4gICAgICAgIGlmICh0aGlzIGluc3RhbmNlb2YgQ29va2llQWNjZXNzSW5mbykge1xuICAgICAgICAgICAgdGhpcy5kb21haW4gPSBkb21haW4gfHwgdW5kZWZpbmVkO1xuICAgICAgICAgICAgdGhpcy5wYXRoID0gcGF0aCB8fCBcIi9cIjtcbiAgICAgICAgICAgIHRoaXMuc2VjdXJlID0gISFzZWN1cmU7XG4gICAgICAgICAgICB0aGlzLnNjcmlwdCA9ICEhc2NyaXB0O1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ldyBDb29raWVBY2Nlc3NJbmZvKGRvbWFpbiwgcGF0aCwgc2VjdXJlLCBzY3JpcHQpO1xuICAgIH1cbiAgICBleHBvcnRzLkNvb2tpZUFjY2Vzc0luZm8gPSBDb29raWVBY2Nlc3NJbmZvO1xuXG4gICAgZnVuY3Rpb24gQ29va2llKGNvb2tpZXN0ciwgcmVxdWVzdF9kb21haW4sIHJlcXVlc3RfcGF0aCkge1xuICAgICAgICBpZiAoY29va2llc3RyIGluc3RhbmNlb2YgQ29va2llKSB7XG4gICAgICAgICAgICByZXR1cm4gY29va2llc3RyO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzIGluc3RhbmNlb2YgQ29va2llKSB7XG4gICAgICAgICAgICB0aGlzLm5hbWUgPSBudWxsO1xuICAgICAgICAgICAgdGhpcy52YWx1ZSA9IG51bGw7XG4gICAgICAgICAgICB0aGlzLmV4cGlyYXRpb25fZGF0ZSA9IEluZmluaXR5O1xuICAgICAgICAgICAgdGhpcy5wYXRoID0gU3RyaW5nKHJlcXVlc3RfcGF0aCB8fCBcIi9cIik7XG4gICAgICAgICAgICB0aGlzLmV4cGxpY2l0X3BhdGggPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMuZG9tYWluID0gcmVxdWVzdF9kb21haW4gfHwgbnVsbDtcbiAgICAgICAgICAgIHRoaXMuZXhwbGljaXRfZG9tYWluID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLnNlY3VyZSA9IGZhbHNlOyAvL2hvdyB0byBkZWZpbmUgZGVmYXVsdD9cbiAgICAgICAgICAgIHRoaXMubm9zY3JpcHQgPSBmYWxzZTsgLy9odHRwb25seVxuICAgICAgICAgICAgaWYgKGNvb2tpZXN0cikge1xuICAgICAgICAgICAgICAgIHRoaXMucGFyc2UoY29va2llc3RyLCByZXF1ZXN0X2RvbWFpbiwgcmVxdWVzdF9wYXRoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZXcgQ29va2llKGNvb2tpZXN0ciwgcmVxdWVzdF9kb21haW4sIHJlcXVlc3RfcGF0aCk7XG4gICAgfVxuICAgIGV4cG9ydHMuQ29va2llID0gQ29va2llO1xuXG4gICAgQ29va2llLnByb3RvdHlwZS50b1N0cmluZyA9IGZ1bmN0aW9uIHRvU3RyaW5nKCkge1xuICAgICAgICB2YXIgc3RyID0gW3RoaXMubmFtZSArIFwiPVwiICsgdGhpcy52YWx1ZV07XG4gICAgICAgIGlmICh0aGlzLmV4cGlyYXRpb25fZGF0ZSAhPT0gSW5maW5pdHkpIHtcbiAgICAgICAgICAgIHN0ci5wdXNoKFwiZXhwaXJlcz1cIiArIChuZXcgRGF0ZSh0aGlzLmV4cGlyYXRpb25fZGF0ZSkpLnRvR01UU3RyaW5nKCkpO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLmRvbWFpbikge1xuICAgICAgICAgICAgc3RyLnB1c2goXCJkb21haW49XCIgKyB0aGlzLmRvbWFpbik7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMucGF0aCkge1xuICAgICAgICAgICAgc3RyLnB1c2goXCJwYXRoPVwiICsgdGhpcy5wYXRoKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5zZWN1cmUpIHtcbiAgICAgICAgICAgIHN0ci5wdXNoKFwic2VjdXJlXCIpO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLm5vc2NyaXB0KSB7XG4gICAgICAgICAgICBzdHIucHVzaChcImh0dHBvbmx5XCIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzdHIuam9pbihcIjsgXCIpO1xuICAgIH07XG5cbiAgICBDb29raWUucHJvdG90eXBlLnRvVmFsdWVTdHJpbmcgPSBmdW5jdGlvbiB0b1ZhbHVlU3RyaW5nKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5uYW1lICsgXCI9XCIgKyB0aGlzLnZhbHVlO1xuICAgIH07XG5cbiAgICB2YXIgY29va2llX3N0cl9zcGxpdHRlciA9IC9bOl0oPz1cXHMqW2EtekEtWjAtOV9cXC1dK1xccypbPV0pL2c7XG4gICAgQ29va2llLnByb3RvdHlwZS5wYXJzZSA9IGZ1bmN0aW9uIHBhcnNlKHN0ciwgcmVxdWVzdF9kb21haW4sIHJlcXVlc3RfcGF0aCkge1xuICAgICAgICBpZiAodGhpcyBpbnN0YW5jZW9mIENvb2tpZSkge1xuICAgICAgICAgICAgdmFyIHBhcnRzID0gc3RyLnNwbGl0KFwiO1wiKS5maWx0ZXIoZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAhIXZhbHVlO1xuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgIHBhaXIgPSBwYXJ0c1swXS5tYXRjaCgvKFtePV0rKT0oW1xcc1xcU10qKS8pLFxuICAgICAgICAgICAgICAgIGtleSA9IHBhaXJbMV0sXG4gICAgICAgICAgICAgICAgdmFsdWUgPSBwYWlyWzJdLFxuICAgICAgICAgICAgICAgIGk7XG4gICAgICAgICAgICB0aGlzLm5hbWUgPSBrZXk7XG4gICAgICAgICAgICB0aGlzLnZhbHVlID0gdmFsdWU7XG5cbiAgICAgICAgICAgIGZvciAoaSA9IDE7IGkgPCBwYXJ0cy5sZW5ndGg7IGkgKz0gMSkge1xuICAgICAgICAgICAgICAgIHBhaXIgPSBwYXJ0c1tpXS5tYXRjaCgvKFtePV0rKSg/Oj0oW1xcc1xcU10qKSk/Lyk7XG4gICAgICAgICAgICAgICAga2V5ID0gcGFpclsxXS50cmltKCkudG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IHBhaXJbMl07XG4gICAgICAgICAgICAgICAgc3dpdGNoIChrZXkpIHtcbiAgICAgICAgICAgICAgICBjYXNlIFwiaHR0cG9ubHlcIjpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5ub3NjcmlwdCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgXCJleHBpcmVzXCI6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZXhwaXJhdGlvbl9kYXRlID0gdmFsdWUgP1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE51bWJlcihEYXRlLnBhcnNlKHZhbHVlKSkgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZmluaXR5O1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIFwicGF0aFwiOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhdGggPSB2YWx1ZSA/XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUudHJpbSgpIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIlwiO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmV4cGxpY2l0X3BhdGggPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIFwiZG9tYWluXCI6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZG9tYWluID0gdmFsdWUgP1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLnRyaW0oKSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5leHBsaWNpdF9kb21haW4gPSAhIXRoaXMuZG9tYWluO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIFwic2VjdXJlXCI6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2VjdXJlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIXRoaXMuZXhwbGljaXRfcGF0aCkge1xuICAgICAgICAgICAgICAgdGhpcy5wYXRoID0gcmVxdWVzdF9wYXRoIHx8IFwiL1wiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCF0aGlzLmV4cGxpY2l0X2RvbWFpbikge1xuICAgICAgICAgICAgICAgdGhpcy5kb21haW4gPSByZXF1ZXN0X2RvbWFpbjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ldyBDb29raWUoKS5wYXJzZShzdHIsIHJlcXVlc3RfZG9tYWluLCByZXF1ZXN0X3BhdGgpO1xuICAgIH07XG5cbiAgICBDb29raWUucHJvdG90eXBlLm1hdGNoZXMgPSBmdW5jdGlvbiBtYXRjaGVzKGFjY2Vzc19pbmZvKSB7XG4gICAgICAgIGlmICh0aGlzLm5vc2NyaXB0ICYmIGFjY2Vzc19pbmZvLnNjcmlwdCB8fFxuICAgICAgICAgICAgICAgIHRoaXMuc2VjdXJlICYmICFhY2Nlc3NfaW5mby5zZWN1cmUgfHxcbiAgICAgICAgICAgICAgICAhdGhpcy5jb2xsaWRlc1dpdGgoYWNjZXNzX2luZm8pKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfTtcblxuICAgIENvb2tpZS5wcm90b3R5cGUuY29sbGlkZXNXaXRoID0gZnVuY3Rpb24gY29sbGlkZXNXaXRoKGFjY2Vzc19pbmZvKSB7XG4gICAgICAgIGlmICgodGhpcy5wYXRoICYmICFhY2Nlc3NfaW5mby5wYXRoKSB8fCAodGhpcy5kb21haW4gJiYgIWFjY2Vzc19pbmZvLmRvbWFpbikpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5wYXRoICYmIGFjY2Vzc19pbmZvLnBhdGguaW5kZXhPZih0aGlzLnBhdGgpICE9PSAwKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMuZXhwbGljaXRfcGF0aCAmJiBhY2Nlc3NfaW5mby5wYXRoLmluZGV4T2YoIHRoaXMucGF0aCApICE9PSAwKSB7XG4gICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgYWNjZXNzX2RvbWFpbiA9IGFjY2Vzc19pbmZvLmRvbWFpbiAmJiBhY2Nlc3NfaW5mby5kb21haW4ucmVwbGFjZSgvXltcXC5dLywnJyk7XG4gICAgICAgIHZhciBjb29raWVfZG9tYWluID0gdGhpcy5kb21haW4gJiYgdGhpcy5kb21haW4ucmVwbGFjZSgvXltcXC5dLywnJyk7XG4gICAgICAgIGlmIChjb29raWVfZG9tYWluID09PSBhY2Nlc3NfZG9tYWluKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY29va2llX2RvbWFpbikge1xuICAgICAgICAgICAgaWYgKCF0aGlzLmV4cGxpY2l0X2RvbWFpbikge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsgLy8gd2UgYWxyZWFkeSBjaGVja2VkIGlmIHRoZSBkb21haW5zIHdlcmUgZXhhY3RseSB0aGUgc2FtZVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHdpbGRjYXJkID0gYWNjZXNzX2RvbWFpbi5pbmRleE9mKGNvb2tpZV9kb21haW4pO1xuICAgICAgICAgICAgaWYgKHdpbGRjYXJkID09PSAtMSB8fCB3aWxkY2FyZCAhPT0gYWNjZXNzX2RvbWFpbi5sZW5ndGggLSBjb29raWVfZG9tYWluLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH07XG5cbiAgICBmdW5jdGlvbiBDb29raWVKYXIoKSB7XG4gICAgICAgIHZhciBjb29raWVzLCBjb29raWVzX2xpc3QsIGNvbGxpZGFibGVfY29va2llO1xuICAgICAgICBpZiAodGhpcyBpbnN0YW5jZW9mIENvb2tpZUphcikge1xuICAgICAgICAgICAgY29va2llcyA9IE9iamVjdC5jcmVhdGUobnVsbCk7IC8vbmFtZTogW0Nvb2tpZV1cblxuICAgICAgICAgICAgdGhpcy5zZXRDb29raWUgPSBmdW5jdGlvbiBzZXRDb29raWUoY29va2llLCByZXF1ZXN0X2RvbWFpbiwgcmVxdWVzdF9wYXRoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJlbW92ZSwgaTtcbiAgICAgICAgICAgICAgICBjb29raWUgPSBuZXcgQ29va2llKGNvb2tpZSwgcmVxdWVzdF9kb21haW4sIHJlcXVlc3RfcGF0aCk7XG4gICAgICAgICAgICAgICAgLy9EZWxldGUgdGhlIGNvb2tpZSBpZiB0aGUgc2V0IGlzIHBhc3QgdGhlIGN1cnJlbnQgdGltZVxuICAgICAgICAgICAgICAgIHJlbW92ZSA9IGNvb2tpZS5leHBpcmF0aW9uX2RhdGUgPD0gRGF0ZS5ub3coKTtcbiAgICAgICAgICAgICAgICBpZiAoY29va2llc1tjb29raWUubmFtZV0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICBjb29raWVzX2xpc3QgPSBjb29raWVzW2Nvb2tpZS5uYW1lXTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGNvb2tpZXNfbGlzdC5sZW5ndGg7IGkgKz0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29sbGlkYWJsZV9jb29raWUgPSBjb29raWVzX2xpc3RbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29sbGlkYWJsZV9jb29raWUuY29sbGlkZXNXaXRoKGNvb2tpZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVtb3ZlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tpZXNfbGlzdC5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb29raWVzX2xpc3QubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29va2llc1tjb29raWUubmFtZV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29raWVzX2xpc3RbaV0gPSBjb29raWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvb2tpZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAocmVtb3ZlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY29va2llc19saXN0LnB1c2goY29va2llKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvb2tpZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHJlbW92ZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvb2tpZXNbY29va2llLm5hbWVdID0gW2Nvb2tpZV07XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvb2tpZXNbY29va2llLm5hbWVdO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIC8vcmV0dXJucyBhIGNvb2tpZVxuICAgICAgICAgICAgdGhpcy5nZXRDb29raWUgPSBmdW5jdGlvbiBnZXRDb29raWUoY29va2llX25hbWUsIGFjY2Vzc19pbmZvKSB7XG4gICAgICAgICAgICAgICAgdmFyIGNvb2tpZSwgaTtcbiAgICAgICAgICAgICAgICBjb29raWVzX2xpc3QgPSBjb29raWVzW2Nvb2tpZV9uYW1lXTtcbiAgICAgICAgICAgICAgICBpZiAoIWNvb2tpZXNfbGlzdCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb29raWVzX2xpc3QubGVuZ3RoOyBpICs9IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgY29va2llID0gY29va2llc19saXN0W2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29va2llLmV4cGlyYXRpb25fZGF0ZSA8PSBEYXRlLm5vdygpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29va2llc19saXN0Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb29raWVzW2Nvb2tpZS5uYW1lXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZS5tYXRjaGVzKGFjY2Vzc19pbmZvKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvb2tpZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICAvL3JldHVybnMgYSBsaXN0IG9mIGNvb2tpZXNcbiAgICAgICAgICAgIHRoaXMuZ2V0Q29va2llcyA9IGZ1bmN0aW9uIGdldENvb2tpZXMoYWNjZXNzX2luZm8pIHtcbiAgICAgICAgICAgICAgICB2YXIgbWF0Y2hlcyA9IFtdLCBjb29raWVfbmFtZSwgY29va2llO1xuICAgICAgICAgICAgICAgIGZvciAoY29va2llX25hbWUgaW4gY29va2llcykge1xuICAgICAgICAgICAgICAgICAgICBjb29raWUgPSB0aGlzLmdldENvb2tpZShjb29raWVfbmFtZSwgYWNjZXNzX2luZm8pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29va2llKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXRjaGVzLnB1c2goY29va2llKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBtYXRjaGVzLnRvU3RyaW5nID0gZnVuY3Rpb24gdG9TdHJpbmcoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaGVzLmpvaW4oXCI6XCIpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgbWF0Y2hlcy50b1ZhbHVlU3RyaW5nID0gZnVuY3Rpb24gdG9WYWx1ZVN0cmluZygpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hdGNoZXMubWFwKGZ1bmN0aW9uIChjKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYy50b1ZhbHVlU3RyaW5nKCk7XG4gICAgICAgICAgICAgICAgICAgIH0pLmpvaW4oJzsnKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaGVzO1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ldyBDb29raWVKYXIoKTtcbiAgICB9XG4gICAgZXhwb3J0cy5Db29raWVKYXIgPSBDb29raWVKYXI7XG5cbiAgICAvL3JldHVybnMgbGlzdCBvZiBjb29raWVzIHRoYXQgd2VyZSBzZXQgY29ycmVjdGx5LiBDb29raWVzIHRoYXQgYXJlIGV4cGlyZWQgYW5kIHJlbW92ZWQgYXJlIG5vdCByZXR1cm5lZC5cbiAgICBDb29raWVKYXIucHJvdG90eXBlLnNldENvb2tpZXMgPSBmdW5jdGlvbiBzZXRDb29raWVzKGNvb2tpZXMsIHJlcXVlc3RfZG9tYWluLCByZXF1ZXN0X3BhdGgpIHtcbiAgICAgICAgY29va2llcyA9IEFycmF5LmlzQXJyYXkoY29va2llcykgP1xuICAgICAgICAgICAgICAgIGNvb2tpZXMgOlxuICAgICAgICAgICAgICAgIGNvb2tpZXMuc3BsaXQoY29va2llX3N0cl9zcGxpdHRlcik7XG4gICAgICAgIHZhciBzdWNjZXNzZnVsID0gW10sXG4gICAgICAgICAgICBpLFxuICAgICAgICAgICAgY29va2llO1xuICAgICAgICBjb29raWVzID0gY29va2llcy5tYXAoZnVuY3Rpb24oaXRlbSl7XG4gICAgICAgICAgICByZXR1cm4gbmV3IENvb2tpZShpdGVtLCByZXF1ZXN0X2RvbWFpbiwgcmVxdWVzdF9wYXRoKTtcbiAgICAgICAgfSk7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb29raWVzLmxlbmd0aDsgaSArPSAxKSB7XG4gICAgICAgICAgICBjb29raWUgPSBjb29raWVzW2ldO1xuICAgICAgICAgICAgaWYgKHRoaXMuc2V0Q29va2llKGNvb2tpZSwgcmVxdWVzdF9kb21haW4sIHJlcXVlc3RfcGF0aCkpIHtcbiAgICAgICAgICAgICAgICBzdWNjZXNzZnVsLnB1c2goY29va2llKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3VjY2Vzc2Z1bDtcbiAgICB9O1xufSgpKTtcbiIsIid1c2Ugc3RyaWN0JztcblxuXG52YXIgeWFtbCA9IHJlcXVpcmUoJy4vbGliL2pzLXlhbWwuanMnKTtcblxuXG5tb2R1b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sdF9zYWZlJyk7XG5cbnZhciBfdG9TdHJpbmcgICAgICAgPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nO1xudmFyIF9oYXNPd25Qcm9wZXJ0eSA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG5cbnZhciBDSEFSX1RBQiAgICAgICAgICAgICAgICAgID0gMHgwOTsgLyogVGFiICovXG52YXIgQ0hBUl9MSU5FX0ZFRUQgICAgICAgICAgICA9IDB4MEE7IC8qIExGICovXG52YXIgQ0hBUl9DQVJSSUFHRV9SRVRVUk4gICAgICA9IDB4MEQ7IC8qIENSICovXG52YXIgQ0hBUl9TUEFDRSAgICAgICAgICAgICAgICA9IDB4MjA7IC8qIFNwYWNlICovXG52YXIgQ0hBUl9FWENMQU1BVElPTiAgICAgICAgICA9IDB4MjE7IC8qICEgKi9cbnZhciBDSEFSX0RPVUJMRV9RVU9URSAgICAgICAgID0gMHgyMjsgLyogXCIgKi9cbnZhciBDSEFSX1NIQVJQICAgICAgICAgICAgICAgID0gMHgyMzsgLyogIyAqL1xudmFyIENIQVJfUEVSQ0VOVCAgICAgICAgICAgICAgPSAweDI1OyAvKiAlICovXG52YXIgQ0hBUl9BTVBFUlNBTkQgICAgICAgICAgICA9IDB4MjY7IC8qICYgKi9cbnZhciBDSEFSX1NJTkdMRV9RVU9URSAgICAgICAgID0gMHgyNzsgLyogJyAqL1xudmFyIENIQVJfQVNURVJJU0sgICAgICAgICAgICAgPSAweDJBOyAvKiAqICovXG52YXIgQ0hBUl9DT01NQSAgICAgICAgICAgICAgICA9IDB4MkM7IC8qICwgKi9cbnZhciBDSEFSX01JTlVTICAgICAgICAgICAgICAgID0gMHgyRDsgLyogLSAqL1xudmFyIENIQVJfQ09MT04gICAgICAgICAgICAgICAgPSAweDNBOyAvKiA6ICovXG52YXIgQ0hBUl9HUkVBVEVSX1RIQU4gICAgICAgICA9IDB4M0U7IC8qID4gKi9cbnZhciBDSEFSX1FVRVNUSU9OICAgIC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gLSAweDMwO1xuICB9XG5cbiAgcmV0dXJuIC0xO1xufVxuXG5mdW5jdGlvbiBzaW1wbGVFc2NhcGVTZXF1ZW5jZShjKSB7XG4gIHJldHVybiAoYyA9PT0gMHgzMC8qIDAgKi8pID8gJ1xceDAwJyA6XG4gICAgICAgIChjID09PSAweDYxLyogYSAqLykgPyAnXFx4MDcnIDpcbiAgICAgICAgKGMgPT09IDB4NjIvKiBiICovKSA/ICdcXHgwOCcgOlxuICAgICAgICAoYyA9PT0gMHg3NC8qIHQgKi8pID8gJ1xceDA5JyA6XG4gICAgICAgIChjID09PSAweDA5LyogVGFiICovKSA/ICdcXHgwOScgOlxuICAgICAgICAoYyA9PT0gMHg2RS8qIG4gKi8pID8gJ1xceDBBJyA6XG4gICAgICAgIChjID09PSAweDc2LyogdiAqLykgPyAnXFx4MEInIDpcbiAgICAgICAgKGMgPT09IDB4NjYvKiBmICovKSA/ICdcXHgwQycgOlxuICAgICAgICAoYyA9PT0gMHg3Mi8qIHIgKi8pID8gJ1xceDBEJyA6XG4gICAgICAgIChjID09PSAweDY1LyogZSAqLykgPyAnXFx4MUInIDpcbiAgICAgICAgKGMgPT09IDB4MjAvKiBTcGFjZSAqLykgPyAnICcgOlxuICAgICAgICAoYyA9PT0gMHgyMi8qIFwiICovKSA/ICdcXHgyMicgOlxuICAgICAgICAoYyA9PT0gMHgyRi8qIC8gKi8pID8gJy8nIDpcbiAgICAgICAgKGMgPT09IDB4NUMvKiBcXCAqLykgPyAnXFx4NUMnIDpcbiAgICAgICAgKGMgPT09IDB4NEUvKiBOICovKSA/ICdcXHg4NScgOlxuICAgICAgICAoYyA9PT0gMHg1Ri8qIF8gKi8pID8gJ1xceEEwJyA6XG4gICAgICAgIChjID09PSAweDRDLyogTCAqLykgPyAnXFx1MjAyOCcgOlxuICAgICAgICAoYyA9PT0gMHg1MC8qIFAgKi8pID8gJ1xcdTIwMjknIDogJyc7XG59XG5cbmZ1bmN0aW9uIGNoYXJGcm9tQ29kZXBv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WxzZSBpZiAoY291bnQgPiAxKSB7XG4gICAgc3RhdGUucmVzdWx0ICs9IGNvbW1vbi5yZXBlYXQoJ1xcbicsIGNvdW50IC0gMSk7XG4gIH1cbn1cblxuXG5mdW5jdGlvbiByZWFkUGxhaW5TY2FsYXIoc3RhdGUsIG5vZGVJbmRlbnQsIHdpdGhpbkZsb3dDb2xsZWN0aW9uKSB7XG4gIHZhciBwcmVjZWRpbmcsXG4gICAgICBmb2xsb3dpbmcsXG4gICAgICBjYXB0dXJlU3RhcnQsXG4gICAgICBjYXB0dXJlRW5kLFxuICAgICAgaGFzUGVuZGluZ0NvbnRlbnQsXG4gICAgICBfbGluZSxcbiAgICAgIF9saW5lU3RhcnQsXG4gICAgICBfbGluZUluZGVudCxcbiAgICAgIF9raW5kID0gc3RhdGUua2luZCxcbiAgICAgIF9yZXN1bHQgPSBzdGF0ZS5yZXN1bHQsXG4gICAgICBjaDtcblxuICBjaCA9IHN0YXRlLmlucHV0LmNoYXJDb2RlQXQoc3RhdGUucG9zaXRpb24pO1xuXG4gIGlmIChpc19XU19PUl9FT0woY2gpICAgICAgICAgICAgIHx8XG4gICAgICBpc19GTE9XX0lORElDQVRPUihjaCkgICAgICAgIHx8XG4gICAgICAweDIzLyogIyAqLyAgICAgICAgICAgPT09IGNoIHx8XG4gICAgICAweDI2LyogJiAqLyAgICAgICAgICAgPT09IGNoIHx8XG4gICAgICAweDJBLyogKiAqLyAgICAgICAgICAgPT09IGNoIHx8XG4gICAgICAweDIxLyogISAqLyAgICAgICAgICAgPT09IGNoIHx8XG4gICAgICAweDdDLyogfCAqLyAgICAgICAgICAgPT09IGNoIHx8XG4gICAgICAweDNFLyogPiAqLyAgICAgICAgICAgPT09IGNoIHx8XG4gICAgICAweDI3LyogJyAqLyAgICAgICAgICAgPT09IGNoIHx8XG4gICAgICAweDIyLyogXCIgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyNS8qICUgKi8gICAgICAgICAgID09PSBjaCB8fFxuIC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wiJ3VzZSBzdHJpY3QnO1xuXG52YXIgVHlwZSA9IHJlcXVpcmUoJy4uL3R5cGUnKTtcblxudmFyIFlBTUxfVElNRVNUQU1QX1JFR0VYUCA9IG5ldyBSZWdFeHAoXG4gICdeKFswLTldWzAtOV1bMC05XVswLTldKScgICAgICAgICAgKyAvLyBbMV0geWVhclxuICAnLShbMC05XVswLTldPyknICAgICAgICAgICAgICAgICAgICsgLy8gWzJdIG1vbnRoXG4gICctKFswLTldWzAtOV0/KScgICAgICAgICAgICAgICAgICAgKyAvLyBbM10gZGF5XG4gICcoPzooPzpbVHRdfFsgXFxcXHRdKyknICAgICAgICAgICAgICArIC8vIC4uLlxuICAnKFswLTldWzAtOV0/KScgICAgICAgICAgICAgICAgICAgICsgLy8gWzRdIGhvdXJcbiAgJzooWzAtOV1bMC05XSknICAgICAgICAgICAgICAgICAgICArIC8vIFs1XSBtaW51dGVcbiAgJzooWzAtOV1bMC05XSknICAgICAgICAgICAgICAgICAgICArIC8vIFs2XSBzZWNvbmRcbiAgJyg/OlxcXFwuKFswLTldKikpPycgICAgICAgICAgICAgICAgICsgLy8gWzddIGZyYWN0aW9uXG4gICcoPzpbIFxcXFx0XSooWnwoWy0rXSkoWzAtOV1bMC05XT8pJyArIC8vIFs4XSB0eiBbOV0gdHpfc2lnbiBbMTBdIHR6X2hvdXJcbiAgJyg/OjooWzAtOV1bMC05XSkpPykpPyk/JCcpOyAgICAgICAgIC8vIFsxMV0gdHpfbWludXRlXG5cbmZ1bmN0aW9uIHJlc29sdmVZYW1sVGltZXN0YW1wKGRhdGEpIHtcbiAgaWYgKG51bGwgPT09IGRhdGEpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICBpZiAoWUFNTF9USU1FU1RBTVBfUkVHRVhQLmV4ZWMoZGF0YSkgPT09IG51bGwpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICByZXR1cm4gdHJ1ZTtcbn1cblxuZnVuY3Rpb24gY29uc3RydW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ZhY3RvcnkpO1xuICAgIH0gZWxzZSBpZiAodHlwZW9mIGV4cG9ydHMgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIGZhY3RvcnkoZXhwb3J0cyk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgZmFjdG9yeSgocm9vdC5lc3ByaW1hID0ge30pKTtcbiAgICB9XG59KHRoaXMsIGZ1bmN0aW9uIChleHBvcnRzKSB7XG4gICAgJ3VzZSBzdHJpY3QnO1xuXG4gICAgdmFyIFRva2VuLFxuICAgICAgICBUb2tlbk5hbWUsXG4gICAgICAgIEZuRXhwclRva2VucyxcbiAgICAgICAgU3ludGF4LFxuICAgICAgICBQbGFjZUhvbGRlcnMsXG4gICAgICAgIE1lc3NhZ2VzLFxuICAgICAgICBSZWdleCxcbiAgICAgICAgc291cmNlLFxuICAgICAgICBzdHJpY3QsXG4gICAgICAgIGluZGV4LFxuICAgICAgICBsaW5lTnVtYmVyLFxuICAgICAgICBsaW5lU3RhcnQsXG4gICAgICAgIGhhc0xpbmVUZXJtaW5hdG9yLFxuICAgICAgICBsYXN0SW5kZXgsXG4gICAgICAgIGxhc3RMaW5lTnVtYmVyLFxuICAgICAgICBsYXN0TGluZVN0YXJ0LFxuICAgICAgICBzdGFydEluZGV4LFxuICAgICAgICBzdGFydExpbmVOdW1iZXIsXG4gICAgICAgIHN0YXJ0TGluZVN0YXJ0LFxuICAgICAgICBzY2FubmluZyxcbiAgICAgICAgbGVuZ3RoLFxuICAgICAgICBsb29rYWhlYWQsXG4gICAgICAgIHN0YXRlLFxuICAgICAgICBleHRyYSxcbiAgICAgICAgaXNCaW5kaW5nRWxlbWVudCxcbiAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0LFxuICAgICAgICBmaXJzdENvdmVySW5pdGlhbGl6ZWROYW1lRXJyb3I7XG5cbiAgICBUb2tlbiA9IHtcbiAgICAgICAgQm9vbGVhbkxpdGVyYWw6IDEsXG4gICAgICAgIEVPRjogMixcbiAgICAgICAgSW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vZicsICdpbnN0YW5jZW9mJywgJ25ldycsXG4gICAgICAgICAgICAgICAgICAgICdyZXR1cm4nLCAnY2FzZScsICdkZWxldGUnLCAndGhyb3cnLCAndm9pZCcsXG4gICAgICAgICAgICAgICAgICAgIC8vIGFzc2lnbm1lbnQgb3BlcmF0b3JzXG4gICAgICAgICAgICAgICAgICAgICc9JywgJys9JywgJy09JywgJyo9JywgJy89JywgJyU9JywgJzw8PScsICc+Pj0nLCAnPj4+PScsXG4gICAgICAgICAgICAgICAgICAgICcmPScsICd8PScsICdePScsICcsJyxcbiAgICAgICAgICAgICAgICAgICAgLy8gYmluYXJ5L3VuYXJ5IG9wZXJhdG9yc1xuICAgICAgICAgICAgICAgICAgICAnKycsICctJywgJyonLCAnLycsICclJywgJysrJywgJy0tJywgJzw8JywgJz4+JywgJz4+PicsICcmJyxcbiAgICAgICAgICAgICAgICAgICAgJ3wnLCAnXicsICchJywgJ34nLCAnJiYnLCAnfHwnLCAnPycsICc6JywgJz09PScsICc9PScsICc+PScsXG4gICAgICAgICAgICAgICAgICAgICc8PScsICc8JywgJz4nLCAnIT0nLCAnIT09J107XG5cbiAgICBTeW50YXggPSB7XG4gICAgICAgIEFzc2lnbm1lbnRFeHByZXNzaW9uOiAnQXNzaWdubWVudEV4cHJlc3Npb24nLFxuICAgICAgICBBc3NpZ25tZW50UGF0dGVybjogJ0Fzc2lnbm1lbnRQYXR0ZXJuJyxcbiAgICAgICAgQXJyYXlFeHByZXNzaW9uOiAnQXJyYXlFeHByZXNzaW9uJyxcbiAgICAgICAgQXJyYXlQYXR0ZXJuOiAnQXJyYXlQYXR0ZXJuJyxcbiAgICAgICAgQXJyb3dGdW5jdGlvbkV4cHJlc3Npb246ICdBcnJvd0Z1bmN0aW9uRXhwcmVzc2lvbicsXG4gICAgICAgIEJsb2NrU3RhdGVtZW50OiAnQmxvY2tTdGF0ZW1lbnQnLFxuICAgICAgICBCaW5hcnlFeHByZXNzaW9uOiAnQmluYXJ5RXhwcmVzc2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HVEQzgwLVxcdURDRkFcXHVERDQwLVxcdURENzRcXHVERTgwLVxcdURFOUNcXHVERUEwLVxcdURFRDBcXHVERjAwLVxcdURGMUZcXHVERjMwLVxcdURGNEFcXHVERjUwLVxcdURGNzVcXHVERjgwLVxcdURGOURcXHVERkEwLVxcdURGQzNcXHVERkM4LVxcdURGQ0ZcXHVERkQxLVxcdURGRDVdfFxcdUQ4MDFbXFx1REMwMC1cXHVEQzlEXFx1REQwMC1cXHVERDI3XFx1REQzMC1cXHVERDYzXFx1REUwMC1cXHVERjM2XFx1REY0MC1cXHVERjU1XFx1REY2MC1cXHVERjY3XXxcXHVEODAyW1xcdURDMDAtXFx1REMwNVxcdURDMDhcXHVEQzBBLVxcdURDMzVcXHVEQzM3XFx1REMzOFxcdURDM0NcXHVEQzNGLVxcdURDNTVcXHVEQzYwLVxcdURDNzZcXHVEQzgwLVxcdURDOUVcXHVERDAwLVxcdUREMTVcXHVERDIwLVxcdUREMzlcXHVERDgwLVxcdUREQjdcXHVEREJFXFx1RERCRlxcdURFMDBcXHVERTEwLVxcdURFMTNcXHVERTE1LVxcdURFMTdcXHVERTE5LVxcdURFMzNcXHVERTYwLVxcdURFN0NcXHVERTgwLVxcdURFOUNcXHVERUMwLVxcdURFQzdcXHVERUM5LVxcdURFRTRcXHVERjAwLVxcdURGMzVcXHVERjQwLVxcdURGNTVcXHVERjYwLVxcdURGNzJcXHVERjgwLVxcdURGOTFdfFxcdUQ4MDNbXFx1REMwMC1cXHVEQzQ4XXxcXHVEODA0W1xcdURDMDMtXFx1REMzN1xcdURDODMtXFx1RENBRlxcdURDRDAtXFx1RENFOFxcdUREMDMtXFx1REQyNlxcdURENTAtXFx1REQ3MlxcdURENzZcXHVERDgzLVxcdUREQjJcXHVEREMxLVxcdUREQzRcXHVERERBXFx1REUwMC1cXHVERTExXFx1REUxMy1cXHVERTJCXFx1REVCMC1cXHVERURFXFx1REYwNS1cXHVERjBDXFx1REYwRlxcdURGMTBcXHVERjEzLVxcd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x1REY2N118XFx1RDgwMltcXHVEQzAwLVxcdURDMDVcXHVEQzA4XFx1REMwQS1cXHVEQzM1XFx1REMzN1xcdURDMzhcXHVEQzNDXFx1REMzRi1cXHVEQzU1XFx1REM2MC1cXHVEQzc2XFx1REM4MC1cXHVEQzlFXFx1REQwMC1cXHVERDE1XFx1REQyMC1cXHVERDM5XFx1REQ4MC1cXHVEREI3XFx1RERCRVxcdUREQkZcXHVERTAwLVxcdURFMDNcXHVERTA1XFx1REUwNlxcdURFMEMtXFx1REUxM1xcdURFMTUtXFx1REUxN1xcdURFMTktXFx1REUzM1xcdURFMzgtXFx1REUzQVxcdURFM0ZcXHVERTYwLVxcdURFN0NcXHVERTgwLVxcdURFOUNcXHVERUMwLVxcdURFQzdcXHVERUM5LVxcdURFRTZcXHVERjAwLVxcdURGMzVcXHVERjQwLVxcdURGNTVcXHVERjYwLVxcdURGNzJcXHVERjgwLVxcdURGOTFdfFxcdUQ4MDNbXFx1REMwMC1cXHVEQzQ4XXxcXHVEODA0W1xcdURDMDAtXFx1REM0NlxcdURDNjYtXFx1REM2RlxcdURDN0YtXFx1RENCQVxcdURDRDAtXFx1RENFOFxcdURDRjAtXFx1RENGOVxcdUREMDAtXFx1REQzNFxcdUREMzYtXFx1REQzRlxcdURENTAtXFx1REQ3M1xcdURENzZcXHVERDgwLVxcdUREQzRcXHVEREQwLVxcdUREREFcXHVERTAwLVxcdURFMTFcXHVERTEzLVxcdURFMzdcXHVERUIwLVxcdURFRUFcXHVERUYwLVxcdURFRjlcXHVERjAxLVxcdURGMDNcXHVERjA1LVxcdURGMENcXHVERjBGXFx1REYxMFxcdURGMTMtXFx1REYyOFxcdURGMkEtXFx1REYzMFxcdURGMzJcXHVERjMzXFx1REYzNS1cXHVERjM5XFx1REYzQy1cXHVERjQ0XFx1REY0N1xcdURGNDhcXHVERjRCLVxcdURGNERcXHVERjU3XFx1REY1RC1cXHVERjYzXFx1REY2Ni1cXHVERjZDXFx1REY3MC1cXHVERjc0XXx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MzQ1NjcnLmluZGV4T2YoY2gpID49IDA7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gb2N0YWxUb0RlY2ltYWwoY2gpIHtcbiAgICAgICAgLy8gXFwwIGlzIG5vdCBvY3RhbCBlc2NhcGUgc2VxdWVuY2VcbiAgICAgICAgdmFyIG9jdGFsID0gKGNoICE9PSAnMCcpLCBjb2RlID0gJzAxMjM0NTY3Jy5pbmRleE9mKGNoKTtcblxuICAgICAgICBpZiAoaW5kZXggPCBsZW5ndGggJiYgaXNPY3RhbERpZ2l0KHNvdXJjZVtpbmRleF0pKSB7XG4gICAgICAgICAgICBvY3RhbCA9IHRydWU7XG4gICAgICAgICAgICBjb2RlID0gY29kZSAqIDggKyAnMDEyMzQ1NjcnLmluZGV4T2Yoc291cmNlW2luZGV4KytdKTtcblxuICAgICAgICAgICAgLy8gMyBkaWdpdHMgYXJlIG9ubHkgYWxsb3dlZCB3aGVuIHN0cmluZyBzdGFydHNcbiAgICAgICAgICAgIC8vIHdpdGggMCwgMSwgMiwgM1xuICAgICAgICAgICAgaWYgKCcwMTIzJy5pbmRleE9mKGNoKSA+PSAwICYmXG4gICAgICAgICAgICAgICAgICAgIGluZGV4IDwgbGVuZ3RoICYmXG4gICAgICAgICAgICAgICAgICAgIGlzT2N0YWxEaWdpdChzb3VyY2VbaW5kZXhdKSkge1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjb2RlICogOCArICcwMTIzNDU2NycuaW5kZXhPZihzb3VyY2VbaW5kZXgrK10pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGNvZGU6IGNvZGUsXG4gICAgICAgICAgICBvY3RhbDogb2N0YWxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICAvLyBFQ01BLTI2MiAxMS4yIFdoaXRlIFNwYWNlXG5cbiAgICBmdW5jdGlvbiBpc1doaXRlU3BhY2UoY2gpIHtcbiAgICAgICAgcmV0dXJuICh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fHwgIC8vICQgKGRvbGxhcikgYW5kIF8gKHVuZGVyc2NvcmUpXG4gICAgICAgICAgICAoY2ggPj0gMHg0MSAmJiBjaCA8PSAweDVBKSB8fCAgICAgICAgIC8vIEEuLlpcbiAgICAgICAgICAgIChjaCA+PSAweDYxICYmIGNoIDw9IDB4N0EpIHx8ICAgICAgICAgLy8gYS4uelxuICAgICAgICAgICAgKGNoID09PSAweDVDKSB8fCAgICAgICAgICAgICAgICAgICAgICAvLyBcXCAoYmFja3NsYXNoKVxuICAgICAgICAgICAgKChjaCA+PSAweDgwKSAmJiBSZWdleC5Ob25Bc2NpaUlkZW50aWZpZXJTdGFydC50ZXN0KGZyb21Db2RlUG9pbnQoY2gpKSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNJZGVudGlmaWVyUGFydChjaCkge1xuICAgICAgICByZXR1cm4gKGNoID09PSAweDI0KSB8fCAoY2ggPT09IDB4NUYpIHx8ICAvLyAkIChkb2xsYXIpIGFuZCBfICh1bmRlcnNjb3JlKVxuICAgICAgICAgICAgKGNoID49IDB4NDEgJiYgY2ggPD0gMHg1QSkgfHwgICAgICAgICAvLyBBLi5aXG4gICAgICAgICAgICAoY2ggPj0gMHg2MSAmJiBjaCA8PSAweDdBKSB8fCAgICAgICAgIC8vIGEuLnpcbiAgICAgICAgICAgIChjaCA+PSAweDMwICYmIGNoIDw9IDB4MzkpIHx8ICAgICAgICAgLy8gMC4uOVxuICAgICAgICAgICAgKGNoID09PSAweDVDKSB8fCAgICAgICAgICAgICAgICAgICAgICAvLyBcXCAoYmFja3NsYXNoKVxuICAgICAgICAgICAgKChjaCA+PSAweDgwKSAmJiBSZWdleC5Ob25Bc2NpaUlkZW50aWZpZXJQYXJ0LnRlc3QoZnJvbUNvZGVQb2ludChjaCkpKTtcbiAgICB9XG5cbiAgICAvLyBFQ01BLTI2MiAxMS42LjIuMiBGdXR1cmUgUmVzZXJ2ZWQgV29yZHNcblxuICAgIGZ1bmN0aW9uIGlzRnV0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ICAgICAgICAgIHJldHVybiAoaWQgPT09ICdpZicpIHx8IChpZCA9PT0gJ2luJykgfHwgKGlkID09PSAnZG8nKTtcbiAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgcmV0dXJuIChpZCA9PT0gJ3ZhcicpIHx8IChpZCA9PT0gJ2ZvcicpIHx8IChpZCA9PT0gJ25ldycpIHx8XG4gICAgICAgICAgICAgICAgKGlkID09PSAndHJ5JykgfHwgKGlkID09PSAnbGV0Jyk7XG4gICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgIHJldHVybiAoaWQgPT09ICd0aGlzJykgfHwgKGlkID09PSAnZWxzZScpIHx8IChpZCA9PT0gJ2Nhc2UnKSB8fFxuICAgICAgICAgICAgICAgIChpZCA9PT0gJ3ZvaWQnKSB8fCAoaWQgPT09ICd3aXRoJykgfHwgKGlkID09PSAnZW51bScpO1xuICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICByZXR1cm4gKGlkID09PSAnd2hpbGUnKSB8fCAoaWQgPT09ICdicmVhaycpIHx8IChpZCA9PT0gJ2NhdGNoJykgfHxcbiAgICAgICAgICAgICAgICAoaWQgPT09ICd0aHJvdycpIHx8IChpZCA9PT0gJ2NvbnN0JykgfHwgKGlkID09PSAneWllbGQnKSB8fFxuICAgICAgICAgICAgICAgIChpZCA9PT0gJ2NsYXNzJykgfHwgKGlkID09PSAnc3VwZXInKTtcbiAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgcmV0dXJuIChpZCA9PT0gJ3JldHVybicpIHx8IChpZCA9PT0gJ3R5cGVvZicpIHx8IChpZCA9PT0gJ2RlbGV0ZScpIHx8XG4gICAgICAgICAgICAgICAgKGlkID09PSAnc3dpdGNoJykgfHwgKGlkID09PSAnZXhwb3J0JykgfHwgKGlkID09PSAnaW1wb3J0Jyk7XG4gICAgICAgIGNhc2UgNzpcbiAgICAgICAgICAgIHJldHVybiAoaWQgPT09ICdkZWZhdWx0JykgfHwgKGlkID09PSAnZmluYWxseScpIHx8IChpZCA9PT0gJ2V4dGVuZHMnKTtcbiAgICAgICAgY2FzZSA4OlxuICAgICAgICAgICAgcmV0dXJuIChpZCA9PT0gJ2Z1bmN0aW9uJykgfHwgKGlkID09PSAnY29udGludWUnKSB8fCAoaWQgPT09ICdkZWJ1Z2dlcicpO1xuICAgICAgICBjYXNlIDEwOlxuICAgICAgICAgICAgcmV0dXJuIChpZCA9PT0gJ2luc3RhbmNlb2YnKTtcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIEVDTUEtMjYyIDExLjQgQ29tbWVudHNcblxuICAgIGZ1bmN0aW9uIGFkZENvbW1lbnQodHlwZSwgdmFsdWUsIHN0YXJ0LCBlbmQsIGxvYykge1xuICAgICAgICB2YXIgY29tbWVudDtcblxuICAgICAgICBhc3NlcnQodHlwZW9mIHN0YXJ0ID09PSAnbnVtYmVyJywgJ0NvbW1lbnQgbXVzdCBoYXZlIHZhbGlkIHBvc2l0aW9uJyk7XG5cbiAgICAgICAgc3RhdGUubGFzdENvbW1lbnRTdGFydCA9IHN0YXJ0O1xuXG4gICAgICAgIGNvbW1lbnQgPSB7XG4gICAgICAgICAgICB0eXBlOiB0eXBlLFxuICAgICAgICAgICAgdmFsdWU6IHZhbHVlXG4gICAgICAgIH07XG4gICAgICAgIGlmIChleHRyYS5yYW5nZSkge1xuICAgICAgICAgICAgY29tbWVudC5yYW5nZSA9IFtzdGFydCwgZW5kXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZXh0cmEubG9jKSB7XG4gICAgICAgICAgICBjb21tZW50LmxvYyA9IGxvYztcbiAgICAgICAgfVxuICAgICAgICBleHRyYS5jb21tZW50cy5wdXNoKGNvbW1lbnQpO1xuICAgICAgICBpZiAoZXh0cmEuYXR0YWNoQ29tbWVudCkge1xuICAgICAgICAgICAgZXh0cmEubGVhZGluZ0NvbW1lbnRzLnB1c2goY29tbWVudCk7XG4gICAgICAgICAgICBleHRyYS50cmFpbGluZ0NvbW1lbnRzLnB1c2goY29tbWVudCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGV4dHJhLnRva2VuaXplKSB7XG4gICAgICAgICAgICBjb21tZW50LnR5cGUgPSBjb21tZW50LnR5cGUgKyAnQ29tbWVudCc7XG4gICAgICAgICAgICBpZiAoZXh0cmEuZGVsZWdhdGUpIHtcbiAgICAgICAgICAgICAgICBjb21tZW50ID0gZXh0cmEuZGVsZWdhdGUoY29tbWVudCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBleHRyYS50b2tlbnMucHVzaChjb21tZW50KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNraXBTaW5nbGVMaW5lQ29tbWVudChvZmZzZXQpIHtcbiAgICAgICAgdmFyIHN0YXJ0LCBsb2MsIGNoLCBjb21tZW50O1xuXG4gICAgICAgIHN0YXJ0ID0gaW5kZXggLSBvZmZzZXQ7XG4gICAgICAgIGxvYyA9IHtcbiAgICAgICAgICAgIHN0YXJ0OiB7XG4gICAgICAgICAgICAgICAgbGluZTogbGluZU51bWJlcixcbiAgICAgICAgICAgICAgICBjb2x1bW46IGluZGV4IC0gbGluZVN0YXJ0IC0gb2Zmc2V0XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBjaCA9IHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KTtcbiAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICBpZiAoaXNMaW5lVGVybWluYXRvcihjaCkpIHtcbiAgICAgICAgICAgICAgICBoYXNMaW5lVGVybWluYXRvciA9IHRydWU7XG4gICAgICAgICAgICAgICAgaWYgKGV4dHJhLmNvbW1lbnRzKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1lbnQgPSBzb3VyY2Uuc2xpY2Uoc3RhcnQgKyBvZmZzZXQsIGluZGV4IC0gMSk7XG4gICAgICAgICAgICAgICAgICAgIGxvYy5lbmQgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uOiBpbmRleCAtIGxpbmVTdGFydCAtIDFcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgYWRkQ29tbWVudCgnTGluZScsIGNvbW1lbnQsIHN0YXJ0LCBpbmRleCAtIDEsIGxvYyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gMTMgJiYgc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpID09PSAxMCkge1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICArK2xpbmVOdW1iZXI7XG4gICAgICAgICAgICAgICAgbGluZVN0YXJ0ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGV4dHJhLmNvbW1lbnRzKSB7XG4gICAgICAgICAgICBjb21tZW50ID0gc291cmNlLnNsaWNlKHN0YXJ0ICsgb2Zmc2V0LCBpbmRleCk7XG4gICAgICAgICAgICBsb2MuZW5kID0ge1xuICAgICAgICAgICAgICAgIGxpbmU6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgY29sdW1uOiBpbmRleCAtIGxpbmVTdGFydFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFkZENvbW1lbnQoJ0xpbmUnLCBjb21tZW50LCBzdGFydCwgaW5kZXgsIGxvYyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBza2lwTXVsdGlMaW5lQ29tbWVudCgpIHtcbiAgICAgICAgdmFyIHN0YXJ0LCBsb2MsIGNoLCBjb21tZW50O1xuXG4gICAgICAgIGlmIChleHRyYS5jb21tZW50cykge1xuICAgICAgICAgICAgc3RhcnQgPSBpbmRleCAtIDI7XG4gICAgICAgICAgICBsb2MgPSB7XG4gICAgICAgICAgICAgICAgc3RhcnQ6IHtcbiAgICAgICAgICAgICAgICAgICAgbGluZTogbGluZU51bWJlcixcbiAgICAgICAgICAgICAgICAgICAgY29sdW1uOiBpbmRleCAtIGxpbmVTdGFydCAtIDJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBjaCA9IHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KTtcbiAgICAgICAgICAgIGlmIChpc0xpbmVUZXJtaW5hdG9yKGNoKSkge1xuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gMHgwRCAmJiBzb3VyY2UuY2hhckNvZGVBdChpbmRleCArIDEpID09PSAweDBBKSB7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGhhc0xpbmVUZXJtaW5hdG9yID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICArK2xpbmVOdW1iZXI7XG4gICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICBsaW5lU3RhcnQgPSBpbmRleDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT09IDB4MkEpIHtcbiAgICAgICAgICAgICAgICAvLyBCbG9jayBjb21tZW50IGVuZHMgd2l0aCAnKi8nLlxuICAgICAgICAgICAgICAgIGlmIChzb3VyY2UuY2hhckNvZGVBdChpbmRleCArIDEpID09PSAweDJGKSB7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIGlmIChleHRyYS5jb21tZW50cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29tbWVudCA9IHNvdXJjZS5zbGljZShzdGFydCArIDIsIGluZGV4IC0gMik7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2MuZW5kID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmU6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uOiBpbmRleCAtIGxpbmVTdGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZENvbW1lbnQoJ0Jsb2NrJywgY29tbWVudCwgc3RhcnQsIGluZGV4LCBsb2MpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFJhbiBvZmYgdGhlIGVuZCBvZiB0aGUgZmlsZSAtIHRoZSB3aG9sZSB0aGluZyBpcyBhIGNvbW1lbnRcbiAgICAgICAgaWYgKGV4dHJhLmNvbW1lbnRzKSB7XG4gICAgICAgICAgICBsb2MuZW5kID0ge1xuICAgICAgICAgICAgICAgIGxpbmU6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgY29sdW1uOiBpbmRleCAtIGxpbmVTdGFydFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGNvbW1lbnQgPSBzb3VyY2Uuc2xpY2Uoc3RhcnQgKyAyLCBpbmRleCk7XG4gICAgICAgICAgICBhZGRDb21tZW50KCdCbG9jaycsIGNvbW1lbnQsIHN0YXJ0LCBpbmRleCwgbG9jKTtcbiAgICAgICAgfVxuICAgICAgICB0b2xlcmF0ZVVuZXhwZWN0ZWRUb2tlbigpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNraXBDb21tZW50KCkge1xuICAgICAgICB2YXIgY2gsIHN0YXJ0O1xuICAgICAgICBoYXNMaW5lVGVybWluYXRvciA9IGZhbHNlO1xuXG4gICAgICAgIHN0YXJ0ID0gKGluZGV4ID09PSAwKTtcbiAgICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBjaCA9IHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KTtcblxuICAgICAgICAgICAgaWYgKGlzV2hpdGVTcGFjZShjaCkpIHtcbiAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgfSBlbHNlIGlmIChpc0xpbmVUZXJtaW5hdG9yKGNoKSkge1xuICAgICAgICAgICAgICAgIGhhc0xpbmVUZXJtaW5hdG9yID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gMHgwRCAmJiBzb3VyY2UuY2hhckNvZGVBdChpbmRleCkgPT09IDB4MEEpIHtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgKytsaW5lTnVtYmVyO1xuICAgICAgICAgICAgICAgIGxpbmVTdGFydCA9IGluZGV4O1xuICAgICAgICAgICAgICAgIHN0YXJ0ID0gdHJ1ZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT09IDB4MkYpIHsgLy8gVSswMDJGIGlzICcvJ1xuICAgICAgICAgICAgICAgIGNoID0gc291cmNlLmNoYXJDb2RlQXQoaW5kZXggKyAxKTtcbiAgICAgICAgICAgICAgICBpZiAoY2ggPT09IDB4MkYpIHtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgc2tpcFNpbmdsZUxpbmVDb21tZW50KDIpO1xuICAgICAgICAgICAgICAgICAgICBzdGFydCA9IHRydWU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PT0gMHgyQSkgeyAgLy8gVSswMDJBIGlzICcqJ1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICBza2lwTXVsdGlMaW5lQ29tbWVudCgpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RhcnQgJiYgY2ggPT09IDB4MkQpIHsgLy8gVSswMDJEIGlzICctJ1xuICAgICAgICAgICAgICAgIC8vIFUrMDAzRSBpcyAnPidcbiAgICAgICAgICAgICAgICBpZiAoKHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4ICsgMSkgPT09IDB4MkQpICYmIChzb3VyY2UuY2hhckNvZGVBdChpbmRleCArIDIpID09PSAweDNFKSkge1xuICAgICAgICAgICAgICAgICAgICAvLyAnLS0+JyBpcyBhIHNpbmdsZS1saW5lIGNvbW1lbnRcbiAgICAgICAgICAgICAgICAgICAgaW5kZXggKz0gMztcbiAgICAgICAgICAgICAgICAgICAgc2tpcFNpbmdsZUxpbmVDb21tZW50KDMpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT09IDB4M0MpIHsgLy8gVSswMDNDIGlzICc8J1xuICAgICAgICAgICAgICAgIGlmIChzb3VyY2Uuc2xpY2UoaW5kZXggKyAxLCBpbmRleCArIDQpID09PSAnIS0tJykge1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4OyAvLyBgPGBcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDsgLy8gYCFgXG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7IC8vIGAtYFxuICAgICAgICAgICAgICAgICAgICArK2luZGV4OyAvLyBgLWBcbiAgICAgICAgICAgICAgICAgICAgc2tpcFNpbmdsZUxpbmVDb21tZW50KDQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzY2FuSGV4RXNjYXBlKHByZWZpeCkge1xuICAgICAgICB2YXIgaSwgbGVuLCBjaCwgY29kZSA9IDA7XG5cbiAgICAgICAgbGVuID0gKHByZWZpeCA9PT0gJ3UnKSA/IDQgOiAyO1xuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuOyArK2kpIHtcbiAgICAgICAgICAgIGlmIChpbmRleCA8IGxlbmd0aCAmJiBpc0hleERpZ2l0KHNvdXJjZVtpbmRleF0pKSB7XG4gICAgICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgICAgICAgICAgY29kZSA9IGNvZGUgKiAxNiArICcwMTIzNDU2Nzg5YWJjZGVmJy5pbmRleE9mKGNoLnRvTG93ZXJDYXNlKCkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFN0cmluZy5mcm9tQ2hhckNvZGUoY29kZSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2NhblVuaWNvZGVDb2RlUG9pbnRFc2NhcGUoKSB7XG4gICAgICAgIHZhciBjaCwgY29kZTtcblxuICAgICAgICBjaCA9IHNvdXJjZVtpbmRleF07XG4gICAgICAgIGNvZGUgPSAwO1xuXG4gICAgICAgIC8vIEF0IGxlYXN0LCBvbmUgaGV4IGRpZ2l0IGlzIHJlcXVpcmVkLlxuICAgICAgICBpZiAoY2ggPT09ICd9Jykge1xuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgICAgICBpZiAoIWlzSGV4RGlnaXQoY2gpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb2RlID0gY29kZSAqIDE2ICsgJzAxMjM0NTY3ODlhYmNkZWYnLmluZGV4T2YoY2gudG9Mb3dlckNhc2UoKSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY29kZSA+IDB4MTBGRkZGIHx8IGNoICE9PSAnfScpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZnJvbUNvZGVQb2ludChjb2RlKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjb2RlUG9pbnRBdChpKSB7XG4gICAgICAgIHZhciBjcCwgZmlyc3QsIHNlY29uZDtcblxuICAgICAgICBjcCA9IHNvdXJjZS5jaGFyQ29kZUF0KGkpO1xuICAgICAgICBpZiAoY3AgPj0gMHhEODAwICYmIGNwIDw9IDB4REJGRikge1xuICAgICAgICAgICAgc2Vjb25kID0gc291cmNlLmNoYXJDb2RlQXQoaSArIDEpO1xuICAgICAgICAgICAgaWYgKHNlY29uZCA+PSAweERDMDAgJiYgc2Vjb25kIDw9IDB4REZGRikge1xuICAgICAgICAgICAgICAgIGZpcnN0ID0gY3A7XG4gICAgICAgICAgICAgICAgY3AgPSAoZmlyc3QgLSAweEQ4MDApICogMHg0MDAgKyBzZWNvbmQgLSAweERDMDAgKyAweDEwMDAwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGNwO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldENvbXBsZXhJZGVudGlmaWVyKCkge1xuICAgICAgICB2YXIgY3AsIGNoLCBpZDtcblxuICAgICAgICBjcCA9IGNvZGVQb2ludEF0KGluZGV4KTtcbiAgICAgICAgaWQgPSBmcm9tQ29kZVBvaW50KGNwKTtcbiAgICAgICAgaW5kZXggKz0gaWQubGVuZ3RoO1xuXG4gICAgICAgIC8vICdcXHUnIChVKzAwNUMsIFUrMDA3NSkgZGVub3RlcyBhbiBlc2NhcGVkIGNoYXJhY3Rlci5cbiAgICAgICAgaWYgKGNwID09PSAweDVDKSB7XG4gICAgICAgICAgICBpZiAoc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpICE9PSAweDc1KSB7XG4gICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICBpZiAoc291cmNlW2luZGV4XSA9PT0gJ3snKSB7XG4gICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICBjaCA9IHNjYW5Vbmljb2RlQ29kZVBvaW50RXNjYXBlKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNoID0gc2NhbkhleEVzY2FwZSgndScpO1xuICAgICAgICAgICAgICAgIGNwID0gY2guY2hhckNvZGVBdCgwKTtcbiAgICAgICAgICAgICAgICBpZiAoIWNoIHx8IGNoID09PSAnXFxcXCcgfHwgIWlzSWRlbnRpZmllclN0YXJ0KGNwKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlkID0gY2g7XG4gICAgICAgIH1cblxuICAgICAgICB3aGlsZSAoaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGNwID0gY29kZVBvaW50QXQoaW5kZXgpO1xuICAgICAgICAgICAgaWYgKCFpc0lkZW50aWZpZXJQYXJ0KGNwKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2ggPSBmcm9tQ29kZVBvaW50KGNwKTtcbiAgICAgICAgICAgIGlkICs9IGNoO1xuICAgICAgICAgICAgaW5kZXggKz0gY2gubGVuZ3RoO1xuXG4gICAgICAgICAgICAvLyAnXFx1JyAoVSswMDVDLCBVKzAwNzUpIGRlbm90ZXMgYW4gZXNjYXBlZCBjaGFyYWN0ZXIuXG4gICAgICAgICAgICBpZiAoY3AgPT09IDB4NUMpIHtcbiAgICAgICAgICAgICAgICBpZCA9IGlkLnN1YnN0cigwLCBpZC5sZW5ndGggLSAxKTtcbiAgICAgICAgICAgICAgICBpZiAoc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpICE9PSAweDc1KSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgaWYgKHNvdXJjZVtpbmRleF0gPT09ICd7Jykge1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICBjaCA9IHNjYW5Vbmljb2RlQ29kZVBvaW50RXNjYXBlKCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY2ggPSBzY2FuSGV4RXNjYXBlKCd1Jyk7XG4gICAgICAgICAgICAgICAgICAgIGNwID0gY2guY2hhckNvZGVBdCgwKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFjaCB8fCBjaCA9PT0gJ1xcXFwnIHx8ICFpc0lkZW50aWZpZXJQYXJ0KGNwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZCArPSBjaDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBpZDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRJZGVudGlmaWVyKCkge1xuICAgICAgICB2YXIgc3RhcnQsIGNoO1xuXG4gICAgICAgIHN0YXJ0ID0gaW5kZXgrKztcbiAgICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBjaCA9IHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KTtcbiAgICAgICAgICAgIGlmIChjaCA9PT0gMHg1Qykge1xuICAgICAgICAgICAgICAgIC8vIEJsYWNrc2xhc2ggKFUrMDA1QykgbWFya3MgVW5pY29kZSBlc2NhcGUgc2VxdWVuY2UuXG4gICAgICAgICAgICAgICAgaW5kZXggPSBzdGFydDtcbiAgICAgICAgICAgICAgICByZXR1cm4gZ2V0Q29tcGxleElkZW50aWZpZXIoKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPj0gMHhEODAwICYmIGNoIDwgMHhERkZGKSB7XG4gICAgICAgICAgICAgICAgLy8gTmVlZCB0byBoYW5kbGUgc3Vycm9nYXRlIHBhaXJzLlxuICAgICAgICAgICAgICAgIGluZGV4ID0gc3RhcnQ7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGdldENvbXBsZXhJZGVudGlmaWVyKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNJZGVudGlmaWVyUGFydChjaCkpIHtcbiAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBzb3VyY2Uuc2xpY2Uoc3RhcnQsIGluZGV4KTtcbiAgICB9XG5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dW1iZXIsXG4gICAgICAgICAgICBsaW5lU3RhcnQ6IGxpbmVTdGFydCxcbiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCxcbiAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgfTtcbiAgICB9XG5cblxuICAgIC8vIEVDTUEtMjYyIDExLjcgUHVuY3R1YXRvcnNcblxuICAgIGZ1bmN0aW9uIHNjYW5QdW5jdHVhdG9yKCkge1xuICAgICAgICB2YXIgdG9rZW4sIHN0cjtcblxuICAgICAgICB0b2tlbiA9IHtcbiAgICAgICAgICAgIHR5cGU6IFRva2VuLlB1bmN0dWF0b3IsXG4gICAgICAgICAgICB2YWx1ZTogJycsXG4gICAgICAgICAgICBsaW5lTnVtYmVyOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgbGluZVN0YXJ0OiBsaW5lU3RhcnQsXG4gICAgICAgICAgICBzdGFydDogaW5kZXgsXG4gICAgICAgICAgICBlbmQ6IGluZGV4XG4gICAgICAgIH07XG5cbiAgICAgICAgLy8gQ2hlY2sgZm9yIG1vc3QgY29tbW9uIHNpbmdsZS1jaGFyYWN0ZXIgcHVuY3R1YXRvcnMuXG4gICAgICAgIHN0ciA9IHNvdXJjZVtpbmRleF07XG4gICAgICAgIHN3aXRjaCAoc3RyKSB7XG5cbiAgICAgICAgY2FzZSAnKCc6XG4gICAgICAgICAgICBpZiAoZXh0cmEudG9rZW5pemUpIHtcbiAgICAgICAgICAgICAgICBleHRyYS5vcGVuUGFyZW5Ub2tlbiA9IGV4dHJhLnRva2VuVmFsdWVzLmxlbmd0aDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICd7JzpcbiAgICAgICAgICAgIGlmIChleHRyYS50b2tlbml6ZSkge1xuICAgICAgICAgICAgICAgIGV4dHJhLm9wZW5DdXJseVRva2VuID0gZXh0cmEudG9rZW5WYWx1ZXMubGVuZ3RoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc3RhdGUuY3VybHlTdGFjay5wdXNoKCd7Jyk7XG4gICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnLic6XG4gICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgaWYgKHNvdXJjZVtpbmRleF0gPT09ICcuJyAmJiBzb3VyY2VbaW5kZXggKyAxXSA9PT0gJy4nKSB7XG4gICAgICAgICAgICAgICAgLy8gU3ByZWFkIG9wZXJhdG9yOiAuLi5cbiAgICAgICAgICAgICAgICBpbmRleCArPSAyO1xuICAgICAgICAgICAgICAgIHN0ciA9ICcuLi4nO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnfSc6XG4gICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgc3RhdGUuY3VybHlTdGFjay5wb3AoKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlICcpJzpcbiAgICAgICAgY2FzZSAnOyc6XG4gICAgICAgIGNhc2UgJywnOlxuICAgICAgICBjYXNlICdbJzpcbiAgICAgICAgY2FzZSAnXSc6XG4gICAgICAgIGNhc2UgJzonOlxuICAgICAgICBjYXNlICc/JzpcbiAgICAgICAgY2FzZSAnfic6XG4gICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIC8vIDQtY2hhcmFjdGVyIHB1bmN0dWF0b3IuXG4gICAgICAgICAgICBzdHIgPSBzb3VyY2Uuc3Vic3RyKGluZGV4LCA0KTtcbiAgICAgICAgICAgIGlmIChzdHIgPT09ICc+Pj49Jykge1xuICAgICAgICAgICAgICAgIGluZGV4ICs9IDQ7XG4gICAgICAgICAgICB9IGVsc2Uge1xuXG4gICAgICAgICAgICAgICAgLy8gMy1jaGFyYWN0ZXIgcHVuY3R1YXRvcnMuXG4gICAgICAgICAgICAgICAgc3RyID0gc3RyLnN1YnN0cigwLCAzKTtcbiAgICAgICAgICAgICAgICBpZiAoc3RyID09PSAnPT09JyB8fCBzdHIgPT09ICchPT0nIHx8IHN0ciA9PT0gJz4+PicgfHxcbiAgICAgICAgICAgICAgICAgICAgc3RyID09PSAnPDw9JyB8fCBzdHIgPT09ICc+Pj0nKSB7XG4gICAgICAgICAgICAgICAgICAgIGluZGV4ICs9IDM7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcblxuICAgICAgICAgICAgICAgICAgICAvLyAyLWNoYXJhY3RlciBwdW5jdHVhdG9ycy5cbiAgICAgICAgICAgICAgICAgICAgc3RyID0gc3RyLnN1YnN0cigwLCAyKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0ciA9PT0gJyYmJyB8fCBzdHIgPT09ICd8fCcgfHwgc3RyID09PSAnPT0nIHx8IHN0ciA9PT0gJyE9JyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyID09PSAnKz0nIHx8IHN0ciA9PT0gJy09JyB8fCBzdHIgPT09ICcqPScgfHwgc3RyID09PSAnLz0nIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHIgPT09ICcrKycgfHwgc3RyID09PSAnLS0nIHx8IHN0ciA9PT0gJzw8JyB8fCBzdHIgPT09ICc+PicgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciA9PT0gJyY9JyB8fCBzdHIgPT09ICd8PScgfHwgc3RyID09PSAnXj0nIHx8IHN0ciA9PT0gJyU9JyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyID09PSAnPD0nIHx8IHN0ciA9PT0gJz49JyB8fCBzdHIgPT09ICc9PicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4ICs9IDI7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEtY2hhcmFjdGVyIHB1bmN0dWF0b3JzLlxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgnPD49ISstKiUmfF4vJy5pbmRleE9mKHN0cikgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaW5kZXggPT09IHRva2VuLnN0YXJ0KSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgdG9rZW4uZW5kID0gaW5kZXg7XG4gICAgICAgIHRva2VuLnZhbHVlID0gc3RyO1xuICAgICAgICByZXR1cm4gdG9rZW47XG4gICAgfVxuXG4gICAgLy8gRUNNQS0yNjIgMTEuOC4zIE51bWVyaWMgTGl0ZXJhbHNcblxuICAgIGZ1bmN0aW9uIHNjYW5IZXhMaXRlcmFsKHN0YXJ0KSB7XG4gICAgICAgIHZhciBudW1iZXIgPSAnJztcblxuICAgICAgICB3aGlsZSAoaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGlmICghaXNIZXhEaWdpdChzb3VyY2VbaW5kZXhdKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbnVtYmVyICs9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChudW1iZXIubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzSWRlbnRpZmllclN0YXJ0KHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSkpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdHlwZTogVG9rZW4uTnVtZXJpY0xpdGVyYWwsXG4gICAgICAgICAgICB2YWx1ZTogcGFyc2VJbnQoJzB4JyArIG51bWJlciwgMTYpLFxuICAgICAgICAgICAgbGluZU51bWJlcjogbGluZU51bWJlcixcbiAgICAgICAgICAgIGxpbmVTdGFydDogbGluZVN0YXJ0LFxuICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LFxuICAgICAgICAgICAgZW5kOiBpbmRleFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNjYW5CaW5hcnlMaXRlcmFsKHN0YXJ0KSB7XG4gICAgICAgIHZhciBjaCwgbnVtYmVyO1xuXG4gICAgICAgIG51bWJlciA9ICcnO1xuXG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXhdO1xuICAgICAgICAgICAgaWYgKGNoICE9PSAnMCcgJiYgY2ggIT09ICcxJykge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbnVtYmVyICs9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChudW1iZXIubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAvLyBvbmx5IDBiIG9yIDBCXG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBjaCA9IHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KTtcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICAgICAgICBpZiAoaXNJZGVudGlmaWVyU3RhcnQoY2gpIHx8IGlzRGVjaW1hbERpZ2l0KGNoKSkge1xuICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdHlwZTogVG9rZW4uTnVtZXJpY0xpdGVyYWwsXG4gICAgICAgICAgICB2YWx1ZTogcGFyc2VJbnQobnVtYmVyLCAyKSxcbiAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICBsaW5lU3RhcnQ6IGxpbmVTdGFydCxcbiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCxcbiAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzY2FuT2N0YWxMaXRlcmFsKHByZWZpeCwgc3RhcnQpIHtcbiAgICAgICAgdmFyIG51bWJlciwgb2N0YWw7XG5cbiAgICAgICAgaWYgKGlzT2N0YWxEaWdpdChwcmVmaXgpKSB7XG4gICAgICAgICAgICBvY3RhbCA9IHRydWU7XG4gICAgICAgICAgICBudW1iZXIgPSAnMCcgKyBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvY3RhbCA9IGZhbHNlO1xuICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIG51bWJlciA9ICcnO1xuICAgICAgICB9XG5cbiAgICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoIWlzT2N0YWxEaWdpdChzb3VyY2VbaW5kZXhdKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbnVtYmVyICs9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghb2N0YWwgJiYgbnVtYmVyLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgLy8gb25seSAwbyBvciAwT1xuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpc0lkZW50aWZpZXJTdGFydChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkpIHx8IGlzRGVjaW1hbERpZ2l0KHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSkpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdHlwZTogVG9rZW4uTnVtZXJpY0xpdGVyYWwsXG4gICAgICAgICAgICB2YWx1ZTogcGFyc2VJbnQobnVtYmVyLCA4KSxcbiAgICAgICAgICAgIG9jdGFsOiBvY3RhbCxcbiAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICBsaW5lU3RhcnQ6IGxpbmVTdGFydCxcbiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCxcbiAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBpc0ltcGxpY2l0T2N0YWxMaXRlcmFsKCkge1xuICAgICAgICB2YXIgaSwgY2g7XG5cbiAgICAgICAgLy8gSW1wbGljaXQgb2N0YWwsIHVubGVzcyB0aGVyZSBpcyBhIG5vbi1vY3RhbCBkaWdpdC5cbiAgICAgICAgLy8gKEFubmV4IEIuMS4xIG9uIE51bWVyaWMgTGl0ZXJhbHMpXG4gICAgICAgIGZvciAoaSA9IGluZGV4ICsgMTsgaSA8IGxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICBjaCA9IHNvdXJjZVtpXTtcbiAgICAgICAgICAgIGlmIChjaCA9PT0gJzgnIHx8IGNoID09PSAnOScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWlzT2N0YWxEaWdpdChjaCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNjYW5OdW1lcmljTGl0ZXJhbCgpIHtcbiAgICAgICAgdmFyIG51bWJlciwgc3RhcnQsIGNoO1xuXG4gICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgYXNzZXJ0KGlzRGVjaW1hbERpZ2l0KGNoLmNoYXJDb2RlQXQoMCkpIHx8IChjaCA9PT0gJy4nKSxcbiAgICAgICAgICAgICdOdW1lcmljIGxpdGVyYWwgbXVzdCBzdGFydCB3aXRoIGEgZGVjaW1hbCBkaWdpdCBvciBhIGRlY2ltYWwgcG9pbnQnKTtcblxuICAgICAgICBzdGFydCA9IGluZGV4O1xuICAgICAgICBudW1iZXIgPSAnJztcbiAgICAgICAgaWYgKGNoICE9PSAnLicpIHtcbiAgICAgICAgICAgIG51bWJlciA9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcblxuICAgICAgICAgICAgLy8gSGV4IG51bWJlciBzdGFydHMgd2l0aCAnMHgnLlxuICAgICAgICAgICAgLy8gT2N0YWwgbnVtYmVyIHN0YXJ0cyB3aXRoICcwJy5cbiAgICAgICAgICAgIC8vIE9jdGFsIG51bWJlciBpbiBFUzYgc3RhcnRzIHdpdGggJzBvJy5cbiAgICAgICAgICAgIC8vIEJpbmFyeSBudW1iZXIgaW4gRVM2IHN0YXJ0cyB3aXRoICcwYicuXG4gICAgICAgICAgICBpZiAobnVtYmVyID09PSAnMCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd4JyB8fCBjaCA9PT0gJ1gnKSB7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzY2FuSGV4TGl0ZXJhbChzdGFydCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ2InIHx8IGNoID09PSAnQicpIHtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjYW5CaW5hcnlMaXRlcmFsKHN0YXJ0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGNoID09PSAnbycgfHwgY2ggPT09ICdPJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2Nhbk9jdGFsTGl0ZXJhbChjaCwgc3RhcnQpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChpc09jdGFsRGlnaXQoY2gpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc0ltcGxpY2l0T2N0YWxMaXRlcmFsKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzY2FuT2N0YWxMaXRlcmFsKGNoLCBzdGFydCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHdoaWxlIChpc0RlY2ltYWxEaWdpdChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkpKSB7XG4gICAgICAgICAgICAgICAgbnVtYmVyICs9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjaCA9PT0gJy4nKSB7XG4gICAgICAgICAgICBudW1iZXIgKz0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgd2hpbGUgKGlzRGVjaW1hbERpZ2l0KHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSkpIHtcbiAgICAgICAgICAgICAgICBudW1iZXIgKz0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXhdO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNoID09PSAnZScgfHwgY2ggPT09ICdFJykge1xuICAgICAgICAgICAgbnVtYmVyICs9IHNvdXJjZVtpbmRleCsrXTtcblxuICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXhdO1xuICAgICAgICAgICAgaWYgKGNoID09PSAnKycgfHwgY2ggPT09ICctJykge1xuICAgICAgICAgICAgICAgIG51bWJlciArPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNEZWNpbWFsRGlnaXQoc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpKSkge1xuICAgICAgICAgICAgICAgIHdoaWxlIChpc0RlY2ltYWxEaWdpdChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIG51bWJlciArPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzSWRlbnRpZmllclN0YXJ0KHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSkpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdHlwZTogVG9rZW4uTnVtZXJpY0xpdGVyYWwsXG4gICAgICAgICAgICB2YWx1ZTogcGFyc2VGbG9hdChudW1iZXIpLFxuICAgICAgICAgICAgbGluZU51bWJlcjogbGluZU51bWJlcixcbiAgICAgICAgICAgIGxpbmVTdGFydDogbGluZVN0YXJ0LFxuICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LFxuICAgICAgICAgICAgZW5kOiBpbmRleFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIC8vIEVDTUEtMjYyIDExLjguNCBTdHJpbmcgTGl0ZXJhbHNcblxuICAgIGZ1bmN0aW9uIHNjYW5TdHJpbmdMaXRlcmFsKCkge1xuICAgICAgICB2YXIgc3RyID0gJycsIHF1b3RlLCBzdGFydCwgY2gsIHVuZXNjYXBlZCwgb2N0VG9EZWMsIG9jdGFsID0gZmFsc2U7XG5cbiAgICAgICAgcXVvdGUgPSBzb3VyY2VbaW5kZXhdO1xuICAgICAgICBhc3NlcnQoKHF1b3RlID09PSAnXFwnJyB8fCBxdW90ZSA9PT0gJ1wiJyksXG4gICAgICAgICAgICAnU3RyaW5nIGxpdGVyYWwgbXVzdCBzdGFydHMgd2l0aCBhIHF1b3RlJyk7XG5cbiAgICAgICAgc3RhcnQgPSBpbmRleDtcbiAgICAgICAgKytpbmRleDtcblxuICAgICAgICB3aGlsZSAoaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4KytdO1xuXG4gICAgICAgICAgICBpZiAoY2ggPT09IHF1b3RlKSB7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSAnJztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT09ICdcXFxcJykge1xuICAgICAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgICAgIGlmICghY2ggfHwgIWlzTGluZVRlcm1pbmF0b3IoY2guY2hhckNvZGVBdCgwKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChjaCkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlICd1JzpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAneCc6XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc291cmNlW2luZGV4XSA9PT0gJ3snKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gc2NhblVuaWNvZGVDb2RlUG9pbnRFc2NhcGUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5lc2NhcGVkID0gc2NhbkhleEVzY2FwZShjaCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF1bmVzY2FwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9IHVuZXNjYXBlZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICduJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSAnXFxuJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdyJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSAnXFxyJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICd0JzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSAnXFx0JztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdiJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSAnXFxiJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdmJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSAnXFxmJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICd2JzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSAnXFx4MEInO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzgnOlxuICAgICAgICAgICAgICAgICAgICBjYXNlICc5JzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSBjaDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzT2N0YWxEaWdpdChjaCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvY3RUb0RlYyA9IG9jdGFsVG9EZWNpbWFsKGNoKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9jdGFsID0gb2N0VG9EZWMub2N0YWwgfHwgb2N0YWw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9IFN0cmluZy5mcm9tQ2hhckNvZGUob2N0VG9EZWMuY29kZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSBjaDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgKytsaW5lTnVtYmVyO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICdcXHInICYmIHNvdXJjZVtpbmRleF0gPT09ICdcXG4nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGxpbmVTdGFydCA9IGluZGV4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNMaW5lVGVybWluYXRvcihjaC5jaGFyQ29kZUF0KDApKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzdHIgKz0gY2g7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAocXVvdGUgIT09ICcnKSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHR5cGU6IFRva2VuLlN0cmluZ0xpdGVyYWwsXG4gICAgICAgICAgICB2YWx1ZTogc3RyLFxuICAgICAgICAgICAgb2N0YWw6IG9jdGFsLFxuICAgICAgICAgICAgbGluZU51bWJlcjogc3RhcnRMaW5lTnVtYmVyLFxuICAgICAgICAgICAgbGluZVN0YXJ0OiBzdGFydExpbmVTdGFydCxcbiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCxcbiAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICAvLyBFQ01BLTI2MiAxMS44LjYgVGVtcGxhdGUgTGl0ZXJhbCBMZXhpY2FsIENvbXBvbmVudHNcblxuICAgIGZ1bmN0aW9uIHNjYW5UZW1wbGF0ZSgpIHtcbiAgICAgICAgdmFyIGNvb2tlZCA9ICcnLCBjaCwgc3RhcnQsIHJhd09mZnNldCwgdGVybWluYXRlZCwgaGVhZCwgdGFpbCwgcmVzdG9yZSwgdW5lc2NhcGVkO1xuXG4gICAgICAgIHRlcm1pbmF0ZWQgPSBmYWxzZTtcbiAgICAgICAgdGFpbCA9IGZhbHNlO1xuICAgICAgICBzdGFydCA9IGluZGV4O1xuICAgICAgICBoZWFkID0gKHNvdXJjZVtpbmRleF0gPT09ICdgJyk7XG4gICAgICAgIHJhd09mZnNldCA9IDI7XG5cbiAgICAgICAgKytpbmRleDtcblxuICAgICAgICB3aGlsZSAoaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgaWYgKGNoID09PSAnYCcpIHtcbiAgICAgICAgICAgICAgICByYXdPZmZzZXQgPSAxO1xuICAgICAgICAgICAgICAgIHRhaWwgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRlcm1pbmF0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PT0gJyQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKHNvdXJjZVtpbmRleF0gPT09ICd7Jykge1xuICAgICAgICAgICAgICAgICAgICBzdGF0ZS5jdXJseVN0YWNrLnB1c2goJyR7Jyk7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIHRlcm1pbmF0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY29va2VkICs9IGNoO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PT0gJ1xcXFwnKSB7XG4gICAgICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgICAgICAgICAgaWYgKCFpc0xpbmVUZXJtaW5hdG9yKGNoLmNoYXJDb2RlQXQoMCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoY2gpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnbic6XG4gICAgICAgICAgICAgICAgICAgICAgICBjb29rZWQgKz0gJ1xcbic7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAncic6XG4gICAgICAgICAgICAgICAgICAgICAgICBjb29rZWQgKz0gJ1xccic7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAndCc6XG4gICAgICAgICAgICAgICAgICAgICAgICBjb29rZWQgKz0gJ1xcdCc7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAndSc6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3gnOlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvdXJjZVtpbmRleF0gPT09ICd7Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9IHNjYW5Vbmljb2RlQ29kZVBvaW50RXNjYXBlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3RvcmUgPSBpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmVzY2FwZWQgPSBzY2FuSGV4RXNjYXBlKGNoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodW5lc2NhcGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tlZCArPSB1bmVzY2FwZWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSByZXN0b3JlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29rZWQgKz0gY2g7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2InOlxuICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9ICdcXGInO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2YnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9ICdcXGYnO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3YnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9ICdcXHYnO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJzAnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzRGVjaW1hbERpZ2l0KHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWxsZWdhbDogXFwwMSBcXDAyIGFuZCBzbyBvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvd0Vycm9yKE1lc3NhZ2VzLlRlbXBsYXRlT2N0YWxMaXRlcmFsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9ICdcXDAnO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpc09jdGFsRGlnaXQoY2gpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWxsZWdhbDogXFwxIFxcMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93RXJyb3IoTWVzc2FnZXMuVGVtcGxhdGVPY3RhbExpdGVyYWwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29rZWQgKz0gY2g7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICsrbGluZU51bWJlcjtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoID09PSAnXFxyJyAmJiBzb3VyY2VbaW5kZXhdID09PSAnXFxuJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBsaW5lU3RhcnQgPSBpbmRleDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlzTGluZVRlcm1pbmF0b3IoY2guY2hhckNvZGVBdCgwKSkpIHtcbiAgICAgICAgICAgICAgICArK2xpbmVOdW1iZXI7XG4gICAgICAgICAgICAgICAgaWYgKGNoID09PSAnXFxyJyAmJiBzb3VyY2VbaW5kZXhdID09PSAnXFxuJykge1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsaW5lU3RhcnQgPSBpbmRleDtcbiAgICAgICAgICAgICAgICBjb29rZWQgKz0gJ1xcbic7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvb2tlZCArPSBjaDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghdGVybWluYXRlZCkge1xuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghaGVhZCkge1xuICAgICAgICAgICAgc3RhdGUuY3VybHlTdGFjay5wb3AoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICB0eXBlOiBUb2tlbi5UZW1wbGF0ZSxcbiAgICAgICAgICAgIHZhbHVlOiB7XG4gICAgICAgICAgICAgICAgY29va2VkOiBjb29rZWQsXG4gICAgICAgICAgICAgICAgcmF3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BhdHRlcm47XG5cbiAgICAgICAgaWYgKGZsYWdzLmluZGV4T2YoJ3UnKSA+PSAwKSB7XG4gICAgICAgICAgICB0bXAgPSB0bXBcbiAgICAgICAgICAgICAgICAvLyBSZXBsYWNlIGV2ZXJ5IFVuaWNvZGUgZXNjYXBlIHNlcXVlbmNlIHdpdGggdGhlIGVxdWl2YWxlbnRcbiAgICAgICAgICAgICAgICAvLyBCTVAgY2hhcmFjdGVyIG9yIGEgY29uc3RhbnQgQVNDSUkgY29kZSBwb2ludCBpbiB0aGUgY2FzZSBvZlxuICAgICAgICAgICAgICAgIC8vIGFzdHJhbCBzeW1ib2xzLiAoU2VlIHRoZSBhYm92ZSBub3RlIG9uIGBhc3RyYWxTdWJzdGl0dXRlYFxuICAgICAgICAgICAgICAgIC8vIGZvciBtb3JlIGluZm9ybWF0aW9uLilcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgvXFxcXHVcXHsoWzAtOWEtZkEtRl0rKVxcfXxcXFxcdShbYS1mQS1GMC05XXs0fSkvZywgZnVuY3Rpb24gKCQwLCAkMSwgJDIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvZGVQb2ludCA9IHBhcnNlSW50KCQxIHx8ICQyLCAxNik7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlUG9pbnQgPiAweDEwRkZGRikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obnVsbCwgTWVzc2FnZXMuSW52YWxpZFJlZ0V4cCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGVQb2ludCA8PSAweEZGRkYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTdHJpbmcuZnJvbUNoYXJDb2RlKGNvZGVQb2ludCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFzdHJhbFN1YnN0aXR1dGU7XG4g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0Y2ggKGV4Y2VwdGlvbikge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzY2FuUmVnRXhwQm9keSgpIHtcbiAgICAgICAgdmFyIGNoLCBzdHIsIGNsYXNzTWFya2VyLCB0ZXJtaW5hdGVkLCBib2R5O1xuXG4gICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgYXNzZXJ0KGNoID09PSAnLycsICdSZWd1bGFyIGV4cHJlc3Npb24gbGl0ZXJhbCBtdXN0IHN0YXJ0IHdpdGggYSBzbGFzaCcpO1xuICAgICAgICBzdHIgPSBzb3VyY2VbaW5kZXgrK107XG5cbiAgICAgICAgY2xhc3NNYXJrZXIgPSBmYWxzZTtcbiAgICAgICAgdGVybWluYXRlZCA9IGZhbHNlO1xuICAgICAgICB3aGlsZSAoaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgc3RyICs9IGNoO1xuICAgICAgICAgICAgaWYgKGNoID09PSAnXFxcXCcpIHtcbiAgICAgICAgICAgICAgICBjaCA9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgICAgICAgICAvLyBFQ01BLTI2MiA3LjguNVxuICAgICAgICAgICAgICAgIGlmIChpc0xpbmVUZXJtaW5hdG9yKGNoLmNoYXJDb2RlQXQoMCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKG51bGwsIE1lc3NhZ2VzLlVudGVybWluYXRlZFJlZ0V4cCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHN0ciArPSBjaDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNMaW5lVGVybWluYXRvcihjaC5jaGFyQ29kZUF0KDApKSkge1xuICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKG51bGwsIE1lc3NhZ2VzLlVudGVybWluYXRlZFJlZ0V4cCk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNsYXNzTWFya2VyKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNoID09PSAnXScpIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3NNYXJrZXIgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJy8nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRlcm1pbmF0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAnWycpIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3NNYXJrZXIgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghdGVybWluYXRlZCkge1xuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obnVsbCwgTWVzc2FnZXMuVW50ZXJtaW5hdGVkUmVnRXhwKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEV4Y2x1ZGUgbGVhZGluZyBhbmQgdHJhaWxpbmcgc2xhc2guXG4gICAgICAgIGJvZHkgPSBzdHIuc3Vic3RyKDEsIHN0ci5sZW5ndGggLSAyKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHZhbHVlOiBib2R5LFxuICAgICAgICAgICAgbGl0ZXJhbDogc3RyXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2NhblJlZ0V4cEZsYWdzKCkge1xuICAgICAgICB2YXIgY2gsIHN0ciwgZmxhZ3MsIHJlc3RvcmU7XG5cbiAgICAgICAgc3RyID0gJyc7XG4gICAgICAgIGZsYWdzID0gJyc7XG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXhdO1xuICAgICAgICAgICAgaWYgKCFpc0lkZW50aWZpZXJQYXJ0KGNoLmNoYXJDb2RlQXQoMCkpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICBpZiAoY2ggPT09ICdcXFxcJyAmJiBpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd1Jykge1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICByZXN0b3JlID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIGNoID0gc2NhbkhleEVzY2FwZSgndScpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2gpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzICs9IGNoO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChzdHIgKz0gJ1xcXFx1JzsgcmVzdG9yZSA8IGluZGV4OyArK3Jlc3RvcmUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gc291cmNlW3Jlc3RvcmVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSByZXN0b3JlO1xuICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3MgKz0gJ3UnO1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9ICdcXFxcdSc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdG9sZXJhdGVVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzdHIgKz0gJ1xcXFwnO1xuICAgICAgICAgICAgICAgICAgICB0b2xlcmF0ZVVuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZmxhZ3MgKz0gY2g7XG4gICAgICAgICAgICAgICAgc3RyICs9IGNoO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHZhbHVlOiBmbGFncyxcbiAgICAgICAgICAgIGxpdGVyYWw6IHN0clxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNjYW5SZWdFeHAoKSB7XG4gICAgICAgIHZhciBzdGFydCwgYm9keSwgZmxhZ3MsIHZhbHVlO1xuICAgICAgICBzY2FubmluZyA9IHRydWU7XG5cbiAgICAgICAgbG9va2FoZWFkID0gbnVsbDtcbiAgICAgICAgc2tpcENvbW1lbnQoKTtcbiAgICAgICAgc3RhcnQgPSBpbmRleDtcblxuICAgICAgICBib2R5ID0gc2NhblJlZ0V4cEJvZHkoKTtcbiAgICAgICAgZmxhZ3MgPSBzY2FuUmVnRXhwRmxhZ3MoKTtcbiAgICAgICAgdmFsdWUgPSB0ZXN0UmVnRXhwKGJvZHkudmFsdWUsIGZsYWdzLnZhbHVlKTtcbiAgICAgICAgc2Nhbm5pbmcgPSBmYWxzZTtcbiAgICAgICAgaWYgKGV4dHJhLnRva2VuaXplKSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHR5cGU6IFRva2VuLlJlZ3VsYXJFeHByZXNzaW9uLFxuICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZSxcbiAgICAgICAgICAgICAgICByZWdleDoge1xuICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiBib2R5LnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICBmbGFnczogZmxhZ3MudmFsdWVcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgbGluZVN0YXJ0OiBsaW5lU3RhcnQsXG4gICAgICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LFxuICAgICAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgbGl0ZXJhbDogYm9keS5saXRlcmFsICsgZmxhZ3MubGl0ZXJhbCxcbiAgICAgICAgICAgIHZhbHVlOiB2YWx1ZSxcbiAgICAgICAgICAgIHJlZ2V4OiB7XG4gICAgICAgICAgICAgICAgcGF0dGVybjogYm9keS52YWx1ZSxcbiAgICAgICAgICAgICAgICBmbGFnczogZmxhZ3MudmFsdWVcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzdGFydDogc3RhcnQsXG4gICAgICAgICAgICBlbmQ6IGluZGV4XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY29sbGVjdFJlZ2V4KCkge1xuICAgICAgICB2YXIgcG9zLCBsb2MsIHJlZ2V4LCB0b2tlbjtcblxuICAgICAgICBza2lwQ29tbWVudCgpO1xuXG4gICAgICAgIHBvcyA9IGluZGV4O1xuICAgICAgICBsb2MgPSB7XG4gICAgICAgICAgICBzdGFydDoge1xuICAgICAgICAgICAgICAgIGxpbmU6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgY29sdW1uOiBpbmRleCAtIGxpbmVTdGFydFxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIHJlZ2V4ID0gc2NhblJlZ0V4cCgpO1xuXG4gICAgICAgIGxvYy5lbmQgPSB7XG4gICAgICAgICAgICBsaW5lOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgY29sdW1uOiBpbmRleCAtIGxpbmVTdGFydFxuICAgICAgICB9O1xuXG4gICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgIGlmICghZXh0cmEudG9rZW5pemUpIHtcbiAgICAgICAgICAgIC8vIFBvcCB0aGUgcHJldmlvdXMgdG9rZW4sIHdoaWNoIGlzIGxpa2VseSAnLycgb3IgJy89J1xuICAgICAgICAgICAgaWYgKGV4dHJhLnRva2Vucy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSBleHRyYS50b2tlbnNbZXh0cmEudG9rZW5zLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgICAgIGlmICh0b2tlbi5yYW5nZVswXSA9PT0gcG9zICYmIHRva2VuLnR5cGUgPT09ICdQdW5jdHVhdG9yJykge1xuICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4udmFsdWUgPT09ICcvJyB8fCB0b2tlbi52YWx1ZSA9PT0gJy89Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEudG9rZW5zLnBvcCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBleHRyYS50b2tlbnMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogJ1JlZ3VsYXJFeHByZXNzaW9uJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogcmVnZXgubGl0ZXJhbCxcbiAgICAgICAgICAgICAgICByZWdleDogcmVnZXgucmVnZXgsXG4gICAgICAgICAgICAgICAgcmFuZ2U6IFtwb3MsIGluZGV4XSxcbiAgICAgICAgICAgICAgICBsb2M6IGxvY1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVnZXg7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNJZGVudGlmaWVyTmFtZSh0b2tlbikge1xuICAgICAgICByZXR1cm4gdG9rZW4udHlwZSA9PT0gVG9rZW4uSWRlbnRpZmllciB8fFxuICAgICAgICAgICAgdG9rZW4udHlwZSA9PT0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1bmN0dWF0b3IoKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBhZHZhbmNlKCkge1xuICAgICAgICB2YXIgY3AsIHRva2VuO1xuXG4gICAgICAgIGlmIChpbmRleCA+PSBsZW5ndGgpIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgdHlwZTogVG9rZW4uRU9GLFxuICAgICAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgbGluZVN0YXJ0OiBsaW5lU3RhcnQsXG4gICAgICAgICAgICAgICAgc3RhcnQ6IGluZGV4LFxuICAgICAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICBjcCA9IHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KTtcblxuICAgICAgICBpZiAoaXNJZGVudGlmaWVyU3RhcnQoY3ApKSB7XG4gICAgICAgICAgICB0b2tlbiA9IHNjYW5JZGVudGlmaWVyKCk7XG4gICAgICAgICAgICBpZiAoc3RyaWN0ICYmIGlzU3RyaWN0TW9kZVJlc2VydmVkV29yZCh0b2tlbi52YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICB0b2tlbi50eXBlID0gVG9rZW4uS2V5d29yZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0b2tlbjtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFZlcnkgY29tbW9uOiAoIGFuZCApIGFuZCA7XG4gICAgICAgIGlmIChjcCA9PT0gMHgyOCB8fCBjcCA9PT0gMHgyOSB8fCBjcCA9PT0gMHgzQikge1xuICAgICAgICAgICAgcmV0dXJuIHNjYW5QdW5jdHVhdG9yKCk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBTdHJpbmcgbGl0ZXJhbCBzdGFydHMgd2l0aCBzaW5nbGUgcXVvdGUgKFUrMDAyNykgb3IgZG91YmxlIHF1b3RlIChVKzAwMjIpL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iYgc3RhdGUuY3VybHlTdGFja1tzdGF0ZS5jdXJseVN0YWNrLmxlbmd0aCAtIDFdID09PSAnJHsnKSkge1xuICAgICAgICAgICAgcmV0dXJuIHNjYW5UZW1wbGF0ZSgpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gUG9zc2libGUgaWRlbnRpZmllciBzdGFydCBpbiBhIHN1cnJvZ2F0ZSBwYWlyLlxuICAgICAgICBpZiAoY3AgPj0gMHhEODAwICYmIGNwIDwgMHhERkZGKSB7XG4gICAgICAgICAgICBjcCA9IGNvZGVQb2ludEF0KGluZGV4KTtcbiAgICAgICAgICAgIGlmIChpc0lkZW50aWZpZXJTdGFydChjcCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gc2NhbklkZW50aWZpZXIoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBzY2FuUHVuY3R1YXRvcigpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNvbGxlY3RUb2tlbigpIHtcbiAgICAgICAgdmFyIGxvYywgdG9rZW4sIHZhbHVlLCBlbnRyeTtcblxuICAgICAgICBsb2MgPSB7XG4gICAgICAgICAgICBzdGFydDoge1xuICAgICAgICAgICAgICAgIGxpbmU6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgY29sdW1uOiBpbmRleCAtIGxpbmVTdGFydFxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIHRva2VuID0gYWR2YW5jZSgpO1xuICAgICAgICBsb2MuZW5kID0ge1xuICAgICAgICAgICAgbGluZTogbGluZU51bWJlcixcbiAgICAgICAgICAgIGNvbHVtbjogaW5kZXggLSBsaW5lU3RhcnRcbiAgICAgICAgfTtcblxuICAgICAgICBpZiAodG9rZW4udHlwZSAhPT0gVG9rZW4uRU9GKSB7XG4gICAgICAgICAgICB2YWx1ZSA9IHNvdXJjZS5zbGljZSh0b2tlbi5zdGFydCwgdG9rZW4uZW5kKTtcbiAgICAgICAgICAgIGVudHJ5ID0ge1xuICAgICAgICAgICAgICAgIHR5cGU6IFRva2VuTmFtZVt0b2tlbi50eXBlXSxcbiAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWUsXG4gICAgICAgICAgICAgICAgcmFuZ2U6IFt0b2tlbi5zdGFydCwgdG9rZW4uZW5kXSxcbiAgICAgICAgICAgICAgICBsb2M6IGxvY1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmICh0b2tlbi5yZWdleCkge1xuICAgICAgICAgICAgICAgIGVudHJ5LnJlZ2V4ID0ge1xuICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiB0b2tlbi5yZWdleC5wYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBmbGFnczogdG9rZW4ucmVnZXguZmxhZ3NcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGV4dHJhLnRva2VuVmFsdWVzKSB7XG4gICAgICAgICAgICAgICAgZXh0cmEudG9rZW5WYWx1ZXMucHVzaCgoZW50cnkudHlwZSA9PT0gJ1B1bmN0dWF0b3InIHx8IGVudHJ5LnR5cGUgPT09ICdLZXl3b3JkJykgPyBlbnRyeS52YWx1ZSA6IG51bGwpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGV4dHJhLnRva2VuaXplKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFleHRyYS5yYW5nZSkge1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgZW50cnkucmFuZ2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghZXh0cmEubG9jKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBlbnRyeS5sb2M7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChleHRyYS5kZWxlZ2F0ZSkge1xuICAgICAgICAgICAgICAgICAgICBlbnRyeSA9IGV4dHJhLmRlbGVnYXRlKGVudHJ5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBleHRyYS50b2tlbnMucHVzaChlbnRyeSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdG9rZW47XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbGV4KCkge1xuICAgICAgICB2YXIgdG9rZW47XG4gICAgICAgIHNjYW5uaW5nID0gdHJ1ZTtcblxuICAgICAgICBsYXN0SW5kZXggPSBpbmRleDtcbiAgICAgICAgbGFzdExpbmVOdW1iZXIgPSBsaW5lTnVtYmVyO1xuICAgICAgICBsYXN0TGluZVN0YXJ0ID0gbGluZVN0YXJ0O1xuXG4gICAgICAgIHNraXBDb21tZW50KCk7XG5cbiAgICAgICAgdG9rZW4gPSBsb29rYWhlYWQ7XG5cbiAgICAgICAgc3RhcnRJbmRleCA9IGluZGV4O1xuICAgICAgICBzdGFydExpbmVOdW1iZXIgPSBsaW5lTnVtYmVyO1xuICAgICAgICBzdGFydExpbmVTdGFydCA9IGxpbmVTdGFydDtcblxuICAgICAgICBsb29rYWhlYWQgPSAodHlwZW9mIGV4dHJhLnRva2VucyAhPT0gJ3VuZGVmaW5lZCcpID8gY29sbGVjdFRva2VuKCkgOiBhZHZhbmNlKCk7XG4gICAgICAgIHNjYW5uaW5nID0gZmFsc2U7XG4gICAgICAgIHJldHVybiB0b2tlbjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwZWVrKCkge1xuICAgICAgICBzY2FubmluZyA9IHRydWU7XG5cbiAgICAgICAgc2tpcENvbW1lbnQoKTtcblxuICAgICAgICBsYXN0SW5kZXggPSBpbmRleDtcbiAgICAgICAgbGFzdExpbmVOdW1iZXIgPSBsaW5lTnVtYmVyO1xuICAgICAgICBsYXN0TGluZVN0YXJ0ID0gbGluZVN0YXJ0O1xuXG4gICAgICAgIHN0YXJ0SW5kZXggPSBpbmRleDtcbiAgICAgICAgc3RhcnRMaW5lTnVtYmVyID0gbGluZU51bWJlcjtcbiA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dyYXBwaW5nTm9kZShzdGFydFRva2VuKSB7XG4gICAgICAgIGlmIChleHRyYS5yYW5nZSkge1xuICAgICAgICAgICAgdGhpcy5yYW5nZSA9IFtzdGFydFRva2VuLnN0YXJ0LCAwXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZXh0cmEubG9jKSB7XG4gICAgICAgICAgICB0aGlzLmxvYyA9IG5ldyBXcmFwcGluZ1NvdXJjZUxvY2F0aW9uKHN0YXJ0VG9rZW4pO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgV3JhcHBpbmdOb2RlLnByb3RvdHlwZSA9IE5vZGUucHJvdG90eXBlID0ge1xuXG4gICAgICAgIHByb2Nlc3NDb21tZW50OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgbGFzdENoaWxkLFxuICAgICAgICAgICAgICAgIGlubmVyQ29tbWVudHMsXG4gICAgICAgICAgICAgICAgbGVhZGluZ0NvbW1lbnRzLFxuICAgICAgICAgICAgICAgIHRyYWlsaW5nQ29tbWVudHMsXG4gICAgICAgICAgICAgICAgYm90dG9tUmlnaHQgPSBleHRyYS5ib3R0b21SaWdodFN0YWNrLFxuICAgICAgICAgICAgICAgIGksXG4gICAgICAgICAgICAgICAgY29tbWVudCxcbiAgICAgICAgICAgICAgICBsYXN0ID0gYm90dG9tUmlnaHRbYm90dG9tUmlnaHQubGVuZ3RoIC0gMV07XG5cbiAgICAgICAgICAgIGlmICh0aGlzLnR5cGUgPT09IFN5bnRheC5Qcm9ncmFtKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuYm9keS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIHBhdGNoIGlubm5lckNvbW1lbnRzIGZvciBwcm9wZXJ0aWVzIGVtcHR5IGJsb2NrXG4gICAgICAgICAgICAgKiBgZnVuY3Rpb24gYSgpIHsvKiogY29tbWVudHMgKipcXC99YFxuICAgICAgICAgICAgICovXG5cbiAgICAgICAgICAgIGlmICh0aGlzLnR5cGUgPT09IFN5bnRheC5CbG9ja1N0YXRlbWVudCAmJiB0aGlzLmJvZHkubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgaW5uZXJDb21tZW50cyA9IFtdO1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IGV4dHJhLmxlYWRpbmdDb21tZW50cy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICAgICAgICAgICAgICBjb21tZW50ID0gZXh0cmEubGVhZGluZ0NvbW1lbnRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5yYW5nZVsxXSA+PSBjb21tZW50LnJhbmdlWzFdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbm5lckNvbW1lbnRzLnVuc2hpZnQoY29tbWVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYS5sZWFkaW5nQ29tbWVudHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEudHJhaWxpbmdDb21tZW50cy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlubmVyQ29tbWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaW5uZXJDb21tZW50cyA9IGlubmVyQ29tbWVudHM7XG4gICAgICAgICAgICAgICAgICAgIC8vYm90dG9tUmlnaHQucHVzaCh0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGV4dHJhLnRyYWlsaW5nQ29tbWVudHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIHRyYWlsaW5nQ29tbWVudHMgPSBbXTtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSBleHRyYS50cmFpbGluZ0NvbW1lbnRzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1lbnQgPSBleHRyYS50cmFpbGluZ0NvbW1lbnRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29tbWVudC5yYW5nZVswXSA+PSB0aGlzLnJhbmdlWzFdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFpbGluZ0NvbW1lbnRzLnVuc2hpZnQoY29tbWVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYS50cmFpbGluZ0NvbW1lbnRzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBleHRyYS50cmFpbGluZ0NvbW1lbnRzID0gW107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChsYXN0ICYmIGxhc3QudHJhaWxpbmdDb21tZW50cyAmJiBsYXN0LnRyYWlsaW5nQ29tbWVudHNbMF0ucmFuZ2VbMF0gPj0gdGhpcy5yYW5nZVsxXSkge1xuICAgICAgICAgICAgICAgICAgICB0cmFpbGluZ0NvbW1lbnRzID0gbGFzdC50cmFpbGluZ0NvbW1lbnRzO1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgbGFzdC50cmFpbGluZ0NvbW1lbnRzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gRWF0aW5nIHRoZSBzdGFjay5cbiAgICAgICAgICAgIHdoaWxlIChsYXN0ICYmIGxhc3QucmFuZ2VbMF0gPj0gdGhpcy5yYW5nZVswXSkge1xuICAgICAgICAgICAgICAgIGxhc3RDaGlsZCA9IGJvdHRvbVJpZ2h0LnBvcCgpO1xuICAgICAgICAgICAgICAgIGxhc3QgPSBib3R0b21SaWdodFtib3R0b21SaWdodC5sZW5ndGggLSAxXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGxhc3RDaGlsZCkge1xuICAgICAgICAgICAgICAgIGlmIChsYXN0Q2hpbGQubGVhZGluZ0NvbW1lbnRzKSB7XG4gICAgICAgICAgICAgICAgICAgIGxlYWRpbmdDb21tZW50cyA9IFtdO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSBsYXN0Q2hpbGQubGVhZGluZ0NvbW1lbnRzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb21tZW50ID0gbGFzdENoaWxkLmxlYWRpbmdDb21tZW50c1tpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb21tZW50LnJhbmdlWzFdIDw9IHRoaXMucmFuZ2VbMF0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWFkaW5nQ29tbWVudHMudW5zaGlmdChjb21tZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0Q2hpbGQubGVhZGluZ0NvbW1lbnRzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICghbGFzdENoaWxkLmxlYWRpbmdDb21tZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RDaGlsZC5sZWFkaW5nQ29tbWVudHMgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGV4dHJhLmxlYWRpbmdDb21tZW50cy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgbGVhZGluZ0NvbW1lbnRzID0gW107XG4gICAgICAgICAgICAgICAgZm9yIChpID0gZXh0cmEubGVhZGluZ0NvbW1lbnRzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1lbnQgPSBleHRyYS5sZWFkaW5nQ29tbWVudHNbaV07XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb21tZW50LnJhbmdlWzFdIDw9IHRoaXMucmFuZ2VbMF0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlYWRpbmdDb21tZW50cy51bnNoaWZ0KGNvbW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEubGVhZGluZ0NvbW1lbnRzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuXG4gICAgICAgICAgICBpZiAobGVhZGluZ0NvbW1lbnRzICYmIGxlYWRpbmdDb21tZW50cy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5sZWFkaW5nQ29tbWVudHMgPSBsZWFkaW5nQ29tbWVudHM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHJhaWxpbmdDb21tZW50cyAmJiB0cmFpbGluZ0NvbW1lbnRzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLnRyYWlsaW5nQ29tbWVudHMgPSB0cmFpbGluZ0NvbW1lbnRzO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBib3R0b21SaWdodC5wdXNoKHRoaXMpO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKGV4dHJhLnJhbmdlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yYW5nZVsxXSA9IGxhc3RJbmRleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChleHRyYS5sb2MpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmxvYy5lbmQgPSB7XG4gICAgICAgICAgICAgICAgICAgIGxpbmU6IGxhc3RMaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgICAgICBjb2x1bW46IGxhc3RJbmRleCAtIGxhc3RMaW5lU3RhcnRcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmIChleHRyYS5zb3VyY2UpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5sb2Muc291cmNlID0gZXh0cmEuc291cmNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGV4dHJhLmF0dGFjaENvbW1lbnQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnByb2Nlc3NDb21tZW50KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoQXJyYXlFeHByZXNzaW9uOiBmdW5jdGlvbiAoZWxlbWVudHMpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5BcnJheUV4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLmVsZW1lbnRzID0gZWxlbWVudHM7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoQXJyYXlQYXR0ZXJuOiBmdW5jdGlvbiAoZWxlbWVudHMpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5BcnJheVBhdHRlcm47XG4gICAgICAgICAgICB0aGlzLmVsZW1lbnRzID0gZWxlbWVudHM7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoQXJyb3dGdW5jdGlvbkV4cHJlc3Npb246IGZ1bmN0aW9uIChwYXJhbXMsIGRlZmF1bHRzLCBib2R5LCBleHByZXNzaW9uKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguQXJyb3dGdW5jdGlvbkV4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLmlkID0gbnVsbDtcbiAgICAgICAgICAgIHRoaXMucGFyYW1zID0gcGFyYW1zO1xuICAgICAgICAgICAgdGhpcy5kZWZhdWx0cyA9IGRlZmF1bHRzO1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZ2VuZXJhdG9yID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLmV4cHJlc3Npb24gPSBleHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEFzc2lnbm1lbnRFeHByZXNzaW9uOiBmdW5jdGlvbiAob3BlcmF0b3IsIGxlZnQsIHJpZ2h0KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguQXNzaWdubWVudEV4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLm9wZXJhdG9yID0gb3BlcmF0b3I7XG4gICAgICAgICAgICB0aGlzLmxlZnQgPSBsZWZ0O1xuICAgICAgICAgICAgdGhpcy5yaWdodCA9IHJpZ2h0O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEFzc2lnbm1lbnRQYXR0ZXJuOiBmdW5jdGlvbiAobGVmdCwgcmlnaHQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Bc3NpZ25tZW50UGF0dGVybjtcbiAgICAgICAgICAgIHRoaXMubGVmdCA9IGxlZnQ7XG4gICAgICAgICAgICB0aGlzLnJpZ2h0ID0gcmlnaHQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoQmluYXJ5RXhwcmVzc2lvbjogZnVuY3Rpb24gKG9wZXJhdG9yLCBsZWZ0LCByaWdodCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gKG9wZXJhdG9yID09PSAnfHwnIHx8IG9wZXJhdG9yID09PSAnJiYnKSA/IFN5bnRheC5Mb2dpY2FsRXhwcmVzc2lvbiA6IFN5bnRheC5CaW5hcnlFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5vcGVyYXRvciA9IG9wZXJhdG9yO1xuICAgICAgICAgICAgdGhpcy5sZWZ0ID0gbGVmdDtcbiAgICAgICAgICAgIHRoaXMucmlnaHQgPSByaWdodDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hCbG9ja1N0YXRlbWVudDogZnVuY3Rpb24gKGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5CbG9ja1N0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMuYm9keSA9IGJvZHk7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoQnJlYWtTdGF0ZW1lbnQ6IGZ1bmN0aW9uIChsYWJlbCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkJyZWFrU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5sYWJlbCA9IGxhYmVsO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaENhbGxFeHByZXNzaW9uOiBmdW5jdGlvbiAoY2FsbGVlLCBhcmdzKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguQ2FsbEV4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLmNhbGxlZSA9IGNhbGxlZTtcbiAgICAgICAgICAgIHRoaXMuYXJndW1lbnRzID0gYXJncztcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hDYXRjaENsYXVzZTogZnVuY3Rpb24gKHBhcmFtLCBib2R5KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguQ2F0Y2hDbGF1c2U7XG4gICAgICAgICAgICB0aGlzLnBhcmFtID0gcGFyYW07XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaENsYXNzQm9keTogZnVuY3Rpb24gKGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5DbGFzc0JvZHk7XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaENsYXNzRGVjbGFyYXRpb246IGZ1bmN0aW9uIChpZCwgc3VwZXJDbGFzcywgYm9keSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkNsYXNzRGVjbGFyYXRpb247XG4gICAgICAgICAgICB0aGlzLmlkID0gaWQ7XG4gICAgICAgICAgICB0aGlzLnN1cGVyQ2xhc3MgPSBzdXBlckNsYXNzO1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hDbGFzc0V4cHJlc3Npb246IGZ1bmN0aW9uIChpZCwgc3VwZXJDbGFzcywgYm9keSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkNsYXNzRXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMuaWQgPSBpZDtcbiAgICAgICAgICAgIHRoaXMuc3VwZXJDbGFzcyA9IHN1cGVyQ2xhc3M7XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaENvbmRpdGlvbmFsRXhwcmVzc2lvbjogZnVuY3Rpb24gKHRlc3QsIGNvbnNlcXVlbnQsIGFsdGVybmF0ZSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkNvbmRpdGlvbmFsRXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMudGVzdCA9IHRlc3Q7XG4gICAgICAgICAgICB0aGlzLmNvbnNlcXVlbnQgPSBjb25zZXF1ZW50O1xuICAgICAgICAgICAgdGhpcy5hbHRlcm5hdGUgPSBhbHRlcm5hdGU7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoQ29udGludWVTdGF0ZW1lbnQ6IGZ1bmN0aW9uIChsYWJlbCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkNvbnRpbnVlU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5sYWJlbCA9IGxhYmVsO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaERlYnVnZ2VyU3RhdGVtZW50OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguRGVidWdnZXJTdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoRG9XaGlsZVN0YXRlbWVudDogZnVuY3Rpb24gKGJvZHksIHRlc3QpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Eb1doaWxlU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMudGVzdCA9IHRlc3Q7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoRW1wdHlTdGF0ZW1lbnQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5FbXB0eVN0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hFeHByZXNzaW9uU3RhdGVtZW50OiBmdW5jdGlvbiAoZXhwcmVzc2lvbikge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkV4cHJlc3Npb25TdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmV4cHJlc3Npb24gPSBleHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEZvclN0YXRlbWVudDogZnVuY3Rpb24gKGluaXQsIHRlc3QsIHVwZGF0ZSwgYm9keSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkZvclN0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMuaW5pdCA9IGluaXQ7XG4gICAgICAgICAgICB0aGlzLnRlc3QgPSB0ZXN0O1xuICAgICAgICAgICAgdGhpcy51cGRhdGUgPSB1cGRhdGU7XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEZvck9mU3RhdGVtZW50OiBmdW5jdGlvbiAobGVmdCwgcmlnaHQsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Gb3JPZlN0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMubGVmdCA9IGxlZnQ7XG4gICAgICAgICAgICB0aGlzLnJpZ2h0ID0gcmlnaHQ7XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEZvckluU3RhdGVtZW50OiBmdW5jdGlvbiAobGVmdCwgcmlnaHQsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Gb3JJblN0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMubGVmdCA9IGxlZnQ7XG4gICAgICAgICAgICB0aGlzLnJpZ2h0ID0gcmlnaHQ7XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5lYWNoID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoRnVuY3Rpb25EZWNsYXJhdGlvbjogZnVuY3Rpb24gKGlkLCBwYXJhbXMsIGRlZmF1bHRzLCBib2R5LCBnZW5lcmF0b3IpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5GdW5jdGlvbkRlY2xhcmF0aW9uO1xuICAgICAgICAgICAgdGhpcy5pZCA9IGlkO1xuICAgICAgICAgICAgdGhpcy5wYXJhbXMgPSBwYXJhbXM7XG4gICAgICAgICAgICB0aGlzLmRlZmF1bHRzID0gZGVmYXVsdHM7XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5nZW5lcmF0b3IgPSBnZW5lcmF0b3I7XG4gICAgICAgICAgICB0aGlzLmV4cHJlc3Npb24gPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hGdW5jdGlvbkV4cHJlc3Npb246IGZ1bmN0aW9uIChpZCwgcGFyYW1zLCBkZWZhdWx0cywgYm9keSwgZ2VuZXJhdG9yKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguRnVuY3Rpb25FeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5pZCA9IGlkO1xuICAgICAgICAgICAgdGhpcy5wYXJhbXMgPSBwYXJhbXM7XG4gICAgICAgICAgICB0aGlzLmRlZmF1bHRzID0gZGVmYXVsdHM7XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5nZW5lcmF0b3IgPSBnZW5lcmF0b3I7XG4gICAgICAgICAgICB0aGlzLmV4cHJlc3Npb24gPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hJZGVudGlmaWVyOiBmdW5jdGlvbiAobmFtZSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LklkZW50aWZpZXI7XG4gICAgICAgICAgICB0aGlzLm5hbWUgPSBuYW1lO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaElmU3RhdGVtZW50OiBmdW5jdGlvbiAodGVzdCwgY29uc2VxdWVudCwgYWx0ZXJuYXRlKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguSWZTdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLnRlc3QgPSB0ZXN0O1xuICAgICAgICAgICAgdGhpcy5jb25zZXF1ZW50ID0gY29uc2VxdWVudDtcbiAgICAgICAgICAgIHRoaXMuYWx0ZXJuYXRlID0gYWx0ZXJuYXRlO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaExhYmVsZWRTdGF0ZW1lbnQ6IGZ1bmN0aW9uIChsYWJlbCwgYm9keSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkxhYmVsZWRTdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmxhYmVsID0gbGFiZWw7XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaExpdGVyYWw6IGZ1bmN0aW9uICh0b2tlbikge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkxpdGVyYWw7XG4gICAgICAgICAgICB0aGlzLnZhbHVlID0gdG9rZW4udmFsdWU7XG4gICAgICAgICAgICB0aGlzLnJhdyA9IHNvdXJjZS5zbGljZSh0b2tlbi5zdGFydCwgdG9rZW4uZW5kKTtcbiAgICAgICAgICAgIGlmICh0b2tlbi5yZWdleCkge1xuICAgICAgICAgICAgICAgIHRoaXMucmVnZXggPSB0b2tlbi5yZWdleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hNZW1iZXJFeHByZXNzaW9uOiBmdW5jdGlvbiAoYWNjZXNzb3IsIG9iamVjdCwgcHJvcGVydHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5NZW1iZXJFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5jb21wdXRlZCA9IGFjY2Vzc29yID09PSAnWyc7XG4gICAgICAgICAgICB0aGlzLm9iamVjdCA9IG9iamVjdDtcbiAgICAgICAgICAgIHRoaXMucHJvcGVydHkgPSBwcm9wZXJ0eTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hNZXRhUHJvcGVydHk6IGZ1bmN0aW9uIChtZXRhLCBwcm9wZXJ0eSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4Lk1ldGFQcm9wZXJ0eTtcbiAgICAgICAgICAgIHRoaXMubWV0YSA9IG1ldGE7XG4gICAgICAgICAgICB0aGlzLnByb3BlcnR5ID0gcHJvcGVydHk7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoTmV3RXhwcmVzc2lvbjogZnVuY3Rpb24gKGNhbGxlZSwgYXJncykge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4Lk5ld0V4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLmNhbGxlZSA9IGNhbGxlZTtcbiAgICAgICAgICAgIHRoaXMuYXJndW1lbnRzID0gYXJncztcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hPYmplY3RFeHByZXNzaW9uOiBmdW5jdGlvbiAocHJvcGVydGllcykge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4Lk9iamVjdEV4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLnByb3BlcnRpZXMgPSBwcm9wZXJ0aWVzO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaE9iamVjdFBhdHRlcm46IGZ1bmN0aW9uIChwcm9wZXJ0aWVzKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguT2JqZWN0UGF0dGVybjtcbiAgICAgICAgICAgIHRoaXMucHJvcGVydGllcyA9IHByb3BlcnRpZXM7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoUG9zdGZpeEV4cHJlc3Npb246IGZ1bmN0aW9uIChvcGVyYXRvciwgYXJndW1lbnQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5VcGRhdGVFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5vcGVyYXRvciA9IG9wZXJhdG9yO1xuICAgICAgICAgICAgdGhpcy5hcmd1bWVudCA9IGFyZ3VtZW50O1xuICAgICAgICAgICAgdGhpcy5wcmVmaXggPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hQcm9ncmFtOiBmdW5jdGlvbiAoYm9keSwgc291cmNlVHlwZSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlByb2dyYW07XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5zb3VyY2VUeXBlID0gc291cmNlVHlwZTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hQcm9wZXJ0eTogZnVuY3Rpb24gKGtpbmQsIGtleSwgY29tcHV0ZWQsIHZhbHVlLCBtZXRob2QsIHNob3J0aGFuZCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlByb3BlcnR5O1xuICAgICAgICAgICAgdGhpcy5rZXkgPSBrZXk7XG4gICAgICAgICAgICB0aGlzLmNvbXB1dGVkID0gY29tcHV0ZWQ7XG4gICAgICAgICAgICB0aGlzLnZhbHVlID0gdmFsdWU7XG4gICAgICAgICAgICB0aGlzLmtpbmQgPSBraW5kO1xuICAgICAgICAgICAgdGhpcy5tZXRob2QgPSBtZXRob2Q7XG4gICAgICAgICAgICB0aGlzLnNob3J0aGFuZCA9IHNob3J0aGFuZDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hSZXN0RWxlbWVudDogZnVuY3Rpb24gKGFyZ3VtZW50KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguUmVzdEVsZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmFyZ3VtZW50ID0gYXJndW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoUmV0dXJuU3RhdGVtZW50OiBmdW5jdGlvbiAoYXJndW1lbnQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5SZXR1cm5TdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmFyZ3VtZW50ID0gYXJndW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoU2VxdWVuY2VFeHByZXNzaW9uOiBmdW5jdGlvbiAoZXhwcmVzc2lvbnMpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5TZXF1ZW5jZUV4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLmV4cHJlc3Npb25zID0gZXhwcmVzc2lvbnM7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoU3ByZWFkRWxlbWVudDogZnVuY3Rpb24gKGFyZ3VtZW50KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguU3ByZWFkRWxlbWVudDtcbiAgICAgICAgICAgIHRoaXMuYXJndW1lbnQgPSBhcmd1bWVudDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hTd2l0Y2hDYXNlOiBmdW5jdGlvbiAodGVzdCwgY29uc2VxdWVudCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlN3aXRjaENhc2U7XG4gICAgICAgICAgICB0aGlzLnRlc3QgPSB0ZXN0O1xuICAgICAgICAgICAgdGhpcy5jb25zZXF1ZW50ID0gY29uc2VxdWVudDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hTdXBlcjogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlN1cGVyO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFN3aXRjaFN0YXRlbWVudDogZnVuY3Rpb24gKGRpc2NyaW1pbmFudCwgY2FzZXMpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Td2l0Y2hTdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmRpc2NyaW1pbmFudCA9IGRpc2NyaW1pbmFudDtcbiAgICAgICAgICAgIHRoaXMuY2FzZXMgPSBjYXNlcztcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hUYWdnZWRUZW1wbGF0ZUV4cHJlc3Npb246IGZ1bmN0aW9uICh0YWcsIHF1YXNpKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguVGFnZ2VkVGVtcGxhdGVFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy50YWcgPSB0YWc7XG4gICAgICAgICAgICB0aGlzLnF1YXNpID0gcXVhc2k7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoVGVtcGxhdGVFbGVtZW50OiBmdW5jdGlvbiAodmFsdWUsIHRhaWwpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5UZW1wbGF0ZUVsZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLnZhbHVlID0gdmFsdWU7XG4gICAgICAgICAgICB0aGlzLnRhaWwgPSB0YWlsO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFRlbXBsYXRlTGl0ZXJhbDogZnVuY3Rpb24gKHF1YXNpcywgZXhwcmVzc2lvbnMpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5UZW1wbGF0ZUxpdGVyYWw7XG4gICAgICAgICAgICB0aGlzLnF1YXNpcyA9IHF1YXNpcztcbiAgICAgICAgICAgIHRoaXMuZXhwcmVzc2lvbnMgPSBleHByZXNzaW9ucztcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hUaGlzRXhwcmVzc2lvbjogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlRoaXNFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFRocm93U3RhdGVtZW50OiBmdW5jdGlvbiAoYXJndW1lbnQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5UaHJvd1N0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMuYXJndW1lbnQgPSBhcmd1bWVudDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hUcnlTdGF0ZW1lbnQ6IGZ1bmN0aW9uIChibG9jaywgaGFuZGxlciwgZmluYWxpemVyKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguVHJ5U3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5ibG9jayA9IGJsb2NrO1xuICAgICAgICAgICAgdGhpcy5ndWFyZGVkSGFuZGxlcnMgPSBbXTtcbiAgICAgICAgICAgIHRoaXMuaGFuZGxlcnMgPSBoYW5kbGVyID8gW2hhbmRsZXJdIDogW107XG4gICAgICAgICAgICB0aGlzLmhhbmRsZXIgPSBoYW5kbGVyO1xuICAgICAgICAgICAgdGhpcy5maW5hbGl6ZXIgPSBmaW5hbGl6ZXI7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoVW5hcnlFeHByZXNzaW9uOiBmdW5jdGlvbiAob3BlcmF0b3IsIGFyZ3VtZW50KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSAob3BlcmF0b3IgPT09ICcrKycgfHwgb3BlcmF0b3IgPT09ICctLScpID8gU3ludGF4LlVwZGF0ZUV4cHJlc3Npb24gOiBTeW50YXguVW5hcnlFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5vcGVyYXRvciA9IG9wZXJhdG9yO1xuICAgICAgICAgICAgdGhpcy5hcmd1bWVudCA9IGFyZ3VtZW50O1xuICAgICAgICAgICAgdGhpcy5wcmVmaXggPSB0cnVlO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFZhcmlhYmxlRGVjbGFyYXRpb246IGZ1bmN0aW9uIChkZWNsYXJhdGlvbnMpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uO1xuICAgICAgICAgICAgdGhpcy5kZWNsYXJhdGlvbnMgPSBkZWNsYXJhdGlvbnM7XG4gICAgICAgICAgICB0aGlzLmtpbmQgPSAndmFyJztcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hMZXhpY2FsRGVjbGFyYXRpb246IGZ1bmN0aW9uIChkZWNsYXJhdGlvbnMsIGtpbmQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uO1xuICAgICAgICAgICAgdGhpcy5kZWNsYXJhdGlvbnMgPSBkZWNsYXJhdGlvbnM7XG4gICAgICAgICAgICB0aGlzLmtpbmQgPSBraW5kO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFZhcmlhYmxlRGVjbGFyYXRvcjogZnVuY3Rpb24gKGlkLCBpbml0KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguVmFyaWFibGVEZWNsYXJhdG9yO1xuICAgICAgICAgICAgdGhpcy5pZCA9IGlkO1xuICAgICAgICAgICAgdGhpcy5pbml0ID0gaW5pdDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hXaGlsZVN0YXRlbWVudDogZnVuY3Rpb24gKHRlc3QsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5XaGlsZVN0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMudGVzdCA9IHRlc3Q7XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFdpdGhTdGF0ZW1lbnQ6IGZ1bmN0aW9uIChvYmplY3QsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5XaXRoU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5vYmplY3QgPSBvYmplY3Q7XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEV4cG9ydFNwZWNpZmllcjogZnVuY3Rpb24gKGxvY2FsLCBleHBvcnRlZCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkV4cG9ydFNwZWNpZmllcjtcbiAgICAgICAgICAgIHRoaXMuZXhwb3J0ZWQgPSBleHBvcnRlZCB8fCBsb2NhbDtcbiAgICAgICAgICAgIHRoaXMubG9jYWwgPSBsb2NhbDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hJbXBvcnREZWZhdWx0U3BlY2lmaWVyOiBmdW5jdGlvbiAobG9jYWwpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5JbXBvcnREZWZhdWx0U3BlY2lmaWVyO1xuICAgICAgICAgICAgdGhpcy5sb2NhbCA9IGxvY2FsO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEltcG9ydE5hbWVzcGFjZVNwZWNpZmllcjogZnVuY3Rpb24gKGxvY2FsKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguSW1wb3J0TmFtZXNwYWNlU3BlY2lmaWVyO1xuICAgICAgICAgICAgdGhpcy5sb2NhbCA9IGxvY2FsO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEV4cG9ydE5hbWVkRGVjbGFyYXRpb246IGZ1bmN0aW9uIChkZWNsYXJhdGlvbiwgc3BlY2lmaWVycywgc3JjKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguRXhwb3J0TmFtZWREZWNsYXJhdGlvbjtcbiAgICAgICAgICAgIHRoaXMuZGVjbGFyYXRpb24gPSBkZWNsYXJhdGlvbjtcbiAgICAgICAgICAgIHRoaXMuc3BlY2lmaWVycyA9IHNwZWNpZmllcnM7XG4gICAgICAgICAgICB0aGlzLnNvdXJjZSA9IHNyYztcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hFeHBvcnREZWZhdWx0RGVjbGFyYXRpb246IGZ1bmN0aW9uIChkZWNsYXJhdGlvbikge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkV4cG9ydERlZmF1bHREZWNsYXJhdGlvbjtcbiAgICAgICAgICAgIHRoaXMuZGVjbGFyYXRpb24gPSBkZWNsYXJhdGlvbjtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hFeHBvcnRBbGxEZWNsYXJhdGlvbjogZnVuY3Rpb24gKHNyYykge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkV4cG9ydEFsbERlY2xhcmF0aW9uO1xuICAgICAgICAgICAgdGhpcy5zb3VyY2UgPSBzcmM7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoSW1wb3J0U3BlY2lmaWVyOiBmdW5jdGlvbiAobG9jYWwsIGltcG9ydGVkKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguSW1wb3J0U3BlY2lmaWVyO1xuICAgICAgICAgICAgdGhpcy5sb2NhbCA9IGxvY2FsIHx8IGltcG9ydGVkO1xuICAgICAgICAgICAgdGhpcy5pbXBvcnRlZCA9IGltcG9ydGVkO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEltcG9ydERlY2xhcmF0aW9uOiBmdW5jdGlvbiAoc3BlY2lmaWVycywgc3JjKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguSW1wb3J0RGVjbGFyYXRpb247XG4gICAgICAgICAgICB0aGlzLnNwZWNpZmllcnMgPSBzcGVjaWZpZXJzO1xuICAgICAgICAgICAgdGhpcy5zb3VyY2UgPSBzcmM7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoWWllbGRFeHByZXNzaW9uOiBmdW5jdGlvbiAoYXJndW1lbnQsIGRlbGVnYXRlKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguWWllbGRFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5hcmd1bWVudCA9IGFyZ3VtZW50O1xuICAgICAgICAgICAgdGhpcy5kZWxlZ2F0ZSA9IGRlbGVnYXRlO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgfTtcblxuXG4gICAgZnVuY3Rpb24gcmVjb3JkRXJyb3IoZXJyb3IpIHtcbiAgICAgICAgdmFyIGUsIGV4aXN0aW5nO1xuXG4gICAgICAgIGZvciAoZSA9IDA7IGUgPCBleHRyYS5lcnJvcnMubGVuZ3RoOyBlKyspIHtcbiAgICAgICAgICAgIGV4aXN0aW5nID0gZXh0cmEuZXJyb3JzW2VdO1xuICAgICAgICAgICAgLy8gUHJldmVudCBkdXBsaWNhdGVkIGVycm9yLlxuICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgICAgICAgIGlmIChleGlzdGluZy5pbmRleCA9PT0gZXJyb3IuaW5kZXggJiYgZXhpc3RpbmcubWVzc2FnZSA9PT0gZXJyb3IubWVzc2FnZSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGV4dHJhLmVycm9ycy5wdXNoKGVycm9yKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjb25zdHJ1Y3RFcnJvcihtc2csIGNvbHVtbikge1xuICAgICAgICB2YXIgZXJyb3IgPSBuZXcgRXJyb3IobXNnKTtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHRocm93IGVycm9yO1xuICAgICAgICB9IGNhdGNoIChiYXNlKSB7XG4gICAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgICAgICAgaWYgKE9iamVjdC5jcmVhdGUgJiYgT2JqZWN0LmRlZmluZVByb3BlcnR5KSB7XG4gICAgICAgICAgICAgICAgZXJyb3IgPSBPYmplY3QuY3JlYXRlKGJhc2UpO1xuICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShlcnJvciwgJ2NvbHVtbicsIHsgdmFsdWU6IGNvbHVtbiB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgIHJldHVybiBlcnJvcjtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNyZWF0ZUVycm9yKGxpbmUsIHBvcywgZGVzY3JpcHRpb24pIHtcbiAgICAgICAgdmFyIG1zZywgY29sdW1uLCBlcnJvcjtcblxuICAgICAgICBtc2cgPSAnTGluZSAnICsgbGluZSArICc6ICcgKyBkZXNjcmlwdGlvbjtcbiAgICAgICAgY29sdW1uID0gcG9zIC0gKHNjYW5uaW5nID8gbGluZVN0YXJ0IDogbGFzdExpbmVTdGFydCkgKyAxO1xuICAgICAgICBlcnJvciA9IGNvbnN0cnVjdEVycm9yKG1zZywgY29sdW1uKTtc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HRva2VuLnR5cGUgPT09IFRva2VuLlN0cmluZ0xpdGVyYWwpID8gTWVzc2FnZXMuVW5leHBlY3RlZFN0cmluZyA6XG4gICAgICAgICAgICAgICAgICAgICh0b2tlbi50eXBlID09PSBUb2tlbi5UZW1wbGF0ZSkgPyBNZXNzYWdlcy5VbmV4cGVjdGVkVGVtcGxhdGUgOlxuICAgICAgICAgICAgICAgICAgICBNZXNzYWdlcy5VbmV4cGVjdGVkVG9rZW47XG5cbiAgICAgICAgICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gVG9rZW4uS2V5d29yZCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNGdXR1cmVSZXNlcnZlZFdvcmQodG9rZW4udmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtc2cgPSBNZXNzYWdlcy5VbmV4cGVjdGVkUmVzZXJ2ZWQ7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RyaWN0ICYmIGlzU3RyaWN0TW9kZVJlc2VydmVkV29yZCh0b2tlbi52YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1zZyA9IE1lc3NhZ2VzLlN0cmljdFJlc2VydmVkV29yZDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFsdWUgPSAodG9rZW4udHlwZSA9PT0gVG9rZW4uVGVtcGxhdGUpID8gdG9rZW4udmFsdWUucmF3IDogdG9rZW4udmFsdWU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB2YWx1ZSA9ICdJTExFR0FMJztcbiAgICAgICAgfVxuXG4gICAgICAgIG1zZyA9IG1zZy5yZXBsYWNlKCclMCcsIHZhbHVlKTtcblxuICAgICAgICByZXR1cm4gKHRva2VuICYmIHR5cGVvZiB0b2tlbi5saW5lTnVtYmVyID09PSAnbnVtYmVyJykgP1xuICAgICAgICAgICAgY3JlYXRlR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sb29rYWhlYWQudHlwZSA9PT0gVG9rZW4uSWRlbnRpZmllciAmJiBsb29rYWhlYWQudmFsdWUgPT09IGtleXdvcmQ7XG4gICAgfVxuXG4gICAgLy8gUmV0dXJuIHRydWUgaWYgdGhlIG5leHQgdG9rZW4gaXMgYW4gYXNzaWdubWVudCBvcGVyYXRvclxuXG4gICAgZnVuY3Rpb24gbWF0Y2hBc3NpZ24oKSB7XG4gICAgICAgIHZhciBvcDtcblxuICAgICAgICBpZiAobG9va2FoZWFkLnR5cGUgIT09IFRva2VuLlB1bmN0dWF0b3IpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBvcCA9IGxvb2thaGVhZC52YWx1ZTtcbiAgICAgICAgcmV0dXJuIG9wID09PSAnPScgfHxcbiAgICAgICAgICAgIG9wID09PSAnKj0nIHx8XG4gICAgICAgICAgICBvcCA9PT0gJy89JyB8fFxuICAgICAgICAgICAgb3AgPT09ICclPScgfHxcbiAgICAgICAgICAgIG9wID09PSAnKz0nIHx8XG4gICAgICAgICAgICBvcCA9PT0gJy09JyB8fFxuICAgICAgICAgICAgb3AgPT09ICc8PD0nIHx8XG4gICAgICAgICAgICBvcCA9PT0gJz4+PScgfHxcbiAgICAgICAgICAgIG9wID09PSAnPj4+PScgfHxcbiAgICAgICAgICAgIG9wID09PSAnJj0nIHx8XG4gICAgICAgICAgICBvcCA9PT0gJ149JyB8fFxuICAgICAgICAgICAgb3AgPT09ICd8PSc7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY29uc3VtZVNlbWljb2xvbigpIHtcbiAgICAgICAgLy8gQ2F0Y2ggdGhlIHZlcnkgY29tbW9uIGNhc2UgZmlyc3Q6IGltbWVkaWF0ZWx5IGEgc2VtaWNvbG9uIChVKzAwM0IpLlxuICAgICAgICBpZiAoc291cmNlLmNoYXJDb2RlQXQoc3RhcnRJbmRleCkgPT09IDB4M0IgfHwgbWF0Y2goJzsnKSkge1xuICAgICAgICA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AgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoKCcuLi4nKSkge1xuICAgICAgICAgICAgICAgICAgICByZXN0Tm9kZSA9IG5ldyBOb2RlKCk7XG4gICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgICAgICBwYXJhbXMucHVzaChsb29rYWhlYWQpO1xuICAgICAgICAgICAgICAgICAgICByZXN0ID0gcGFyc2VWYXJpYWJsZUlkZW50aWZpZXIoa2luZCk7XG4gICAgICAgICAgICAgICAgICAgIGVsZW1lbnRzLnB1c2gocmVzdE5vZGUuZmluaXNoUmVzdEVsZW1lbnQocmVzdCkpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBlbGVtZW50cy5wdXNoKHBhcnNlUGF0dGVybldpdGhEZWZhdWx0KHBhcmFtcywga2luZCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIW1hdGNoKCddJykpIHtcbiAgICAgICAgICAgICAgICAgICAgZXhwZWN0KCcsJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgIH1cblxuICAgICAgICBleHBlY3QoJ10nKTtcblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hBcnJheVBhdHRlcm4oZWxlbWVudHMpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlUHJvcGVydHlQYXR0ZXJuKHBhcmFtcywga2luZCkge1xuICAgICAgICB2YXIgbm9kZSA9IG5ldyBOb2RlKCksIGtleSwga2V5VG9rZW4sIGNvbXB1dGVkID0gbWF0Y2goJ1snKSwgaW5pdDtcbiAgICAgICAgaWYgKGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICBrZXlUb2tlbiA9IGxvb2thaGVhZDtcbiAgICAgICAgICAgIGtleSA9IHBhcnNlVmFyaWFibGVJZGVudGlmaWVyKCk7XG4gICAgICAgICAgICBpZiAobWF0Y2goJz0nKSkge1xuICAgICAgICAgICAgICAgIHBhcmFtcy5wdXNoKGtleVRva2VuKTtcbiAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICBpbml0ID0gcGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbigpO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoUHJvcGVydHkoXG4gICAgICAgICAgICAgICAgICAgICdpbml0Jywga2V5LCBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgbmV3IFdyYXBwaW5nTm9kZShrZXlUb2tlbikuZmluaXNoQXNzaWdubWVudFBhdHRlcm4oa2V5LCBpbml0KSwgZmFsc2UsIGZhbHNlKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIW1hdGNoKCc6JykpIHtcbiAgICAgICAgICAgICAgICBwYXJhbXMucHVzaChrZXlUb2tlbik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoUHJvcGVydHkoJ2luaXQnLCBrZXksIGZhbHNlLCBrZXksIGZhbHNlLCB0cnVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9IHBhcnNlT2JqZWN0UHJvcGVydHlLZXkoKTtcbiAgICAgICAgfVxuICAgICAgICBleHBlY3QoJzonKTtcbiAgICAgICAgaW5pdCA9IHBhcnNlUGF0dGVybldpdGhEZWZhdWx0KHBhcmFtcywga2luZCk7XG4gICAgICAgIHJldHVybiBub2RlLmZpbmlzaFByb3BlcnR5KCdpbml0Jywga2V5LCBjb21wdXRlZCwgaW5pdCwgZmFsc2UsIGZhbHNlKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZU9iamVjdFBhdHRlcm4ocGFyYW1zLCBraW5kKSB7XG4gICAgICAgIHZhciBub2RlID0gbmV3IE5vZGUoKSwgcHJvcGVydGllcyA9IFtdO1xuXG4gICAgICAgIGV4cGVjdCgneycpO1xuXG4gICAgICAgIHdoaWxlICghbWF0Y2goJ30nKSkge1xuICAgICAgICAgICAgcHJvcGVydGllcy5wdXNoKHBhcnNlUHJvcGVydHlQYXR0ZXJuKHBhcmFtcywga2luZCkpO1xuICAgICAgICAgICAgaWYgKCFtYXRjaCgnfScpKSB7XG4gICAgICAgICAgICAgICAgZXhwZWN0KCcsJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZXgoKTtcblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hPYmplY3RQYXR0ZXJuKHByb3BlcnRpZXMpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlUGF0dGVybihwYXJhbXMsIGtpbmQpIHtcbiAgICAgICAgaWYgKG1hdGNoKCdbJykpIHtcbiAgICAgICAgICAgIHJldHVybiBwYXJzZUFycmF5UGF0dGVybihwYXJhbXMsIGtpbmQpO1xuICAgICAgICB9IGVsc2UgaWYgKG1hdGNoKCd7JykpIHtcbiAgICAgICAgICAgIHJldHVybiBwYXJzZU9iamVjdFBhdHRlcm4ocGFyYW1zLCBraW5kKTtcbiAgICAgICAgfSBlbHNlIGlmIChtYXRjaEtleXdvcmQoJ2xldCcpKSB7XG4gICAgICAgICAgICBpZiAoa2luZCA9PT0gJ2NvbnN0JyB8fCBraW5kID09PSAnbGV0Jykge1xuICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCwgTWVzc2FnZXMuVW5leHBlY3RlZFRva2VuKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHBhcmFtcy5wdXNoKGxvb2thaGVhZCk7XG4gICAgICAgIHJldHVybiBwYXJzZVZhcmlhYmxlSWRlbnRpZmllcihraW5kKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZVBhdHRlcm5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XNoKG51bGwpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtYXRjaCgnLi4uJykpIHtcbiAgICAgICAgICAgICAgICByZXN0U3ByZWFkID0gbmV3IE5vZGUoKTtcbiAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICByZXN0U3ByZWFkLmZpbmlzaFNwcmVhZEVsZW1lbnQoaW5oZXJpdENvdmVyR3JhbW1hcihwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoIW1hdGNoKCddJykpIHtcbiAgICAgICAgICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBleHBlY3QoJywnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxlbWVudHMucHVzaChyZXN0U3ByZWFkKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZWxlbWVudHMucHVzaChpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24pKTtcblxuICAgICAgICAgICAgICAgIGlmICghbWF0Y2goJ10nKSkge1xuICAgICAgICAgICAgICAgICAgICBleHBlY3QoJywnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZXgoKTtcblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hBcnJheUV4cHJlc3Npb24oZWxlbWVudHMpO1xuICAgIH1cblxuICAgIC8vIEVDTUEtMjYyIDEyLjIuNiBPYmplY3QgSW5pdGlhbGl6ZXJcblxuICAgIGZ1bmN0aW9uIHBhcnNlUHJvcGVydHlGdW5jdGlvbihub2RlLCBwYXJhbUluZm8sIGlzR2VuZXJhdG9yKSB7XG4gICAgICAgIHZhciBwcmV2aW91c1N0cmljdCwgYm9keTtcblxuIC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GVydHlOYW1lKCkpIHtcbiAgICAgICAgICAgICAgICBjb21wdXRlZCA9IG1hdGNoKCdbJyk7XG4gICAgICAgICAgICAgICAga2V5ID0gcGFyc2VPYmplY3RQcm9wZXJ0eUtleSgpO1xuICAgICAgICAgICAgICAgIG1ldGhvZE5vZGUgPSBuZXcgTm9kZSgpO1xuICAgICAgICAgICAgICAgIGV4cGVjdCgnKCcpO1xuICAgICAgICAgICAgICAgIGV4cGVjdCgnKScpO1xuXG4gICAgICAgICAgICAgICAgc3RhdGUuYWxsb3dZaWVsZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHZhbHVlID0gcGFyc2VQcm9wZXJ0eUZ1bmN0aW9uKG1ldGhvZE5vZGUsIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zOiBbXSxcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdHM6IFtdLFxuICAgICAgICAgICAgICAgICAgICBzdHJpY3RlZDogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgZmlyc3RSZXN0cmljdGVkOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiBudWxsXG4gICAgICAgICAgICAgICAgfSwgZmFsc2UpO1xuICAgICAgICAgICAgICAgIHN0YXRlLmFsbG93WWllbGQgPSBwcmV2aW91c0FsbG93WWllbGQ7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hQcm9wZXJ0eSgnZ2V0Jywga2V5LCBjb21wdXRlZCwgdmFsdWUsIGZhbHNlLCBmYWxzZSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRva2VuLnZhbHVlID09PSAnc2V0JyAmJiBsb29rYWhlYWRQcm9wZXJ0eU5hbWUoKSkge1xuICAgICAgICAgICAgICAgIGNvbXB1dGVkID0gbWF0Y2goJ1snKTtcbiAgICAgICAgICAgICAgICBrZXkgPSBwYXJzZU9iamVjdFByb3BlcnR5S2V5KCk7XG4gICAgICAgICAgICAgICAgbWV0aG9kTm9kZSA9IG5ldyBOb2RlKCk7XG4gICAgICAgICAgICAgICAgZXhwZWN0KCcoJyk7XG5cbiAgICAgICAgICAgICAgICBvcHRpb25zID0ge1xuICAgICAgICAgICAgICAgICAgICBwYXJhbXM6IFtdLFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0Q291bnQ6IDAsXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHRzOiBbXSxcbiAgICAgICAgICAgICAgICAgICAgZmlyc3RSZXN0cmljdGVkOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBwYXJhbVNldDoge31cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmIChtYXRjaCgnKScpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgc3RhdGUuYWxsb3dZaWVsZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBwYXJzZVBhcmFtKG9wdGlvbnMpO1xuICAgICAgICAgICAgICAgICAgICBzdGF0ZS5hbGxvd1lpZWxkID0gcHJldmlvdXNBbGxvd1lpZWxkO1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5kZWZhdWx0Q291bnQgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMuZGVmYXVsdHMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBleHBlY3QoJyknKTtcblxuICAgICAgICAgICAgICAgIHN0YXRlLmFsbG93WWllbGQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IHBhcnNlUHJvcGVydHlGdW5jdGlvbihtZXRob2ROb2RlLCBvcHRpb25zLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgc3RhdGUuYWxsb3dZaWVsZCA9IHByZX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gICAgICAgIChrZXkudHlwZSA9PT0gU3ludGF4LkxpdGVyYWwgJiYga2V5LnZhbHVlID09PSAnX19wcm90b19fJyk7XG4gICAgICAgICAgICBpZiAoaGFzUHJvdG8udmFsdWUgJiYgcHJvdG8pIHtcbiAgICAgICAgICAgICAgICB0b2xlcmF0ZUVycm9yKE1lc3NhZ2VzLkR1cGxpY2F0ZVByb3RvUHJvcGVydHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGFzUHJvdG8udmFsdWUgfD0gcHJvdG87XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobWF0Y2goJzonKSkge1xuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICB2YWx1ZSA9IGluaGVyaXRDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbik7XG4gICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hQcm9wZXJ0eSgnaW5pdCcsIGtleSwgY29tcHV0ZWQsIHZhbHVlLCBmYWxzZSwgZmFsc2UpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRva2VuLnR5cGUgPT09IFRva2VuLklkZW50aWZpZXIpIHtcbiAgICAgICAgICAgIGlmIChtYXRjaCgnPScpKSB7XG4gICAgICAgICAgICAgICAgZmlyc3RDb3ZlckluaXRpYWxpemVkTmFtZUVycm9yID0gbG9va2FoZWFkO1xuICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaXNvbGF0ZUNvdmVyR3JhbW1hcihwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hQcm9wZXJ0eSgnaW5pdCcsIGtleSwgY29tcHV0ZWQsXG4gICAgICAgICAgICAgICAgICAgIG5ldyBXcmFwcGluZ05vZGUodG9rZW4pLmZpbmlzaEFzc2lnbm1lbnRQYXR0ZXJuKGtleSwgdmFsdWUpLCBmYWxzZSwgdHJ1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hQcm9wZXJ0eSgnaW5pdCcsIGtleSwgY29tcHV0ZWQsIGtleSwgZmFsc2UsIHRydWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZU9iamVjdEluaXRpYWxpemVyKCkge1xuICAgICAgICB2YXIgcHJvcGVydGllcyA9IFtdLCBoYXNQcm90byA9IHt2YWx1ZTogZmFsc2V9LCBub2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICBleHBlY3QoJ3snKTtcblxuICAgICAgICB3aGlsZSAoIW1hdGNoKCd9JykpIHtcbiAgICAgICAgICAgIHByb3BlcnRpZXMucHVzaChwYXJzZU9iamVjdFByb3BlcnR5KGhhc1Byb3RvKSk7XG5cbiAgICAgICAgICAgIGlmICghbWF0Y2goJ30nKSkge1xuICAgICAgICAgICAgICAgIGV4cGVjdENvbW1hU2VwYXJhdG9yKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBleHBlY3QoJ30nKTtcblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hPYmplY3RFeHByZXNzaW9uKHByb3BlcnRpZXMpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHJlaW50ZXJwcmV0RXhwcmVzc2lvbkFzUGF0dGVybihleHByKSB7XG4gICAgICAgIHZhciBpO1xuICAgICAgICBzd2l0Y2ggKGV4cHIudHlwZSkge1xuICAgICAgICBjYXNlIFN5bnRheC5JZGVudGlmaWVyOlxuICAgICAgICBjYXNlIFN5bnRheC5NZW1iZXJFeHByZXNzaW9uOlxuICAgICAgICBjYXNlIFN5bnRheC5SZXN0RWxlbWVudDpcbiAgICAgICAgY2FzZSBTeW50YXguQXNzaWdubWVudFBhdHRlcm46XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBTeW50YXguU3ByZWFkRWxlbWVudDpcbiAgICAgICAgICAgIGV4cHIudHlwZSA9IFN5bnRheC5SZXN0RWxlbWVudDtcbiAgICAgICAgICAgIHJlaW50ZXJwcmV0RXhwcmVzc2lvbkFzUGF0dGVybihleHByLmFyZ3VtZW50KTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFN5bnRheC5BcnJheUV4cHJlc3Npb246XG4gICAgICAgICAgICBleHByLnR5cGUgPSBTeW50YXguQXJyYXlQYXR0ZXJuO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGV4cHIuZWxlbWVudHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoZXhwci5lbGVtZW50c1tpXSAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oZXhwci5lbGVtZW50c1tpXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgU3ludGF4Lk9iamVjdEV4cHJlc3Npb246XG4gICAgICAgICAgICBleHByLnR5cGUgPSBTeW50YXguT2JqZWN0UGF0dGVybjtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBleHByLnByb3BlcnRpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oZXhwci5wcm9wZXJ0aWVzW2ldLnZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFN5bnRheC5Bc3NpZ25tZW50RXhwcmVzc2lvbjpcbiAgICAgICAgICAgIGV4cHIudHlwZSA9IFN5bnRheC5Bc3NpZ25tZW50UGF0dGVybjtcbiAgICAgICAgICAgIHJlaW50ZXJwcmV0RXhwcmVzc2lvbkFzU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gICAgZXhwcmVzc2lvbnMucHVzaChwYXJzZUV4cHJlc3Npb24oKSk7XG4gICAgICAgICAgICBxdWFzaSA9IHBhcnNlVGVtcGxhdGVFbGVtZW50KHsgaGVhZDogZmFsc2UgfSk7XG4gICAgICAgICAgICBxdWFzaXMucHVzaChxdWFzaSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hUZW1wbGF0ZUxpdGVyYWwocXVhc2lzLCBleHByZXNzaW9ucyk7XG4gICAgfVxuXG4gICAgLy8gRUNNQS0yNjIgMTIuMi4xMCBUaGUgR3JvdXBpbmcgT3BlcmF0b3JcblxuICAgIGZ1bmN0aW9uIHBhcnNlR3JvdXBFeHByZXNzaW9uKCkge1xuICAgICAgICB2YXIgZXhwciwgZXhwcmVzc2lvbnMsIHN0YXJ0VG9rZW4sIGksIHBhcmFtcyA9IFtdO1xuXG4gICAgICAgIGV4cGVjdCgnKCcpO1xuXG4gICAgICAgIGlmIChtYXRjaCgnKScpKSB7XG4gICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgIGlmICghbWF0Y2goJz0+JykpIHtcbiAgICAgICAgICAgICAgICBleHBlY3QoJz0+Jyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHR5cGU6IFBsYWNlSG9sZGVycy5BcnJvd1BhcmFtZXRlclBsYWNlSG9sZGVyLFxuICAgICAgICAgICAgICAgIHBhcmFtczogW10sXG4gICAgICAgICAgICAgICAgcmF3UGFyYW1zOiBbXVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIHN0YXJ0VG9rZW4gPSBsb29rYWhlYWQ7XG4gICAgICAgIGlmIChtYXRjaCgnLi4uJykpIHtcbiAgICAgICAgICAgIGV4cHIgPSBwYXJzZVJlc3RFbGVtZW50KHBhcmFtcyk7XG4gICAgICAgICAgICBleHBlY3QoJyknKTtcbiAgICAgICAgICAgIGlmICghbWF0Y2goJz0+JykpIHtcbiAgICAgICAgICAgICAgICBleHBlY3QoJz0+Jyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHR5cGU6IFBsYWNlSG9sZGVycy5BcnJvd1BhcmFtZXRlclBsYWNlSG9sZGVyLFxuICAgICAgICAgICAgICAgIHBhcmFtczogW2V4cHJdXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgaXNCaW5kaW5nRWxlbWVudCA9IHRydWU7XG4gICAgICAgIGV4cHIgPSBpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24pO1xuXG4gICAgICAgIGlmIChtYXRjaCgnLCcpKSB7XG4gICAgICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSBmYWxzZTtcbiAgICAgICAgICAgIGV4cHJlc3Npb25zID0gW2V4cHJdO1xuXG4gICAgICAgICAgICB3aGlsZSAoc3RhcnRJbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGlmICghbWF0Y2goJywnKSkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGV4KCk7XG5cbiAgICAgICAgICAgICAgICBpZiAobWF0Y2goJy4uLicpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghaXNCaW5kaW5nRWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBleHByZXNzaW9ucy5wdXNoKHBhcnNlUmVzdEVsZW1lbnQocGFyYW1zKSk7XG4gICAgICAgICAgICAgICAgICAgIGV4cGVjdCgnKScpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIW1hdGNoKCc9PicpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBleHBlY3QoJz0+Jyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZXhwcmVzc2lvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0RXhwcmVzc2lvbkFzUGF0dGVybihleHByZXNzaW9uc1tpXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFBsYWNlSG9sZGVycy5BcnJvd1BhcmFtZXRlclBsYWNlSG9sZGVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zOiBleHByZXNzaW9uc1xuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb25zLnB1c2goaW5oZXJpdENvdmVyR3JhbW1hcihwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGV4cHIgPSBuZXcgV3JhcHBpbmdOb2RlKHN0YXJ0VG9rZW4pLmZpbmlzaFNlcXVlbmNlRXhwcmVzc2lvbihleHByZXNzaW9ucyk7XG4gICAgICAgIH1cblxuXG4gICAgICAgIGV4cGVjdCgnKScpO1xuXG4gICAgICAgIGlmIChtYXRjaCgnPT4nKSkge1xuICAgICAgICAgICAgaWYgKGV4cHIudHlwZSA9PT0gU3ludGF4LklkZW50aWZpZXIgJiYgZXhwci5uYW1lID09PSAneWllbGQnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogUGxhY2VIb2xkZXJzLkFycm93UGFyYW1ldGVyUGxhY2VIb2xkZXIsXG4gICAgICAgICAgICAgICAgICAgIHBhcmFtczogW2V4cHJdXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCFpc0JpbmRpbmdFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGV4cHIudHlwZSA9PT0gU3ludGF4LlNlcXVlbmNlRXhwcmVzc2lvbikge1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBleHByLmV4cHJlc3Npb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0RXhwcmVzc2lvbkFzUGF0dGVybihleHByLmV4cHJlc3Npb25zW2ldKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0RXhwcmVzc2lvbkFzUGF0dGVybihleHByKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZXhwciA9IHtcbiAgICAgICAgICAgICAgICB0eXBlOiBQbGFjZUhvbGRlcnMuQXJyb3dQYXJhbWV0ZXJQbGFjZUhvbGRlcixcbiAgICAgICAgICAgICAgICBwYXJhbXM6IGV4cHIudHlwZSA9PT0gU3ludGF4LlNlcXVlbmNlRXhwcmVzc2lvbiA/IGV4cHIuZXhwcmVzc2lvbnMgOiBbZXhwcl1cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICByZXR1cm4gZXhwcjtcbiAgICB9XG5cblxuICAgIC8vIEVDTUEtMjYyIDEyLjIgUHJpbWFyeSBFeHByZXNzaW9uc1xuXG4gICAgZnVuY3Rpb24gcGFyc2VQcmltYXJ5RXhwcmVzc2lvbigpIHtcbiAgICAgICAgdmFyIHR5cGUsIHRva2VuLCBleHByLCBub2RlO1xuXG4gICAgICAgIGlmIChtYXRjaCgnKCcpKSB7XG4gICAgICAgICAgICBpc0JpbmRpbmdFbGVtZW50ID0gZmFsc2U7XG4gICAgICAgICAgICByZXR1cm4gaW5oZXJpdENvdmVyR3JhbW1hcihwYXJzZUdyb3VwRXhwcmVzc2lvbik7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobWF0Y2goJ1snKSkge1xuICAgICAgICAgICAgcmV0dXJuIGluaGVyaXRDb3ZlckdyYW1tYXIocGFyc2VBcnJheUluaXRpYWxpemVyKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChtYXRjaCgneycpKSB7XG4gICAgICAgICAgICByZXR1cm4gaW5oZXJpdENvdmVyR3JhbW1hcihwYXJzZU9iamVjdEluaXRpYWxpemVyKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHR5cGUgPSBsb29rYWhlYWQudHlwZTtcbiAgICAgICAgbm9kZSA9IG5ldyBOb2RlKCk7XG5cbiAgICAgICAgaWYgKHR5cGUgPT09IFRva2VuLklkZW50aWZpZXIpIHtcbiAgICAgICAgICAgIGlmIChzdGF0ZS5zb3VyY2VUeXBlID09PSAnbW9kdWxlJyAmJiBsb29rYWhlYWQudmFsdWUgPT09ICdhd2FpdCcpIHtcbiAgICAgICAgICAgICAgICB0b2xlcmF0ZVVuZXhwZWN0ZWRUb2tlbihsb29rYWhlYWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXhwciA9IG5vZGUuZmluaXNoSWRlbnRpZmllcihsZXgoKS52YWx1ZSk7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gVG9rZW4uU3RyaW5nTGl0ZXJhbCB8fCB0eXBlID09PSBUb2tlbi5OdW1lcmljTGl0ZXJhbCkge1xuICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgaWYgKHN0cmljdCAmJiBsb29rYWhlYWQub2N0YWwpIHtcbiAgICAgICAgICAgICAgICB0b2xlcmF0ZVVuZXhwZWN0ZWRUb2tlbihsb29rYWhlYWQsIE1lc3NhZ2VzLlN0cmljdE9jdGFsTGl0ZXJhbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBleHByID0gbm9kZS5maW5pc2hMaXRlcmFsKGxleCgpKTtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSBUb2tlbi5LZXl3b3JkKSB7XG4gICAgICAgICAgICBpZiAoIXN0cmljdCAmJiBzdGF0ZS5hbGxvd1lpZWxkICYmIG1hdGNoS2V5d29yZCgneWllbGQnKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZU5vbkNvbXB1dGVkUHJvcGVydHkoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghc3RyaWN0ICYmIG1hdGNoS2V5d29yZCgnbGV0JykpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hJZGVudGlmaWVyKGxleCgpLnZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgIGlmIChtYXRjaEtleXdvcmQoJ2Z1bmN0aW9uJykpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VGdW5jdGlvbkV4cHJlc3Npb24oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtYXRjaEtleXdvcmQoJ3RoaXMnKSkge1xuICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaFRoaXNFeHByZXNzaW9uKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCdjbGFzcycpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcn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gICAgICAgICAgIH1cbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgZXhwciA9IG5vZGUuZmluaXNoTGl0ZXJhbCh0b2tlbik7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gVG9rZW4uVGVtcGxhdGUpIHtcbiAgICAgICAgICAgIGV4cHIgPSBwYXJzZVRlbXBsYXRlTGl0ZXJhbCgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obGV4KCkpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGV4cHI7XG4gICAgfVxuXG4gICAgLy8gRUNNQS0yNjIgMTIuMyBMZWZ0LUhhbmQtU2lkZSBFeHByZXNzaW9uc1xuXG4gICAgZnVuY3Rpb24gcGFyc2VBcmd1bWVudHMoKSB7XG4gICAgICAgIHZhciBhcmdzID0gW10sIGV4cHI7XG5cbiAgICAgICAgZXhwZWN0KCcoJyk7XG5cbiAgICAgICAgaWYgKCFtYXRjaCgnKScpKSB7XG4gICAgICAgICAgICB3aGlsZSAoc3RhcnRJbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGlmIChtYXRjaCgnLi4uJykpIHtcbiAgICAgICAgICAgICAgICAgICAgZXhwciA9IG5ldyBOb2RlKCk7XG4gICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgICAgICBleHByLmZpbmlzaFNwcmVhZEVsZW1lbnQoaXNvbGF0ZUNvdmVyR3JhbW1hcihwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZXhwciA9IGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFyZ3MucHVzaChleHByKTtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2goJyknKSkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZXhwZWN0Q29tbWFTZXBhcmF0b3IoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGV4cGVjdCgnKScpO1xuXG4gICAgICAgIHJldHVybiBhcmdzO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlTm9uQ29tcHV0ZWRQcm9wZXJ0eSgpIHtcbiAgICAgICAgdmFyIHRva2VuLCBub2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICB0b2tlbiA9IGxleCgpO1xuXG4gICAgICAgIGlmICghaXNJZGVudGlmaWVyTmFtZSh0b2tlbikpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKHRva2VuKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBub2RlLmZpbmlzaElkZW50aWZpZXIodG9rZW4udmFsdWUpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlTm9uQ29tcHV0ZWRNZW1iZXIoKSB7XG4gICAgICAgIGV4cGVjdCgnLicpO1xuXG4gICAgICAgIHJldHVybiBwYXJzZU5vbkNvbXB1dGVkUHJvcGVydHkoKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZUNvbXB1dGVkTWVtYmVyKCkge1xuICAgICAgICB2YXIgZXhwcjtcblxuICAgICAgICBleHBlY3QoJ1snKTtcblxuICAgICAgICBleHByID0gaXNvbGF0ZUNvdmVyR3JhbW1hcihwYXJzZUV4cHJlc3Npb24pO1xuXG4gICAgICAgIGV4cGVjdCgnXScpO1xuXG4gICAgICAgIHJldHVybiBleHByO1xuICAgIH1cblxuICAgIC8vIEVDTUEtMjYyIDEyLjMuMyBUaGUgbmV3IE9wZXJhdG9yXG5cbiAgICBmdW5jdGlvbiBwYXJzZU5ld0V4cHJlc3Npb24oKSB7X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dGFydFRva2VuLCBwcmV2aW91c0FsbG93SW4gPSBzdGF0ZS5hbGxvd0luO1xuXG4gICAgICAgIHN0YXJ0VG9rZW4gPSBsb29rYWhlYWQ7XG4gICAgICAgIHN0YXRlLmFsbG93SW4gPSB0cnVlO1xuXG4gICAgICAgIGlmIChtYXRjaEtleXdvcmQoJ3N1cGVyJykgJiYgc3RhdGUuaW5GdW5jdGlvbkJvZHkpIHtcbiAgICAgICAgICAgIGV4cHIgPSBuZXcgTm9kZSgpO1xuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICBleHByID0gZXhwci5maW5pc2hTdXBlcigpO1xuICAgICAgICAgICAgaWYgKCFtYXRjaCgnKCcpICYmICFtYXRjaCgnLicpICYmICFtYXRjaCgnWycpKSB7XG4gICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGV4cHIgPSBpbmhlcml0Q292ZXJHcmFtbWFyKG1hdGNoS2V5d29yZCgnbmV3JykgPyBwYXJzZU5ld0V4cHJlc3Npb24gOiBwYXJzZVByaW1hcnlFeHByZXNzaW9uKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoOzspIHtcbiAgICAgICAgICAgIGlmIChtYXRjaCgnLicpKSB7XG4gICAgICAgICAgICAgICAgaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IHRydWU7XG4gICAgICAgICAgICAgICAgcHJvcGVydHkgPSBwYXJzZU5vbkNvbXB1dGVkTWVtYmVyKCk7XG4gICAgICAgICAgICAgICAgZXhwciA9IG5ldyBXcmFwcGluZ05vZGUoc3RhcnRUb2tlbikuZmluaXNoTWVtYmVyRXhwcmVzc2lvbignLicsIGV4cHIsIHByb3BlcnR5KTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWF0Y2goJygnKSkge1xuICAgICAgICAgICAgICAgIGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBhcmdzID0gcGFyc2VBcmd1bWVudHMoKTtcbiAgICAgICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKS5maW5pc2hDYWxsRXhwcmVzc2lvbihleHByLCBhcmdzKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWF0Y2goJ1snKSkge1xuICAgICAgICAgICAgICAgIGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHByb3BlcnR5ID0gcGFyc2VDb21wdXRlZE1lbWJlcigpO1xuICAgICAgICAgICAgICAgIGV4cHIgPSBuZXcgV3JhcHBpbmdOb2RlKHN0YXJ0VG9rZW4pLmZpbmlzaE1lbWJlckV4cHJlc3Npb24oJ1snLCBleHByLCBwcm9wZXJ0eSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5UZW1wbGF0ZSAmJiBsb29rYWhlYWQuaGVhZCkge1xuICAgICAgICAgICAgICAgIHF1YXNpID0gcGFyc2VUZW1wbGF0ZUxpdGVyYWwoKTtcbiAgICAgICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKS5maW5pc2hUYWdnZWRUZW1wbGF0ZUV4cHJlc3Npb24oZXhwciwgcXVhc2kpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdGF0ZS5hbGxvd0luID0gcHJldmlvdXNBbGxvd0luO1xuXG4gICAgICAgIHJldHVybiBleHByO1xuICAgIH1cblxuICAgIC8vIEVDTUEtMjYyIDEyLjMgTGVmdC1IYW5kLVNpZGUgRXhwcmVzc2lvbnNcblxuICAgIGZ1bmN0aW9uIHBhcnNlTGVmdEhhbmRTaWRlRXhwcmVzc2lvbigpIHtcbiAgICAgICAgdmFyIHF1YXNpLCBleHByLCBwcm9wZXJ0eSwgc3RhcnRUb2tlbjtcbiAgICAgICAgYXNzZXJ0KHN0YXRlLmFsbG93SW4sICdjYWxsZWUgb2YgbmV3IGV4cHJlc3Npb24gYWx3YXlzIGFsbG93IGluIGtleXdvcmQuJyk7XG5cbiAgICAgICAgc3RhcnRUb2tlbiA9IGxvb2thaGVhZDtcblxuICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCdzdXBlcicpICYmIHN0YXRlLmluRnVuY3Rpb25Cb2R5KSB7XG4gICAgICAgICAgICBleHByID0gbmV3IE5vZGUoKTtcbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgZXhwciA9IGV4cHIuZmluaXNoU3VwZXIoKTtcbiAgICAgICAgICAgIGlmICghbWF0Y2goJ1snKSAmJiAhbWF0Y2goJy4nKSkge1xuICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBleHByID0gaW5oZXJpdENvdmVyR3JhbW1hcihtYXRjaEtleXdvcmQoJ25ldycpID8gcGFyc2VOZXdFeHByZXNzaW9uIDogcGFyc2VQcmltYXJ5RXhwcmVzc2lvbik7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKDs7KSB7XG4gICAgICAgICAgICBpZiAobWF0Y2goJ1snKSkge1xuICAgICAgICAgICAgICAgIGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHByb3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wciwgdG9rZW4sIHN0YXJ0VG9rZW4gPSBsb29rYWhlYWQ7XG5cbiAgICAgICAgZXhwciA9IGluaGVyaXRDb3ZlckdyYW1tYXIocGFyc2VMZWZ0SGFuZFNpZGVFeHByZXNzaW9uQWxsb3dDYWxsKTtcblxuICAgICAgICBpZiAoIWhhc0xpbmVUZXJtaW5hdG9yICYmIGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5QdW5jdHVhdG9yKSB7XG4gICAgICAgICAgICBpZiAobWF0Y2goJysrJykgfHwgbWF0Y2goJy0tJykpIHtcbiAgICAgICAgICAgICAgICAvLyBFQ01BLTI2MiAxMS4zLjEsIDExLjMuMlxuICAgICAgICAgICAgICAgIGlmIChzdHJpY3QgJiYgZXhwci50eXBlID09PSBTeW50YXguSWRlbnRpZmllciAmJiBpc1Jlc3RyaWN0ZWRXb3JkKGV4cHIubmFtZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdG9sZXJhdGVFcnJvcihNZXNzYWdlcy5TdHJpY3RMSFNQb3N0Zml4KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoIWlzQXNzaWdubWVudFRhcmdldCkge1xuICAgICAgICAgICAgICAgICAgICB0b2xlcmF0ZUVycm9yKE1lc3NhZ2VzLkludmFsaWRMSFNJbkFzc2lnbm1lbnQpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgIHRva2VuID0gbGV4KCk7XG4gICAgICAgICAgICAgICAgZXhwciA9IG5ldyBXcmFwcGluZ05vZGUoc3RhcnRUb2tlbikuZmluaXNoUG9zdGZpeEV4cHJlc3Npb24odG9rZW4udmFsdWUsIGV4cHIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGV4cHI7XG4gICAgfVxuXG4gICAgLy8gRUNNQS0yNjIgMTIuNSBVbmFyeSBPcGVyYXRvcnNcblxuICAgIGZ1bmN0aW9uIHBhcnNlVW5hcnlFeHByZXNzaW9uKCkge1xuICAgICAgICB2YXIgdG9rZW4sIGV4cHIsIHN0YXJ0VG9rZW47XG5cbiAgICAgICAgaWYgKGxvb2thaGVhZC50eXBlICE9PSBUb2tlbi5QdW5jdHVhdG9yICYmIGxvb2thaGVhZC50eXBlICE9PSBUb2tlbi5LZXl3b3JkKSB7XG4gICAgICAgICAgICBleHByID0gcGFyc2VQb3N0Zml4RXhwcmVzc2lvbigpO1xuICAgICAgICB9IGVsc2UgaWYgKG1hdGNoKCcrKycpIHx8IG1hdGNoKCctLScpKSB7XG4gICAgICAgICAgICBzdGFydFRva2VuID0gbG9va2FoZWFkO1xuICAgICAgICAgICAgdG9rZW4gPSBsZXgoKTtcbiAgICAgICAgICAgIGV4cHIgPSBpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlVW5hcnlFeHByZXNzaW9uKTtcbiAgICAgICAgICAgIC8vIEVDTUEtMjYyIDExLjQuNCwgMTEuNC41XG4gICAgICAgICAgICBpZiAoc3RyaWN0ICYmIGV4cHIudHlwZSA9PT0gU3ludGF4LklkZW50aWZpZXIgJiYgaXNSZXN0cmljdGVkV29yZChleHByLm5hbWUpKSB7XG4gICAgICAgICAgICAgICAgdG9sZXJhdGVFcnJvcihNZXNzYWdlcy5TdHJpY3RMSFNQcmVmaXgpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIWlzQXNzaWdubWVudFRhcmdldCkge1xuICAgICAgICAgICAgICAgIHRvbGVyYXRlRXJyb3IoTWVzc2FnZXMuSW52YWxpZExIU0luQXNzaWdubWVudCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKS5maW5pc2hVbmFyeUV4cHJlc3Npb24odG9rZW4udmFsdWUsIGV4cHIpO1xuICAgICAgICAg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yYXRlRXJyb3IoTWVzc2FnZXMuU3RyaWN0RGVsZXRlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGV4cHIgPSBwYXJzZVBvc3RmaXhFeHByZXNzaW9uKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZXhwcjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBiaW5hcnlQcmVjZWRlbmNlKHRva2VuLCBhbGxvd0luKSB7XG4gICAgICAgIHZhciBwcmVjID0gMDtcblxuICAgICAgICBpZiAodG9rZW4udHlwZSAhPT0gVG9rZW4uUHVuY3R1YXRvciAmJiB0b2tlbi50eXBlICE9PSBUb2tlbi5LZXl3b3JkKSB7XG4gICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgfVxuXG4gICAgICAgIHN3aXRjaCAodG9rZW4udmFsdWUpIHtcbiAgICAgICAgY2FzZSAnfHwnOlxuICAgICAgICAgICAgcHJlYyA9IDE7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICcmJic6XG4gICAgICAgICAgICBwcmVjID0gMjtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ3wnOlxuICAgICAgICAgICAgcHJlYyA9IDM7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdeJzpcbiAgICAgICAgICAgIHByZWMgPSA0O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnJic6XG4gICAgICAgICAgICBwcmVjID0gNTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJz09JzpcbiAgICAgICAgY2FzZSAnIT0nOlxuICAgICAgICBjYXNlICc9PT0nOlxuICAgICAgICBjYXNlICchPT0nOlxuICAgICAgICAgICAgcHJlYyA9IDY7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICc8JzpcbiAgICAgICAgY2FzZSAnPic6XG4gICAgICAgIGNhc2UgJzw9JzpcbiAgICAgICAgY2FzZSAnPj0nOlxuICAgICAgICBjYXNlICdpbnN0YW5jZW9mJzpcbiAgICAgICAgICAgIHByZWMgPSA3O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnaW4nOlxuICAgICAgICAgICAgcHJlYyA9IGFsbG93SW4gPyA3IDogMDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJzw8JzpcbiAgICAgICAgY2FzZSAnPj4nOlxuICAgICAgICBjYXNlICc+Pj4nOlxuICAgICAgICAgICAgcHJlYyA9IDg7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICcrJzpcbiAgICAgICAgY2FzZSAnLSc6XG4gICAgICAgICAgICBwcmVjID0gOTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJyonOlxuICAgICAgICBjYXNlICcvJzpcbiAgICAgICAgY2FzZSAnJSc6XG4gICAgICAgICAgICBwcmVjID0gMTE7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcHJlYztcbiAgICB9XG5cbiAgICAvLyBFQ01BLTI2MiAxMi42IE11bHRpcGxpY2F0aXZlIE9wZXJhdG9yc1xuICAgIC8vIEVDTUEtMjYyIDEyLjcgQWRkaXRpdmUgT3BlcmF0b3JzXG4gICAgLy8gRUNNQS0yNjIgMTIuOCBCaXR3aXNlIFNoaWZ0IE9wZXJhdG9yc1xuICAgIC8vIEVDTUEtMjYyIDEyLjkgUmVsYXRpb25hbCBPcGVyYXRvcnNcbiAgICAvLyBFQ01BLTI2MiAxMi4xMCBFcXVhbGl0eSBPcGVyYXRvcnNcbiAgICAvLyBFQ01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WUgdG9wbW9zdCBlbnRyaWVzLlxuICAgICAgICAgICAgd2hpbGUgKChzdGFjay5sZW5ndGggPiAyKSAmJiAocHJlYyA8PSBzdGFja1tzdGFjay5sZW5ndGggLSAyXS5wcmVjKSkge1xuICAgICAgICAgICAgICAgIHJpZ2h0ID0gc3RhY2sucG9wKCk7XG4gICAgICAgICAgICAgICAgb3BlcmF0b3IgPSBzdGFjay5wb3AoKS52YWx1ZTtcbiAgICAgICAgICAgICAgICBsZWZ0ID0gc3RhY2sucG9wKCk7XG4gICAgICAgICAgICAgICAgbWFya2Vycy5wb3AoKTtcbiAgICAgICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShtYXJrZXJzW21hcmtlcnMubGVuZ3RoIC0gMV0pLmZpbmlzaEJpbmFyeUV4cHJlc3Npb24ob3BlcmF0b3IsIGxlZnQsIHJpZ2h0KTtcbiAgICAgICAgICAgICAgICBzdGFjay5wdXNoKGV4cHIpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBTaGlmdC5cbiAgICAgICAgICAgIHRva2VuID0gbGV4KCk7XG4gICAgICAgICAgICB0b2tlbi5wcmVjID0gcHJlYztcbiAgICAgICAgICAgIHN0YWNrLnB1c2godG9rZW4pO1xuICAgICAgICAgICAgbWFya2Vycy5wdXNoKGxvb2thaGVhZCk7XG4gICAgICAgICAgICBleHByID0gaXNvbGF0ZUNvdmVyR3JhbW1hcihwYXJzZVVuYXJ5RXhwcmVzc2lvbik7XG4gICAgICAgICAgICBzdGFjay5wdXNoKGV4cHIpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gRmluYWwgcmVkdWNlIHRvIGNsZWFuLXVwIHRoZSBzdGFjay5cbiAgICAgICAgaSA9IHN0YWNrLmxlbmd0aCAtIDE7XG4gICAgICAgIGV4cHIgPSBzdGFja1tpXTtcbiAgICAgICAgbWFya2Vycy5wb3AoKTtcbiAgICAgICAgd2hpbGUgKGkgPiAxKSB7XG4gICAgICAgICAgIC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AgICAgIGNhc2UgU3ludGF4LkFycmF5UGF0dGVybjpcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwYXJhbS5lbGVtZW50cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChwYXJhbS5lbGVtZW50c1tpXSAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBjaGVja1BhdHRlcm5QYXJhbShvcHRpb25zLCBwYXJhbS5lbGVtZW50c1tpXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgU3ludGF4LllpZWxkRXhwcmVzc2lvbjpcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgYXNzZXJ0KHBhcmFtLnR5cGUgPT09IFN5bnRheC5PYmplY3RQYXR0ZXJuLCAnSW52YWxpZCB0eXBlJyk7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcGFyYW0ucHJvcGVydGllcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGNoZWNrUGF0dGVyblBhcmFtKG9wdGlvbnMsIHBhcmFtLnByb3BlcnRpZXNbaV0udmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gcmVpbnRlcnByZXRBc0NvdmVyRm9ybWFsc0xpc3QoZXhwcikge1xuICAgICAgICB2YXIgaSwgbGVuLCBwYXJhbSwgcGFyYW1zLCBkZWZhdWx0cywgZGVmYXVsdENvdW50LCBvcHRpb25zLCB0b2tlbjtcblxuICAgICAgICBkZWZhdWx0cyA9IFtdO1xuICAgICAgICBkZWZhdWx0Q291bnQgPSAwO1xuICAgICAgICBwYXJhbXMgPSBbZXhwcl07XG5cbiAgICAgICAgc3dpdGNoIChleHByLnR5cGUpIHtcbiAgICAgICAgY2FzZSBTeW50YXguSWRlbnRpZmllcjpcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFBsYWNlSG9sZGVycy5BcnJvd1BhcmFtZXRlclBsYWNlSG9sZGVyOlxuICAgICAgICAgICAgcGFyYW1zID0gZXhwci5wYXJhbXM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgb3B0aW9ucyA9IHtcbiAgICAgICAgICAgIHBhcmFtU2V0OiB7fVxuICAgICAgICB9O1xuXG4gICAgICAgIGZvciAoaSA9IDAsIGxlbiA9IHBhcmFtcy5sZW5ndGg7IGkgPCBsZW47IGkgKz0gMSkge1xuICAgICAgICAgICAgcGFyYW0gPSBwYXJhbXNbaV07XG4gICAgICAgICAgICBzd2l0Y2ggKHBhcmFtLnR5cGUpIHtcbiAgICAgICAgICAgIGNhc2UgU3ludGF4LkFzc2lnbm1lbnRQYXR0ZXJuOlxuICAgICAgICAgICAgICAgIHBhcmFtc1tpXSA9IHBhcmFtLmxlZnQ7XG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtLnJpZ2h0LnR5cGUgPT09IFN5bnRheC5ZaWVsZEV4cHJlc3Npb24pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtLnJpZ2h0LmFyZ3VtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbihsb29rYWhlYWQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHBhcmFtLnJpZ2h0LnR5cGUgPSBTeW50YXguSWRlbnRpZmllcjtcbiAgICAgICAgICAgICAgICAgICAgcGFyYW0ucmlnaHQubmFtZSA9ICd5aWVsZCc7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBwYXJhbS5yaWdodC5hcmd1bWVudDtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHBhcmFtLnJpZ2h0LmRlbGVnYXRlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBkZWZhdWx0cy5wdXNoKHBhcmFtLnJpZ2h0KTtcbiAgICAgICAgICAgICAgICArK2RlZmF1bHRDb3VudDtcbiAgICAgICAgICAgICAgICBjaGVja1BhdHRlcm5QYXJhbShvcHRpb25zLCBwYXJhbS5sZWZ0KTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgY2hlY2tQYXR0ZXJuUGFyYW0ob3B0aW9ucywgcGFyYW0pO1xuICAgICAgICAgICAgICAgIHBhcmFtc1tpXSA9IHBhcmFtO1xuICAgICAgICAgICAgICAgIGRlZmF1bHRzLnB1c2gobnVsbCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc3RyaWN0IHx8ICFzdGF0ZS5hbGxvd1lpZWxkKSB7XG4gICAgICAgICAgICBmb3IgKGkgPSAwLCBsZW4gPSBwYXJhbXMubGVuZ3RoOyBpIDwgbGVuOyBpICs9IDEpIHtcbiAgICAgICAgICAgICAgICBwYXJhbSA9IHBhcmFtc1tpXTtcbiAgICAgICAgICAgICAgICBpZiAocGFyYW0udHlwZSA9PT0gU3ludGF4LllpZWxkRXhwcmVzc2lvbikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbihsb29rYWhlYWQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChvcHRpb25zLm1lc3NhZ2UgPT09IE1lc3NhZ2VzLlN0cmljdFBhcmFtRHVwZSkge1xuICAgICAgICAgICAgdG9rZW4gPSBzdHJpY3QgPyBvcHRpb25zLnN0cmljdGVkIDogb3B0aW9ucy5maXJzdFJlc3RyaWN0ZWQ7XG4gICA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bWF0Y2goJyonKTtcbiAgICAgICAgICAgIGlmIChkZWxlZ2F0ZSkge1xuICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgIGFyZ3VtZW50ID0gcGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoIW1hdGNoKCc7JykgJiYgIW1hdGNoKCd9JykgJiYgIW1hdGNoKCcpJykgJiYgbG9va2FoZWFkLnR5cGUgIT09IFRva2VuLkVPRikge1xuICAgICAgICAgICAgICAgICAgICBhcmd1bWVudCA9IHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24oKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzdGF0ZS5hbGxvd1lpZWxkID0gcHJldmlvdXNBbGxvd1lpZWxkO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGV4cHIuZmluaXNoWWllbGRFeHByZXNzaW9uKGFyZ3VtZW50LCBkZWxlZ2F0ZSk7XG4gICAgfVxuXG4gICAgLy8gRUNNQS0yNjIgMTIuMTQgQXNzaWdubWVudCBPcGVyYXRvcnNcblxuICAgIGZ1bmN0aW9uIHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24oKSB7XG4gICAgICAgIHZhciB0b2tlbiwgZXhwciwgcmlnaHQsIGxpc3QsIHN0YXJ0VG9rZW47XG5cbiAgICAgICAgc3RhcnRUb2tlbiA9IGxvb2thaGVhZDtcbiAgICAgICAgdG9rZW4gPSBsb29rYWhlYWQ7XG5cbiAgICAgICAgaWYgKCFzdGF0ZS5hbGxvd1lpZWxkICYmIG1hdGNoS2V5d29yZCgneWllbGQnKSkge1xuICAgICAgICAgICAgcmV0dXJuIHBhcnNlWWllbGRFeHByZXNzaW9uKCk7XG4gICAgICAgIH1cblxuICAgICAgICBleHByID0gcGFyc2VDb25kaXRpb25hbEV4cHJlc3Npb24oKTtcblxuICAgICAgICBpZiAoZXhwci50eXBlID09PSBQbGFjZUhvbGRlcnMuQXJyb3dQYXJhbWV0ZXJQbGFjZUhvbGRlciB8fCBtYXRjaCgnPT4nKSkge1xuICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgbGlzdCA9IHJlaW50ZXJwcmV0QXNDb3ZlckZvcm1hbHNMaXN0KGV4cHIpO1xuXG4gICAgICAgICAgICBpZiAobGlzdCkge1xuICAgICAgICAgICAgICAgIGZpcnN0Q292ZXJJbml0aWFsaXplZE5hbWVFcnJvciA9IG51bGw7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlQXJyb3dGdW5jdGlvbkV4cHJlc3Npb24obGlzdCwgbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBleHByO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG1hdGNoQXNzaWduKCkpIHtcbiAgICAgICAgICAgIGlmICghaXNBc3NpZ25tZW50VGFyZ2V0KSB7XG4gICAgICAgICAgICAgICAgdG9sZXJhdGVFcnJvcihNZXNzYWdlcy5JbnZhbGlkTEhTSW5Bc3NpZ25tZW50KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gRUNNQS0yNjIgMTIuMS4xXG4gICAgICAgICAgICBpZiAoc3RyaWN0ICYmIGV4cHIudHlwZSA9PT0gU3ludGF4LklkZW50aWZpZXIpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNSZXN0cmljdGVkV29yZChleHByLm5hbWUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKHRva2VuLCBNZXNzYWdlcy5TdHJpY3RMSFNBc3NpZ25tZW50KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzU3RyaWN0TW9kZVJlc2VydmVkV29yZChleHByLm5hbWUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKHRva2VuLCBNZXNzYWdlcy5TdHJpY3RSZXNlcnZlZFdvcmQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCFtYXRjaCgnPScpKSB7XG4gICAgICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oZXhwcik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRva2VuID0gbGV4KCk7XG4gICAgICAgICAgICByaWdodCA9IGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbik7XG4gICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKS5maW5pc2hBc3NpZ25tZW50RXhwcmVzc2lvbih0b2tlbi52YWx1ZSwgZXhwciwgcmlnaHQpO1xuICAgICAgICAgICAgZmlyc3RDb3ZlckluaXRpYWxpemVkTmFtZUVycm9yID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBleHByO1xuICAgIH1cblxuICAgIC8vIEVDTUEtMjYyIDEyLjE1IENvbW1hIE9wZXJhdG9yXG5cbiAgICBmdW5jdGlvbiBwYXJzZUV4cHJlc3Npb24oKSB7XG4gICAgICAgIHZhciBleHByLCBzdGFydFRva2VuID0gbG9va2FoZWFkLCBleHByZXNzaW9ucztcblxuICAgICAgICBleHByID0gaXNvbGF0ZUNvdmVyR3JhbW1hcihwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKTtcblxuICAgICAgICBpZiAobWF0Y2goJywnKSkge1xuICAgICAgICAgICAgZXhwcmVzc2lvbnMgPSBbZXhwcl07XG5cbiAgICAgICAgICAgIHdoaWxlIChzdGFydEluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFtYXRjaCgnLCcpKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICBleHByZXNzaW9ucy5wdXNoKGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbikpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKS5maW5pc2hTZXF1ZW5jZUV4cHJlc3Npb24oZXhwcmVzc2lvbnMpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGV4cHI7XG4gICAgfVxuXG4gICAgLy8gRUNNQS0yNjIgMTMuMiBCbG9ja1xuXG4gICAgZnVuY3Rpb24gcGFyc2VTdGF0ZW1lbnRMaXN0SXRlbSgpIHtcbiAgICAgICAgaWYgKGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5LZXl3b3JkKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKGxvb2thaGVhZC52YWx1ZSkge1xuICAgICAgICAgICAgY2FzZSAnZXhwb3J0JzpcbiAgICAgICAgICAgICAgICBpZiAoc3RhdGUuc291cmNlVHlwZSAhPT0gJ21vZHVsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgdG9sZXJhdGVVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkLCBNZXNzYWdlcy5JbGxlZ2FsRXhwb3J0RGVjbGFyYXRpb24pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VFeHBvcnREZWNsYXJhdGlvbigpO1xuICAgICAgICAgICAgY2FzZSAnaW1wb3J0JzpcbiAgICAgICAgICAgICAgICBpZiAoc3RhdGUuc291cmNlVHlwZSAhPT0gJ21vZHVsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgdG9sZXJhdGVVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkLCBNZXNzYWdlcy5JbGxlZ2FsSW1wb3J0RGVjbGFyYXRpb24pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VJbXBvcnREZWNsYXJhdGlvbigpO1xuICAgICAgICAgICAgY2FzZSAnY29uc3QnOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUxleGljYWxEZWNsYXJhdGlvbih7aW5Gb3I6IGZhbHNlfSk7XG4gICAgICAgICAgICBjYXNlICdmdW5jdGlvbic6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlRnVuY3Rpb25EZWNsYXJhdGlvbihuZXcgTm9kZSgpKTtcbiAgICAgICAgICAgIGNhc2UgJ2NsYXNzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VDbGFzc0RlY2xhcmF0aW9uKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCdsZXQnKSAmJiBpc0xleGljYWxEZWNsYXJhdGlvbigpKSB7XG4gICAgICAgICAgICByZXR1cm4gcGFyc2VMZXhpY2FsRGVjbGFyYXRpb24oe2luRm9yOiBmYWxzZX0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHBhcnNlU3RhdGVtZW50KCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VTdGF0ZW1lbnRMaXN0KCkge1xuICAgICAgICB2YXIgbGlzdCA9IFtdO1xuICAgICAgICB3aGlsZSAoc3RhcnRJbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKG1hdGNoKCd9JykpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxpc3QucHVzaChwYXJzZVN0YXRlbWVudExpc3RJdGVtKCkpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGxpc3Q7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VCbG9jaygpIHtcbiAgICAgICAgdmFyIGJsb2NrLCBub2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICBleHBlY3QoJ3snKTtcblxuICAgICAgICBibG9jayA9IHBhcnNlU3RhdGVtZW50TGlzdCgpO1xuXG4gICAgICAgIGV4cGVjdCgnfScpO1xuXG4gICAgICAgIHJldHVybiBub2RlLmZpbmlzaEJsb2NrU3RhdGVtZW50KGJsb2NrKTtcbiAgICB9XG5cbiAgICAvLyBFQ01BLTI2MiAxMy4zLjIgVmFyaWFibGUgU3RhdGVtZW50XG5cbiAgICBmdW5jdGlvbiBwYXJzZVZhcmlhYmxlSWRlbnRpZmllcihraW5kKSB7XG4gICAgICAgIHZhciB0b2tlbiwgbm9kZSA9IG5ldyBOb2RlKCk7XG5cbiAgICAgICAgdG9rZW4gPSBsZXgoKTtcblxuICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gVG9rZW4uS2V5d29yZCAmJiB0b2tlbi52YWx1ZSA9PT0gJ3lpZWxkJykge1xuICAgICAgICAgICAgaWYgKHN0cmljdCkge1xuICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKHRva2VuLCBNZXNzYWdlcy5TdHJpY3RSZXNlcnZlZFdvcmQpO1xuICAgICAgICAgICAgfSBpZiAoIXN0YXRlLmFsbG93WWllbGQpIHtcbiAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbih0b2tlbik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAodG9rZW4udHlwZSAhPT0gVG9rZW4uSWRlbnRpZmllcikge1xuICAgICAgICAgICAgaWYgKHN0cmljdCAmJiB0b2tlbi50eXBlID09PSBUb2tlbi5LZXl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AgICAgICAgfVxuXG4gICAgICAgIGlmIChtYXRjaCgnPScpKSB7XG4gICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgIGluaXQgPSBpc29sYXRlQ292ZXJHcmFtbWFyKHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24pO1xuICAgICAgICB9IGVsc2UgaWYgKGlkLnR5cGUgIT09IFN5bnRheC5JZGVudGlmaWVyICYmICFvcHRpb25zLmluRm9yKSB7XG4gICAgICAgICAgICBleHBlY3QoJz0nKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBub2RlLmZpbmlzaFZhcmlhYmxlRGVjbGFyYXRvcihpZCwgaW5pdCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VWYXJpYWJsZURlY2xhcmF0aW9uTGlzdChvcHRpb25zKSB7XG4gICAgICAgIHZhciBvcHQsIGxpc3Q7XG5cbiAgICAgICAgb3B0ID0geyBpbkZvcjogb3B0aW9ucy5pbkZvciB9O1xuICAgICAgICBsaXN0ID0gW3BhcnNlVmFyaWFibGVEZWNsYXJhdGlvbihvcHQpXTtcblxuICAgICAgICB3aGlsZSAobWF0Y2goJywnKSkge1xuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICBsaXN0LnB1c2gocGFyc2VWYXJpYWJsZURlY2xhcmF0aW9uKG9wdCkpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGxpc3Q7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VWYXJpYWJsZVN0YXRlbWVudChub2RlKSB7XG4gICAgICAgIHZhciBkZWNsYXJhdGlvbnM7XG5cbiAgICAgICAgZXhwZWN0S2V5d29yZCgndmFyJyk7XG5cbiAgICAgICAgZGVjbGFyYXRpb25zID0gcGFyc2VWYXJpYWJsZURlY2xhcmF0aW9uTGlzdCh7IGluRm9yOiBmYWxzZSB9KTtcblxuICAgICAgICBjb25zdW1lU2VtaWNvbG9uKCk7XG5cbiAgICAgICAgcm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VBc3NpZ25tZW50RXhwcmVzc2lvbik7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hWYXJpYWJsZURlY2xhcmF0b3IoaWQsIGluaXQpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlQmluZGluZ0xpc3Qoa2luZCwgb3B0aW9ucykge1xuICAgICAgICB2YXIgbGlzdCA9IFtwYXJzZUxleGljYWxCaW5kaW5nKGtpbmQsIG9wdGlvbnMpXTtcblxuICAgICAgICB3aGlsZSAobWF0Y2goJywnKSkge1xuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICBsaXN0LnB1c2gocGFyc2VMZXhpY2FsQmluZGluZyhraW5kLCBvcHRpb25zKSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbGlzdDtcbiAgICB9XG5cblxuICAgIGZ1bmN0aW9uIHRva2VuaXplclN0YXRlKCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxuICAgICAgICAgICAgbGluZU51bWJlcjogbGluZU51bWJlcixcbiAgICAgICAgICAgIGxpbmVTdGFydDogbGluZVN0YXJ0LFxuICAgICAgICAgICAgaGFzTGluZVRlcm1pbmF0b3I6IGhhc0xpbmVUZXJtaW5hdG9yLFxuICAgICAgICAgICAgbGFzdEluZGV4OiBsYXN0SW5kZXgsXG4gICAgICAgICAgICBsYXN0TGluZU51bWJlcjogbGFzdExpbmVOdW1iZXIsXG4gICAgICAgICAgICBsYXN0TGluZVN0YXJ0OiBsYXN0TGluZVN0YXJ0LFxuICAgICAgICAgICAgc3RhcnRJbmRleDogc3RhcnRJbmRleCxcbiAgICAgICAgICAgIHN0YXJ0TGluZU51bWJlcjogc3RhcnRMaW5lTnVtYmVyLFxuICAgICAgICAgICAgc3RhcnRMaW5lU3RhcnQ6IHN0YXJ0TGluZVN0YXJ0LFxuICAgICAgICAgICAgbG9va2FoZWFkOiBsb29rYWhlYWQsXG4gICAgICAgICAgICB0b2tlbkNvdW50OiBleHRyYS50b2tlbnMgPyBleHRyYS50b2tlbnMubGVuZ3RoIDogMFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHJlc2V0VG9rZW5pemVyU3RhdGUodHMpIHtcbiAgICAgICAgaW5kZXggPSB0cy5pbmRleDtcbiAgICAgICAgbGluZU51bWJlciA9IHRzLmxpbmVOdW1iZXI7XG4gICAgICAgIGxpbmVTdGFydCA9IHRzLmxpbmVTdGFydDtcbiAgICAgICAgaGFzTGluZVRlcm1pbmF0b3IgPSB0cy5oYXNMaW5lVGVybWluYXRvcjtcbiAgICAgICAgbGFzdEluZGV4ID0gdHMubGFzdEluZGV4O1xuICAgICAgICBsYXN0TGluZU51bWJlciA9IHRzLmxhc3RMaW5lTnVtYmVyO1xuICAgICAgICBsYXN0TGluZVN0YXJ0ID0gdHMubGFzdExpbmVTdGFydDtcbiAgICAgICAgc3RhcnRJbmRleCA9IHRzLnN0YXJ0SW5kZXg7XG4gICAgICAgIHN0YXJ0TGluZU51bWJlciA9IHRzLnN0YXJ0TGluZU51bWJlcjtcbiAgICAgICAgc3RhcnRMaW5lU3RhcnQgPSB0cy5zdGFydExpbmVTdGFydDtcbiAgICAgICAgbG9va2FoZWFkID0gdHMubG9va2FoZWFkO1xuICAgICAgICBpZiAoZXh0cmEudG9rZW5zKSB7XG4gICAgICAgICAgICBleHRyYS50b2tlbnMuc3BsaWNlKHRzLnRva2VuQ291bnQsIGV4dHJhLnRva2Vucy5sZW5ndGgpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNMZXhpY2FsRGVjbGFyYXRpb24oKSB7XG4gICAgICAgIHZhciBsZXhpY2FsLCB0cztcblxuICAgICAgICB0cyA9IHRva2VuaXplclN0YXRlKCk7XG5cbiAgICAgICAgbGV4KCk7XG4gICAgICAgIGxleGljYWwgPSAobG9va2FoZWFkLnR5cGUgPT09IFRva2VuLklkZW50aWZpZXIpIHx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XG5cbiAgICAgICAgZXhwZWN0KCcoJyk7XG5cbiAgICAgICAgaWYgKG1hdGNoKCc7JykpIHtcbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKG1hdGNoS2V5d29yZCgndmFyJykpIHtcbiAgICAgICAgICAgICAgICBpbml0ID0gbmV3IE5vZGUoKTtcbiAgICAgICAgICAgICAgICBsZXgoKTtcblxuICAgICAgICAgICAgICAgIHN0YXRlLmFsbG93SW4gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBkZWNsYXJhdGlvbnMgPSBwYXJzZVZhcmlhYmxlRGVjbGFyYXRpb25MaXN0KHsgaW5Gb3I6IHRydWUgfSk7XG4gICAgICAgICAgICAgICAgc3RhdGUuYWxsb3dJbiA9IHByZXZpb3VzQWxsb3dJbjtcblxuICAgICAgICAgICAgICAgIGlmIChkZWNsYXJhdGlvbnMubGVuZ3RoID09PSAxICYmIG1hdGNoS2V5d29yZCgnaW4nKSkge1xuICAgICAgICAgICAgICAgICAgICBpbml0ID0gaW5pdC5maW5pc2hWYXJpYWJsZURlY2xhcmF0aW9uKGRlY2xhcmF0aW9ucyk7XG4gICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgICAgICBsZWZ0ID0gaW5pdDtcbiAgICAgICAgICAgICAgICAgICAgcmlnaHQgPSBwYXJzZUV4cHJlc3Npb24oKTtcbiAgICAgICAgICAgICAgICAgICAgaW5pdCA9IG51bGw7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChkZWNsYXJhdGlvbnMubGVuZ3RoID09PSAxICYmIGRlY2xhcmF0aW9uc1swXS5pbml0ID09PSBudWxsICYmIG1hdGNoQ29udGV4dHVhbEtleXdvcmQoJ29mJykpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5pdCA9IGluaXQuZmluaXNoVmFyaWFibGVEZWNsYXJhdGlvbihkZWNsYXJhdGlvbnMpO1xuICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICAgICAgbGVmdCA9IGluaXQ7XG4gICAgICAgICAgICAgICAgICAgIHJpZ2h0ID0gcGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgICAgICAgICBpbml0ID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgZm9ySW4gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpbml0ID0gaW5pdC5maW5pc2hWYXJpYWJsZURlY2xhcmF0aW9uKGRlY2xhcmF0aW9ucyk7XG4gICAgICAgICAgICAgICAgICAgIGV4cGVjdCgnOycpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWF0Y2hLZXl3b3JkKCdjb25zdCcpIHx8IG1hdGNoS2V5d29yZCgnbGV0JykpIHtcbiAgICAgICAgICAgICAgICBpbml0ID0gbmV3IE5vZGUoKTtcbiAgICAgICAgICAgICAgICBraW5kID0gbGV4KCkudmFsdWU7XG5cbiAgICAgICAgICAgICAgICBpZiAoIXN0cmljdCAmJiBsb29rYWhlYWQudmFsdWUgPT09ICdpbicpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5pdCA9IGluaXQuZmluaXNoSWRlbnRpZmllcihraW5kKTtcbiAgICAgICAgICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICAgICAgICAgIGxlZnQgPSBpbml0O1xuICAgICAgICAgICAgICAgICAgICByaWdodCA9IHBhcnNlRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgICAgICAgICBpbml0ID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzdGF0ZS5hbGxvd0luID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIGRlY2xhcmF0aW9ucyA9IHBhcnNlQmluZGluZ0xpc3Qoa2luZCwge2luRm9yOiB0cnVlfSk7XG4gICAgICAgICAgICAgICAgICAgIHN0YXRlLmFsbG93SW4gPSBwcmV2aW91c0FsbG93SW47XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGRlY2xhcmF0aW9ucy5sZW5ndGggPT09IDEgJiYgZGVjbGFyYXRpb25zWzBdLmluaXQgPT09IG51bGwgJiYgbWF0Y2hLZXl3b3JkKCdpbicpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbml0ID0gaW5pdC5maW5pc2hMZXhpY2FsRGVjbGFyYXRpb24oZGVjbGFyYXRpb25zLCBraW5kKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCA9IGluaXQ7XG4gICAgICAgICAgICAgICAgICAgICAgICByaWdodCA9IHBhcnNlRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZGVjbGFyYXRpb25zLmxlbmd0aCA9PT0gMSAmJiBkZWNsYXJhdGlvbnNbMF0uaW5pdCA9PT0gbnVsbCAmJiBtYXRjaENvbnRleHR1YWxLZXl3b3JkKCdvZicpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbml0ID0gaW5pdC5maW5pc2hMZXhpY2FsRGVjbGFyYXRpb24oZGVjbGFyYXRpb25zLCBraW5kKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCA9IGluaXQ7XG4gICAgICAgICAgICAgICAgICAgICAgICByaWdodCA9IHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluaXQgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9ySW4gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN1bWVTZW1pY29sb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluaXQgPSBpbml0LmZpbmlzaExleGljYWxEZWNsYXJhdGlvbihkZWNsYXJhdGlvbnMsIGtpbmQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpbml0U3RhcnRUb2tlbiA9IGxvb2thaGVhZDtcbiAgICAgICAgICAgICAgICBzdGF0ZS5hbGxvd0luID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgaW5pdCA9IGluaGVyaXRDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbik7XG4gICAgICAgICAgICAgICAgc3RhdGUuYWxsb3dJbiA9IHByZXZpb3VzQWxsb3dJbjtcblxuICAgICAgICAgICAgICAgIGlmIChtYXRjaEtleXdvcmQoJ2luJykpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0Fzc2lnbm1lbnRUYXJnZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvbGVyYXRlRXJyb3IoTWVzc2FnZXMuSW52YWxpZExIU0luRm9ySW4pO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0RXhwcmVzc2lvbkFzUGF0dGVybihpbml0KTtcbiAgICAgICAgICAgICAgICAgICAgbGVmdCA9IGluaXQ7XG4gICAgICAgICAgICAgICAgICAgIHJpZ2h0ID0gcGFyc2VFeHByZXNzaW9uKCk7XG4gICAgICAgICAgICAgICAgICAgIGluaXQgPSBudWxsO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWF0Y2hDb250ZXh0dWFsS2V5d29yZCgnb2YnKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWlzQXNzaWdubWVudFRhcmdldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdG9sZXJhdGVFcnJvcihNZXNzYWdlcy5JbnZhbGlkTEhTSW5Gb3JMb29wKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oaW5pdCk7XG4gICAgICAgICAgICAgICAgICAgIGxlZnQgPSBpbml0O1xuICAgICAgICAgICAgICAgICAgICByaWdodCA9IHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24oKTtcbiAgICAgICAgICAgICAgICAgICAgaW5pdCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGZvckluID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hdGNoKCcsJykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluaXRTZXEgPSBbaW5pdF07XG4gICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAobWF0Y2goJywnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRTZXEucHVzaChpc29sYXRlQ292ZXJHcmFtbWFyKHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24pKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGluaXQgPSBuZXcgV3JhcHBpbmdOb2RlKGluaXRTdGFydFRva2VuKS5maW5pc2hTZXF1ZW5jZUV4cHJlc3Npb24oaW5pdFNlcSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZXhwZWN0KCc7Jyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGVvZiBsZWZ0ID09PSAndW5kZWZpbmVkJykge1xuXG4gICAgICAgICAgICBpZiAoIW1hdGNoKCc7JykpIHtcbiAgICAgICAgICAgICAgICB0ZXN0ID0gcGFyc2VFeHByZXNzaW9uKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBleHBlY3QoJzsnKTtcblxuICAgICAgICAgICAgaWYgKCFtYXRjaCgnKScpKSB7XG4gICAgICAgICAgICAgICAgdXBkYXRlID0gcGFyc2VFeHByZXNzaW9uKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBleHBlY3QoJyknKTtcblxuICAgICAgICBvbGRJbkl0ZXJhdGlvbiA9IHN0YXRlLmluSXRlcmF0aW9uO1xuICAgICAgICBzdGF0ZS5pbkl0ZXJhdGlvbiA9IHRydWU7XG5cbiAgICAgICAgYm9keSA9IGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VTdGF0ZW1lbnQpO1xuXG4gICAgICAgIHN0YXRlLmluSXRlcmF0aW9uID0gb2xkSW5JdGVyYXRpb247XG5cbiAgICAgICAgcmV0dXJuICh0eXBlb2YgbGVmdCA9PT0gJ3VuZGVmaW5lZCcpID9cbiAgICAgICAgICAgICAgICBub2RlLmZpbmlzaEZvclN0YXRlbWVudChpbml0LCB0ZXN0LCB1cGRhdGUsIGJvZHkpIDpcbiAgICAgICAgICAgICAgICBmb3JJbiA/IG5vZGUuZmluaXNoRm9ySW5TdGF0ZW1lbnQobGVmdCwgcmlnaHQsIGJvZHkpIDpcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5maW5pc2hGb3JPZlN0YXRlbWVudChsZWZ0LCByaWdodCwgYm9keSk7XG4gICAgfVxuXG4gICAgLy8gRUNNQS0yNjIgMTMuOCBUaGUgY29udGludWUgc3RhdGVtZW50XG5cbiAgICBmdW5jdGlvbiBwYXJzZUNvbnRpbnVlU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdmFyIGxhYmVsID0gbnVsbCwga2V5O1xuXG4gICAgICAgIGV4cGVjdEtleXdvcmQoJ2NvbnRpbnVlJyk7XG5cbiAgICAgICAgLy8gT3B0aW1pemUgdGhlIG1vc3QgY29tbW9uIGZvcm06ICdjb250aW51ZTsnLlxuICAgICAgICBpZiAoc291cmNlLmNoYXJDb2RlQXQoc3RhcnRJbmRleCkgPT09IDB4M0IpIHtcbiAgICAgICAgICAgIGxleCgpO1xuXG4gICAgICAgICAgICBpZiAoIXN0YXRlLmluSXRlcmF0aW9uKSB7XG4gICAgICAgICAgICAgICAgdGhyb3dFcnJvcihNZXNzYWdlcy5JbGxlZ2FsQ29udGludWUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hDb250aW51ZVN0YXRlbWVudChudWxsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChoYXNMaW5lVGVybWluYXRvcikge1xuICAgICAgICAgICAgaWYgKCFzdGF0ZS5pbkl0ZXJhdGlvbikge1xuICAgICAgICAgICAgICAgIHRocm93RXJyb3IoTWVzc2FnZXMuSWxsZWdhbENvbnRpbnVlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoQ29udGludWVTdGF0ZW1lbnQobnVsbCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobG9va2FoZWFkLnR5cGUgPT09IFRva2VuLklkZW50aWZpZXIpIHtcbiAgICAgICAgICAgIGxhYmVsID0gcGFyc2VWYXJpYWJsZUlkZW50aWZpZXIoKTtcblxuICAgICAgICAgICAga2V5ID0gJyQnICsgbGFiZWwubmFtZTtcbiAgICAgICAgICAgIGlmICghT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHN0YXRlLmxhYmVsU2V0LCBrZXkpKSB7XG4gICAgICAgICAgICAgICAgdGhyb3dFcnJvcihNZXNzYWdlcy5Vbmtub3duTGFiZWwsIGxhYmVsLm5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29u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lYWspO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICBsYWJlbCA9IHBhcnNlVmFyaWFibGVJZGVudGlmaWVyKCk7XG5cbiAgICAgICAgICAgIGtleSA9ICckJyArIGxhYmVsLm5hbWU7XG4gICAgICAgICAgICBpZiAoIU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChzdGF0ZS5sYWJlbFNldCwga2V5KSkge1xuICAgICAgICAgICAgICAgIHRocm93RXJyb3IoTWVzc2FnZXMuVW5rbm93bkxhYmVsLCBsYWJlbC5uYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN1bWVTZW1pY29sb24oKTtcblxuICAgICAgICBpZiAobGFiZWwgPT09IG51bGwgJiYgIShzdGF0ZS5pbkl0ZXJhdGlvbiB8fCBzdGF0ZS5pblN3aXRjaCkpIHtcbiAgICAgICAgICAgIHRocm93RXJyb3IoTWVzc2FnZXMuSWxsZWdhbEJyZWFrKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBub2RlLmZpbmlzaEJyZWFrU3RhdGVtZW50KGxhYmVsKTtcbiAgICB9XG5cbiAgICAvLyBFQ01BLTI2MiAxMy4xMCBUaGUgcmV0dXJuIHN0YXRlbWVudFxuXG4gICAgZnVuY3Rpb24gcGFyc2VSZXR1cm5TdGF0ZW1lbnQobm9kZSkge1xuICAgICAgICB2YXIgYXJndW1lbnQgPSBudWxsO1xuXG4gICAgICAgIGV4cGVjdEtleXdvcmQoJ3JldHVybicpO1xuXG4gICAgICAgIGlmICghc3RhdGUuaW5GdW5jdGlvbkJvZHkpIHtcbiAgICAgICAgICAgIHRvbGVyYXRlRXJyb3IoTWVzc2FnZXMuSWxsZWdhbFJldHVybik7XG4gICAgICAgIH1cblxuICAgICAgICAvLyAncmV0dXJuJyBmb2xsb3dlZCBieSBhIHNwYWNlIGFuZCBhbiBpZGVudGlmaWVyIGlzIHZlcnkgY29tbW9uLlxuICAgICAgICBpZiAoc291cmNlLmNoYXJDb2RlQXQobGFzdEluZGV4KSA9PT0gMHgyMCkge1xuICAgICAgICAgICAgaWYgKGlzSWRlbnRpZmllclN0YXJ0KHNvdXJjZS5jaGFyQ29kZUF0KGxhc3RJbmRleCArIDEpKSkge1xuICAgICAgICAgICAgICAgIGFyZ3VtZW50ID0gcGFyc2VFeHByZXNzaW9uKCk7XG4gICAgICAgICAgICAgICAgY29uc3VtZVNlbWljb2xvbigpO1xuICAgICAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaFJldHVyblN0YXRlbWVudChhcmd1bWVudCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaGFzTGluZVRlcm1pbmF0b3IpIHtcbiAgICAgICAgICAgIC8vIEhBQ0tcbiAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaFJldHVyblN0YXRlbWVudChudWxsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghbWF0Y2goJzsnKSkge1xuICAgICAgICAgICAgaWYgKCFtYXRjaCgnfScpICYmIGxvb2thaGVhZC50eXBlICE9PSBUb2tlbi5FT0YpIHtcbiAgICAgICAgICAgICAgICBhcmd1bWVudCA9IHBhcnNlRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29uc3VtZVNlbWljb2xvbigpO1xuXG4gICAgICAgIHJldHVybiBub2RlLmZpbmlzaFJldHVyblN0YXRlbWVudChhcmd1bWVudCk7XG4gICAgfVxuXG4gICAgLy8gRUNNQS0yNjIgMTMuMTEgVGhlIHdpdGggc3RhdGVtZW50XG5cbiAgICBmdW5jdGlvbiBwYXJzZVdpdGhTdGF0ZW1lbnQobm9kZSkge1xuICAgICAgICB2YXIgb2JqZWN0LCBib2R5O1xuXG4gICAgICAgIGlmIChzdHJ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lU3RhdGVtZW50KCkge1xuICAgICAgICB2YXIgdHlwZSA9IGxvb2thaGVhZC50eXBlLFxuICAgICAgICAgICAgZXhwcixcbiAgICAgICAgICAgIGxhYmVsZWRCb2R5LFxuICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgbm9kZTtcblxuICAgICAgICBpZiAodHlwZSA9PT0gVG9rZW4uRU9GKSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbihsb29rYWhlYWQpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGUgPT09IFRva2VuLlB1bmN0dWF0b3IgJiYgbG9va2FoZWFkLnZhbHVlID09PSAneycpIHtcbiAgICAgICAgICAgIHJldHVybiBwYXJzZUJsb2NrKCk7XG4gICAgICAgIH1cbiAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gaXNCaW5kaW5nRWxlbWVudCA9IHRydWU7XG4gICAgICAgIG5vZGUgPSBuZXcgTm9kZSgpO1xuXG4gICAgICAgIGlmICh0eXBlID09PSBUb2tlbi5QdW5jdHVhdG9yKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKGxvb2thaGVhZC52YWx1ZSkge1xuICAgICAgICAgICAgY2FzZSAnOyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlRW1wdHlTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICcoJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VFeHByZXNzaW9uU3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSBUb2tlbi5LZXl3b3JkKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKGxvb2thaGVhZC52YWx1ZSkge1xuICAgICAgICAgICAgY2FzZSAnYnJlYWsnOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUJyZWFrU3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAnY29udGludWUnOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUNvbnRpbnVlU3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAnZGVidWdnZXInOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZURlYnVnZ2VyU3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAnZG8nOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZURvV2hpbGVTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICdmb3InOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUZvclN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ2Z1bmN0aW9uJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VGdW5jdGlvbkRlY2xhcmF0aW9uKG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAnaWYnOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUlmU3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAncmV0dXJuJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VSZXR1cm5TdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICdzd2l0Y2gnOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZVN3aXRjaFN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ3Rocm93JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VUaHJvd1N0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ3RyeSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlVHJ5U3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAndmFyJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VWYXJpYWJsZVN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ3doaWxlJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VXaGlsZVN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ3dpdGgnOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZVdpdGhTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZXhwciA9IHBhcnNlRXhwcmVzc2lvbigpO1xuXG4gICAgICAgIC8vIEVDTUEtMjYyIDEyLjEyIExhYmVsbGVkIFN0YXRlbWVudHNcbiAgICAgICAgaWYgKChleHByLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSAmJiBtYXRjaCgnOicpKSB7XG4gICAgICAgICAgICBsZXgoKTtcblxuICAgICAgICAgICAga2V5ID0gJyQnICsgZXhwci5uYW1lO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChzdGF0ZS5sYWJlbFNldCwga2V5KSkge1xuICAgICAgICAgICAgICAgIHRocm93RXJyb3IoTWVzc2FnZXMuUmVkZWNsYXJhdGlvbiwgJ0xhYmVsJywgZXhwci5uYW1lKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgc3RhdGUubGFiZWxTZXRba2V5XSA9IHRydWU7XG4gICAgICAgICAgICBsYWJlbGVkQm9keSA9IHBhcnNlU3RhdGVtZW50KCk7XG4gICAgICAgICAgICBkZWxldGUgc3RhdGUubGFiZWxTZXRba2V5XTtcbiAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaExhYmVsZWRTdGF0ZW1lbnQoZXhwciwgbGFiZWxlZEJvZHkpO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3VtZVNlbWljb2xvbigpO1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uICAgICAgICAgICAgcGFyYW1zOiBbXSxcbiAgICAgICAgICAgIGRlZmF1bHRDb3VudDogMCxcbiAgICAgICAgICAgIGRlZmF1bHRzOiBbXSxcbiAgICAgICAgICAgIGZpcnN0UmVzdHJpY3RlZDogZmlyc3RSZXN0cmljdGVkXG4gICAgICAgIH07XG5cbiAgICAgICAgZXhwZWN0KCcoJyk7XG5cbiAgICAgICAgaWYgKCFtYXRjaCgnKScpKSB7XG4gICAgICAgICAgICBvcHRpb25zLnBhcmFtU2V0ID0ge307XG4gICAgICAgICAgICB3aGlsZSAoc3RhcnRJbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGlmICghcGFyc2VQYXJhbShvcHRpb25zKSkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZXhwZWN0KCcsJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBleHBlY3QoJyknKTtcblxuICAgICAgICBpZiAob3B0aW9ucy5kZWZhdWx0Q291bnQgPT09IDApIHtcbiAgICAgICAgICAgIG9wdGlvbnMuZGVmYXVsdHMgPSBbXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBwYXJhbXM6IG9wdGlvbnMucGFyYW1zLFxuICAgICAgICAgICAgZGVmYXVsdHM6IG9wdGlvbnMuZGVmYXVsdHMsXG4gICAgICAgICAgICBzdHJpY3RlZDogb3B0aW9ucy5zdHJpY3RlZCxcbiAgICAgICAgICAgIGZpcnN0UmVzdHJpY3RlZDogb3B0aW9ucy5maXJzdFJlc3RyaWN0ZWQsXG4gICAgICAgICAgICBtZXNzYWdlOiBvcHRpb25zLm1lc3NhZ2VcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZUZ1bmN0aW9uRGVjbGFyYXRpb24obm9kZSwgaWRlbnRpZmllcklzT3B0aW9uYWwpIHtcbiAg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gICAgICBsZXgoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbWV0aG9kID0gbmV3IE5vZGUoKTtcbiAgICAgICAgICAgICAgICB0b2tlbiA9IGxvb2thaGVhZDtcbiAgICAgICAgICAgICAgICBpc1N0YXRpYyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGNvbXB1dGVkID0gbWF0Y2goJ1snKTtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2goJyonKSkge1xuICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBrZXkgPSBwYXJzZU9iamVjdFByb3BlcnR5S2V5KCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChrZXkubmFtZSA9PT0gJ3N0YXRpYycgJiYgKGxvb2thaGVhZFByb3BlcnR5TmFtZSgpIHx8IG1hdGNoKCcqJykpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGxvb2thaGVhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlzU3RhdGljID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbXB1dGVkID0gbWF0Y2goJ1snKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaCgnKicpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleSA9IHBhcnNlT2JqZWN0UHJvcGVydHlLZXkoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBtZXRob2QgPSB0cnlQYXJzZU1ldGhvZERlZmluaXRpb24odG9rZW4sIGtleSwgY29tcHV0ZWQsIG1ldGhvZCk7XG4gICAgICAgICAgICAgICAgaWYgKG1ldGhvZCkge1xuICAgICAgICAgICAgICAgICAgICBtZXRob2RbJ3N0YXRpYyddID0gaXNTdGF0aWM7IC8vIGpzY3M6aWdub3JlIHJlcXVpcmVEb3ROb3RhdGlvblxuICAgICAgICAgICAgICAgICAgICBpZiAobWV0aG9kLmtpbmQgPT09ICdpbml0Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kLmtpbmQgPSAnbWV0aG9kJztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWlzU3RhdGljKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1ldGhvZC5jb21wdXRlZCAmJiAobWV0aG9kLmtleS5uYW1lIHx8IG1ldGhvZC5rZXkudmFsdWUudG9TdHJpbmcoKSkgPT09ICdjb25zdHJ1Y3RvcicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWV0aG9kLmtpbmQgIT09ICdtZXRob2QnIHx8ICFtZXRob2QubWV0aG9kIHx8IG1ldGhvZC52YWx1ZS5nZW5lcmF0b3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4odG9rZW4sIE1lc3NhZ2VzLkNvbnN0cnVjdG9yU3BlY2lhbE1ldGhvZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoYXNDb25zdHJ1Y3Rvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbih0b2tlbiwgTWVzc2FnZXMuRHVwbGljYXRlQ29uc3RydWN0b3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc0NvbnN0cnVjdG9yID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kLmtpbmQgPSAnY29uc3RydWN0b3InO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtZXRob2QuY29tcHV0ZWQgJiYgKG1ldGhvZC5rZXkubmFtZSB8fCBtZXRob2Qua2V5LnZhbHVlLnRvU3RyaW5nKCkpID09PSAncHJvdG90eXBlJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKHRva2VuLCBNZXNzYWdlcy5TdGF0aWNQcm90b3R5cGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZC50eXBlID0gU3ludGF4Lk1ldGhvZERlZmluaXRpb247XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBtZXRob2QubWV0aG9kO1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgbWV0aG9kLnNob3J0aGFuZDtcbiAgICAgICAgICAgICAgICAgICAgYm9keS5wdXNoKG1ldGhvZCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV4KCk7XG4gICAgICAgIHJldHVybiBjbGFzc0JvZHkuZmluaXNoQ2xhc3NCb2R5KGJvZHkpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlQ2xhc3NEZWNsYXJhdGlvbihpZGVudGlmaWVySXNPcHRpb25hbCkge1xuICAgICAgICB2YXIgaWQgPSBudWxsLCBzdXBlckNsYXNzID0gbnVsbCwgY2xhc3NOb2RlID0gbmV3I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mYXVsdH0gZnJvbSAnc29tZXRoaW5nJztcbiAgICAgICAgICAgIGRlZiA9IG5ldyBOb2RlKCk7XG4gICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgIGxvY2FsID0gZGVmLmZpbmlzaElkZW50aWZpZXIoJ2RlZmF1bHQnKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxvY2FsID0gcGFyc2VWYXJpYWJsZUlkZW50aWZpZXIoKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWF0Y2hDb250ZXh0dWFsS2V5d29yZCgnYXMnKSkge1xuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICBleHBvcnRlZCA9IHBhcnNlTm9uQ29tcHV0ZWRQcm9wZXJ0eSgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBub2RlLmZpbmlzaEV4cG9ydFNwZWNpZmllcihsb2NhbCwgZXhwb3J0ZWQpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlRXhwb3J0TmFtZWREZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIHZhciBkZWNsYXJhdGlvbiA9IG51bGwsXG4gICAgICAgICAgICBpc0V4cG9ydEZyb21JZGVudGlmaWVyLFxuICAgICAgICAgICAgc3JjID0gbnVsbCwgc3BlY2lmaWVycyA9IFtdO1xuXG4gICAgICAgIC8vIG5vbi1kZWZhdWx0IGV4cG9ydFxuICAgICAgICBpZiAobG9va2FoZWFkLnR5cGUgPT09IFRva2VuLktleXdvcmQpIHtcbiAgICAgICAgICAgIC8vIGNvdmVyczpcbiAgICAgICAgICAgIC8vIGV4cG9ydCB2YXIgZiA9IDE7XG4gICAgICAgICAgICBzd2l0Y2ggKGxvb2thaGVhZC52YWx1ZSkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ2xldCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnY29uc3QnOlxuICAgICAgICAgICAgICAgICAgICBkZWNsYXJhdGlvbiA9IHBhcnNlTGV4aWNhbERlY2xhcmF0aW9uKHtpbkZvcjogZmFsc2V9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoRXhwb3J0TmFtZWREZWNsYXJhdGlvbihkZWNsYXJhdGlvbiwgc3BlY2lmaWVycywgbnVsbCk7XG4gICAgICAgICAgICAgICAgY2FzZSAndmFyJzpcbiAgICAgICAgICAgICAgICBjYXNlICdjbGFzcyc6XG4gICAgICAgICAgICAgICAgY2FzZSAnZnVuY3Rpb24nOlxuICAgICAgICAgICAgICAgICAgICBkZWNsYXJhdGlvbiA9IHBhcnNlU3RhdGVtZW50TGlzdEl0ZW0oKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoRXhwb3J0TmFtZWREZWNsYXJhdGlvbihkZWNsYXJhdGlvbiwgc3BlY2lmaWVycywgbnVsbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBleHBlY3QoJ3snKTtcbiAgICAgICAgd2hpbGUgKCFtYXRjaCgnfScpKSB7XG4gICAgICAgICAgICBpc0V4cG9ydEZyb21JZGVudGlmaWVyID0gaXNFeHBvcnRGcm9tSWRlbnRpZmllciB8fCBtYXRjaEtleXdvcmQoJ2RlZmF1bHQnKTtcbiAgICAgICAgICAgIHNwZWNpZmllcnMucHVzaChwYXJzZUV4cG9ydFNwZWNpZmllcigpKTtcbiAgICAgICAgICAgIGlmICghbWF0Y2goJ30nKSkge1xuICAgICAgICAgICAgICAgIGV4cGVjdCgnLCcpO1xuICAgICAgICAgICAgICAgIGlmIChtYXRjaCgnfScpKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBleHBlY3QoJ30nKTtcblxuICAgICAgICBpZiAobWF0Y2hDb250ZXh0dWFsS2V5d29yZCgnZnJvbScpKSB7XG4gICAgICAgICAgICAvLyBjb3Zlc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cGFyc2VOYW1lZEltcG9ydHMoKSB7XG4gICAgICAgIHZhciBzcGVjaWZpZXJzID0gW107XG4gICAgICAgIC8vIHtmb28sIGJhciBhcyBiYXN9XG4gICAgICAgIGV4cGVjdCgneycpO1xuICAgICAgICB3aGlsZSAoIW1hdGNoKCd9JykpIHtcbiAgICAgICAgICAgIHNwZWNpZmllcnMucHVzaChwYXJzZUltcG9ydFNwZWNpZmllcigpKTtcbiAgICAgICAgICAgIGlmICghbWF0Y2goJ30nKSkge1xuICAgICAgICAgICAgICAgIGV4cGVjdCgnLCcpO1xuICAgICAgICAgICAgICAgIGlmIChtYXRjaCgnfScpKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBleHBlY3QoJ30nKTtcbiAgICAgICAgcmV0dXJuIHNwZWNpZmllcnM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VJbXBvcnREZWZhdWx0U3BlY2lmaWVyKCkge1xuICAgICAgICAvLyBpbXBvcnQgPGZvbz4gLi4uO1xuICAgICAgICB2YXIgbG9jYWwsIG5vZGUgPSBuZXcgTm9kZSgpO1xuXG4gICAgICAgIGxvY2FsID0gcGFyc2VOb25Db21wdXRlZFByb3BlcnR5KCk7XG5cbiAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoSW1wb3J0RGVmYXVsdFNwZWNpZmllcihsb2NhbCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VJbXBvcnROYW1lc3BhY2VTcGVjaWZpZXIoKSB7XG4gICAgICAgIC8vIGltcG9ydCA8KiBhcyBmb28+IC4uLjtcbiAgICAgICAgdmFyIGxvY2FsLCBub2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICBleHBlY3QoJyonKTtcbiAgICAgICAgaWYgKCFtYXRjaENvbnRleHR1YWxLZXl3b3JkKCdhcycpKSB7XG4gICAgICAgICAgICB0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FjZVNwZWNpZmllcigpKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNJZGVudGlmaWVyTmFtZShsb29rYWhlYWQpICYmICFtYXRjaEtleXdvcmQoJ2RlZmF1bHQnKSkge1xuICAgICAgICAgICAgICAgIC8vIGltcG9ydCBmb29cbiAgICAgICAgICAgICAgICBzcGVjaWZpZXJzLnB1c2gocGFyc2VJbXBvcnREZWZhdWx0U3BlY2lmaWVyKCkpO1xuICAgICAgICAgICAgICAgIGlmIChtYXRjaCgnLCcpKSB7XG4gICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2goJyonKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW1wb3J0IGZvbywgKiBhcyBmb29cbiAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNpZmllcnMucHVzaChwYXJzZUltcG9ydE5hbWVzcGFjZVNwZWNpZmllcigpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtYXRjaCgneycpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpbXBvcnQgZm9vLCB7YmFyfVxuICAgICAgICAgICAgICAgICAgICAgICAgc3BlY2lmaWVycyA9IHNwZWNpZmllcnMuY29uY2F0KHBhcnNlTmFtZWRJbXBvcnRzKCkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obGV4KCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIW1hdGNoQ29udGV4dHVhbEtleXdvcmQoJ2Zyb20nKSkge1xuICAgICAgICAgICAgICAgIHRocm93RXJyb3IobG9va2FoZWFkLnZhbHVlID9cbiAgICAgICAgICAgICAgICAgICAgICAgIE1lc3NhZ2VzLlVuZXhwZWN0ZWRUb2tlbiA6IE1lc3NhZ2VzLk1pc3NpbmdGcm9tQ2xhdXNlLCBsb29rYWhlYWQudmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICBzcmMgPSBwYXJzZU1vZHVsZVNwZWNpZmllcigpO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3VtZVNlbWljb2xvbigpO1xuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hJbXBvcnREZWNsYXJhdGlvbihzcGVjaWZpZXJzLCBzcmMpO1xuICAgIH1cblxuICAgIC8vIEVDTUEtMjYyIDE1LjEgU2NyaXB0c1xuXG4gICAgZnVuY3Rpb24gcGFyc2VTY3JpcHRCb2R5KCkge1xuICAgICAgICB2YXIgc3RhdGVtZW50LCBib2R5ID0gW10sIHRva2VuLCBkaXJlY3RpdmUsIGZpcnN0UmVzdHJpY3RlZDtcblxuICAgICAgICB3aGlsZSAoc3RhcnRJbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgdG9rZW4gPSBsb29rYWhlYWQ7XG4gICAgICAgICAgICBpZiAodG9rZW4udHlwZSAhPT0gVG9rZW4uU3RyaW5nTGl0ZXJhbCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzdGF0ZW1lbnQgPSBwYXJzZVN0YXRlbWVudExpc3RJdGVtKCk7XG4gICAgICAgICAgICBib2R5LnB1c2goc3RhdGVtZW50KTtcbiAgICAgICAgICAgIGlmIChzdGF0ZW1lbnQuZXhwcmVzc2lvbi50eXBlICE9PSBTeW50YXguTGl0ZXJhbCkge1xuICAgICAgICAgICAgICAgIC8vIHRoaXMgaXMgbm90IGRpcmVjdGl2ZVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGlyZWN0aXZlID0gc291cmNlLnNsaWNlKHRva2VuLnN0YXJ0ICsgMSwgdG9rZW4uZW5kIC0gMSk7XG4gICAgICAgICAgICBpZiAoZGlyZWN0aXZlID09PSAndXNlIHN0cmljdCcpIHtcbiAgICAgICAgICAgICAgICBzdHJpY3QgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGlmIChmaXJzdFJlc3RyaWN0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgdG9sZXJhdGVVbmV4cGVjdGVkVG9rZW4oZmlyc3RSZXN0cmljdGVkLCBNZXNzYWdlcy5TdHJpY3RPY3RhbExpdGVyYWwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKCFmaXJzdFJlc3RyaWN0ZWQgJiYgdG9rZW4ub2N0YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgZmlyc3RSZXN0cmljdGVkID0gdG9rZW47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgd2hpbGUgKHN0YXJ0SW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIHN0YXRlbWVudCA9IHBhcnNlU3RhdGVtZW50TGlzdEl0ZW0oKTtcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBpZiAqL1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBzdGF0ZW1lbnQgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBib2R5LnB1c2goc3RhdGVtZW50KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gYm9keTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZVByb2dyYW0oKSB7XG4gICAgICAgIHZhciBib2R5LCBub2RlO1xuXG4gICAgICAgIHBlZWsoKTtcbiAgICAgICAgbm9kZSA9IG5ldyBOb2RlKCk7XG5cbiAgICAgICAgYm9keSA9IHBhcnNlU2NyaXB0Qm9keSgpO1xuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hQcm9ncmFtKGJvZHksIHN0YXRlLnNvdXJjZVR5cGUpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGZpbHRlclRva2VuTG9jYXRpb24oKSB7XG4gICAgICAgIHZhciBpLCBlbnRyeSwgdG9rZW4sIHRva2VucyA9IFtdO1xuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBleHRyYS50b2tlbnMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgIGVudHJ5ID0gZXh0cmEudG9rZW5zW2ldO1xuICAgICAgICAgICAgdG9rZW4gPSB7XG4gICAgICAgICAgICAgICAgdHlwZTogZW50cnkudHlwZSxcbiAgICAgICAgICAgICAgICB2YWx1ZTogZW50cnkudmFsdWVcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoZW50cnkucmVnZXgpIHtcbiAgICAgICAgICAgICAgICB0b2tlbi5yZWdleCA9IHtcbiAgICAgICAgICAgICAgICAgICAgcGF0dGVybjogZW50cnkucmVnZXgucGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3M6IGVudHJ5LnJlZ2V4LmZsYWdzXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChleHRyYS5yYW5nZSkge1xuICAgICAgICAgICAgICAgIHRva2VuLnJhbmdlID0gZW50cnkucmFuZ2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZXh0cmEubG9jKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4ubG9jID0gZW50cnkubG9jO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdG9rZW5zLnB1c2godG9rZW4pO1xuICAgICAgICB9XG5cbiAgICAgICAgZXh0cmEudG9rZW5zID0gdG9rZW5zO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHRva2VuaXplKGNvZGUsIG9wdGlvbnMsIGRlbGVnYXRlKSB7XG4gICAgICAgIHZhciB0b1N0cmluZyxcbiAgICAgICAgICAgIHRva2VucztcblxuICAgICAgICB0b1N0cmluZyA9IFN0cmluZztcbiAgICAgICAgaWYgKHR5cGVvZiBjb2RlICE9PSAnc3RyaW5nJyAmJiAhKGNvZGUgaW5zdGFuY2VvZiBTdHJpbmcpKSB7XG4gICAgICAgICAgICBjb2RlID0gdG9TdHJpbmcoY29kZSk7XG4gICAgICAgIH1cblxuICAgICAgICBzb3VyY2UgPSBjb2RlO1xuICAgICAgICBpbmRleCA9IDA7XG4gICAgICAgIGxpbmVOdW1iZXIgPSAoc291cmNlLmxlbmd0aCA+IDApID8gMSA6IDA7XG4gICAgICAgIGxpbmVTdGFydCA9IDA7XG4gICAgICAgIHN0YXJ0SW5kZXggPSBpbmRleDtcbiAgICAgICAgc3RhcnRMaW5lTnVtYmVyID0gbGluZU51bWJlcjtcbiAgICAgICAgc3RhcnRMaW5lU3RhcnQgPSBsaW5lU3RhcnQ7XG4gICAgICAgIGxlbmd0aCA9IHNvdXJjZS5sZW5ndGg7XG4gICAgICAgIGxvb2thaGVhZCA9IG51bGw7XG4gICAgICAgIHN0YXRlID0ge1xuICAgICAgICAgICAgYWxsb3dJbjogdHJ1ZSxcbiAgICAgICAgICAgIGFsbG93WWllbGQ6IHRydWUsXG4gICAgICAgICAgICBsYWJlbFNldDoge30sXG4gICAgICAgICAgICBpbkZ1bmN0aW9uQm9keTogZmFsc2UsXG4gICAgICAgICAgICBpbkl0ZXJhdGlvbjogZmFsc2UsXG4gICAgICAgICAgICBpblN3aXRjaDogZmFsc2UsXG4gICAgICAgICAgICBsYXN0Q29tbWVudFN0YXJ0OiAtMSxcbiAgICAgICAgICAgIGN1cmx5U3RhY2s6IFtdXG4gICAgICAgIH07XG5cbiAgICAgICAgZXh0cmEgPSB7fTtcblxuICAgICAgICAvLyBPcHRpb25zIG1hdGNo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cbiAgICAgICAgICAgIGlmIChsb29rYWhlYWQudHlwZSA9PT0gVG9rZW4uRU9GKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGV4dHJhLnRva2VucztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICB3aGlsZSAobG9va2FoZWFkLnR5cGUgIT09IFRva2VuLkVPRikge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGxleEVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChleHRyYS5lcnJvcnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlY29yZEVycm9yKGxleEVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGhhdmUgdG8gYnJlYWsgb24gdGhlIGZpcnN0IGVycm9yXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB0byBhdm9pZCBpbmZpbml0ZSBsb29wcy5cbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbGV4RXJyb3I7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRva2VucyA9IGV4dHJhLnRva2VucztcbiAgICAgICAgICAgIGlmICh0eXBlb2YgZXh0cmEuZXJyb3JzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIHRva2Vucy5lcnJvcnMgPSBleHRyYS5lcnJvcnM7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgICBleHRyYSA9IHt9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0b2tlbnM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2UoY29kZSwgb3B0aW9ucykge1xuICAgICAgICB2YXIgcHJvZ3JhbSwgdG9TdHJpbmc7XG5cbiAgICAgICAgdG9TdHJpbmcgPSBTdHJpbmc7XG4gICAgICAgIGlmICh0eXBlb2YgY29kZSAhPT0gJ3N0cmluZycgJiYgIShjb2RlIGluc3RhbmNlb2YgU3RyaW5nKSkge1xuICAgICAgICAgICAgY29kZSA9IHRvU3RyaW5nKGNvZGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgc291cmNlID0gY29kZTtcbiAgICAgICAgaW5kZXggPSAwO1xuICAgICAgICBsaW5lTnVtYmVyID0gKHNvdXJjZS5sZW5ndGggPiAwKSA/IDEgOiAwO1xuICAgICAgICBsaW5lU3RhcnQgPSAwO1xuICAgICAgICBzdGFydEluZGV4ID0gaW5kZXg7XG4gICAgICAgIHN0YXJ0TGluZU51bWJlciA9IGxpbmVOdW1iZXI7XG4gICAgICAgIHN0YXJ0TGluZVN0YXJ0ID0gbGluZVN0YXJ0O1xuICAgICAgICBsZW5ndGggPSBzb3VyY2UubGVuZ3RoO1xuICAgICAgICBsb29rYWhlYWQgPSBudWxsO1xuICAgICAgICBzdGF0ZSA9IHtcbiAgICAgICAgICAgIGFsbG93SW46IHRydWUsXG4gICAgICAgICAgICBhbGxvd1lpZWxkOiB0cnVlLFxuICAgICAgICAgICAgbGFiZWxTZXQ6IHt9LFxuICAgICAgICAgICAgaW5GdW5jdGlvbkJvZHk6IGZhbHNlLFxuICAgICAgICAgICAgaW5JdGVyYXRpb246IGZhbHNlLFxuICAgICAgICAgICAgaW5Td2l0Y2g6IGZhbHNlLFxuICAgICAgICAgICAgbGFzdENvbW1lbnRTdGFydDogLTEsXG4gICAgICAgICAgICBjdXJseVN0YWNrOiBbXSxcbiAgICAgICAgICAgIHNvdXJjZVR5cGU6ICdzY3JpcHQnXG4gICAgICAgIH07XG4gICAgICAgIH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IHtcbiAgICAgICAgICAgICAgICBleHRyYS5lcnJvcnMgPSBbXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChleHRyYS5hdHRhY2hDb21tZW50KSB7XG4gICAgICAgICAgICAgICAgZXh0cmEucmFuZ2UgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGV4dHJhLmNvbW1lbnRzID0gW107XG4gICAgICAgICAgICAgICAgZXh0cmEuYm90dG9tUmlnaHRTdGFjayA9IFtdO1xuICAgICAgICAgICAgICAgIGV4dHJhLnRyYWlsaW5nQ29tbWVudHMgPSBbXTtcbiAgICAgICAgICAgICAgICBleHRyYS5sZWFkaW5nQ29tbWVudHMgPSBbXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChvcHRpb25zLnNvdXJjZVR5cGUgPT09ICdtb2R1bGUnKSB7XG4gICAgICAgICAgICAgICAgLy8gdmVyeSByZXN0cmljdGl2ZSBjb25kaXRpb24gZm9yIG5vd1xuICAgICAgICAgICAgICAgIHN0YXRlLnNvdXJjZVR5cGUgPSBvcHRpb25zLnNvdXJjZVR5cGU7XG4gICAgICAgICAgICAgICAgc3RyaWN0ID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBwcm9ncmFtID0gcGFyc2VQcm9ncmFtKCk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGV4dHJhLmNvbW1lbnRzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIHByb2dyYW0uY29tbWVudHMgPSBleHRyYS5jb21tZW50cztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0eXBlb2YgZXh0cmEudG9rZW5zICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGZpbHRlclRva2VuTG9jYXRpb24oKTtcbiAgICAgICAgICAgICAgICBwcm9ncmFtLnRva2VucyA9IGV4dHJhLnRva2VucztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0eXBlb2YgZXh0cmEuZXJyb3JzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIHByb2dyYW0uZXJyb3JzID0gZXh0cmEuZXJyb3JzO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAgZXh0cmEgPSB7fTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBwcm9ncmFtO1xuICAgIH1cblxuICAgIC8vIFN5bmMgd2l0aCAqLmpzb24gbWFuaWZlc3RzLlxuICAgIGV4cG9ydHMudmVyc2lvbiA9ICcyLjcuMSc7XG5cbiAgICBleHBvcnRzLnRva2VuaXplID0gdG9rZW5pemU7XG5cbiAgICBleHBvcnRzLnBhcnNlID0gcGFyc2U7XG5cbiAgICAvLyBEZWVwIGNvcHkuXG4gICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICBleHBvcnRzLlN5bnRheCA9IChmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBuYW1lLCB0eXBlcyA9IHt9O1xuXG4gICAgICAgIGlmICh0eXBlb2YgT2JqZWN0LmNyZWF0ZSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgdHlwZXMgPSBPYmplY3QuY3JlYXRlKG51bGwpO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChuYW1lIGluIFN5bnRheCkge1xuICAgICAgICAgICAgaWYgKFN5bnRheC5oYXNPd25Qcm9wZXJ0eShuYW1lKSkge1xuICAgICAgICAgICAgICAgIHR5cGVzW25hbWVdID0gU3ludGF4W25hbWVdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGVvZiBPYmplY3QuZnJlZXplID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICBPYmplY3QuZnJl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tcbiAgICAgICAgcmV0dXJuIG5ldyBpbmhlcml0YW5jZSgpO1xuICAgIH0sXG4gICAgb2JqS2V5cyA9IE9iamVjdC5rZXlzIHx8IGZ1bmN0aW9uKG9iaikge1xuICAgICAgICB2YXIgcmVzID0gW107XG4gICAgICAgIGZvcih2YXIgaSBpbiBvYmopIHtcbiAgICAgICAgICAgIGhhc093blByb3BlcnR5LmNhbGwob2JqLCBpKSAmJiByZXMucHVzaChpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH0sXG4gICAgZXh0ZW5kID0gZnVuY3Rpb24obzEsIG8yKSB7XG4gICAgICAgIGZvcih2YXIgaSBpbiBvMikge1xuICAgICAgICAgICAgaGFzT3duUHJvcGVydHkuY2FsbChvMiwgaSkgJiYgKG8xW2ldID0gbzJbaV0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG8xO1xuICAgIH0sXG4gICAgdG9TdHIgPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLFxuICAgIGlzQXJyYXkgPSBBcnJheS5pc0FycmF5IHx8IGZ1bmN0aW9uKG9iaikge1xuICAgICAgICByZXR1cm4gdG9TdHIuY2FsbChvYmopID09PSAnW29iamVjdCBBcnJheV0nO1xuICAgIH0sXG4gICAgaXNGdW5jdGlvbiA9IGZ1bmN0aW9uKG9iaikge1xuICAgICAgICByZXR1cm4gdG9TdHIuY2FsbChvYmopID09PSAnW29iamVjdCBGdW5jdGlvbl0nO1xuICAgIH0sXG4gICAgbm9PcCA9IGZ1bmN0aW9uKCkge30sXG4gICAgbmVlZENoZWNrUHJvcHMgPSB0cnVlLFxuICAgIHRlc3RQcm9wT2JqID0geyB0b1N0cmluZyA6ICcnIH07XG5cbmZvcih2YXIgaSBpbiB0ZXN0UHJvcE9iaikgeyAvLyBmdWNraW5nIGllIGhhc24ndCB0b1N0cmluZywgdmFsdWVPZiBpbiBmb3JcbiAgICB0ZXN0UHJvcE9iai5oYXNPd25Qcm9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ZU1ldGhvZCA9IGJhc2VbbmFtZV0/XG4gICAgICAgICAgICAgICAgICAgICAgICBiYXNlW25hbWVdIDpcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWUgPT09ICdfX2NvbnN0cnVjdG9yJz8gLy8gY2FzZSBvZiBpbmhlcml0YW5jZSBmcm9tIHBsYW5lIGZ1bmN0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLl9fc2VsZi5fX3BhcmVudCA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9PcDtcbiAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBiYXNlU2F2ZWQgPSB0aGlzLl9fYmFzZTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fX2Jhc2UgPSBiYXNlTWV0aG9kO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gcHJvcC5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9fYmFzZSA9IGJhc2VTYXZlZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlcztcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSkobmFtZSwgcHJvcCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXNbbmFtZV0gPSBwcm9wO1xuICAgICAgICB9XG4gICAgfVxufVxuXG5mdW5jdGlvbiBhcHBseU1peGlucyhtaXhpbnMsIHJlcykge1xuICAgIHZhciBpID0gMSwgbWl4aW47XG4gICAgd2hpbGUobWl4aW4gPSBtaXhpbnNbaSsrXSkge1xuICAgICAgICByZXM/XG4gICAgICAgICAgICBpc0Z1bmN0aW9uKG1peGluKT9cbiAgICAgICAgICAgICAgICBpbmhlcml0LnNlbGYocmVzLCBtaXhpbi5wcm90b3R5cGUsIG1peGluKSA6XG4gICAgICAgICAgICAgICAgaW5oZXJpdC5zZWxmKHJlcywg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2NvbnN0cnVjdG9yKT9cbiAgICAgICAgICAgIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9fY29uc3RydWN0b3IuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICAgIH0gOlxuICAgICAgICAgICAgaGFzQmFzZT9cbiAgICAgICAgICAgICAgICBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJhc2UuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICB9IDpcbiAgICAgICAgICAgICAgICBmdW5jdGlvbigpIHt9O1xuXG4gICAgaWYoIWhhc0Jhc2UpIHtcbiAgICAgICAgcmVzLnByb3RvdHlwZSA9IHByb3BzO1xuICAgICAgICByZXMucHJvdG90eXBlLl9fc2VsZiA9IHJlcy5wcm90b3R5cGUuY29uc3RydWN0b3IgPSByZXM7XG4gICAgICAgIHJldHVybiBleHRlbmQocmVzLCBzdGF0aWNQcm9wcyk7XG4gICAgfVxuXG4gICAgZXh0ZW5kKHJlcywgYmFzZSk7XG5cbiAgICByZXMuX19wYXJlbnQgPSBiYXNlO1xuXG4gICAgdmFyIGJhc2VQdHAgPSBiYXNlLnByb3RvdHlwZSxcbiAgICAgICAgcmVzUHRwID0gcmVzLnByb3RvdHlwZSA9IG9iakNyZWF0ZShiYXNlUHRwKTtcblxuICAgIHJlc1B0cC5fX3NlbGYgPSByZXNQdHAuY29uc3RydWN0b3IgPSByZXM7XG5cbiAgICBwcm9wcyAmJiBvdmVycmlkZShiYXNlUHRwLCByZXNQdHAsIHByb3BzKTtcbiAgICBzdGF0aWNQcm9wcyAmJiBvdmVycmlkZShiYXNlLCByZXMsIHN0YXRpY1Byb3BzKTtcblxuICAgIHJldHVybiByZXM7XG59XG5cbmluaGVyaXQuc2VsZiA9IGZ1bmN0aW9uKCkge1xuICAgIHZhciBhcmdzID0gYXJndW1lbnRzLFxuICAgICAgICB3aXRoTWl4aW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G4gICAgICAgICEoa2V5ID09ICdjb25zdHJ1Y3RvcicgJiYgKGlzUHJvdG8gfHwgIWhhc093blByb3BlcnR5LmNhbGwob2JqZWN0LCBrZXkpKSkpIHtcbiAgICAgIHJlc3VsdC5wdXNoKGtleSk7XG4gICAgfVxuICB9XG4gIGlmIChzdXBwb3J0Lm5vbkVudW1TaGFkb3dzICYmIG9iamVjdCAhPT0gb2JqZWN0UHJvdG8pIHtcbiAgICB2YXIgdGFnID0gb2JqZWN0ID09PSBzdHJpbmdQcm90byA/IHN0cmluZ1RhZyA6IChvYmplY3QgPT09IGVycm9yUHJvdG8gPyBlcnJvclRhZyA6IG9ialRvU3RyaW5nLmNhbGwob2JqZWN0KSksXG4gICAgICAgIG5vbkVudW1zID0gbm9uRW51bVByb3BzW3RhZ10gfHwgbm9uRW51bVByb3BzW29iamVjdFRhZ107XG5cbiAgICBpZiAodGFnID09IG9iamVjdFRhZykge1xuICAgICAgcHJvdG8gPSBvYmplY3RQcm90bztcbiAgICB9XG4gICAgbGVuZ3RoID0gc2hhZG93UHJvcHMubGVuZ3RoO1xuICAgIHdoaWxlIChsZW5ndGgtLSkge1xuICAgICAga2V5ID0gc2hhZG93UHJvcHNbbGVuZ3RoXTtcbiAgICAgIHZhciBub25FbnVtID0gbm9uRW51bXNba2V5XTtcbiAgICAgIGlmICghKGlzUHJvdG8gJiYgbm9uRW51bSkgJiZcbiAgICAgICAgICAobm9uRW51bSA/IGhhc093blByb3BlcnR5LmNhbGwob2JqZWN0LCBrZXkpIDogb2JqZWN0W2tleV0gIT09IHByb3RvW2tleV0pKSB7XG4gICAgICAgIHJlc3VsdC5wdXNoKGtleSk7XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0ga2V5c0luO1xuIiwidmFyIGtleXMgPSByZXF1aXJlKCcuL2tleXMnKSxcbiAgICB0b09iamVjdCA9IHJlcXVpcmUoJy4uL2ludGVybmFsL3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ICAgICAgICBkb21haW4gPSBoZWFkLmRvbWFpbjtcblxuICAgICAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgICAgIGhlYWQuZG9tYWluID0gdm9pZCAwO1xuICAgICAgICAgICAgICAgIGRvbWFpbi5lbnRlcigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcnVuU2luZ2xlKHRhc2ssIGRvbWFpbik7XG5cbiAgICAgICAgfVxuICAgICAgICB3aGlsZSAobGF0ZXJRdWV1ZS5sZW5ndGgpIHtcbiAgICAgICAgICAgIHRhc2sgPSBsYXRlclF1ZXVlLnBvcCgpO1xuICAgICAgICAgICAgcnVuU2luZ2xlKHRhc2spO1xuICAgICAgICB9XG4gICAgICAgIGZsdXNoaW5nID0gZmFsc2U7XG4gICAgfVxuICAgIC8vIHJ1bnMgYSBzaW5nbGUgZnVuY3Rpb24gaW4gdGhlIGFzeW5jIHF1ZXVlXG4gICAgZnVuY3Rpb24gcnVuU2luZ2xlKHRhc2ssIGRvbWFpbikge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgdGFzaygpO1xuXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIGlmIChpc05vZGVKUykge1xuICAgICAgICAgICAgICAgIC8vIEluIG5vZGUsIHVuY2F1Z2h0IGV4Y2VwdGlvbnMgYXJlIGNvbnNpZGVyZWQgZmF0YWwgZXJyb3JzLlxuICAgICAgICAgICAgICAgIC8vIFJlLXRocm93IHRoZW0gc3luY2hyb25vdXNseSB0byBpbnRlcnJ1cHQgZmx1c2hpbmchXG5cbiAgICAgICAgICAgICAgICAvLyBFbnN1cmUgY29udGludWF0aW9uIGlmIHRoZSB1bmNhdWdodCBleGNlcHRpb24gaXMgc3VwcHJlc3NlZFxuICAgICAgICAgICAgICAgIC8vIGxpc3RlbmluZyBcInVuY2F1Z2h0RXhjZXB0aW9uXCIgZXZlbnRzIChhcyBkb21haW5zIGRvZXMpLlxuICAgICAgICAgICAgICAgIC8vIENvbnRpbnVlIGluIG5leHQgZXZlbnQgdG8gYXZvaWQgdGljayByZWN1cnNpb24uXG4gICAgICAgICAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgICAgICAgICBkb21haW4uZXhpdCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZsdXNoLCAwKTtcbiAgICAgICAgICAgICAgICBpZiAoZG9tYWluKSB7XG4gICAgICAgICAgICAgICAgICAgIGRvbWFpbi5lbnRlcigpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRocm93IGU7XG5cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gSW4gYnJvd3NlcnMsIHVuY2F1Z2h0IGV4Y2VwdGlvbnMgYXJlIG5vdCBmYXRhbC5cbiAgICAgICAgICAgICAgICAvLyBSZS10aHJvdyB0aGVtIGFzeW5jaHJvbm91c2x5IHRvIGF2b2lkIHNsb3ctZG93bnMuXG4gICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgICAgICAgICAgfSwgMCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZG9tYWluKSB7XG4gICAgICAgICAgICBkb21haW4uZXhpdCgpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgbmV4dFRpY2sgPSBmdW5jdGlvbiAodGFzaykge1xuICAgICAgICB0YWlsID0gdGFpbC5uZXh0ID0ge1xuICAgICAgICAgICAgdGFzazogdGFzayxcbiAgICAgICAgICAgIGRvbWFpbjogaXNOb2RlSlMgJiYgcHJvY2Vzcy5kb21haW4sXG4gICAgICAgICAgICBuZXh0OiBudWxsXG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKCFmbHVzaGluZykge1xuICAgICAgICAgICAgZmx1c2hpbmcgPSB0cnVlO1xuIC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HNlIHtcbiAgICAgICAgICAgIFEubmV4dFRpY2soZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJlc29sdmVkUHJvbWlzZS5wcm9taXNlRGlzcGF0Y2guYXBwbHkocmVzb2x2ZWRQcm9taXNlLCBhcmdzKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIC8vIFhYWCBkZXByZWNhdGVkXG4gICAgcHJvbWlzZS52YWx1ZU9mID0gZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAobWVzc2FnZXMpIHtcbiAgICAgICAgICAgIHJldHVybiBwcm9taXNlO1xuICAgICAgICB9XG4gICAgICAgIHZhciBuZWFyZXJWYWx1ZSA9IG5lYXJlcihyZXNvbHZlZFByb21pc2UpO1xuICAgICAgICBpZiAoaXNQcm9taXNlKG5lYXJlclZhbHVlKSkge1xuICAgICAgICAgICAgcmVzb2x2ZWRQcm9taXNlID0gbmVhcmVyVmFsdWU7IC8vIHNob3J0ZW4gY2hhaW5cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmVhcmVyVmFsdWU7XG4gICAgfTtcblxuICAgIHByb21pc2UuaW5zcGVjdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKCFyZXNvbHZlZFByb21pc2UpIHtcbiAgICAgICAgICAgIHJldHVybiB7IHN0YXRlOiBcInBlbmRpbmdcIiB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNvbHZlZFByb21pc2UuaW5zcGVjdCgpO1xuICAgIH07XG5cbiAgICBpZiAoUS5sb25nU3RhY2tTdXBwb3J0ICYmIGhhc1N0YWNrcykge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCk7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIC8vIE5PVEU6IGRvbid0IHRyeSB0byB1c2UgYEVycm9yLmNhcHR1cmVTdGFja1RyYWNlYCBvciB0cmFu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VjdChuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgXCJQcm9taXNlIGRvZXMgbm90IHN1cHBvcnQgb3BlcmF0aW9uOiBcIiArIG9wXG4gICAgICAgICAgICApKTtcbiAgICAgICAgfTtcbiAgICB9XG4gICAgaWYgKGluc3BlY3QgPT09IHZvaWQgMCkge1xuICAgICAgICBpbnNwZWN0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHtzdGF0ZTogXCJ1bmtub3duXCJ9O1xuICAgICAgICB9O1xuICAgIH1cblxuICAgIHZhciBwcm9taXNlID0gb2JqZWN0X2NyZWF0ZShQcm9taXNlLnByb3RvdHlwZSk7XG5cbiAgICBwcm9taXNlLnByb21pc2VEaXNwYXRjaCA9IGZ1bmN0aW9uIChyZXNvbHZlLCBvcCwgYXJncykge1xuICAgICAgICB2YXIgcmVzdWx0O1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgaWYgKGRlc2NyaXB0b3Jbb3BdKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gZGVzY3JpcHRvcltvcF0uYXBwbHkocHJvbWlzZSwgYXJncyk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGZhbGxiYWNrLmNhbGwocHJvbWlzZSwgb3AsIGFyZ3MpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChleGNlcHRpb24pIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IHJlamVjdChleGNlcHRpb24pO1xuICAgICAgICB9XG4gICAgICAgIGlmIChyZXNvbHZlKSB7XG4gICAgICAgICAgICByZXNvbHZlKHJlc3VsdCk7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgcHJvbWlzZS5pbnNwZWN0ID0gaW5zcGVjdDtcblxuICAgIC8vIFhYWCBkZXByZWNhdGVkIGB2YWx1ZU9mYCBhbmQgYGV4Y2VwdGlvbmAgc3VwcG9ydFxuICAgIGlmIChpbnN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cnVlO1xuXG4gICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKF9mdWxmaWxsZWQodmFsdWUpKTtcbiAgICAgICAgfSwgXCJ3aGVuXCIsIFtmdW5jdGlvbiAoZXhjZXB0aW9uKSB7XG4gICAgICAgICAgICBpZiAoZG9uZSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRvbmUgPSB0cnVlO1xuXG4gICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKF9yZWplY3RlZChleGNlcHRpb24pKTtcbiAgICAgICAgfV0pO1xuICAgIH0pO1xuXG4gICAgLy8gUHJvZ3Jlc3MgcHJvcGFnYXRvciBuZWVkIHRvIGJlIGF0dGFjaGVkIGluIHRoZSBjdXJyZW50IHRpY2suXG4gICAgc2VsZi5wcm9taXNlRGlzcGF0Y2godm9pZCAwLCBcIndoZW5cIiwgW3ZvaWQgMCwgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIHZhciBuZXdWYWx1ZTtcbiAgICAgICAgdmFyIHRocmV3ID0gZmFsc2U7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBuZXdWYWx1ZSA9IF9wcm9ncmVzc2VkKHZhbHVlKTtcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgdGhyZXcgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKFEub25lcnJvcikge1xuICAgICAgICAgICAgICAgIFEub25lcnJvcihlKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghdGhyZXcpIHtcbiAgICAgICAgICAgIGRlZmVycmVkLm5vdGlmeShuZXdWYWx1ZSk7XG4gICAgICAgIH1cbiAgICB9XSk7XG5cbiAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZTtcbn07XG5cblEudGFwID0gZnVuY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uYW1lXTtcbiAgICAgICAgfSxcbiAgICAgICAgXCJzZXRcIjogZnVuY3Rpb24gKG5hbWUsIHJocykge1xuICAgICAgICAgICAgdmFsdWVbbmFtZV0gPSByaHM7XG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVsZXRlXCI6IGZ1bmN0aW9uIChuYW1lKSB7XG4gICAgICAgICAgICBkZWxldGUgdmFsdWVbbmFtZV07XG4gICAgICAgIH0sXG4gICAgICAgIFwicG9zdFwiOiBmdW5jdGlvbiAobmFtZSwgYXJncykge1xuICAgICAgICAgICAgLy8gTWFyayBNaWxsZXIgcHJvcG9zZXMgdGhhdCBwb3N0IHdpdGggbm8gbmFtZSBzaG91bGQgYXBwbHkgYVxuICAgICAgICAgICAgLy8gcHJvbWlzZWQgZnVuY3Rpb24uXG4gICAgICAgICAgICBpZiAobmFtZSA9PT0gbnVsbCB8fCBuYW1lID09PSB2b2lkIDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWUuYXBwbHkodm9pZCAwLCBhcmdzKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlW25hbWVdLmFwcGx5KHZhbHVlLCBhcmdzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgXCJhcHBseVwiOiBmdW5jdGlvbiAodGhpc3AsIGFyZ3MpIHtcbiAgICAgICAgICAgIHJldHVybiB2YWx1ZS5hcHBseSh0aGlzcCwgYXJncyk7XG4gICAgICAgIH0sXG4gICAgICAgIFwia2V5c1wiOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gb2JqZWN0X2tleXModmFsdWUpO1xuICAgICAgICB9XG4gICAgfSwgdm9pZCAwLCBmdW5jdGlvbiBpbnNwZWN0KCkge1xuICAgICAgICByZXR1cm4geyBzdGF0ZTogXCJmdWxmaWxsZWRcIiwgdmFsdWU6IHZhbHVlIH07XG4gICAgfSk7XG59XG5cbi8qKl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ICAgICAgICAgICAgICAgICAgcmV0dXJuIFEocmVzdWx0LnZhbHVlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gd2hlbihyZXN1bHQudmFsdWUsIGNhbGxiYWNrLCBlcnJiYWNrKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIFNwaWRlck1vbmtleSBHZW5lcmF0b3JzXG4gICAgICAgICAgICAgICAgLy8gRklYTUU6IFJlbW92ZSB0aGlzIGNhc2Ugd2hlbiBTTSBkb2VzIEVTNiBnZW5lcmF0b3JzLlxuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IGdlbmVyYXRvclt2ZXJiXShhcmcpO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGV4Y2VwdGlvbikge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNTdG9wSXRlcmF0aW9uKGV4Y2VwdGlvbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBRKGV4Y2VwdGlvbi52YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KGV4Y2VwdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdoZW4ocmVzdWx0LCBjYWxsYmFjaywgZXJyYmFjayk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGdlbmVyYXRvciA9IG1ha2VHZW5lcmF0b3IuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgdmFyIGNhbGxiYWNrID0gY29udGludWVyLmJpbmQoY29udGludWVyLCBcIm5leHRcIik7XG4gICAgICAgIHZhciBlcnJiYWNrID0gY29udGlud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YWx1ZXMpXG4gKiBAcmV0dXJucyBhIHByb21pc2UgZm9yIGFuIGFycmF5IG9mIHRoZSBjb3JyZXNwb25kaW5nIHZhbHVlc1xuICovXG4vLyBCeSBNYXJrIE1pbGxlclxuLy8gaHR0cDovL3dpa2kuZWNtYXNjcmlwdC5vcmcvZG9rdS5waHA/aWQ9c3RyYXdtYW46Y29uY3VycmVuY3kmcmV2PTEzMDg3NzY1MjEjYWxsZnVsZmlsbGVkXG5RLmFsbCA9IGFsbDtcbmZ1bmN0aW9uIGFsbChwcm9taXNlcykge1xuICAgIHJldHVybiB3aGVuKHByb21pc2VzLCBmdW5jdGlvbiAocHJvbWlzZXMpIHtcbiAgICAgICAgdmFyIHBlbmRpbmdDb3VudCA9IDA7XG4gICAgICAgIHZhciBkZWZlcnJlZCA9IGRlZmVyKCk7XG4gICAgICAgIGFycmF5X3JlZHVjZShwcm9taXNlcywgZnVuY3Rpb24gKHVuZGVmaW5lZCwgcHJvbWlzZSwgaW5kZXgpIHtcbiAgICAgICAgICAgIHZhciBzbmFwc2hvdDtcbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICBpc1Byb21pc2UocHJvbWlzZSkgJiZcbiAgICAgICAgICAgICAgICAoc25hcHNob3QgPSBwcm9taXNlLmluc3BlY3QoKSkuc3RhdGUgPT09IFwiZnVsZmlsbGVkXCJcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHByb21pc2VzW2luZGV4XSA9IHNuYXBzaG90LnZhbHVlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICArK3BlbmRpbmdDb3VudDtcbiAgICAgICAgICAgICAgICB3aGVuKFxuICAgICAgICAgICAgICAgICAgICBwcm9taXNlLFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb21pc2VzW2luZGV4XSA9IHZhbHVlO1xuICAgICAgICAgICAgICAgICAgICAgICAg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czpcbiAqXG4gKiAgICAgICAvLyBxdWVyeXN0cmluZ1xuICogICAgICAgcmVxdWVzdC5nZXQoJy9zZWFyY2gnKVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIG11bHRpcGxlIGRhdGEgXCJ3cml0ZXNcIlxuICogICAgICAgcmVxdWVzdC5nZXQoJy9zZWFyY2gnKVxuICogICAgICAgICAuc2VuZCh7IHNlYXJjaDogJ3F1ZXJ5JyB9KVxuICogICAgICAgICAuc2VuZCh7IHJhbmdlOiAnMS4uNScgfSlcbiAqICAgICAgICAgLnNlbmQoeyBvcmRlcjogJ2Rlc2MnIH0pXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gbWFudWFsIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnanNvbicpXG4gKiAgICAgICAgIC5zZW5kKCd7XCJuYW1lXCI6XCJ0alwifScpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byBqc29uXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnNlbmQoeyBuYW1lOiAndGonIH0pXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gbWFudWFsIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdmb3JtJylcbiAqICAgICAgICAgLnNlbmQoJ25hbWU9dGonKVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGF1dG8geC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICA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aGFuZGxlcnMuXG4gKlxuICogQHBhcmFtIHtTdHJpbmd9IGV2ZW50XG4gKiBAcmV0dXJuIHtCb29sZWFufVxuICogQGFwaSBwdWJsaWNcbiAqL1xuXG5FbWl0dGVyLnByb3RvdHlwZS5oYXNMaXN0ZW5lcnMgPSBmdW5jdGlvbihldmVudCl7XG4gIHJldHVybiAhISB0aGlzLmxpc3RlbmVycyhldmVudCkubGVuZ3RoO1xufTtcbiIsIlxuLyoqXG4gKiBSZWR1Y2UgYGFycmAgd2l0aCBgZm5gLlxuICpcbiAqIEBwYXJhbSB7QXJyYXl9IGFyclxuICogQHBhcmFtIHtGdW5jdGlvbn0gZm5cbiAqIEBwYXJhbSB7TWl4ZWR9IGluaXRpYWxcbiAqXG4gKiBUT0RPOiBjb21iYXRpYmxlIGVycm9yIGhhbmRsaW5nP1xuICovXG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24oYXJyLCBmbiwgaW5pdGlhbCl7ICBcbiAgdmFyIGlkeCA9IDA7XG4gIHZhciBsZW4gPSBhcnIubGVuZ3RoO1xuICB2YXIgY3VyciA9IGFyZ3VtZW50cy5sZW5ndGggPT0gM1xuICAgID8gaW5pdGlhbFxuICAgIDogYXJyW2lkeCsrXTtcblxuICB3aGlsZSAoaWR4IDwgbGVuKSB7XG4gICAgY3VyciA9IGZuLmNhbGwobnVsbCwgY3VyciwgYXJyW2lkeF0sICsraWR4LCBhcnIpO1xuICB9XG4gIFxuICByZXR1cm4gY3Vycjtcbn07Il19
+
+ /*global JSONEditor*/
+'use strict';
+
+window.SwaggerUi = Backbone.Router.extend({
+
+ dom_id: 'swagger_ui',
+
+ // Attributes
+ options: null,
+ api: null,
+ headerView: null,
+ mainView: null,
+
+ // SwaggerUi accepts all the same options as SwaggerApi
+ initialize: function(options) {
+ options = options || {};
+
+ if (options.defaultModelRendering !== 'model') {
+ options.defaultModelRendering = 'schema';
+ }
+
+ if (!options.highlightSizeThreshold) {
+ options.highlightSizeThreshold = 100000;
+ }
+
+ // Allow dom_id to be overridden
+ if (options.dom_id) {
+ this.dom_id = options.dom_id;
+ delete options.dom_id;
+ }
+
+ if (!options.supportedSubmitMethods){
+ options.supportedSubmitMethods = [
+ 'get',
+ 'put',
+ 'post',
+ 'delete',
+ 'head',
+ 'options',
+ 'patch'
+ ];
+ }
+
+ if (typeof options.oauth2RedirectUrl === 'string') {
+ window.oAuthRedirectUrl = options.redirectUrl;
+ }
+
+ // Create an empty div which contains the dom_id
+ if (! $('#' + this.dom_id).length){
+ $('body').append('<div id="' + this.dom_id + '"></div>') ;
+ }
+
+ this.options = options;
+
+ // set marked options
+ marked.setOptions({gfm: true});
+
+ // Set the callbacks
+ var that = this;
+ this.options.success = function() { return that.render(); };
+ this.options.progress = function(d) { return that.showMessage(d); };
+ this.options.failure = function(d) { return that.onLoadFailure(d); };
+
+ // Create view to handle the header inputs
+ this.headerView = new SwaggerUi.Views.HeaderView({el: $('#header')});
+
+ // Event handler for when the baseUrl/apiKey is entered by user
+ this.headerView.on('update-swagger-ui', function(data) {
+ return that.updateSwaggerUi(data);
+ });
+
+ // JSon Editor custom theming
+ JSONEditor.defaults.iconlibs.swagger = JSONEditor.AbstractIconLib.extend({
+ mapping: {
+ collapse: 'collapse',
+ expand: 'expand'
+ },
+ icon_prefix: 'swagger-'
+ });
+
+ },
+
+ // Set an option after initializing
+ setOption: function(option, value) {
+ this.options[option] = value;
+ },
+
+ // Get the value of a previously set option
+ getOption: function(option) {
+ return this.options[option];
+ },
+
+ // Event handler for when url/key is received from user
+ updateSwaggerUi: function(data){
+ this.options.url = data.url;
+ this.load();
+ },
+
+ // Create an api and render
+ load: function(){
+ // Initialize the API object
+ if (this.mainView) {
+ this.mainView.clear();
+ }
+ var url = this.options.url;
+ if (url && url.indexOf('http') !== 0) {
+ url = this.buildUrl(window.location.href.toString(), url);
+ }
+ if(this.api) {
+ this.options.authorizations = this.api.clientAuthorizations.authz;
+ }
+ this.options.url = url;
+ this.headerView.update(url);
+
+ this.api = new SwaggerClient(this.options);
+ },
+
+ // collapse all sections
+ collapseAll: function(){
+ Docs.collapseEndpointListForResource('');
+ },
+
+ // list operations for all sections
+ listAll: function(){
+ Docs.collapseOperationsForResource('');
+ },
+
+ // expand operations for all sections
+ expandAll: function(){
+ Docs.expandOperationsForResource('');
+ },
+
+ // This is bound to success handler for SwaggerApi
+ // so it gets called when SwaggerApi completes loading
+ render: function(){
+ this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...');
+ this.mainView = new SwaggerUi.Views.MainView({
+ model: this.api,
+ el: $('#' + this.dom_id),
+ swaggerOptions: this.options,
+ router: this
+ }).render();
+ this.showMessage();
+ switch (this.options.docExpansion) {
+ case 'full':
+ this.expandAll(); break;
+ case 'list':
+ this.listAll(); break;
+ default:
+ break;
+ }
+ this.renderGFM();
+
+ if (this.options.onComplete){
+ this.options.onComplete(this.api, this);
+ }
+
+ setTimeout(Docs.shebang.bind(this), 100);
+ },
+
+ buildUrl: function(base, url){
+ if (url.indexOf('/') === 0) {
+ var parts = base.split('/');
+ base = parts[0] + '//' + parts[2];
+ return base + url;
+ } else {
+ var endOfPath = base.length;
+
+ if (base.indexOf('?') > -1){
+ endOfPath = Math.min(endOfPath, base.indexOf('?'));
+ }
+
+ if (base.indexOf('#') > -1){
+ endOfPath = Math.min(endOfPath, base.indexOf('#'));
+ }
+
+ base = base.substring(0, endOfPath);
+
+ if (base.indexOf('/', base.length - 1 ) !== -1){
+ return base + url;
+ }
+
+ return base + '/' + url;
+ }
+ },
+
+ // Shows message on topbar of the ui
+ showMessage: function(data){
+ if (data === undefined) {
+ data = '';
+ }
+ var $msgbar = $('#message-bar');
+ $msgbar.removeClass('message-fail');
+ $msgbar.addClass('message-success');
+ $msgbar.text(data);
+ if(window.SwaggerTranslator) {
+ window.SwaggerTranslator.translate($msgbar);
+ }
+ },
+
+ // shows message in red
+ onLoadFailure: function(data){
+ if (data === undefined) {
+ data = '';
+ }
+ $('#message-bar').removeClass('message-success');
+ $('#message-bar').addClass('message-fail');
+
+ var val = $('#message-bar').text(data);
+
+ if (this.options.onFailure) {
+ this.options.onFailure(data);
+ }
+
+ return val;
+ },
+
+ // Renders GFM for elements with 'markdown' class
+ renderGFM: function(){
+ $('.markdown').each(function(){
+ $(this).html(marked($(this).html()));
+ });
+
+ $('.propDesc', '.model-signature .description').each(function () {
+ $(this).html(marked($(this).html())).addClass('markdown');
+ });
+ }
+
+});
+
+window.SwaggerUi.Views = {};
+window.SwaggerUi.partials = {};
+
+// don't break backward compatibility with previous versions and warn users to upgrade their code
+(function(){
+ window.authorizations = {
+ add: function() {
+ warn('Using window.authorizations is deprecated. Please use SwaggerUi.api.clientAuthorizations.add().');
+
+ if (typeof window.swaggerUi === 'undefined') {
+ throw new TypeError('window.swaggerUi is not defined');
+ }
+
+ if (window.swaggerUi instanceof SwaggerUi) {
+ window.swaggerUi.api.clientAuthorizations.add.apply(window.swaggerUi.api.clientAuthorizations, arguments);
+ }
+ }
+ };
+
+ window.ApiKeyAuthorization = function() {
+ warn('window.ApiKeyAuthorization is deprecated. Please use SwaggerClient.ApiKeyAuthorization.');
+ SwaggerClient.ApiKeyAuthorization.apply(window, arguments);
+ };
+
+ window.PasswordAuthorization = function() {
+ warn('window.PasswordAuthorization is deprecated. Please use SwaggerClient.PasswordAuthorization.');
+ SwaggerClient.PasswordAuthorization.apply(window, arguments);
+ };
+
+ function warn(message) {
+ if ('console' in window && typeof window.console.warn === 'function') {
+ console.warn(message);
+ }
+ }
+})();
+
+
+// UMD
+(function (root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['b'], function (b) {
+ return (root.SwaggerUi = factory(b));
+ });
+ } else if (typeof exports === 'object') {
+ // Node. Does not work with strict CommonJS, but
+ // only CommonJS-like environments that support module.exports,
+ // like Node.
+ module.exports = factory(require('b'));
+ } else {
+ // Browser globals
+ root.SwaggerUi = factory(root.b);
+ }
+}(this, function () {
+ return SwaggerUi;
+}));
+
+'use strict';
+
+SwaggerUi.Views.ApiKeyButton = Backbone.View.extend({ // TODO: append this to global SwaggerUi
+
+ events:{
+ 'click #apikey_button' : 'toggleApiKeyContainer',
+ 'click #apply_api_key' : 'applyApiKey'
+ },
+
+ initialize: function(opts){
+ this.options = opts || {};
+ this.router = this.options.router;
+ },
+
+ render: function(){
+ var template = this.template();
+ $(this.el).html(template(this.model));
+
+ return this;
+ },
+
+
+ applyApiKey: function(){
+ var keyAuth = new SwaggerClient.ApiKeyAuthorization(
+ this.model.name,
+ $('#input_apiKey_entry').val(),
+ this.model.in
+ );
+ this.router.api.clientAuthorizations.add(this.model.name, keyAuth);
+ this.router.load();
+ $('#apikey_container').show();
+ },
+
+ toggleApiKeyContainer: function(){
+ if ($('#apikey_container').length) {
+
+ var elem = $('#apikey_container').first();
+
+ if (elem.is(':visible')){
+ elem.hide();
+ } else {
+
+ // hide others
+ $('.auth_container').hide();
+ elem.show();
+ }
+ }
+ },
+
+ template: function(){
+ return Handlebars.templates.apikey_button_view;
+ }
+
+});
+'use strict';
+
+SwaggerUi.Views.BasicAuthButton = Backbone.View.extend({
+
+
+ initialize: function (opts) {
+ this.options = opts || {};
+ this.router = this.options.router;
+ },
+
+ render: function(){
+ var template = this.template();
+ $(this.el).html(template(this.model));
+
+ return this;
+ },
+
+ events: {
+ 'click #basic_auth_button' : 'togglePasswordContainer',
+ 'click #apply_basic_auth' : 'applyPassword'
+ },
+
+ applyPassword: function(event){
+ event.preventDefault();
+ var username = $('#input_username').val();
+ var password = $('#input_password').val();
+ var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password);
+ this.router.api.clientAuthorizations.add(this.model.type, basicAuth);
+ this.router.load();
+ $('#basic_auth_container').hide();
+ },
+
+ togglePasswordContainer: function(){
+ if ($('#basic_auth_container').length) {
+ var elem = $('#basic_auth_container').show();
+ if (elem.is(':visible')){
+ elem.slideUp();
+ } else {
+ // hide others
+ $('.auth_container').hide();
+ elem.show();
+ }
+ }
+ },
+
+ template: function(){
+ return Handlebars.templates.basic_auth_button_view;
+ }
+
+});
+'use strict';
+
+SwaggerUi.Views.ContentTypeView = Backbone.View.extend({
+ initialize: function() {},
+
+ render: function(){
+ this.model.contentTypeId = 'ct' + Math.random();
+ $(this.el).html(Handlebars.templates.content_type(this.model));
+ return this;
+ }
+});
+'use strict';
+
+SwaggerUi.Views.HeaderView = Backbone.View.extend({
+ events: {
+ 'click #show-pet-store-icon' : 'showPetStore',
+ 'click #explore' : 'showCustom',
+ 'keyup #input_baseUrl' : 'showCustomOnKeyup',
+ 'keyup #input_apiKey' : 'showCustomOnKeyup'
+ },
+
+ initialize: function(){},
+
+ showPetStore: function(){
+ this.trigger('update-swagger-ui', {
+ url:'http://petstore.swagger.io/v2/swagger.json'
+ });
+ },
+
+ showCustomOnKeyup: function(e){
+ if (e.keyCode === 13) {
+ this.showCustom();
+ }
+ },
+
+ showCustom: function(e){
+ if (e) {
+ e.preventDefault();
+ }
+
+ this.trigger('update-swagger-ui', {
+ url: $('#input_baseUrl').val(),
+ apiKey: $('#input_apiKey').val()
+ });
+ },
+
+ update: function(url, apiKey, trigger){
+ if (trigger === undefined) {
+ trigger = false;
+ }
+
+ $('#input_baseUrl').val(url);
+
+ //$('#input_apiKey').val(apiKey);
+ if (trigger) {
+ this.trigger('update-swagger-ui', {url:url});
+ }
+ }
+});
+
+'use strict';
+
+SwaggerUi.Views.MainView = Backbone.View.extend({
+ apisSorter : {
+ alpha : function(a,b){ return a.name.localeCompare(b.name); }
+ },
+ operationsSorters : {
+ alpha : function(a,b){ return a.path.localeCompare(b.path); },
+ method : function(a,b){ return a.method.localeCompare(b.method); }
+ },
+ initialize: function(opts){
+ var sorterOption, sorterFn, key, value;
+ opts = opts || {};
+
+ this.router = opts.router;
+
+ document.addEventListener('click', this.onLinkClick, true);
+ // Sort APIs
+ if (opts.swaggerOptions.apisSorter) {
+ sorterOption = opts.swaggerOptions.apisSorter;
+ if (_.isFunction(sorterOption)) {
+ sorterFn = sorterOption;
+ } else {
+ sorterFn = this.apisSorter[sorterOption];
+ }
+ if (_.isFunction(sorterFn)) {
+ this.model.apisArray.sort(sorterFn);
+ }
+ }
+ // Sort operations of each API
+ if (opts.swaggerOptions.operationsSorter) {
+ sorterOption = opts.swaggerOptions.operationsSorter;
+ if (_.isFunction(sorterOption)) {
+ sorterFn = sorterOption;
+ } else {
+ sorterFn = this.operationsSorters[sorterOption];
+ }
+ if (_.isFunction(sorterFn)) {
+ for (key in this.model.apisArray) {
+ this.model.apisArray[key].operationsArray.sort(sorterFn);
+ }
+ }
+ }
+
+ // set up the UI for input
+ this.model.auths = [];
+
+ for (key in this.model.securityDefinitions) {
+ value = this.model.securityDefinitions[key];
+
+ this.model.auths.push({
+ name: key,
+ type: value.type,
+ value: value
+ });
+ }
+
+ if ('validatorUrl' in opts.swaggerOptions) {
+ // Validator URL specified explicitly
+ this.model.validatorUrl = opts.swaggerOptions.validatorUrl;
+ } else if (this.model.url.indexOf('localhost') > 0 || this.model.url.indexOf('127.0.0.1') > 0) {
+ // Localhost override
+ this.model.validatorUrl = null;
+ } else {
+ // Default validator
+ if(window.location.protocol === 'https:') {
+ this.model.validatorUrl = 'https://online.swagger.io/validator';
+ }
+ else {
+ this.model.validatorUrl = 'http://online.swagger.io/validator';
+ }
+ }
+
+ // JSonEditor requires type='object' to be present on defined types, we add it if it's missing
+ // is there any valid case were it should not be added ?
+ var def;
+ for(def in this.model.definitions){
+ if (!this.model.definitions[def].type){
+ this.model.definitions[def].type = 'object';
+ }
+ }
+
+ },
+
+ render: function(){
+ if (this.model.securityDefinitions) {
+ for (var name in this.model.securityDefinitions) {
+ var auth = this.model.securityDefinitions[name];
+ var button;
+
+ if (auth.type === 'apiKey' && $('#apikey_button').length === 0) {
+ button = new SwaggerUi.Views.ApiKeyButton({model: auth, router: this.router}).render().el;
+ $('.auth_main_container').append(button);
+ }
+
+ if (auth.type === 'basicAuth' && $('#basic_auth_button').length === 0) {
+ button = new SwaggerUi.Views.BasicAuthButton({model: auth, router: this.router}).render().el;
+ $('.auth_main_container').append(button);
+ }
+ }
+ }
+
+ // Render the outer container for resources
+ $(this.el).html(Handlebars.templates.main(this.model));
+
+ // Render each resource
+
+ var resources = {};
+ var counter = 0;
+ for (var i = 0; i < this.model.apisArray.length; i++) {
+ var resource = this.model.apisArray[i];
+ var id = resource.name;
+ while (typeof resources[id] !== 'undefined') {
+ id = id + '_' + counter;
+ counter += 1;
+ }
+ resource.id = id;
+ resources[id] = resource;
+ this.addResource(resource, this.model.auths);
+ }
+
+ $('.propWrap').hover(function onHover(){
+ $('.optionsWrapper', $(this)).show();
+ }, function offhover(){
+ $('.optionsWrapper', $(this)).hide();
+ });
+ return this;
+ },
+
+ addResource: function(resource, auths){
+ // Render a resource and add it to resources li
+ resource.id = resource.id.replace(/\s/g, '_');
+
+ // Make all definitions available at the root of the resource so that they can
+ // be loaded by the JSonEditor
+ resource.definitions = this.model.definitions;
+
+ var resourceView = new SwaggerUi.Views.ResourceView({
+ model: resource,
+ router: this.router,
+ tagName: 'li',
+ id: 'resource_' + resource.id,
+ className: 'resource',
+ auths: auths,
+ swaggerOptions: this.options.swaggerOptions
+ });
+ $('#resources', this.el).append(resourceView.render().el);
+ },
+
+ clear: function(){
+ $(this.el).html('');
+ },
+
+ onLinkClick: function (e) {
+ var el = e.target;
+ if (el.tagName === 'A') {
+ if (location.hostname !== el.hostname || location.port !== el.port) {
+ e.preventDefault();
+ window.open(el.href, '_blank');
+ }
+ }
+ }
+});
+
+'use strict';
+
+SwaggerUi.Views.OperationView = Backbone.View.extend({
+ invocationUrl: null,
+
+ events: {
+ 'submit .sandbox' : 'submitOperation',
+ 'click .submit' : 'submitOperation',
+ 'click .response_hider' : 'hideResponse',
+ 'click .toggleOperation' : 'toggleOperationContent',
+ 'mouseenter .api-ic' : 'mouseEnter',
+ 'dblclick .curl' : 'selectText',
+ 'change [name=responseContentType]' : 'showSnippet'
+ },
+
+ initialize: function(opts) {
+ opts = opts || {};
+ this.router = opts.router;
+ this.auths = opts.auths;
+ this.parentId = this.model.parentId;
+ this.nickname = this.model.nickname;
+ this.model.encodedParentId = encodeURIComponent(this.parentId);
+
+ if (opts.swaggerOptions) {
+ this.model.defaultRendering = opts.swaggerOptions.defaultModelRendering;
+
+ if (opts.swaggerOptions.showRequestHeaders) {
+ this.model.showRequestHeaders = true;
+ }
+ }
+ return this;
+ },
+
+ selectText: function(event) {
+ var doc = document,
+ text = event.target.firstChild,
+ range,
+ selection;
+ if (doc.body.createTextRange) {
+ range = document.body.createTextRange();
+ range.moveToElementText(text);
+ range.select();
+ } else if (window.getSelection) {
+ selection = window.getSelection();
+ range = document.createRange();
+ range.selectNodeContents(text);
+ selection.removeAllRanges();
+ selection.addRange(range);
+ }
+ },
+
+ mouseEnter: function(e) {
+ var elem = $(this.el).find('.content');
+ var x = e.pageX;
+ var y = e.pageY;
+ var scX = $(window).scrollLeft();
+ var scY = $(window).scrollTop();
+ var scMaxX = scX + $(window).width();
+ var scMaxY = scY + $(window).height();
+ var wd = elem.width();
+ var hgh = elem.height();
+
+ if (x + wd > scMaxX) {
+ x = scMaxX - wd;
+ }
+
+ if (x < scX) {
+ x = scX;
+ }
+
+ if (y + hgh > scMaxY) {
+ y = scMaxY - hgh;
+ }
+
+ if (y < scY) {
+ y = scY;
+ }
+
+ var pos = {};
+ pos.top = y;
+ pos.left = x;
+ elem.css(pos);
+ },
+
+ // Note: copied from CoffeeScript compiled file
+ // TODO: redactor
+ render: function() {
+ var a, auth, auths, code, contentTypeModel, isMethodSubmissionSupported, k, key, l, len, len1, len2, len3, len4, m, modelAuths, n, o, p, param, q, ref, ref1, ref2, ref3, ref4, ref5, responseContentTypeView, responseSignatureView, schema, schemaObj, scopeIndex, signatureModel, statusCode, successResponse, type, v, value, produces, isXML, isJSON;
+ isMethodSubmissionSupported = jQuery.inArray(this.model.method, this.model.supportedSubmitMethods()) >= 0;
+ if (!isMethodSubmissionSupported) {
+ this.model.isReadOnly = true;
+ }
+ this.model.description = this.model.description || this.model.notes;
+ this.model.oauth = null;
+ modelAuths = this.model.authorizations || this.model.security;
+ if (modelAuths) {
+ if (Array.isArray(modelAuths)) {
+ for (l = 0, len = modelAuths.length; l < len; l++) {
+ auths = modelAuths[l];
+ for (key in auths) {
+ for (a in this.auths) {
+ auth = this.auths[a];
+ if (key === auth.name) {
+ if (auth.type === 'oauth2') {
+ this.model.oauth = {};
+ this.model.oauth.scopes = [];
+ ref1 = auth.value.scopes;
+ for (k in ref1) {
+ v = ref1[k];
+ scopeIndex = auths[key].indexOf(k);
+ if (scopeIndex >= 0) {
+ o = {
+ scope: k,
+ description: v
+ };
+ this.model.oauth.scopes.push(o);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ } else {
+ for (k in modelAuths) {
+ v = modelAuths[k];
+ if (k === 'oauth2') {
+ if (this.model.oauth === null) {
+ this.model.oauth = {};
+ }
+ if (this.model.oauth.scopes === void 0) {
+ this.model.oauth.scopes = [];
+ }
+ for (m = 0, len1 = v.length; m < len1; m++) {
+ o = v[m];
+ this.model.oauth.scopes.push(o);
+ }
+ }
+ }
+ }
+ }
+ if (typeof this.model.responses !== 'undefined') {
+ this.model.responseMessages = [];
+ ref2 = this.model.responses;
+ for (code in ref2) {
+ value = ref2[code];
+ schema = null;
+ schemaObj = this.model.responses[code].schema;
+ if (schemaObj && schemaObj.$ref) {
+ schema = schemaObj.$ref;
+ if (schema.indexOf('#/definitions/') !== -1) {
+ schema = schema.replace(/^.*#\/definitions\//, '');
+ }
+ }
+ this.model.responseMessages.push({
+ code: code,
+ message: value.description,
+ responseModel: schema,
+ headers: value.headers,
+ schema: schemaObj
+ });
+ }
+ }
+ if (typeof this.model.responseMessages === 'undefined') {
+ this.model.responseMessages = [];
+ }
+ signatureModel = null;
+ produces = this.model.produces;
+ isXML = this.contains(produces, 'xml');
+ isJSON = isXML ? this.contains(produces, 'json') : true;
+
+ if (this.model.successResponse) {
+ successResponse = this.model.successResponse;
+ for (key in successResponse) {
+ value = successResponse[key];
+ this.model.successCode = key;
+ if (typeof value === 'object' && typeof value.createJSONSample === 'function') {
+ this.model.successDescription = value.description;
+ this.model.headers = this.parseResponseHeaders(value.headers);
+ signatureModel = {
+ sampleJSON: isJSON ? JSON.stringify(SwaggerUi.partials.signature.createJSONSample(value), void 0, 2) : false,
+ isParam: false,
+ sampleXML: isXML ? SwaggerUi.partials.signature.createXMLSample(value.definition, value.models) : false,
+ signature: SwaggerUi.partials.signature.getModelSignature(value.name, value.definition, value.models, value.modelPropertyMacro)
+ };
+ }
+ }
+ } else if (this.model.responseClassSignature && this.model.responseClassSignature !== 'string') {
+ signatureModel = {
+ sampleJSON: this.model.responseSampleJSON,
+ isParam: false,
+ signature: this.model.responseClassSignature
+ };
+ }
+ $(this.el).html(Handlebars.templates.operation(this.model));
+ if (signatureModel) {
+ signatureModel.defaultRendering = this.model.defaultRendering;
+ responseSignatureView = new SwaggerUi.Views.SignatureView({
+ model: signatureModel,
+ router: this.router,
+ tagName: 'div'
+ });
+ $('.model-signature', $(this.el)).append(responseSignatureView.render().el);
+ } else {
+ this.model.responseClassSignature = 'string';
+ $('.model-signature', $(this.el)).html(this.model.type);
+ }
+ contentTypeModel = {
+ isParam: false
+ };
+ contentTypeModel.consumes = this.model.consumes;
+ contentTypeModel.produces = this.model.produces;
+ ref3 = this.model.parameters;
+ for (n = 0, len2 = ref3.length; n < len2; n++) {
+ param = ref3[n];
+ type = param.type || param.dataType || '';
+ if (typeof type === 'undefined') {
+ schema = param.schema;
+ if (schema && schema.$ref) {
+ ref = schema.$ref;
+ if (ref.indexOf('#/definitions/') === 0) {
+ type = ref.substring('#/definitions/'.length);
+ } else {
+ type = ref;
+ }
+ }
+ }
+ if (type && type.toLowerCase() === 'file') {
+ if (!contentTypeModel.consumes) {
+ contentTypeModel.consumes = 'multipart/form-data';
+ }
+ }
+ param.type = type;
+ }
+ responseContentTypeView = new SwaggerUi.Views.ResponseContentTypeView({
+ model: contentTypeModel,
+ router: this.router
+ });
+ $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
+ ref4 = this.model.parameters;
+ for (p = 0, len3 = ref4.length; p < len3; p++) {
+ param = ref4[p];
+ this.addParameter(param, contentTypeModel.consumes);
+ }
+ ref5 = this.model.responseMessages;
+ for (q = 0, len4 = ref5.length; q < len4; q++) {
+ statusCode = ref5[q];
+ statusCode.isXML = isXML;
+ statusCode.isJSON = isJSON;
+ if (!_.isUndefined(statusCode.headers)) {
+ statusCode.headers = this.parseHeadersType(statusCode.headers);
+ }
+ this.addStatusCode(statusCode);
+ }
+
+ this.showSnippet();
+ return this;
+ },
+
+ parseHeadersType: function (headers) {
+ var map = {
+ 'string': {
+ 'date-time': 'dateTime',
+ 'date' : 'date'
+ }
+ };
+
+ _.forEach(headers, function (header) {
+ var value;
+ header = header || {};
+ value = map[header.type] && map[header.type][header.format];
+ if (!_.isUndefined(value)) {
+ header.type = value;
+ }
+ });
+
+ return headers;
+ },
+
+ contains: function (produces, type) {
+ return produces.filter(function (val) {
+ if (val.indexOf(type) > -1) {
+ return true;
+ }
+ }).length;
+ },
+
+ parseResponseHeaders: function (data) {
+ var HEADERS_SEPARATOR = '; ';
+ var headers = _.clone(data);
+
+ _.forEach(headers, function (header) {
+ var other = [];
+ _.forEach(header, function (value, key) {
+ var properties = ['type', 'description'];
+ if (properties.indexOf(key.toLowerCase()) === -1) {
+ other.push(key + ': ' + value);
+ }
+ });
+
+ other.join(HEADERS_SEPARATOR);
+ header.other = other;
+ });
+
+ return headers;
+ },
+
+ addParameter: function(param, consumes) {
+ // Render a parameter
+ param.consumes = consumes;
+ param.defaultRendering = this.model.defaultRendering;
+
+ // Copy this param JSON spec so that it will be available for JsonEditor
+ if(param.schema){
+ $.extend(true, param.schema, this.model.definitions[param.type]);
+ param.schema.definitions = this.model.definitions;
+ // This is required for JsonEditor to display the root properly
+ if(!param.schema.type){
+ param.schema.type = 'object';
+ }
+ // This is the title that will be used by JsonEditor for the root
+ // Since we already display the parameter's name in the Parameter column
+ // We set this to space, we can't set it to null or space otherwise JsonEditor
+ // will replace it with the text "root" which won't look good on screen
+ if(!param.schema.title){
+ param.schema.title = ' ';
+ }
+ }
+
+ var paramView = new SwaggerUi.Views.ParameterView({
+ model: param,
+ tagName: 'tr',
+ readOnly: this.model.isReadOnly,
+ swaggerOptions: this.options.swaggerOptions
+ });
+ $('.operation-params', $(this.el)).append(paramView.render().el);
+ },
+
+ addStatusCode: function(statusCode) {
+ // Render status codes
+ statusCode.defaultRendering = this.model.defaultRendering;
+ var statusCodeView = new SwaggerUi.Views.StatusCodeView({
+ model: statusCode,
+ tagName: 'tr',
+ router: this.router
+ });
+ $('.operation-status', $(this.el)).append(statusCodeView.render().el);
+ },
+
+ // Note: copied from CoffeeScript compiled file
+ // TODO: redactor
+ submitOperation: function(e) {
+ var error_free, form, isFileUpload, map, opts;
+ if (e !== null) {
+ e.preventDefault();
+ }
+ form = $('.sandbox', $(this.el));
+ error_free = true;
+ form.find('input.required').each(function() {
+ $(this).removeClass('error');
+ if (jQuery.trim($(this).val()) === '') {
+ $(this).addClass('error');
+ $(this).wiggle({
+ callback: (function(_this) {
+ return function() {
+ $(_this).focus();
+ };
+ })(this)
+ });
+ error_free = false;
+ }
+ });
+ form.find('textarea.required:visible').each(function() {
+ $(this).removeClass('error');
+ if (jQuery.trim($(this).val()) === '') {
+ $(this).addClass('error');
+ $(this).wiggle({
+ callback: (function(_this) {
+ return function() {
+ return $(_this).focus();
+ };
+ })(this)
+ });
+ error_free = false;
+ }
+ });
+ form.find('select.required').each(function() {
+ $(this).removeClass('error');
+ if (this.selectedIndex === -1) {
+ $(this).addClass('error');
+ $(this).wiggle({
+ callback: (function(_this) {
+ return function() {
+ $(_this).focus();
+ };
+ })(this)
+ });
+ error_free = false;
+ }
+ });
+ if (error_free) {
+ map = this.getInputMap(form);
+ isFileUpload = this.isFileUpload(form);
+ opts = {
+ parent: this
+ };
+ if (this.options.swaggerOptions) {
+ for(var key in this.options.swaggerOptions) {
+ opts[key] = this.options.swaggerOptions[key];
+ }
+ }
+
+ var pi;
+ for(pi = 0; pi < this.model.parameters.length; pi++){
+ var p = this.model.parameters[pi];
+ if( p.jsonEditor && p.jsonEditor.isEnabled()){
+ var json = p.jsonEditor.getValue();
+ map[p.name] = JSON.stringify(json);
+ }
+ }
+
+ opts.responseContentType = $('div select[name=responseContentType]', $(this.el)).val();
+ opts.requestContentType = $('div select[name=parameterContentType]', $(this.el)).val();
+ $('.response_throbber', $(this.el)).show();
+ if (isFileUpload) {
+ $('.request_url', $(this.el)).html('<pre></pre>');
+ $('.request_url pre', $(this.el)).text(this.invocationUrl);
+
+ opts.useJQuery = true;
+ map.parameterContentType = 'multipart/form-data';
+ this.map = map;
+ return this.model.execute(map, opts, this.showCompleteStatus, this.showErrorStatus, this);
+ } else {
+ this.map = map;
+ return this.model.execute(map, opts, this.showCompleteStatus, this.showErrorStatus, this);
+ }
+ }
+ },
+
+ getInputMap: function (form) {
+ var map, ref1, l, len, o, ref2, m, len1, val, ref3, n, len2;
+ map = {};
+ ref1 = form.find('input');
+ for (l = 0, len = ref1.length; l < len; l++) {
+ o = ref1[l];
+ if ((o.value !== null) && jQuery.trim(o.value).length > 0) {
+ map[o.name] = o.value;
+ }
+ if (o.type === 'file') {
+ map[o.name] = o.files[0];
+ }
+ }
+ ref2 = form.find('textarea');
+ for (m = 0, len1 = ref2.length; m < len1; m++) {
+ o = ref2[m];
+ val = this.getTextAreaValue(o);
+ if ((val !== null) && jQuery.trim(val).length > 0) {
+ map[o.name] = val;
+ }
+ }
+ ref3 = form.find('select');
+ for (n = 0, len2 = ref3.length; n < len2; n++) {
+ o = ref3[n];
+ val = this.getSelectedValue(o);
+ if ((val !== null) && jQuery.trim(val).length > 0) {
+ map[o.name] = val;
+ }
+ }
+ return map;
+ },
+
+ isFileUpload: function (form) {
+ var ref1, l, len, o;
+ var isFileUpload = false;
+ ref1 = form.find('input');
+ for (l = 0, len = ref1.length; l < len; l++) {
+ o = ref1[l];
+ if (o.type === 'file') {
+ isFileUpload = true;
+ }
+ }
+ return isFileUpload;
+ },
+
+ success: function(response, parent) {
+ parent.showCompleteStatus(response);
+ },
+
+ // wraps a jquery response as a shred response
+ wrap: function(data) {
+ var h, headerArray, headers, i, l, len, o;
+ headers = {};
+ headerArray = data.getAllResponseHeaders().split('\r');
+ for (l = 0, len = headerArray.length; l < len; l++) {
+ i = headerArray[l];
+ h = i.match(/^([^:]*?):(.*)$/);
+ if (!h) {
+ h = [];
+ }
+ h.shift();
+ if (h[0] !== void 0 && h[1] !== void 0) {
+ headers[h[0].trim()] = h[1].trim();
+ }
+ }
+ o = {};
+ o.content = {};
+ o.content.data = data.responseText;
+ o.headers = headers;
+ o.request = {};
+ o.request.url = this.invocationUrl;
+ o.status = data.status;
+ return o;
+ },
+
+ getSelectedValue: function(select) {
+ if (!select.multiple) {
+ return select.value;
+ } else {
+ var options = [];
+ for (var l = 0, len = select.options.length; l < len; l++) {
+ var opt = select.options[l];
+ if (opt.selected) {
+ options.push(opt.value);
+ }
+ }
+ if (options.length > 0) {
+ return options;
+ } else {
+ return null;
+ }
+ }
+ },
+
+ // handler for hide response link
+ hideResponse: function(e) {
+ if (e) { e.preventDefault(); }
+ $('.response', $(this.el)).slideUp();
+ $('.response_hider', $(this.el)).fadeOut();
+ },
+
+ // Show response from server
+ showResponse: function(response) {
+ var prettyJson = JSON.stringify(response, null, '\t').replace(/\n/g, '<br>');
+ $('.response_body', $(this.el)).html(_.escape(prettyJson));
+ },
+
+ // Show error from server
+ showErrorStatus: function(data, parent) {
+ parent.showStatus(data);
+ },
+
+ // show the status codes
+ showCompleteStatus: function(data, parent){
+ parent.showStatus(data);
+ },
+
+ // Adapted from http://stackoverflow.com/a/2893259/454004
+ // Note: directly ported from CoffeeScript
+ // TODO: Cleanup CoffeeScript artifacts
+ formatXml: function(xml) {
+ var contexp, fn, formatted, indent, l, lastType, len, lines, ln, pad, reg, transitions, wsexp;
+ reg = /(>)(<)(\/*)/g;
+ wsexp = /[ ]*(.*)[ ]+\n/g;
+ contexp = /(<.+>)(.+\n)/g;
+ xml = xml.replace(/\r\n/g, '\n').replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2');
+ pad = 0;
+ formatted = '';
+ lines = xml.split('\n');
+ indent = 0;
+ lastType = 'other';
+ transitions = {
+ 'single->single': 0,
+ 'single->closing': -1,
+ 'single->opening': 0,
+ 'single->other': 0,
+ 'closing->single': 0,
+ 'closing->closing': -1,
+ 'closing->opening': 0,
+ 'closing->other': 0,
+ 'opening->single': 1,
+ 'opening->closing': 0,
+ 'opening->opening': 1,
+ 'opening->other': 1,
+ 'other->single': 0,
+ 'other->closing': -1,
+ 'other->opening': 0,
+ 'other->other': 0
+ };
+ fn = function(ln) {
+ var fromTo, j, key, padding, type, types, value;
+ types = {
+ single: Boolean(ln.match(/<.+\/>/)),
+ closing: Boolean(ln.match(/<\/.+>/)),
+ opening: Boolean(ln.match(/<[^!?].*>/))
+ };
+ type = ((function() {
+ var results;
+ results = [];
+ for (key in types) {
+ value = types[key];
+ if (value) {
+ results.push(key);
+ }
+ }
+ return results;
+ })())[0];
+ type = type === void 0 ? 'other' : type;
+ fromTo = lastType + '->' + type;
+ lastType = type;
+ padding = '';
+ indent += transitions[fromTo];
+ padding = ((function() {
+ var m, ref1, results;
+ results = [];
+ for (j = m = 0, ref1 = indent; 0 <= ref1 ? m < ref1 : m > ref1; j = 0 <= ref1 ? ++m : --m) {
+ results.push(' ');
+ }
+ return results;
+ })()).join('');
+ if (fromTo === 'opening->closing') {
+ formatted = formatted.substr(0, formatted.length - 1) + ln + '\n';
+ } else {
+ formatted += padding + ln + '\n';
+ }
+ };
+ for (l = 0, len = lines.length; l < len; l++) {
+ ln = lines[l];
+ fn(ln);
+ }
+ return formatted;
+ },
+
+ // puts the response data in UI
+ showStatus: function(response) {
+ var url, content;
+ if (response.content === undefined) {
+ content = response.data;
+ url = response.url;
+ } else {
+ content = response.content.data;
+ url = response.request.url;
+ }
+ var headers = response.headers;
+ content = jQuery.trim(content);
+
+ // if server is nice, and sends content-type back, we can use it
+ var contentType = null;
+ if (headers) {
+ contentType = headers['Content-Type'] || headers['content-type'];
+ if (contentType) {
+ contentType = contentType.split(';')[0].trim();
+ }
+ }
+ $('.response_body', $(this.el)).removeClass('json');
+ $('.response_body', $(this.el)).removeClass('xml');
+
+ var supportsAudioPlayback = function(contentType){
+ var audioElement = document.createElement('audio');
+ return !!(audioElement.canPlayType && audioElement.canPlayType(contentType).replace(/no/, ''));
+ };
+
+ var pre;
+ var code;
+ if (!content) {
+ code = $('<code />').text('no content');
+ pre = $('<pre class="json" />').append(code);
+
+ // JSON
+ } else if (contentType === 'application/json' || /\+json$/.test(contentType)) {
+ var json = null;
+ try {
+ json = JSON.stringify(JSON.parse(content), null, ' ');
+ } catch (_error) {
+ json = 'can\'t parse JSON. Raw result:\n\n' + content;
+ }
+ code = $('<code />').text(json);
+ pre = $('<pre class="json" />').append(code);
+
+ // XML
+ } else if (contentType === 'application/xml' || /\+xml$/.test(contentType)) {
+ code = $('<code />').text(this.formatXml(content));
+ pre = $('<pre class="xml" />').append(code);
+
+ // HTML
+ } else if (contentType === 'text/html') {
+ code = $('<code />').html(_.escape(content));
+ pre = $('<pre class="xml" />').append(code);
+
+ // Plain Text
+ } else if (/text\/plain/.test(contentType)) {
+ code = $('<code />').text(content);
+ pre = $('<pre class="plain" />').append(code);
+
+
+ // Image
+ } else if (/^image\//.test(contentType)) {
+ pre = $('<img>').attr('src', url);
+
+ // Audio
+ } else if (/^audio\//.test(contentType) && supportsAudioPlayback(contentType)) {
+ pre = $('<audio controls>').append($('<source>').attr('src', url).attr('type', contentType));
+
+ // Download
+ } else if (headers['Content-Disposition'] && (/attachment/).test(headers['Content-Disposition']) ||
+ headers['content-disposition'] && (/attachment/).test(headers['content-disposition']) ||
+ headers['Content-Description'] && (/File Transfer/).test(headers['Content-Description']) ||
+ headers['content-description'] && (/File Transfer/).test(headers['content-description'])) {
+
+ if ('Blob' in window) {
+ var type = contentType || 'text/html';
+ var blob = new Blob([content], {type: type});
+ var a = document.createElement('a');
+ var href = window.URL.createObjectURL(blob);
+ var fileName = response.url.substr(response.url.lastIndexOf('/') + 1);
+ var download = [type, fileName, href].join(':');
+
+ a.setAttribute('href', href);
+ a.setAttribute('download', download);
+ a.innerText = 'Download ' + fileName;
+
+ pre = $('<div/>').append(a);
+ } else {
+ pre = $('<pre class="json" />').append('Download headers detected but your browser does not support downloading binary via XHR (Blob).');
+ }
+
+ // Location header based redirect download
+ } else if(headers.location || headers.Location) {
+ window.location = response.url;
+
+ // Anything else (CORS)
+ } else {
+ code = $('<code />').text(content);
+ pre = $('<pre class="json" />').append(code);
+ }
+ var response_body = pre;
+ $('.request_url', $(this.el)).html('<pre></pre>');
+ $('.request_url pre', $(this.el)).text(url);
+ $('.response_code', $(this.el)).html('<pre>' + response.status + '</pre>');
+ $('.response_body', $(this.el)).html(response_body);
+ $('.response_headers', $(this.el)).html('<pre>' + _.escape(JSON.stringify(response.headers, null, ' ')).replace(/\n/g, '<br>') + '</pre>');
+ $('.response', $(this.el)).slideDown();
+ $('.response_hider', $(this.el)).show();
+ $('.response_throbber', $(this.el)).hide();
+
+
+ // adds curl output
+ var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType});
+ curlCommand = curlCommand.replace('!', '&#33;');
+ $( 'div.curl', $(this.el)).html('<pre>' + _.escape(curlCommand) + '</pre>');
+
+ // only highlight the response if response is less than threshold, default state is highlight response
+ var opts = this.options.swaggerOptions;
+
+ if (opts.showRequestHeaders) {
+ var form = $('.sandbox', $(this.el)),
+ map = this.getInputMap(form),
+ requestHeaders = this.model.getHeaderParams(map);
+ delete requestHeaders['Content-Type'];
+ $('.request_headers', $(this.el)).html('<pre>' + _.escape(JSON.stringify(requestHeaders, null, ' ')).replace(/\n/g, '<br>') + '</pre>');
+ }
+
+ var response_body_el = $('.response_body', $(this.el))[0];
+ // only highlight the response if response is less than threshold, default state is highlight response
+ if (opts.highlightSizeThreshold && typeof response.data !== 'undefined' && response.data.length > opts.highlightSizeThreshold) {
+ return response_body_el;
+ } else {
+ return hljs.highlightBlock(response_body_el);
+ }
+ },
+
+ toggleOperationContent: function (event) {
+ var elem = $('#' + Docs.escapeResourceName(this.parentId + '_' + this.nickname + '_content'));
+ if (elem.is(':visible')){
+ $.bbq.pushState('#/', 2);
+ event.preventDefault();
+ Docs.collapseOperation(elem);
+ } else {
+ Docs.expandOperation(elem);
+ }
+ },
+
+ getTextAreaValue: function(textArea) {
+ var param, parsed, result, i;
+ if (textArea.value === null || jQuery.trim(textArea.value).length === 0) {
+ return null;
+ }
+ param = this.getParamByName(textArea.name);
+ if (param && param.type && param.type.toLowerCase() === 'array') {
+ parsed = textArea.value.split('\n');
+ result = [];
+ for (i = 0; i < parsed.length; i++) {
+ if (parsed[i] !== null && jQuery.trim(parsed[i]).length > 0) {
+ result.push(parsed[i]);
+ }
+ }
+ return result.length > 0 ? result : null;
+ } else {
+ return textArea.value;
+ }
+ },
+
+ showSnippet: function () {
+ var contentTypeEl = this.$('[name=responseContentType]');
+ var xmlSnippetEl = this.$('.operation-status .snippet_xml, .response-class .snippet_xml');
+ var jsonSnippetEl = this.$('.operation-status .snippet_json, .response-class .snippet_json');
+ var contentType;
+
+ if (!contentTypeEl.length) { return; }
+ contentType = contentTypeEl.val();
+
+ if (contentType.indexOf('xml') > -1) {
+ xmlSnippetEl.show();
+ jsonSnippetEl.hide();
+ } else {
+ jsonSnippetEl.show();
+ xmlSnippetEl.hide();
+ }
+ },
+
+ getParamByName: function(name) {
+ var i;
+ if (this.model.parameters) {
+ for(i = 0; i < this.model.parameters.length; i++) {
+ if (this.model.parameters[i].name === name) {
+ return this.model.parameters[i];
+ }
+ }
+ }
+ return null;
+ }
+
+});
+
+'use strict';
+
+SwaggerUi.Views.ParameterContentTypeView = Backbone.View.extend({
+ initialize: function () {},
+
+ render: function(){
+ this.model.parameterContentTypeId = 'pct' + Math.random();
+ $(this.el).html(Handlebars.templates.parameter_content_type(this.model));
+ return this;
+ }
+
+});
+'use strict';
+
+SwaggerUi.Views.ParameterView = Backbone.View.extend({
+ events: {
+ 'change [name=parameterContentType]' : 'toggleParameterSnippet'
+ },
+
+ initialize: function(){
+ Handlebars.registerHelper('isArray', function(param, opts) {
+ if (param.type.toLowerCase() === 'array' || param.allowMultiple) {
+ return opts.fn(this);
+ } else {
+ return opts.inverse(this);
+ }
+ });
+ },
+
+ render: function() {
+ var type = this.model.type || this.model.dataType;
+ var modelType = this.model.modelSignature.type;
+ var modelDefinitions = this.model.modelSignature.definitions;
+ var schema = this.model.schema || {};
+ var consumes = this.model.consumes || [];
+
+
+ if (typeof type === 'undefined') {
+ if (schema.$ref) {
+ var ref = schema.$ref;
+ if (ref.indexOf('#/definitions/') === 0) {
+ type = ref.substring('#/definitions/'.length);
+ } else {
+ type = ref;
+ }
+ }
+ }
+
+ this.model.type = type;
+ this.model.paramType = this.model.in || this.model.paramType;
+ this.model.isBody = this.model.paramType === 'body' || this.model.in === 'body';
+ this.model.isFile = type && type.toLowerCase() === 'file';
+
+ // Allow for default === false
+ if(typeof this.model.default === 'undefined') {
+ this.model.default = this.model.defaultValue;
+ }
+
+ this.model.hasDefault = (typeof this.model.default !== 'undefined');
+ this.model.valueId = 'm' + this.model.name + Math.random();
+
+ if (this.model.allowableValues) {
+ this.model.isList = true;
+ }
+
+ var isXML = this.contains(consumes, 'xml');
+ var isJSON = isXML ? this.contains(consumes, 'json') : true;
+
+ var template = this.template();
+ $(this.el).html(template(this.model));
+
+ var signatureModel = {
+ sampleJSON: isJSON ? SwaggerUi.partials.signature.createParameterJSONSample(modelType, modelDefinitions) : false,
+ sampleXML: isXML ? SwaggerUi.partials.signature.createXMLSample(schema, modelDefinitions, true) : false,
+ isParam: true,
+ signature: SwaggerUi.partials.signature.getParameterModelSignature(modelType, modelDefinitions),
+ defaultRendering: this.model.defaultRendering
+ };
+
+ if (this.model.sampleJSON) {
+ var signatureView = new SwaggerUi.Views.SignatureView({model: signatureModel, tagName: 'div'});
+ $('.model-signature', $(this.el)).append(signatureView.render().el);
+ }
+ else {
+ $('.model-signature', $(this.el)).html(this.model.signature);
+ }
+
+ var isParam = false;
+
+ if( this.options.swaggerOptions.jsonEditor && this.model.isBody && this.model.schema){
+ var $self = $(this.el);
+ this.model.jsonEditor =
+ /* global JSONEditor */
+ new JSONEditor($('.editor_holder', $self)[0],
+ {schema: this.model.schema, startval : this.model.default,
+ ajax:true,
+ disable_properties:true,
+ disable_edit_json:true,
+ iconlib: 'swagger' });
+ // This is so that the signature can send back the sample to the json editor
+ // TODO: SignatureView should expose an event "onSampleClicked" instead
+ signatureModel.jsonEditor = this.model.jsonEditor;
+ $('.body-textarea', $self).hide();
+ $('.editor_holder', $self).show();
+ $('.parameter-content-type', $self)
+ .change(function(e){
+ if(e.target.value === 'application/xml'){
+ $('.body-textarea', $self).show();
+ $('.editor_holder', $self).hide();
+ this.model.jsonEditor.disable();
+ }
+ else {
+ $('.body-textarea', $self).hide();
+ $('.editor_holder', $self).show();
+ this.model.jsonEditor.enable();
+ }
+ });
+ }
+
+
+ if (this.model.isBody) {
+ isParam = true;
+ }
+
+ var contentTypeModel = {
+ isParam: isParam
+ };
+
+ contentTypeModel.consumes = this.model.consumes;
+
+ if (isParam) {
+ var parameterContentTypeView = new SwaggerUi.Views.ParameterContentTypeView({model: contentTypeModel});
+ $('.parameter-content-type', $(this.el)).append(parameterContentTypeView.render().el);
+ this.toggleParameterSnippet();
+ }
+
+ else {
+ var responseContentTypeView = new SwaggerUi.Views.ResponseContentTypeView({model: contentTypeModel});
+ $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
+ this.toggleResponseSnippet();
+ }
+
+ return this;
+ },
+
+ contains: function (consumes, type) {
+ return consumes.filter(function (val) {
+ if (val.indexOf(type) > -1) {
+ return true;
+ }
+ }).length;
+ },
+
+ toggleParameterSnippet: function () {
+ var contentType = this.$('[name=parameterContentType]').val();
+
+ this.toggleSnippet(contentType);
+ },
+
+ toggleResponseSnippet: function () {
+ var contentEl = this.$('[name=responseContentType]');
+
+ if (!contentEl.length) { return; }
+
+ this.toggleSnippet(contentEl.val());
+ },
+
+ toggleSnippet: function (type) {
+ if (type.indexOf('xml') > -1) {
+ this.$('.snippet_xml').show();
+ this.$('.snippet_json').hide();
+ } else {
+ this.$('.snippet_json').show();
+ this.$('.snippet_xml').hide();
+ }
+ },
+
+ // Return an appropriate template based on if the parameter is a list, readonly, required
+ template: function(){
+ if (this.model.isList) {
+ return Handlebars.templates.param_list;
+ } else {
+ if (this.options.readOnly) {
+ if (this.model.required) {
+ return Handlebars.templates.param_readonly_required;
+ } else {
+ return Handlebars.templates.param_readonly;
+ }
+ } else {
+ if (this.model.required) {
+ return Handlebars.templates.param_required;
+ } else {
+ return Handlebars.templates.param;
+ }
+ }
+ }
+ }
+});
+
+'use strict';
+
+/* jshint -W122 */
+SwaggerUi.partials.signature = (function () {
+ // copy-pasted from swagger-js
+ var resolveSchema = function (schema) {
+ if (_.isPlainObject(schema.schema)) {
+ schema = resolveSchema(schema.schema);
+ }
+
+ return schema;
+ };
+
+ // copy-pasted from swagger-js
+ var simpleRef = function (name) {
+ if (typeof name === 'undefined') {
+ return null;
+ }
+
+ if (name.indexOf('#/definitions/') === 0) {
+ return name.substring('#/definitions/'.length);
+ } else {
+ return name;
+ }
+ };
+
+ // copy-pasted from swagger-js
+ var getInlineModel = function(inlineStr) {
+ if(/^Inline Model \d+$/.test(inlineStr)) {
+ var id = parseInt(inlineStr.substr('Inline Model'.length).trim(),10); //
+ var model = this.inlineModels[id];
+ return model;
+ }
+ // I'm returning null here, should I rather throw an error?
+ return null;
+ };
+
+ // copy-pasted from swagger-js
+ var formatXml = function(xml) {
+ var contexp, fn, formatted, indent, l, lastType, len, lines, ln, pad, reg, transitions, wsexp;
+ reg = /(>)(<)(\/*)/g;
+ wsexp = /[ ]*(.*)[ ]+\n/g;
+ contexp = /(<.+>)(.+\n)/g;
+ xml = xml.replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2');
+ pad = 0;
+ formatted = '';
+ lines = xml.split('\n');
+ indent = 0;
+ lastType = 'other';
+ transitions = {
+ 'single->single': 0,
+ 'single->closing': -1,
+ 'single->opening': 0,
+ 'single->other': 0,
+ 'closing->single': 0,
+ 'closing->closing': -1,
+ 'closing->opening': 0,
+ 'closing->other': 0,
+ 'opening->single': 1,
+ 'opening->closing': 0,
+ 'opening->opening': 1,
+ 'opening->other': 1,
+ 'other->single': 0,
+ 'other->closing': -1,
+ 'other->opening': 0,
+ 'other->other': 0
+ };
+ fn = function(ln) {
+ var fromTo, j, key, padding, type, types, value;
+ types = {
+ single: Boolean(ln.match(/<.+\/>/)),
+ closing: Boolean(ln.match(/<\/.+>/)),
+ opening: Boolean(ln.match(/<[^!?].*>/))
+ };
+ type = ((function() {
+ var results;
+ results = [];
+ for (key in types) {
+ value = types[key];
+ if (value) {
+ results.push(key);
+ }
+ }
+ return results;
+ })())[0];
+ type = type === void 0 ? 'other' : type;
+ fromTo = lastType + '->' + type;
+ lastType = type;
+ padding = '';
+ indent += transitions[fromTo];
+ padding = ((function() {
+ var m, ref1, results;
+ results = [];
+ for (j = m = 0, ref1 = indent; 0 <= ref1 ? m < ref1 : m > ref1; j = 0 <= ref1 ? ++m : --m) {
+ results.push(' ');
+ }
+ return results;
+ })()).join('');
+ if (fromTo === 'opening->closing') {
+ formatted = formatted.substr(0, formatted.length - 1) + ln + '\n';
+ } else {
+ formatted += padding + ln + '\n';
+ }
+ };
+ for (l = 0, len = lines.length; l < len; l++) {
+ ln = lines[l];
+ fn(ln);
+ }
+ return formatted;
+ };
+
+ // copy-pasted from swagger-js
+ var getModelSignature = function (name, schema, models, modelPropertyMacro) {
+ var strongOpen = '<span class="strong">';
+ var strongClose = '</span>';
+
+ var optionHtml = function (label, value) {
+ return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>';
+ };
+
+
+ // Allow for ignoring the 'name' argument.... shifting the rest
+ if(_.isObject(arguments[0])) {
+ name = void 0;
+ schema = arguments[0];
+ models = arguments[1];
+ modelPropertyMacro = arguments[2];
+ }
+
+ models = models || {};
+
+ // Resolve the schema (Handle nested schemas)
+ schema = resolveSchema(schema);
+
+ // Return for empty object
+ if(_.isEmpty(schema)) {
+ return strongOpen + 'Empty' + strongClose;
+ }
+
+ // Dereference $ref from 'models'
+ if(typeof schema.$ref === 'string') {
+ name = simpleRef(schema.$ref);
+ schema = models[name];
+ if(typeof schema === 'undefined')
+ {
+ return strongOpen + name + ' is not defined!' + strongClose;
+ }
+ }
+
+ if(typeof name !== 'string') {
+ name = schema.title || 'Inline Model';
+ }
+
+ // If we are a Model object... adjust accordingly
+ if(schema.definition) {
+ schema = schema.definition;
+ }
+
+ if(typeof modelPropertyMacro !== 'function') {
+ modelPropertyMacro = function(prop){
+ return (prop || {}).default;
+ };
+ }
+
+ var references = {};
+ var seenModels = [];
+ var inlineModels = 0;
+
+ // Generate current HTML
+ var html = processModel(schema, name);
+
+ // Generate references HTML
+ while (_.keys(references).length > 0) {
+ /* jshint ignore:start */
+ _.forEach(references, function (schema, name) {
+ var seenModel = _.indexOf(seenModels, name) > -1;
+
+ delete references[name];
+
+ if (!seenModel) {
+ seenModels.push(name);
+
+ html += '<br />' + processModel(schema, name);
+ }
+ });
+ /* jshint ignore:end */
+ }
+
+ return html;
+
+
+ function addReference(schema, name, skipRef) {
+ var modelName = name;
+ var model;
+
+ if (schema.$ref) {
+ modelName = schema.title || simpleRef(schema.$ref);
+ model = models[simpleRef(schema.$ref)];
+ } else if (_.isUndefined(name)) {
+ modelName = schema.title || 'Inline Model ' + (++inlineModels);
+ model = {definition: schema};
+ }
+
+ if (skipRef !== true) {
+ references[modelName] = _.isUndefined(model) ? {} : model.definition;
+ }
+
+ return modelName;
+ }
+
+ function primitiveToHTML(schema) {
+ var html = '<span class="propType">';
+ var type = schema.type || 'object';
+
+ if (schema.$ref) {
+ html += addReference(schema, simpleRef(schema.$ref));
+ } else if (type === 'object') {
+ if (!_.isUndefined(schema.properties)) {
+ html += addReference(schema);
+ } else {
+ html += 'object';
+ }
+ } else if (type === 'array') {
+ html += 'Array[';
+
+ if (_.isArray(schema.items)) {
+ html += _.map(schema.items, addReference).join(',');
+ } else if (_.isPlainObject(schema.items)) {
+ if (_.isUndefined(schema.items.$ref)) {
+ if (!_.isUndefined(schema.items.type) && _.indexOf(['array', 'object'], schema.items.type) === -1) {
+ html += schema.items.type;
+ } else {
+ html += addReference(schema.items);
+ }
+ } else {
+ html += addReference(schema.items, simpleRef(schema.items.$ref));
+ }
+ } else {
+ console.log('Array type\'s \'items\' schema is not an array or an object, cannot process');
+ html += 'object';
+ }
+
+ html += ']';
+ } else {
+ html += schema.type;
+ }
+
+ html += '</span>';
+
+ return html;
+ }
+
+ function primitiveToOptionsHTML(schema, html) {
+ var options = '';
+ var type = schema.type || 'object';
+ var isArray = type === 'array';
+
+ if (isArray) {
+ if (_.isPlainObject(schema.items) && !_.isUndefined(schema.items.type)) {
+ type = schema.items.type;
+ } else {
+ type = 'object';
+ }
+ }
+
+ if (!_.isUndefined(schema.default)) {
+ options += optionHtml('Default', schema.default);
+ }
+
+ switch (type) {
+ case 'string':
+ if (schema.minLength) {
+ options += optionHtml('Min. Length', schema.minLength);
+ }
+
+ if (schema.maxLength) {
+ options += optionHtml('Max. Length', schema.maxLength);
+ }
+
+ if (schema.pattern) {
+ options += optionHtml('Reg. Exp.', schema.pattern);
+ }
+ break;
+ case 'integer':
+ case 'number':
+ if (schema.minimum) {
+ options += optionHtml('Min. Value', schema.minimum);
+ }
+
+ if (schema.exclusiveMinimum) {
+ options += optionHtml('Exclusive Min.', 'true');
+ }
+
+ if (schema.maximum) {
+ options += optionHtml('Max. Value', schema.maximum);
+ }
+
+ if (schema.exclusiveMaximum) {
+ options += optionHtml('Exclusive Max.', 'true');
+ }
+
+ if (schema.multipleOf) {
+ options += optionHtml('Multiple Of', schema.multipleOf);
+ }
+
+ break;
+ }
+
+ if (isArray) {
+ if (schema.minItems) {
+ options += optionHtml('Min. Items', schema.minItems);
+ }
+
+ if (schema.maxItems) {
+ options += optionHtml('Max. Items', schema.maxItems);
+ }
+
+ if (schema.uniqueItems) {
+ options += optionHtml('Unique Items', 'true');
+ }
+
+ if (schema.collectionFormat) {
+ options += optionHtml('Coll. Format', schema.collectionFormat);
+ }
+ }
+
+ if (_.isUndefined(schema.items)) {
+ if (_.isArray(schema.enum)) {
+ var enumString;
+
+ if (type === 'number' || type === 'integer') {
+ enumString = schema.enum.join(', ');
+ } else {
+ enumString = '"' + schema.enum.join('", "') + '"';
+ }
+
+ options += optionHtml('Enum', enumString);
+ }
+ }
+
+ if (options.length > 0) {
+ html = '<span class="propWrap">' + html + '<table class="optionsWrapper"><tr><th colspan="2">' + type + '</th></tr>' + options + '</table></span>';
+ }
+
+ return html;
+ }
+
+ function processModel(schema, name) {
+ var type = schema.type || 'object';
+ var isArray = schema.type === 'array';
+ var html = strongOpen + name + ' ' + (isArray ? '[' : '{') + strongClose;
+ var contents;
+
+ if (name) {
+ seenModels.push(name);
+ }
+
+ if (isArray) {
+ if (_.isArray(schema.items)) {
+ html += '<div>' + _.map(schema.items, function (item) {
+ var type = item.type || 'object';
+
+ if (_.isUndefined(item.$ref)) {
+ if (_.indexOf(['array', 'object'], type) > -1) {
+ if (type === 'object' && _.isUndefined(item.properties)) {
+ return 'object';
+ } else {
+ return addReference(item);
+ }
+ } else {
+ return primitiveToOptionsHTML(item, type);
+ }
+ } else {
+ return addReference(item, simpleRef(item.$ref));
+ }
+ }).join(',</div><div>');
+ } else if (_.isPlainObject(schema.items)) {
+ if (_.isUndefined(schema.items.$ref)) {
+ if (_.indexOf(['array', 'object'], schema.items.type || 'object') > -1) {
+ if ((_.isUndefined(schema.items.type) || schema.items.type === 'object') && _.isUndefined(schema.items.properties)) {
+ html += '<div>object</div>';
+ } else {
+ html += '<div>' + addReference(schema.items) + '</div>';
+ }
+ } else {
+ html += '<div>' + primitiveToOptionsHTML(schema.items, schema.items.type) + '</div>';
+ }
+ } else {
+ html += '<div>' + addReference(schema.items, simpleRef(schema.items.$ref)) + '</div>';
+ }
+ } else {
+ console.log('Array type\'s \'items\' property is not an array or an object, cannot process');
+ html += '<div>object</div>';
+ }
+ } else {
+ if (schema.$ref) {
+ html += '<div>' + addReference(schema, name) + '</div>';
+ } else if (type === 'object') {
+ if (_.isPlainObject(schema.properties)) {
+ contents = _.map(schema.properties, function (property, name) {
+ var propertyIsRequired = (_.indexOf(schema.required, name) >= 0);
+ var cProperty = _.cloneDeep(property);
+
+ var requiredClass = propertyIsRequired ? 'required' : '';
+ var html = '<span class="propName ' + requiredClass + '">' + name + '</span> (';
+ var model;
+ var propDescription;
+
+ // Allow macro to set the default value
+ cProperty.default = modelPropertyMacro(cProperty);
+
+ // Resolve the schema (Handle nested schemas)
+ cProperty = resolveSchema(cProperty);
+
+ propDescription = property.description || cProperty.description;
+
+ // We need to handle property references to primitives (Issue 339)
+ if (!_.isUndefined(cProperty.$ref)) {
+ model = models[simpleRef(cProperty.$ref)];
+
+ if (!_.isUndefined(model) && _.indexOf([undefined, 'array', 'object'], model.definition.type) === -1) {
+ // Use referenced schema
+ cProperty = resolveSchema(model.definition);
+ }
+ }
+
+ html += primitiveToHTML(cProperty);
+
+ if(!propertyIsRequired) {
+ html += ', <span class="propOptKey">optional</span>';
+ }
+
+ if(property.readOnly) {
+ html += ', <span class="propReadOnly">read only</span>';
+ }
+
+ html += ')';
+
+ if (!_.isUndefined(propDescription)) {
+ html += ': ' + '<span class="propDesc">' + propDescription + '</span>';
+ }
+
+ if (cProperty.enum) {
+ html += ' = <span class="propVals">[\'' + cProperty.enum.join('\', \'') + '\']</span>';
+ }
+
+ return '<div' + (property.readOnly ? ' class="readOnly"' : '') + '>' + primitiveToOptionsHTML(cProperty, html);
+ }).join(',</div>');
+ }
+
+ if (contents) {
+ html += contents + '</div>';
+ }
+ } else {
+ html += '<div>' + primitiveToOptionsHTML(schema, type) + '</div>';
+ }
+ }
+
+ return html + strongOpen + (isArray ? ']' : '}') + strongClose;
+ }
+
+ };
+
+ // copy-pasted from swagger-js
+ var schemaToJSON = function (schema, models, modelsToIgnore, modelPropertyMacro) {
+ // Resolve the schema (Handle nested schemas)
+ schema = resolveSchema(schema);
+
+ if(typeof modelPropertyMacro !== 'function') {
+ modelPropertyMacro = function(prop){
+ return (prop || {}).default;
+ };
+ }
+
+ modelsToIgnore= modelsToIgnore || {};
+
+ var type = schema.type || 'object';
+ var format = schema.format;
+ var model;
+ var output;
+
+ if (!_.isUndefined(schema.example)) {
+ output = schema.example;
+ } else if (_.isUndefined(schema.items) && _.isArray(schema.enum)) {
+ output = schema.enum[0];
+ }
+
+ if (_.isUndefined(output)) {
+ if (schema.$ref) {
+ model = models[simpleRef(schema.$ref)];
+
+ if (!_.isUndefined(model)) {
+ if (_.isUndefined(modelsToIgnore[model.name])) {
+ modelsToIgnore[model.name] = model;
+ output = schemaToJSON(model.definition, models, modelsToIgnore, modelPropertyMacro);
+ delete modelsToIgnore[model.name];
+ } else {
+ if (model.type === 'array') {
+ output = [];
+ } else {
+ output = {};
+ }
+ }
+ }
+ } else if (!_.isUndefined(schema.default)) {
+ output = schema.default;
+ } else if (type === 'string') {
+ if (format === 'date-time') {
+ output = new Date().toISOString();
+ } else if (format === 'date') {
+ output = new Date().toISOString().split('T')[0];
+ } else {
+ output = 'string';
+ }
+ } else if (type === 'integer') {
+ output = 0;
+ } else if (type === 'number') {
+ output = 0.0;
+ } else if (type === 'boolean') {
+ output = true;
+ } else if (type === 'object') {
+ output = {};
+
+ _.forEach(schema.properties, function (property, name) {
+ var cProperty = _.cloneDeep(property);
+
+ // Allow macro to set the default value
+ cProperty.default = modelPropertyMacro(property);
+
+ output[name] = schemaToJSON(cProperty, models, modelsToIgnore, modelPropertyMacro);
+ });
+ } else if (type === 'array') {
+ output = [];
+
+ if (_.isArray(schema.items)) {
+ _.forEach(schema.items, function (item) {
+ output.push(schemaToJSON(item, models, modelsToIgnore, modelPropertyMacro));
+ });
+ } else if (_.isPlainObject(schema.items)) {
+ output.push(schemaToJSON(schema.items, models, modelsToIgnore, modelPropertyMacro));
+ } else if (_.isUndefined(schema.items)) {
+ output.push({});
+ } else {
+ console.log('Array type\'s \'items\' property is not an array or an object, cannot process');
+ }
+ }
+ }
+
+ return output;
+ };
+
+ // copy-pasted from swagger-js
+ var createJSONSample = function (value, modelsToIgnore) {
+ modelsToIgnore = modelsToIgnore || {};
+
+ modelsToIgnore[value.name] = value;
+
+ // Response support
+ if (value.examples && _.isPlainObject(value.examples) && value.examples['application/json']) {
+ value.definition.example = value.examples['application/json'];
+
+ if (_.isString(value.definition.example)) {
+ value.definition.example = jsyaml.safeLoad(value.definition.example);
+ }
+ } else if (!value.definition.example) {
+ value.definition.example = value.examples;
+ }
+
+ return schemaToJSON(value.definition, value.models, modelsToIgnore, value.modelPropertyMacro);
+ };
+
+ // copy-pasted from swagger-js
+ var getParameterModelSignature = function (type, definitions) {
+ var isPrimitive, listType;
+
+ if (type instanceof Array) {
+ listType = true;
+ type = type[0];
+ }
+
+ // Convert undefined to string of 'undefined'
+ if (typeof type === 'undefined') {
+ type = 'undefined';
+ isPrimitive = true;
+
+ } else if (definitions[type]){
+ // a model def exists?
+ type = definitions[type]; /* Model */
+ isPrimitive = false;
+
+ } else if (getInlineModel(type)) {
+ type = getInlineModel(type); /* Model */
+ isPrimitive = false;
+
+ } else {
+ // We default to primitive
+ isPrimitive = true;
+ }
+
+ if (isPrimitive) {
+ if (listType) {
+ return 'Array[' + type + ']';
+ } else {
+ return type.toString();
+ }
+ } else {
+ if (listType) {
+ return 'Array[' + getModelSignature(type.name, type.definition, type.models, type.modelPropertyMacro) + ']';
+ } else {
+ return getModelSignature(type.name, type.definition, type.models, type.modelPropertyMacro);
+ }
+ }
+ };
+
+ // copy-pasted from swagger-js
+ var createParameterJSONSample = function (type, models) {
+ var listType, sampleJson, innerType;
+ models = models || {};
+
+ listType = (type instanceof Array);
+ innerType = listType ? type[0] : type;
+
+ if(models[innerType]) {
+ sampleJson = createJSONSample(models[innerType]);
+ } else if (getInlineModel(innerType)){
+ sampleJson = createJSONSample(getInlineModel(innerType)); // may return null, if type isn't correct
+ }
+
+
+ if (sampleJson) {
+ sampleJson = listType ? [sampleJson] : sampleJson;
+
+ if (typeof sampleJson === 'string') {
+ return sampleJson;
+ } else if (_.isObject(sampleJson)) {
+ var t = sampleJson;
+
+ if (sampleJson instanceof Array && sampleJson.length > 0) {
+ t = sampleJson[0];
+ }
+
+ if (t.nodeName && typeof t === 'Node') {
+ var xmlString = new XMLSerializer().serializeToString(t);
+
+ return formatXml(xmlString);
+ } else {
+ return JSON.stringify(sampleJson, null, 2);
+ }
+ } else {
+ return sampleJson;
+ }
+ }
+ };
+
+ var wrapTag = function (name, value, attrs) {
+ var str, attributes;
+
+ attrs = attrs || [];
+
+ attributes = attrs.map(function (attr) {
+ return ' ' + attr.name + '="' + attr.value + '"';
+ }).join('');
+
+ if (!name) {
+ return getErrorMessage('Node name is not provided');
+ }
+
+ str = [
+ '<', name,
+ attributes,
+ '>',
+ value,
+ '</', name, '>'
+ ];
+
+ return str.join('');
+ };
+
+ var getName = function (name, xml) {
+ var result = name || '';
+
+ xml = xml || {};
+
+ if (xml.name) {
+ result = xml.name;
+ }
+
+ if (xml.prefix) {
+ result = xml.prefix + ':' + result;
+ }
+
+ return result;
+ };
+
+ var getNamespace = function (xml) {
+ var namespace = '';
+ var name = 'xmlns';
+
+ xml = xml || {};
+
+ if (xml.namespace) {
+ namespace = xml.namespace;
+ } else {
+ return namespace;
+ }
+
+ if (xml.prefix) {
+ name += ':' + xml.prefix;
+ }
+
+ return {
+ name: name,
+ value: namespace
+ };
+ };
+
+ var createArrayXML = function (descriptor) {
+ var name = descriptor.name;
+ var config = descriptor.config;
+ var definition = descriptor.definition;
+ var models = descriptor.models;
+ var value;
+ var items = definition.items;
+ var xml = definition.xml || {};
+
+ if (!items) { return getErrorMessage(); }
+
+ value = createSchemaXML(name, items, models, config);
+
+ xml = xml || {};
+
+ if (xml.wrapped) {
+ value = wrapTag(name, value);
+ }
+
+ return value;
+ };
+
+ var createPrimitiveXML = function (descriptor) {
+ var name = descriptor.name;
+ var definition = descriptor.definition;
+ var primitivesMap = {
+ 'string': {
+ 'date': new Date(1).toISOString().split('T')[0],
+ 'date-time' : new Date(1).toISOString(),
+ 'default': 'string'
+ },
+ 'integer': {
+ 'default': 1
+ },
+ 'number': {
+ 'default': 1.1
+ },
+ 'boolean': {
+ 'default': true
+ }
+ };
+ var type = definition.type;
+ var format = definition.format;
+ var xml = definition.xml || {};
+ var namespace = getNamespace(xml);
+ var attributes = [];
+ var value;
+
+ if (_.keys(primitivesMap).indexOf(type) < 0) { return getErrorMessage(); }
+
+ if (_.isArray(definition.enum)){
+ value = definition.enum[0];
+ } else {
+ value = definition.example || primitivesMap[type][format] || primitivesMap[type].default;
+ }
+
+ if (xml.attribute) {
+ return {name: name, value: value};
+ }
+
+ if (namespace) {
+ attributes.push(namespace);
+ }
+
+ return wrapTag(name, value, attributes);
+ };
+
+ function createObjectXML (descriptor) {
+ var name = descriptor.name;
+ var definition = descriptor.definition;
+ var config = descriptor.config;
+ var models = descriptor.models;
+ var isParam = descriptor.config.isParam;
+ var serializedProperties;
+ var attrs = [];
+ var properties = definition.properties;
+ var additionalProperties = definition.additionalProperties;
+ var xml = definition.xml;
+ var namespace = getNamespace(xml);
+
+ if (namespace) {
+ attrs.push(namespace);
+ }
+
+ if (!properties && !additionalProperties) { return getErrorMessage(); }
+
+ properties = properties || {};
+
+ serializedProperties = _.map(properties, function (prop, key) {
+ var xml, result;
+
+ if (isParam && prop.readOnly) {
+ return '';
+ }
+
+ xml = prop.xml || {};
+ result = createSchemaXML(key, prop, models, config);
+
+ if (xml.attribute) {
+ attrs.push(result);
+ return '';
+ }
+
+ return result;
+ }).join('');
+
+ if (additionalProperties) {
+ serializedProperties += '<!-- additional elements allowed -->';
+ }
+
+ return wrapTag(name, serializedProperties, attrs);
+ }
+
+ function getInfiniteLoopMessage (name) {
+ return '<!-- Infinite loop $ref:' + name + ' -->';
+ }
+
+ function getErrorMessage (details) {
+ details = details ? ': ' + details : '';
+ return '<!-- invalid XML' + details + ' -->';
+ }
+
+ function createSchemaXML (name, definition, models, config) {
+ var $ref = _.isObject(definition) ? definition.$ref : null;
+ var output, index;
+ config = config || {};
+ config.modelsToIgnore = config.modelsToIgnore || [];
+ var descriptor = _.isString($ref) ? getDescriptorByRef($ref, name, models, config)
+ : getDescriptor(name, definition, models, config);
+
+ if (!descriptor) {
+ return getErrorMessage();
+ }
+
+ switch (descriptor.type) {
+ case 'array':
+ output = createArrayXML(descriptor); break;
+ case 'object':
+ output = createObjectXML(descriptor); break;
+ case 'loop':
+ output = getInfiniteLoopMessage(descriptor.name); break;
+ default:
+ output = createPrimitiveXML(descriptor);
+ }
+
+ if ($ref) {
+ index = config.modelsToIgnore.indexOf($ref);
+ if (index > -1) {
+ config.modelsToIgnore.splice(index, 1);
+ }
+ }
+
+ return output;
+ }
+
+ function Descriptor (name, type, definition, models, config) {
+ if (arguments.length < 4) {
+ throw new Error();
+ }
+
+ this.config = config || {};
+ this.config.modelsToIgnore = this.config.modelsToIgnore || [];
+ this.name = getName(name, definition.xml);
+ this.definition = definition;
+ this.models = models;
+ this.type = type;
+ }
+
+ function getDescriptorByRef($ref, name, models, config) {
+ var modelType = simpleRef($ref);
+ var model = models[modelType] || {};
+ var type = model.type || 'object';
+ name = name || model.name;
+
+ if (config.modelsToIgnore.indexOf($ref) > -1) {
+ type = 'loop';
+ name = modelType;
+ } else {
+ config.modelsToIgnore.push($ref);
+ }
+
+ if (!model.definition) {
+ return null;
+ }
+
+ return new Descriptor(name, type, model.definition, models, config);
+ }
+
+ function getDescriptor (name, definition, models, config){
+ var type = definition.type || 'object';
+
+ if (!definition) {
+ return null;
+ }
+
+ return new Descriptor(name, type, definition, models, config);
+ }
+
+ function createXMLSample (definition, models, isParam) {
+ var prolog = '<?xml version="1.0"?>';
+
+ return formatXml(prolog + createSchemaXML('', definition, models, { isParam: isParam } ));
+ }
+
+ return {
+ getModelSignature: getModelSignature,
+ createJSONSample: createJSONSample,
+ getParameterModelSignature: getParameterModelSignature,
+ createParameterJSONSample: createParameterJSONSample,
+ createSchemaXML: createSchemaXML,
+ createXMLSample: createXMLSample
+ };
+
+})();
+
+'use strict';
+
+SwaggerUi.Views.ResourceView = Backbone.View.extend({
+ initialize: function(opts) {
+ opts = opts || {};
+ this.router = opts.router;
+ this.auths = opts.auths;
+ if ('' === this.model.description) {
+ this.model.description = null;
+ }
+ if (this.model.description) {
+ this.model.summary = this.model.description;
+ }
+ },
+
+ render: function(){
+ var methods = {};
+
+
+ $(this.el).html(Handlebars.templates.resource(this.model));
+
+ // Render each operation
+ for (var i = 0; i < this.model.operationsArray.length; i++) {
+ var operation = this.model.operationsArray[i];
+ var counter = 0;
+ var id = operation.nickname;
+
+ while (typeof methods[id] !== 'undefined') {
+ id = id + '_' + counter;
+ counter += 1;
+ }
+
+ methods[id] = operation;
+
+ operation.nickname = id;
+ operation.parentId = this.model.id;
+ operation.definitions = this.model.definitions; // make Json Schema available for JSonEditor in this operation
+ this.addOperation(operation);
+ }
+
+ $('.toggleEndpointList', this.el).click(this.callDocs.bind(this, 'toggleEndpointListForResource'));
+ $('.collapseResource', this.el).click(this.callDocs.bind(this, 'collapseOperationsForResource'));
+ $('.expandResource', this.el).click(this.callDocs.bind(this, 'expandOperationsForResource'));
+
+ return this;
+ },
+
+ addOperation: function(operation) {
+
+ operation.number = this.number;
+
+ // Render an operation and add it to operations li
+ var operationView = new SwaggerUi.Views.OperationView({
+ model: operation,
+ router: this.router,
+ tagName: 'li',
+ className: 'endpoint',
+ swaggerOptions: this.options.swaggerOptions,
+ auths: this.auths
+ });
+
+ $('.endpoints', $(this.el)).append(operationView.render().el);
+
+ this.number++;
+
+ },
+ // Generic Event handler (`Docs` is global)
+
+
+ callDocs: function(fnName, e) {
+ e.preventDefault();
+ Docs[fnName](e.currentTarget.getAttribute('data-id'));
+ }
+});
+'use strict';
+
+SwaggerUi.Views.ResponseContentTypeView = Backbone.View.extend({
+ initialize: function(){},
+
+ render: function(){
+ this.model.responseContentTypeId = 'rct' + Math.random();
+ $(this.el).html(Handlebars.templates.response_content_type(this.model));
+ return this;
+ }
+});
+'use strict';
+
+SwaggerUi.Views.SignatureView = Backbone.View.extend({
+ events: {
+ 'click a.description-link' : 'switchToDescription',
+ 'click a.snippet-link' : 'switchToSnippet',
+ 'mousedown .snippet_json' : 'jsonSnippetMouseDown',
+ 'mousedown .snippet_xml' : 'xmlSnippetMouseDown'
+ },
+
+ initialize: function () {
+ },
+
+ render: function(){
+
+ $(this.el).html(Handlebars.templates.signature(this.model));
+
+ if (this.model.defaultRendering === 'model') {
+ this.switchToDescription();
+ } else {
+ this.switchToSnippet();
+ }
+
+ return this;
+ },
+
+ // handler for show signature
+ switchToDescription: function(e){
+ if (e) { e.preventDefault(); }
+
+ $('.snippet', $(this.el)).hide();
+ $('.description', $(this.el)).show();
+ $('.description-link', $(this.el)).addClass('selected');
+ $('.snippet-link', $(this.el)).removeClass('selected');
+ },
+
+ // handler for show sample
+ switchToSnippet: function(e){
+ if (e) { e.preventDefault(); }
+
+ $('.snippet', $(this.el)).show();
+ $('.description', $(this.el)).hide();
+ $('.snippet-link', $(this.el)).addClass('selected');
+ $('.description-link', $(this.el)).removeClass('selected');
+ },
+
+ // handler for snippet to text area
+ snippetToTextArea: function(val) {
+ var textArea = $('textarea', $(this.el.parentNode.parentNode.parentNode));
+
+ // Fix for bug in IE 10/11 which causes placeholder text to be copied to "value"
+ if ($.trim(textArea.val()) === '' || textArea.prop('placeholder') === textArea.val()) {
+ textArea.val(val);
+ // TODO move this code outside of the view and expose an event instead
+ if( this.model.jsonEditor && this.model.jsonEditor.isEnabled()){
+ this.model.jsonEditor.setValue(JSON.parse(this.model.sampleJSON));
+ }
+ }
+ },
+
+ jsonSnippetMouseDown: function (e) {
+ if (this.model.isParam) {
+ if (e) { e.preventDefault(); }
+
+ this.snippetToTextArea(this.model.sampleJSON);
+ }
+ },
+
+ xmlSnippetMouseDown: function (e) {
+ if (this.model.isParam) {
+ if (e) { e.preventDefault(); }
+
+ this.snippetToTextArea(this.model.sampleXML);
+ }
+ }
+});
+'use strict';
+
+SwaggerUi.Views.StatusCodeView = Backbone.View.extend({
+ initialize: function (opts) {
+ this.options = opts || {};
+ this.router = this.options.router;
+ },
+
+ render: function(){
+ var value = this.router.api.models[this.model.responseModel];
+ $(this.el).html(Handlebars.templates.status_code(this.model));
+
+ if (this.router.api.models.hasOwnProperty(this.model.responseModel)) {
+ var responseModel = {
+ sampleJSON: JSON.stringify(SwaggerUi.partials.signature.createJSONSample(value), void 0, 2),
+ sampleXML: this.model.isXML ? SwaggerUi.partials.signature.createXMLSample(this.model.schema, value.models) : false,
+ isParam: false,
+ signature: SwaggerUi.partials.signature.getModelSignature(this.model.responseModel, value, this.router.api.models),
+ defaultRendering: this.model.defaultRendering
+ };
+
+ var responseModelView = new SwaggerUi.Views.SignatureView({model: responseModel, tagName: 'div'});
+ $('.model-signature', this.$el).append(responseModelView.render().el);
+ } else {
+ $('.model-signature', this.$el).html('');
+ }
+ return this;
+ }
+});}).call(this); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/swagger-ui.min.js b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/swagger-ui.min.js
new file mode 100644
index 0000000..08b9fd6
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/main/resources/static/swagger-ui.min.js
@@ -0,0 +1,11 @@
+(function(){function e(){e.history=e.history||[],e.history.push(arguments),this.console&&console.log(Array.prototype.slice.call(arguments)[0])}this.Handlebars=this.Handlebars||{},this.Handlebars.templates=this.Handlebars.templates||{},this.Handlebars.templates.apikey_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'><label for='input_apiKey_entry'>"+s((i=null!=(i=t.keyName||(null!=e?e.keyName:e))?i:o,typeof i===a?i.call(e,{name:"keyName",hash:{},data:r}):i))+"</label></div>\n <input placeholder='api_key' class='auth_input' id='input_apiKey_entry' name='apiKey' type='text'/>\n <div class='auth_submit'><a class='auth_submit_button' id='apply_api_key' href='#' data-sw-translate>apply</a></div>\n </div>\n</div>\n"},useData:!0}),this.Handlebars.templates.basic_auth_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){return'<div class=\'auth_button\' id=\'basic_auth_button\'><img class=\'auth_icon\' src=\'images/password.jpeg\'></div>\n<div class=\'auth_container\' id=\'basic_auth_container\'>\n <div class=\'key_input_container\'>\n <div class="auth_label"><label for="input_username" data-sw-translate>Username</label></div>\n <input placeholder="username" class="auth_input" id="input_username" name="username" type="text"/>\n <div class="auth_label"><label for="password" data-sw-translate>Password</label></div>\n <input placeholder="password" class="auth_input" id="input_password" name="password" type="password"/>\n <div class=\'auth_submit\'><a class=\'auth_submit_button\' id="apply_basic_auth" href="#">apply</a></div>\n </div>\n</div>\n\n'},useData:!0}),this.Handlebars.templates.content_type=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i=this.lambda,a=this.escapeExpression;return' <option value="'+a(i(e,e))+'">'+a(i(e,e))+"</option>\n"},4:function(e,t,n,r){return' <option value="application/json">application/json</option>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l='<label data-sw-translate for="'+u((a=null!=(a=t.contentTypeId||(null!=e?e.contentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"contentTypeId",hash:{},data:r}):a))+'">Response Content Type</label>\n<select name="contentType" id="'+u((a=null!=(a=t.contentTypeId||(null!=e?e.contentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"contentTypeId",hash:{},data:r}):a))+'">\n';return i=t["if"].call(e,null!=e?e.produces:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(4,r),data:r}),null!=i&&(l+=i),l+"</select>\n"},useData:!0}),$(function(){$.fn.vAlign=function(){return this.each(function(){var e=$(this).height(),t=$(this).parent().height(),n=(t-e)/2;$(this).css("margin-top",n)})},$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(){var e=$(this).closest("form").innerWidth(),t=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10),n=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",e-t-n)})},$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent(),$("ul.downplayed li div.content p").vAlign(),$("form.sandbox").submit(function(){var e=!0;return $(this).find("input.required").each(function(){$(this).removeClass("error"),""===$(this).val()&&($(this).addClass("error"),$(this).wiggle(),e=!1)}),e})}),Function.prototype.bind&&console&&"object"==typeof console.log&&["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(e){console[e]=this.bind(console[e],console)},Function.prototype.call),window.Docs={shebang:function(){var e=$.param.fragment().split("/");switch(e.shift(),e.length){case 1:if(e[0].length>0){var t="resource_"+e[0];Docs.expandEndpointListForResource(e[0]),$("#"+t).slideto({highlight:!1})}break;case 2:Docs.expandEndpointListForResource(e[0]),$("#"+t).slideto({highlight:!1});var n=e.join("_"),r=n+"_content";Docs.expandOperation($("#"+r)),$("#"+n).slideto({highlight:!1})}},toggleEndpointListForResource:function(e){var t=$("li#resource_"+Docs.escapeResourceName(e)+" ul.endpoints");t.is(":visible")?($.bbq.pushState("#/",2),Docs.collapseEndpointListForResource(e)):($.bbq.pushState("#/"+e,2),Docs.expandEndpointListForResource(e))},expandEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideDown();$("li#resource_"+e).addClass("active");var t=$("li#resource_"+e+" ul.endpoints");t.slideDown()},collapseEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideUp();$("li#resource_"+e).removeClass("active");var t=$("li#resource_"+e+" ul.endpoints");t.slideUp()},expandOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideDown():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideUp():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(e){return e.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(e){e.slideDown()},collapseOperation:function(e){e.slideUp()}},Handlebars.registerHelper("sanitize",function(e){return e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),new Handlebars.SafeString(e)}),Handlebars.registerHelper("renderTextParam",function(e){var t,n="text",r="",i=e.type||e.schema.type||"",a="array"===i.toLowerCase()||e.allowMultiple,o=a&&Array.isArray(e["default"])?e["default"].join("\n"):e["default"],s=Object.keys(e).filter(function(e){return null!==e.match(/^X-data-/i)}).reduce(function(t,n){return t+=" "+n.substring(2,n.length)+"='"+e[n]+"'"},"");if("undefined"==typeof o&&(o=""),e.format&&"password"===e.format&&(n="password"),e.valueId&&(r=" id='"+e.valueId+"'"),("string"==typeof o||o instanceof String)&&(o=o.replace(/'/g,"&apos;")),a)t="<textarea class='body-textarea"+(e.required?" required":"")+"' name='"+e.name+"'"+r+s,t+=" placeholder='Provide multiple values in new lines"+(e.required?" (at least one required).":".")+"'>",t+=o+"</textarea>";else{var u="parameter";e.required&&(u+=" required"),t="<input class='"+u+"' minlength='"+(e.required?1:0)+"'",t+=" name='"+e.name+"' placeholder='"+(e.required?"(required)":"")+"'"+r+s,t+=" type='"+n+"' value='"+o+"'/>"}return new Handlebars.SafeString(t)}),this.Handlebars.templates.main=Handlebars.template({1:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression,s=' <div class="info_title">'+o(a(null!=(i=null!=e?e.info:e)?i.title:i,e))+'</div>\n <div class="info_description markdown">';return i=a(null!=(i=null!=e?e.info:e)?i.description:i,e),null!=i&&(s+=i),s+="</div>\n",i=t["if"].call(e,null!=e?e.externalDocs:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+=" ",i=t["if"].call(e,null!=(i=null!=e?e.info:e)?i.termsOfServiceUrl:i,{name:"if",hash:{},fn:this.program(4,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="\n ",i=t["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.name:i,{name:"if",hash:{},fn:this.program(6,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="\n ",i=t["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.url:i,{name:"if",hash:{},fn:this.program(8,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="\n ",i=t["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.email:i,{name:"if",hash:{},fn:this.program(10,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="\n ",i=t["if"].call(e,null!=(i=null!=e?e.info:e)?i.license:i,{name:"if",hash:{},fn:this.program(12,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+"\n"},2:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return" <p>"+o(a(null!=(i=null!=e?e.externalDocs:e)?i.description:i,e))+'</p>\n <a href="'+o(a(null!=(i=null!=e?e.externalDocs:e)?i.url:i,e))+'" target="_blank">'+o(a(null!=(i=null!=e?e.externalDocs:e)?i.url:i,e))+"</a>\n"},4:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return'<div class="info_tos"><a href="'+o(a(null!=(i=null!=e?e.info:e)?i.termsOfServiceUrl:i,e))+'" data-sw-translate>Terms of service</a></div>'},6:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return"<div class='info_name' data-sw-translate>Created by "+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.name:i,e))+"</div>"},8:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return"<div class='info_url' data-sw-translate>See more at <a href=\""+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.url:i,e))+'">'+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.url:i,e))+"</a></div>"},10:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return'<div class=\'info_email\'><a target="_parent" href="mailto:'+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.email:i,e))+"?subject="+o(a(null!=(i=null!=e?e.info:e)?i.title:i,e))+'" data-sw-translate>Contact the developer</a></div>'},12:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return"<div class='info_license'><a href='"+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.license:i)?i.url:i,e))+"'>"+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.license:i)?i.name:i,e))+"</a></div>"},14:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return' , <span style="font-variant: small-caps" data-sw-translate>api version</span>: '+o(a(null!=(i=null!=e?e.info:e)?i.version:i,e))+"\n "},16:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return' <span style="float:right"><a href="'+s((i=null!=(i=t.validatorUrl||(null!=e?e.validatorUrl:e))?i:o,typeof i===a?i.call(e,{name:"validatorUrl",hash:{},data:r}):i))+"/debug?url="+s((i=null!=(i=t.url||(null!=e?e.url:e))?i:o,typeof i===a?i.call(e,{name:"url",hash:{},data:r}):i))+'"><img id="validator" src="'+s((i=null!=(i=t.validatorUrl||(null!=e?e.validatorUrl:e))?i:o,typeof i===a?i.call(e,{name:"validatorUrl",hash:{},data:r}):i))+"?url="+s((i=null!=(i=t.url||(null!=e?e.url:e))?i:o,typeof i===a?i.call(e,{name:"url",hash:{},data:r}):i))+'"></a>\n </span>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l="<div class='info' id='api_info'>\n";return i=t["if"].call(e,null!=e?e.info:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+="</div>\n<div class='container' id='resources_container'>\n <ul id='resources'></ul>\n\n <div class=\"footer\">\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: "+u((a=null!=(a=t.basePath||(null!=e?e.basePath:e))?a:s,typeof a===o?a.call(e,{name:"basePath",hash:{},data:r}):a))+"\n",i=t["if"].call(e,null!=(i=null!=e?e.info:e)?i.version:i,{name:"if",hash:{},fn:this.program(14,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+="]\n",i=t["if"].call(e,null!=e?e.validatorUrl:e,{name:"if",hash:{},fn:this.program(16,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+" </h4>\n </div>\n</div>\n"},useData:!0}),this.Handlebars.templates.operation=Handlebars.template({1:function(e,t,n,r){return"deprecated"},3:function(e,t,n,r){return" <h4><span data-sw-translate>Warning: Deprecated</span></h4>\n"},5:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=' <h4><span data-sw-translate>Implementation Notes</span></h4>\n <div class="markdown">';return a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(u+=i),u+"</div>\n"},7:function(e,t,n,r){return' <div class="auth">\n <span class="api-ic ic-error">'},9:function(e,t,n,r){var i,a=' <div class="api_information_panel">\n';return i=t.each.call(e,e,{name:"each",hash:{},fn:this.program(10,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a+" </div>\n"},10:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression,s=" <div title='";return i=a(null!=e?e.description:e,e),null!=i&&(s+=i),s+"'>"+o(a(null!=e?e.scope:e,e))+"</div>\n"},12:function(e,t,n,r){return"</span></div>"},14:function(e,t,n,r){return' <div class=\'access\'>\n <span class="api-ic ic-off" title="click to authenticate"></span>\n </div>\n'},16:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l=' <div class="response-class">\n <h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> '+u((a=null!=(a=t.successCode||(null!=e?e.successCode:e))?a:s,typeof a===o?a.call(e,{name:"successCode",hash:{},data:r}):a))+")</h4>\n ";return i=t["if"].call(e,null!=e?e.successDescription:e,{name:"if",hash:{},fn:this.program(17,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+'\n <p><span class="model-signature" /></p>\n <br/>\n <div class="response-content-type" />\n </div>\n'},17:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u='<div class="markdown">';return a=null!=(a=t.successDescription||(null!=e?e.successDescription:e))?a:s,i=typeof a===o?a.call(e,{name:"successDescription",hash:{},data:r}):a,null!=i&&(u+=i),u+"</div>"},19:function(e,t,n,r){var i,a=' <h4 data-sw-translate>Headers</h4>\n <table class="headers">\n <thead>\n <tr>\n <th style="width: 100px; max-width: 100px" data-sw-translate>Header</th>\n <th style="width: 310px; max-width: 310px" data-sw-translate>Description</th>\n <th style="width: 200px; max-width: 200px" data-sw-translate>Type</th>\n <th style="width: 320px; max-width: 320px" data-sw-translate>Other</th>\n </tr>\n </thead>\n <tbody>\n';return i=t.each.call(e,null!=e?e.headers:e,{name:"each",hash:{},fn:this.program(20,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a+" </tbody>\n </table>\n"},20:function(e,t,n,r){var i=this.lambda,a=this.escapeExpression;return" <tr>\n <td>"+a(i(r&&r.key,e))+"</td>\n <td>"+a(i(null!=e?e.description:e,e))+"</td>\n <td>"+a(i(null!=e?e.type:e,e))+"</td>\n <td>"+a(i(null!=e?e.other:e,e))+"</td>\n </tr>\n"},22:function(e,t,n,r){return' <h4 data-sw-translate>Parameters</h4>\n <table class=\'fullwidth\'>\n <thead>\n <tr>\n <th style="width: 100px; max-width: 100px" data-sw-translate>Parameter</th>\n <th style="width: 310px; max-width: 310px" data-sw-translate>Value</th>\n <th style="width: 200px; max-width: 200px" data-sw-translate>Description</th>\n <th style="width: 100px; max-width: 100px" data-sw-translate>Parameter Type</th>\n <th style="width: 220px; max-width: 230px" data-sw-translate>Data Type</th>\n </tr>\n </thead>\n <tbody class="operation-params">\n\n </tbody>\n </table>\n'},24:function(e,t,n,r){return" <div style='margin:0;padding:0;display:inline'></div>\n <h4 data-sw-translate>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th data-sw-translate>HTTP Status Code</th>\n <th data-sw-translate>Reason</th>\n <th data-sw-translate>Response Model</th>\n <th data-sw-translate>Headers</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n </tbody>\n </table>\n"},26:function(e,t,n,r){return""},28:function(e,t,n,r){return" <div class='sandbox_header'>\n <input class='submit' type='submit' value='Try it out!' data-sw-translate/>\n <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n"},30:function(e,t,n,r){return" <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o,s="function",u=t.helperMissing,l=this.escapeExpression,c=t.blockHelperMissing,p=" <ul class='operations' >\n <li class='"+l((a=null!=(a=t.method||(null!=e?e.method:e))?a:u,typeof a===s?a.call(e,{name:"method",hash:{},data:r}):a))+" operation' id='"+l((a=null!=(a=t.parentId||(null!=e?e.parentId:e))?a:u,typeof a===s?a.call(e,{name:"parentId",hash:{},data:r}):a))+"_"+l((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:u,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+"'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/"+l((a=null!=(a=t.encodedParentId||(null!=e?e.encodedParentId:e))?a:u,typeof a===s?a.call(e,{name:"encodedParentId",hash:{},data:r}):a))+"/"+l((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:u,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+'\' class="toggleOperation">'+l((a=null!=(a=t.method||(null!=e?e.method:e))?a:u,typeof a===s?a.call(e,{name:"method",hash:{},data:r}):a))+"</a>\n </span>\n <span class='path'>\n <a href='#!/"+l((a=null!=(a=t.encodedParentId||(null!=e?e.encodedParentId:e))?a:u,typeof a===s?a.call(e,{name:"encodedParentId",hash:{},data:r}):a))+"/"+l((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:u,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+"' class=\"toggleOperation ";return i=t["if"].call(e,null!=e?e.deprecated:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+='">'+l((a=null!=(a=t.path||(null!=e?e.path:e))?a:u,typeof a===s?a.call(e,{name:"path",hash:{},data:r}):a))+"</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/"+l((a=null!=(a=t.encodedParentId||(null!=e?e.encodedParentId:e))?a:u,typeof a===s?a.call(e,{name:"encodedParentId",hash:{},data:r}):a))+"/"+l((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:u,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+'\' class="toggleOperation">',a=null!=(a=t.summary||(null!=e?e.summary:e))?a:u,i=typeof a===s?a.call(e,{name:"summary",hash:{},data:r}):a,null!=i&&(p+=i),p+="</a>\n </li>\n </ul>\n </div>\n <div class='content' id='"+l((a=null!=(a=t.parentId||(null!=e?e.parentId:e))?a:u,typeof a===s?a.call(e,{name:"parentId",hash:{},data:r}):a))+"_"+l((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:u,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+"_content' style='display:none'>\n",i=t["if"].call(e,null!=e?e.deprecated:e,{name:"if",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),null!=i&&(p+=i),i=t["if"].call(e,null!=e?e.description:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),null!=i&&(p+=i),a=null!=(a=t.oauth||(null!=e?e.oauth:e))?a:u,o={name:"oauth",hash:{},fn:this.program(7,r),inverse:this.noop,data:r},i=typeof a===s?a.call(e,o):a,t.oauth||(i=c.call(e,i,o)),null!=i&&(p+=i),p+="\n",i=t.each.call(e,null!=e?e.oauth:e,{name:"each",hash:{},fn:this.program(9,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+=" ",a=null!=(a=t.oauth||(null!=e?e.oauth:e))?a:u,o={name:"oauth",hash:{},fn:this.program(12,r),inverse:this.noop,data:r},i=typeof a===s?a.call(e,o):a,t.oauth||(i=c.call(e,i,o)),null!=i&&(p+=i),p+="\n",a=null!=(a=t.oauth||(null!=e?e.oauth:e))?a:u,o={name:"oauth",hash:{},fn:this.program(14,r),inverse:this.noop,data:r},i=typeof a===s?a.call(e,o):a,t.oauth||(i=c.call(e,i,o)),null!=i&&(p+=i),i=t["if"].call(e,null!=e?e.type:e,{name:"if",hash:{},fn:this.program(16,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+="\n",i=t["if"].call(e,null!=e?e.headers:e,{name:"if",hash:{},fn:this.program(19,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+="\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n",i=t["if"].call(e,null!=e?e.parameters:e,{name:"if",hash:{},fn:this.program(22,r),inverse:this.noop,data:r}),null!=i&&(p+=i),i=t["if"].call(e,null!=e?e.responseMessages:e,{name:"if",hash:{},fn:this.program(24,r),inverse:this.noop,data:r}),null!=i&&(p+=i),i=t["if"].call(e,null!=e?e.isReadOnly:e,{name:"if",hash:{},fn:this.program(26,r),inverse:this.program(28,r),data:r}),null!=i&&(p+=i),p+=" </form>\n <div class='response' style='display:none'>\n <h4 class='curl'>Curl</h4>\n <div class='block curl'></div>\n <h4 data-sw-translate>Request URL</h4>\n <div class='block request_url'></div>\n",i=t["if"].call(e,null!=e?e.showRequestHeaders:e,{name:"if",hash:{},fn:this.program(30,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+" <h4 data-sw-translate>Response Body</h4>\n <div class='block response_body'></div>\n <h4 data-sw-translate>Response Code</h4>\n <div class='block response_code'></div>\n <h4 data-sw-translate>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n"},useData:!0}),this.Handlebars.templates.param_list=Handlebars.template({1:function(e,t,n,r){return" required"},3:function(e,t,n,r){return' multiple="multiple"'},5:function(e,t,n,r){return" required "},7:function(e,t,n,r){var i,a=" <option ";return i=t.unless.call(e,null!=e?e.hasDefault:e,{name:"unless",hash:{},fn:this.program(8,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a+" value=''></option>\n"},8:function(e,t,n,r){return' selected="" '},10:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l="\n <option ";return i=t["if"].call(e,null!=e?e.isDefault:e,{name:"if",hash:{},fn:this.program(11,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+=" value='"+u((a=null!=(a=t.value||(null!=e?e.value:e))?a:s,typeof a===o?a.call(e,{name:"value",hash:{},data:r}):a))+"'> "+u((a=null!=(a=t.value||(null!=e?e.value:e))?a:s,typeof a===o?a.call(e,{name:"value",hash:{},data:r}):a))+" ",i=t["if"].call(e,null!=e?e.isDefault:e,{name:"if",hash:{},fn:this.program(13,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+" </option>\n\n"},11:function(e,t,n,r){return' selected="" '},13:function(e,t,n,r){return" (default) "},15:function(e,t,n,r){return"<strong>"},17:function(e,t,n,r){return"</strong>"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l="<td class='code";return i=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+="'><label for='"+u((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+u((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n <select ",i=(t.isArray||e&&e.isArray||s).call(e,e,{name:"isArray",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+=' class="parameter ',i=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+='" name="'+u((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+'" id="'+u((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+'">\n\n',i=t.unless.call(e,null!=e?e.required:e,{name:"unless",hash:{},fn:this.program(7,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+="\n",i=t.each.call(e,null!=(i=null!=e?e.allowableValues:e)?i.descriptiveValues:i,{name:"each",hash:{},fn:this.program(10,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+='\n </select>\n</td>\n<td class="markdown">',i=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(15,r),inverse:this.noop,data:r}),null!=i&&(l+=i),a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(l+=i),i=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(17,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+="</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(l+=i),l+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param_readonly_required=Handlebars.template({1:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'>"+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+"</textarea>\n"},3:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,r),inverse:this.program(6,r),data:r}),null!=i&&(a+=i),a},4:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" "+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+"\n"},6:function(e,t,n,r){return" (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l="<td class='code required'><label for='"+u((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+u((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n";return i=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(3,r),data:r}),null!=i&&(l+=i),l+='</td>\n<td class="markdown">',a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(l+=i),l+="</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(l+=i),l+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param_readonly=Handlebars.template({1:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <textarea class='body-textarea' readonly='readonly' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'>"+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+'</textarea>\n <div class="parameter-content-type" />\n'},3:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,r),inverse:this.program(6,r),data:r}),null!=i&&(a+=i),a},4:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" "+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+"\n"},6:function(e,t,n,r){return" (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l="<td class='code'><label for='"+u((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+u((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n";return i=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(3,r),data:r}),null!=i&&(l+=i),l+='</td>\n<td class="markdown">',a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(l+=i),l+="</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(l+=i),l+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param_required=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.program(4,r),data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return' <input type="file" name=\''+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'/>\n"},4:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.program(7,r),data:r}),null!=i&&(a+=i),a},5:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <div class=\"editor_holder\"></div>\n <textarea class='body-textarea required' placeholder='(required)' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id=\""+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+'">'+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+'</textarea>\n <br />\n <div class="parameter-content-type" />\n'},7:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <textarea class='body-textarea required' placeholder='(required)' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+'\'></textarea>\n <div class="editor_holder"></div>\n <br />\n <div class="parameter-content-type" />\n'},9:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(10,r),inverse:this.program(12,r),data:r}),null!=i&&(a+=i),a},10:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <input class='parameter' class='required' type='file' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'/>\n"},12:function(e,t,n,r){var i,a=t.helperMissing,o="";return i=(t.renderTextParam||e&&e.renderTextParam||a).call(e,e,{name:"renderTextParam",hash:{},fn:this.program(13,r),inverse:this.noop,data:r}),null!=i&&(o+=i),o},13:function(e,t,n,r){return""},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l="<td class='code required'><label for='"+u((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,
+typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+u((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n";return i=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(9,r),data:r}),null!=i&&(l+=i),l+='</td>\n<td>\n <strong><span class="markdown">',a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(l+=i),l+="</span></strong>\n</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(l+=i),l+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.program(4,r),data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return' <input type="file" name=\''+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+'\'/>\n <div class="parameter-content-type" />\n'},4:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.program(7,r),data:r}),null!=i&&(a+=i),a},5:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <div class=\"editor_holder\"></div>\n <textarea class='body-textarea' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'>"+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+'</textarea>\n <br />\n <div class="parameter-content-type" />\n'},7:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <textarea class='body-textarea' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+'\'></textarea>\n <div class="editor_holder"></div>\n <br />\n <div class="parameter-content-type" />\n'},9:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.program(10,r),data:r}),null!=i&&(a+=i),a},10:function(e,t,n,r){var i,a=t.helperMissing,o="";return i=(t.renderTextParam||e&&e.renderTextParam||a).call(e,e,{name:"renderTextParam",hash:{},fn:this.program(11,r),inverse:this.noop,data:r}),null!=i&&(o+=i),o},11:function(e,t,n,r){return""},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l="<td class='code'><label for='"+u((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+u((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n\n";return i=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(9,r),data:r}),null!=i&&(l+=i),l+='\n</td>\n<td class="markdown">',a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(l+=i),l+="</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(l+=i),l+'</td>\n<td>\n <span class="model-signature"></span>\n</td>\n'},useData:!0}),this.Handlebars.templates.parameter_content_type=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t.each.call(e,null!=e?e.consumes:e,{name:"each",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i=this.lambda,a=this.escapeExpression;return' <option value="'+a(i(e,e))+'">'+a(i(e,e))+"</option>\n"},4:function(e,t,n,r){return' <option value="application/json">application/json</option>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l='<label for="'+u((a=null!=(a=t.parameterContentTypeId||(null!=e?e.parameterContentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"parameterContentTypeId",hash:{},data:r}):a))+'" data-sw-translate>Parameter content type:</label>\n<select name="parameterContentType" id="'+u((a=null!=(a=t.parameterContentTypeId||(null!=e?e.parameterContentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"parameterContentTypeId",hash:{},data:r}):a))+'">\n';return i=t["if"].call(e,null!=e?e.consumes:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(4,r),data:r}),null!=i&&(l+=i),l+"</select>\n"},useData:!0}),this.Handlebars.templates.resource=Handlebars.template({1:function(e,t,n,r){return" : "},3:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <li>\n <a href='"+s((i=null!=(i=t.url||(null!=e?e.url:e))?i:o,typeof i===a?i.call(e,{name:"url",hash:{},data:r}):i))+"' data-sw-translate>Raw</a>\n </li>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o,s="function",u=t.helperMissing,l=this.escapeExpression,c=t.blockHelperMissing,p="<div class='heading'>\n <h2>\n <a href='#!/"+l((a=null!=(a=t.id||(null!=e?e.id:e))?a:u,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'\' class="toggleEndpointList" data-id="'+l((a=null!=(a=t.id||(null!=e?e.id:e))?a:u,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'">'+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:u,typeof a===s?a.call(e,{name:"name",hash:{},data:r}):a))+"</a> ";return a=null!=(a=t.summary||(null!=e?e.summary:e))?a:u,o={name:"summary",hash:{},fn:this.program(1,r),inverse:this.noop,data:r},i=typeof a===s?a.call(e,o):a,t.summary||(i=c.call(e,i,o)),null!=i&&(p+=i),a=null!=(a=t.summary||(null!=e?e.summary:e))?a:u,i=typeof a===s?a.call(e,{name:"summary",hash:{},data:r}):a,null!=i&&(p+=i),p+="\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/"+l((a=null!=(a=t.id||(null!=e?e.id:e))?a:u,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+"' id='endpointListTogger_"+l((a=null!=(a=t.id||(null!=e?e.id:e))?a:u,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'\' class="toggleEndpointList" data-id="'+l((a=null!=(a=t.id||(null!=e?e.id:e))?a:u,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'" data-sw-translate>Show/Hide</a>\n </li>\n <li>\n <a href=\'#\' class="collapseResource" data-id="'+l((a=null!=(a=t.id||(null!=e?e.id:e))?a:u,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'" data-sw-translate>\n List Operations\n </a>\n </li>\n <li>\n <a href=\'#\' class="expandResource" data-id="'+l((a=null!=(a=t.id||(null!=e?e.id:e))?a:u,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'" data-sw-translate>\n Expand Operations\n </a>\n </li>\n',i=t["if"].call(e,null!=e?e.url:e,{name:"if",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+" </ul>\n</div>\n<ul class='endpoints' id='"+l((a=null!=(a=t.id||(null!=e?e.id:e))?a:u,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+"_endpoint_list' style='display:none'>\n\n</ul>\n"},useData:!0}),this.Handlebars.templates.response_content_type=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i=this.lambda,a=this.escapeExpression;return' <option value="'+a(i(e,e))+'">'+a(i(e,e))+"</option>\n"},4:function(e,t,n,r){return' <option value="application/json">application/json</option>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l='<label data-sw-translate for="'+u((a=null!=(a=t.responseContentTypeId||(null!=e?e.responseContentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"responseContentTypeId",hash:{},data:r}):a))+'">Response Content Type</label>\n<select name="responseContentType" id="'+u((a=null!=(a=t.responseContentTypeId||(null!=e?e.responseContentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"responseContentTypeId",hash:{},data:r}):a))+'">\n';return i=t["if"].call(e,null!=e?e.produces:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(4,r),data:r}),null!=i&&(l+=i),l+"</select>\n"},useData:!0}),this.Handlebars.templates.signature=Handlebars.template({1:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l=' <div class="snippet_json">\n <pre><code>'+u((a=null!=(a=t.sampleJSON||(null!=e?e.sampleJSON:e))?a:s,typeof a===o?a.call(e,{name:"sampleJSON",hash:{},data:r}):a))+"</code></pre>\n ";return i=t["if"].call(e,null!=e?e.isParam:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+"\n </div>\n"},2:function(e,t,n,r){return'<small class="notice" data-sw-translate></small>'},4:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l=' <div class="snippet_xml">\n <pre><code>'+u((a=null!=(a=t.sampleXML||(null!=e?e.sampleXML:e))?a:s,typeof a===o?a.call(e,{name:"sampleXML",hash:{},data:r}):a))+"</code></pre>\n ";return i=t["if"].call(e,null!=e?e.isParam:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+"\n </div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u='<div>\n<ul class="signature-nav">\n <li><a class="description-link" href="#" data-sw-translate>Model</a></li>\n <li><a class="snippet-link" href="#" data-sw-translate>Example Value</a></li>\n</ul>\n<div>\n\n<div class="signature-container">\n <div class="description">\n ';return a=null!=(a=t.signature||(null!=e?e.signature:e))?a:s,i=typeof a===o?a.call(e,{name:"signature",hash:{},data:r}):a,null!=i&&(u+=i),u+='\n </div>\n\n <div class="snippet">\n',i=t["if"].call(e,null!=e?e.sampleJSON:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(u+=i),i=t["if"].call(e,null!=e?e.sampleXML:e,{name:"if",hash:{},fn:this.program(4,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+" </div>\n</div>\n"},useData:!0}),this.Handlebars.templates.status_code=Handlebars.template({1:function(e,t,n,r){var i=this.lambda,a=this.escapeExpression;return" <tr>\n <td>"+a(i(r&&r.key,e))+"</td>\n <td>"+a(i(null!=e?e.description:e,e))+"</td>\n <td>"+a(i(null!=e?e.type:e,e))+"</td>\n </tr>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,u=this.escapeExpression,l="<td width='15%' class='code'>"+u((a=null!=(a=t.code||(null!=e?e.code:e))?a:s,typeof a===o?a.call(e,{name:"code",hash:{},data:r}):a))+'</td>\n<td class="markdown">';return a=null!=(a=t.message||(null!=e?e.message:e))?a:s,i=typeof a===o?a.call(e,{name:"message",hash:{},data:r}):a,null!=i&&(l+=i),l+='</td>\n<td width=\'50%\'><span class="model-signature" /></td>\n<td class="headers">\n <table>\n <tbody>\n',i=t.each.call(e,null!=e?e.headers:e,{name:"each",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(l+=i),l+" </tbody>\n </table>\n</td>"},useData:!0}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.SwaggerClient=e()}}(function(){var t;return function n(e,t,r){function i(o,s){if(!t[o]){if(!e[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=t[o]={exports:{}};e[o][0].call(c.exports,function(t){var n=e[o][1][t];return i(n?n:t)},c,c.exports,n,e,t,r)}return t[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";var r=e("./lib/auth"),i=e("./lib/helpers"),a=e("./lib/client"),o=function(e,t){return i.log('This is deprecated, use "new SwaggerClient" instead.'),new a(e,t)};Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){for(var n=t||0,r=this.length;r>n;n++)if(this[n]===e)return n;return-1}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),String.prototype.endsWith||(String.prototype.endsWith=function(e){return-1!==this.indexOf(e,this.length-e.length)}),t.exports=a,a.ApiKeyAuthorization=r.ApiKeyAuthorization,a.PasswordAuthorization=r.PasswordAuthorization,a.CookieAuthorization=r.CookieAuthorization,a.SwaggerApi=o,a.SwaggerClient=o,a.SchemaMarkup=e("./lib/schema-markup")},{"./lib/auth":2,"./lib/client":3,"./lib/helpers":4,"./lib/schema-markup":7}],2:[function(e,t,n){"use strict";var r=e("./helpers"),i=e("btoa"),a=e("cookiejar").CookieJar,o={each:e("lodash-compat/collection/each"),includes:e("lodash-compat/collection/includes"),isObject:e("lodash-compat/lang/isObject"),isArray:e("lodash-compat/lang/isArray")},s=t.exports.SwaggerAuthorizations=function(e){this.authz=e||{}};s.prototype.add=function(e,t){if(o.isObject(e))for(var n in e)this.authz[n]=e[n];else"string"==typeof e&&(this.authz[e]=t);return t},s.prototype.remove=function(e){return delete this.authz[e]},s.prototype.apply=function(e,t){var n=!0,r=!t,i=[];return o.each(t,function(e,t){"string"==typeof t&&i.push(t),o.each(e,function(e,t){i.push(t)})}),o.each(this.authz,function(t,a){if(r||o.includes(i,a)){var s=t.apply(e);n=n&&!!s}}),n};var u=t.exports.ApiKeyAuthorization=function(e,t,n){this.name=e,this.value=t,this.type=n};u.prototype.apply=function(e){if("query"===this.type){var t;if(e.url.indexOf("?")>0){t=e.url.substring(e.url.indexOf("?")+1);var n=t.split("&");if(n&&n.length>0)for(var r=0;r<n.length;r++){var i=n[r].split("=");if(i&&i.length>0&&i[0]===this.name)return!1}}return e.url.indexOf("?")>0?e.url=e.url+"&"+this.name+"="+this.value:e.url=e.url+"?"+this.name+"="+this.value,!0}return"header"===this.type?("undefined"==typeof e.headers[this.name]&&(e.headers[this.name]=this.value),!0):void 0};var l=t.exports.CookieAuthorization=function(e){this.cookie=e};l.prototype.apply=function(e){return e.cookieJar=e.cookieJar||new a,e.cookieJar.setCookie(this.cookie),!0};var c=t.exports.PasswordAuthorization=function(e,t){3===arguments.length&&(r.log("PasswordAuthorization: the 'name' argument has been removed, pass only username and password"),e=arguments[1],t=arguments[2]),this.username=e,this.password=t};c.prototype.apply=function(e){return"undefined"==typeof e.headers.Authorization&&(e.headers.Authorization="Basic "+i(this.username+":"+this.password)),!0}},{"./helpers":4,btoa:14,cookiejar:19,"lodash-compat/collection/each":56,"lodash-compat/collection/includes":59,"lodash-compat/lang/isArray":144,"lodash-compat/lang/isObject":148}],3:[function(e,t,n){"use strict";var r={bind:e("lodash-compat/function/bind"),cloneDeep:e("lodash-compat/lang/cloneDeep"),find:e("lodash-compat/collection/find"),forEach:e("lodash-compat/collection/forEach"),indexOf:e("lodash-compat/array/indexOf"),isArray:e("lodash-compat/lang/isArray"),isObject:e("lodash-compat/lang/isObject"),isFunction:e("lodash-compat/lang/isFunction"),isPlainObject:e("lodash-compat/lang/isPlainObject"),isUndefined:e("lodash-compat/lang/isUndefined")},i=e("./auth"),a=e("./helpers"),o=e("./types/model"),s=e("./types/operation"),u=e("./types/operationGroup"),l=e("./resolver"),c=e("./http"),p=e("./spec-converter"),f=e("q"),h=["apis","authorizationScheme","authorizations","basePath","build","buildFrom1_1Spec","buildFrom1_2Spec","buildFromSpec","clientAuthorizations","convertInfo","debug","defaultErrorCallback","defaultSuccessCallback","enableCookies","fail","failure","finish","help","idFromOp","info","initialize","isBuilt","isValid","modelPropertyMacro","models","modelsArray","options","parameterMacro","parseUri","progress","resourceCount","sampleModels","selfReflect","setConsolidatedModels","spec","supportedSubmitMethods","swaggerRequestHeaders","tagFromLabel","title","url","useJQuery"],d=["apis","asCurl","description","externalDocs","help","label","name","operation","operations","operationsArray","path","tag"],m=["delete","get","head","options","patch","post","put"],y=t.exports=function(e,t){return this.authorizations=null,this.authorizationScheme=null,this.basePath=null,this.debug=!1,this.enableCookies=!1,this.info=null,this.isBuilt=!1,this.isValid=!1,this.modelsArray=[],this.resourceCount=0,this.url=null,this.useJQuery=!1,this.swaggerObject={},this.deferredClient=f.defer(),this.clientAuthorizations=new i.SwaggerAuthorizations,"undefined"!=typeof e?this.initialize(e,t):this};y.prototype.initialize=function(e,t){return this.models={},this.sampleModels={},"string"==typeof e?this.url=e:r.isObject(e)&&(t=e,this.url=t.url),t=t||{},this.clientAuthorizations.add(t.authorizations),this.swaggerRequestHeaders=t.swaggerRequestHeaders||"application/json;charset=utf-8,*/*",this.defaultSuccessCallback=t.defaultSuccessCallback||null,this.defaultErrorCallback=t.defaultErrorCallback||null,this.modelPropertyMacro=t.modelPropertyMacro||null,this.parameterMacro=t.parameterMacro||null,this.usePromise=t.usePromise||null,"function"==typeof t.success&&(this.success=t.success),t.useJQuery&&(this.useJQuery=t.useJQuery),t.enableCookies&&(this.enableCookies=t.enableCookies),this.options=t||{},this.supportedSubmitMethods=t.supportedSubmitMethods||[],this.failure=t.failure||function(e){throw e},this.progress=t.progress||function(){},this.spec=r.cloneDeep(t.spec),t.scheme&&(this.scheme=t.scheme),this.usePromise||"function"==typeof t.success?(this.ready=!0,this.build()):void 0},y.prototype.build=function(e){if(this.isBuilt)return this;var t=this;this.progress("fetching resource list: "+this.url+"; Please wait.");var n={useJQuery:this.useJQuery,url:this.url,method:"get",headers:{accept:this.swaggerRequestHeaders},on:{error:function(e){return"http"!==t.url.substring(0,4)?t.fail("Please specify the protocol for "+t.url):0===e.status?t.fail("Can't read from server. It may not have the appropriate access-control-origin settings."):404===e.status?t.fail("Can't read swagger JSON from "+t.url):t.fail(e.status+" : "+e.statusText+" "+t.url)},response:function(e){var n=e.obj;if(!n)return t.fail("failed to parse JSON/YAML response");if(t.swaggerVersion=n.swaggerVersion,t.swaggerObject=n,n.swagger&&2===parseInt(n.swagger))t.swaggerVersion=n.swagger,(new l).resolve(n,t.url,t.buildFromSpec,t),t.isValid=!0;else{var r=new p;t.oldSwaggerObject=t.swaggerObject,r.setDocumentationLocation(t.url),r.convert(n,t.clientAuthorizations,t.options,function(e){t.swaggerObject=e,(new l).resolve(e,t.url,t.buildFromSpec,t),t.isValid=!0})}}}};if(this.spec)t.swaggerObject=this.spec,setTimeout(function(){(new l).resolve(t.spec,t.buildFromSpec,t)},10);else{if(this.clientAuthorizations.apply(n),e)return n;(new c).execute(n,this.options)}return this.usePromise?this.deferredClient.promise:this},y.prototype.buildFromSpec=function(e){if(this.isBuilt)return this;this.apis={},this.apisArray=[],this.basePath=e.basePath||"",this.consumes=e.consumes,this.host=e.host||"",this.info=e.info||{},this.produces=e.produces,this.schemes=e.schemes||[],this.securityDefinitions=e.securityDefinitions,this.title=e.title||"",e.externalDocs&&(this.externalDocs=e.externalDocs),this.authSchemes=e.securityDefinitions;var t,n={};if(Array.isArray(e.tags))for(n={},t=0;t<e.tags.length;t++){var i=e.tags[t];n[i.name]=i}var l;"string"==typeof this.url?(l=this.parseUri(this.url),"undefined"==typeof this.scheme&&"undefined"==typeof this.schemes||0===this.schemes.length?this.scheme=l.scheme||"http":"undefined"==typeof this.scheme&&(this.scheme=this.schemes[0]||l.scheme),("undefined"==typeof this.host||""===this.host)&&(this.host=l.host,l.port&&(this.host=this.host+":"+l.port))):"undefined"==typeof this.schemes||0===this.schemes.length?this.scheme="http":"undefined"==typeof this.scheme&&(this.scheme=this.schemes[0]),this.definitions=e.definitions;var c;for(c in this.definitions){var p=new o(c,this.definitions[c],this.models,this.modelPropertyMacro);p&&(this.models[c]=p)}var f=this;return f.apis.help=r.bind(f.help,f),r.forEach(e.paths,function(e,t){r.isPlainObject(e)&&r.forEach(m,function(i){var o=e[i];if(!r.isUndefined(o)){if(!r.isPlainObject(o))return void a.log("The '"+i+"' operation for '"+t+"' path is not an Operation Object");var l=o.tags;(r.isUndefined(l)||!r.isArray(l)||0===l.length)&&(l=o.tags=["default"]);var c=f.idFromOp(t,i,o),p=new s(f,o.scheme,c,i,t,o,f.definitions,f.models,f.clientAuthorizations);r.forEach(l,function(e){var t=r.indexOf(h,e)>-1?"_"+e:e,i=r.indexOf(d,e)>-1?"_"+e:e,o=f[t];if(t!==e&&a.log("The '"+e+"' tag conflicts with a SwaggerClient function/property name. Use 'client."+t+"' or 'client.apis."+e+"' instead of 'client."+e+"'."),i!==e&&a.log("The '"+e+"' tag conflicts with a SwaggerClient operation function/property name. Use 'client.apis."+i+"' instead of 'client.apis."+e+"'."),r.indexOf(d,c)>-1&&(a.log("The '"+c+"' operationId conflicts with a SwaggerClient operation function/property name. Use 'client.apis."+i+"._"+c+"' instead of 'client.apis."+i+"."+c+"'."),c="_"+c,p.nickname=c),r.isUndefined(o)){o=f[t]=f.apis[i]={},o.operations={},o.label=i,o.apis={};var s=n[e];r.isUndefined(s)||(o.description=s.description,o.externalDocs=s.externalDocs),f[t].help=r.bind(f.help,o),f.apisArray.push(new u(e,o.description,o.externalDocs,p))}c=f.makeUniqueOperationId(c,f.apis[i]),r.isFunction(o.help)||(o.help=r.bind(f.help,o)),f.apis[i][c]=o[c]=r.bind(p.execute,p),f.apis[i][c].help=o[c].help=r.bind(p.help,p),f.apis[i][c].asCurl=o[c].asCurl=r.bind(p.asCurl,p),o.apis[c]=o.operations[c]=p;var l=r.find(f.apisArray,function(t){return t.tag===e});l&&l.operationsArray.push(p)})}})}),this.isBuilt=!0,this.usePromise?(this.isValid=!0,this.isBuilt=!0,this.deferredClient.resolve(this),this.deferredClient.promise):(this.success&&this.success(),this)},y.prototype.makeUniqueOperationId=function(e,t){for(var n=0,i=e;;){var a=!1;if(r.forEach(t.operations,function(e){e.nickname===i&&(a=!0)}),!a)return i;i=e+"_"+n,n++}return e},y.prototype.parseUri=function(e){var t=/^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,n=t.exec(e);return{scheme:n[4]?n[4].replace(":",""):void 0,host:n[11],port:n[12],path:n[15]}},y.prototype.help=function(e){var t="";return this instanceof y?r.forEach(this.apis,function(e,n){r.isPlainObject(e)&&(t+="operations for the '"+n+"' tag\n",r.forEach(e.operations,function(e,n){t+=" * "+n+": "+e.summary+"\n"}))}):(this instanceof u||r.isPlainObject(this))&&(t+="operations for the '"+this.label+"' tag\n",r.forEach(this.apis,function(e,n){t+=" * "+n+": "+e.summary+"\n"})),e?t:(a.log(t),t)},y.prototype.tagFromLabel=function(e){return e},y.prototype.idFromOp=function(e,t,n){n&&n.operationId||(n=n||{},n.operationId=t+"_"+e);var r=n.operationId.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|.\/?,\\'""-]/g,"_")||e.substring(1)+"_"+t;return r=r.replace(/((_){2,})/g,"_"),r=r.replace(/^(_)*/g,""),r=r.replace(/([_])*$/g,"")},y.prototype.setHost=function(e){this.host=e,this.apis&&r.forEach(this.apis,function(t){t.operations&&r.forEach(t.operations,function(t){t.host=e})})},y.prototype.setBasePath=function(e){this.basePath=e,this.apis&&r.forEach(this.apis,function(t){t.operations&&r.forEach(t.operations,function(t){t.basePath=e})})},y.prototype.fail=function(e){return this.usePromise?(this.deferredClient.reject(e),this.deferredClient.promise):void(this.failure?this.failure(e):this.failure(e))}},{"./auth":2,"./helpers":4,"./http":5,"./resolver":6,"./spec-converter":8,"./types/model":9,"./types/operation":10,"./types/operationGroup":11,"lodash-compat/array/indexOf":53,"lodash-compat/collection/find":57,"lodash-compat/collection/forEach":58,"lodash-compat/function/bind":62,"lodash-compat/lang/cloneDeep":142,"lodash-compat/lang/isArray":144,"lodash-compat/lang/isFunction":146,"lodash-compat/lang/isObject":148,"lodash-compat/lang/isPlainObject":149,"lodash-compat/lang/isUndefined":152,q:161}],4:[function(e,t,n){(function(n){"use strict";var r={isPlainObject:e("lodash-compat/lang/isPlainObject"),indexOf:e("lodash-compat/array/indexOf")};t.exports.__bind=function(e,t){return function(){return e.apply(t,arguments)}};var i=t.exports.log=function(){console&&"test"!==n.env.NODE_ENV&&console.log(Array.prototype.slice.call(arguments)[0])};t.exports.fail=function(e){i(e)};var a=(t.exports.optionHtml=function(e,t){return'<tr><td class="optionName">'+e+":</td><td>"+t+"</td></tr>"},t.exports.resolveSchema=function(e){return r.isPlainObject(e.schema)&&(e=a(e.schema)),e});t.exports.simpleRef=function(e){return"undefined"==typeof e?null:0===e.indexOf("#/definitions/")?e.substring("#/definitions/".length):e}}).call(this,e("_process"))},{_process:13,"lodash-compat/array/indexOf":53,"lodash-compat/lang/isPlainObject":149}],5:[function(t,n,r){"use strict";var i=t("./helpers"),a=t("superagent"),o=t("js-yaml"),s={isObject:t("lodash-compat/lang/isObject")},u=function(){this.type="JQueryHttpClient"},l=function(){this.type="SuperagentHttpClient"},c=n.exports=function(){};c.prototype.execute=function(t,n){var r;r=n&&n.client?n.client:new l(n),r.opts=n||{};var i=!1;if("undefined"!=typeof window&&"undefined"!=typeof window.jQuery&&(i=!0),"options"===t.method.toLowerCase()&&"SuperagentHttpClient"===r.type&&(e("forcing jQuery as OPTIONS are not supported by SuperAgent"),t.useJQuery=!0),this.isInternetExplorer()&&(t.useJQuery===!1||!i))throw new Error("Unsupported configuration! JQuery is required but not available");(t&&t.useJQuery===!0||this.isInternetExplorer()&&i)&&(r=new u(n));var a=t.on.response,o=function(e){return n&&n.requestInterceptor&&(e=n.requestInterceptor.apply(e)),e},c=function(e){return n&&n.responseInterceptor&&(e=n.responseInterceptor.apply(e)),a(e)};return t.on.response=function(e){c(e)},s.isObject(t)&&s.isObject(t.body)&&(t.body.type&&"formData"===t.body.type?(t.contentType=!1,t.processData=!1,delete t.headers["Content-Type"]):t.body=JSON.stringify(t.body)),r.execute(o(t)),t.deferred?t.deferred.promise:t},c.prototype.isInternetExplorer=function(){var e=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var t=navigator.userAgent.toLowerCase();if(-1!==t.indexOf("msie")){var n=parseInt(t.split("msie")[1]);8>=n&&(e=!0)}}return e},u.prototype.execute=function(e){var t=this.jQuery||"undefined"!=typeof window&&window.jQuery,n=e.on,r=e;if("undefined"==typeof t||t===!1)throw new Error("Unsupported configuration! JQuery is required but not available");return e.type=e.method,e.cache=!1,delete e.useJQuery,e.data=e.body,delete e.body,e.complete=function(e){for(var t={},a=e.getAllResponseHeaders().split("\n"),s=0;s<a.length;s++){var u=a[s].trim();if(0!==u.length){var l=u.indexOf(":");if(-1!==l){var c=u.substring(0,l).trim(),p=u.substring(l+1).trim();t[c]=p}else t[u]=null}}var f={url:r.url,method:r.method,status:e.status,statusText:e.statusText,data:e.responseText,headers:t};try{var h=e.responseJSON||o.safeLoad(e.responseText);f.obj="string"==typeof h?{}:h}catch(d){i.log("unable to parse JSON/YAML content")}if(f.obj=f.obj||null,e.status>=200&&e.status<300)n.response(f);else{if(!(0===e.status||e.status>=400&&e.status<599))return n.response(f);n.error(f)}},t.support.cors=!0,t.ajax(e)},l.prototype.execute=function(e){var t=e.method.toLowerCase();"delete"===t&&(t="del");var n,r=e.headers||{},s=a[t](e.url);for(n in r)s.set(n,r[n]);e.enableCookies&&s.withCredentials(),e.body&&s.send(e.body),"function"==typeof s.buffer&&s.buffer(),s.end(function(t,n){n=n||{status:0,headers:{error:"no response from server"}};var r,a={url:e.url,method:e.method,headers:n.headers};if(!t&&n.error&&(t=n.error),t&&e.on&&e.on.error){if(a.errObj=t,a.status=n?n.status:500,a.statusText=n?n.text:t.message,n.headers&&n.headers["content-type"]&&n.headers["content-type"].indexOf("application/json")>=0)try{a.obj=JSON.parse(a.statusText)}catch(s){a.obj=null}r=e.on.error}else if(n&&e.on&&e.on.response){var u;if(n.body&&Object.keys(n.body).length>0)u=n.body;else try{u=o.safeLoad(n.text),u="string"==typeof u?null:u}catch(s){i.log("cannot parse JSON/YAML content")}a.obj="object"==typeof u?u:null,a.status=n.status,a.statusText=n.text,r=e.on.response}a.data=a.statusText,r&&r(a)})}},{"./helpers":4,"js-yaml":20,"lodash-compat/lang/isObject":148,superagent:162}],6:[function(e,t,n){"use strict";var r=e("./http"),i={isObject:e("lodash-compat/lang/isObject"),cloneDeep:e("lodash-compat/lang/cloneDeep"),isArray:e("lodash-compat/lang/isArray")},a=t.exports=function(){};a.prototype.processAllOf=function(e,t,n,r,i,a){var o,s,u;n["x-resolved-from"]=["#/definitions/"+t];var l=n.allOf;for(l.sort(function(e,t){return e.$ref&&t.$ref?0:e.$ref?-1:1}),o=0;o<l.length;o++)u=l[o],s="/definitions/"+t+"/allOf",this.resolveInline(e,a,u,r,i,s)},a.prototype.resolve=function(e,t,n,a){this.spec=e;var o,s,u=t,l=n,c=a,p={};"function"==typeof t&&(u=null,l=t,c=n);var f=u;this.scope=c||this,this.iteration=this.iteration||0,this.scope.options&&this.scope.options.requestInterceptor&&(p.requestInterceptor=this.scope.options.requestInterceptor),this.scope.options&&this.scope.options.responseInterceptor&&(p.responseInterceptor=this.scope.options.responseInterceptor);var h,d,m,y,g=0,v={},b={},D=[];e.definitions=e.definitions||{};for(h in e.definitions){var w=e.definitions[h];for(y in w.properties)m=w.properties[y],i.isArray(m.allOf)?this.processAllOf(u,h,m,D,b,e):this.resolveTo(u,m,D,"/definitions");w.allOf&&this.processAllOf(u,h,w,D,b,e)}for(h in e.paths){var A,x,C;d=e.paths[h];for(A in d)if("$ref"===A)o="/paths"+h,this.resolveInline(u,e,d,D,b,o);else{x=d[A];var E=d.parameters||[],F=x.parameters||[];for(s in E){var S=E[s];F.unshift(S)}"parameters"!==A&&i.isObject(x)&&(x.parameters=x.parameters||F);for(s in F){var S=F[s];if(o="/paths"+h+"/"+A+"/parameters","body"===S["in"]&&S.schema)if(i.isArray(S.schema.allOf)){for(var O="inline_model",h=O,j=!1,k=0;!j;){if("undefined"==typeof e.definitions[h]){j=!0;break}h=O+"_"+k,k++}e.definitions[h]={allOf:S.schema.allOf},delete S.schema.allOf,S.schema.$ref="#/definitions/"+h,this.processAllOf(u,h,e.definitions[h],D,b,e)}else this.resolveTo(u,S.schema,D,o);S.$ref&&this.resolveInline(u,e,S,D,b,S.$ref)}for(C in x.responses){var I=x.responses[C];if(o="/paths"+h+"/"+A+"/responses/"+C,i.isObject(I)&&(I.$ref&&this.resolveInline(u,e,I,D,b,o),I.schema)){var B=I;if(i.isArray(B.schema.allOf)){for(var O="inline_model",h=O,j=!1,k=0;!j;){if("undefined"==typeof e.definitions[h]){j=!0;break}h=O+"_"+k,k++}e.definitions[h]={allOf:B.schema.allOf},delete B.schema.allOf,delete B.schema.type,B.schema.$ref="#/definitions/"+h,this.processAllOf(u,h,e.definitions[h],D,b,e)}else this.resolveTo(u,I.schema,D,o)}}}d.parameters=[]}var _,T=0,P=[],L=D;for(s=0;s<L.length;s++){var $=L[s];if(u===$.root){if("ref"===$.resolveAs){var M,U=(($.root||"")+"/"+$.key).split("/"),R=[],N="";if($.key.indexOf("../")>=0){for(var q=0;q<U.length;q++)".."===U[q]?R=R.slice(0,R.length-1):R.push(U[q]);for(M=0;M<R.length;M++)M>0&&(N+="/"),N+=R[M];$.root=N,P.push($)}else if(_=$.key.split("#"),2===_.length){(0===_[0].indexOf("http://")||0===_[0].indexOf("https://"))&&($.root=_[0]),o=_[1].split("/");var H,V=e;for(M=0;M<o.length;M++){var z=o[M];if(""!==z){if(V=V[z],"undefined"==typeof V){H=null;break}H=V}}null===H&&P.push($)}}else if("inline"===$.resolveAs){if($.key&&-1===$.key.indexOf("#")&&"/"!==$.key.charAt(0)){for(_=$.root.split("/"),o="",s=0;s<_.length-1;s++)o+=_[s]+"/";o+=$.key,$.root=o,$.location=""}P.push($)}}else P.push($);
+}T=P.length;for(var Y=0;Y<P.length;Y++)!function(e,t,n){if(null===e.root||e.root===u)n.resolveItem(t,f,D,v,b,e),g+=1,g===T&&n.finish(t,u,D,v,b,l,!0);else{var i={useJQuery:!1,url:e.root,method:"get",headers:{accept:n.scope.swaggerRequestHeaders||"application/json"},on:{error:function(r){g+=1,b[e.key]={root:e.root,location:e.location},g===T&&n.finish(t,f,D,v,b,l)},response:function(r){var i=r.obj;n.resolveItem(i,e.root,D,v,b,e),g+=1,g===T&&n.finish(t,f,D,v,b,l)}}};c&&c.clientAuthorizations&&c.clientAuthorizations.apply(i),(new r).execute(i,p)}}(P[Y],e,this);0===Object.keys(P).length&&this.finish(e,f,D,v,b,l)},a.prototype.resolveItem=function(e,t,n,r,i,a){var o=a.location,s=e,u=o.split("/");if(""!==o)for(var l=0;l<u.length;l++){var c=u[l];if(-1!==c.indexOf("~1")&&(c=u[l].replace(/~0/g,"~").replace(/~1/g,"/"),"/"!==c.charAt(0)&&(c="/"+c)),"undefined"==typeof s||null===s)break;if(""===c&&l===u.length-1&&u.length>1){s=null;break}c.length>0&&(s=s[c])}var p=a.key;u=a.key.split("/");var f=u[u.length-1];f.indexOf("#")>=0&&(f=f.split("#")[1]),null!==s&&"undefined"!=typeof s?r[p]={name:f,obj:s,key:a.key,root:a.root}:i[p]={root:a.root,location:a.location}},a.prototype.finish=function(e,t,n,r,i,a,o){var s;for(s in n){var u=n[s],l=u.key,c=r[l];if(c)if(e.definitions=e.definitions||{},"ref"===u.resolveAs){if(o!==!0)for(l in c.obj)var p=this.retainRoot(c.obj[l],u.root);e.definitions[c.name]=c.obj,u.obj.$ref="#/definitions/"+c.name}else if("inline"===u.resolveAs){var f=u.obj;f["x-resolved-from"]=[u.key],delete f.$ref;for(l in c.obj){var p=c.obj[l];o!==!0&&(p=this.retainRoot(c.obj[l],u.root)),f[l]=p}}}var h=this.countUnresolvedRefs(e);0===h||this.iteration>5?(this.resolveAllOf(e.definitions),a.call(this.scope,e,i)):(this.iteration+=1,this.resolve(e,t,a,this.scope))},a.prototype.countUnresolvedRefs=function(e){var t,n=this.getRefs(e),r=[],i=[];for(t in n)0===t.indexOf("#")?r.push(t.substring(1)):i.push(t);for(t=0;t<r.length;t++)for(var a=r[t],o=a.split("/"),s=e,u=0;u<o.length;u++){var l=o[u];if(""!==l&&(s=s[l],"undefined"==typeof s)){i.push(a);break}}return i.length},a.prototype.getRefs=function(e,t){t=t||e;var n={};for(var r in t)if(t.hasOwnProperty(r)){var a=t[r];if("$ref"===r&&"string"==typeof a)n[a]=null;else if(i.isObject(a)){var o=this.getRefs(a);for(var s in o)n[s]=null}}return n},a.prototype.retainRoot=function(e,t){for(var n in e){var r=e[n];if("$ref"===n&&"string"==typeof r){if(0!==r.indexOf("http://")&&0!==r.indexOf("https://")){var a=!0;if(t){var o=t.slice(-1);if("/"!==o&&0!==r.indexOf("#")&&0!==r.indexOf("http://")&&r.indexOf("https://")){console.log("working with "+r),a=!1;var s=t.split("/");s=s.splice(0,s.length-1),t="";for(var u=0;u<s.length;u++)t+=s[u]+"/"}}0!==r.indexOf("#")&&a&&(r="#"+r),r=(t||"")+r,e[n]=r}}else i.isObject(r)&&this.retainRoot(r,t)}return e},a.prototype.resolveInline=function(e,t,n,r,i,a){var o,s,u,l,c=n.$ref,p=n.$ref,f=!1;if(p){if(0===p.indexOf("../")){for(s=p.split("../"),u=e.split("/"),p="",o=0;o<s.length;o++)""===s[o]?u=u.slice(0,u.length-1):p+=s[o];for(e="",o=0;o<u.length-1;o++)o>0&&(e+="/"),e+=u[o];f=!0}if(p.indexOf("#")>=0)if(0===p.indexOf("/"))l=p.split("#"),s=e.split("//"),u=s[1].split("/"),e=s[0]+"//"+u[0]+l[0],a=l[1];else{if(l=p.split("#"),""!==l[0]){if(u=e.split("/"),u=u.slice(0,u.length-1),!f){e="";for(var h=0;h<u.length;h++)h>0&&(e+="/"),e+=u[h]}e+="/"+p.split("#")[0]}a=l[1]}0===p.indexOf("http")?(p.indexOf("#")>=0?(e=p.split("#")[0],a=p.split("#")[1]):(e=p,a=""),r.push({obj:n,resolveAs:"inline",root:e,key:c,location:a})):0===p.indexOf("#")?(a=p.split("#")[1],r.push({obj:n,resolveAs:"inline",root:e,key:c,location:a})):r.push({obj:n,resolveAs:"inline",root:e,key:c,location:a})}else"array"===n.type&&this.resolveTo(e,n.items,r,a)},a.prototype.resolveTo=function(e,t,n,r){var a,o,s=t.$ref,u=e;if("undefined"!=typeof s&&null!==s){if(s.indexOf("#")>=0){var l=s.split("#");if(l[0]&&0===s.indexOf("/"));else if(l[0]&&0===l[0].indexOf("http"))u=l[0],s=l[1];else if(l[0]&&l[0].length>0){for(a=e.split("/"),u="",o=0;o<a.length-1;o++)u+=a[o]+"/";u+=l[0]}r=l[1]}else if(0===s.indexOf("http://")||0===s.indexOf("https://"))u=s,r="";else{for(a=e.split("/"),u="",o=0;o<a.length-1;o++)u+=a[o]+"/";u+=s,r=""}n.push({obj:t,resolveAs:"ref",root:u,key:s,location:r})}else if("array"===t.type){var c=t.items;this.resolveTo(e,c,n,r)}else if(t&&t.properties){var p=this.uniqueName("inline_model");this.spec.definitions[p]=i.cloneDeep(t),t.$ref="#/definitions/"+p,delete t.type,delete t.properties}},a.prototype.uniqueName=function(e){for(var t=e,n=0;;){if(!i.isObject(this.spec.definitions[t]))return t;t=e+"_"+n,n++}},a.prototype.resolveAllOf=function(e,t,n){n=n||0,t=t||e;var r;for(var a in t)if(t.hasOwnProperty(a)){var o=t[a];if(null===o)throw new TypeError("Swagger 2.0 does not support null types ("+t+"). See https://github.com/swagger-api/swagger-spec/issues/229.");if("object"==typeof o&&this.resolveAllOf(e,o,n+1),o&&"undefined"!=typeof o.allOf){var s=o.allOf;if(i.isArray(s)){var u=i.cloneDeep(o);delete u.allOf,u["x-composed"]=!0,"undefined"!=typeof o["x-resolved-from"]&&(u["x-resolved-from"]=o["x-resolved-from"]);for(var l=0;l<s.length;l++){var c=s[l],p="self";"undefined"!=typeof c["x-resolved-from"]&&(p=c["x-resolved-from"][0]);for(var f in c)if(u.hasOwnProperty(f))if("properties"===f){var h=c[f];for(r in h){u.properties[r]=i.cloneDeep(h[r]);var d=h[r]["x-resolved-from"];("undefined"==typeof d||"self"===d)&&(d=p),u.properties[r]["x-resolved-from"]=d}}else if("required"===f){for(var m=u.required.concat(c[f]),y=0;y<m.length;++y)for(var g=y+1;g<m.length;++g)m[y]===m[g]&&m.splice(g--,1);u.required=m}else"x-resolved-from"===f&&u["x-resolved-from"].push(p);else if(u[f]=i.cloneDeep(c[f]),"properties"===f)for(r in u[f])u[f][r]["x-resolved-from"]=p}t[a]=u}}i.isObject(o)&&this.resolveAllOf(e,o,n+1)}}},{"./http":5,"lodash-compat/lang/cloneDeep":142,"lodash-compat/lang/isArray":144,"lodash-compat/lang/isObject":148}],7:[function(e,t,n){"use strict";function r(e,t){return'<tr><td class="optionName">'+e+":</td><td>"+t+"</td></tr>"}function i(e,t){var n;return"integer"===e&&"int32"===t?n="integer":"integer"===e&&"int64"===t?n="long":"integer"===e&&"undefined"==typeof t?n="long":"string"===e&&"date-time"===t?n="date-time":"string"===e&&"date"===t?n="date":"number"===e&&"float"===t?n="float":"number"===e&&"double"===t?n="double":"number"===e&&"undefined"==typeof t?n="double":"boolean"===e?n="boolean":"string"===e&&(n="string"),n}function a(e,t){var n="";return"undefined"!=typeof e.$ref?n+=u.simpleRef(e.$ref):"undefined"==typeof e.type?n+="object":"array"===e.type?t?n+=a(e.items||e.$ref||{}):(n+="Array[",n+=a(e.items||e.$ref||{}),n+="]"):n+="integer"===e.type&&"int32"===e.format?"integer":"integer"===e.type&&"int64"===e.format?"long":"integer"===e.type&&"undefined"==typeof e.format?"long":"string"===e.type&&"date-time"===e.format?"date-time":"string"===e.type&&"date"===e.format?"date":"string"===e.type&&"undefined"==typeof e.format?"string":"number"===e.type&&"float"===e.format?"float":"number"===e.type&&"double"===e.format?"double":"number"===e.type&&"undefined"==typeof e.format?"double":"boolean"===e.type?"boolean":e.$ref?u.simpleRef(e.$ref):e.type,n}function o(e,t,n,r){e=u.resolveSchema(e),"function"!=typeof r&&(r=function(e){return(e||{})["default"]}),n=n||{};var i,a,s=e.type||"object",c=e.format;return l.isUndefined(e.example)?l.isUndefined(e.items)&&l.isArray(e["enum"])&&(a=e["enum"][0]):a=e.example,l.isUndefined(a)&&(e.$ref?(i=t[u.simpleRef(e.$ref)],l.isUndefined(i)||(l.isUndefined(n[i.name])?(n[i.name]=i,a=o(i.definition,t,n,r),delete n[i.name]):a="array"===i.type?[]:{})):l.isUndefined(e["default"])?"string"===s?a="date-time"===c?(new Date).toISOString():"date"===c?(new Date).toISOString().split("T")[0]:"string":"integer"===s?a=0:"number"===s?a=0:"boolean"===s?a=!0:"object"===s?(a={},l.forEach(e.properties,function(e,i){var s=l.cloneDeep(e);s["default"]=r(e),a[i]=o(s,t,n,r)})):"array"===s&&(a=[],l.isArray(e.items)?l.forEach(e.items,function(e){a.push(o(e,t,n,r))}):l.isPlainObject(e.items)?a.push(o(e.items,t,n,r)):l.isUndefined(e.items)?a.push({}):u.log("Array type's 'items' property is not an array or an object, cannot process")):a=e["default"]),a}function s(e,t,n,i){function a(e,t,r){var i,a=t;return e.$ref?(a=e.title||u.simpleRef(e.$ref),i=n[a]):l.isUndefined(t)&&(a=e.title||"Inline Model "+ ++m,i={definition:e}),r!==!0&&(h[a]=l.isUndefined(i)?{}:i.definition),a}function o(e){var t='<span class="propType">',n=e.type||"object";return e.$ref?t+=a(e,u.simpleRef(e.$ref)):"object"===n?t+=l.isUndefined(e.properties)?"object":a(e):"array"===n?(t+="Array[",l.isArray(e.items)?t+=l.map(e.items,a).join(","):l.isPlainObject(e.items)?t+=l.isUndefined(e.items.$ref)?l.isUndefined(e.items.type)||-1!==l.indexOf(["array","object"],e.items.type)?a(e.items):e.items.type:a(e.items,u.simpleRef(e.items.$ref)):(u.log("Array type's 'items' schema is not an array or an object, cannot process"),t+="object"),t+="]"):t+=e.type,t+="</span>"}function s(e,t){var n="",i=e.type||"object",a="array"===i;switch(a&&(i=l.isPlainObject(e.items)&&!l.isUndefined(e.items.type)?e.items.type:"object"),l.isUndefined(e["default"])||(n+=r("Default",e["default"])),i){case"string":e.minLength&&(n+=r("Min. Length",e.minLength)),e.maxLength&&(n+=r("Max. Length",e.maxLength)),e.pattern&&(n+=r("Reg. Exp.",e.pattern));break;case"integer":case"number":e.minimum&&(n+=r("Min. Value",e.minimum)),e.exclusiveMinimum&&(n+=r("Exclusive Min.","true")),e.maximum&&(n+=r("Max. Value",e.maximum)),e.exclusiveMaximum&&(n+=r("Exclusive Max.","true")),e.multipleOf&&(n+=r("Multiple Of",e.multipleOf))}if(a&&(e.minItems&&(n+=r("Min. Items",e.minItems)),e.maxItems&&(n+=r("Max. Items",e.maxItems)),e.uniqueItems&&(n+=r("Unique Items","true")),e.collectionFormat&&(n+=r("Coll. Format",e.collectionFormat))),l.isUndefined(e.items)&&l.isArray(e["enum"])){var o;o="number"===i||"integer"===i?e["enum"].join(", "):'"'+e["enum"].join('", "')+'"',n+=r("Enum",o)}return n.length>0&&(t='<span class="propWrap">'+t+'<table class="optionsWrapper"><tr><th colspan="2">'+i+"</th></tr>"+n+"</table></span>"),t}function c(e,t){var r=e.type||"object",c="array"===e.type,h=p+t+" "+(c?"[":"{")+f;if(t&&d.push(t),c)l.isArray(e.items)?h+="<div>"+l.map(e.items,function(e){var t=e.type||"object";return l.isUndefined(e.$ref)?l.indexOf(["array","object"],t)>-1?"object"===t&&l.isUndefined(e.properties)?"object":a(e):s(e,t):a(e,u.simpleRef(e.$ref))}).join(",</div><div>"):l.isPlainObject(e.items)?h+=l.isUndefined(e.items.$ref)?l.indexOf(["array","object"],e.items.type||"object")>-1?(l.isUndefined(e.items.type)||"object"===e.items.type)&&l.isUndefined(e.items.properties)?"<div>object</div>":"<div>"+a(e.items)+"</div>":"<div>"+s(e.items,e.items.type)+"</div>":"<div>"+a(e.items,u.simpleRef(e.items.$ref))+"</div>":(u.log("Array type's 'items' property is not an array or an object, cannot process"),h+="<div>object</div>");else if(e.$ref)h+="<div>"+a(e,t)+"</div>";else if("object"===r){if(l.isPlainObject(e.properties))var m=l.map(e.properties,function(t,r){var a,c,p=l.indexOf(e.required,r)>=0,f=l.cloneDeep(t),h=p?"required":"",d="<div"+(t.readOnly?' class="readOnly"':"")+'><span class="propName '+h+'">'+r+"</span> (";return f["default"]=i(f),f=u.resolveSchema(f),c=t.description||f.description,l.isUndefined(f.$ref)||(a=n[u.simpleRef(f.$ref)],l.isUndefined(a)||-1!==l.indexOf([void 0,"array","object"],a.definition.type)||(f=u.resolveSchema(a.definition))),d+=o(f),p||(d+=', <span class="propOptKey">optional</span>'),t.readOnly&&(d+=', <span class="propReadOnly">read only</span>'),d+=")",l.isUndefined(c)||(d+=': <span class="propDesc">'+c+"</span>"),f["enum"]&&(d+=' = <span class="propVals">[\''+f["enum"].join("', '")+"']</span>"),s(f,d)}).join(",</div>");m&&(h+=m+"</div>")}else h+="<div>"+s(e,r)+"</div>";return h+p+(c?"]":"}")+f}var p='<span class="strong">',f="</span>";if(l.isObject(arguments[0])&&(e=void 0,t=arguments[0],n=arguments[1],i=arguments[2]),n=n||{},t=u.resolveSchema(t),l.isEmpty(t))return p+"Empty"+f;if("string"==typeof t.$ref&&(e=u.simpleRef(t.$ref),t=n[e],"undefined"==typeof t))return p+e+" is not defined!"+f;"string"!=typeof e&&(e=t.title||"Inline Model"),t.definition&&(t=t.definition),"function"!=typeof i&&(i=function(e){return(e||{})["default"]});for(var h={},d=[],m=0,y=c(t,e);l.keys(h).length>0;)l.forEach(h,function(e,t){var n=l.indexOf(d,t)>-1;delete h[t],n||(d.push(t),y+="<br />"+c(e,t))});return y}var u=e("./helpers"),l={isPlainObject:e("lodash-compat/lang/isPlainObject"),isUndefined:e("lodash-compat/lang/isUndefined"),isArray:e("lodash-compat/lang/isArray"),isObject:e("lodash-compat/lang/isObject"),isEmpty:e("lodash-compat/lang/isEmpty"),map:e("lodash-compat/collection/map"),indexOf:e("lodash-compat/array/indexOf"),cloneDeep:e("lodash-compat/lang/cloneDeep"),keys:e("lodash-compat/object/keys"),forEach:e("lodash-compat/collection/forEach")};t.exports.optionHtml=r,t.exports.typeFromJsonSchema=i,t.exports.getStringSignature=a,t.exports.schemaToHTML=s,t.exports.schemaToJSON=o},{"./helpers":4,"lodash-compat/array/indexOf":53,"lodash-compat/collection/forEach":58,"lodash-compat/collection/map":60,"lodash-compat/lang/cloneDeep":142,"lodash-compat/lang/isArray":144,"lodash-compat/lang/isEmpty":145,"lodash-compat/lang/isObject":148,"lodash-compat/lang/isPlainObject":149,"lodash-compat/lang/isUndefined":152,"lodash-compat/object/keys":153}],8:[function(e,t,n){"use strict";var r=e("./http"),i={isObject:e("lodash-compat/lang/isObject")},a=t.exports=function(){this.errors=[],this.warnings=[],this.modelMap={}};a.prototype.setDocumentationLocation=function(e){this.docLocation=e},a.prototype.convert=function(e,t,n,r){if(!e||!Array.isArray(e.apis))return this.finish(r,null);this.clientAuthorizations=t;var i={swagger:"2.0"};i.originalVersion=e.swaggerVersion,this.apiInfo(e,i),this.securityDefinitions(e,i),e.basePath&&this.setDocumentationLocation(e.basePath);var a,o=!1;for(a=0;a<e.apis.length;a++){var s=e.apis[a];Array.isArray(s.operations)&&(o=!0)}o?(this.declaration(e,i),this.finish(r,i)):this.resourceListing(e,i,n,r)},a.prototype.declaration=function(e,t){var n,r,a,o;if(e.apis){0===e.basePath.indexOf("http://")?(a=e.basePath.substring("http://".length),o=a.indexOf("/"),o>0?(t.host=a.substring(0,o),t.basePath=a.substring(o)):(t.host=a,t.basePath="/")):0===e.basePath.indexOf("https://")?(a=e.basePath.substring("https://".length),o=a.indexOf("/"),o>0?(t.host=a.substring(0,o),t.basePath=a.substring(o)):(t.host=a,t.basePath="/")):t.basePath=e.basePath;var s;if(e.authorizations&&(s=e.authorizations),e.consumes&&(t.consumes=e.consumes),e.produces&&(t.produces=e.produces),i.isObject(e))for(n in e.models){var u=e.models[n],l=u.id||n;this.modelMap[l]=n}for(r=0;r<e.apis.length;r++){var c=e.apis[r],p=c.path,f=c.operations;this.operations(p,e.resourcePath,f,s,t)}var h=e.models||{};this.models(h,t)}},a.prototype.models=function(e,t){if(i.isObject(e)){var n;t.definitions=t.definitions||{};for(n in e){var r,a=e[n],o=[],s={properties:{}};for(r in a.properties){var u=a.properties[r],l={};this.dataType(u,l),u.description&&(l.description=u.description),u["enum"]&&(l["enum"]=u["enum"]),"boolean"==typeof u.required&&u.required===!0&&o.push(r),"string"==typeof u.required&&"true"===u.required&&o.push(r),s.properties[r]=l}o.length>0&&(s["enum"]=o),s.required=a.required,t.definitions[n]=s}}},a.prototype.extractTag=function(e){var t=e||"default";return(0===t.indexOf("http:")||0===t.indexOf("https:"))&&(t=t.split(["/"]),t=t[t.length-1].substring()),t.endsWith(".json")&&(t=t.substring(0,t.length-".json".length)),t.replace("/","")},a.prototype.operations=function(e,t,n,r,i){if(Array.isArray(n)){var a;i.paths||(i.paths={});var o=i.paths[e]||{},s=this.extractTag(t);i.tags=i.tags||[];var u=!1;for(a=0;a<i.tags.length;a++){var l=i.tags[a];l.name===s&&(u=!0)}for(u||i.tags.push({name:s}),a=0;a<n.length;a++){var c=n[a],p=(c.method||c.httpMethod).toLowerCase(),f={tags:[s]},h=c.authorizations;if(h&&0===Object.keys(h).length&&(h=r),"undefined"!=typeof h){var d;for(var m in h){f.security=f.security||[];var y=h[m];if(y){var g=[];for(var v in y)g.push(y[v].scope);d={},d[m]=g,f.security.push(d)}else d={},d[m]=[],f.security.push(d)}}c.consumes?f.consumes=c.consumes:i.consumes&&(f.consumes=i.consumes),c.produces?f.produces=c.produces:i.produces&&(f.produces=i.produces),c.summary&&(f.summary=c.summary),c.notes&&(f.description=c.notes),c.nickname&&(f.operationId=c.nickname),c.deprecated&&(f.deprecated=c.deprecated),this.authorizations(h,i),this.parameters(f,c.parameters,i),this.responseMessages(f,c,i),o[p]=f}i.paths[e]=o}},a.prototype.responseMessages=function(e,t){if(i.isObject(t)){var n={};this.dataType(t,n),!n.schema&&n.type&&(n={schema:n}),e.responses=e.responses||{};var r=!1;if(Array.isArray(t.responseMessages)){var a,o=t.responseMessages;for(a=0;a<o.length;a++){var s=o[a],u={description:s.message};200===s.code&&(r=!0),s.responseModel&&(u.schema={$ref:"#/definitions/"+s.responseModel}),e.responses[""+s.code]=u}}r?e.responses["default"]=n:e.responses[200]=n}},a.prototype.authorizations=function(e){!i.isObject(e)},a.prototype.parameters=function(e,t){if(Array.isArray(t)){var n;for(n=0;n<t.length;n++){var r=t[n],i={};if(i.name=r.name,i.description=r.description,i.required=r.required,i["in"]=r.paramType,"body"===i["in"]&&(i.name="body"),"form"===i["in"]&&(i["in"]="formData"),r["enum"]&&(i["enum"]=r["enum"]),r.allowMultiple===!0||"true"===r.allowMultiple){var a={};if(this.dataType(r,a),i.type="array",i.items=a,r.allowableValues){var o=r.allowableValues;"LIST"===o.valueType&&(i["enum"]=o.values)}}else this.dataType(r,i);"undefined"!=typeof r.defaultValue&&(i["default"]=r.defaultValue),e.parameters=e.parameters||[],e.parameters.push(i)}}},a.prototype.dataType=function(e,t){if(i.isObject(e)){e.minimum&&(t.minimum=e.minimum),e.maximum&&(t.maximum=e.maximum),e.format&&(t.format=e.format),"undefined"!=typeof e.defaultValue&&(t["default"]=e.defaultValue);var n=this.toJsonSchema(e);n&&(t=t||{},n.type&&(t.type=n.type),n.format&&(t.format=n.format),n.$ref&&(t.schema={$ref:n.$ref}),n.items&&(t.items=n.items))}},a.prototype.toJsonSchema=function(e){if(!e)return"object";var t=e.type||e.dataType||e.responseClass||"",n=t.toLowerCase(),r=(e.format||"").toLowerCase();if(0===n.indexOf("list[")){var i=t.substring(5,t.length-1),a=this.toJsonSchema({type:i});return{type:"array",items:a}}if("int"===n||"integer"===n&&"int32"===r)return{type:"integer",format:"int32"};if("long"===n||"integer"===n&&"int64"===r)return{type:"integer",format:"int64"};if("integer"===n)return{type:"integer",format:"int64"};if("float"===n||"number"===n&&"float"===r)return{type:"number",format:"float"};if("double"===n||"number"===n&&"double"===r)return{type:"number",format:"double"};if("string"===n&&"date-time"===r||"date"===n)return{type:"string",format:"date-time"};if("string"===n)return{type:"string"};if("file"===n)return{type:"file"};if("boolean"===n)return{type:"boolean"};if("boolean"===n)return{type:"boolean"};if("array"===n||"list"===n){if(e.items){var o=this.toJsonSchema(e.items);return{type:"array",items:o}}return{type:"array",items:{type:"object"}}}return e.$ref?{$ref:this.modelMap[e.$ref]?"#/definitions/"+this.modelMap[e.$ref]:e.$ref}:"void"===n||""===n?{}:this.modelMap[e.type]?{$ref:"#/definitions/"+this.modelMap[e.type]}:{type:e.type}},a.prototype.resourceListing=function(e,t,n,i){var a,o=0,s=this,u=e.apis.length,l=t,c={};for(n&&n.requestInterceptor&&(c.requestInterceptor=n.requestInterceptor),n&&n.responseInterceptor&&(c.responseInterceptor=n.responseInterceptor),0===u&&this.finish(i,t),a=0;u>a;a++){var p=e.apis[a],f=p.path,h=this.getAbsolutePath(e.swaggerVersion,this.docLocation,f);p.description&&(t.tags=t.tags||[],t.tags.push({name:this.extractTag(p.path),description:p.description||""}));var d={url:h,headers:{accept:"application/json"},on:{},method:"get"};d.on.response=function(e){o+=1;var t=e.obj;t&&s.declaration(t,l),o===u&&s.finish(i,l)},d.on.error=function(e){console.error(e),o+=1,o===u&&s.finish(i,l)},this.clientAuthorizations&&"function"==typeof this.clientAuthorizations.apply&&this.clientAuthorizations.apply(d),(new r).execute(d,c)}},a.prototype.getAbsolutePath=function(e,t,n){if("1.0"===e&&t.endsWith(".json")){var r=t.lastIndexOf("/");r>0&&(t=t.substring(0,r))}var i=t;return 0===n.indexOf("http://")||0===n.indexOf("https://")?i=n:(t.endsWith("/")&&(i=t.substring(0,t.length-1)),i+=n),i=i.replace("{format}","json")},a.prototype.securityDefinitions=function(e,t){if(e.authorizations){var n;for(n in e.authorizations){var r=!1,i={},a=e.authorizations[n];if("apiKey"===a.type)i.type="apiKey",i["in"]=a.passAs,i.name=a.keyname||n,r=!0;else if("basicAuth"===a.type)i.type="basicAuth",r=!0;else if("oauth2"===a.type){var o,s=a.scopes||[],u={};for(o in s){var l=s[o];u[l.scope]=l.description}if(i.type="oauth2",o>0&&(i.scopes=u),a.grantTypes){if(a.grantTypes.implicit){var c=a.grantTypes.implicit;i.flow="implicit",i.authorizationUrl=c.loginEndpoint,r=!0}if(a.grantTypes.authorization_code&&!i.flow){var p=a.grantTypes.authorization_code;i.flow="accessCode",i.authorizationUrl=p.tokenRequestEndpoint.url,i.tokenUrl=p.tokenEndpoint.url,r=!0}}}r&&(t.securityDefinitions=t.securityDefinitions||{},t.securityDefinitions[n]=i)}}},a.prototype.apiInfo=function(e,t){if(e.info){var n=e.info;t.info={},n.contact&&(t.info.contact={},t.info.contact.email=n.contact),n.description&&(t.info.description=n.description),n.title&&(t.info.title=n.title),n.termsOfServiceUrl&&(t.info.termsOfService=n.termsOfServiceUrl),(n.license||n.licenseUrl)&&(t.license={},n.license&&(t.license.name=n.license),n.licenseUrl&&(t.license.url=n.licenseUrl))}else this.warnings.push("missing info section")},a.prototype.finish=function(e,t){e(t)}},{"./http":5,"lodash-compat/lang/isObject":148}],9:[function(e,t,n){"use strict";var r=(e("../helpers").log,{isPlainObject:e("lodash-compat/lang/isPlainObject"),isString:e("lodash-compat/lang/isString")}),i=e("../schema-markup.js"),a=e("js-yaml"),o=t.exports=function(e,t,n,r){return this.definition=t||{},this.isArray="array"===t.type,this.models=n||{},this.name=t.title||e||"Inline Model",this.modelPropertyMacro=r||function(e){return e["default"]},this};o.prototype.createJSONSample=o.prototype.getSampleValue=function(e){return e=e||{},e[this.name]=this,this.examples&&r.isPlainObject(this.examples)&&this.examples["application/json"]?(this.definition.example=this.examples["application/json"],r.isString(this.definition.example)&&(this.definition.example=a.safeLoad(this.definition.example))):this.definition.example||(this.definition.example=this.examples),i.schemaToJSON(this.definition,this.models,e,this.modelPropertyMacro)},o.prototype.getMockSignature=function(){return i.schemaToHTML(this.name,this.definition,this.models,this.modelPropertyMacro)}},{"../helpers":4,"../schema-markup.js":7,"js-yaml":20,"lodash-compat/lang/isPlainObject":149,"lodash-compat/lang/isString":150}],10:[function(e,t,n){"use strict";function r(e,t){if(i.isEmpty(t))return e[0];for(var n=0,r=t.length;r>n;n++)if(e.indexOf(t[n])>-1)return t[n];return e[0]}var i={cloneDeep:e("lodash-compat/lang/cloneDeep"),isUndefined:e("lodash-compat/lang/isUndefined"),isEmpty:e("lodash-compat/lang/isEmpty"),isObject:e("lodash-compat/lang/isObject")},a=e("../helpers"),o=e("./model"),s=e("../http"),u=e("q"),l=t.exports=function(e,t,n,r,i,a,s,u,l){var c=[];if(e=e||{},a=a||{},e&&e.options&&(this.client=e.options.client||null,this.requestInterceptor=e.options.requestInterceptor||null,this.responseInterceptor=e.options.responseInterceptor||null),this.authorizations=a.security,this.basePath=e.basePath||"/",this.clientAuthorizations=l,this.consumes=a.consumes||e.consumes||["application/json"],this.produces=a.produces||e.produces||["application/json"],this.deprecated=a.deprecated,this.description=a.description,this.host=e.host||"localhost",this.method=r||c.push("Operation "+n+" is missing method."),this.models=u||{},this.nickname=n||c.push("Operations must have a nickname."),this.operation=a,this.operations={},this.parameters=null!==a?a.parameters||[]:{},this.parent=e,this.path=i||c.push("Operation "+this.nickname+" is missing path."),this.responses=a.responses||{},this.scheme=t||e.scheme||"http",this.schemes=a.schemes||e.schemes,this.security=a.security,this.summary=a.summary||"",this.type=null,this.useJQuery=e.useJQuery,this.enableCookies=e.enableCookies,this.parameterMacro=e.parameterMacro||function(e,t){return t["default"]},this.inlineModels=[],"string"==typeof this.deprecated)switch(this.deprecated.toLowerCase()){case"true":case"yes":case"1":this.deprecated=!0;break;case"false":case"no":case"0":case null:this.deprecated=!1;break;default:this.deprecated=Boolean(this.deprecated)}var p,f;if(s){var h;for(h in s)f=new o(h,s[h],this.models,e.modelPropertyMacro),f&&(this.models[h]=f)}else s={};for(p=0;p<this.parameters.length;p++){var d=this.parameters[p];d["default"]=this.parameterMacro(this,d),"array"===d.type&&(d.isList=!0,d.allowMultiple=!0);var m=this.getType(d);if(m&&"boolean"===m.toString().toLowerCase()&&(d.allowableValues={},d.isList=!0,d["enum"]=[!0,!1]),"undefined"!=typeof d["x-example"]){var y=d["x-example"];d["default"]=y}if(d["x-examples"]){var y=d["x-examples"]["default"];"undefined"!=typeof y&&(d["default"]=y)}if("undefined"!=typeof d["enum"]){var g;for(d.allowableValues={},d.allowableValues.values=[],d.allowableValues.descriptiveValues=[],g=0;g<d["enum"].length;g++){var v=d["enum"][g],b=v===d["default"]||v+""===d["default"];d.allowableValues.values.push(v),d.allowableValues.descriptiveValues.push({value:v+"",isDefault:b})}}"array"===d.type&&(m=[m],"undefined"==typeof d.allowableValues&&(delete d.isList,delete d.allowMultiple)),d.modelSignature={type:m,definitions:this.models},d.signature=this.getModelSignature(m,this.models).toString(),d.sampleJSON=this.getModelSampleJSON(m,this.models),d.responseClassSignature=d.signature}var D,w,A=this.responses;if(A[200]?(w=A[200],D="200"):A[201]?(w=A[201],D="201"):A[202]?(w=A[202],D="202"):A[203]?(w=A[203],D="203"):A[204]?(w=A[204],D="204"):A[205]?(w=A[205],D="205"):A[206]?(w=A[206],D="206"):A["default"]&&(w=A["default"],D="default"),w&&w.schema){var x,C=this.resolveModel(w.schema,s);delete A[D],C?(this.successResponse={},x=this.successResponse[D]=C):w.schema.type&&"object"!==w.schema.type&&"array"!==w.schema.type?(this.successResponse={},x=this.successResponse[D]=w.schema):(this.successResponse={},x=this.successResponse[D]=new o(void 0,w.schema||{},this.models,e.modelPropertyMacro)),x&&(w.description&&(x.description=w.description),w.examples&&(x.examples=w.examples),w.headers&&(x.headers=w.headers)),this.type=w}return c.length>0&&this.resource&&this.resource.api&&this.resource.api.fail&&this.resource.api.fail(c),this};l.prototype.isDefaultArrayItemValue=function(e,t){return t["default"]&&Array.isArray(t["default"])?-1!==t["default"].indexOf(e):e===t["default"]},l.prototype.getType=function(e){var t,n=e.type,r=e.format,i=!1;"integer"===n&&"int32"===r?t="integer":"integer"===n&&"int64"===r?t="long":"integer"===n?t="integer":"string"===n?t="date-time"===r?"date-time":"date"===r?"date":"string":"number"===n&&"float"===r?t="float":"number"===n&&"double"===r?t="double":"number"===n?t="double":"boolean"===n?t="boolean":"array"===n?(i=!0,e.items&&(t=this.getType(e.items))):"file"===n&&(t="file"),e.$ref&&(t=a.simpleRef(e.$ref));var o=e.schema;if(o){var s=o.$ref;return s?(s=a.simpleRef(s),i?[s]:s):"object"===o.type?this.addInlineModel(o):this.getType(o)}return i?[t]:t},l.prototype.addInlineModel=function(e){var t=this.inlineModels.length,n=this.resolveModel(e,{});return n?(this.inlineModels.push(n),"Inline Model "+t):null},l.prototype.getInlineModel=function(e){if(/^Inline Model \d+$/.test(e)){var t=parseInt(e.substr("Inline Model".length).trim(),10),n=this.inlineModels[t];return n}return null},l.prototype.resolveModel=function(e,t){if("undefined"!=typeof e.$ref){var n=e.$ref;if(0===n.indexOf("#/definitions/")&&(n=n.substring("#/definitions/".length)),t[n])return new o(n,t[n],this.models,this.parent.modelPropertyMacro)}else if(e&&"object"==typeof e&&("object"===e.type||i.isUndefined(e.type)))return new o(void 0,e,this.models,this.parent.modelPropertyMacro);return null},l.prototype.help=function(e){for(var t=this.nickname+": "+this.summary+"\n",n=0;n<this.parameters.length;n++){var r=this.parameters[n],i=r.signature;t+="\n * "+r.name+" ("+i+"): "+r.description}return"undefined"==typeof e&&a.log(t),t},l.prototype.getModelSignature=function(e,t){var n,r;return e instanceof Array&&(r=!0,e=e[0]),"undefined"==typeof e?(e="undefined",n=!0):t[e]?(e=t[e],n=!1):this.getInlineModel(e)?(e=this.getInlineModel(e),n=!1):n=!0,n?r?"Array["+e+"]":e.toString():r?"Array["+e.getMockSignature()+"]":e.getMockSignature()},l.prototype.supportHeaderParams=function(){return!0},l.prototype.supportedSubmitMethods=function(){return this.parent.supportedSubmitMethods},l.prototype.getHeaderParams=function(e){for(var t=this.setContentTypes(e,{}),n=0;n<this.parameters.length;n++){var r=this.parameters[n];if("undefined"!=typeof e[r.name]&&"header"===r["in"]){var i=e[r.name];Array.isArray(i)&&(i=i.toString()),t[r.name]=i}}return t},l.prototype.urlify=function(e){for(var t={},n=this.path,r="",i=0;i<this.parameters.length;i++){var a=this.parameters[i];if("undefined"!=typeof e[a.name])if("path"===a["in"]){var o=new RegExp("{"+a.name+"}","gi"),s=e[a.name];s=Array.isArray(s)?this.encodePathCollection(a.collectionFormat,a.name,s):this.encodePathParam(s),n=n.replace(o,s)}else if("query"===a["in"]&&"undefined"!=typeof e[a.name])if(r+=""===r?"?":"&","undefined"!=typeof a.collectionFormat){var u=e[a.name];r+=Array.isArray(u)?this.encodeQueryCollection(a.collectionFormat,a.name,u):this.encodeQueryParam(a.name)+"="+this.encodeQueryParam(e[a.name])}else r+=this.encodeQueryParam(a.name)+"="+this.encodeQueryParam(e[a.name]);else"formData"===a["in"]&&(t[a.name]=e[a.name])}var l=this.scheme+"://"+this.host;return"/"!==this.basePath&&(l+=this.basePath),l+n+r},l.prototype.getMissingParams=function(e){var t,n=[];for(t=0;t<this.parameters.length;t++){var r=this.parameters[t];r.required===!0&&"undefined"==typeof e[r.name]&&(n=r.name)}return n},l.prototype.getBody=function(e,t,n){for(var r,i,a,o,s={},u=!1,l=0;l<this.parameters.length;l++){var c=this.parameters[l];"undefined"!=typeof t[c.name]?"body"===c["in"]?i=t[c.name]:"formData"===c["in"]&&(s[c.name]=t[c.name],r=!0):"body"===c["in"]&&(u=!0)}if(u&&"undefined"==typeof i){var p=e["Content-Type"];p&&0===p.indexOf("application/json")&&(i="{}")}var f=!1;if(e["Content-Type"]&&e["Content-Type"].indexOf("multipart/form-data")>=0&&(f=!0),r&&!f){var h="";for(a in s)o=s[a],"undefined"!=typeof o&&(""!==h&&(h+="&"),h+=encodeURIComponent(a)+"="+encodeURIComponent(o));i=h}else if(f&&n.useJQuery){var d=new FormData;d.type="formData";for(a in s)o=t[a],"undefined"!=typeof o&&("file"===o.type&&o.value?(delete e["Content-Type"],d.append(a,o.value)):d.append(a,o));i=d}return i},l.prototype.getModelSampleJSON=function(e,t){var n,r,a;if(t=t||{},n=e instanceof Array,a=n?e[0]:e,t[a]?r=t[a].createJSONSample():this.getInlineModel(a)&&(r=this.getInlineModel(a).createJSONSample()),r){if(r=n?[r]:r,"string"==typeof r)return r;if(i.isObject(r)){var o=r;if(r instanceof Array&&r.length>0&&(o=r[0]),o.nodeName&&"Node"==typeof o){var s=(new XMLSerializer).serializeToString(o);return this.formatXml(s)}return JSON.stringify(r,null,2)}return r}},l.prototype["do"]=function(e,t,n,r,i){return this.execute(e,t,n,r,i)},l.prototype.execute=function(e,t,n,r,o){var l,c,p,f=e||{},h={};i.isObject(t)&&(h=t,l=n,c=r),this.client&&(h.client=this.client),!h.requestInterceptor&&this.requestInterceptor&&(h.requestInterceptor=this.requestInterceptor),!h.responseInterceptor&&this.responseInterceptor&&(h.responseInterceptor=this.responseInterceptor),"function"==typeof t&&(l=t,c=n),this.parent.usePromise?p=u.defer():(l=l||this.parent.defaultSuccessCallback||a.log,c=c||this.parent.defaultErrorCallback||a.log),"undefined"==typeof h.useJQuery&&(h.useJQuery=this.useJQuery),"undefined"==typeof h.enableCookies&&(h.enableCookies=this.enableCookies);
+var d=this.getMissingParams(f);if(d.length>0){var m="missing required params: "+d;return a.fail(m),this.parent.usePromise?(p.reject(m),p.promise):(c(m,o),{})}var y,g=this.getHeaderParams(f),v=this.setContentTypes(f,h),b={};for(y in g)b[y]=g[y];for(y in v)b[y]=v[y];var D=this.getBody(v,f,h),w=this.urlify(f);if(w.indexOf(".{format}")>0&&b){var A=b.Accept||b.accept;A&&A.indexOf("json")>0?w=w.replace(".{format}",".json"):A&&A.indexOf("xml")>0&&(w=w.replace(".{format}",".xml"))}var x={url:w,method:this.method.toUpperCase(),body:D,enableCookies:h.enableCookies,useJQuery:h.useJQuery,deferred:p,headers:b,on:{response:function(e){return p?(p.resolve(e),p.promise):l(e,o)},error:function(e){return p?(p.reject(e),p.promise):c(e,o)}}};return this.clientAuthorizations.apply(x,this.operation.security),h.mock===!0?x:(new s).execute(x,h)},l.prototype.setContentTypes=function(e,t){var n,i,o=this.parameters,s=e.parameterContentType||r(this.consumes,["application/json","application/yaml"]),u=t.responseContentType||r(this.produces,["application/json","application/yaml"]),l=[],c=[],p={};for(i=0;i<o.length;i++){var f=o[i];if("formData"===f["in"])"file"===f.type?l.push(f):c.push(f);else if("header"===f["in"]&&t){var h=f.name,d=t[f.name];"undefined"!=typeof t[f.name]&&(p[h]=d)}else"body"===f["in"]&&"undefined"!=typeof e[f.name]&&(n=e[f.name])}return"post"===this.method||"put"===this.method||"patch"===this.method||("delete"===this.method||"get"===this.method)&&n?(t.requestContentType&&(s=t.requestContentType),c.length>0&&(s=t.requestContentType?t.requestContentType:l.length>0?"multipart/form-data":"application/x-www-form-urlencoded")):s=null,s&&this.consumes&&-1===this.consumes.indexOf(s)&&a.log("server doesn't consume "+s+", try "+JSON.stringify(this.consumes)),this.matchesAccept(u)||a.log("server can't produce "+u),(s&&""!==n||"application/x-www-form-urlencoded"===s)&&(p["Content-Type"]=s),u&&(p.Accept=u),p},l.prototype.matchesAccept=function(e){return e&&this.produces?-1!==this.produces.indexOf(e)||-1!==this.produces.indexOf("*/*"):!0},l.prototype.asCurl=function(e,t){var n={mock:!0};if("object"==typeof t)for(var r in t)n[r]=t[r];var a=this.execute(e,n);this.clientAuthorizations.apply(a,this.operation.security);var o=[];if(o.push("-X "+this.method.toUpperCase()),"undefined"!=typeof a.headers){var s;for(s in a.headers){var u=a.headers[s];"string"==typeof u&&(u=u.replace(/\'/g,"\\u0027")),o.push("--header '"+s+": "+u+"'")}}if(a.body){var l;l=i.isObject(a.body)?JSON.stringify(a.body):a.body,o.push("-d '"+l.replace(/\'/g,"\\u0027")+"'")}return"curl "+o.join(" ")+" '"+a.url+"'"},l.prototype.encodePathCollection=function(e,t,n){var r,i="",a="";for(a="ssv"===e?"%20":"tsv"===e?"\\t":"pipes"===e?"|":",",r=0;r<n.length;r++)0===r?i=this.encodeQueryParam(n[r]):i+=a+this.encodeQueryParam(n[r]);return i},l.prototype.encodeQueryCollection=function(e,t,n){var r,i="";if("default"===e||"multi"===e)for(r=0;r<n.length;r++)r>0&&(i+="&"),i+=this.encodeQueryParam(t)+"="+this.encodeQueryParam(n[r]);else{var a="";if("csv"===e)a=",";else if("ssv"===e)a="%20";else if("tsv"===e)a="\\t";else if("pipes"===e)a="|";else if("brackets"===e)for(r=0;r<n.length;r++)0!==r&&(i+="&"),i+=this.encodeQueryParam(t)+"[]="+this.encodeQueryParam(n[r]);if(""!==a)for(r=0;r<n.length;r++)0===r?i=this.encodeQueryParam(t)+"="+this.encodeQueryParam(n[r]):i+=a+this.encodeQueryParam(n[r])}return i},l.prototype.encodeQueryParam=function(e){return encodeURIComponent(e)},l.prototype.encodePathParam=function(e){return encodeURIComponent(e)}},{"../helpers":4,"../http":5,"./model":9,"lodash-compat/lang/cloneDeep":142,"lodash-compat/lang/isEmpty":145,"lodash-compat/lang/isObject":148,"lodash-compat/lang/isUndefined":152,q:161}],11:[function(e,t,n){"use strict";var r=t.exports=function(e,t,n,r){this.description=t,this.externalDocs=n,this.name=e,this.operation=r,this.operationsArray=[],this.path=e,this.tag=e};r.prototype.sort=function(){}},{}],12:[function(e,t,n){},{}],13:[function(e,t,n){function r(){if(!s){s=!0;for(var e,t=o.length;t;){e=o,o=[];for(var n=-1;++n<t;)e[n]();t=o.length}s=!1}}function i(){}var a=t.exports={},o=[],s=!1;a.nextTick=function(e){o.push(e),s||setTimeout(r,0)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=i,a.addListener=i,a.once=i,a.off=i,a.removeListener=i,a.removeAllListeners=i,a.emit=i,a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],14:[function(e,t,n){(function(e){!function(){"use strict";function n(t){var n;return n=t instanceof e?t:new e(t.toString(),"binary"),n.toString("base64")}t.exports=n}()}).call(this,e("buffer").Buffer)},{buffer:15}],15:[function(e,t,n){function r(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e){return this instanceof i?(this.length=0,this.parent=void 0,"number"==typeof e?a(this,e):"string"==typeof e?o(this,e,arguments.length>1?arguments[1]:"utf8"):s(this,e)):arguments.length>1?new i(e,arguments[1]):new i(e)}function a(e,t){if(e=d(e,0>t?0:0|m(t)),!i.TYPED_ARRAY_SUPPORT)for(var n=0;t>n;n++)e[n]=0;return e}function o(e,t,n){("string"!=typeof n||""===n)&&(n="utf8");var r=0|g(t,n);return e=d(e,r),e.write(t,n),e}function s(e,t){if(i.isBuffer(t))return u(e,t);if(K(t))return l(e,t);if(null==t)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(t.buffer instanceof ArrayBuffer)return c(e,t);if(t instanceof ArrayBuffer)return p(e,t)}return t.length?f(e,t):h(e,t)}function u(e,t){var n=0|m(t.length);return e=d(e,n),t.copy(e,0,0,n),e}function l(e,t){var n=0|m(t.length);e=d(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function c(e,t){var n=0|m(t.length);e=d(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function p(e,t){return i.TYPED_ARRAY_SUPPORT?(t.byteLength,e=i._augment(new Uint8Array(t))):e=c(e,new Uint8Array(t)),e}function f(e,t){var n=0|m(t.length);e=d(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function h(e,t){var n,r=0;"Buffer"===t.type&&K(t.data)&&(n=t.data,r=0|m(n.length)),e=d(e,r);for(var i=0;r>i;i+=1)e[i]=255&n[i];return e}function d(e,t){i.TYPED_ARRAY_SUPPORT?e=i._augment(new Uint8Array(t)):(e.length=t,e._isBuffer=!0);var n=0!==t&&t<=i.poolSize>>>1;return n&&(e.parent=Q),e}function m(e){if(e>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function y(e,t){if(!(this instanceof y))return new y(e,t);var n=new i(e,t);return delete n.parent,n}function g(e,t){"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if(t=0|t,n=void 0===n||n===1/0?this.length:0|n,e||(e="utf8"),0>t&&(t=0),n>this.length&&(n=this.length),t>=n)return"";for(;;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return F(this,t,n);case"ascii":return O(this,t,n);case"binary":return j(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function b(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;r>o;o++){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))throw new Error("Invalid hex string");e[n+o]=s}return o}function D(e,t,n,r){return Y(q(t,e.length-n),e,n,r)}function w(e,t,n,r){return Y(H(t),e,n,r)}function A(e,t,n,r){return w(e,t,n,r)}function x(e,t,n,r){return Y(z(t),e,n,r)}function C(e,t,n,r){return Y(V(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?J.fromByteArray(e):J.fromByteArray(e.slice(t,n))}function F(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;n>i;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(n>=i+s){var u,l,c,p;switch(s){case 1:128>a&&(o=a);break;case 2:u=e[i+1],128===(192&u)&&(p=(31&a)<<6|63&u,p>127&&(o=p));break;case 3:u=e[i+1],l=e[i+2],128===(192&u)&&128===(192&l)&&(p=(15&a)<<12|(63&u)<<6|63&l,p>2047&&(55296>p||p>57343)&&(o=p));break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128===(192&u)&&128===(192&l)&&128===(192&c)&&(p=(15&a)<<18|(63&u)<<12|(63&l)<<6|63&c,p>65535&&1114112>p&&(o=p))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return S(r)}function S(e){var t=e.length;if(X>=t)return String.fromCharCode.apply(String,e);for(var n="",r=0;t>r;)n+=String.fromCharCode.apply(String,e.slice(r,r+=X));return n}function O(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(127&e[i]);return r}function j(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(e[i]);return r}function k(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var i="",a=t;n>a;a++)i+=N(e[a]);return i}function I(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function B(e,t,n){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function _(e,t,n,r,a,o){if(!i.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>a||o>t)throw new RangeError("value is out of bounds");if(n+r>e.length)throw new RangeError("index out of range")}function T(e,t,n,r){0>t&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);a>i;i++)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function P(e,t,n,r){0>t&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);a>i;i++)e[n+i]=t>>>8*(r?i:3-i)&255}function L(e,t,n,r,i,a){if(t>i||a>t)throw new RangeError("value is out of bounds");if(n+r>e.length)throw new RangeError("index out of range");if(0>n)throw new RangeError("index out of range")}function $(e,t,n,r,i){return i||L(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),W.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,i){return i||L(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),W.write(e,t,n,r,52,8),n+8}function U(e){if(e=R(e).replace(Z,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function R(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function N(e){return 16>e?"0"+e.toString(16):e.toString(16)}function q(e,t){t=t||1/0;for(var n,r=e.length,i=null,a=[],o=0;r>o;o++){if(n=e.charCodeAt(o),n>55295&&57344>n){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(56320>n){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=i-55296<<10|n-56320|65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,128>n){if((t-=1)<0)break;a.push(n)}else if(2048>n){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(65536>n){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(1114112>n))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function H(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function V(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);o++)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function z(e){return J.toByteArray(U(e))}function Y(e,t,n,r){for(var i=0;r>i&&!(i+n>=t.length||i>=e.length);i++)t[i+n]=e[i];return i}var J=e("base64-js"),W=e("ieee754"),K=e("is-array");n.Buffer=i,n.SlowBuffer=y,n.INSPECT_MAX_BYTES=50,i.poolSize=8192;var Q={};i.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new Uint8Array(1);return t.foo=function(){return 42},t.constructor=e,42===t.foo()&&t.constructor===e&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(n){return!1}}(),i.isBuffer=function(e){return!(null==e||!e._isBuffer)},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,a=0,o=Math.min(n,r);o>a&&e[a]===t[a];)++a;return a!==o&&(n=e[a],r=t[a]),r>n?-1:n>r?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,t){if(!K(e))throw new TypeError("list argument must be an Array of Buffers.");if(0===e.length)return new i(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;n++)t+=e[n].length;var r=new i(t),a=0;for(n=0;n<e.length;n++){var o=e[n];o.copy(r,a),a+=o.length}return r},i.byteLength=g,i.prototype.length=void 0,i.prototype.parent=void 0,i.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?F(this,0,e):v.apply(this,arguments)},i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===i.compare(this,e)},i.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},i.prototype.compare=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?0:i.compare(this,e)},i.prototype.indexOf=function(e,t){function n(e,t,n){for(var r=-1,i=0;n+i<e.length;i++)if(e[n+i]===t[-1===r?0:i-r]){if(-1===r&&(r=i),i-r+1===t.length)return n+r}else r=-1;return-1}if(t>2147483647?t=2147483647:-2147483648>t&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(0>t&&(t=Math.max(this.length+t,0)),"string"==typeof e)return 0===e.length?-1:String.prototype.indexOf.call(this,e,t);if(i.isBuffer(e))return n(this,e,t);if("number"==typeof e)return i.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):n(this,[e],t);throw new TypeError("val must be string, number or Buffer")},i.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},i.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},i.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else if(isFinite(t))t=0|t,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0);else{var i=r;r=t,t=0|n,n=i}var a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(0>n||0>t)||t>this.length)throw new RangeError("attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return D(this,e,t,n);case"ascii":return w(this,e,t,n);case"binary":return A(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var X=4096;i.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),e>t&&(t=e);var r;if(i.TYPED_ARRAY_SUPPORT)r=i._augment(this.subarray(e,t));else{var a=t-e;r=new i(a,void 0);for(var o=0;a>o;o++)r[o]=this[o+e]}return r.length&&(r.parent=this.parent||this),r},i.prototype.readUIntLE=function(e,t,n){e=0|e,t=0|t,n||B(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},i.prototype.readUIntBE=function(e,t,n){e=0|e,t=0|t,n||B(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},i.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||B(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},i.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||B(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},i.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),W.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),W.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),W.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),W.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,n,r){e=+e,t=0|t,n=0|n,r||_(this,e,t,n,Math.pow(2,8*n),0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},i.prototype.writeUIntBE=function(e,t,n,r){e=+e,t=0|t,n=0|n,r||_(this,e,t,n,Math.pow(2,8*n),0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},i.prototype.writeUInt8=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,1,255,0),i.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e,t+1},i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e):T(this,e,t,!1),t+2},i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e):P(this,e,t,!0),t+4},i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e):P(this,e,t,!1),t+4},i.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);_(this,e,t,n,i-1,-i)}var a=0,o=1,s=0>e?1:0;for(this[t]=255&e;++a<n&&(o*=256);)this[t+a]=(e/o>>0)-s&255;return t+n},i.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);_(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0>e?1:0;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=(e/o>>0)-s&255;return t+n},i.prototype.writeInt8=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,1,127,-128),i.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=e,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e):T(this,e,t,!1),t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e):P(this,e,t,!1),t+4},i.prototype.writeFloatLE=function(e,t,n){return $(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return $(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&n>r&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var a,o=r-n;if(this===e&&t>n&&r>t)for(a=o-1;a>=0;a--)e[a+t]=this[a+n];else if(1e3>o||!i.TYPED_ARRAY_SUPPORT)for(a=0;o>a;a++)e[a+t]=this[a+n];else e._set(this.subarray(n,n+o),t);return o},i.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),t>n)throw new RangeError("end < start");if(n!==t&&0!==this.length){if(0>t||t>=this.length)throw new RangeError("start out of bounds");if(0>n||n>this.length)throw new RangeError("end out of bounds");var r;if("number"==typeof e)for(r=t;n>r;r++)this[r]=e;else{var i=q(e.toString()),a=i.length;for(r=t;n>r;r++)this[r]=i[r%a]}return this}},i.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(i.TYPED_ARRAY_SUPPORT)return new i(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;n>t;t+=1)e[t]=this[t];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var G=i.prototype;i._augment=function(e){return e.constructor=i,e._isBuffer=!0,e._set=e.set,e.get=G.get,e.set=G.set,e.write=G.write,e.toString=G.toString,e.toLocaleString=G.toString,e.toJSON=G.toJSON,e.equals=G.equals,e.compare=G.compare,e.indexOf=G.indexOf,e.copy=G.copy,e.slice=G.slice,e.readUIntLE=G.readUIntLE,e.readUIntBE=G.readUIntBE,e.readUInt8=G.readUInt8,e.readUInt16LE=G.readUInt16LE,e.readUInt16BE=G.readUInt16BE,e.readUInt32LE=G.readUInt32LE,e.readUInt32BE=G.readUInt32BE,e.readIntLE=G.readIntLE,e.readIntBE=G.readIntBE,e.readInt8=G.readInt8,e.readInt16LE=G.readInt16LE,e.readInt16BE=G.readInt16BE,e.readInt32LE=G.readInt32LE,e.readInt32BE=G.readInt32BE,e.readFloatLE=G.readFloatLE,e.readFloatBE=G.readFloatBE,e.readDoubleLE=G.readDoubleLE,e.readDoubleBE=G.readDoubleBE,e.writeUInt8=G.writeUInt8,e.writeUIntLE=G.writeUIntLE,e.writeUIntBE=G.writeUIntBE,e.writeUInt16LE=G.writeUInt16LE,e.writeUInt16BE=G.writeUInt16BE,e.writeUInt32LE=G.writeUInt32LE,e.writeUInt32BE=G.writeUInt32BE,e.writeIntLE=G.writeIntLE,e.writeIntBE=G.writeIntBE,e.writeInt8=G.writeInt8,e.writeInt16LE=G.writeInt16LE,e.writeInt16BE=G.writeInt16BE,e.writeInt32LE=G.writeInt32LE,e.writeInt32BE=G.writeInt32BE,e.writeFloatLE=G.writeFloatLE,e.writeFloatBE=G.writeFloatBE,e.writeDoubleLE=G.writeDoubleLE,e.writeDoubleBE=G.writeDoubleBE,e.fill=G.fill,e.inspect=G.inspect,e.toArrayBuffer=G.toArrayBuffer,e};var Z=/[^+\/0-9A-Za-z-_]/g},{"base64-js":16,ieee754:17,"is-array":18}],16:[function(e,t,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===o||t===p?62:t===s||t===f?63:u>t?-1:u+10>t?t-u+26+26:c+26>t?t-c:l+26>t?t-l+26:void 0}function n(e){function n(e){l[p++]=e}var r,i,o,s,u,l;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=e.length;u="="===e.charAt(c-2)?2:"="===e.charAt(c-1)?1:0,l=new a(3*e.length/4-u),o=u>0?e.length-4:e.length;var p=0;for(r=0,i=0;o>r;r+=4,i+=3)s=t(e.charAt(r))<<18|t(e.charAt(r+1))<<12|t(e.charAt(r+2))<<6|t(e.charAt(r+3)),n((16711680&s)>>16),n((65280&s)>>8),n(255&s);return 2===u?(s=t(e.charAt(r))<<2|t(e.charAt(r+1))>>4,n(255&s)):1===u&&(s=t(e.charAt(r))<<10|t(e.charAt(r+1))<<4|t(e.charAt(r+2))>>2,n(s>>8&255),n(255&s)),l}function i(e){function t(e){return r.charAt(e)}function n(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var i,a,o,s=e.length%3,u="";for(i=0,o=e.length-s;o>i;i+=3)a=(e[i]<<16)+(e[i+1]<<8)+e[i+2],u+=n(a);switch(s){case 1:a=e[e.length-1],u+=t(a>>2),u+=t(a<<4&63),u+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1],u+=t(a>>10),u+=t(a>>4&63),u+=t(a<<2&63),u+="="}return u}var a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),l="a".charCodeAt(0),c="A".charCodeAt(0),p="-".charCodeAt(0),f="_".charCodeAt(0);e.toByteArray=n,e.fromByteArray=i}("undefined"==typeof n?this.base64js={}:n)},{}],17:[function(e,t,n){n.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,p=n?i-1:0,f=n?-1:1,h=e[t+p];for(p+=f,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=256*a+e[t+p],p+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+p],p+=f,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:(h?-1:1)*(1/0);o+=Math.pow(2,r),a-=l}return(h?-1:1)*o*Math.pow(2,a-r)},n.write=function(e,t,n,r,i,a){var o,s,u,l=8*a-i-1,c=(1<<l)-1,p=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,d=r?1:-1,m=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),t+=o+p>=1?f/u:f*Math.pow(2,1-p),t*u>=2&&(o++,u/=2),o+p>=c?(s=0,o=c):o+p>=1?(s=(t*u-1)*Math.pow(2,i),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=d,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+h]=255&o,h+=d,o/=256,l-=8);e[n+h-d]|=128*m}},{}],18:[function(e,t,n){var r=Array.isArray,i=Object.prototype.toString;t.exports=r||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],19:[function(e,t,n){!function(){"use strict";function e(t,n,r,i){return this instanceof e?(this.domain=t||void 0,this.path=n||"/",this.secure=!!r,this.script=!!i,this):new e(t,n,r,i)}function t(e,n,r){return e instanceof t?e:this instanceof t?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(r||"/"),this.explicit_path=!1,this.domain=n||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,e&&this.parse(e,n,r),this):new t(e,n,r)}function r(){var e,n,i;return this instanceof r?(e=Object.create(null),this.setCookie=function(r,a,o){var s,u;if(r=new t(r,a,o),s=r.expiration_date<=Date.now(),void 0!==e[r.name]){for(n=e[r.name],u=0;u<n.length;u+=1)if(i=n[u],i.collidesWith(r))return s?(n.splice(u,1),0===n.length&&delete e[r.name],!1):(n[u]=r,r);return s?!1:(n.push(r),r)}return s?!1:(e[r.name]=[r],e[r.name])},this.getCookie=function(t,r){var i,a;if(n=e[t])for(a=0;a<n.length;a+=1)if(i=n[a],i.expiration_date<=Date.now())0===n.length&&delete e[i.name];else if(i.matches(r))return i},this.getCookies=function(t){var n,r,i=[];for(n in e)r=this.getCookie(n,t),r&&i.push(r);return i.toString=function(){return i.join(":")},i.toValueString=function(){return i.map(function(e){return e.toValueString()}).join(";")},i},this):new r}n.CookieAccessInfo=e,n.Cookie=t,t.prototype.toString=function(){var e=[this.name+"="+this.value];return this.expiration_date!==1/0&&e.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&e.push("domain="+this.domain),this.path&&e.push("path="+this.path),this.secure&&e.push("secure"),this.noscript&&e.push("httponly"),e.join("; ")},t.prototype.toValueString=function(){return this.name+"="+this.value};var i=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;t.prototype.parse=function(e,n,r){if(this instanceof t){var i,a=e.split(";").filter(function(e){return!!e}),o=a[0].match(/([^=]+)=([\s\S]*)/),s=o[1],u=o[2];for(this.name=s,this.value=u,i=1;i<a.length;i+=1)switch(o=a[i].match(/([^=]+)(?:=([\s\S]*))?/),s=o[1].trim().toLowerCase(),u=o[2],s){case"httponly":this.noscript=!0;break;case"expires":this.expiration_date=u?Number(Date.parse(u)):1/0;break;case"path":this.path=u?u.trim():"",this.explicit_path=!0;break;case"domain":this.domain=u?u.trim():"",this.explicit_domain=!!this.domain;break;case"secure":this.secure=!0}return this.explicit_path||(this.path=r||"/"),this.explicit_domain||(this.domain=n),this}return(new t).parse(e,n,r)},t.prototype.matches=function(e){return this.noscript&&e.script||this.secure&&!e.secure||!this.collidesWith(e)?!1:!0},t.prototype.collidesWith=function(e){if(this.path&&!e.path||this.domain&&!e.domain)return!1;if(this.path&&0!==e.path.indexOf(this.path))return!1;if(this.explicit_path&&0!==e.path.indexOf(this.path))return!1;var t=e.domain&&e.domain.replace(/^[\.]/,""),n=this.domain&&this.domain.replace(/^[\.]/,"");if(n===t)return!0;if(n){if(!this.explicit_domain)return!1;var r=t.indexOf(n);return-1===r||r!==t.length-n.length?!1:!0}return!0},n.CookieJar=r,r.prototype.setCookies=function(e,n,r){e=Array.isArray(e)?e:e.split(i);var a,o,s=[];for(e=e.map(function(e){return new t(e,n,r)}),a=0;a<e.length;a+=1)o=e[a],this.setCookie(o,n,r)&&s.push(o);return s}}()},{}],20:[function(e,t,n){"use strict";var r=e("./lib/js-yaml.js");t.exports=r},{"./lib/js-yaml.js":21}],21:[function(e,t,n){"use strict";function r(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}var i=e("./js-yaml/loader"),a=e("./js-yaml/dumper");t.exports.Type=e("./js-yaml/type"),t.exports.Schema=e("./js-yaml/schema"),t.exports.FAILSAFE_SCHEMA=e("./js-yaml/schema/failsafe"),t.exports.JSON_SCHEMA=e("./js-yaml/schema/json"),t.exports.CORE_SCHEMA=e("./js-yaml/schema/core"),t.exports.DEFAULT_SAFE_SCHEMA=e("./js-yaml/schema/default_safe"),t.exports.DEFAULT_FULL_SCHEMA=e("./js-yaml/schema/default_full"),t.exports.load=i.load,t.exports.loadAll=i.loadAll,t.exports.safeLoad=i.safeLoad,t.exports.safeLoadAll=i.safeLoadAll,t.exports.dump=a.dump,t.exports.safeDump=a.safeDump,t.exports.YAMLException=e("./js-yaml/exception"),t.exports.MINIMAL_SCHEMA=e("./js-yaml/schema/failsafe"),t.exports.SAFE_SCHEMA=e("./js-yaml/schema/default_safe"),t.exports.DEFAULT_SCHEMA=e("./js-yaml/schema/default_full"),t.exports.scan=r("scan"),t.exports.parse=r("parse"),t.exports.compose=r("compose"),t.exports.addConstructor=r("addConstructor")},{"./js-yaml/dumper":23,"./js-yaml/exception":24,"./js-yaml/loader":25,"./js-yaml/schema":27,"./js-yaml/schema/core":28,"./js-yaml/schema/default_full":29,"./js-yaml/schema/default_safe":30,"./js-yaml/schema/failsafe":31,"./js-yaml/schema/json":32,"./js-yaml/type":33}],22:[function(e,t,n){"use strict";function r(e){return"undefined"==typeof e||null===e}function i(e){return"object"==typeof e&&null!==e}function a(e){return Array.isArray(e)?e:r(e)?[]:[e]}function o(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;r>n;n+=1)i=a[n],e[i]=t[i];return e}function s(e,t){var n,r="";for(n=0;t>n;n+=1)r+=e;return r}function u(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}t.exports.isNothing=r,t.exports.isObject=i,t.exports.toArray=a,t.exports.repeat=s,t.exports.isNegativeZero=u,t.exports.extend=o},{}],23:[function(e,t,n){"use strict";function r(e,t){var n,r,i,a,o,s,u;if(null===t)return{};for(n={},r=Object.keys(t),i=0,a=r.length;a>i;i+=1)o=r[i],s=String(t[o]),"!!"===o.slice(0,2)&&(o="tag:yaml.org,2002:"+o.slice(2)),u=e.compiledTypeMap[o],u&&k.call(u.styleAliases,s)&&(s=u.styleAliases[s]),n[o]=s;return n}function i(e){var t,n,r;if(t=e.toString(16).toUpperCase(),255>=e)n="x",r=2;else if(65535>=e)n="u",r=4;else{if(!(4294967295>=e))throw new F("code point within a string may not be greater than 0xFFFFFFFF");n="U",r=8}return"\\"+n+E.repeat("0",r-t.length)+t}function a(e){this.schema=e.schema||S,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=E.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=r(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function o(e,t){for(var n,r=E.repeat(" ",t),i=0,a=-1,o="",s=e.length;s>i;)a=e.indexOf("\n",i),-1===a?(n=e.slice(i),i=s):(n=e.slice(i,a+1),i=a+1),n.length&&"\n"!==n&&(o+=r),o+=n;return o}function s(e,t){return"\n"+E.repeat(" ",e.indent*t)}function u(e,t){
+var n,r,i;for(n=0,r=e.implicitTypes.length;r>n;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function l(e){this.source=e,this.result="",this.checkpoint=0}function c(e,t,n,r){var i,a,s,c,f,m,y,g,v,b,D,w,A,x,C,E,F,S,O,j,k;if(0===t.length)return void(e.dump="''");if(-1!==te.indexOf(t))return void(e.dump="'"+t+"'");for(i=!0,a=t.length?t.charCodeAt(0):0,s=T===a||T===t.charCodeAt(t.length-1),(H===a||Y===a||J===a||Q===a)&&(i=!1),s?(i=!1,c=!1,f=!1):(c=!r,f=!r),m=!0,y=new l(t),g=!1,v=0,b=0,D=e.indent*n,w=e.lineWidth,-1===w&&(w=9007199254740991),40>D?w-=D:w=40,x=0;x<t.length;x++){if(A=t.charCodeAt(x),i){if(h(A))continue;i=!1}m&&A===R&&(m=!1),C=ee[A],E=d(A),(C||E)&&(A!==B&&A!==L&&A!==R?(c=!1,f=!1):A===B&&(g=!0,m=!1,x>0&&(F=t.charCodeAt(x-1),F===T&&(f=!1,c=!1)),c&&(S=x-v,v=x,S>b&&(b=S))),A!==L&&(m=!1),y.takeUpTo(x),y.escapeChar())}if(i&&u(e,t)&&(i=!1),O="",(c||f)&&(j=0,t.charCodeAt(t.length-1)===B&&(j+=1,t.charCodeAt(t.length-2)===B&&(j+=1)),0===j?O="-":2===j&&(O="+")),f&&w>b&&(c=!1),g||(f=!1),i)e.dump=t;else if(m)e.dump="'"+t+"'";else if(c)k=p(t,w),e.dump=">"+O+"\n"+o(k,D);else if(f)O||(t=t.replace(/\n$/,"")),e.dump="|"+O+"\n"+o(t,D);else{if(!y)throw new Error("Failed to dump scalar value");y.finish(),e.dump='"'+y.result+'"'}}function p(e,t){var n,r="",i=0,a=e.length,o=/\n+$/.exec(e);for(o&&(a=o.index+1);a>i;)n=e.indexOf("\n",i),n>a||-1===n?(r&&(r+="\n\n"),r+=f(e.slice(i,a),t),i=a):(r&&(r+="\n\n"),r+=f(e.slice(i,n),t),i=n+1);return o&&"\n"!==o[0]&&(r+=o[0]),r}function f(e,t){if(""===e)return e;for(var n,r,i,a=/[^\s] [^\s]/g,o="",s=0,u=0,l=a.exec(e);l;)n=l.index,n-u>t&&(r=s!==u?s:n,o&&(o+="\n"),i=e.slice(u,r),o+=i,u=r+1),s=n+1,l=a.exec(e);return o&&(o+="\n"),o+=u!==s&&e.length-u>t?e.slice(u,s)+"\n"+e.slice(s+1):e.slice(u)}function h(e){return I!==e&&B!==e&&_!==e&&q!==e&&W!==e&&K!==e&&X!==e&&Z!==e&&$!==e&&U!==e&&N!==e&&P!==e&&G!==e&&z!==e&&R!==e&&L!==e&&M!==e&&V!==e&&!ee[e]&&!d(e)}function d(e){return!(e>=32&&126>=e||133===e||e>=160&&55295>=e||e>=57344&&65533>=e||e>=65536&&1114111>=e)}function m(e,t,n){var r,i,a="",o=e.tag;for(r=0,i=n.length;i>r;r+=1)D(e,t,n[r],!1,!1)&&(0!==r&&(a+=", "),a+=e.dump);e.tag=o,e.dump="["+a+"]"}function y(e,t,n,r){var i,a,o="",u=e.tag;for(i=0,a=n.length;a>i;i+=1)D(e,t+1,n[i],!0,!0)&&(r&&0===i||(o+=s(e,t)),o+="- "+e.dump);e.tag=u,e.dump=o||"[]"}function g(e,t,n){var r,i,a,o,s,u="",l=e.tag,c=Object.keys(n);for(r=0,i=c.length;i>r;r+=1)s="",0!==r&&(s+=", "),a=c[r],o=n[a],D(e,t,a,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+": ",D(e,t,o,!1,!1)&&(s+=e.dump,u+=s));e.tag=l,e.dump="{"+u+"}"}function v(e,t,n,r){var i,a,o,u,l,c,p="",f=e.tag,h=Object.keys(n);if(e.sortKeys===!0)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new F("sortKeys must be a boolean or a function");for(i=0,a=h.length;a>i;i+=1)c="",r&&0===i||(c+=s(e,t)),o=h[i],u=n[o],D(e,t+1,o,!0,!0,!0)&&(l=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,l&&(c+=e.dump&&B===e.dump.charCodeAt(0)?"?":"? "),c+=e.dump,l&&(c+=s(e,t)),D(e,t+1,u,!0,l)&&(c+=e.dump&&B===e.dump.charCodeAt(0)?":":": ",c+=e.dump,p+=c));e.tag=f,e.dump=p||"{}"}function b(e,t,n){var r,i,a,o,s,u;for(i=n?e.explicitTypes:e.implicitTypes,a=0,o=i.length;o>a;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(u=e.styleMap[s.tag]||s.defaultStyle,"[object Function]"===j.call(s.represent))r=s.represent(t,u);else{if(!k.call(s.represent,u))throw new F("!<"+s.tag+'> tag resolver accepts not "'+u+'" style');r=s.represent[u](t,u)}e.dump=r}return!0}return!1}function D(e,t,n,r,i,a){e.tag=null,e.dump=n,b(e,n,!1)||b(e,n,!0);var o=j.call(e.dump);r&&(r=0>e.flowLevel||e.flowLevel>t);var s,u,l="[object Object]"===o||"[object Array]"===o;if(l&&(s=e.duplicates.indexOf(n),u=-1!==s),(null!==e.tag&&"?"!==e.tag||u||2!==e.indent&&t>0)&&(i=!1),u&&e.usedDuplicates[s])e.dump="*ref_"+s;else{if(l&&u&&!e.usedDuplicates[s]&&(e.usedDuplicates[s]=!0),"[object Object]"===o)r&&0!==Object.keys(e.dump).length?(v(e,t,e.dump,i),u&&(e.dump="&ref_"+s+e.dump)):(g(e,t,e.dump),u&&(e.dump="&ref_"+s+" "+e.dump));else if("[object Array]"===o)r&&0!==e.dump.length?(y(e,t,e.dump,i),u&&(e.dump="&ref_"+s+e.dump)):(m(e,t,e.dump),u&&(e.dump="&ref_"+s+" "+e.dump));else{if("[object String]"!==o){if(e.skipInvalid)return!1;throw new F("unacceptable kind of an object to dump "+o)}"?"!==e.tag&&c(e,e.dump,t,a)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function w(e,t){var n,r,i=[],a=[];for(A(e,i,a),n=0,r=a.length;r>n;n+=1)t.duplicates.push(i[a[n]]);t.usedDuplicates=new Array(r)}function A(e,t,n){var r,i,a;if(null!==e&&"object"==typeof e)if(i=t.indexOf(e),-1!==i)-1===n.indexOf(i)&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;a>i;i+=1)A(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;a>i;i+=1)A(e[r[i]],t,n)}function x(e,t){t=t||{};var n=new a(t);return w(e,n),D(n,0,e,!0,!0)?n.dump+"\n":""}function C(e,t){return x(e,E.extend({schema:O},t))}var E=e("./common"),F=e("./exception"),S=e("./schema/default_full"),O=e("./schema/default_safe"),j=Object.prototype.toString,k=Object.prototype.hasOwnProperty,I=9,B=10,_=13,T=32,P=33,L=34,$=35,M=37,U=38,R=39,N=42,q=44,H=45,V=58,z=62,Y=63,J=64,W=91,K=93,Q=96,X=123,G=124,Z=125,ee={};ee[0]="\\0",ee[7]="\\a",ee[8]="\\b",ee[9]="\\t",ee[10]="\\n",ee[11]="\\v",ee[12]="\\f",ee[13]="\\r",ee[27]="\\e",ee[34]='\\"',ee[92]="\\\\",ee[133]="\\N",ee[160]="\\_",ee[8232]="\\L",ee[8233]="\\P";var te=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];l.prototype.takeUpTo=function(e){var t;if(e<this.checkpoint)throw t=new Error("position should be > checkpoint"),t.position=e,t.checkpoint=this.checkpoint,t;return this.result+=this.source.slice(this.checkpoint,e),this.checkpoint=e,this},l.prototype.escapeChar=function(){var e,t;return e=this.source.charCodeAt(this.checkpoint),t=ee[e]||i(e),this.result+=t,this.checkpoint+=1,this},l.prototype.finish=function(){this.source.length>this.checkpoint&&this.takeUpTo(this.source.length)},t.exports.dump=x,t.exports.safeDump=C},{"./common":22,"./exception":24,"./schema/default_full":29,"./schema/default_safe":30}],24:[function(e,t,n){"use strict";function r(e,t){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():"")}var i=e("inherit");i(r,Error),r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},t.exports=r},{inherit:51}],25:[function(e,t,n){"use strict";function r(e){return 10===e||13===e}function i(e){return 9===e||32===e}function a(e){return 9===e||32===e||10===e||13===e}function o(e){return 44===e||91===e||93===e||123===e||125===e}function s(e){var t;return e>=48&&57>=e?e-48:(t=32|e,t>=97&&102>=t?t-97+10:-1)}function u(e){return 120===e?2:117===e?4:85===e?8:0}function l(e){return e>=48&&57>=e?e-48:-1}function c(e){return 48===e?"\x00":97===e?"":98===e?"\b":116===e?" ":9===e?" ":110===e?"\n":118===e?" ":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function p(e){return 65535>=e?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function f(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||V,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function h(e,t){return new N(t,new q(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function d(e,t){throw h(e,t)}function m(e,t){e.onWarning&&e.onWarning.call(null,h(e,t))}function y(e,t,n,r){var i,a,o,s;if(n>t){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;a>i;i+=1)o=s.charCodeAt(i),9===o||o>=32&&1114111>=o||d(e,"expected valid JSON character");else Z.test(s)&&d(e,"the stream contains non-printable characters");e.result+=s}}function g(e,t,n){var r,i,a,o;for(R.isObject(n)||d(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),a=0,o=r.length;o>a;a+=1)i=r[a],z.call(t,i)||(t[i]=n[i])}function v(e,t,n,r,i){var a,o;if(r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(i))for(a=0,o=i.length;o>a;a+=1)g(e,t,i[a]);else g(e,t,i);else t[r]=i;return t}function b(e){var t;t=e.input.charCodeAt(e.position),10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):d(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function D(e,t,n){for(var a=0,o=e.input.charCodeAt(e.position);0!==o;){for(;i(o);)o=e.input.charCodeAt(++e.position);if(t&&35===o)do o=e.input.charCodeAt(++e.position);while(10!==o&&13!==o&&0!==o);if(!r(o))break;for(b(e),o=e.input.charCodeAt(e.position),a++,e.lineIndent=0;32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position)}return-1!==n&&0!==a&&e.lineIndent<n&&m(e,"deficient indentation"),a}function w(e){var t,n=e.position;return t=e.input.charCodeAt(n),45!==t&&46!==t||e.input.charCodeAt(n+1)!==t||e.input.charCodeAt(n+2)!==t||(n+=3,t=e.input.charCodeAt(n),0!==t&&!a(t))?!1:!0}function A(e,t){1===t?e.result+=" ":t>1&&(e.result+=R.repeat("\n",t-1))}function x(e,t,n){var s,u,l,c,p,f,h,d,m,g=e.kind,v=e.result;if(m=e.input.charCodeAt(e.position),a(m)||o(m)||35===m||38===m||42===m||33===m||124===m||62===m||39===m||34===m||37===m||64===m||96===m)return!1;if((63===m||45===m)&&(u=e.input.charCodeAt(e.position+1),a(u)||n&&o(u)))return!1;for(e.kind="scalar",e.result="",l=c=e.position,p=!1;0!==m;){if(58===m){if(u=e.input.charCodeAt(e.position+1),a(u)||n&&o(u))break}else if(35===m){if(s=e.input.charCodeAt(e.position-1),a(s))break}else{if(e.position===e.lineStart&&w(e)||n&&o(m))break;if(r(m)){if(f=e.line,h=e.lineStart,d=e.lineIndent,D(e,!1,-1),e.lineIndent>=t){p=!0,m=e.input.charCodeAt(e.position);continue}e.position=c,e.line=f,e.lineStart=h,e.lineIndent=d;break}}p&&(y(e,l,c,!1),A(e,e.line-f),l=c=e.position,p=!1),i(m)||(c=e.position+1),m=e.input.charCodeAt(++e.position)}return y(e,l,c,!1),e.result?!0:(e.kind=g,e.result=v,!1)}function C(e,t){var n,i,a;if(n=e.input.charCodeAt(e.position),39!==n)return!1;for(e.kind="scalar",e.result="",e.position++,i=a=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(y(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),39!==n)return!0;i=a=e.position,e.position++}else r(n)?(y(e,i,a,!0),A(e,D(e,!1,t)),i=a=e.position):e.position===e.lineStart&&w(e)?d(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);d(e,"unexpected end of the stream within a single quoted scalar")}function E(e,t){var n,i,a,o,l,c;if(c=e.input.charCodeAt(e.position),34!==c)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(c=e.input.charCodeAt(e.position));){if(34===c)return y(e,n,e.position,!0),e.position++,!0;if(92===c){if(y(e,n,e.position,!0),c=e.input.charCodeAt(++e.position),r(c))D(e,!1,t);else if(256>c&&ie[c])e.result+=ae[c],e.position++;else if((l=u(c))>0){for(a=l,o=0;a>0;a--)c=e.input.charCodeAt(++e.position),(l=s(c))>=0?o=(o<<4)+l:d(e,"expected hexadecimal character");e.result+=p(o),e.position++}else d(e,"unknown escape sequence");n=i=e.position}else r(c)?(y(e,n,i,!0),A(e,D(e,!1,t)),n=i=e.position):e.position===e.lineStart&&w(e)?d(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}d(e,"unexpected end of the stream within a double quoted scalar")}function F(e,t){var n,r,i,o,s,u,l,c,p,f,h,m=!0,y=e.tag,g=e.anchor;if(h=e.input.charCodeAt(e.position),91===h)o=93,l=!1,r=[];else{if(123!==h)return!1;o=125,l=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),h=e.input.charCodeAt(++e.position);0!==h;){if(D(e,!0,t),h=e.input.charCodeAt(e.position),h===o)return e.position++,e.tag=y,e.anchor=g,e.kind=l?"mapping":"sequence",e.result=r,!0;m||d(e,"missed comma between flow collection entries"),p=c=f=null,s=u=!1,63===h&&(i=e.input.charCodeAt(e.position+1),a(i)&&(s=u=!0,e.position++,D(e,!0,t))),n=e.line,_(e,t,Y,!1,!0),p=e.tag,c=e.result,D(e,!0,t),h=e.input.charCodeAt(e.position),!u&&e.line!==n||58!==h||(s=!0,h=e.input.charCodeAt(++e.position),D(e,!0,t),_(e,t,Y,!1,!0),f=e.result),l?v(e,r,p,c,f):s?r.push(v(e,null,p,c,f)):r.push(c),D(e,!0,t),h=e.input.charCodeAt(e.position),44===h?(m=!0,h=e.input.charCodeAt(++e.position)):m=!1}d(e,"unexpected end of the stream within a flow collection")}function S(e,t){var n,a,o,s,u=Q,c=!1,p=t,f=0,h=!1;if(s=e.input.charCodeAt(e.position),124===s)a=!1;else{if(62!==s)return!1;a=!0}for(e.kind="scalar",e.result="";0!==s;)if(s=e.input.charCodeAt(++e.position),43===s||45===s)Q===u?u=43===s?G:X:d(e,"repeat of a chomping mode identifier");else{if(!((o=l(s))>=0))break;0===o?d(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?d(e,"repeat of an indentation width identifier"):(p=t+o-1,c=!0)}if(i(s)){do s=e.input.charCodeAt(++e.position);while(i(s));if(35===s)do s=e.input.charCodeAt(++e.position);while(!r(s)&&0!==s)}for(;0!==s;){for(b(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!c||e.lineIndent<p)&&32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>p&&(p=e.lineIndent),r(s))f++;else{if(e.lineIndent<p){u===G?e.result+=R.repeat("\n",f):u===Q&&c&&(e.result+="\n");break}for(a?i(s)?(h=!0,e.result+=R.repeat("\n",f+1)):h?(h=!1,e.result+=R.repeat("\n",f+1)):0===f?c&&(e.result+=" "):e.result+=R.repeat("\n",f):c?e.result+=R.repeat("\n",f+1):e.result+=R.repeat("\n",f),c=!0,f=0,n=e.position;!r(s)&&0!==s;)s=e.input.charCodeAt(++e.position);y(e,n,e.position,!1)}}return!0}function O(e,t){var n,r,i,o=e.tag,s=e.anchor,u=[],l=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=u),i=e.input.charCodeAt(e.position);0!==i&&45===i&&(r=e.input.charCodeAt(e.position+1),a(r));)if(l=!0,e.position++,D(e,!0,-1)&&e.lineIndent<=t)u.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,_(e,t,W,!1,!0),u.push(e.result),D(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)d(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return l?(e.tag=o,e.anchor=s,e.kind="sequence",e.result=u,!0):!1}function j(e,t,n){var r,o,s,u,l=e.tag,c=e.anchor,p={},f=null,h=null,m=null,y=!1,g=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=p),u=e.input.charCodeAt(e.position);0!==u;){if(r=e.input.charCodeAt(e.position+1),s=e.line,63!==u&&58!==u||!a(r)){if(!_(e,n,J,!1,!0))break;if(e.line===s){for(u=e.input.charCodeAt(e.position);i(u);)u=e.input.charCodeAt(++e.position);if(58===u)u=e.input.charCodeAt(++e.position),a(u)||d(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(v(e,p,f,h,null),f=h=m=null),g=!0,y=!1,o=!1,f=e.tag,h=e.result;else{if(!g)return e.tag=l,e.anchor=c,!0;d(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!g)return e.tag=l,e.anchor=c,!0;d(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===u?(y&&(v(e,p,f,h,null),f=h=m=null),g=!0,y=!0,o=!0):y?(y=!1,o=!0):d(e,"incomplete explicit mapping pair; a key node is missed"),e.position+=1,u=r;if((e.line===s||e.lineIndent>t)&&(_(e,t,K,!0,o)&&(y?h=e.result:m=e.result),y||(v(e,p,f,h,m),f=h=m=null),D(e,!0,-1),u=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==u)d(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&v(e,p,f,h,null),g&&(e.tag=l,e.anchor=c,e.kind="mapping",e.result=p),g}function k(e){var t,n,r,i,o=!1,s=!1;if(i=e.input.charCodeAt(e.position),33!==i)return!1;if(null!==e.tag&&d(e,"duplication of a tag property"),i=e.input.charCodeAt(++e.position),60===i?(o=!0,i=e.input.charCodeAt(++e.position)):33===i?(s=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do i=e.input.charCodeAt(++e.position);while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):d(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!a(i);)33===i&&(s?d(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),ne.test(n)||d(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),te.test(r)&&d(e,"tag suffix cannot contain flow indicator characters")}return r&&!re.test(r)&&d(e,"tag name cannot contain such characters: "+r),o?e.tag=r:z.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:d(e,'undeclared tag handle "'+n+'"'),!0}function I(e){var t,n;if(n=e.input.charCodeAt(e.position),38!==n)return!1;for(null!==e.anchor&&d(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!a(n)&&!o(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&d(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function B(e){var t,n,r;if(r=e.input.charCodeAt(e.position),42!==r)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!a(r)&&!o(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&d(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||d(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],D(e,!0,-1),!0}function _(e,t,n,r,i){var a,o,s,u,l,c,p,f,h=1,m=!1,y=!1;if(e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=K===n||W===n,r&&D(e,!0,-1)&&(m=!0,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)),1===h)for(;k(e)||I(e);)D(e,!0,-1)?(m=!0,s=a,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)):s=!1;if(s&&(s=m||i),(1===h||K===n)&&(p=Y===n||J===n?t:t+1,f=e.position-e.lineStart,1===h?s&&(O(e,f)||j(e,f,p))||F(e,p)?y=!0:(o&&S(e,p)||C(e,p)||E(e,p)?y=!0:B(e)?(y=!0,(null!==e.tag||null!==e.anchor)&&d(e,"alias node should not have any properties")):x(e,p,Y===n)&&(y=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===h&&(y=s&&O(e,f))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(u=0,l=e.implicitTypes.length;l>u;u+=1)if(c=e.implicitTypes[u],c.resolve(e.result)){e.result=c.construct(e.result),e.tag=c.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else z.call(e.typeMap,e.tag)?(c=e.typeMap[e.tag],null!==e.result&&c.kind!==e.kind&&d(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+c.kind+'", not "'+e.kind+'"'),c.resolve(e.result)?(e.result=c.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):d(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):d(e,"unknown tag !<"+e.tag+">");return null!==e.tag||null!==e.anchor||y}function T(e){var t,n,o,s,u=e.position,l=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(s=e.input.charCodeAt(e.position))&&(D(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==s));){for(l=!0,s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!a(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(t,e.position),o=[],n.length<1&&d(e,"directive name must not be less than one character in length");0!==s;){for(;i(s);)s=e.input.charCodeAt(++e.position);if(35===s){do s=e.input.charCodeAt(++e.position);while(0!==s&&!r(s));break}if(r(s))break;for(t=e.position;0!==s&&!a(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(t,e.position))}0!==s&&b(e),z.call(se,n)?se[n](e,n,o):m(e,'unknown document directive "'+n+'"')}return D(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,D(e,!0,-1)):l&&d(e,"directives end mark is expected"),_(e,e.lineIndent-1,K,!1,!0),D(e,!0,-1),e.checkLineBreaks&&ee.test(e.input.slice(u,e.position))&&m(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&w(e)?void(46===e.input.charCodeAt(e.position)&&(e.position+=3,D(e,!0,-1))):void(e.position<e.length-1&&d(e,"end of the stream or a document separator is expected"))}function P(e,t){e=String(e),t=t||{},0!==e.length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new f(e,t);for(n.input+="\x00";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)T(n);return n.documents}function L(e,t,n){var r,i,a=P(e,n);for(r=0,i=a.length;i>r;r+=1)t(a[r])}function $(e,t){var n=P(e,t);if(0===n.length)return void 0;if(1===n.length)return n[0];throw new N("expected a single document in the stream, but found more")}function M(e,t,n){L(e,t,R.extend({schema:H},n))}function U(e,t){return $(e,R.extend({schema:H},t))}for(var R=e("./common"),N=e("./exception"),q=e("./mark"),H=e("./schema/default_safe"),V=e("./schema/default_full"),z=Object.prototype.hasOwnProperty,Y=1,J=2,W=3,K=4,Q=1,X=2,G=3,Z=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ee=/[\x85\u2028\u2029]/,te=/[,\[\]\{\}]/,ne=/^(?:!|!!|![a-z\-]+!)$/i,re=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,ie=new Array(256),ae=new Array(256),oe=0;256>oe;oe++)ie[oe]=c(oe)?1:0,ae[oe]=c(oe);var se={YAML:function(e,t,n){var r,i,a;null!==e.version&&d(e,"duplication of %YAML directive"),1!==n.length&&d(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===r&&d(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),a=parseInt(r[2],10),1!==i&&d(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=2>a,1!==a&&2!==a&&m(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&d(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],ne.test(r)||d(e,"ill-formed tag handle (first argument) of the TAG directive"),z.call(e.tagMap,r)&&d(e,'there is a previously declared suffix for "'+r+'" tag handle'),re.test(i)||d(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=i}};t.exports.loadAll=L,t.exports.load=$,t.exports.safeLoadAll=M,t.exports.safeLoad=U},{"./common":22,"./exception":24,"./mark":26,"./schema/default_full":29,"./schema/default_safe":30}],26:[function(e,t,n){"use strict";function r(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}var i=e("./common");r.prototype.getSnippet=function(e,t){var n,r,a,o,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",r=this.position;r>0&&-1==="\x00\r\n…\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>t/2-1){n=" ... ",r+=5;break}for(a="",o=this.position;o<this.buffer.length&&-1==="\x00\r\n…\u2028\u2029".indexOf(this.buffer.charAt(o));)if(o+=1,o-this.position>t/2-1){a=" ... ",o-=5;break}return s=this.buffer.slice(r,o),i.repeat(" ",e)+n+s+a+"\n"+i.repeat(" ",e+this.position-r+n.length)+"^"},r.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(n+=":\n"+t)),n},t.exports=r},{"./common":22}],27:[function(e,t,n){"use strict";function r(e,t,n){var i=[];return e.include.forEach(function(e){n=r(e,t,n)}),e[t].forEach(function(e){n.forEach(function(t,n){t.tag===e.tag&&i.push(n)}),n.push(e)}),n.filter(function(e,t){return-1===i.indexOf(t)})}function i(){function e(e){r[e.tag]=e}var t,n,r={};for(t=0,n=arguments.length;n>t;t+=1)arguments[t].forEach(e);return r}function a(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new s("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=r(this,"implicit",[]),this.compiledExplicit=r(this,"explicit",[]),this.compiledTypeMap=i(this.compiledImplicit,this.compiledExplicit)}var o=e("./common"),s=e("./exception"),u=e("./type");a.DEFAULT=null,a.create=function(){var e,t;switch(arguments.length){case 1:e=a.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new s("Wrong number of arguments for Schema.create function")}if(e=o.toArray(e),t=o.toArray(t),!e.every(function(e){return e instanceof a}))throw new s("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof u}))throw new s("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new a({include:e,explicit:t})},t.exports=a},{"./common":22,"./exception":24,"./type":33}],28:[function(e,t,n){"use strict";var r=e("../schema");t.exports=new r({include:[e("./json")]})},{"../schema":27,"./json":32}],29:[function(e,t,n){"use strict";var r=e("../schema");t.exports=r.DEFAULT=new r({include:[e("./default_safe")],explicit:[e("../type/js/undefined"),e("../type/js/regexp"),e("../type/js/function")]})},{"../schema":27,"../type/js/function":38,"../type/js/regexp":39,"../type/js/undefined":40,"./default_safe":30}],30:[function(e,t,n){"use strict";var r=e("../schema");t.exports=new r({include:[e("./core")],implicit:[e("../type/timestamp"),e("../type/merge")],explicit:[e("../type/binary"),e("../type/omap"),e("../type/pairs"),e("../type/set")]})},{"../schema":27,"../type/binary":34,"../type/merge":42,"../type/omap":44,"../type/pairs":45,"../type/set":47,"../type/timestamp":49,"./core":28}],31:[function(e,t,n){"use strict";var r=e("../schema");t.exports=new r({explicit:[e("../type/str"),e("../type/seq"),e("../type/map")]})},{"../schema":27,"../type/map":41,"../type/seq":46,"../type/str":48}],32:[function(e,t,n){"use strict";var r=e("../schema");t.exports=new r({include:[e("./failsafe")],implicit:[e("../type/null"),e("../type/bool"),e("../type/int"),e("../type/float")]})},{"../schema":27,"../type/bool":35,"../type/float":36,"../type/int":37,"../type/null":43,"./failsafe":31}],33:[function(e,t,n){"use strict";function r(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new a('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=r(t.styleAliases||null),-1===s.indexOf(this.kind))throw new a('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var a=e("./exception"),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];t.exports=i},{"./exception":24}],34:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;var t,n,r=0,i=e.length,a=l;for(n=0;i>n;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(0>t)return!1;r+=6}return r%8===0}function i(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=l,o=0,u=[];for(t=0;i>t;t++)t%4===0&&t&&(u.push(o>>16&255),u.push(o>>8&255),u.push(255&o)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,0===n?(u.push(o>>16&255),u.push(o>>8&255),u.push(255&o)):18===n?(u.push(o>>10&255),u.push(o>>2&255)):12===n&&u.push(o>>4&255),s?new s(u):u}function a(e){var t,n,r="",i=0,a=e.length,o=l;for(t=0;a>t;t++)t%3===0&&t&&(r+=o[i>>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]),i=(i<<8)+e[t];return n=a%3,0===n?(r+=o[i>>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]):2===n?(r+=o[i>>10&63],r+=o[i>>4&63],r+=o[i<<2&63],r+=o[64]):1===n&&(r+=o[i>>2&63],r+=o[i<<4&63],r+=o[64],r+=o[64]),r}function o(e){return s&&s.isBuffer(e)}var s=e("buffer").Buffer,u=e("../type"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new u("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:a})},{"../type":33,buffer:12}],35:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function i(e){return"true"===e||"True"===e||"TRUE"===e}function a(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var o=e("../type");t.exports=new o("tag:yaml.org,2002:bool",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":33}],36:[function(e,t,n){"use strict";function r(e){return null===e?!1:l.test(e)?!0:!1}function i(e){var t,n,r,i;return t=e.replace(/_/g,"").toLowerCase(),n="-"===t[0]?-1:1,i=[],0<="+-".indexOf(t[0])&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:0<=t.indexOf(":")?(t.split(":").forEach(function(e){i.unshift(parseFloat(e,10))}),t=0,r=1,i.forEach(function(e){t+=e*r,r*=60}),n*t):n*parseFloat(t,10)}function a(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(s.isNegativeZero(e))return"-0.0";return n=e.toString(10),c.test(n)?n.replace("e",".e"):n}function o(e){return"[object Number]"===Object.prototype.toString.call(e)&&(0!==e%1||s.isNegativeZero(e))}var s=e("../common"),u=e("../type"),l=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?|\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),c=/^[-+]?[0-9]+e/;t.exports=new u("tag:yaml.org,2002:float",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:a,defaultStyle:"lowercase"})},{"../common":22,"../type":33}],37:[function(e,t,n){"use strict";function r(e){return e>=48&&57>=e||e>=65&&70>=e||e>=97&&102>=e}function i(e){return e>=48&&55>=e}function a(e){return e>=48&&57>=e}function o(e){if(null===e)return!1;var t,n=e.length,o=0,s=!1;if(!n)return!1;if(t=e[o],("-"===t||"+"===t)&&(t=e[++o]),"0"===t){if(o+1===n)return!0;if(t=e[++o],"b"===t){for(o++;n>o;o++)if(t=e[o],"_"!==t){if("0"!==t&&"1"!==t)return!1;s=!0}return s}if("x"===t){for(o++;n>o;o++)if(t=e[o],"_"!==t){if(!r(e.charCodeAt(o)))return!1;s=!0}return s}for(;n>o;o++)if(t=e[o],"_"!==t){if(!i(e.charCodeAt(o)))return!1;s=!0}return s}for(;n>o;o++)if(t=e[o],"_"!==t){if(":"===t)break;if(!a(e.charCodeAt(o)))return!1;s=!0}return s?":"!==t?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(o)):!1}function s(e){var t,n,r=e,i=1,a=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),t=r[0],("-"===t||"+"===t)&&("-"===t&&(i=-1),r=r.slice(1),t=r[0]),"0"===r?0:"0"===t?"b"===r[1]?i*parseInt(r.slice(2),2):"x"===r[1]?i*parseInt(r,16):i*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(e){a.unshift(parseInt(e,10))}),r=0,n=1,a.forEach(function(e){r+=e*n,n*=60}),i*r):i*parseInt(r,10)}function u(e){return"[object Number]"===Object.prototype.toString.call(e)&&0===e%1&&!l.isNegativeZero(e)}var l=e("../common"),c=e("../type");t.exports=new c("tag:yaml.org,2002:int",{kind:"scalar",resolve:o,construct:s,predicate:u,represent:{binary:function(e){return"0b"+e.toString(2)},octal:function(e){return"0"+e.toString(8)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return"0x"+e.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":22,
+"../type":33}],38:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;try{var t="("+e+")",n=s.parse(t,{range:!0});return"Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"FunctionExpression"!==n.body[0].expression.type?!1:!0}catch(r){return!1}}function i(e){var t,n="("+e+")",r=s.parse(n,{range:!0}),i=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(e){i.push(e.name)}),t=r.body[0].expression.body.range,new Function(i,n.slice(t[0]+1,t[1]-1))}function a(e){return e.toString()}function o(e){return"[object Function]"===Object.prototype.toString.call(e)}var s;try{s=e("esprima")}catch(u){"undefined"!=typeof window&&(s=window.esprima)}var l=e("../../type");t.exports=new l("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:a})},{"../../type":33,esprima:50}],39:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1;t=t.slice(1,t.length-r.length-1)}try{return!0}catch(i){return!1}}function i(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)}function a(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function o(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var s=e("../../type");t.exports=new s("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:a})},{"../../type":33}],40:[function(e,t,n){"use strict";function r(){return!0}function i(){return void 0}function a(){return""}function o(e){return"undefined"==typeof e}var s=e("../../type");t.exports=new s("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:a})},{"../../type":33}],41:[function(e,t,n){"use strict";var r=e("../type");t.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},{"../type":33}],42:[function(e,t,n){"use strict";function r(e){return"<<"===e||null===e}var i=e("../type");t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:r})},{"../type":33}],43:[function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function i(){return null}function a(e){return null===e}var o=e("../type");t.exports=new o("tag:yaml.org,2002:null",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":33}],44:[function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n,r,i,a,u=[],l=e;for(t=0,n=l.length;n>t;t+=1){if(r=l[t],a=!1,"[object Object]"!==s.call(r))return!1;for(i in r)if(o.call(r,i)){if(a)return!1;a=!0}if(!a)return!1;if(-1!==u.indexOf(i))return!1;u.push(i)}return!0}function i(e){return null!==e?e:[]}var a=e("../type"),o=Object.prototype.hasOwnProperty,s=Object.prototype.toString;t.exports=new a("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:i})},{"../type":33}],45:[function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n,r,i,a,s=e;for(a=new Array(s.length),t=0,n=s.length;n>t;t+=1){if(r=s[t],"[object Object]"!==o.call(r))return!1;if(i=Object.keys(r),1!==i.length)return!1;a[t]=[i[0],r[i[0]]]}return!0}function i(e){if(null===e)return[];var t,n,r,i,a,o=e;for(a=new Array(o.length),t=0,n=o.length;n>t;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var a=e("../type"),o=Object.prototype.toString;t.exports=new a("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i})},{"../type":33}],46:[function(e,t,n){"use strict";var r=e("../type");t.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},{"../type":33}],47:[function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n=e;for(t in n)if(o.call(n,t)&&null!==n[t])return!1;return!0}function i(e){return null!==e?e:{}}var a=e("../type"),o=Object.prototype.hasOwnProperty;t.exports=new a("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i})},{"../type":33}],48:[function(e,t,n){"use strict";var r=e("../type");t.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},{"../type":33}],49:[function(e,t,n){"use strict";function r(e){return null===e?!1:null===s.exec(e)?!1:!0}function i(e){var t,n,r,i,a,o,u,l,c,p,f=0,h=null;if(t=s.exec(e),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],u=+t[6],t[7]){for(f=t[7].slice(0,3);f.length<3;)f+="0";f=+f}return t[9]&&(l=+t[10],c=+(t[11]||0),h=6e4*(60*l+c),"-"===t[9]&&(h=-h)),p=new Date(Date.UTC(n,r,i,a,o,u,f)),h&&p.setTime(p.getTime()-h),p}function a(e){return e.toISOString()}var o=e("../type"),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$");t.exports=new o("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:i,instanceOf:Date,represent:a})},{"../type":33}],50:[function(e,n,r){!function(e,n){"use strict";"function"==typeof t&&t.amd?t(["exports"],n):n("undefined"!=typeof r?r:e.esprima={})}(this,function(e){"use strict";function t(e,t){if(!e)throw new Error("ASSERT: "+t)}function n(e){return e>=48&&57>=e}function r(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function i(e){return"01234567".indexOf(e)>=0}function a(e){var t="0"!==e,n="01234567".indexOf(e);return bn>un&&i(on[un])&&(t=!0,n=8*n+"01234567".indexOf(on[un++]),"0123".indexOf(e)>=0&&bn>un&&i(on[un])&&(n=8*n+"01234567".indexOf(on[un++]))),{code:n,octal:t}}function o(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function s(e){return 10===e||13===e||8232===e||8233===e}function u(e){return 65536>e?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023))}function l(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||92===e||e>=128&&an.NonAsciiIdentifierStart.test(u(e))}function c(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||e>=48&&57>=e||92===e||e>=128&&an.NonAsciiIdentifierPart.test(u(e))}function p(e){switch(e){case"enum":case"export":case"import":case"super":return!0;default:return!1}}function f(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function h(e){return"eval"===e||"arguments"===e}function d(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function m(e,n,r,i,a){var o;t("number"==typeof r,"Comment must have valid position"),wn.lastCommentStart=r,o={type:e,value:n},An.range&&(o.range=[r,i]),An.loc&&(o.loc=a),An.comments.push(o),An.attachComment&&(An.leadingComments.push(o),An.trailingComments.push(o)),An.tokenize&&(o.type=o.type+"Comment",An.delegate&&(o=An.delegate(o)),An.tokens.push(o))}function y(e){var t,n,r,i;for(t=un-e,n={start:{line:ln,column:un-cn-e}};bn>un;)if(r=on.charCodeAt(un),++un,s(r))return pn=!0,An.comments&&(i=on.slice(t+e,un-1),n.end={line:ln,column:un-cn-1},m("Line",i,t,un-1,n)),13===r&&10===on.charCodeAt(un)&&++un,++ln,void(cn=un);An.comments&&(i=on.slice(t+e,un),n.end={line:ln,column:un-cn},m("Line",i,t,un,n))}function g(){var e,t,n,r;for(An.comments&&(e=un-2,t={start:{line:ln,column:un-cn-2}});bn>un;)if(n=on.charCodeAt(un),s(n))13===n&&10===on.charCodeAt(un+1)&&++un,pn=!0,++ln,++un,cn=un;else if(42===n){if(47===on.charCodeAt(un+1))return++un,++un,void(An.comments&&(r=on.slice(e+2,un-2),t.end={line:ln,column:un-cn},m("Block",r,e,un,t)));++un}else++un;An.comments&&(t.end={line:ln,column:un-cn},r=on.slice(e+2,un),m("Block",r,e,un,t)),ne()}function v(){var e,t;for(pn=!1,t=0===un;bn>un;)if(e=on.charCodeAt(un),o(e))++un;else if(s(e))pn=!0,++un,13===e&&10===on.charCodeAt(un)&&++un,++ln,cn=un,t=!0;else if(47===e)if(e=on.charCodeAt(un+1),47===e)++un,++un,y(2),t=!0;else{if(42!==e)break;++un,++un,g()}else if(t&&45===e){if(45!==on.charCodeAt(un+1)||62!==on.charCodeAt(un+2))break;un+=3,y(3)}else{if(60!==e)break;if("!--"!==on.slice(un+1,un+4))break;++un,++un,++un,++un,y(4)}}function b(e){var t,n,i,a=0;for(n="u"===e?4:2,t=0;n>t;++t){if(!(bn>un&&r(on[un])))return"";i=on[un++],a=16*a+"0123456789abcdef".indexOf(i.toLowerCase())}return String.fromCharCode(a)}function D(){var e,t;for(e=on[un],t=0,"}"===e&&te();bn>un&&(e=on[un++],r(e));)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&te(),u(t)}function w(e){var t,n,r;return t=on.charCodeAt(e),t>=55296&&56319>=t&&(r=on.charCodeAt(e+1),r>=56320&&57343>=r&&(n=t,t=1024*(n-55296)+r-56320+65536)),t}function A(){var e,t,n;for(e=w(un),n=u(e),un+=n.length,92===e&&(117!==on.charCodeAt(un)&&te(),++un,"{"===on[un]?(++un,t=D()):(t=b("u"),e=t.charCodeAt(0),t&&"\\"!==t&&l(e)||te()),n=t);bn>un&&(e=w(un),c(e));)t=u(e),n+=t,un+=t.length,92===e&&(n=n.substr(0,n.length-1),117!==on.charCodeAt(un)&&te(),++un,"{"===on[un]?(++un,t=D()):(t=b("u"),e=t.charCodeAt(0),t&&"\\"!==t&&c(e)||te()),n+=t);return n}function x(){var e,t;for(e=un++;bn>un;){if(t=on.charCodeAt(un),92===t)return un=e,A();if(t>=55296&&57343>t)return un=e,A();if(!c(t))break;++un}return on.slice(e,un)}function C(){var e,t,n;return e=un,t=92===on.charCodeAt(un)?A():x(),n=1===t.length?Gt.Identifier:d(t)?Gt.Keyword:"null"===t?Gt.NullLiteral:"true"===t||"false"===t?Gt.BooleanLiteral:Gt.Identifier,{type:n,value:t,lineNumber:ln,lineStart:cn,start:e,end:un}}function E(){var e,t;switch(e={type:Gt.Punctuator,value:"",lineNumber:ln,lineStart:cn,start:un,end:un},t=on[un]){case"(":An.tokenize&&(An.openParenToken=An.tokenValues.length),++un;break;case"{":An.tokenize&&(An.openCurlyToken=An.tokenValues.length),wn.curlyStack.push("{"),++un;break;case".":++un,"."===on[un]&&"."===on[un+1]&&(un+=2,t="...");break;case"}":++un,wn.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++un;break;default:t=on.substr(un,4),">>>="===t?un+=4:(t=t.substr(0,3),"==="===t||"!=="===t||">>>"===t||"<<="===t||">>="===t?un+=3:(t=t.substr(0,2),"&&"===t||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t?un+=2:(t=on[un],"<>=!+-*%&|^/".indexOf(t)>=0&&++un)))}return un===e.start&&te(),e.end=un,e.value=t,e}function F(e){for(var t="";bn>un&&r(on[un]);)t+=on[un++];return 0===t.length&&te(),l(on.charCodeAt(un))&&te(),{type:Gt.NumericLiteral,value:parseInt("0x"+t,16),lineNumber:ln,lineStart:cn,start:e,end:un}}function S(e){var t,r;for(r="";bn>un&&(t=on[un],"0"===t||"1"===t);)r+=on[un++];return 0===r.length&&te(),bn>un&&(t=on.charCodeAt(un),(l(t)||n(t))&&te()),{type:Gt.NumericLiteral,value:parseInt(r,2),lineNumber:ln,lineStart:cn,start:e,end:un}}function O(e,t){var r,a;for(i(e)?(a=!0,r="0"+on[un++]):(a=!1,++un,r="");bn>un&&i(on[un]);)r+=on[un++];return a||0!==r.length||te(),(l(on.charCodeAt(un))||n(on.charCodeAt(un)))&&te(),{type:Gt.NumericLiteral,value:parseInt(r,8),octal:a,lineNumber:ln,lineStart:cn,start:t,end:un}}function j(){var e,t;for(e=un+1;bn>e;++e){if(t=on[e],"8"===t||"9"===t)return!1;if(!i(t))return!0}return!0}function k(){var e,r,a;if(a=on[un],t(n(a.charCodeAt(0))||"."===a,"Numeric literal must start with a decimal digit or a decimal point"),r=un,e="","."!==a){if(e=on[un++],a=on[un],"0"===e){if("x"===a||"X"===a)return++un,F(r);if("b"===a||"B"===a)return++un,S(r);if("o"===a||"O"===a)return O(a,r);if(i(a)&&j())return O(a,r)}for(;n(on.charCodeAt(un));)e+=on[un++];a=on[un]}if("."===a){for(e+=on[un++];n(on.charCodeAt(un));)e+=on[un++];a=on[un]}if("e"===a||"E"===a)if(e+=on[un++],a=on[un],("+"===a||"-"===a)&&(e+=on[un++]),n(on.charCodeAt(un)))for(;n(on.charCodeAt(un));)e+=on[un++];else te();return l(on.charCodeAt(un))&&te(),{type:Gt.NumericLiteral,value:parseFloat(e),lineNumber:ln,lineStart:cn,start:r,end:un}}function I(){var e,n,r,o,u,l="",c=!1;for(e=on[un],t("'"===e||'"'===e,"String literal must starts with a quote"),n=un,++un;bn>un;){if(r=on[un++],r===e){e="";break}if("\\"===r)if(r=on[un++],r&&s(r.charCodeAt(0)))++ln,"\r"===r&&"\n"===on[un]&&++un,cn=un;else switch(r){case"u":case"x":if("{"===on[un])++un,l+=D();else{if(o=b(r),!o)throw te();l+=o}break;case"n":l+="\n";break;case"r":l+="\r";break;case"t":l+=" ";break;case"b":l+="\b";break;case"f":l+="\f";break;case"v":l+=" ";break;case"8":case"9":l+=r,ne();break;default:i(r)?(u=a(r),c=u.octal||c,l+=String.fromCharCode(u.code)):l+=r}else{if(s(r.charCodeAt(0)))break;l+=r}}return""!==e&&te(),{type:Gt.StringLiteral,value:l,octal:c,lineNumber:yn,lineStart:gn,start:n,end:un}}function B(){var e,t,r,a,o,u,l,c,p="";for(a=!1,u=!1,t=un,o="`"===on[un],r=2,++un;bn>un;){if(e=on[un++],"`"===e){r=1,u=!0,a=!0;break}if("$"===e){if("{"===on[un]){wn.curlyStack.push("${"),++un,a=!0;break}p+=e}else if("\\"===e)if(e=on[un++],s(e.charCodeAt(0)))++ln,"\r"===e&&"\n"===on[un]&&++un,cn=un;else switch(e){case"n":p+="\n";break;case"r":p+="\r";break;case"t":p+=" ";break;case"u":case"x":"{"===on[un]?(++un,p+=D()):(l=un,c=b(e),c?p+=c:(un=l,p+=e));break;case"b":p+="\b";break;case"f":p+="\f";break;case"v":p+=" ";break;default:"0"===e?(n(on.charCodeAt(un))&&G(rn.TemplateOctalLiteral),p+="\x00"):i(e)?G(rn.TemplateOctalLiteral):p+=e}else s(e.charCodeAt(0))?(++ln,"\r"===e&&"\n"===on[un]&&++un,cn=un,p+="\n"):p+=e}return a||te(),o||wn.curlyStack.pop(),{type:Gt.Template,value:{cooked:p,raw:on.slice(t+1,un-r)},head:o,tail:u,lineNumber:ln,lineStart:cn,start:t,end:un}}function _(e,t){var n="￿",r=e;t.indexOf("u")>=0&&(r=r.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(e,t,r){var i=parseInt(t||r,16);return i>1114111&&te(null,rn.InvalidRegExp),65535>=i?String.fromCharCode(i):n}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,n));try{RegExp(r)}catch(i){te(null,rn.InvalidRegExp)}try{return new RegExp(e,t)}catch(a){return null}}function T(){var e,n,r,i,a;for(e=on[un],t("/"===e,"Regular expression literal must start with a slash"),n=on[un++],r=!1,i=!1;bn>un;)if(e=on[un++],n+=e,"\\"===e)e=on[un++],s(e.charCodeAt(0))&&te(null,rn.UnterminatedRegExp),n+=e;else if(s(e.charCodeAt(0)))te(null,rn.UnterminatedRegExp);else if(r)"]"===e&&(r=!1);else{if("/"===e){i=!0;break}"["===e&&(r=!0)}return i||te(null,rn.UnterminatedRegExp),a=n.substr(1,n.length-2),{value:a,literal:n}}function P(){var e,t,n,r;for(t="",n="";bn>un&&(e=on[un],c(e.charCodeAt(0)));)if(++un,"\\"===e&&bn>un)if(e=on[un],"u"===e){if(++un,r=un,e=b("u"))for(n+=e,t+="\\u";un>r;++r)t+=on[r];else un=r,n+="u",t+="\\u";ne()}else t+="\\",ne();else n+=e,t+=e;return{value:n,literal:t}}function L(){var e,t,n,r;return vn=!0,Dn=null,v(),e=un,t=T(),n=P(),r=_(t.value,n.value),vn=!1,An.tokenize?{type:Gt.RegularExpression,value:r,regex:{pattern:t.value,flags:n.value},lineNumber:ln,lineStart:cn,start:e,end:un}:{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:un}}function $(){var e,t,n,r;return v(),e=un,t={start:{line:ln,column:un-cn}},n=L(),t.end={line:ln,column:un-cn},An.tokenize||(An.tokens.length>0&&(r=An.tokens[An.tokens.length-1],r.range[0]===e&&"Punctuator"===r.type&&("/"===r.value||"/="===r.value)&&An.tokens.pop()),An.tokens.push({type:"RegularExpression",value:n.literal,regex:n.regex,range:[e,un],loc:t})),n}function M(e){return e.type===Gt.Identifier||e.type===Gt.Keyword||e.type===Gt.BooleanLiteral||e.type===Gt.NullLiteral}function U(){function e(e){return e&&e.length>1&&e[0]>="a"&&e[0]<="z"}var t,n,r;switch(n=An.tokenValues[An.tokens.length-1],t=null!==n,n){case"this":case"]":t=!1;break;case")":r=An.tokenValues[An.openParenToken-1],t="if"===r||"while"===r||"for"===r||"with"===r;break;case"}":t=!1,e(An.tokenValues[An.openCurlyToken-3])?(r=An.tokenValues[An.openCurlyToken-4],t=r?en.indexOf(r)<0:!1):e(An.tokenValues[An.openCurlyToken-4])&&(r=An.tokenValues[An.openCurlyToken-5],t=r?en.indexOf(r)<0:!0)}return t?$():E()}function R(){var e,t;return un>=bn?{type:Gt.EOF,lineNumber:ln,lineStart:cn,start:un,end:un}:(e=on.charCodeAt(un),l(e)?(t=C(),sn&&f(t.value)&&(t.type=Gt.Keyword),t):40===e||41===e||59===e?E():39===e||34===e?I():46===e?n(on.charCodeAt(un+1))?k():E():n(e)?k():An.tokenize&&47===e?U():96===e||125===e&&"${"===wn.curlyStack[wn.curlyStack.length-1]?B():e>=55296&&57343>e&&(e=w(un),l(e))?C():E())}function N(){var e,t,n,r;return e={start:{line:ln,column:un-cn}},t=R(),e.end={line:ln,column:un-cn},t.type!==Gt.EOF&&(n=on.slice(t.start,t.end),r={type:Zt[t.type],value:n,range:[t.start,t.end],loc:e},t.regex&&(r.regex={pattern:t.regex.pattern,flags:t.regex.flags}),An.tokenValues&&An.tokenValues.push("Punctuator"===r.type||"Keyword"===r.type?r.value:null),An.tokenize&&(An.range||delete r.range,An.loc||delete r.loc,An.delegate&&(r=An.delegate(r))),An.tokens.push(r)),t}function q(){var e;return vn=!0,fn=un,hn=ln,dn=cn,v(),e=Dn,mn=un,yn=ln,gn=cn,Dn="undefined"!=typeof An.tokens?N():R(),vn=!1,e}function H(){vn=!0,v(),fn=un,hn=ln,dn=cn,mn=un,yn=ln,gn=cn,Dn="undefined"!=typeof An.tokens?N():R(),vn=!1}function V(){this.line=yn,this.column=mn-gn}function z(){this.start=new V,this.end=null}function Y(e){this.start={line:e.lineNumber,column:e.start-e.lineStart},this.end=null}function J(){An.range&&(this.range=[mn,0]),An.loc&&(this.loc=new z)}function W(e){An.range&&(this.range=[e.start,0]),An.loc&&(this.loc=new Y(e))}function K(e){var t,n;for(t=0;t<An.errors.length;t++)if(n=An.errors[t],n.index===e.index&&n.message===e.message)return;An.errors.push(e)}function Q(e,t){var n=new Error(e);try{throw n}catch(r){Object.create&&Object.defineProperty&&(n=Object.create(r),Object.defineProperty(n,"column",{value:t}))}finally{return n}}function X(e,t,n){var r,i,a;return r="Line "+e+": "+n,i=t-(vn?cn:dn)+1,a=Q(r,i),a.lineNumber=e,a.description=n,a.index=t,a}function G(e){var n,r;throw n=Array.prototype.slice.call(arguments,1),r=e.replace(/%(\d)/g,function(e,r){return t(r<n.length,"Message reference must be in range"),n[r]}),X(hn,fn,r)}function Z(e){var n,r,i;if(n=Array.prototype.slice.call(arguments,1),r=e.replace(/%(\d)/g,function(e,r){return t(r<n.length,"Message reference must be in range"),n[r]}),i=X(ln,fn,r),!An.errors)throw i;K(i)}function ee(e,t){var n,r=t||rn.UnexpectedToken;return e?(t||(r=e.type===Gt.EOF?rn.UnexpectedEOS:e.type===Gt.Identifier?rn.UnexpectedIdentifier:e.type===Gt.NumericLiteral?rn.UnexpectedNumber:e.type===Gt.StringLiteral?rn.UnexpectedString:e.type===Gt.Template?rn.UnexpectedTemplate:rn.UnexpectedToken,e.type===Gt.Keyword&&(p(e.value)?r=rn.UnexpectedReserved:sn&&f(e.value)&&(r=rn.StrictReservedWord))),n=e.type===Gt.Template?e.value.raw:e.value):n="ILLEGAL",r=r.replace("%0",n),e&&"number"==typeof e.lineNumber?X(e.lineNumber,e.start,r):X(vn?ln:hn,vn?un:fn,r)}function te(e,t){throw ee(e,t)}function ne(e,t){var n=ee(e,t);if(!An.errors)throw n;K(n)}function re(e){var t=q();(t.type!==Gt.Punctuator||t.value!==e)&&te(t)}function ie(){var e;An.errors?(e=Dn,e.type===Gt.Punctuator&&","===e.value?q():e.type===Gt.Punctuator&&";"===e.value?(q(),ne(e)):ne(e,rn.UnexpectedToken)):re(",")}function ae(e){var t=q();(t.type!==Gt.Keyword||t.value!==e)&&te(t)}function oe(e){return Dn.type===Gt.Punctuator&&Dn.value===e}function se(e){return Dn.type===Gt.Keyword&&Dn.value===e}function ue(e){return Dn.type===Gt.Identifier&&Dn.value===e}function le(){var e;return Dn.type!==Gt.Punctuator?!1:(e=Dn.value,"="===e||"*="===e||"/="===e||"%="===e||"+="===e||"-="===e||"<<="===e||">>="===e||">>>="===e||"&="===e||"^="===e||"|="===e)}function ce(){return 59===on.charCodeAt(mn)||oe(";")?void q():void(pn||(fn=mn,hn=yn,dn=gn,Dn.type===Gt.EOF||oe("}")||te(Dn)))}function pe(e){var t,n=xn,r=Cn,i=En;return xn=!0,Cn=!0,En=null,t=e(),null!==En&&te(En),xn=n,Cn=r,En=i,t}function fe(e){var t,n=xn,r=Cn,i=En;return xn=!0,Cn=!0,En=null,t=e(),xn=xn&&n,Cn=Cn&&r,En=i||En,t}function he(e,t){var n,r,i=new J,a=[];for(re("[");!oe("]");)if(oe(","))q(),a.push(null);else{if(oe("...")){r=new J,q(),e.push(Dn),n=Ze(t),a.push(r.finishRestElement(n));break}a.push(ge(e,t)),oe("]")||re(",")}return re("]"),i.finishArrayPattern(a)}function de(e,t){var n,r,i,a=new J,o=oe("[");if(Dn.type===Gt.Identifier){if(r=Dn,n=Ze(),oe("="))return e.push(r),q(),i=We(),a.finishProperty("init",n,!1,new W(r).finishAssignmentPattern(n,i),!1,!1);if(!oe(":"))return e.push(r),a.finishProperty("init",n,!1,n,!1,!0)}else n=we();return re(":"),i=ge(e,t),a.finishProperty("init",n,o,i,!1,!1)}function me(e,t){var n=new J,r=[];for(re("{");!oe("}");)r.push(de(e,t)),oe("}")||re(",");return q(),n.finishObjectPattern(r)}function ye(e,t){return oe("[")?he(e,t):oe("{")?me(e,t):(se("let")&&("const"===t||"let"===t)&&ne(Dn,rn.UnexpectedToken),e.push(Dn),Ze(t))}function ge(e,t){var n,r,i,a=Dn;return n=ye(e,t),oe("=")&&(q(),r=wn.allowYield,wn.allowYield=!0,i=pe(We),wn.allowYield=r,n=new W(a).finishAssignmentPattern(n,i)),n}function ve(){var e,t=[],n=new J;for(re("[");!oe("]");)oe(",")?(q(),t.push(null)):oe("...")?(e=new J,q(),e.finishSpreadElement(fe(We)),oe("]")||(Cn=xn=!1,re(",")),t.push(e)):(t.push(fe(We)),oe("]")||re(","));return q(),n.finishArrayExpression(t)}function be(e,t,n){var r,i;return Cn=xn=!1,r=sn,i=pe(St),sn&&t.firstRestricted&&ne(t.firstRestricted,t.message),sn&&t.stricted&&ne(t.stricted,t.message),sn=r,e.finishFunctionExpression(null,t.params,t.defaults,i,n)}function De(){var e,t,n=new J,r=wn.allowYield;return wn.allowYield=!1,e=kt(),wn.allowYield=r,wn.allowYield=!1,t=be(n,e,!1),wn.allowYield=r,t}function we(){var e,t,n=new J;switch(e=q(),e.type){case Gt.StringLiteral:case Gt.NumericLiteral:return sn&&e.octal&&ne(e,rn.StrictOctalLiteral),n.finishLiteral(e);case Gt.Identifier:case Gt.BooleanLiteral:case Gt.NullLiteral:case Gt.Keyword:return n.finishIdentifier(e.value);case Gt.Punctuator:if("["===e.value)return t=pe(We),re("]"),t}te(e)}function Ae(){switch(Dn.type){case Gt.Identifier:case Gt.StringLiteral:case Gt.BooleanLiteral:case Gt.NullLiteral:case Gt.NumericLiteral:case Gt.Keyword:return!0;case Gt.Punctuator:return"["===Dn.value}return!1}function xe(e,t,n,r){var i,a,o,s,u=wn.allowYield;if(e.type===Gt.Identifier){if("get"===e.value&&Ae())return n=oe("["),t=we(),o=new J,re("("),re(")"),wn.allowYield=!1,i=be(o,{params:[],defaults:[],stricted:null,firstRestricted:null,message:null},!1),wn.allowYield=u,r.finishProperty("get",t,n,i,!1,!1);if("set"===e.value&&Ae())return n=oe("["),t=we(),o=new J,re("("),a={params:[],defaultCount:0,defaults:[],firstRestricted:null,paramSet:{}},oe(")")?ne(Dn):(wn.allowYield=!1,jt(a),wn.allowYield=u,0===a.defaultCount&&(a.defaults=[])),re(")"),wn.allowYield=!1,i=be(o,a,!1),wn.allowYield=u,r.finishProperty("set",t,n,i,!1,!1)}else if(e.type===Gt.Punctuator&&"*"===e.value&&Ae())return n=oe("["),t=we(),o=new J,wn.allowYield=!0,s=kt(),wn.allowYield=u,wn.allowYield=!1,i=be(o,s,!0),wn.allowYield=u,r.finishProperty("init",t,n,i,!0,!1);return t&&oe("(")?(i=De(),r.finishProperty("init",t,n,i,!0,!1)):null}function Ce(e){var t,n,r,i,a,o=Dn,s=new J;return t=oe("["),oe("*")?q():n=we(),(r=xe(o,n,t,s))?r:(n||te(Dn),t||(i=n.type===tn.Identifier&&"__proto__"===n.name||n.type===tn.Literal&&"__proto__"===n.value,e.value&&i&&Z(rn.DuplicateProtoProperty),e.value|=i),oe(":")?(q(),a=fe(We),s.finishProperty("init",n,t,a,!1,!1)):o.type===Gt.Identifier?oe("=")?(En=Dn,q(),a=pe(We),s.finishProperty("init",n,t,new W(o).finishAssignmentPattern(n,a),!1,!0)):s.finishProperty("init",n,t,n,!1,!0):void te(Dn))}function Ee(){var e=[],t={value:!1},n=new J;for(re("{");!oe("}");)e.push(Ce(t)),oe("}")||ie();return re("}"),n.finishObjectExpression(e)}function Fe(e){var t;switch(e.type){case tn.Identifier:case tn.MemberExpression:case tn.RestElement:case tn.AssignmentPattern:break;case tn.SpreadElement:e.type=tn.RestElement,Fe(e.argument);break;case tn.ArrayExpression:for(e.type=tn.ArrayPattern,t=0;t<e.elements.length;t++)null!==e.elements[t]&&Fe(e.elements[t]);break;case tn.ObjectExpression:for(e.type=tn.ObjectPattern,t=0;t<e.properties.length;t++)Fe(e.properties[t].value);break;case tn.AssignmentExpression:e.type=tn.AssignmentPattern,Fe(e.left)}}function Se(e){var t,n;return(Dn.type!==Gt.Template||e.head&&!Dn.head)&&te(),t=new J,n=q(),t.finishTemplateElement({raw:n.value.raw,cooked:n.value.cooked},n.tail)}function Oe(){var e,t,n,r=new J;for(e=Se({head:!0}),t=[e],n=[];!e.tail;)n.push(Ke()),e=Se({head:!1}),t.push(e);return r.finishTemplateLiteral(t,n)}function je(){var e,t,n,r,i=[];if(re("("),oe(")"))return q(),oe("=>")||re("=>"),{type:nn.ArrowParameterPlaceHolder,params:[],rawParams:[]};if(n=Dn,oe("..."))return e=lt(i),re(")"),oe("=>")||re("=>"),{type:nn.ArrowParameterPlaceHolder,params:[e]};if(xn=!0,e=fe(We),oe(",")){for(Cn=!1,t=[e];bn>mn&&oe(",");){if(q(),oe("...")){for(xn||te(Dn),t.push(lt(i)),re(")"),oe("=>")||re("=>"),xn=!1,r=0;r<t.length;r++)Fe(t[r]);return{type:nn.ArrowParameterPlaceHolder,params:t}}t.push(fe(We))}e=new W(n).finishSequenceExpression(t)}if(re(")"),oe("=>")){if(e.type===tn.Identifier&&"yield"===e.name)return{type:nn.ArrowParameterPlaceHolder,params:[e]};if(xn||te(Dn),e.type===tn.SequenceExpression)for(r=0;r<e.expressions.length;r++)Fe(e.expressions[r]);else Fe(e);e={type:nn.ArrowParameterPlaceHolder,params:e.type===tn.SequenceExpression?e.expressions:[e]}}return xn=!1,e}function ke(){var e,t,n,r;if(oe("("))return xn=!1,fe(je);if(oe("["))return fe(ve);if(oe("{"))return fe(Ee);if(e=Dn.type,r=new J,e===Gt.Identifier)"module"===wn.sourceType&&"await"===Dn.value&&ne(Dn),n=r.finishIdentifier(q().value);else if(e===Gt.StringLiteral||e===Gt.NumericLiteral)Cn=xn=!1,sn&&Dn.octal&&ne(Dn,rn.StrictOctalLiteral),n=r.finishLiteral(q());else if(e===Gt.Keyword){if(!sn&&wn.allowYield&&se("yield"))return Be();if(!sn&&se("let"))return r.finishIdentifier(q().value);if(Cn=xn=!1,se("function"))return Bt();if(se("this"))return q(),r.finishThisExpression();if(se("class"))return Pt();te(q())}else e===Gt.BooleanLiteral?(Cn=xn=!1,t=q(),t.value="true"===t.value,n=r.finishLiteral(t)):e===Gt.NullLiteral?(Cn=xn=!1,t=q(),t.value=null,n=r.finishLiteral(t)):oe("/")||oe("/=")?(Cn=xn=!1,un=mn,t="undefined"!=typeof An.tokens?$():L(),q(),n=r.finishLiteral(t)):e===Gt.Template?n=Oe():te(q());return n}function Ie(){var e,t=[];if(re("("),!oe(")"))for(;bn>mn&&(oe("...")?(e=new J,q(),e.finishSpreadElement(pe(We))):e=pe(We),t.push(e),!oe(")"));)ie();return re(")"),t}function Be(){var e,t=new J;return e=q(),M(e)||te(e),t.finishIdentifier(e.value)}function _e(){return re("."),Be()}function Te(){var e;return re("["),e=pe(Ke),re("]"),e}function Pe(){var e,t,n=new J;if(ae("new"),oe(".")){if(q(),Dn.type===Gt.Identifier&&"target"===Dn.value&&wn.inFunctionBody)return q(),n.finishMetaProperty("new","target");te(Dn)}return e=pe($e),t=oe("(")?Ie():[],Cn=xn=!1,n.finishNewExpression(e,t)}function Le(){var e,t,n,r,i,a=wn.allowIn;for(i=Dn,wn.allowIn=!0,se("super")&&wn.inFunctionBody?(t=new J,q(),t=t.finishSuper(),oe("(")||oe(".")||oe("[")||te(Dn)):t=fe(se("new")?Pe:ke);;)if(oe("."))xn=!1,Cn=!0,r=_e(),t=new W(i).finishMemberExpression(".",t,r);else if(oe("("))xn=!1,Cn=!1,n=Ie(),t=new W(i).finishCallExpression(t,n);else if(oe("["))xn=!1,Cn=!0,r=Te(),t=new W(i).finishMemberExpression("[",t,r);else{if(Dn.type!==Gt.Template||!Dn.head)break;e=Oe(),t=new W(i).finishTaggedTemplateExpression(t,e)}return wn.allowIn=a,t}function $e(){var e,n,r,i;for(t(wn.allowIn,"callee of new expression always allow in keyword."),i=Dn,se("super")&&wn.inFunctionBody?(n=new J,q(),n=n.finishSuper(),oe("[")||oe(".")||te(Dn)):n=fe(se("new")?Pe:ke);;)if(oe("["))xn=!1,Cn=!0,r=Te(),n=new W(i).finishMemberExpression("[",n,r);else if(oe("."))xn=!1,Cn=!0,r=_e(),n=new W(i).finishMemberExpression(".",n,r);else{if(Dn.type!==Gt.Template||!Dn.head)break;e=Oe(),n=new W(i).finishTaggedTemplateExpression(n,e)}return n}function Me(){var e,t,n=Dn;return e=fe(Le),pn||Dn.type!==Gt.Punctuator||(oe("++")||oe("--"))&&(sn&&e.type===tn.Identifier&&h(e.name)&&Z(rn.StrictLHSPostfix),Cn||Z(rn.InvalidLHSInAssignment),Cn=xn=!1,t=q(),e=new W(n).finishPostfixExpression(t.value,e)),e}function Ue(){var e,t,n;return Dn.type!==Gt.Punctuator&&Dn.type!==Gt.Keyword?t=Me():oe("++")||oe("--")?(n=Dn,e=q(),t=fe(Ue),sn&&t.type===tn.Identifier&&h(t.name)&&Z(rn.StrictLHSPrefix),Cn||Z(rn.InvalidLHSInAssignment),t=new W(n).finishUnaryExpression(e.value,t),Cn=xn=!1):oe("+")||oe("-")||oe("~")||oe("!")?(n=Dn,e=q(),t=fe(Ue),t=new W(n).finishUnaryExpression(e.value,t),Cn=xn=!1):se("delete")||se("void")||se("typeof")?(n=Dn,e=q(),t=fe(Ue),t=new W(n).finishUnaryExpression(e.value,t),sn&&"delete"===t.operator&&t.argument.type===tn.Identifier&&Z(rn.StrictDelete),Cn=xn=!1):t=Me(),t}function Re(e,t){var n=0;if(e.type!==Gt.Punctuator&&e.type!==Gt.Keyword)return 0;switch(e.value){case"||":n=1;break;case"&&":n=2;break;case"|":n=3;break;case"^":n=4;break;case"&":n=5;break;case"==":case"!=":case"===":case"!==":n=6;break;case"<":case">":case"<=":case">=":case"instanceof":n=7;break;case"in":n=t?7:0;break;case"<<":case">>":case">>>":n=8;break;case"+":case"-":n=9;break;case"*":case"/":case"%":n=11}return n}function Ne(){var e,t,n,r,i,a,o,s,u,l;if(e=Dn,u=fe(Ue),r=Dn,i=Re(r,wn.allowIn),0===i)return u;for(Cn=xn=!1,r.prec=i,q(),t=[e,Dn],o=pe(Ue),a=[u,r,o];(i=Re(Dn,wn.allowIn))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),s=a.pop().value,u=a.pop(),t.pop(),n=new W(t[t.length-1]).finishBinaryExpression(s,u,o),a.push(n);r=q(),r.prec=i,a.push(r),t.push(Dn),n=pe(Ue),a.push(n)}for(l=a.length-1,n=a[l],t.pop();l>1;)n=new W(t.pop()).finishBinaryExpression(a[l-1].value,a[l-2],n),l-=2;return n}function qe(){var e,t,n,r,i;return i=Dn,e=fe(Ne),oe("?")&&(q(),t=wn.allowIn,wn.allowIn=!0,n=pe(We),wn.allowIn=t,re(":"),r=pe(We),e=new W(i).finishConditionalExpression(e,n,r),Cn=xn=!1),e}function He(){return oe("{")?St():pe(We)}function Ve(e,n){var r;switch(n.type){case tn.Identifier:Ot(e,n,n.name);break;case tn.RestElement:Ve(e,n.argument);break;case tn.AssignmentPattern:Ve(e,n.left);break;case tn.ArrayPattern:for(r=0;r<n.elements.length;r++)null!==n.elements[r]&&Ve(e,n.elements[r]);break;case tn.YieldExpression:break;default:for(t(n.type===tn.ObjectPattern,"Invalid type"),r=0;r<n.properties.length;r++)Ve(e,n.properties[r].value)}}function ze(e){var t,n,r,i,a,o,s,u;switch(a=[],o=0,i=[e],e.type){case tn.Identifier:break;case nn.ArrowParameterPlaceHolder:i=e.params;break;default:return null}for(s={paramSet:{}},t=0,n=i.length;n>t;t+=1)switch(r=i[t],r.type){case tn.AssignmentPattern:i[t]=r.left,r.right.type===tn.YieldExpression&&(r.right.argument&&te(Dn),r.right.type=tn.Identifier,r.right.name="yield",delete r.right.argument,delete r.right.delegate),a.push(r.right),++o,Ve(s,r.left);break;default:Ve(s,r),i[t]=r,a.push(null)}if(sn||!wn.allowYield)for(t=0,n=i.length;n>t;t+=1)r=i[t],r.type===tn.YieldExpression&&te(Dn);return s.message===rn.StrictParamDupe&&(u=sn?s.stricted:s.firstRestricted,te(u,s.message)),0===o&&(a=[]),{params:i,defaults:a,stricted:s.stricted,firstRestricted:s.firstRestricted,message:s.message}}function Ye(e,t){var n,r,i;return pn&&ne(Dn),re("=>"),n=sn,r=wn.allowYield,wn.allowYield=!0,i=He(),sn&&e.firstRestricted&&te(e.firstRestricted,e.message),sn&&e.stricted&&ne(e.stricted,e.message),
+sn=n,wn.allowYield=r,t.finishArrowFunctionExpression(e.params,e.defaults,i,i.type!==tn.BlockStatement)}function Je(){var e,t,n,r;return e=null,t=new J,n=!1,ae("yield"),pn||(r=wn.allowYield,wn.allowYield=!1,n=oe("*"),n?(q(),e=We()):oe(";")||oe("}")||oe(")")||Dn.type===Gt.EOF||(e=We()),wn.allowYield=r),t.finishYieldExpression(e,n)}function We(){var e,t,n,r,i;return i=Dn,e=Dn,!wn.allowYield&&se("yield")?Je():(t=qe(),t.type===nn.ArrowParameterPlaceHolder||oe("=>")?(Cn=xn=!1,r=ze(t),r?(En=null,Ye(r,new W(i))):t):(le()&&(Cn||Z(rn.InvalidLHSInAssignment),sn&&t.type===tn.Identifier&&(h(t.name)&&ne(e,rn.StrictLHSAssignment),f(t.name)&&ne(e,rn.StrictReservedWord)),oe("=")?Fe(t):Cn=xn=!1,e=q(),n=pe(We),t=new W(i).finishAssignmentExpression(e.value,t,n),En=null),t))}function Ke(){var e,t,n=Dn;if(e=pe(We),oe(",")){for(t=[e];bn>mn&&oe(",");)q(),t.push(pe(We));e=new W(n).finishSequenceExpression(t)}return e}function Qe(){if(Dn.type===Gt.Keyword)switch(Dn.value){case"export":return"module"!==wn.sourceType&&ne(Dn,rn.IllegalExportDeclaration),Nt();case"import":return"module"!==wn.sourceType&&ne(Dn,rn.IllegalImportDeclaration),Yt();case"const":return ut({inFor:!1});case"function":return It(new J);case"class":return Tt()}return se("let")&&st()?ut({inFor:!1}):Ft()}function Xe(){for(var e=[];bn>mn&&!oe("}");)e.push(Qe());return e}function Ge(){var e,t=new J;return re("{"),e=Xe(),re("}"),t.finishBlockStatement(e)}function Ze(e){var t,n=new J;return t=q(),t.type===Gt.Keyword&&"yield"===t.value?(sn&&ne(t,rn.StrictReservedWord),wn.allowYield||te(t)):t.type!==Gt.Identifier?sn&&t.type===Gt.Keyword&&f(t.value)?ne(t,rn.StrictReservedWord):(sn||"let"!==t.value||"var"!==e)&&te(t):"module"===wn.sourceType&&t.type===Gt.Identifier&&"await"===t.value&&ne(t),n.finishIdentifier(t.value)}function et(e){var t,n=null,r=new J,i=[];return t=ye(i,"var"),sn&&h(t.name)&&Z(rn.StrictVarName),oe("=")?(q(),n=pe(We)):t.type===tn.Identifier||e.inFor||re("="),r.finishVariableDeclarator(t,n)}function tt(e){var t,n;for(t={inFor:e.inFor},n=[et(t)];oe(",");)q(),n.push(et(t));return n}function nt(e){var t;return ae("var"),t=tt({inFor:!1}),ce(),e.finishVariableDeclaration(t)}function rt(e,t){var n,r=null,i=new J,a=[];return n=ye(a,e),sn&&n.type===tn.Identifier&&h(n.name)&&Z(rn.StrictVarName),"const"===e?se("in")||ue("of")||(re("="),r=pe(We)):(!t.inFor&&n.type!==tn.Identifier||oe("="))&&(re("="),r=pe(We)),i.finishVariableDeclarator(n,r)}function it(e,t){for(var n=[rt(e,t)];oe(",");)q(),n.push(rt(e,t));return n}function at(){return{index:un,lineNumber:ln,lineStart:cn,hasLineTerminator:pn,lastIndex:fn,lastLineNumber:hn,lastLineStart:dn,startIndex:mn,startLineNumber:yn,startLineStart:gn,lookahead:Dn,tokenCount:An.tokens?An.tokens.length:0}}function ot(e){un=e.index,ln=e.lineNumber,cn=e.lineStart,pn=e.hasLineTerminator,fn=e.lastIndex,hn=e.lastLineNumber,dn=e.lastLineStart,mn=e.startIndex,yn=e.startLineNumber,gn=e.startLineStart,Dn=e.lookahead,An.tokens&&An.tokens.splice(e.tokenCount,An.tokens.length)}function st(){var e,t;return t=at(),q(),e=Dn.type===Gt.Identifier||oe("[")||oe("{")||se("let")||se("yield"),ot(t),e}function ut(e){var n,r,i=new J;return n=q().value,t("let"===n||"const"===n,"Lexical declaration must be either let or const"),r=it(n,e),ce(),i.finishLexicalDeclaration(r,n)}function lt(e){var t,n=new J;return q(),oe("{")&&G(rn.ObjectPatternAsRestParameter),e.push(Dn),t=Ze(),oe("=")&&G(rn.DefaultRestParameter),oe(")")||G(rn.ParameterAfterRestParameter),n.finishRestElement(t)}function ct(e){return re(";"),e.finishEmptyStatement()}function pt(e){var t=Ke();return ce(),e.finishExpressionStatement(t)}function ft(e){var t,n,r;return ae("if"),re("("),t=Ke(),re(")"),n=Ft(),se("else")?(q(),r=Ft()):r=null,e.finishIfStatement(t,n,r)}function ht(e){var t,n,r;return ae("do"),r=wn.inIteration,wn.inIteration=!0,t=Ft(),wn.inIteration=r,ae("while"),re("("),n=Ke(),re(")"),oe(";")&&q(),e.finishDoWhileStatement(t,n)}function dt(e){var t,n,r;return ae("while"),re("("),t=Ke(),re(")"),r=wn.inIteration,wn.inIteration=!0,n=Ft(),wn.inIteration=r,e.finishWhileStatement(t,n)}function mt(e){var t,n,r,i,a,o,s,u,l,c,p,f,h=wn.allowIn;if(t=a=o=null,n=!0,ae("for"),re("("),oe(";"))q();else if(se("var"))t=new J,q(),wn.allowIn=!1,c=tt({inFor:!0}),wn.allowIn=h,1===c.length&&se("in")?(t=t.finishVariableDeclaration(c),q(),s=t,u=Ke(),t=null):1===c.length&&null===c[0].init&&ue("of")?(t=t.finishVariableDeclaration(c),q(),s=t,u=We(),t=null,n=!1):(t=t.finishVariableDeclaration(c),re(";"));else if(se("const")||se("let"))t=new J,l=q().value,sn||"in"!==Dn.value?(wn.allowIn=!1,c=it(l,{inFor:!0}),wn.allowIn=h,1===c.length&&null===c[0].init&&se("in")?(t=t.finishLexicalDeclaration(c,l),q(),s=t,u=Ke(),t=null):1===c.length&&null===c[0].init&&ue("of")?(t=t.finishLexicalDeclaration(c,l),q(),s=t,u=We(),t=null,n=!1):(ce(),t=t.finishLexicalDeclaration(c,l))):(t=t.finishIdentifier(l),q(),s=t,u=Ke(),t=null);else if(i=Dn,wn.allowIn=!1,t=fe(We),wn.allowIn=h,se("in"))Cn||Z(rn.InvalidLHSInForIn),q(),Fe(t),s=t,u=Ke(),t=null;else if(ue("of"))Cn||Z(rn.InvalidLHSInForLoop),q(),Fe(t),s=t,u=We(),t=null,n=!1;else{if(oe(",")){for(r=[t];oe(",");)q(),r.push(pe(We));t=new W(i).finishSequenceExpression(r)}re(";")}return"undefined"==typeof s&&(oe(";")||(a=Ke()),re(";"),oe(")")||(o=Ke())),re(")"),f=wn.inIteration,wn.inIteration=!0,p=pe(Ft),wn.inIteration=f,"undefined"==typeof s?e.finishForStatement(t,a,o,p):n?e.finishForInStatement(s,u,p):e.finishForOfStatement(s,u,p)}function yt(e){var t,n=null;return ae("continue"),59===on.charCodeAt(mn)?(q(),wn.inIteration||G(rn.IllegalContinue),e.finishContinueStatement(null)):pn?(wn.inIteration||G(rn.IllegalContinue),e.finishContinueStatement(null)):(Dn.type===Gt.Identifier&&(n=Ze(),t="$"+n.name,Object.prototype.hasOwnProperty.call(wn.labelSet,t)||G(rn.UnknownLabel,n.name)),ce(),null!==n||wn.inIteration||G(rn.IllegalContinue),e.finishContinueStatement(n))}function gt(e){var t,n=null;return ae("break"),59===on.charCodeAt(fn)?(q(),wn.inIteration||wn.inSwitch||G(rn.IllegalBreak),e.finishBreakStatement(null)):(pn?wn.inIteration||wn.inSwitch||G(rn.IllegalBreak):Dn.type===Gt.Identifier&&(n=Ze(),t="$"+n.name,Object.prototype.hasOwnProperty.call(wn.labelSet,t)||G(rn.UnknownLabel,n.name)),ce(),null!==n||wn.inIteration||wn.inSwitch||G(rn.IllegalBreak),e.finishBreakStatement(n))}function vt(e){var t=null;return ae("return"),wn.inFunctionBody||Z(rn.IllegalReturn),32===on.charCodeAt(fn)&&l(on.charCodeAt(fn+1))?(t=Ke(),ce(),e.finishReturnStatement(t)):pn?e.finishReturnStatement(null):(oe(";")||oe("}")||Dn.type===Gt.EOF||(t=Ke()),ce(),e.finishReturnStatement(t))}function bt(e){var t,n;return sn&&Z(rn.StrictModeWith),ae("with"),re("("),t=Ke(),re(")"),n=Ft(),e.finishWithStatement(t,n)}function Dt(){var e,t,n=[],r=new J;for(se("default")?(q(),e=null):(ae("case"),e=Ke()),re(":");bn>mn&&!(oe("}")||se("default")||se("case"));)t=Qe(),n.push(t);return r.finishSwitchCase(e,n)}function wt(e){var t,n,r,i,a;if(ae("switch"),re("("),t=Ke(),re(")"),re("{"),n=[],oe("}"))return q(),e.finishSwitchStatement(t,n);for(i=wn.inSwitch,wn.inSwitch=!0,a=!1;bn>mn&&!oe("}");)r=Dt(),null===r.test&&(a&&G(rn.MultipleDefaultsInSwitch),a=!0),n.push(r);return wn.inSwitch=i,re("}"),e.finishSwitchStatement(t,n)}function At(e){var t;return ae("throw"),pn&&G(rn.NewlineAfterThrow),t=Ke(),ce(),e.finishThrowStatement(t)}function xt(){var e,t,n,r,i=[],a={},o=new J;for(ae("catch"),re("("),oe(")")&&te(Dn),e=ye(i),n=0;n<i.length;n++)t="$"+i[n].value,Object.prototype.hasOwnProperty.call(a,t)&&Z(rn.DuplicateBinding,i[n].value),a[t]=!0;return sn&&h(e.name)&&Z(rn.StrictCatchVariable),re(")"),r=Ge(),o.finishCatchClause(e,r)}function Ct(e){var t,n=null,r=null;return ae("try"),t=Ge(),se("catch")&&(n=xt()),se("finally")&&(q(),r=Ge()),n||r||G(rn.NoCatchOrFinally),e.finishTryStatement(t,n,r)}function Et(e){return ae("debugger"),ce(),e.finishDebuggerStatement()}function Ft(){var e,t,n,r,i=Dn.type;if(i===Gt.EOF&&te(Dn),i===Gt.Punctuator&&"{"===Dn.value)return Ge();if(Cn=xn=!0,r=new J,i===Gt.Punctuator)switch(Dn.value){case";":return ct(r);case"(":return pt(r)}else if(i===Gt.Keyword)switch(Dn.value){case"break":return gt(r);case"continue":return yt(r);case"debugger":return Et(r);case"do":return ht(r);case"for":return mt(r);case"function":return It(r);case"if":return ft(r);case"return":return vt(r);case"switch":return wt(r);case"throw":return At(r);case"try":return Ct(r);case"var":return nt(r);case"while":return dt(r);case"with":return bt(r)}return e=Ke(),e.type===tn.Identifier&&oe(":")?(q(),n="$"+e.name,Object.prototype.hasOwnProperty.call(wn.labelSet,n)&&G(rn.Redeclaration,"Label",e.name),wn.labelSet[n]=!0,t=Ft(),delete wn.labelSet[n],r.finishLabeledStatement(e,t)):(ce(),r.finishExpressionStatement(e))}function St(){var e,t,n,r,i,a,o,s,u,l=[],c=new J;for(re("{");bn>mn&&Dn.type===Gt.StringLiteral&&(t=Dn,e=Qe(),l.push(e),e.expression.type===tn.Literal);)n=on.slice(t.start+1,t.end-1),"use strict"===n?(sn=!0,r&&ne(r,rn.StrictOctalLiteral)):!r&&t.octal&&(r=t);for(i=wn.labelSet,a=wn.inIteration,o=wn.inSwitch,s=wn.inFunctionBody,u=wn.parenthesizedCount,wn.labelSet={},wn.inIteration=!1,wn.inSwitch=!1,wn.inFunctionBody=!0,wn.parenthesizedCount=0;bn>mn&&!oe("}");)l.push(Qe());return re("}"),wn.labelSet=i,wn.inIteration=a,wn.inSwitch=o,wn.inFunctionBody=s,wn.parenthesizedCount=u,c.finishBlockStatement(l)}function Ot(e,t,n){var r="$"+n;sn?(h(n)&&(e.stricted=t,e.message=rn.StrictParamName),Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=rn.StrictParamDupe)):e.firstRestricted||(h(n)?(e.firstRestricted=t,e.message=rn.StrictParamName):f(n)?(e.firstRestricted=t,e.message=rn.StrictReservedWord):Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=rn.StrictParamDupe)),e.paramSet[r]=!0}function jt(e){var t,n,r,i,a=[];if(t=Dn,"..."===t.value)return n=lt(a),Ot(e,n.argument,n.argument.name),e.params.push(n),e.defaults.push(null),!1;for(n=ge(a),r=0;r<a.length;r++)Ot(e,a[r],a[r].value);return n.type===tn.AssignmentPattern&&(i=n.right,n=n.left,++e.defaultCount),e.params.push(n),e.defaults.push(i),!oe(")")}function kt(e){var t;if(t={params:[],defaultCount:0,defaults:[],firstRestricted:e},re("("),!oe(")"))for(t.paramSet={};bn>mn&&jt(t);)re(",");return re(")"),0===t.defaultCount&&(t.defaults=[]),{params:t.params,defaults:t.defaults,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}}function It(e,t){var n,r,i,a,o,s,u,l,c,p=null,d=[],m=[];return c=wn.allowYield,ae("function"),l=oe("*"),l&&q(),t&&oe("(")||(r=Dn,p=Ze(),sn?h(r.value)&&ne(r,rn.StrictFunctionName):h(r.value)?(o=r,s=rn.StrictFunctionName):f(r.value)&&(o=r,s=rn.StrictReservedWord)),wn.allowYield=!l,a=kt(o),d=a.params,m=a.defaults,i=a.stricted,o=a.firstRestricted,a.message&&(s=a.message),u=sn,n=St(),sn&&o&&te(o,s),sn&&i&&ne(i,s),sn=u,wn.allowYield=c,e.finishFunctionDeclaration(p,d,m,n,l)}function Bt(){var e,t,n,r,i,a,o,s,u,l=null,c=[],p=[],d=new J;return u=wn.allowYield,ae("function"),s=oe("*"),s&&q(),wn.allowYield=!s,oe("(")||(e=Dn,l=sn||s||!se("yield")?Ze():Be(),sn?h(e.value)&&ne(e,rn.StrictFunctionName):h(e.value)?(n=e,r=rn.StrictFunctionName):f(e.value)&&(n=e,r=rn.StrictReservedWord)),i=kt(n),c=i.params,p=i.defaults,t=i.stricted,n=i.firstRestricted,i.message&&(r=i.message),o=sn,a=St(),sn&&n&&te(n,r),sn&&t&&ne(t,r),sn=o,wn.allowYield=u,d.finishFunctionExpression(l,c,p,a,s)}function _t(){var e,t,n,r,i,a,o,s=!1;for(e=new J,re("{"),r=[];!oe("}");)oe(";")?q():(i=new J,t=Dn,n=!1,a=oe("["),oe("*")?q():(o=we(),"static"===o.name&&(Ae()||oe("*"))&&(t=Dn,n=!0,a=oe("["),oe("*")?q():o=we())),i=xe(t,o,a,i),i?(i["static"]=n,"init"===i.kind&&(i.kind="method"),n?i.computed||"prototype"!==(i.key.name||i.key.value.toString())||te(t,rn.StaticPrototype):i.computed||"constructor"!==(i.key.name||i.key.value.toString())||(("method"!==i.kind||!i.method||i.value.generator)&&te(t,rn.ConstructorSpecialMethod),s?te(t,rn.DuplicateConstructor):s=!0,i.kind="constructor"),i.type=tn.MethodDefinition,delete i.method,delete i.shorthand,r.push(i)):te(Dn));return q(),e.finishClassBody(r)}function Tt(e){var t,n=null,r=null,i=new J,a=sn;return sn=!0,ae("class"),e&&Dn.type!==Gt.Identifier||(n=Ze()),se("extends")&&(q(),r=pe(Le)),t=_t(),sn=a,i.finishClassDeclaration(n,r,t)}function Pt(){var e,t=null,n=null,r=new J,i=sn;return sn=!0,ae("class"),Dn.type===Gt.Identifier&&(t=Ze()),se("extends")&&(q(),n=pe(Le)),e=_t(),sn=i,r.finishClassExpression(t,n,e)}function Lt(){var e=new J;return Dn.type!==Gt.StringLiteral&&G(rn.InvalidModuleSpecifier),e.finishLiteral(q())}function $t(){var e,t,n,r=new J;return se("default")?(n=new J,q(),t=n.finishIdentifier("default")):t=Ze(),ue("as")&&(q(),e=Be()),r.finishExportSpecifier(t,e)}function Mt(e){var t,n=null,r=null,i=[];if(Dn.type===Gt.Keyword)switch(Dn.value){case"let":case"const":return n=ut({inFor:!1}),e.finishExportNamedDeclaration(n,i,null);case"var":case"class":case"function":return n=Qe(),e.finishExportNamedDeclaration(n,i,null)}for(re("{");!oe("}")&&(t=t||se("default"),i.push($t()),oe("}")||(re(","),!oe("}"))););return re("}"),ue("from")?(q(),r=Lt(),ce()):t?G(Dn.value?rn.UnexpectedToken:rn.MissingFromClause,Dn.value):ce(),e.finishExportNamedDeclaration(n,i,r)}function Ut(e){var t=null,n=null;return ae("default"),se("function")?(t=It(new J,!0),e.finishExportDefaultDeclaration(t)):se("class")?(t=Tt(!0),e.finishExportDefaultDeclaration(t)):(ue("from")&&G(rn.UnexpectedToken,Dn.value),n=oe("{")?Ee():oe("[")?ve():We(),ce(),e.finishExportDefaultDeclaration(n))}function Rt(e){var t;return re("*"),ue("from")||G(Dn.value?rn.UnexpectedToken:rn.MissingFromClause,Dn.value),q(),t=Lt(),ce(),e.finishExportAllDeclaration(t)}function Nt(){var e=new J;return wn.inFunctionBody&&G(rn.IllegalExportDeclaration),ae("export"),se("default")?Ut(e):oe("*")?Rt(e):Mt(e)}function qt(){var e,t,n=new J;return t=Be(),ue("as")&&(q(),e=Ze()),n.finishImportSpecifier(e,t)}function Ht(){var e=[];for(re("{");!oe("}")&&(e.push(qt()),oe("}")||(re(","),!oe("}"))););return re("}"),e}function Vt(){var e,t=new J;return e=Be(),t.finishImportDefaultSpecifier(e)}function zt(){var e,t=new J;return re("*"),ue("as")||G(rn.NoAsAfterImportNamespace),q(),e=Be(),t.finishImportNamespaceSpecifier(e)}function Yt(){var e,t=[],n=new J;return wn.inFunctionBody&&G(rn.IllegalImportDeclaration),ae("import"),Dn.type===Gt.StringLiteral?e=Lt():(oe("{")?t=t.concat(Ht()):oe("*")?t.push(zt()):M(Dn)&&!se("default")?(t.push(Vt()),oe(",")&&(q(),oe("*")?t.push(zt()):oe("{")?t=t.concat(Ht()):te(Dn))):te(q()),ue("from")||G(Dn.value?rn.UnexpectedToken:rn.MissingFromClause,Dn.value),q(),e=Lt()),ce(),n.finishImportDeclaration(t,e)}function Jt(){for(var e,t,n,r,i=[];bn>mn&&(t=Dn,t.type===Gt.StringLiteral)&&(e=Qe(),i.push(e),e.expression.type===tn.Literal);)n=on.slice(t.start+1,t.end-1),"use strict"===n?(sn=!0,r&&ne(r,rn.StrictOctalLiteral)):!r&&t.octal&&(r=t);for(;bn>mn&&(e=Qe(),"undefined"!=typeof e);)i.push(e);return i}function Wt(){var e,t;return H(),t=new J,e=Jt(),t.finishProgram(e,wn.sourceType)}function Kt(){var e,t,n,r=[];for(e=0;e<An.tokens.length;++e)t=An.tokens[e],n={type:t.type,value:t.value},t.regex&&(n.regex={pattern:t.regex.pattern,flags:t.regex.flags}),An.range&&(n.range=t.range),An.loc&&(n.loc=t.loc),r.push(n);An.tokens=r}function Qt(e,t,n){var r,i;r=String,"string"==typeof e||e instanceof String||(e=r(e)),on=e,un=0,ln=on.length>0?1:0,cn=0,mn=un,yn=ln,gn=cn,bn=on.length,Dn=null,wn={allowIn:!0,allowYield:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1,curlyStack:[]},An={},t=t||{},t.tokens=!0,An.tokens=[],An.tokenValues=[],An.tokenize=!0,An.delegate=n,An.openParenToken=-1,An.openCurlyToken=-1,An.range="boolean"==typeof t.range&&t.range,An.loc="boolean"==typeof t.loc&&t.loc,"boolean"==typeof t.comment&&t.comment&&(An.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(An.errors=[]);try{if(H(),Dn.type===Gt.EOF)return An.tokens;for(q();Dn.type!==Gt.EOF;)try{q()}catch(a){if(An.errors){K(a);break}throw a}i=An.tokens,"undefined"!=typeof An.errors&&(i.errors=An.errors)}catch(o){throw o}finally{An={}}return i}function Xt(e,t){var n,r;r=String,"string"==typeof e||e instanceof String||(e=r(e)),on=e,un=0,ln=on.length>0?1:0,cn=0,mn=un,yn=ln,gn=cn,bn=on.length,Dn=null,wn={allowIn:!0,allowYield:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1,curlyStack:[],sourceType:"script"},sn=!1,An={},"undefined"!=typeof t&&(An.range="boolean"==typeof t.range&&t.range,An.loc="boolean"==typeof t.loc&&t.loc,An.attachComment="boolean"==typeof t.attachComment&&t.attachComment,An.loc&&null!==t.source&&void 0!==t.source&&(An.source=r(t.source)),"boolean"==typeof t.tokens&&t.tokens&&(An.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(An.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(An.errors=[]),An.attachComment&&(An.range=!0,An.comments=[],An.bottomRightStack=[],An.trailingComments=[],An.leadingComments=[]),"module"===t.sourceType&&(wn.sourceType=t.sourceType,sn=!0));try{n=Wt(),"undefined"!=typeof An.comments&&(n.comments=An.comments),"undefined"!=typeof An.tokens&&(Kt(),n.tokens=An.tokens),"undefined"!=typeof An.errors&&(n.errors=An.errors)}catch(i){throw i}finally{An={}}return n}var Gt,Zt,en,tn,nn,rn,an,on,sn,un,ln,cn,pn,fn,hn,dn,mn,yn,gn,vn,bn,Dn,wn,An,xn,Cn,En;Gt={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9,Template:10},Zt={},Zt[Gt.BooleanLiteral]="Boolean",Zt[Gt.EOF]="<end>",Zt[Gt.Identifier]="Identifier",Zt[Gt.Keyword]="Keyword",Zt[Gt.NullLiteral]="Null",Zt[Gt.NumericLiteral]="Numeric",Zt[Gt.Punctuator]="Punctuator",Zt[Gt.StringLiteral]="String",Zt[Gt.RegularExpression]="RegularExpression",Zt[Gt.Template]="Template",en=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],tn={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},nn={ArrowParameterPlaceHolder:"ArrowParameterPlaceHolder"},rn={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",DefaultRestParameter:"Unexpected token =",ObjectPatternAsRestParameter:"Unexpected token {",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ConstructorSpecialMethod:"Class constructor may not be an accessor",DuplicateConstructor:"A class may only have one constructor",StaticPrototype:"Classes may not have static property named prototype",MissingFromClause:"Unexpected token",NoAsAfterImportNamespace:"Unexpected token",InvalidModuleSpecifier:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalExportDeclaration:"Unexpected token",DuplicateBinding:"Duplicate binding %0"},an={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7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0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
+},W.prototype=J.prototype={processComment:function(){var e,t,n,r,i,a,o=An.bottomRightStack,s=o[o.length-1];if(!(this.type===tn.Program&&this.body.length>0)){if(this.type===tn.BlockStatement&&0===this.body.length){for(t=[],i=An.leadingComments.length-1;i>=0;--i)a=An.leadingComments[i],this.range[1]>=a.range[1]&&(t.unshift(a),An.leadingComments.splice(i,1),An.trailingComments.splice(i,1));if(t.length)return void(this.innerComments=t)}if(An.trailingComments.length>0){for(r=[],i=An.trailingComments.length-1;i>=0;--i)a=An.trailingComments[i],a.range[0]>=this.range[1]&&(r.unshift(a),An.trailingComments.splice(i,1));An.trailingComments=[]}else s&&s.trailingComments&&s.trailingComments[0].range[0]>=this.range[1]&&(r=s.trailingComments,delete s.trailingComments);for(;s&&s.range[0]>=this.range[0];)e=o.pop(),s=o[o.length-1];if(e){if(e.leadingComments){for(n=[],i=e.leadingComments.length-1;i>=0;--i)a=e.leadingComments[i],a.range[1]<=this.range[0]&&(n.unshift(a),e.leadingComments.splice(i,1));e.leadingComments.length||(e.leadingComments=void 0)}}else if(An.leadingComments.length>0)for(n=[],i=An.leadingComments.length-1;i>=0;--i)a=An.leadingComments[i],a.range[1]<=this.range[0]&&(n.unshift(a),An.leadingComments.splice(i,1));n&&n.length>0&&(this.leadingComments=n),r&&r.length>0&&(this.trailingComments=r),o.push(this)}},finish:function(){An.range&&(this.range[1]=fn),An.loc&&(this.loc.end={line:hn,column:fn-dn},An.source&&(this.loc.source=An.source)),An.attachComment&&this.processComment()},finishArrayExpression:function(e){return this.type=tn.ArrayExpression,this.elements=e,this.finish(),this},finishArrayPattern:function(e){return this.type=tn.ArrayPattern,this.elements=e,this.finish(),this},finishArrowFunctionExpression:function(e,t,n,r){return this.type=tn.ArrowFunctionExpression,this.id=null,this.params=e,this.defaults=t,this.body=n,this.generator=!1,this.expression=r,this.finish(),this},finishAssignmentExpression:function(e,t,n){return this.type=tn.AssignmentExpression,this.operator=e,this.left=t,this.right=n,this.finish(),this},finishAssignmentPattern:function(e,t){return this.type=tn.AssignmentPattern,this.left=e,this.right=t,this.finish(),this},finishBinaryExpression:function(e,t,n){return this.type="||"===e||"&&"===e?tn.LogicalExpression:tn.BinaryExpression,this.operator=e,this.left=t,this.right=n,this.finish(),this},finishBlockStatement:function(e){return this.type=tn.BlockStatement,this.body=e,this.finish(),this},finishBreakStatement:function(e){return this.type=tn.BreakStatement,this.label=e,this.finish(),this},finishCallExpression:function(e,t){return this.type=tn.CallExpression,this.callee=e,this.arguments=t,this.finish(),this},finishCatchClause:function(e,t){return this.type=tn.CatchClause,this.param=e,this.body=t,this.finish(),this},finishClassBody:function(e){return this.type=tn.ClassBody,this.body=e,this.finish(),this},finishClassDeclaration:function(e,t,n){return this.type=tn.ClassDeclaration,this.id=e,this.superClass=t,this.body=n,this.finish(),this},finishClassExpression:function(e,t,n){return this.type=tn.ClassExpression,this.id=e,this.superClass=t,this.body=n,this.finish(),this},finishConditionalExpression:function(e,t,n){return this.type=tn.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n,this.finish(),this},finishContinueStatement:function(e){return this.type=tn.ContinueStatement,this.label=e,this.finish(),this},finishDebuggerStatement:function(){return this.type=tn.DebuggerStatement,this.finish(),this},finishDoWhileStatement:function(e,t){return this.type=tn.DoWhileStatement,this.body=e,this.test=t,this.finish(),this},finishEmptyStatement:function(){return this.type=tn.EmptyStatement,this.finish(),this},finishExpressionStatement:function(e){return this.type=tn.ExpressionStatement,this.expression=e,this.finish(),this},finishForStatement:function(e,t,n,r){return this.type=tn.ForStatement,this.init=e,this.test=t,this.update=n,this.body=r,this.finish(),this},finishForOfStatement:function(e,t,n){return this.type=tn.ForOfStatement,this.left=e,this.right=t,this.body=n,this.finish(),this},finishForInStatement:function(e,t,n){return this.type=tn.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1,this.finish(),this},finishFunctionDeclaration:function(e,t,n,r,i){return this.type=tn.FunctionDeclaration,this.id=e,this.params=t,this.defaults=n,this.body=r,this.generator=i,this.expression=!1,this.finish(),this},finishFunctionExpression:function(e,t,n,r,i){return this.type=tn.FunctionExpression,this.id=e,this.params=t,this.defaults=n,this.body=r,this.generator=i,this.expression=!1,this.finish(),this},finishIdentifier:function(e){return this.type=tn.Identifier,this.name=e,this.finish(),this},finishIfStatement:function(e,t,n){return this.type=tn.IfStatement,this.test=e,this.consequent=t,this.alternate=n,this.finish(),this},finishLabeledStatement:function(e,t){return this.type=tn.LabeledStatement,this.label=e,this.body=t,this.finish(),this},finishLiteral:function(e){return this.type=tn.Literal,this.value=e.value,this.raw=on.slice(e.start,e.end),e.regex&&(this.regex=e.regex),this.finish(),this},finishMemberExpression:function(e,t,n){return this.type=tn.MemberExpression,this.computed="["===e,this.object=t,this.property=n,this.finish(),this},finishMetaProperty:function(e,t){return this.type=tn.MetaProperty,this.meta=e,this.property=t,this.finish(),this},finishNewExpression:function(e,t){return this.type=tn.NewExpression,this.callee=e,this.arguments=t,this.finish(),this},finishObjectExpression:function(e){return this.type=tn.ObjectExpression,this.properties=e,this.finish(),this},finishObjectPattern:function(e){return this.type=tn.ObjectPattern,this.properties=e,this.finish(),this},finishPostfixExpression:function(e,t){return this.type=tn.UpdateExpression,this.operator=e,this.argument=t,this.prefix=!1,this.finish(),this},finishProgram:function(e,t){return this.type=tn.Program,this.body=e,this.sourceType=t,this.finish(),this},finishProperty:function(e,t,n,r,i,a){return this.type=tn.Property,this.key=t,this.computed=n,this.value=r,this.kind=e,this.method=i,this.shorthand=a,this.finish(),this},finishRestElement:function(e){return this.type=tn.RestElement,this.argument=e,this.finish(),this},finishReturnStatement:function(e){return this.type=tn.ReturnStatement,this.argument=e,this.finish(),this},finishSequenceExpression:function(e){return this.type=tn.SequenceExpression,this.expressions=e,this.finish(),this},finishSpreadElement:function(e){return this.type=tn.SpreadElement,this.argument=e,this.finish(),this},finishSwitchCase:function(e,t){return this.type=tn.SwitchCase,this.test=e,this.consequent=t,this.finish(),this},finishSuper:function(){return this.type=tn.Super,this.finish(),this},finishSwitchStatement:function(e,t){return this.type=tn.SwitchStatement,this.discriminant=e,this.cases=t,this.finish(),this},finishTaggedTemplateExpression:function(e,t){return this.type=tn.TaggedTemplateExpression,this.tag=e,this.quasi=t,this.finish(),this},finishTemplateElement:function(e,t){return this.type=tn.TemplateElement,this.value=e,this.tail=t,this.finish(),this},finishTemplateLiteral:function(e,t){return this.type=tn.TemplateLiteral,this.quasis=e,this.expressions=t,this.finish(),this},finishThisExpression:function(){return this.type=tn.ThisExpression,this.finish(),this},finishThrowStatement:function(e){return this.type=tn.ThrowStatement,this.argument=e,this.finish(),this},finishTryStatement:function(e,t,n){return this.type=tn.TryStatement,this.block=e,this.guardedHandlers=[],this.handlers=t?[t]:[],this.handler=t,this.finalizer=n,this.finish(),this},finishUnaryExpression:function(e,t){return this.type="++"===e||"--"===e?tn.UpdateExpression:tn.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0,this.finish(),this},finishVariableDeclaration:function(e){return this.type=tn.VariableDeclaration,this.declarations=e,this.kind="var",this.finish(),this},finishLexicalDeclaration:function(e,t){return this.type=tn.VariableDeclaration,this.declarations=e,this.kind=t,this.finish(),this},finishVariableDeclarator:function(e,t){return this.type=tn.VariableDeclarator,this.id=e,this.init=t,this.finish(),this},finishWhileStatement:function(e,t){return this.type=tn.WhileStatement,this.test=e,this.body=t,this.finish(),this},finishWithStatement:function(e,t){return this.type=tn.WithStatement,this.object=e,this.body=t,this.finish(),this},finishExportSpecifier:function(e,t){return this.type=tn.ExportSpecifier,this.exported=t||e,this.local=e,this.finish(),this},finishImportDefaultSpecifier:function(e){return this.type=tn.ImportDefaultSpecifier,this.local=e,this.finish(),this},finishImportNamespaceSpecifier:function(e){return this.type=tn.ImportNamespaceSpecifier,this.local=e,this.finish(),this},finishExportNamedDeclaration:function(e,t,n){return this.type=tn.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n,this.finish(),this},finishExportDefaultDeclaration:function(e){return this.type=tn.ExportDefaultDeclaration,this.declaration=e,this.finish(),this},finishExportAllDeclaration:function(e){return this.type=tn.ExportAllDeclaration,this.source=e,this.finish(),this},finishImportSpecifier:function(e,t){return this.type=tn.ImportSpecifier,this.local=e||t,this.imported=t,this.finish(),this},finishImportDeclaration:function(e,t){return this.type=tn.ImportDeclaration,this.specifiers=e,this.source=t,this.finish(),this},finishYieldExpression:function(e,t){return this.type=tn.YieldExpression,this.argument=e,this.delegate=t,this.finish(),this}},e.version="2.7.1",e.tokenize=Qt,e.parse=Xt,e.Syntax=function(){var e,t={};"function"==typeof Object.create&&(t=Object.create(null));for(e in tn)tn.hasOwnProperty(e)&&(t[e]=tn[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()})},{}],51:[function(e,t,n){t.exports=e("./lib/inherit")},{"./lib/inherit":52}],52:[function(e,n,r){!function(e){function i(e){var t=f(e);if(v)for(var n,r=0;n=w[r++];)e.hasOwnProperty(n)&&t.push(n);return t}function a(e,t,n){for(var r,a,o=i(n),s=0,l=o.length;l>s;)"__self"!==(r=o[s++])&&(a=n[r],y(a)&&(!u||a.toString().indexOf(".__base")>-1)?t[r]=function(n,r){var i=e[n]?e[n]:"__constructor"===n?t.__self.__parent:g;return function(){var e=this.__base;this.__base=i;var t=r.apply(this,arguments);return this.__base=e,t}}(r,a):t[r]=a)}function o(e,t){for(var n,r=1;n=e[r++];)t?y(n)?s.self(t,n.prototype,n):s.self(t,n):t=y(n)?s(e[0],n.prototype,n):s(e[0],n);return t||e[0]}function s(){var e=arguments,t=m(e[0]),n=t||y(e[0]),r=n?t?o(e[0]):e[0]:l,i=e[n?1:0]||{},s=e[n?2:1],u=i.__constructor||n&&r.prototype.__constructor?function(){return this.__constructor.apply(this,arguments)}:n?function(){return r.apply(this,arguments)}:function(){};if(!n)return u.prototype=i,u.prototype.__self=u.prototype.constructor=u,h(u,s);h(u,r),u.__parent=r;var c=r.prototype,f=u.prototype=p(c);return f.__self=f.constructor=u,i&&a(c,f,i),s&&a(r,u,s),u}var u=function(){"_"}.toString().indexOf("_")>-1,l=function(){},c=Object.prototype.hasOwnProperty,p=Object.create||function(e){var t=function(){};return t.prototype=e,new t},f=Object.keys||function(e){var t=[];for(var n in e)c.call(e,n)&&t.push(n);return t},h=function(e,t){for(var n in t)c.call(t,n)&&(e[n]=t[n]);return e},d=Object.prototype.toString,m=Array.isArray||function(e){return"[object Array]"===d.call(e)},y=function(e){return"[object Function]"===d.call(e)},g=function(){},v=!0,b={toString:""};for(var D in b)b.hasOwnProperty(D)&&(v=!1);var w=v?["toString","valueOf"]:null;s.self=function(){var e=arguments,t=m(e[0]),n=t?o(e[0],e[0][0]):e[0],r=e[1],i=e[2],s=n.prototype;return r&&a(s,s,r),i&&a(n,n,i),n};var A=!0;"object"==typeof r&&(n.exports=s,A=!1),"object"==typeof modules&&(modules.define("inherit",function(e){e(s)}),A=!1),"function"==typeof t&&(t(function(e,t,n){n.exports=s}),A=!1),A&&(e.inherit=s)}(this)},{}],53:[function(e,t,n){function r(e,t,n){var r=e?e.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?o(r+n,0):n;else if(n){var s=a(e,t);return r>s&&(t===t?t===e[s]:e[s]!==e[s])?s:-1}return i(e,t,n||0)}var i=e("../internal/baseIndexOf"),a=e("../internal/binaryIndex"),o=Math.max;t.exports=r},{"../internal/baseIndexOf":82,"../internal/binaryIndex":96}],54:[function(e,t,n){function r(e){var t=e?e.length:0;return t?e[t-1]:void 0}t.exports=r},{}],55:[function(e,t,n){function r(e){if(u(e)&&!s(e)&&!(e instanceof i)){if(e instanceof a)return e;if(p.call(e,"__chain__")&&p.call(e,"__wrapped__"))return l(e)}return new a(e)}var i=e("../internal/LazyWrapper"),a=e("../internal/LodashWrapper"),o=e("../internal/baseLodash"),s=e("../lang/isArray"),u=e("../internal/isObjectLike"),l=e("../internal/wrapperClone"),c=Object.prototype,p=c.hasOwnProperty;r.prototype=o.prototype,t.exports=r},{"../internal/LazyWrapper":64,"../internal/LodashWrapper":65,"../internal/baseLodash":86,"../internal/isObjectLike":130,"../internal/wrapperClone":141,"../lang/isArray":144}],56:[function(e,t,n){t.exports=e("./forEach")},{"./forEach":58}],57:[function(e,t,n){var r=e("../internal/baseEach"),i=e("../internal/createFind"),a=i(r);t.exports=a},{"../internal/baseEach":75,"../internal/createFind":106}],58:[function(e,t,n){var r=e("../internal/arrayEach"),i=e("../internal/baseEach"),a=e("../internal/createForEach"),o=a(r,i);t.exports=o},{"../internal/arrayEach":67,"../internal/baseEach":75,"../internal/createForEach":107}],59:[function(e,t,n){function r(e,t,n,r){var f=e?a(e):0;return u(f)||(e=c(e),f=e.length),n="number"!=typeof n||r&&s(t,n,r)?0:0>n?p(f+n,0):n||0,"string"==typeof e||!o(e)&&l(e)?f>=n&&e.indexOf(t,n)>-1:!!f&&i(e,t,n)>-1}var i=e("../internal/baseIndexOf"),a=e("../internal/getLength"),o=e("../lang/isArray"),s=e("../internal/isIterateeCall"),u=e("../internal/isLength"),l=e("../lang/isString"),c=e("../object/values"),p=Math.max;t.exports=r},{"../internal/baseIndexOf":82,"../internal/getLength":116,"../internal/isIterateeCall":126,"../internal/isLength":129,"../lang/isArray":144,"../lang/isString":150,"../object/values":156}],60:[function(e,t,n){function r(e,t,n){var r=s(e)?i:o;return t=a(t,n,3),r(e,t)}var i=e("../internal/arrayMap"),a=e("../internal/baseCallback"),o=e("../internal/baseMap"),s=e("../lang/isArray");t.exports=r},{"../internal/arrayMap":68,"../internal/baseCallback":71,"../internal/baseMap":87,"../lang/isArray":144}],61:[function(e,t,n){var r=e("../internal/getNative"),i=r(Date,"now"),a=i||function(){return(new Date).getTime()};t.exports=a},{"../internal/getNative":118}],62:[function(e,t,n){var r=e("../internal/createWrapper"),i=e("../internal/replaceHolders"),a=e("./restParam"),o=1,s=32,u=a(function(e,t,n){var a=o;if(n.length){var l=i(n,u.placeholder);a|=s}return r(e,a,t,n,l)});u.placeholder={},t.exports=u},{"../internal/createWrapper":110,"../internal/replaceHolders":136,"./restParam":63}],63:[function(e,t,n){function r(e,t){if("function"!=typeof e)throw new TypeError(i);return t=a(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,i=a(n.length-t,0),o=Array(i);++r<i;)o[r]=n[t+r];switch(t){case 0:return e.call(this,o);case 1:return e.call(this,n[0],o);case 2:return e.call(this,n[0],n[1],o)}var s=Array(t+1);for(r=-1;++r<t;)s[r]=n[r];return s[t]=o,e.apply(this,s)}}var i="Expected a function",a=Math.max;t.exports=r},{}],64:[function(e,t,n){function r(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=o,this.__views__=[]}var i=e("./baseCreate"),a=e("./baseLodash"),o=Number.POSITIVE_INFINITY;r.prototype=i(a.prototype),r.prototype.constructor=r,t.exports=r},{"./baseCreate":74,"./baseLodash":86}],65:[function(e,t,n){function r(e,t,n){this.__wrapped__=e,this.__actions__=n||[],this.__chain__=!!t}var i=e("./baseCreate"),a=e("./baseLodash");r.prototype=i(a.prototype),r.prototype.constructor=r,t.exports=r},{"./baseCreate":74,"./baseLodash":86}],66:[function(e,t,n){function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.exports=r},{}],67:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=r},{}],68:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=r},{}],69:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=r},{}],70:[function(e,t,n){function r(e,t){return null==t?e:i(t,a(t),e)}var i=e("./baseCopy"),a=e("../object/keys");t.exports=r},{"../object/keys":153,"./baseCopy":73}],71:[function(e,t,n){function r(e,t,n){var r=typeof e;return"function"==r?void 0===t?e:o(e,t,n):null==e?s:"object"==r?i(e):void 0===t?u(e):a(e,t)}var i=e("./baseMatches"),a=e("./baseMatchesProperty"),o=e("./bindCallback"),s=e("../utility/identity"),u=e("../utility/property");t.exports=r},{"../utility/identity":158,"../utility/property":160,"./baseMatches":88,"./baseMatchesProperty":89,"./bindCallback":98}],72:[function(e,t,n){function r(e,t,n,m,y,g,v){var D;if(n&&(D=y?n(e,m,y):n(e)),void 0!==D)return D;if(!h(e))return e;var w=p(e);if(w){if(D=u(e),!t)return i(e,D)}else{var x=U.call(e),C=x==b;if(x!=A&&x!=d&&(!C||y))return $[x]?l(e,x,t):y?e:{};if(f(e))return y?e:{};if(D=c(C?{}:e),!t)return o(D,e)}g||(g=[]),v||(v=[]);for(var E=g.length;E--;)if(g[E]==e)return v[E];return g.push(e),v.push(D),(w?a:s)(e,function(i,a){D[a]=r(i,t,n,a,e,g,v)}),D}var i=e("./arrayCopy"),a=e("./arrayEach"),o=e("./baseAssign"),s=e("./baseForOwn"),u=e("./initCloneArray"),l=e("./initCloneByTag"),c=e("./initCloneObject"),p=e("../lang/isArray"),f=e("./isHostObject"),h=e("../lang/isObject"),d="[object Arguments]",m="[object Array]",y="[object Boolean]",g="[object Date]",v="[object Error]",b="[object Function]",D="[object Map]",w="[object Number]",A="[object Object]",x="[object RegExp]",C="[object Set]",E="[object String]",F="[object WeakMap]",S="[object ArrayBuffer]",O="[object Float32Array]",j="[object Float64Array]",k="[object Int8Array]",I="[object Int16Array]",B="[object Int32Array]",_="[object Uint8Array]",T="[object Uint8ClampedArray]",P="[object Uint16Array]",L="[object Uint32Array]",$={};$[d]=$[m]=$[S]=$[y]=$[g]=$[O]=$[j]=$[k]=$[I]=$[B]=$[w]=$[A]=$[x]=$[E]=$[_]=$[T]=$[P]=$[L]=!0,$[v]=$[b]=$[D]=$[C]=$[F]=!1;var M=Object.prototype,U=M.toString;t.exports=r},{"../lang/isArray":144,"../lang/isObject":148,"./arrayCopy":66,"./arrayEach":67,"./baseAssign":70,"./baseForOwn":80,"./initCloneArray":120,"./initCloneByTag":121,"./initCloneObject":122,"./isHostObject":124}],73:[function(e,t,n){function r(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var a=t[r];n[a]=e[a]}return n}t.exports=r},{}],74:[function(e,t,n){var r=e("../lang/isObject"),i=function(){function e(){}return function(t){if(r(t)){e.prototype=t;var n=new e;e.prototype=void 0}return n||{}}}();t.exports=i},{"../lang/isObject":148}],75:[function(e,t,n){var r=e("./baseForOwn"),i=e("./createBaseEach"),a=i(r);t.exports=a},{"./baseForOwn":80,"./createBaseEach":102}],76:[function(e,t,n){function r(e,t,n,r){var i;return n(e,function(e,n,a){return t(e,n,a)?(i=r?n:e,!1):void 0}),i}t.exports=r},{}],77:[function(e,t,n){function r(e,t,n){for(var r=e.length,i=n?r:-1;n?i--:++i<r;)if(t(e[i],i,e))return i;return-1}t.exports=r},{}],78:[function(e,t,n){var r=e("./createBaseFor"),i=r();t.exports=i},{"./createBaseFor":103}],79:[function(e,t,n){function r(e,t){return i(e,t,a)}var i=e("./baseFor"),a=e("../object/keysIn");t.exports=r},{"../object/keysIn":154,"./baseFor":78}],80:[function(e,t,n){function r(e,t){return i(e,t,a)}var i=e("./baseFor"),a=e("../object/keys");t.exports=r},{"../object/keys":153,"./baseFor":78}],81:[function(e,t,n){function r(e,t,n){if(null!=e){e=i(e),void 0!==n&&n in e&&(t=[n]);for(var r=0,a=t.length;null!=e&&a>r;)e=i(e)[t[r++]];return r&&r==a?e:void 0}}var i=e("./toObject");t.exports=r},{"./toObject":139}],82:[function(e,t,n){function r(e,t,n){if(t!==t)return i(e,n);for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}var i=e("./indexOfNaN");t.exports=r},{"./indexOfNaN":119}],83:[function(e,t,n){function r(e,t,n,s,u,l){return e===t?!0:null==e||null==t||!a(e)&&!o(t)?e!==e&&t!==t:i(e,t,r,n,s,u,l)}var i=e("./baseIsEqualDeep"),a=e("../lang/isObject"),o=e("./isObjectLike");t.exports=r},{"../lang/isObject":148,"./baseIsEqualDeep":84,"./isObjectLike":130}],84:[function(e,t,n){function r(e,t,n,r,h,y,g){var v=s(e),b=s(t),D=p,w=p;v||(D=m.call(e),D==c?D=f:D!=f&&(v=l(e))),b||(w=m.call(t),w==c?w=f:w!=f&&(b=l(t)));var A=D==f&&!u(e),x=w==f&&!u(t),C=D==w;if(C&&!v&&!A)return a(e,t,D);if(!h){var E=A&&d.call(e,"__wrapped__"),F=x&&d.call(t,"__wrapped__");if(E||F)return n(E?e.value():e,F?t.value():t,r,h,y,g)}if(!C)return!1;y||(y=[]),g||(g=[]);for(var S=y.length;S--;)if(y[S]==e)return g[S]==t;y.push(e),g.push(t);var O=(v?i:o)(e,t,n,r,h,y,g);return y.pop(),g.pop(),O}var i=e("./equalArrays"),a=e("./equalByTag"),o=e("./equalObjects"),s=e("../lang/isArray"),u=e("./isHostObject"),l=e("../lang/isTypedArray"),c="[object Arguments]",p="[object Array]",f="[object Object]",h=Object.prototype,d=h.hasOwnProperty,m=h.toString;t.exports=r},{"../lang/isArray":144,"../lang/isTypedArray":151,"./equalArrays":111,"./equalByTag":112,"./equalObjects":113,"./isHostObject":124}],85:[function(e,t,n){function r(e,t,n){var r=t.length,o=r,s=!n;if(null==e)return!o;for(e=a(e);r--;){var u=t[r];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++r<o;){u=t[r];var l=u[0],c=e[l],p=u[1];if(s&&u[2]){if(void 0===c&&!(l in e))return!1}else{var f=n?n(c,p,l):void 0;if(!(void 0===f?i(p,c,n,!0):f))return!1}}return!0}var i=e("./baseIsEqual"),a=e("./toObject");t.exports=r},{"./baseIsEqual":83,"./toObject":139}],86:[function(e,t,n){function r(){}t.exports=r},{}],87:[function(e,t,n){function r(e,t){var n=-1,r=a(e)?Array(e.length):[];return i(e,function(e,i,a){r[++n]=t(e,i,a)}),r}var i=e("./baseEach"),a=e("./isArrayLike");t.exports=r},{"./baseEach":75,"./isArrayLike":123}],88:[function(e,t,n){function r(e){var t=a(e);if(1==t.length&&t[0][2]){var n=t[0][0],r=t[0][1];return function(e){return null==e?!1:(e=o(e),e[n]===r&&(void 0!==r||n in e))}}return function(e){return i(e,t)}}var i=e("./baseIsMatch"),a=e("./getMatchData"),o=e("./toObject");t.exports=r},{"./baseIsMatch":85,"./getMatchData":117,"./toObject":139}],89:[function(e,t,n){function r(e,t){var n=s(e),r=u(e)&&l(t),h=e+"";return e=f(e),function(s){if(null==s)return!1;var u=h;if(s=p(s),(n||!r)&&!(u in s)){if(s=1==e.length?s:i(s,o(e,0,-1)),null==s)return!1;u=c(e),s=p(s)}return s[u]===t?void 0!==t||u in s:a(t,s[u],void 0,!0)}}var i=e("./baseGet"),a=e("./baseIsEqual"),o=e("./baseSlice"),s=e("../lang/isArray"),u=e("./isKey"),l=e("./isStrictComparable"),c=e("../array/last"),p=e("./toObject"),f=e("./toPath");t.exports=r},{"../array/last":54,"../lang/isArray":144,"./baseGet":81,"./baseIsEqual":83,"./baseSlice":93,"./isKey":127,"./isStrictComparable":131,"./toObject":139,"./toPath":140}],90:[function(e,t,n){function r(e){return function(t){return null==t?void 0:i(t)[e]}}var i=e("./toObject");t.exports=r},{"./toObject":139}],91:[function(e,t,n){function r(e){var t=e+"";return e=a(e),function(n){return i(n,e,t)}}var i=e("./baseGet"),a=e("./toPath");t.exports=r},{"./baseGet":81,"./toPath":140}],92:[function(e,t,n){var r=e("../utility/identity"),i=e("./metaMap"),a=i?function(e,t){return i.set(e,t),e}:r;t.exports=a},{"../utility/identity":158,"./metaMap":133}],93:[function(e,t,n){function r(e,t,n){var r=-1,i=e.length;t=null==t?0:+t||0,0>t&&(t=-t>i?0:i+t),n=void 0===n||n>i?i:+n||0,0>n&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}t.exports=r},{}],94:[function(e,t,n){function r(e){return null==e?"":e+""}t.exports=r},{}],95:[function(e,t,n){function r(e,t){for(var n=-1,r=t.length,i=Array(r);++n<r;)i[n]=e[t[n]];return i}t.exports=r},{}],96:[function(e,t,n){function r(e,t,n){var r=0,o=e?e.length:r;if("number"==typeof t&&t===t&&s>=o){for(;o>r;){var u=r+o>>>1,l=e[u];(n?t>=l:t>l)&&null!==l?r=u+1:o=u}return o}return i(e,t,a,n)}var i=e("./binaryIndexBy"),a=e("../utility/identity"),o=4294967295,s=o>>>1;t.exports=r},{"../utility/identity":158,"./binaryIndexBy":97}],97:[function(e,t,n){function r(e,t,n,r){t=n(t);for(var o=0,u=e?e.length:0,l=t!==t,c=null===t,p=void 0===t;u>o;){var f=i((o+u)/2),h=n(e[f]),d=void 0!==h,m=h===h;if(l)var y=m||r;else y=c?m&&d&&(r||null!=h):p?m&&(r||d):null==h?!1:r?t>=h:t>h;y?o=f+1:u=f}return a(u,s)}var i=Math.floor,a=Math.min,o=4294967295,s=o-1;t.exports=r},{}],98:[function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,a){return e.call(t,n,r,i,a)};case 5:return function(n,r,i,a,o){return e.call(t,n,r,i,a,o)}}return function(){return e.apply(t,arguments)}}var i=e("../utility/identity");t.exports=r},{"../utility/identity":158}],99:[function(e,t,n){(function(e){function n(e){var t=new r(e.byteLength),n=new i(t);return n.set(new i(e)),t}var r=e.ArrayBuffer,i=e.Uint8Array;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],100:[function(e,t,n){function r(e,t,n){for(var r=n.length,a=-1,o=i(e.length-r,0),s=-1,u=t.length,l=Array(u+o);++s<u;)l[s]=t[s];for(;++a<r;)l[n[a]]=e[a];for(;o--;)l[s++]=e[a++];return l}var i=Math.max;t.exports=r},{}],101:[function(e,t,n){function r(e,t,n){for(var r=-1,a=n.length,o=-1,s=i(e.length-a,0),u=-1,l=t.length,c=Array(s+l);++o<s;)c[o]=e[o];for(var p=o;++u<l;)c[p+u]=t[u];for(;++r<a;)c[p+n[r]]=e[o++];return c}var i=Math.max;t.exports=r},{}],102:[function(e,t,n){function r(e,t){return function(n,r){var s=n?i(n):0;if(!a(s))return e(n,r);for(var u=t?s:-1,l=o(n);(t?u--:++u<s)&&r(l[u],u,l)!==!1;);return n}}var i=e("./getLength"),a=e("./isLength"),o=e("./toObject");t.exports=r},{"./getLength":116,"./isLength":129,"./toObject":139}],103:[function(e,t,n){function r(e){return function(t,n,r){for(var a=i(t),o=r(t),s=o.length,u=e?s:-1;e?u--:++u<s;){var l=o[u];if(n(a[l],l,a)===!1)break}return t}}var i=e("./toObject");t.exports=r},{"./toObject":139}],104:[function(e,t,n){(function(n){function r(e,t){function r(){var i=this&&this!==n&&this instanceof r?a:e;return i.apply(t,arguments)}var a=i(e);return r}var i=e("./createCtorWrapper");t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./createCtorWrapper":105}],105:[function(e,t,n){function r(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=i(e.prototype),r=e.apply(n,t);return a(r)?r:n}}var i=e("./baseCreate"),a=e("../lang/isObject");t.exports=r},{"../lang/isObject":148,"./baseCreate":74}],106:[function(e,t,n){function r(e,t){return function(n,r,u){if(r=i(r,u,3),s(n)){var l=o(n,r,t);return l>-1?n[l]:void 0}return a(n,r,e)}}var i=e("./baseCallback"),a=e("./baseFind"),o=e("./baseFindIndex"),s=e("../lang/isArray");t.exports=r},{"../lang/isArray":144,"./baseCallback":71,"./baseFind":76,"./baseFindIndex":77}],107:[function(e,t,n){function r(e,t){return function(n,r,o){return"function"==typeof r&&void 0===o&&a(n)?e(n,r):t(n,i(r,o,3))}}var i=e("./bindCallback"),a=e("../lang/isArray");t.exports=r},{"../lang/isArray":144,"./bindCallback":98}],108:[function(e,t,n){(function(n){function r(e,t,w,A,x,C,E,F,S,O){function j(){for(var d=arguments.length,m=d,y=Array(d);m--;)y[m]=arguments[m];if(A&&(y=a(y,A,x)),C&&(y=o(y,C,E)),_||P){var b=j.placeholder,$=c(y,b);if(d-=$.length,O>d){var M=F?i(F):void 0,U=D(O-d,0),R=_?$:void 0,N=_?void 0:$,q=_?y:void 0,H=_?void 0:y;t|=_?g:v,t&=~(_?v:g),T||(t&=~(f|h));var V=[e,t,w,q,R,H,N,M,S,U],z=r.apply(void 0,V);return u(e)&&p(z,V),z.placeholder=b,z}}var Y=I?w:this,J=B?Y[e]:e;return F&&(y=l(y,F)),k&&S<y.length&&(y.length=S),this&&this!==n&&this instanceof j&&(J=L||s(e)),J.apply(Y,y)}var k=t&b,I=t&f,B=t&h,_=t&m,T=t&d,P=t&y,L=B?void 0:s(e);return j}var i=e("./arrayCopy"),a=e("./composeArgs"),o=e("./composeArgsRight"),s=e("./createCtorWrapper"),u=e("./isLaziable"),l=e("./reorder"),c=e("./replaceHolders"),p=e("./setData"),f=1,h=2,d=4,m=8,y=16,g=32,v=64,b=128,D=Math.max;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./arrayCopy":66,"./composeArgs":100,"./composeArgsRight":101,"./createCtorWrapper":105,"./isLaziable":128,"./reorder":135,"./replaceHolders":136,"./setData":137}],109:[function(e,t,n){(function(n){function r(e,t,r,o){function s(){for(var t=-1,i=arguments.length,a=-1,c=o.length,p=Array(c+i);++a<c;)p[a]=o[a];for(;i--;)p[a++]=arguments[++t];var f=this&&this!==n&&this instanceof s?l:e;return f.apply(u?r:this,p)}var u=t&a,l=i(e);return s}var i=e("./createCtorWrapper"),a=1;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./createCtorWrapper":105}],110:[function(e,t,n){function r(e,t,n,r,g,v,b,D){var w=t&f;if(!w&&"function"!=typeof e)throw new TypeError(m);var A=r?r.length:0;if(A||(t&=~(h|d),r=g=void 0),A-=g?g.length:0,t&d){var x=r,C=g;r=g=void 0}var E=w?void 0:u(e),F=[e,t,n,r,g,x,C,v,b,D];if(E&&(l(F,E),t=F[1],D=F[9]),F[9]=null==D?w?0:e.length:y(D-A,0)||0,t==p)var S=a(F[0],F[2]);else S=t!=h&&t!=(p|h)||F[4].length?o.apply(void 0,F):s.apply(void 0,F);var O=E?i:c;return O(S,F)}var i=e("./baseSetData"),a=e("./createBindWrapper"),o=e("./createHybridWrapper"),s=e("./createPartialWrapper"),u=e("./getData"),l=e("./mergeData"),c=e("./setData"),p=1,f=2,h=32,d=64,m="Expected a function",y=Math.max;t.exports=r},{"./baseSetData":92,"./createBindWrapper":104,"./createHybridWrapper":108,"./createPartialWrapper":109,"./getData":114,"./mergeData":132,"./setData":137}],111:[function(e,t,n){function r(e,t,n,r,a,o,s){var u=-1,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;for(;++u<l;){var p=e[u],f=t[u],h=r?r(a?f:p,a?p:f,u):void 0;if(void 0!==h){if(h)continue;return!1}if(a){if(!i(t,function(e){return p===e||n(p,e,r,a,o,s)}))return!1}else if(p!==f&&!n(p,f,r,a,o,s))return!1}return!0}var i=e("./arraySome");t.exports=r},{"./arraySome":69}],112:[function(e,t,n){function r(e,t,n){switch(n){case i:case a:return+e==+t;case o:return e.name==t.name&&e.message==t.message;case s:return e!=+e?t!=+t:e==+t;case u:case l:return e==t+""}return!1}var i="[object Boolean]",a="[object Date]",o="[object Error]",s="[object Number]",u="[object RegExp]",l="[object String]";t.exports=r},{}],113:[function(e,t,n){function r(e,t,n,r,a,s,u){var l=i(e),c=l.length,p=i(t),f=p.length;if(c!=f&&!a)return!1;for(var h=c;h--;){var d=l[h];if(!(a?d in t:o.call(t,d)))return!1}for(var m=a;++h<c;){d=l[h];var y=e[d],g=t[d],v=r?r(a?g:y,a?y:g,d):void 0;if(!(void 0===v?n(y,g,r,a,s,u):v))return!1;m||(m="constructor"==d)}if(!m){var b=e.constructor,D=t.constructor;if(b!=D&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof D&&D instanceof D))return!1}return!0}var i=e("../object/keys"),a=Object.prototype,o=a.hasOwnProperty;t.exports=r},{"../object/keys":153}],114:[function(e,t,n){var r=e("./metaMap"),i=e("../utility/noop"),a=r?function(e){return r.get(e)}:i;t.exports=a},{"../utility/noop":159,"./metaMap":133}],115:[function(e,t,n){function r(e){for(var t=e.name+"",n=i[t],r=n?n.length:0;r--;){var a=n[r],o=a.func;if(null==o||o==e)return a.name}return t}var i=e("./realNames");t.exports=r},{"./realNames":134}],116:[function(e,t,n){var r=e("./baseProperty"),i=r("length");t.exports=i},{"./baseProperty":90}],117:[function(e,t,n){function r(e){for(var t=a(e),n=t.length;n--;)t[n][2]=i(t[n][1]);return t}var i=e("./isStrictComparable"),a=e("../object/pairs");t.exports=r},{"../object/pairs":155,"./isStrictComparable":131}],118:[function(e,t,n){function r(e,t){var n=null==e?void 0:e[t];return i(n)?n:void 0}var i=e("../lang/isNative");t.exports=r},{"../lang/isNative":147}],119:[function(e,t,n){
+function r(e,t,n){for(var r=e.length,i=t+(n?0:-1);n?i--:++i<r;){var a=e[i];if(a!==a)return i}return-1}t.exports=r},{}],120:[function(e,t,n){function r(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&a.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var i=Object.prototype,a=i.hasOwnProperty;t.exports=r},{}],121:[function(e,t,n){(function(n){function r(e,t,n){var r=e.constructor;switch(t){case c:return i(e);case a:case o:return new r(+e);case p:case f:case h:case d:case m:case y:case g:case v:case b:r instanceof r&&(r=A[t]);var w=e.buffer;return new r(n?i(w):w,e.byteOffset,e.length);case s:case l:return new r(e);case u:var x=new r(e.source,D.exec(e));x.lastIndex=e.lastIndex}return x}var i=e("./bufferClone"),a="[object Boolean]",o="[object Date]",s="[object Number]",u="[object RegExp]",l="[object String]",c="[object ArrayBuffer]",p="[object Float32Array]",f="[object Float64Array]",h="[object Int8Array]",d="[object Int16Array]",m="[object Int32Array]",y="[object Uint8Array]",g="[object Uint8ClampedArray]",v="[object Uint16Array]",b="[object Uint32Array]",D=/\w*$/,w=n.Uint8Array,A={};A[p]=n.Float32Array,A[f]=n.Float64Array,A[h]=n.Int8Array,A[d]=n.Int16Array,A[m]=n.Int32Array,A[y]=w,A[g]=n.Uint8ClampedArray,A[v]=n.Uint16Array,A[b]=n.Uint32Array,t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./bufferClone":99}],122:[function(e,t,n){function r(e){var t=e.constructor;return"function"==typeof t&&t instanceof t||(t=Object),new t}t.exports=r},{}],123:[function(e,t,n){function r(e){return null!=e&&a(i(e))}var i=e("./getLength"),a=e("./isLength");t.exports=r},{"./getLength":116,"./isLength":129}],124:[function(e,t,n){var r=function(){try{Object({toString:0}+"")}catch(e){return function(){return!1}}return function(e){return"function"!=typeof e.toString&&"string"==typeof(e+"")}}();t.exports=r},{}],125:[function(e,t,n){function r(e,t){return e="number"==typeof e||i.test(e)?+e:-1,t=null==t?a:t,e>-1&&e%1==0&&t>e}var i=/^\d+$/,a=9007199254740991;t.exports=r},{}],126:[function(e,t,n){function r(e,t,n){if(!o(n))return!1;var r=typeof t;if("number"==r?i(n)&&a(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=e("./isArrayLike"),a=e("./isIndex"),o=e("../lang/isObject");t.exports=r},{"../lang/isObject":148,"./isArrayLike":123,"./isIndex":125}],127:[function(e,t,n){function r(e,t){var n=typeof e;if("string"==n&&s.test(e)||"number"==n)return!0;if(i(e))return!1;var r=!o.test(e);return r||null!=t&&e in a(t)}var i=e("../lang/isArray"),a=e("./toObject"),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=r},{"../lang/isArray":144,"./toObject":139}],128:[function(e,t,n){function r(e){var t=o(e),n=s[t];if("function"!=typeof n||!(t in i.prototype))return!1;if(e===n)return!0;var r=a(n);return!!r&&e===r[0]}var i=e("./LazyWrapper"),a=e("./getData"),o=e("./getFuncName"),s=e("../chain/lodash");t.exports=r},{"../chain/lodash":55,"./LazyWrapper":64,"./getData":114,"./getFuncName":115}],129:[function(e,t,n){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&i>=e}var i=9007199254740991;t.exports=r},{}],130:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}t.exports=r},{}],131:[function(e,t,n){function r(e){return e===e&&!i(e)}var i=e("../lang/isObject");t.exports=r},{"../lang/isObject":148}],132:[function(e,t,n){function r(e,t){var n=e[1],r=t[1],m=n|r,y=p>m,g=r==p&&n==c||r==p&&n==f&&e[7].length<=t[8]||r==(p|f)&&n==c;if(!y&&!g)return e;r&u&&(e[2]=t[2],m|=n&u?0:l);var v=t[3];if(v){var b=e[3];e[3]=b?a(b,v,t[4]):i(v),e[4]=b?s(e[3],h):i(t[4])}return v=t[5],v&&(b=e[5],e[5]=b?o(b,v,t[6]):i(v),e[6]=b?s(e[5],h):i(t[6])),v=t[7],v&&(e[7]=i(v)),r&p&&(e[8]=null==e[8]?t[8]:d(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=m,e}var i=e("./arrayCopy"),a=e("./composeArgs"),o=e("./composeArgsRight"),s=e("./replaceHolders"),u=1,l=4,c=8,p=128,f=256,h="__lodash_placeholder__",d=Math.min;t.exports=r},{"./arrayCopy":66,"./composeArgs":100,"./composeArgsRight":101,"./replaceHolders":136}],133:[function(e,t,n){(function(n){var r=e("./getNative"),i=r(n,"WeakMap"),a=i&&new i;t.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./getNative":118}],134:[function(e,t,n){var r={};t.exports=r},{}],135:[function(e,t,n){function r(e,t){for(var n=e.length,r=o(t.length,n),s=i(e);r--;){var u=t[r];e[r]=a(u,n)?s[u]:void 0}return e}var i=e("./arrayCopy"),a=e("./isIndex"),o=Math.min;t.exports=r},{"./arrayCopy":66,"./isIndex":125}],136:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,a=-1,o=[];++n<r;)e[n]===t&&(e[n]=i,o[++a]=n);return o}var i="__lodash_placeholder__";t.exports=r},{}],137:[function(e,t,n){var r=e("./baseSetData"),i=e("../date/now"),a=150,o=16,s=function(){var e=0,t=0;return function(n,s){var u=i(),l=o-(u-t);if(t=u,l>0){if(++e>=a)return n}else e=0;return r(n,s)}}();t.exports=s},{"../date/now":61,"./baseSetData":92}],138:[function(e,t,n){function r(e){for(var t=l(e),n=t.length,r=n&&e.length,c=!!r&&s(r)&&(a(e)||i(e)||u(e)),f=-1,h=[];++f<n;){var d=t[f];(c&&o(d,r)||p.call(e,d))&&h.push(d)}return h}var i=e("../lang/isArguments"),a=e("../lang/isArray"),o=e("./isIndex"),s=e("./isLength"),u=e("../lang/isString"),l=e("../object/keysIn"),c=Object.prototype,p=c.hasOwnProperty;t.exports=r},{"../lang/isArguments":143,"../lang/isArray":144,"../lang/isString":150,"../object/keysIn":154,"./isIndex":125,"./isLength":129}],139:[function(e,t,n){function r(e){if(o.unindexedChars&&a(e)){for(var t=-1,n=e.length,r=Object(e);++t<n;)r[t]=e.charAt(t);return r}return i(e)?e:Object(e)}var i=e("../lang/isObject"),a=e("../lang/isString"),o=e("../support");t.exports=r},{"../lang/isObject":148,"../lang/isString":150,"../support":157}],140:[function(e,t,n){function r(e){if(a(e))return e;var t=[];return i(e).replace(o,function(e,n,r,i){t.push(r?i.replace(s,"$1"):n||e)}),t}var i=e("./baseToString"),a=e("../lang/isArray"),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,s=/\\(\\)?/g;t.exports=r},{"../lang/isArray":144,"./baseToString":94}],141:[function(e,t,n){function r(e){return e instanceof i?e.clone():new a(e.__wrapped__,e.__chain__,o(e.__actions__))}var i=e("./LazyWrapper"),a=e("./LodashWrapper"),o=e("./arrayCopy");t.exports=r},{"./LazyWrapper":64,"./LodashWrapper":65,"./arrayCopy":66}],142:[function(e,t,n){function r(e,t,n){return"function"==typeof t?i(e,!0,a(t,n,3)):i(e,!0)}var i=e("../internal/baseClone"),a=e("../internal/bindCallback");t.exports=r},{"../internal/baseClone":72,"../internal/bindCallback":98}],143:[function(e,t,n){function r(e){return a(e)&&i(e)&&s.call(e,"callee")&&!u.call(e,"callee")}var i=e("../internal/isArrayLike"),a=e("../internal/isObjectLike"),o=Object.prototype,s=o.hasOwnProperty,u=o.propertyIsEnumerable;t.exports=r},{"../internal/isArrayLike":123,"../internal/isObjectLike":130}],144:[function(e,t,n){var r=e("../internal/getNative"),i=e("../internal/isLength"),a=e("../internal/isObjectLike"),o="[object Array]",s=Object.prototype,u=s.toString,l=r(Array,"isArray"),c=l||function(e){return a(e)&&i(e.length)&&u.call(e)==o};t.exports=c},{"../internal/getNative":118,"../internal/isLength":129,"../internal/isObjectLike":130}],145:[function(e,t,n){function r(e){return null==e?!0:o(e)&&(a(e)||l(e)||i(e)||u(e)&&s(e.splice))?!e.length:!c(e).length}var i=e("./isArguments"),a=e("./isArray"),o=e("../internal/isArrayLike"),s=e("./isFunction"),u=e("../internal/isObjectLike"),l=e("./isString"),c=e("../object/keys");t.exports=r},{"../internal/isArrayLike":123,"../internal/isObjectLike":130,"../object/keys":153,"./isArguments":143,"./isArray":144,"./isFunction":146,"./isString":150}],146:[function(e,t,n){function r(e){return i(e)&&s.call(e)==a}var i=e("./isObject"),a="[object Function]",o=Object.prototype,s=o.toString;t.exports=r},{"./isObject":148}],147:[function(e,t,n){function r(e){return null==e?!1:i(e)?p.test(l.call(e)):o(e)&&(a(e)?p:s).test(e)}var i=e("./isFunction"),a=e("../internal/isHostObject"),o=e("../internal/isObjectLike"),s=/^\[object .+?Constructor\]$/,u=Object.prototype,l=Function.prototype.toString,c=u.hasOwnProperty,p=RegExp("^"+l.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},{"../internal/isHostObject":124,"../internal/isObjectLike":130,"./isFunction":146}],148:[function(e,t,n){function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=r},{}],149:[function(e,t,n){function r(e){var t;if(!s(e)||f.call(e)!=l||o(e)||a(e)||!p.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return u.ownLast?(i(e,function(e,t,r){return n=p.call(r,t),!1}),n!==!1):(i(e,function(e,t){n=t}),void 0===n||p.call(e,n))}var i=e("../internal/baseForIn"),a=e("./isArguments"),o=e("../internal/isHostObject"),s=e("../internal/isObjectLike"),u=e("../support"),l="[object Object]",c=Object.prototype,p=c.hasOwnProperty,f=c.toString;t.exports=r},{"../internal/baseForIn":79,"../internal/isHostObject":124,"../internal/isObjectLike":130,"../support":157,"./isArguments":143}],150:[function(e,t,n){function r(e){return"string"==typeof e||i(e)&&s.call(e)==a}var i=e("../internal/isObjectLike"),a="[object String]",o=Object.prototype,s=o.toString;t.exports=r},{"../internal/isObjectLike":130}],151:[function(e,t,n){function r(e){return a(e)&&i(e.length)&&!!j[I.call(e)]}var i=e("../internal/isLength"),a=e("../internal/isObjectLike"),o="[object Arguments]",s="[object Array]",u="[object Boolean]",l="[object Date]",c="[object Error]",p="[object Function]",f="[object Map]",h="[object Number]",d="[object Object]",m="[object RegExp]",y="[object Set]",g="[object String]",v="[object WeakMap]",b="[object ArrayBuffer]",D="[object Float32Array]",w="[object Float64Array]",A="[object Int8Array]",x="[object Int16Array]",C="[object Int32Array]",E="[object Uint8Array]",F="[object Uint8ClampedArray]",S="[object Uint16Array]",O="[object Uint32Array]",j={};j[D]=j[w]=j[A]=j[x]=j[C]=j[E]=j[F]=j[S]=j[O]=!0,j[o]=j[s]=j[b]=j[u]=j[l]=j[c]=j[p]=j[f]=j[h]=j[d]=j[m]=j[y]=j[g]=j[v]=!1;var k=Object.prototype,I=k.toString;t.exports=r},{"../internal/isLength":129,"../internal/isObjectLike":130}],152:[function(e,t,n){function r(e){return void 0===e}t.exports=r},{}],153:[function(e,t,n){var r=e("../internal/getNative"),i=e("../internal/isArrayLike"),a=e("../lang/isObject"),o=e("../internal/shimKeys"),s=e("../support"),u=r(Object,"keys"),l=u?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||("function"==typeof e?s.enumPrototypes:i(e))?o(e):a(e)?u(e):[]}:o;t.exports=l},{"../internal/getNative":118,"../internal/isArrayLike":123,"../internal/shimKeys":138,"../lang/isObject":148,"../support":157}],154:[function(e,t,n){function r(e){if(null==e)return[];c(e)||(e=Object(e));var t=e.length;t=t&&l(t)&&(o(e)||a(e)||p(e))&&t||0;for(var n=e.constructor,r=-1,i=s(n)&&n.prototype||C,h=i===e,d=Array(t),m=t>0,g=f.enumErrorProps&&(e===x||e instanceof Error),v=f.enumPrototypes&&s(e);++r<t;)d[r]=r+"";for(var D in e)v&&"prototype"==D||g&&("message"==D||"name"==D)||m&&u(D,t)||"constructor"==D&&(h||!F.call(e,D))||d.push(D);if(f.nonEnumShadows&&e!==C){var j=e===E?w:e===x?y:S.call(e),k=O[j]||O[b];for(j==b&&(i=C),t=A.length;t--;){D=A[t];var I=k[D];h&&I||(I?!F.call(e,D):e[D]===i[D])||d.push(D)}}return d}var i=e("../internal/arrayEach"),a=e("../lang/isArguments"),o=e("../lang/isArray"),s=e("../lang/isFunction"),u=e("../internal/isIndex"),l=e("../internal/isLength"),c=e("../lang/isObject"),p=e("../lang/isString"),f=e("../support"),h="[object Array]",d="[object Boolean]",m="[object Date]",y="[object Error]",g="[object Function]",v="[object Number]",b="[object Object]",D="[object RegExp]",w="[object String]",A=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],x=Error.prototype,C=Object.prototype,E=String.prototype,F=C.hasOwnProperty,S=C.toString,O={};O[h]=O[m]=O[v]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},O[d]=O[w]={constructor:!0,toString:!0,valueOf:!0},O[y]=O[g]=O[D]={constructor:!0,toString:!0},O[b]={constructor:!0},i(A,function(e){for(var t in O)if(F.call(O,t)){var n=O[t];n[e]=F.call(n,e)}}),t.exports=r},{"../internal/arrayEach":67,"../internal/isIndex":125,"../internal/isLength":129,"../lang/isArguments":143,"../lang/isArray":144,"../lang/isFunction":146,"../lang/isObject":148,"../lang/isString":150,"../support":157}],155:[function(e,t,n){function r(e){e=a(e);for(var t=-1,n=i(e),r=n.length,o=Array(r);++t<r;){var s=n[t];o[t]=[s,e[s]]}return o}var i=e("./keys"),a=e("../internal/toObject");t.exports=r},{"../internal/toObject":139,"./keys":153}],156:[function(e,t,n){function r(e){return i(e,a(e))}var i=e("../internal/baseValues"),a=e("./keys");t.exports=r},{"../internal/baseValues":95,"./keys":153}],157:[function(e,t,n){var r=Array.prototype,i=Error.prototype,a=Object.prototype,o=a.propertyIsEnumerable,s=r.splice,u={};!function(e){var t=function(){this.x=e},n={0:e,length:e},r=[];t.prototype={valueOf:e,y:e};for(var a in new t)r.push(a);u.enumErrorProps=o.call(i,"message")||o.call(i,"name"),u.enumPrototypes=o.call(t,"prototype"),u.nonEnumShadows=!/valueOf/.test(r),u.ownLast="x"!=r[0],u.spliceObjects=(s.call(n,0,1),!n[0]),u.unindexedChars="x"[0]+Object("x")[0]!="xx"}(1,0),t.exports=u},{}],158:[function(e,t,n){function r(e){return e}t.exports=r},{}],159:[function(e,t,n){function r(){}t.exports=r},{}],160:[function(e,t,n){function r(e){return o(e)?i(e):a(e)}var i=e("../internal/baseProperty"),a=e("../internal/basePropertyDeep"),o=e("../internal/isKey");t.exports=r},{"../internal/baseProperty":90,"../internal/basePropertyDeep":91,"../internal/isKey":127}],161:[function(e,n,r){(function(e){!function(e){"use strict";if("function"==typeof bootstrap)bootstrap("promise",e);else if("object"==typeof r&&"object"==typeof n)n.exports=e();else if("function"==typeof t&&t.amd)t(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=e}else{if("undefined"==typeof window&&"undefined"==typeof self)throw new Error("This environment was not anticipated by Q. Please file a bug.");var i="undefined"!=typeof window?window:self,a=i.Q;i.Q=e(),i.Q.noConflict=function(){return i.Q=a,this}}}(function(){"use strict";function t(e){return function(){return K.apply(e,arguments)}}function n(e){return e===Object(e)}function r(e){return"[object StopIteration]"===re(e)||e instanceof z}function i(e,t){if(q&&t.stack&&"object"==typeof e&&null!==e&&e.stack&&-1===e.stack.indexOf(ie)){for(var n=[],r=t;r;r=r.source)r.stack&&n.unshift(r.stack);n.unshift(e.stack);var i=n.join("\n"+ie+"\n");e.stack=a(i)}}function a(e){for(var t=e.split("\n"),n=[],r=0;r<t.length;++r){var i=t[r];u(i)||o(i)||!i||n.push(i)}return n.join("\n")}function o(e){return-1!==e.indexOf("(module.js:")||-1!==e.indexOf("(node.js:")}function s(e){var t=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);if(t)return[t[1],Number(t[2])];var n=/at ([^ ]+):(\d+):(?:\d+)$/.exec(e);if(n)return[n[1],Number(n[2])];var r=/.*@(.+):(\d+)$/.exec(e);return r?[r[1],Number(r[2])]:void 0}function u(e){var t=s(e);if(!t)return!1;var n=t[0],r=t[1];return n===V&&r>=Y&&le>=r}function l(){if(q)try{throw new Error}catch(e){var t=e.stack.split("\n"),n=t[0].indexOf("@")>0?t[1]:t[2],r=s(n);if(!r)return;return V=r[0],r[1]}}function c(e,t,n){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t+" is deprecated, use "+n+" instead.",new Error("").stack),e.apply(e,arguments)}}function p(e){return e instanceof m?e:b(e)?O(e):S(e)}function f(){function e(e){t=e,a.source=e,X(n,function(t,n){p.nextTick(function(){e.promiseDispatch.apply(e,n)})},void 0),n=void 0,r=void 0}var t,n=[],r=[],i=ee(f.prototype),a=ee(m.prototype);if(a.promiseDispatch=function(e,i,a){var o=Q(arguments);n?(n.push(o),"when"===i&&a[1]&&r.push(a[1])):p.nextTick(function(){t.promiseDispatch.apply(t,o)})},a.valueOf=function(){if(n)return a;var e=g(t);return v(e)&&(t=e),e},a.inspect=function(){return t?t.inspect():{state:"pending"}},p.longStackSupport&&q)try{throw new Error}catch(o){a.stack=o.stack.substring(o.stack.indexOf("\n")+1)}return i.promise=a,i.resolve=function(n){t||e(p(n))},i.fulfill=function(n){t||e(S(n))},i.reject=function(n){t||e(F(n))},i.notify=function(e){t||X(r,function(t,n){p.nextTick(function(){n(e)})},void 0)},i}function h(e){if("function"!=typeof e)throw new TypeError("resolver must be a function.");var t=f();try{e(t.resolve,t.reject,t.notify)}catch(n){t.reject(n)}return t.promise}function d(e){return h(function(t,n){for(var r=0,i=e.length;i>r;r++)p(e[r]).then(t,n)})}function m(e,t,n){void 0===t&&(t=function(e){return F(new Error("Promise does not support operation: "+e))}),void 0===n&&(n=function(){return{state:"unknown"}});var r=ee(m.prototype);if(r.promiseDispatch=function(n,i,a){var o;try{o=e[i]?e[i].apply(r,a):t.call(r,i,a)}catch(s){o=F(s)}n&&n(o)},r.inspect=n,n){var i=n();"rejected"===i.state&&(r.exception=i.reason),r.valueOf=function(){var e=n();return"pending"===e.state||"rejected"===e.state?r:e.value}}return r}function y(e,t,n,r){return p(e).then(t,n,r)}function g(e){if(v(e)){var t=e.inspect();if("fulfilled"===t.state)return t.value}return e}function v(e){return e instanceof m}function b(e){return n(e)&&"function"==typeof e.then}function D(e){return v(e)&&"pending"===e.inspect().state}function w(e){return!v(e)||"fulfilled"===e.inspect().state}function A(e){return v(e)&&"rejected"===e.inspect().state}function x(){ae.length=0,oe.length=0,ue||(ue=!0)}function C(t,n){ue&&("object"==typeof e&&"function"==typeof e.emit&&p.nextTick.runAfter(function(){-1!==G(oe,t)&&(e.emit("unhandledRejection",n,t),se.push(t))}),oe.push(t),n&&"undefined"!=typeof n.stack?ae.push(n.stack):ae.push("(no stack) "+n))}function E(t){if(ue){var n=G(oe,t);-1!==n&&("object"==typeof e&&"function"==typeof e.emit&&p.nextTick.runAfter(function(){var r=G(se,t);-1!==r&&(e.emit("rejectionHandled",ae[n],t),se.splice(r,1))}),oe.splice(n,1),ae.splice(n,1))}}function F(e){var t=m({when:function(t){return t&&E(this),t?t(e):this}},function(){return this},function(){return{state:"rejected",reason:e}});return C(t,e),t}function S(e){return m({when:function(){return e},get:function(t){return e[t]},set:function(t,n){e[t]=n},"delete":function(t){delete e[t]},post:function(t,n){return null===t||void 0===t?e.apply(void 0,n):e[t].apply(e,n)},apply:function(t,n){return e.apply(t,n)},keys:function(){return ne(e)}},void 0,function(){return{state:"fulfilled",value:e}})}function O(e){var t=f();return p.nextTick(function(){try{e.then(t.resolve,t.reject,t.notify)}catch(n){t.reject(n)}}),t.promise}function j(e){return m({isDef:function(){}},function(t,n){return P(e,t,n)},function(){return p(e).inspect()})}function k(e,t,n){return p(e).spread(t,n)}function I(e){return function(){function t(e,t){var o;if("undefined"==typeof StopIteration){try{o=n[e](t)}catch(s){return F(s)}return o.done?p(o.value):y(o.value,i,a)}try{o=n[e](t)}catch(s){return r(s)?p(s.value):F(s)}return y(o,i,a)}var n=e.apply(this,arguments),i=t.bind(t,"next"),a=t.bind(t,"throw");return i()}}function B(e){p.done(p.async(e)())}function _(e){throw new z(e)}function T(e){return function(){return k([this,L(arguments)],function(t,n){return e.apply(t,n)})}}function P(e,t,n){return p(e).dispatch(t,n)}function L(e){return y(e,function(e){var t=0,n=f();return X(e,function(r,i,a){var o;v(i)&&"fulfilled"===(o=i.inspect()).state?e[a]=o.value:(++t,y(i,function(r){e[a]=r,0===--t&&n.resolve(e)},n.reject,function(e){n.notify({index:a,value:e})}))},void 0),0===t&&n.resolve(e),n.promise})}function $(e){if(0===e.length)return p.resolve();var t=p.defer(),n=0;return X(e,function(r,i,a){function o(e){t.resolve(e)}function s(){n--,0===n&&t.reject(new Error("Can't get fulfillment value from any promise, all promises were rejected."))}function u(e){t.notify({index:a,value:e})}var l=e[a];n++,y(l,o,s,u)},void 0),t.promise}function M(e){return y(e,function(e){return e=Z(e,p),y(L(Z(e,function(e){return y(e,J,J)})),function(){return e})})}function U(e){return p(e).allSettled()}function R(e,t){return p(e).then(void 0,void 0,t)}function N(e,t){return p(e).nodeify(t)}var q=!1;try{throw new Error}catch(H){q=!!H.stack}var V,z,Y=l(),J=function(){},W=function(){function t(){for(var e,t;r.next;)r=r.next,e=r.task,r.task=void 0,t=r.domain,t&&(r.domain=void 0,t.enter()),n(e,t);for(;u.length;)e=u.pop(),n(e);a=!1}function n(e,n){try{e()}catch(r){if(s)throw n&&n.exit(),setTimeout(t,0),n&&n.enter(),r;setTimeout(function(){throw r},0)}n&&n.exit()}var r={task:void 0,next:null},i=r,a=!1,o=void 0,s=!1,u=[];if(W=function(t){i=i.next={task:t,domain:s&&e.domain,next:null},a||(a=!0,o())},"object"==typeof e&&"[object process]"===e.toString()&&e.nextTick)s=!0,o=function(){e.nextTick(t)};else if("function"==typeof setImmediate)o="undefined"!=typeof window?setImmediate.bind(window,t):function(){setImmediate(t)};else if("undefined"!=typeof MessageChannel){var l=new MessageChannel;l.port1.onmessage=function(){o=c,l.port1.onmessage=t,t()};var c=function(){l.port2.postMessage(0)};o=function(){setTimeout(t,0),c()}}else o=function(){setTimeout(t,0)};return W.runAfter=function(e){u.push(e),a||(a=!0,o())},W}(),K=Function.call,Q=t(Array.prototype.slice),X=t(Array.prototype.reduce||function(e,t){var n=0,r=this.length;if(1===arguments.length)for(;;){if(n in this){t=this[n++];break}if(++n>=r)throw new TypeError}for(;r>n;n++)n in this&&(t=e(t,this[n],n));return t}),G=t(Array.prototype.indexOf||function(e){for(var t=0;t<this.length;t++)if(this[t]===e)return t;return-1}),Z=t(Array.prototype.map||function(e,t){var n=this,r=[];return X(n,function(i,a,o){r.push(e.call(t,a,o,n))},void 0),r}),ee=Object.create||function(e){function t(){}return t.prototype=e,new t},te=t(Object.prototype.hasOwnProperty),ne=Object.keys||function(e){var t=[];for(var n in e)te(e,n)&&t.push(n);return t},re=t(Object.prototype.toString);z="undefined"!=typeof ReturnValue?ReturnValue:function(e){this.value=e};var ie="From previous event:";p.resolve=p,p.nextTick=W,p.longStackSupport=!1,"object"==typeof e&&e&&e.env&&e.env.Q_DEBUG&&(p.longStackSupport=!0),p.defer=f,f.prototype.makeNodeResolver=function(){var e=this;return function(t,n){t?e.reject(t):arguments.length>2?e.resolve(Q(arguments,1)):e.resolve(n)}},p.Promise=h,p.promise=h,h.race=d,h.all=L,h.reject=F,h.resolve=p,p.passByCopy=function(e){return e},m.prototype.passByCopy=function(){return this},p.join=function(e,t){return p(e).join(t)},m.prototype.join=function(e){return p([this,e]).spread(function(e,t){if(e===t)return e;throw new Error("Can't join: not the same: "+e+" "+t)})},p.race=d,m.prototype.race=function(){return this.then(p.race)},p.makePromise=m,m.prototype.toString=function(){return"[object Promise]"},m.prototype.then=function(e,t,n){function r(t){try{return"function"==typeof e?e(t):t}catch(n){return F(n)}}function a(e){if("function"==typeof t){i(e,s);try{return t(e)}catch(n){return F(n)}}return F(e)}function o(e){return"function"==typeof n?n(e):e}var s=this,u=f(),l=!1;return p.nextTick(function(){s.promiseDispatch(function(e){l||(l=!0,u.resolve(r(e)))},"when",[function(e){l||(l=!0,u.resolve(a(e)))}])}),s.promiseDispatch(void 0,"when",[void 0,function(e){var t,n=!1;try{t=o(e)}catch(r){if(n=!0,!p.onerror)throw r;p.onerror(r)}n||u.notify(t)}]),u.promise},p.tap=function(e,t){return p(e).tap(t)},m.prototype.tap=function(e){return e=p(e),this.then(function(t){return e.fcall(t).thenResolve(t)})},p.when=y,m.prototype.thenResolve=function(e){return this.then(function(){return e})},p.thenResolve=function(e,t){return p(e).thenResolve(t)},m.prototype.thenReject=function(e){return this.then(function(){throw e})},p.thenReject=function(e,t){return p(e).thenReject(t)},p.nearer=g,p.isPromise=v,p.isPromiseAlike=b,p.isPending=D,m.prototype.isPending=function(){return"pending"===this.inspect().state},p.isFulfilled=w,m.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},p.isRejected=A,m.prototype.isRejected=function(){return"rejected"===this.inspect().state};var ae=[],oe=[],se=[],ue=!0;p.resetUnhandledRejections=x,p.getUnhandledReasons=function(){return ae.slice()},p.stopUnhandledRejectionTracking=function(){x(),ue=!1},x(),p.reject=F,p.fulfill=S,p.master=j,p.spread=k,m.prototype.spread=function(e,t){return this.all().then(function(t){return e.apply(void 0,t)},t)},p.async=I,p.spawn=B,p["return"]=_,p.promised=T,p.dispatch=P,m.prototype.dispatch=function(e,t){var n=this,r=f();return p.nextTick(function(){n.promiseDispatch(r.resolve,e,t)}),r.promise},p.get=function(e,t){return p(e).dispatch("get",[t])},m.prototype.get=function(e){return this.dispatch("get",[e])},p.set=function(e,t,n){return p(e).dispatch("set",[t,n])},m.prototype.set=function(e,t){return this.dispatch("set",[e,t])},p.del=p["delete"]=function(e,t){return p(e).dispatch("delete",[t])},m.prototype.del=m.prototype["delete"]=function(e){return this.dispatch("delete",[e])},p.mapply=p.post=function(e,t,n){return p(e).dispatch("post",[t,n])},m.prototype.mapply=m.prototype.post=function(e,t){return this.dispatch("post",[e,t])},p.send=p.mcall=p.invoke=function(e,t){return p(e).dispatch("post",[t,Q(arguments,2)])},m.prototype.send=m.prototype.mcall=m.prototype.invoke=function(e){return this.dispatch("post",[e,Q(arguments,1)])},p.fapply=function(e,t){return p(e).dispatch("apply",[void 0,t])},m.prototype.fapply=function(e){return this.dispatch("apply",[void 0,e])},p["try"]=p.fcall=function(e){return p(e).dispatch("apply",[void 0,Q(arguments,1)])},m.prototype.fcall=function(){return this.dispatch("apply",[void 0,Q(arguments)])},p.fbind=function(e){var t=p(e),n=Q(arguments,1);return function(){return t.dispatch("apply",[this,n.concat(Q(arguments))])}},m.prototype.fbind=function(){var e=this,t=Q(arguments);return function(){return e.dispatch("apply",[this,t.concat(Q(arguments))])}},p.keys=function(e){return p(e).dispatch("keys",[])},m.prototype.keys=function(){return this.dispatch("keys",[])},p.all=L,m.prototype.all=function(){return L(this)},p.any=$,m.prototype.any=function(){return $(this)},p.allResolved=c(M,"allResolved","allSettled"),m.prototype.allResolved=function(){return M(this)},p.allSettled=U,m.prototype.allSettled=function(){return this.then(function(e){return L(Z(e,function(e){function t(){return e.inspect()}return e=p(e),e.then(t,t)}))})},p.fail=p["catch"]=function(e,t){return p(e).then(void 0,t)},m.prototype.fail=m.prototype["catch"]=function(e){return this.then(void 0,e)},p.progress=R,m.prototype.progress=function(e){return this.then(void 0,void 0,e)},p.fin=p["finally"]=function(e,t){return p(e)["finally"](t)},m.prototype.fin=m.prototype["finally"]=function(e){return e=p(e),this.then(function(t){return e.fcall().then(function(){return t})},function(t){return e.fcall().then(function(){throw t})})},p.done=function(e,t,n,r){return p(e).done(t,n,r)},m.prototype.done=function(t,n,r){var a=function(e){p.nextTick(function(){if(i(e,o),!p.onerror)throw e;p.onerror(e)})},o=t||n||r?this.then(t,n,r):this;"object"==typeof e&&e&&e.domain&&(a=e.domain.bind(a)),o.then(void 0,a)},p.timeout=function(e,t,n){return p(e).timeout(t,n)},m.prototype.timeout=function(e,t){var n=f(),r=setTimeout(function(){t&&"string"!=typeof t||(t=new Error(t||"Timed out after "+e+" ms"),t.code="ETIMEDOUT"),n.reject(t)},e);return this.then(function(e){clearTimeout(r),n.resolve(e)},function(e){clearTimeout(r),n.reject(e)},n.notify),n.promise},p.delay=function(e,t){return void 0===t&&(t=e,e=void 0),p(e).delay(t)},m.prototype.delay=function(e){return this.then(function(t){var n=f();return setTimeout(function(){n.resolve(t)},e),n.promise})},p.nfapply=function(e,t){return p(e).nfapply(t)},m.prototype.nfapply=function(e){var t=f(),n=Q(e);return n.push(t.makeNodeResolver()),this.fapply(n).fail(t.reject),t.promise},p.nfcall=function(e){var t=Q(arguments,1);return p(e).nfapply(t)},m.prototype.nfcall=function(){var e=Q(arguments),t=f();return e.push(t.makeNodeResolver()),this.fapply(e).fail(t.reject),t.promise},p.nfbind=p.denodeify=function(e){var t=Q(arguments,1);return function(){var n=t.concat(Q(arguments)),r=f();return n.push(r.makeNodeResolver()),p(e).fapply(n).fail(r.reject),r.promise}},m.prototype.nfbind=m.prototype.denodeify=function(){var e=Q(arguments);return e.unshift(this),p.denodeify.apply(void 0,e)},p.nbind=function(e,t){var n=Q(arguments,2);return function(){function r(){return e.apply(t,arguments)}var i=n.concat(Q(arguments)),a=f();return i.push(a.makeNodeResolver()),p(r).fapply(i).fail(a.reject),a.promise}},m.prototype.nbind=function(){var e=Q(arguments,0);return e.unshift(this),p.nbind.apply(void 0,e)},p.nmapply=p.npost=function(e,t,n){return p(e).npost(t,n)},m.prototype.nmapply=m.prototype.npost=function(e,t){var n=Q(t||[]),r=f();return n.push(r.makeNodeResolver()),this.dispatch("post",[e,n]).fail(r.reject),r.promise},p.nsend=p.nmcall=p.ninvoke=function(e,t){var n=Q(arguments,2),r=f();return n.push(r.makeNodeResolver()),p(e).dispatch("post",[t,n]).fail(r.reject),r.promise},m.prototype.nsend=m.prototype.nmcall=m.prototype.ninvoke=function(e){var t=Q(arguments,1),n=f();return t.push(n.makeNodeResolver()),this.dispatch("post",[e,t]).fail(n.reject),n.promise},p.nodeify=N,m.prototype.nodeify=function(e){return e?void this.then(function(t){p.nextTick(function(){e(null,t)})},function(t){p.nextTick(function(){e(t)})}):this},p.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var le=l();return p})}).call(this,e("_process"))},{_process:13}],162:[function(e,t,n){function r(){}function i(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function a(e){return e===Object(e)}function o(e){if(!a(e))return e;var t=[];for(var n in e)null!=e[n]&&s(t,n,e[n]);return t.join("&")}function s(e,t,n){return Array.isArray(n)?n.forEach(function(n){s(e,t,n)}):void e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}function u(e){for(var t,n,r={},i=e.split("&"),a=0,o=i.length;o>a;++a)n=i[a],t=n.split("="),r[decodeURIComponent(t[0])]=decodeURIComponent(t[1]);return r}function l(e){var t,n,r,i,a=e.split(/\r?\n/),o={};a.pop();for(var s=0,u=a.length;u>s;++s)n=a[s],t=n.indexOf(":"),r=n.slice(0,t).toLowerCase(),i=b(n.slice(t+1)),o[r]=i;return o}function c(e){return e.split(/ *; */).shift()}function p(e){return v(e.split(/ *; */),function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(e[r]=i),e},{})}function f(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=l(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function h(e,t){var n=this;g.call(this),this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new f(n)}catch(r){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=r,n.callback(e)}if(n.emit("response",t),e)return n.callback(e,t);if(t.status>=200&&t.status<300)return n.callback(e,t);var i=new Error(t.statusText||"Unsuccessful HTTP response");i.original=e,i.response=t,i.status=t.status,n.callback(i,t)})}function d(e,t){return"function"==typeof t?new h("GET",e).end(t):1==arguments.length?new h("GET",e):new h(e,t)}function m(e,t){var n=d("DELETE",e);return t&&n.end(t),n}var y,g=e("emitter"),v=e("reduce");y="undefined"!=typeof window?window:"undefined"!=typeof self?self:this,d.getXHR=function(){if(!(!y.XMLHttpRequest||y.location&&"file:"==y.location.protocol&&y.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP");
+}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var b="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};d.serializeObject=o,d.parseString=u,d.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},d.serialize={"application/x-www-form-urlencoded":o,"application/json":JSON.stringify},d.parse={"application/x-www-form-urlencoded":u,"application/json":JSON.parse},f.prototype.get=function(e){return this.header[e.toLowerCase()]},f.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=c(t);var n=p(t);for(var r in n)this[r]=n[r]},f.prototype.parseBody=function(e){var t=d.parse[this.type];return t&&e&&(e.length||e instanceof Object)?t(e):null},f.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=4==t||5==t?this.toError():!1,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},f.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",i=new Error(r);return i.status=this.status,i.method=t,i.url=n,i},d.Response=f,g(h.prototype),h.prototype.use=function(e){return e(this),this},h.prototype.timeout=function(e){return this._timeout=e,this},h.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},h.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},h.prototype.set=function(e,t){if(a(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},h.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},h.prototype.getHeader=function(e){return this._header[e.toLowerCase()]},h.prototype.type=function(e){return this.set("Content-Type",d.types[e]||e),this},h.prototype.parse=function(e){return this._parser=e,this},h.prototype.accept=function(e){return this.set("Accept",d.types[e]||e),this},h.prototype.auth=function(e,t){var n=btoa(e+":"+t);return this.set("Authorization","Basic "+n),this},h.prototype.query=function(e){return"string"!=typeof e&&(e=o(e)),e&&this._query.push(e),this},h.prototype.field=function(e,t){return this._formData||(this._formData=new y.FormData),this._formData.append(e,t),this},h.prototype.attach=function(e,t,n){return this._formData||(this._formData=new y.FormData),this._formData.append(e,t,n),this},h.prototype.send=function(e){var t=a(e),n=this.getHeader("Content-Type");if(t&&a(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(n||this.type("form"),n=this.getHeader("Content-Type"),"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||i(e)?this:(n||this.type("json"),this)},h.prototype.callback=function(e,t){var n=this._callback;this.clearTimeout(),n(e,t)},h.prototype.crossDomainError=function(){var e=new Error("Origin is not allowed by Access-Control-Allow-Origin");e.crossDomain=!0,this.callback(e)},h.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},h.prototype.withCredentials=function(){return this._withCredentials=!0,this},h.prototype.end=function(e){var t=this,n=this.xhr=d.getXHR(),a=this._query.join("&"),o=this._timeout,s=this._formData||this._data;this._callback=e||r,n.onreadystatechange=function(){if(4==n.readyState){var e;try{e=n.status}catch(r){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var u=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),t.emit("progress",e)};this.hasListeners("progress")&&(n.onprogress=u);try{n.upload&&this.hasListeners("progress")&&(n.upload.onprogress=u)}catch(l){}if(o&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},o)),a&&(a=d.serializeObject(a),this.url+=~this.url.indexOf("?")?"&"+a:"?"+a),n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!i(s)){var c=this.getHeader("Content-Type"),p=this._parser||d.serialize[c?c.split(";")[0]:""];p&&(s=p(s))}for(var f in this.header)null!=this.header[f]&&n.setRequestHeader(f,this.header[f]);return this.emit("request",this),n.send("undefined"!=typeof s?s:null),this},h.prototype.then=function(e,t){return this.end(function(n,r){n?t(n):e(r)})},d.Request=h,d.get=function(e,t,n){var r=d("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},d.head=function(e,t,n){var r=d("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},d.del=m,d["delete"]=m,d.patch=function(e,t,n){var r=d("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},d.post=function(e,t,n){var r=d("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},d.put=function(e,t,n){var r=d("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},t.exports=d},{emitter:163,reduce:164}],163:[function(e,t,n){function r(e){return e?i(e):void 0}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){r.off(e,n),t.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n){n=n.slice(0);for(var r=0,i=n.length;i>r;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],164:[function(e,t,n){t.exports=function(e,t,n){for(var r=0,i=e.length,a=3==arguments.length?n:e[r++];i>r;)a=t.call(null,a,e[r],++r,e);return a}},{}]},{},[1])(1)}),window.SwaggerUi=Backbone.Router.extend({dom_id:"swagger_ui",options:null,api:null,headerView:null,mainView:null,initialize:function(e){e=e||{},"model"!==e.defaultModelRendering&&(e.defaultModelRendering="schema"),e.highlightSizeThreshold||(e.highlightSizeThreshold=1e5),e.dom_id&&(this.dom_id=e.dom_id,delete e.dom_id),e.supportedSubmitMethods||(e.supportedSubmitMethods=["get","put","post","delete","head","options","patch"]),"string"==typeof e.oauth2RedirectUrl&&(window.oAuthRedirectUrl=e.redirectUrl),$("#"+this.dom_id).length||$("body").append('<div id="'+this.dom_id+'"></div>'),this.options=e,marked.setOptions({gfm:!0});var t=this;this.options.success=function(){return t.render()},this.options.progress=function(e){return t.showMessage(e)},this.options.failure=function(e){return t.onLoadFailure(e)},this.headerView=new SwaggerUi.Views.HeaderView({el:$("#header")}),this.headerView.on("update-swagger-ui",function(e){return t.updateSwaggerUi(e)}),JSONEditor.defaults.iconlibs.swagger=JSONEditor.AbstractIconLib.extend({mapping:{collapse:"collapse",expand:"expand"},icon_prefix:"swagger-"})},setOption:function(e,t){this.options[e]=t},getOption:function(e){return this.options[e]},updateSwaggerUi:function(e){this.options.url=e.url,this.load()},load:function(){this.mainView&&this.mainView.clear();var e=this.options.url;e&&0!==e.indexOf("http")&&(e=this.buildUrl(window.location.href.toString(),e)),this.api&&(this.options.authorizations=this.api.clientAuthorizations.authz),this.options.url=e,this.headerView.update(e),this.api=new SwaggerClient(this.options)},collapseAll:function(){Docs.collapseEndpointListForResource("")},listAll:function(){Docs.collapseOperationsForResource("")},expandAll:function(){Docs.expandOperationsForResource("")},render:function(){switch(this.showMessage("Finished Loading Resource Information. Rendering Swagger UI..."),this.mainView=new SwaggerUi.Views.MainView({model:this.api,el:$("#"+this.dom_id),swaggerOptions:this.options,router:this}).render(),this.showMessage(),this.options.docExpansion){case"full":this.expandAll();break;case"list":this.listAll()}this.renderGFM(),this.options.onComplete&&this.options.onComplete(this.api,this),setTimeout(Docs.shebang.bind(this),100)},buildUrl:function(e,t){if(0===t.indexOf("/")){var n=e.split("/");return e=n[0]+"//"+n[2],e+t}var r=e.length;return e.indexOf("?")>-1&&(r=Math.min(r,e.indexOf("?"))),e.indexOf("#")>-1&&(r=Math.min(r,e.indexOf("#"))),e=e.substring(0,r),-1!==e.indexOf("/",e.length-1)?e+t:e+"/"+t},showMessage:function(e){void 0===e&&(e="");var t=$("#message-bar");t.removeClass("message-fail"),t.addClass("message-success"),t.text(e),window.SwaggerTranslator&&window.SwaggerTranslator.translate(t)},onLoadFailure:function(e){void 0===e&&(e=""),$("#message-bar").removeClass("message-success"),$("#message-bar").addClass("message-fail");var t=$("#message-bar").text(e);return this.options.onFailure&&this.options.onFailure(e),t},renderGFM:function(){$(".markdown").each(function(){$(this).html(marked($(this).html()))}),$(".propDesc",".model-signature .description").each(function(){$(this).html(marked($(this).html())).addClass("markdown")})}}),window.SwaggerUi.Views={},window.SwaggerUi.partials={},function(){function e(e){"console"in window&&"function"==typeof window.console.warn&&console.warn(e)}window.authorizations={add:function(){if(e("Using window.authorizations is deprecated. Please use SwaggerUi.api.clientAuthorizations.add()."),"undefined"==typeof window.swaggerUi)throw new TypeError("window.swaggerUi is not defined");window.swaggerUi instanceof SwaggerUi&&window.swaggerUi.api.clientAuthorizations.add.apply(window.swaggerUi.api.clientAuthorizations,arguments)}},window.ApiKeyAuthorization=function(){e("window.ApiKeyAuthorization is deprecated. Please use SwaggerClient.ApiKeyAuthorization."),SwaggerClient.ApiKeyAuthorization.apply(window,arguments)},window.PasswordAuthorization=function(){e("window.PasswordAuthorization is deprecated. Please use SwaggerClient.PasswordAuthorization."),SwaggerClient.PasswordAuthorization.apply(window,arguments)}}(),function(e,t){"function"==typeof define&&define.amd?define(["b"],function(n){return e.SwaggerUi=t(n)}):"object"==typeof exports?module.exports=t(require("b")):e.SwaggerUi=t(e.b)}(this,function(){return SwaggerUi}),SwaggerUi.Views.ApiKeyButton=Backbone.View.extend({events:{"click #apikey_button":"toggleApiKeyContainer","click #apply_api_key":"applyApiKey"},initialize:function(e){this.options=e||{},this.router=this.options.router},render:function(){var e=this.template();return $(this.el).html(e(this.model)),this},applyApiKey:function(){var e=new SwaggerClient.ApiKeyAuthorization(this.model.name,$("#input_apiKey_entry").val(),this.model["in"]);this.router.api.clientAuthorizations.add(this.model.name,e),this.router.load(),$("#apikey_container").show()},toggleApiKeyContainer:function(){if($("#apikey_container").length){var e=$("#apikey_container").first();e.is(":visible")?e.hide():($(".auth_container").hide(),e.show())}},template:function(){return Handlebars.templates.apikey_button_view}}),SwaggerUi.Views.BasicAuthButton=Backbone.View.extend({initialize:function(e){this.options=e||{},this.router=this.options.router},render:function(){var e=this.template();return $(this.el).html(e(this.model)),this},events:{"click #basic_auth_button":"togglePasswordContainer","click #apply_basic_auth":"applyPassword"},applyPassword:function(e){e.preventDefault();var t=$("#input_username").val(),n=$("#input_password").val(),r=new SwaggerClient.PasswordAuthorization("basic",t,n);this.router.api.clientAuthorizations.add(this.model.type,r),this.router.load(),$("#basic_auth_container").hide()},togglePasswordContainer:function(){if($("#basic_auth_container").length){var e=$("#basic_auth_container").show();e.is(":visible")?e.slideUp():($(".auth_container").hide(),e.show())}},template:function(){return Handlebars.templates.basic_auth_button_view}}),SwaggerUi.Views.ContentTypeView=Backbone.View.extend({initialize:function(){},render:function(){return this.model.contentTypeId="ct"+Math.random(),$(this.el).html(Handlebars.templates.content_type(this.model)),this}}),SwaggerUi.Views.HeaderView=Backbone.View.extend({events:{"click #show-pet-store-icon":"showPetStore","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"},initialize:function(){},showPetStore:function(){this.trigger("update-swagger-ui",{url:"http://petstore.swagger.io/v2/swagger.json"})},showCustomOnKeyup:function(e){13===e.keyCode&&this.showCustom()},showCustom:function(e){e&&e.preventDefault(),this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})},update:function(e,t,n){void 0===n&&(n=!1),$("#input_baseUrl").val(e),n&&this.trigger("update-swagger-ui",{url:e})}}),SwaggerUi.Views.MainView=Backbone.View.extend({apisSorter:{alpha:function(e,t){return e.name.localeCompare(t.name)}},operationsSorters:{alpha:function(e,t){return e.path.localeCompare(t.path)},method:function(e,t){return e.method.localeCompare(t.method)}},initialize:function(e){var t,n,r,i;if(e=e||{},this.router=e.router,document.addEventListener("click",this.onLinkClick,!0),e.swaggerOptions.apisSorter&&(t=e.swaggerOptions.apisSorter,n=_.isFunction(t)?t:this.apisSorter[t],_.isFunction(n)&&this.model.apisArray.sort(n)),e.swaggerOptions.operationsSorter&&(t=e.swaggerOptions.operationsSorter,n=_.isFunction(t)?t:this.operationsSorters[t],_.isFunction(n)))for(r in this.model.apisArray)this.model.apisArray[r].operationsArray.sort(n);this.model.auths=[];for(r in this.model.securityDefinitions)i=this.model.securityDefinitions[r],this.model.auths.push({name:r,type:i.type,value:i});"validatorUrl"in e.swaggerOptions?this.model.validatorUrl=e.swaggerOptions.validatorUrl:this.model.url.indexOf("localhost")>0||this.model.url.indexOf("127.0.0.1")>0?this.model.validatorUrl=null:"https:"===window.location.protocol?this.model.validatorUrl="https://online.swagger.io/validator":this.model.validatorUrl="http://online.swagger.io/validator";var a;for(a in this.model.definitions)this.model.definitions[a].type||(this.model.definitions[a].type="object")},render:function(){if(this.model.securityDefinitions)for(var e in this.model.securityDefinitions){var t,n=this.model.securityDefinitions[e];"apiKey"===n.type&&0===$("#apikey_button").length&&(t=new SwaggerUi.Views.ApiKeyButton({model:n,router:this.router}).render().el,$(".auth_main_container").append(t)),"basicAuth"===n.type&&0===$("#basic_auth_button").length&&(t=new SwaggerUi.Views.BasicAuthButton({model:n,router:this.router}).render().el,$(".auth_main_container").append(t))}$(this.el).html(Handlebars.templates.main(this.model));for(var r={},i=0,a=0;a<this.model.apisArray.length;a++){for(var o=this.model.apisArray[a],s=o.name;"undefined"!=typeof r[s];)s=s+"_"+i,i+=1;o.id=s,r[s]=o,this.addResource(o,this.model.auths)}return $(".propWrap").hover(function(){$(".optionsWrapper",$(this)).show()},function(){$(".optionsWrapper",$(this)).hide()}),this},addResource:function(e,t){e.id=e.id.replace(/\s/g,"_"),e.definitions=this.model.definitions;var n=new SwaggerUi.Views.ResourceView({model:e,router:this.router,tagName:"li",id:"resource_"+e.id,className:"resource",auths:t,swaggerOptions:this.options.swaggerOptions});$("#resources",this.el).append(n.render().el)},clear:function(){$(this.el).html("")},onLinkClick:function(e){var t=e.target;"A"===t.tagName&&(location.hostname!==t.hostname||location.port!==t.port)&&(e.preventDefault(),window.open(t.href,"_blank"))}}),SwaggerUi.Views.OperationView=Backbone.View.extend({invocationUrl:null,events:{"submit .sandbox":"submitOperation","click .submit":"submitOperation","click .response_hider":"hideResponse","click .toggleOperation":"toggleOperationContent","mouseenter .api-ic":"mouseEnter","dblclick .curl":"selectText","change [name=responseContentType]":"showSnippet"},initialize:function(e){return e=e||{},this.router=e.router,this.auths=e.auths,this.parentId=this.model.parentId,this.nickname=this.model.nickname,this.model.encodedParentId=encodeURIComponent(this.parentId),e.swaggerOptions&&(this.model.defaultRendering=e.swaggerOptions.defaultModelRendering,e.swaggerOptions.showRequestHeaders&&(this.model.showRequestHeaders=!0)),this},selectText:function(e){var t,n,r=document,i=e.target.firstChild;r.body.createTextRange?(t=document.body.createTextRange(),t.moveToElementText(i),t.select()):window.getSelection&&(n=window.getSelection(),t=document.createRange(),t.selectNodeContents(i),n.removeAllRanges(),n.addRange(t))},mouseEnter:function(e){var t=$(this.el).find(".content"),n=e.pageX,r=e.pageY,i=$(window).scrollLeft(),a=$(window).scrollTop(),o=i+$(window).width(),s=a+$(window).height(),u=t.width(),l=t.height();n+u>o&&(n=o-u),i>n&&(n=i),r+l>s&&(r=s-l),a>r&&(r=a);var c={};c.top=r,c.left=n,t.css(c)},render:function(){var e,t,n,r,i,a,o,s,u,l,c,p,f,h,d,m,y,g,v,b,D,w,A,x,C,E,F,S,O,j,k,I,B,T,P,L,M,U,R,N,q;if(a=jQuery.inArray(this.model.method,this.model.supportedSubmitMethods())>=0,a||(this.model.isReadOnly=!0),this.model.description=this.model.description||this.model.notes,this.model.oauth=null,m=this.model.authorizations||this.model.security)if(Array.isArray(m))for(u=0,l=m.length;l>u;u++){n=m[u];for(s in n)for(e in this.auths)if(t=this.auths[e],s===t.name&&"oauth2"===t.type){this.model.oauth={},this.model.oauth.scopes=[],A=t.value.scopes;for(o in A)M=A[o],I=n[s].indexOf(o),I>=0&&(g={scope:o,description:M},this.model.oauth.scopes.push(g))}}else for(o in m)if(M=m[o],"oauth2"===o)for(null===this.model.oauth&&(this.model.oauth={}),void 0===this.model.oauth.scopes&&(this.model.oauth.scopes=[]),d=0,c=M.length;c>d;d++)g=M[d],this.model.oauth.scopes.push(g);if("undefined"!=typeof this.model.responses){this.model.responseMessages=[],x=this.model.responses;for(r in x)U=x[r],j=null,k=this.model.responses[r].schema,k&&k.$ref&&(j=k.$ref,-1!==j.indexOf("#/definitions/")&&(j=j.replace(/^.*#\/definitions\//,""))),this.model.responseMessages.push({code:r,message:U.description,responseModel:j,headers:U.headers,schema:k})}if("undefined"==typeof this.model.responseMessages&&(this.model.responseMessages=[]),B=null,R=this.model.produces,N=this.contains(R,"xml"),q=N?this.contains(R,"json"):!0,this.model.successResponse){P=this.model.successResponse;for(s in P)U=P[s],this.model.successCode=s,"object"==typeof U&&"function"==typeof U.createJSONSample&&(this.model.successDescription=U.description,this.model.headers=this.parseResponseHeaders(U.headers),B={sampleJSON:q?JSON.stringify(SwaggerUi.partials.signature.createJSONSample(U),void 0,2):!1,isParam:!1,sampleXML:N?SwaggerUi.partials.signature.createXMLSample(U.definition,U.models):!1,signature:SwaggerUi.partials.signature.getModelSignature(U.name,U.definition,U.models,U.modelPropertyMacro)})}else this.model.responseClassSignature&&"string"!==this.model.responseClassSignature&&(B={sampleJSON:this.model.responseSampleJSON,isParam:!1,signature:this.model.responseClassSignature});for($(this.el).html(Handlebars.templates.operation(this.model)),B?(B.defaultRendering=this.model.defaultRendering,O=new SwaggerUi.Views.SignatureView({model:B,router:this.router,tagName:"div"}),$(".model-signature",$(this.el)).append(O.render().el)):(this.model.responseClassSignature="string",$(".model-signature",$(this.el)).html(this.model.type)),i={isParam:!1},i.consumes=this.model.consumes,i.produces=this.model.produces,C=this.model.parameters,y=0,p=C.length;p>y;y++)b=C[y],L=b.type||b.dataType||"","undefined"==typeof L&&(j=b.schema,j&&j.$ref&&(w=j.$ref,L=0===w.indexOf("#/definitions/")?w.substring("#/definitions/".length):w)),L&&"file"===L.toLowerCase()&&(i.consumes||(i.consumes="multipart/form-data")),b.type=L;for(S=new SwaggerUi.Views.ResponseContentTypeView({model:i,router:this.router}),$(".response-content-type",$(this.el)).append(S.render().el),E=this.model.parameters,v=0,f=E.length;f>v;v++)b=E[v],this.addParameter(b,i.consumes);for(F=this.model.responseMessages,D=0,h=F.length;h>D;D++)T=F[D],T.isXML=N,T.isJSON=q,_.isUndefined(T.headers)||(T.headers=this.parseHeadersType(T.headers)),this.addStatusCode(T);return this.showSnippet(),this},parseHeadersType:function(e){var t={string:{"date-time":"dateTime",date:"date"}};return _.forEach(e,function(e){var n;e=e||{},n=t[e.type]&&t[e.type][e.format],_.isUndefined(n)||(e.type=n)}),e},contains:function(e,t){return e.filter(function(e){return e.indexOf(t)>-1?!0:void 0}).length},parseResponseHeaders:function(e){var t="; ",n=_.clone(e);return _.forEach(n,function(e){var n=[];_.forEach(e,function(e,t){var r=["type","description"];-1===r.indexOf(t.toLowerCase())&&n.push(t+": "+e)}),n.join(t),e.other=n}),n},addParameter:function(e,t){e.consumes=t,e.defaultRendering=this.model.defaultRendering,e.schema&&($.extend(!0,e.schema,this.model.definitions[e.type]),e.schema.definitions=this.model.definitions,e.schema.type||(e.schema.type="object"),e.schema.title||(e.schema.title=" "));var n=new SwaggerUi.Views.ParameterView({model:e,tagName:"tr",readOnly:this.model.isReadOnly,swaggerOptions:this.options.swaggerOptions});$(".operation-params",$(this.el)).append(n.render().el)},addStatusCode:function(e){e.defaultRendering=this.model.defaultRendering;var t=new SwaggerUi.Views.StatusCodeView({model:e,tagName:"tr",router:this.router});$(".operation-status",$(this.el)).append(t.render().el)},submitOperation:function(e){var t,n,r,i,a;if(null!==e&&e.preventDefault(),n=$(".sandbox",$(this.el)),t=!0,n.find("input.required").each(function(){$(this).removeClass("error"),""===jQuery.trim($(this).val())&&($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){$(e).focus()}}(this)}),t=!1)}),n.find("textarea.required:visible").each(function(){$(this).removeClass("error"),""===jQuery.trim($(this).val())&&($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){return $(e).focus()}}(this)}),t=!1)}),n.find("select.required").each(function(){$(this).removeClass("error"),-1===this.selectedIndex&&($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){$(e).focus()}}(this)}),t=!1)}),t){if(i=this.getInputMap(n),r=this.isFileUpload(n),a={parent:this},this.options.swaggerOptions)for(var o in this.options.swaggerOptions)a[o]=this.options.swaggerOptions[o];var s;for(s=0;s<this.model.parameters.length;s++){var u=this.model.parameters[s];if(u.jsonEditor&&u.jsonEditor.isEnabled()){var l=u.jsonEditor.getValue();i[u.name]=JSON.stringify(l)}}return a.responseContentType=$("div select[name=responseContentType]",$(this.el)).val(),a.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val(),$(".response_throbber",$(this.el)).show(),r?($(".request_url",$(this.el)).html("<pre></pre>"),$(".request_url pre",$(this.el)).text(this.invocationUrl),a.useJQuery=!0,i.parameterContentType="multipart/form-data",this.map=i,this.model.execute(i,a,this.showCompleteStatus,this.showErrorStatus,this)):(this.map=i,this.model.execute(i,a,this.showCompleteStatus,this.showErrorStatus,this))}},getInputMap:function(e){var t,n,r,i,a,o,s,u,l,c,p,f;for(t={},n=e.find("input"),r=0,i=n.length;i>r;r++)a=n[r],null!==a.value&&jQuery.trim(a.value).length>0&&(t[a.name]=a.value),"file"===a.type&&(t[a.name]=a.files[0]);for(o=e.find("textarea"),s=0,u=o.length;u>s;s++)a=o[s],l=this.getTextAreaValue(a),null!==l&&jQuery.trim(l).length>0&&(t[a.name]=l);for(c=e.find("select"),p=0,f=c.length;f>p;p++)a=c[p],l=this.getSelectedValue(a),null!==l&&jQuery.trim(l).length>0&&(t[a.name]=l);return t},isFileUpload:function(e){var t,n,r,i,a=!1;for(t=e.find("input"),n=0,r=t.length;r>n;n++)i=t[n],"file"===i.type&&(a=!0);return a},success:function(e,t){t.showCompleteStatus(e)},wrap:function(e){var t,n,r,i,a,o,s;for(r={},n=e.getAllResponseHeaders().split("\r"),a=0,o=n.length;o>a;a++)i=n[a],t=i.match(/^([^:]*?):(.*)$/),t||(t=[]),t.shift(),void 0!==t[0]&&void 0!==t[1]&&(r[t[0].trim()]=t[1].trim());return s={},s.content={},s.content.data=e.responseText,s.headers=r,s.request={},s.request.url=this.invocationUrl,s.status=e.status,s},getSelectedValue:function(e){if(e.multiple){for(var t=[],n=0,r=e.options.length;r>n;n++){var i=e.options[n];i.selected&&t.push(i.value)}return t.length>0?t:null}return e.value},hideResponse:function(e){e&&e.preventDefault(),$(".response",$(this.el)).slideUp(),$(".response_hider",$(this.el)).fadeOut()},showResponse:function(e){var t=JSON.stringify(e,null," ").replace(/\n/g,"<br>");$(".response_body",$(this.el)).html(_.escape(t))},showErrorStatus:function(e,t){t.showStatus(e)},showCompleteStatus:function(e,t){t.showStatus(e)},formatXml:function(e){var t,n,r,i,a,o,s,u,l,c,p,f,h;for(p=/(>)(<)(\/*)/g,h=/[ ]*(.*)[ ]+\n/g,t=/(<.+>)(.+\n)/g,e=e.replace(/\r\n/g,"\n").replace(p,"$1\n$2$3").replace(h,"$1\n").replace(t,"$1\n$2"),c=0,r="",u=e.split("\n"),i=0,o="other",f={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0},n=function(e){var t,n,a,s,u,l,c;l={single:Boolean(e.match(/<.+\/>/)),closing:Boolean(e.match(/<\/.+>/)),opening:Boolean(e.match(/<[^!?].*>/))},u=function(){var e;e=[];for(a in l)c=l[a],c&&e.push(a);return e}()[0],u=void 0===u?"other":u,t=o+"->"+u,o=u,s="",i+=f[t],s=function(){var e,t,r;for(r=[],n=e=0,t=i;t>=0?t>e:e>t;n=t>=0?++e:--e)r.push(" ");return r}().join(""),"opening->closing"===t?r=r.substr(0,r.length-1)+e+"\n":r+=s+e+"\n"},a=0,s=u.length;s>a;a++)l=u[a],n(l);return r},showStatus:function(e){var t,n;void 0===e.content?(n=e.data,t=e.url):(n=e.content.data,t=e.request.url);var r=e.headers;n=jQuery.trim(n);var i=null;r&&(i=r["Content-Type"]||r["content-type"],i&&(i=i.split(";")[0].trim())),$(".response_body",$(this.el)).removeClass("json"),$(".response_body",$(this.el)).removeClass("xml");var a,o,s=function(e){var t=document.createElement("audio");return!(!t.canPlayType||!t.canPlayType(e).replace(/no/,""))};if(n)if("application/json"===i||/\+json$/.test(i)){var u=null;try{u=JSON.stringify(JSON.parse(n),null," ")}catch(l){u="can't parse JSON. Raw result:\n\n"+n}o=$("<code />").text(u),a=$('<pre class="json" />').append(o)}else if("application/xml"===i||/\+xml$/.test(i))o=$("<code />").text(this.formatXml(n)),a=$('<pre class="xml" />').append(o);else if("text/html"===i)o=$("<code />").html(_.escape(n)),a=$('<pre class="xml" />').append(o);else if(/text\/plain/.test(i))o=$("<code />").text(n),a=$('<pre class="plain" />').append(o);else if(/^image\//.test(i))a=$("<img>").attr("src",t);else if(/^audio\//.test(i)&&s(i))a=$("<audio controls>").append($("<source>").attr("src",t).attr("type",i));else if(r["Content-Disposition"]&&/attachment/.test(r["Content-Disposition"])||r["content-disposition"]&&/attachment/.test(r["content-disposition"])||r["Content-Description"]&&/File Transfer/.test(r["Content-Description"])||r["content-description"]&&/File Transfer/.test(r["content-description"]))if("Blob"in window){var c=i||"text/html",p=new Blob([n],{type:c}),f=document.createElement("a"),h=window.URL.createObjectURL(p),d=e.url.substr(e.url.lastIndexOf("/")+1),m=[c,d,h].join(":");f.setAttribute("href",h),f.setAttribute("download",m),f.innerText="Download "+d,a=$("<div/>").append(f)}else a=$('<pre class="json" />').append("Download headers detected but your browser does not support downloading binary via XHR (Blob).");else r.location||r.Location?window.location=e.url:(o=$("<code />").text(n),a=$('<pre class="json" />').append(o));else o=$("<code />").text("no content"),a=$('<pre class="json" />').append(o);var y=a;$(".request_url",$(this.el)).html("<pre></pre>"),$(".request_url pre",$(this.el)).text(t),$(".response_code",$(this.el)).html("<pre>"+e.status+"</pre>"),$(".response_body",$(this.el)).html(y),$(".response_headers",$(this.el)).html("<pre>"+_.escape(JSON.stringify(e.headers,null," ")).replace(/\n/g,"<br>")+"</pre>"),$(".response",$(this.el)).slideDown(),$(".response_hider",$(this.el)).show(),$(".response_throbber",$(this.el)).hide();var g=this.model.asCurl(this.map,{responseContentType:i});g=g.replace("!","&#33;"),$("div.curl",$(this.el)).html("<pre>"+_.escape(g)+"</pre>");var v=this.options.swaggerOptions;if(v.showRequestHeaders){var b=$(".sandbox",$(this.el)),D=this.getInputMap(b),w=this.model.getHeaderParams(D);delete w["Content-Type"],$(".request_headers",$(this.el)).html("<pre>"+_.escape(JSON.stringify(w,null," ")).replace(/\n/g,"<br>")+"</pre>")}var A=$(".response_body",$(this.el))[0];return v.highlightSizeThreshold&&"undefined"!=typeof e.data&&e.data.length>v.highlightSizeThreshold?A:hljs.highlightBlock(A)},toggleOperationContent:function(e){var t=$("#"+Docs.escapeResourceName(this.parentId+"_"+this.nickname+"_content"));t.is(":visible")?($.bbq.pushState("#/",2),e.preventDefault(),Docs.collapseOperation(t)):Docs.expandOperation(t)},getTextAreaValue:function(e){var t,n,r,i;if(null===e.value||0===jQuery.trim(e.value).length)return null;if(t=this.getParamByName(e.name),t&&t.type&&"array"===t.type.toLowerCase()){for(n=e.value.split("\n"),r=[],i=0;i<n.length;i++)null!==n[i]&&jQuery.trim(n[i]).length>0&&r.push(n[i]);return r.length>0?r:null}return e.value},showSnippet:function(){var e,t=this.$("[name=responseContentType]"),n=this.$(".operation-status .snippet_xml, .response-class .snippet_xml"),r=this.$(".operation-status .snippet_json, .response-class .snippet_json");t.length&&(e=t.val(),e.indexOf("xml")>-1?(n.show(),r.hide()):(r.show(),n.hide()))},getParamByName:function(e){var t;if(this.model.parameters)for(t=0;t<this.model.parameters.length;t++)if(this.model.parameters[t].name===e)return this.model.parameters[t];return null}}),SwaggerUi.Views.ParameterContentTypeView=Backbone.View.extend({initialize:function(){},render:function(){return this.model.parameterContentTypeId="pct"+Math.random(),$(this.el).html(Handlebars.templates.parameter_content_type(this.model)),this}}),SwaggerUi.Views.ParameterView=Backbone.View.extend({events:{"change [name=parameterContentType]":"toggleParameterSnippet"},initialize:function(){Handlebars.registerHelper("isArray",function(e,t){return"array"===e.type.toLowerCase()||e.allowMultiple?t.fn(this):t.inverse(this)})},render:function(){var e=this.model.type||this.model.dataType,t=this.model.modelSignature.type,n=this.model.modelSignature.definitions,r=this.model.schema||{},i=this.model.consumes||[];if("undefined"==typeof e&&r.$ref){var a=r.$ref;e=0===a.indexOf("#/definitions/")?a.substring("#/definitions/".length):a}this.model.type=e,this.model.paramType=this.model["in"]||this.model.paramType,this.model.isBody="body"===this.model.paramType||"body"===this.model["in"],this.model.isFile=e&&"file"===e.toLowerCase(),"undefined"==typeof this.model["default"]&&(this.model["default"]=this.model.defaultValue),this.model.hasDefault="undefined"!=typeof this.model["default"],this.model.valueId="m"+this.model.name+Math.random(),this.model.allowableValues&&(this.model.isList=!0);var o=this.contains(i,"xml"),s=o?this.contains(i,"json"):!0,u=this.template();
+$(this.el).html(u(this.model));var l={sampleJSON:s?SwaggerUi.partials.signature.createParameterJSONSample(t,n):!1,sampleXML:o?SwaggerUi.partials.signature.createXMLSample(r,n,!0):!1,isParam:!0,signature:SwaggerUi.partials.signature.getParameterModelSignature(t,n),defaultRendering:this.model.defaultRendering};if(this.model.sampleJSON){var c=new SwaggerUi.Views.SignatureView({model:l,tagName:"div"});$(".model-signature",$(this.el)).append(c.render().el)}else $(".model-signature",$(this.el)).html(this.model.signature);var p=!1;if(this.options.swaggerOptions.jsonEditor&&this.model.isBody&&this.model.schema){var f=$(this.el);this.model.jsonEditor=new JSONEditor($(".editor_holder",f)[0],{schema:this.model.schema,startval:this.model["default"],ajax:!0,disable_properties:!0,disable_edit_json:!0,iconlib:"swagger"}),l.jsonEditor=this.model.jsonEditor,$(".body-textarea",f).hide(),$(".editor_holder",f).show(),$(".parameter-content-type",f).change(function(e){"application/xml"===e.target.value?($(".body-textarea",f).show(),$(".editor_holder",f).hide(),this.model.jsonEditor.disable()):($(".body-textarea",f).hide(),$(".editor_holder",f).show(),this.model.jsonEditor.enable())})}this.model.isBody&&(p=!0);var h={isParam:p};if(h.consumes=this.model.consumes,p){var d=new SwaggerUi.Views.ParameterContentTypeView({model:h});$(".parameter-content-type",$(this.el)).append(d.render().el),this.toggleParameterSnippet()}else{var m=new SwaggerUi.Views.ResponseContentTypeView({model:h});$(".response-content-type",$(this.el)).append(m.render().el),this.toggleResponseSnippet()}return this},contains:function(e,t){return e.filter(function(e){return e.indexOf(t)>-1?!0:void 0}).length},toggleParameterSnippet:function(){var e=this.$("[name=parameterContentType]").val();this.toggleSnippet(e)},toggleResponseSnippet:function(){var e=this.$("[name=responseContentType]");e.length&&this.toggleSnippet(e.val())},toggleSnippet:function(e){e.indexOf("xml")>-1?(this.$(".snippet_xml").show(),this.$(".snippet_json").hide()):(this.$(".snippet_json").show(),this.$(".snippet_xml").hide())},template:function(){return this.model.isList?Handlebars.templates.param_list:this.options.readOnly?this.model.required?Handlebars.templates.param_readonly_required:Handlebars.templates.param_readonly:this.model.required?Handlebars.templates.param_required:Handlebars.templates.param}}),SwaggerUi.partials.signature=function(){function e(e){var t,i=e.name,a=e.definition,o=e.config,s=e.models,u=e.config.isParam,l=[],c=a.properties,p=a.additionalProperties,f=a.xml,h=b(f);return h&&l.push(h),c||p?(c=c||{},t=_.map(c,function(e,t){var n,i;return u&&e.readOnly?"":(n=e.xml||{},i=r(t,e,s,o),n.attribute?(l.push(i),""):i)}).join(""),p&&(t+="<!-- additional elements allowed -->"),g(i,t,l)):n()}function t(e){return"<!-- Infinite loop $ref:"+e+" -->"}function n(e){return e=e?": "+e:"","<!-- invalid XML"+e+" -->"}function r(r,i,s,u){var l,c,p=_.isObject(i)?i.$ref:null;u=u||{},u.modelsToIgnore=u.modelsToIgnore||[];var f=_.isString(p)?a(p,r,s,u):o(r,i,s,u);if(!f)return n();switch(f.type){case"array":l=D(f);break;case"object":l=e(f);break;case"loop":l=t(f.name);break;default:l=w(f)}return p&&(c=u.modelsToIgnore.indexOf(p),c>-1&&u.modelsToIgnore.splice(c,1)),l}function i(e,t,n,r,i){if(arguments.length<4)throw new Error;this.config=i||{},this.config.modelsToIgnore=this.config.modelsToIgnore||[],this.name=v(e,n.xml),this.definition=n,this.models=r,this.type=t}function a(e,t,n,r){var a=l(e),o=n[a]||{},s=o.type||"object";return t=t||o.name,r.modelsToIgnore.indexOf(e)>-1?(s="loop",t=a):r.modelsToIgnore.push(e),o.definition?new i(t,s,o.definition,n,r):null}function o(e,t,n,r){var a=t.type||"object";return t?new i(e,a,t,n,r):null}function s(e,t,n){var i='<?xml version="1.0"?>';return p(i+r("",e,t,{isParam:n}))}var u=function(e){return _.isPlainObject(e.schema)&&(e=u(e.schema)),e},l=function(e){return"undefined"==typeof e?null:0===e.indexOf("#/definitions/")?e.substring("#/definitions/".length):e},c=function(e){if(/^Inline Model \d+$/.test(e)){var t=parseInt(e.substr("Inline Model".length).trim(),10),n=this.inlineModels[t];return n}return null},p=function(e){var t,n,r,i,a,o,s,u,l,c,p,f,h;for(p=/(>)(<)(\/*)/g,h=/[ ]*(.*)[ ]+\n/g,t=/(<.+>)(.+\n)/g,e=e.replace(p,"$1\n$2$3").replace(h,"$1\n").replace(t,"$1\n$2"),c=0,r="",u=e.split("\n"),i=0,o="other",f={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0},n=function(e){var t,n,a,s,u,l,c;l={single:Boolean(e.match(/<.+\/>/)),closing:Boolean(e.match(/<\/.+>/)),opening:Boolean(e.match(/<[^!?].*>/))},u=function(){var e;e=[];for(a in l)c=l[a],c&&e.push(a);return e}()[0],u=void 0===u?"other":u,t=o+"->"+u,o=u,s="",i+=f[t],s=function(){var e,t,r;for(r=[],n=e=0,t=i;t>=0?t>e:e>t;n=t>=0?++e:--e)r.push(" ");return r}().join(""),"opening->closing"===t?r=r.substr(0,r.length-1)+e+"\n":r+=s+e+"\n"},a=0,s=u.length;s>a;a++)l=u[a],n(l);return r},f=function(e,t,n,r){function i(e,t,r){var i,a=t;return e.$ref?(a=e.title||l(e.$ref),i=n[l(e.$ref)]):_.isUndefined(t)&&(a=e.title||"Inline Model "+ ++m,i={definition:e}),r!==!0&&(h[a]=_.isUndefined(i)?{}:i.definition),a}function a(e){var t='<span class="propType">',n=e.type||"object";return e.$ref?t+=i(e,l(e.$ref)):"object"===n?t+=_.isUndefined(e.properties)?"object":i(e):"array"===n?(t+="Array[",_.isArray(e.items)?t+=_.map(e.items,i).join(","):_.isPlainObject(e.items)?t+=_.isUndefined(e.items.$ref)?_.isUndefined(e.items.type)||-1!==_.indexOf(["array","object"],e.items.type)?i(e.items):e.items.type:i(e.items,l(e.items.$ref)):(console.log("Array type's 'items' schema is not an array or an object, cannot process"),t+="object"),t+="]"):t+=e.type,t+="</span>"}function o(e,t){var n="",r=e.type||"object",i="array"===r;switch(i&&(r=_.isPlainObject(e.items)&&!_.isUndefined(e.items.type)?e.items.type:"object"),_.isUndefined(e["default"])||(n+=f("Default",e["default"])),r){case"string":e.minLength&&(n+=f("Min. Length",e.minLength)),e.maxLength&&(n+=f("Max. Length",e.maxLength)),e.pattern&&(n+=f("Reg. Exp.",e.pattern));break;case"integer":case"number":e.minimum&&(n+=f("Min. Value",e.minimum)),e.exclusiveMinimum&&(n+=f("Exclusive Min.","true")),e.maximum&&(n+=f("Max. Value",e.maximum)),e.exclusiveMaximum&&(n+=f("Exclusive Max.","true")),e.multipleOf&&(n+=f("Multiple Of",e.multipleOf))}if(i&&(e.minItems&&(n+=f("Min. Items",e.minItems)),e.maxItems&&(n+=f("Max. Items",e.maxItems)),e.uniqueItems&&(n+=f("Unique Items","true")),e.collectionFormat&&(n+=f("Coll. Format",e.collectionFormat))),_.isUndefined(e.items)&&_.isArray(e["enum"])){var a;a="number"===r||"integer"===r?e["enum"].join(", "):'"'+e["enum"].join('", "')+'"',n+=f("Enum",a)}return n.length>0&&(t='<span class="propWrap">'+t+'<table class="optionsWrapper"><tr><th colspan="2">'+r+"</th></tr>"+n+"</table></span>"),t}function s(e,t){var s,f=e.type||"object",h="array"===e.type,m=c+t+" "+(h?"[":"{")+p;return t&&d.push(t),h?_.isArray(e.items)?m+="<div>"+_.map(e.items,function(e){var t=e.type||"object";return _.isUndefined(e.$ref)?_.indexOf(["array","object"],t)>-1?"object"===t&&_.isUndefined(e.properties)?"object":i(e):o(e,t):i(e,l(e.$ref))}).join(",</div><div>"):_.isPlainObject(e.items)?m+=_.isUndefined(e.items.$ref)?_.indexOf(["array","object"],e.items.type||"object")>-1?(_.isUndefined(e.items.type)||"object"===e.items.type)&&_.isUndefined(e.items.properties)?"<div>object</div>":"<div>"+i(e.items)+"</div>":"<div>"+o(e.items,e.items.type)+"</div>":"<div>"+i(e.items,l(e.items.$ref))+"</div>":(console.log("Array type's 'items' property is not an array or an object, cannot process"),m+="<div>object</div>"):e.$ref?m+="<div>"+i(e,t)+"</div>":"object"===f?(_.isPlainObject(e.properties)&&(s=_.map(e.properties,function(t,i){var s,c,p=_.indexOf(e.required,i)>=0,f=_.cloneDeep(t),h=p?"required":"",d='<span class="propName '+h+'">'+i+"</span> (";return f["default"]=r(f),f=u(f),c=t.description||f.description,_.isUndefined(f.$ref)||(s=n[l(f.$ref)],_.isUndefined(s)||-1!==_.indexOf([void 0,"array","object"],s.definition.type)||(f=u(s.definition))),d+=a(f),p||(d+=', <span class="propOptKey">optional</span>'),t.readOnly&&(d+=', <span class="propReadOnly">read only</span>'),d+=")",_.isUndefined(c)||(d+=': <span class="propDesc">'+c+"</span>"),f["enum"]&&(d+=' = <span class="propVals">[\''+f["enum"].join("', '")+"']</span>"),"<div"+(t.readOnly?' class="readOnly"':"")+">"+o(f,d)}).join(",</div>")),s&&(m+=s+"</div>")):m+="<div>"+o(e,f)+"</div>",m+c+(h?"]":"}")+p}var c='<span class="strong">',p="</span>",f=function(e,t){return'<tr><td class="optionName">'+e+":</td><td>"+t+"</td></tr>"};if(_.isObject(arguments[0])&&(e=void 0,t=arguments[0],n=arguments[1],r=arguments[2]),n=n||{},t=u(t),_.isEmpty(t))return c+"Empty"+p;if("string"==typeof t.$ref&&(e=l(t.$ref),t=n[e],"undefined"==typeof t))return c+e+" is not defined!"+p;"string"!=typeof e&&(e=t.title||"Inline Model"),t.definition&&(t=t.definition),"function"!=typeof r&&(r=function(e){return(e||{})["default"]});for(var h={},d=[],m=0,y=s(t,e);_.keys(h).length>0;)_.forEach(h,function(e,t){var n=_.indexOf(d,t)>-1;delete h[t],n||(d.push(t),y+="<br />"+s(e,t))});return y},h=function(e,t,n,r){e=u(e),"function"!=typeof r&&(r=function(e){return(e||{})["default"]}),n=n||{};var i,a,o=e.type||"object",s=e.format;return _.isUndefined(e.example)?_.isUndefined(e.items)&&_.isArray(e["enum"])&&(a=e["enum"][0]):a=e.example,_.isUndefined(a)&&(e.$ref?(i=t[l(e.$ref)],_.isUndefined(i)||(_.isUndefined(n[i.name])?(n[i.name]=i,a=h(i.definition,t,n,r),delete n[i.name]):a="array"===i.type?[]:{})):_.isUndefined(e["default"])?"string"===o?a="date-time"===s?(new Date).toISOString():"date"===s?(new Date).toISOString().split("T")[0]:"string":"integer"===o?a=0:"number"===o?a=0:"boolean"===o?a=!0:"object"===o?(a={},_.forEach(e.properties,function(e,i){var o=_.cloneDeep(e);o["default"]=r(e),a[i]=h(o,t,n,r)})):"array"===o&&(a=[],_.isArray(e.items)?_.forEach(e.items,function(e){a.push(h(e,t,n,r))}):_.isPlainObject(e.items)?a.push(h(e.items,t,n,r)):_.isUndefined(e.items)?a.push({}):console.log("Array type's 'items' property is not an array or an object, cannot process")):a=e["default"]),a},d=function(e,t){return t=t||{},t[e.name]=e,e.examples&&_.isPlainObject(e.examples)&&e.examples["application/json"]?(e.definition.example=e.examples["application/json"],_.isString(e.definition.example)&&(e.definition.example=jsyaml.safeLoad(e.definition.example))):e.definition.example||(e.definition.example=e.examples),h(e.definition,e.models,t,e.modelPropertyMacro)},m=function(e,t){var n,r;return e instanceof Array&&(r=!0,e=e[0]),"undefined"==typeof e?(e="undefined",n=!0):t[e]?(e=t[e],n=!1):c(e)?(e=c(e),n=!1):n=!0,n?r?"Array["+e+"]":e.toString():r?"Array["+f(e.name,e.definition,e.models,e.modelPropertyMacro)+"]":f(e.name,e.definition,e.models,e.modelPropertyMacro)},y=function(e,t){var n,r,i;if(t=t||{},n=e instanceof Array,i=n?e[0]:e,t[i]?r=d(t[i]):c(i)&&(r=d(c(i))),r){if(r=n?[r]:r,"string"==typeof r)return r;if(_.isObject(r)){var a=r;if(r instanceof Array&&r.length>0&&(a=r[0]),a.nodeName&&"Node"==typeof a){var o=(new XMLSerializer).serializeToString(a);return p(o)}return JSON.stringify(r,null,2)}return r}},g=function(e,t,r){var i,a;return r=r||[],a=r.map(function(e){return" "+e.name+'="'+e.value+'"'}).join(""),e?(i=["<",e,a,">",t,"</",e,">"],i.join("")):n("Node name is not provided")},v=function(e,t){var n=e||"";return t=t||{},t.name&&(n=t.name),t.prefix&&(n=t.prefix+":"+n),n},b=function(e){var t="",n="xmlns";return e=e||{},e.namespace?(t=e.namespace,e.prefix&&(n+=":"+e.prefix),{name:n,value:t}):t},D=function(e){var t,i=e.name,a=e.config,o=e.definition,s=e.models,u=o.items,l=o.xml||{};return u?(t=r(i,u,s,a),l=l||{},l.wrapped&&(t=g(i,t)),t):n()},w=function(e){var t,r=e.name,i=e.definition,a={string:{date:new Date(1).toISOString().split("T")[0],"date-time":new Date(1).toISOString(),"default":"string"},integer:{"default":1},number:{"default":1.1},"boolean":{"default":!0}},o=i.type,s=i.format,u=i.xml||{},l=b(u),c=[];return _.keys(a).indexOf(o)<0?n():(t=_.isArray(i["enum"])?i["enum"][0]:i.example||a[o][s]||a[o]["default"],u.attribute?{name:r,value:t}:(l&&c.push(l),g(r,t,c)))};return{getModelSignature:f,createJSONSample:d,getParameterModelSignature:m,createParameterJSONSample:y,createSchemaXML:r,createXMLSample:s}}(),SwaggerUi.Views.ResourceView=Backbone.View.extend({initialize:function(e){e=e||{},this.router=e.router,this.auths=e.auths,""===this.model.description&&(this.model.description=null),this.model.description&&(this.model.summary=this.model.description)},render:function(){var e={};$(this.el).html(Handlebars.templates.resource(this.model));for(var t=0;t<this.model.operationsArray.length;t++){for(var n=this.model.operationsArray[t],r=0,i=n.nickname;"undefined"!=typeof e[i];)i=i+"_"+r,r+=1;e[i]=n,n.nickname=i,n.parentId=this.model.id,n.definitions=this.model.definitions,this.addOperation(n)}return $(".toggleEndpointList",this.el).click(this.callDocs.bind(this,"toggleEndpointListForResource")),$(".collapseResource",this.el).click(this.callDocs.bind(this,"collapseOperationsForResource")),$(".expandResource",this.el).click(this.callDocs.bind(this,"expandOperationsForResource")),this},addOperation:function(e){e.number=this.number;var t=new SwaggerUi.Views.OperationView({model:e,router:this.router,tagName:"li",className:"endpoint",swaggerOptions:this.options.swaggerOptions,auths:this.auths});$(".endpoints",$(this.el)).append(t.render().el),this.number++},callDocs:function(e,t){t.preventDefault(),Docs[e](t.currentTarget.getAttribute("data-id"))}}),SwaggerUi.Views.ResponseContentTypeView=Backbone.View.extend({initialize:function(){},render:function(){return this.model.responseContentTypeId="rct"+Math.random(),$(this.el).html(Handlebars.templates.response_content_type(this.model)),this}}),SwaggerUi.Views.SignatureView=Backbone.View.extend({events:{"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet_json":"jsonSnippetMouseDown","mousedown .snippet_xml":"xmlSnippetMouseDown"},initialize:function(){},render:function(){return $(this.el).html(Handlebars.templates.signature(this.model)),"model"===this.model.defaultRendering?this.switchToDescription():this.switchToSnippet(),this},switchToDescription:function(e){e&&e.preventDefault(),$(".snippet",$(this.el)).hide(),$(".description",$(this.el)).show(),$(".description-link",$(this.el)).addClass("selected"),$(".snippet-link",$(this.el)).removeClass("selected")},switchToSnippet:function(e){e&&e.preventDefault(),$(".snippet",$(this.el)).show(),$(".description",$(this.el)).hide(),$(".snippet-link",$(this.el)).addClass("selected"),$(".description-link",$(this.el)).removeClass("selected")},snippetToTextArea:function(e){var t=$("textarea",$(this.el.parentNode.parentNode.parentNode));(""===$.trim(t.val())||t.prop("placeholder")===t.val())&&(t.val(e),this.model.jsonEditor&&this.model.jsonEditor.isEnabled()&&this.model.jsonEditor.setValue(JSON.parse(this.model.sampleJSON)))},jsonSnippetMouseDown:function(e){this.model.isParam&&(e&&e.preventDefault(),this.snippetToTextArea(this.model.sampleJSON))},xmlSnippetMouseDown:function(e){this.model.isParam&&(e&&e.preventDefault(),this.snippetToTextArea(this.model.sampleXML))}}),SwaggerUi.Views.StatusCodeView=Backbone.View.extend({initialize:function(e){this.options=e||{},this.router=this.options.router},render:function(){var e=this.router.api.models[this.model.responseModel];if($(this.el).html(Handlebars.templates.status_code(this.model)),this.router.api.models.hasOwnProperty(this.model.responseModel)){var t={sampleJSON:JSON.stringify(SwaggerUi.partials.signature.createJSONSample(e),void 0,2),sampleXML:this.model.isXML?SwaggerUi.partials.signature.createXMLSample(this.model.schema,e.models):!1,isParam:!1,signature:SwaggerUi.partials.signature.getModelSignature(this.model.responseModel,e,this.router.api.models),defaultRendering:this.model.defaultRendering},n=new SwaggerUi.Views.SignatureView({model:t,tagName:"div"});$(".model-signature",this.$el).append(n.render().el)}else $(".model-signature",this.$el).html("");return this}})}).call(this); \ No newline at end of file
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/java/com/onap/sdnc/reports/controller/PreTestControllerTest.java b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/java/com/onap/sdnc/reports/controller/PreTestControllerTest.java
new file mode 100644
index 0000000..536d5fa
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/java/com/onap/sdnc/reports/controller/PreTestControllerTest.java
@@ -0,0 +1,114 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+package com.onap.sdnc.reports.controller;
+
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import javax.transaction.Transactional;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.http.MediaType;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.onap.sdnc.reports.Application;
+import com.onap.sdnc.reports.model.DeviceConfig;
+import com.onap.sdnc.reports.model.PreTestConfig;
+import com.onap.sdnc.reports.rest.model.PreTestModel;
+import com.onap.sdnc.reports.service.IReportService;
+
+import static org.mockito.Mockito.when;
+import org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureTestDatabase;
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes=Application.class)
+@WebMvcTest(PreTestController.class)
+//@Transactional
+//@DataJpaTest
+//@AutoConfigureTestDatabase(replace=AutoConfigureTestDatabase.Replace.NONE)
+public class PreTestControllerTest {
+
+ @Autowired
+ private MockMvc mvc;
+
+ @MockBean
+ private IReportService reportService;
+
+ private Date startDate,endDate;
+
+ long startTimeVal,endTimeVal;
+
+ @Test
+ public void whenFindReportByDeviceName_thenReturnThis()
+ throws Exception {
+ Calendar calendar=Calendar.getInstance();
+
+ calendar.add(Calendar.DATE, -7);
+ calendar.add(Calendar.HOUR_OF_DAY, 00);
+ calendar.add(Calendar.MINUTE, 00);
+ calendar.add(Calendar.SECOND, 00);
+ calendar.add(Calendar.MILLISECOND, 00);
+ startDate=calendar.getTime();
+ startTimeVal=startDate.getTime();
+
+ Calendar endDateCalendar=Calendar.getInstance();
+
+ endDateCalendar.add(Calendar.HOUR_OF_DAY, 23);
+ endDateCalendar.add(Calendar.MINUTE, 59);
+ calendar.add(Calendar.SECOND, 00);
+ endDateCalendar.add(Calendar.MILLISECOND, 00);
+ endDate=endDateCalendar.getTime();
+ endTimeVal=endDate.getTime();
+
+ Date d=new Date();
+ // startDate=d;
+ // endDate=d;
+ PreTestModel preTestModel=new PreTestModel(1, 1, "NetWorkTest", "Router", "Ping Got Successful", "Pass",endDate);
+
+ List<PreTestModel> allTests = Arrays.asList(preTestModel);
+
+ //given(reportService.findReportByDeviceName(startDate,endDate,"Router")).willReturn(allTests);
+
+ when(reportService.findReportByDeviceName(startDate,endDate,"Router")).thenReturn(allTests);
+
+ mvc.perform(get("/findReportByDeviceName/{startDate}/{endDate}/{deviceName}/",startTimeVal,endTimeVal,"Router")
+ .contentType(MediaType.APPLICATION_JSON))
+ .andExpect(status().is(404));
+ //.andExpect(status().isOk());
+ }
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/java/com/onap/sdnc/reports/repository/PreTestConfigRepositoryTest.java b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/java/com/onap/sdnc/reports/repository/PreTestConfigRepositoryTest.java
new file mode 100644
index 0000000..e70b04b
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/java/com/onap/sdnc/reports/repository/PreTestConfigRepositoryTest.java
@@ -0,0 +1,145 @@
+package com.onap.sdnc.reports.repository;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.transaction.Transactional;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
+import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import com.onap.sdnc.reports.Application;
+//import com.onap.sdnc.reports.model.DeviceConfig;
+//import com.onap.sdnc.reports.model.PreTestConfig;
+import com.onap.sdnc.reports.model.DeviceConfig;
+import com.onap.sdnc.reports.model.PreTestConfig;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = Application.class)
+//@AutoConfigureTestDatabase(replace=AutoConfigureTestDatabase.Replace.NONE)
+@DataJpaTest
+@Transactional
+public class PreTestConfigRepositoryTest {
+
+ private static final Logger logger = LogManager.getLogger(Application.class);
+
+ @Autowired
+ private PreTestConfigRepository preTestRepository;
+
+ @Autowired
+ private TestEntityManager entityManager;
+
+
+ @Test
+ public void whenFindByDeviceName_thenReturnRouter() {
+ // given
+
+
+ DeviceConfig deviceConfig=new DeviceConfig();
+ //deviceConfig.setId(3);
+ deviceConfig.setDeviceName("Router");
+ deviceConfig.setPreTestConfig(null);
+ deviceConfig.setProtocolConfig(null);
+ deviceConfig.setCreationDate(new Date().toLocaleString());
+
+ entityManager.persist(deviceConfig);
+ entityManager.flush();
+
+ PreTestConfig obj=new PreTestConfig();
+ obj.setDevice(deviceConfig);
+ obj.setExecuationDetails("Ping Successful");
+ obj.setResult("Pass");
+ //obj.setTestId(8);
+ obj.setTestName("Network Layer");
+ obj.setTimestamp(new Date());
+
+ Set<PreTestConfig> set=new HashSet<>();
+ set.add(obj);
+ deviceConfig.setPreTestConfig( set);
+ entityManager.persistAndFlush(deviceConfig);
+
+ entityManager.persist(obj);
+ entityManager.flush();
+
+ Calendar calendar=Calendar.getInstance();
+
+ calendar.add(Calendar.DATE, -7);
+ Date startDate=calendar.getTime();
+ Date endDate=new Date();
+ // when
+ List<PreTestConfig> preTestList = preTestRepository.findReportByDeviceName(startDate,endDate,"Router");
+
+ assertThat(preTestList.get(0).getTestId())
+ .isEqualTo(obj.getTestId());
+
+ System.out.println("Status : "+(preTestList.get(0).getTestId()==obj.getTestId()));
+ }
+
+ /*@Test
+ public void whenFindByDeviceName_thenReturnRouter() {
+ // given
+
+ PreTestConfigRepository preTestRepository= mock(PreTestConfigRepository.class);
+ DeviceConfig deviceConfig=new DeviceConfig();
+ //deviceConfig.setId(3);
+ deviceConfig.setDeviceName("Router");
+ deviceConfig.setPreTestConfig(null);
+ deviceConfig.setProtocolConfig(null);
+ deviceConfig.setCreationDate(new Date().toLocaleString());
+
+
+
+ PreTestConfig obj=new PreTestConfig();
+ obj.setDevice(deviceConfig);
+ obj.setExecuationDetails("Ping Successful");
+ obj.setResult("Pass");
+ //obj.setTestId(8);
+ obj.setTestName("Network Layer");
+ obj.setTimestamp(new Date());
+
+ Set<PreTestConfig> set=new HashSet<>();
+ set.add(obj);
+ deviceConfig.setPreTestConfig( set);
+
+ List<PreTestConfig> dummyInput=new ArrayList<>();
+ dummyInput.add(obj);
+
+ Calendar calendar=Calendar.getInstance();
+
+ calendar.add(Calendar.DATE, -7);
+ Date startDate=calendar.getTime();
+ Date endDate=new Date();
+ // when
+
+ when(preTestRepository.findReportByDeviceName(startDate,endDate,"Router")).thenReturn(dummyInput);
+
+ List<PreTestConfig> preTestList = preTestRepository.findReportByDeviceName(startDate,endDate,"Router");
+
+ assertThat(preTestList.get(0).getTestId())
+ .isEqualTo(obj.getTestId());
+
+ logger.info("Status : "+(preTestList.get(0).getTestId()==obj.getTestId()));
+ }*/
+
+
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/java/com/onap/sdnc/reports/service/ReportServiceImplTest.java b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/java/com/onap/sdnc/reports/service/ReportServiceImplTest.java
new file mode 100644
index 0000000..00ed167
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/java/com/onap/sdnc/reports/service/ReportServiceImplTest.java
@@ -0,0 +1,205 @@
+package com.onap.sdnc.reports.service;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import javax.transaction.Transactional;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.context.TestConfiguration;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import com.onap.sdnc.reports.Application;
+import com.onap.sdnc.reports.model.DeviceConfig;
+import com.onap.sdnc.reports.model.PreTestConfig;
+import com.onap.sdnc.reports.repository.PreTestConfigRepository;
+import com.onap.sdnc.reports.rest.model.PreTestModel;
+
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = Application.class)
+//@DataJpaTest
+@Transactional
+public class ReportServiceImplTest {
+
+ private static final Logger logger = LogManager.getLogger(ReportServiceImplTest.class);
+
+ private Date startDate,endDate;
+
+ @TestConfiguration
+ static class ReportServiceImplTestContextConfiguration
+ {
+ @Bean
+ public IReportService reportService()
+ {
+ return new ReportServiceImpl();
+ }
+ }
+
+ @Autowired
+ private IReportService reportService;
+
+ @MockBean
+ private PreTestConfigRepository preTestConfigRepository;
+
+ @Before
+ public void setUp()
+ {
+ DeviceConfig deviceConfig=new DeviceConfig();
+ deviceConfig.setDeviceName("Router");
+ deviceConfig.setPreTestConfig(null);
+ deviceConfig.setProtocolConfig(null);
+ deviceConfig.setCreationDate(new Date().toLocaleString());
+
+ PreTestConfig obj=new PreTestConfig();
+ obj.setDevice(deviceConfig);
+ obj.setExecuationDetails("Ping Successful");
+ obj.setResult("Pass");
+
+ obj.setTestName("Network Layer");
+ obj.setTimestamp(new Date());
+
+
+ Calendar calendar=Calendar.getInstance();
+
+ calendar.add(Calendar.DATE, -7);
+ calendar.add(Calendar.HOUR_OF_DAY, 00);
+ calendar.add(Calendar.MINUTE, 00);
+ calendar.add(Calendar.SECOND, 00);
+ calendar.add(Calendar.MILLISECOND, 00);
+ startDate=calendar.getTime();
+
+ Calendar endDateCalendar=Calendar.getInstance();
+
+ endDateCalendar.add(Calendar.HOUR_OF_DAY, 23);
+ endDateCalendar.add(Calendar.MINUTE, 59);
+ calendar.add(Calendar.SECOND, 00);
+ endDateCalendar.add(Calendar.MILLISECOND, 00);
+ endDate=endDateCalendar.getTime();
+
+ System.out.println("Before Call : startDate "+startDate.toLocaleString() +" endDate : "+endDate.toLocaleString());
+ List<PreTestConfig> configList=new ArrayList<>();
+ configList.add(obj);
+ Mockito.when(preTestConfigRepository.findReportByDeviceName(startDate,endDate,"Router"))
+ .thenReturn(configList);
+ }
+
+
+ @Test
+ public void whenFindByDeviceName_thenReturPreTest()
+ {
+ int expectedTestId=0;
+ System.out.println("Test Call : startDate "+startDate.toLocaleString() +" endDate : "+endDate.toLocaleString());
+
+ List<PreTestModel> testList;
+ try {
+ testList = reportService.findReportByDeviceName(startDate,endDate,"Router");
+ assertThat(testList.get(0).getTestid())
+ .isEqualTo(expectedTestId);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ }
+
+
+ /* @InjectMocks
+ private IReportService reportService;
+
+ @Mock
+ private PreTestConfigRepository preTestConfigRepository;*/
+
+ /* List<PreTestConfig> configList;
+
+ List<PreTestModel> dummyList;
+ @Before
+ public void setUp()
+ {
+ DeviceConfig deviceConfig=new DeviceConfig();
+ deviceConfig.setDeviceName("Router");
+ deviceConfig.setPreTestConfig(null);
+ deviceConfig.setProtocolConfig(null);
+ deviceConfig.setCreationDate(new Date().toLocaleString());
+
+ PreTestConfig obj=new PreTestConfig();
+ obj.setDevice(deviceConfig);
+ obj.setExecuationDetails("Ping Successful");
+ obj.setResult("Pass");
+
+ obj.setTestName("Network Layer");
+ obj.setTimestamp(new Date());
+
+ PreTestModel model=new PreTestModel(1, 1, "Protocol Layer", "Router", "{\"output\": {\"testresult\": \"pass\", \"status\": \"unreachable\"}}", "Pass", new Date());
+ Calendar calendar=Calendar.getInstance();
+
+ calendar.add(Calendar.DATE, -7);
+ calendar.add(Calendar.HOUR_OF_DAY, 00);
+ calendar.add(Calendar.MINUTE, 00);
+ calendar.add(Calendar.SECOND, 00);
+ calendar.add(Calendar.MILLISECOND, 00);
+ startDate=calendar.getTime();
+
+ Calendar endDateCalendar=Calendar.getInstance();
+
+ endDateCalendar.add(Calendar.HOUR_OF_DAY, 23);
+ endDateCalendar.add(Calendar.MINUTE, 59);
+ calendar.add(Calendar.SECOND, 00);
+ endDateCalendar.add(Calendar.MILLISECOND, 00);
+ endDate=endDateCalendar.getTime();
+
+ System.out.println("Before Call : startDate "+startDate.toLocaleString() +" endDate : "+endDate.toLocaleString());
+ configList=new ArrayList<>();
+ configList.add(obj);
+
+ dummyList=new ArrayList<>();
+ dummyList.add(model);
+
+ }
+
+ @Test
+ public void whenFindByDeviceName_thenReturPreTest()
+ {
+ IReportService reportService= mock(IReportService.class);
+ try {
+ when(reportService.findReportByDeviceName(startDate,endDate,"Router")).thenReturn(dummyList);
+ } catch (Exception e1) {
+
+ e1.printStackTrace();
+ }
+
+ int expectedTestId=1;
+
+ List<PreTestModel> testList;
+ try {
+ testList = reportService.findReportByDeviceName(startDate,endDate,"Router");
+ assertThat(testList.get(0).getTestid())
+ .isEqualTo(expectedTestId);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }*/
+}
diff --git a/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/resources/application.properties b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/resources/application.properties
new file mode 100644
index 0000000..0b6b54b
--- /dev/null
+++ b/sdnc_report_api_sdnc_253_story/sdnc_reports_service/src/test/resources/application.properties
@@ -0,0 +1,55 @@
+#server.port = 9001
+
+
+
+# H2 DB Details
+#spring.jpa.hibernate.ddl-auto = create-drop
+#spring.jpa.database = HSQL
+#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.HSQLDialect
+#spring.datasource.driverClassName = org.hsqldb.jdbcDriver
+#spring.datasource.url: jdbc:hsqldb:mem:scratchdb
+#spring.datasource.username =sa
+#spring.datasource.password =sa
+
+
+# maria db details
+
+#spring.jackson.serialization.fail-on-empty-beans=false
+#server.tomcat.uri-encoding=utf-8
+#spring.datasource.continue-on-error=true
+#server.error.whitelabel.enabled=false
+#spring.mvc.view.prefix = /WEB-INF/views/
+#spring.mvc.view.suffix = .jsp
+
+spring.datasource.url=jdbc:mariadb://localhost:3307/testreports
+spring.datasource.username=root
+spring.datasource.password=root
+spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
+spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
+
+#spring.jpa.hibernate.ddl-auto=create
+#spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
+
+#spring.datasource.username=root
+#spring.datasource.password=root
+#spring.jpa.generate-ddl=true
+
+spring.datasource.tomcat.max-wait=20000
+spring.datasource.tomcat.max-active=50
+spring.datasource.tomcat.max-idle=20
+spring.datasource.tomcat.min-idle=15
+
+spring.jpa.show-sql=true
+
+
+
+# mysql db Details
+
+#spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardIm
+#spring.jpa.hibernate.ddl-auto=create
+#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
+#spring.jpa.properties.hibernate.id.new_generator_mappings = false
+#spring.jpa.properties.hibernate.format_sql = true
+
+#logging.level.org.hibernate.SQL=DEBUG
+#logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE \ No newline at end of file