Commit 0f2953588eaf5b5fbcedb08269b67f524d922403
1 parent
5203184c
Exists in
master
Ajustando estrutura para IC.
Showing
278 changed files
with
9060 additions
and
9060 deletions
Show diff stats
Too many changes.
To preserve performance only 100 of 278 files displayed.
| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<classpath> | |
| 3 | + <classpathentry kind="src" output="target/classes" path="src/main/java"> | |
| 4 | + <attributes> | |
| 5 | + <attribute name="optional" value="true"/> | |
| 6 | + <attribute name="maven.pomderived" value="true"/> | |
| 7 | + </attributes> | |
| 8 | + </classpathentry> | |
| 9 | + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> | |
| 10 | + <attributes> | |
| 11 | + <attribute name="maven.pomderived" value="true"/> | |
| 12 | + </attributes> | |
| 13 | + </classpathentry> | |
| 14 | + <classpathentry kind="src" output="target/test-classes" path="src/test/java"> | |
| 15 | + <attributes> | |
| 16 | + <attribute name="optional" value="true"/> | |
| 17 | + <attribute name="maven.pomderived" value="true"/> | |
| 18 | + </attributes> | |
| 19 | + </classpathentry> | |
| 20 | + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> | |
| 21 | + <attributes> | |
| 22 | + <attribute name="maven.pomderived" value="true"/> | |
| 23 | + </attributes> | |
| 24 | + </classpathentry> | |
| 25 | + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | |
| 26 | + <attributes> | |
| 27 | + <attribute name="maven.pomderived" value="true"/> | |
| 28 | + <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> | |
| 29 | + </attributes> | |
| 30 | + </classpathentry> | |
| 31 | + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> | |
| 32 | + <attributes> | |
| 33 | + <attribute name="maven.pomderived" value="true"/> | |
| 34 | + </attributes> | |
| 35 | + </classpathentry> | |
| 36 | + <classpathentry kind="output" path="target/classes"/> | |
| 37 | +</classpath> | ... | ... |
| ... | ... | @@ -0,0 +1,72 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<projectDescription> | |
| 3 | + <name>templates-broker</name> | |
| 4 | + <comment></comment> | |
| 5 | + <projects> | |
| 6 | + </projects> | |
| 7 | + <buildSpec> | |
| 8 | + <buildCommand> | |
| 9 | + <name>tern.eclipse.ide.core.ternBuilder</name> | |
| 10 | + <arguments> | |
| 11 | + </arguments> | |
| 12 | + </buildCommand> | |
| 13 | + <buildCommand> | |
| 14 | + <name>org.eclipse.wst.jsdt.core.javascriptValidator</name> | |
| 15 | + <arguments> | |
| 16 | + </arguments> | |
| 17 | + </buildCommand> | |
| 18 | + <buildCommand> | |
| 19 | + <name>org.eclipse.jdt.core.javabuilder</name> | |
| 20 | + <arguments> | |
| 21 | + </arguments> | |
| 22 | + </buildCommand> | |
| 23 | + <buildCommand> | |
| 24 | + <name>org.eclipse.wst.common.project.facet.core.builder</name> | |
| 25 | + <arguments> | |
| 26 | + </arguments> | |
| 27 | + </buildCommand> | |
| 28 | + <buildCommand> | |
| 29 | + <name>org.jboss.tools.jst.web.kb.kbbuilder</name> | |
| 30 | + <arguments> | |
| 31 | + </arguments> | |
| 32 | + </buildCommand> | |
| 33 | + <buildCommand> | |
| 34 | + <name>org.hibernate.eclipse.console.hibernateBuilder</name> | |
| 35 | + <arguments> | |
| 36 | + </arguments> | |
| 37 | + </buildCommand> | |
| 38 | + <buildCommand> | |
| 39 | + <name>org.jboss.tools.cdi.core.cdibuilder</name> | |
| 40 | + <arguments> | |
| 41 | + </arguments> | |
| 42 | + </buildCommand> | |
| 43 | + <buildCommand> | |
| 44 | + <name>org.jboss.tools.ws.jaxrs.metamodelBuilder</name> | |
| 45 | + <arguments> | |
| 46 | + </arguments> | |
| 47 | + </buildCommand> | |
| 48 | + <buildCommand> | |
| 49 | + <name>org.eclipse.wst.validation.validationbuilder</name> | |
| 50 | + <arguments> | |
| 51 | + </arguments> | |
| 52 | + </buildCommand> | |
| 53 | + <buildCommand> | |
| 54 | + <name>org.eclipse.m2e.core.maven2Builder</name> | |
| 55 | + <arguments> | |
| 56 | + </arguments> | |
| 57 | + </buildCommand> | |
| 58 | + </buildSpec> | |
| 59 | + <natures> | |
| 60 | + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> | |
| 61 | + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> | |
| 62 | + <nature>org.eclipse.jdt.core.javanature</nature> | |
| 63 | + <nature>org.eclipse.m2e.core.maven2Nature</nature> | |
| 64 | + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> | |
| 65 | + <nature>org.eclipse.wst.jsdt.core.jsNature</nature> | |
| 66 | + <nature>org.hibernate.eclipse.console.hibernateNature</nature> | |
| 67 | + <nature>org.jboss.tools.jst.web.kb.kbnature</nature> | |
| 68 | + <nature>org.jboss.tools.cdi.core.cdinature</nature> | |
| 69 | + <nature>org.jboss.tools.jsf.jsfnature</nature> | |
| 70 | + <nature>org.jboss.tools.ws.jaxrs.nature</nature> | |
| 71 | + </natures> | |
| 72 | +</projectDescription> | ... | ... |
| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<classpath> | |
| 3 | + <classpathentry kind="src" path="src/main/webapp"/> | |
| 4 | + <classpathentry kind="src" path="target/m2e-wtp/web-resources"/> | |
| 5 | + <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> | |
| 6 | + <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"> | |
| 7 | + <attributes> | |
| 8 | + <attribute name="hide" value="true"/> | |
| 9 | + </attributes> | |
| 10 | + </classpathentry> | |
| 11 | + <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/> | |
| 12 | + <classpathentry kind="output" path=""/> | |
| 13 | +</classpath> | ... | ... |
| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | +eclipse.preferences.version=1 | |
| 2 | +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | |
| 3 | +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate | |
| 4 | +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | |
| 5 | +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | |
| 6 | +org.eclipse.jdt.core.compiler.compliance=1.8 | |
| 7 | +org.eclipse.jdt.core.compiler.debug.lineNumber=generate | |
| 8 | +org.eclipse.jdt.core.compiler.debug.localVariable=generate | |
| 9 | +org.eclipse.jdt.core.compiler.debug.sourceFile=generate | |
| 10 | +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | |
| 11 | +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | |
| 12 | +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning | |
| 13 | +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore | |
| 14 | +org.eclipse.jdt.core.compiler.source=1.8 | ... | ... |
| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> | |
| 2 | + <wb-module deploy-name="templates-broker-0.0.1"> | |
| 3 | + <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> | |
| 4 | + <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> | |
| 5 | + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> | |
| 6 | + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> | |
| 7 | + <property name="java-output-path" value="/templates-broker/target/classes"/> | |
| 8 | + <property name="context-root" value="templates-broker"/> | |
| 9 | + </wb-module> | |
| 10 | +</project-modules> | ... | ... |
.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
0 → 100644
| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | +<root> | |
| 2 | + <facet id="jst.jsf"> | |
| 3 | + <node name="libprov"> | |
| 4 | + <attribute name="provider-id" value="jsf-no-op-library-provider"/> | |
| 5 | + </node> | |
| 6 | + </facet> | |
| 7 | + <facet id="jpt.jpa"> | |
| 8 | + <node name="libprov"> | |
| 9 | + <attribute name="provider-id" value="jpa-no-op-library-provider"/> | |
| 10 | + </node> | |
| 11 | + </facet> | |
| 12 | + <facet id="jst.jsf"> | |
| 13 | + <node name="libprov"> | |
| 14 | + <attribute name="provider-id" value="jaxrs-no-op-library-provider"/> | |
| 15 | + </node> | |
| 16 | + </facet> | |
| 17 | +</root> | ... | ... |
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<faceted-project> | |
| 3 | + <fixed facet="wst.jsdt.web"/> | |
| 4 | + <installed facet="wst.jsdt.web" version="1.0"/> | |
| 5 | + <installed facet="jst.cdi" version="1.1"/> | |
| 6 | + <installed facet="jboss.m2" version="1.0"/> | |
| 7 | + <installed facet="jst.web" version="3.0"/> | |
| 8 | + <installed facet="jst.jaxrs" version="2.0"/> | |
| 9 | + <installed facet="jpt.jpa" version="2.1"/> | |
| 10 | + <installed facet="java" version="1.8"/> | |
| 11 | +</faceted-project> | ... | ... |
| ... | ... | @@ -0,0 +1,157 @@ |
| 1 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 2 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| 3 | + <modelVersion>4.0.0</modelVersion> | |
| 4 | + <groupId>br.gov.ans</groupId> | |
| 5 | + <artifactId>templates-broker</artifactId> | |
| 6 | + <version>1.0</version> | |
| 7 | + <packaging>war</packaging> | |
| 8 | + <name>templates-broker</name> | |
| 9 | + <description>Sistema de gerenciamento de templates.</description> | |
| 10 | + | |
| 11 | + <!-- CONFIGURAR VERSÃO DO JAVA PARA 1.8 --> | |
| 12 | + <build> | |
| 13 | + <plugins> | |
| 14 | + <plugin> | |
| 15 | + <groupId>org.apache.maven.plugins</groupId> | |
| 16 | + <artifactId>maven-compiler-plugin</artifactId> | |
| 17 | + <version>3.1</version> | |
| 18 | + <configuration> | |
| 19 | + <source>1.8</source> | |
| 20 | + <target>1.8</target> | |
| 21 | + </configuration> | |
| 22 | + </plugin> | |
| 23 | + </plugins> | |
| 24 | + </build> | |
| 25 | + | |
| 26 | + <dependencies> | |
| 27 | + | |
| 28 | + <!-- HIBERNATE --> | |
| 29 | + <dependency> | |
| 30 | + <groupId>org.hibernate</groupId> | |
| 31 | + <artifactId>hibernate-core</artifactId> | |
| 32 | + <version>5.2.6.Final</version> | |
| 33 | + </dependency> | |
| 34 | + | |
| 35 | + <dependency> | |
| 36 | + <groupId>org.hibernate.javax.persistence</groupId> | |
| 37 | + <artifactId>hibernate-jpa-2.1-api</artifactId> | |
| 38 | + <version>1.0.0.Final-redhat-1</version> | |
| 39 | + </dependency> | |
| 40 | + | |
| 41 | + <dependency> | |
| 42 | + <groupId>org.jboss.spec.javax.transaction</groupId> | |
| 43 | + <artifactId>jboss-transaction-api_1.2_spec</artifactId> | |
| 44 | + <version>1.0.0.Final</version> | |
| 45 | + </dependency> | |
| 46 | + | |
| 47 | + <!-- CDI --> | |
| 48 | + <dependency> | |
| 49 | + <groupId>org.jboss.weld</groupId> | |
| 50 | + <artifactId>weld-core</artifactId> | |
| 51 | + <version>2.2.15.Final</version> | |
| 52 | + </dependency> | |
| 53 | + | |
| 54 | + <!-- REST --> | |
| 55 | + <dependency> | |
| 56 | + <groupId>org.jboss.resteasy</groupId> | |
| 57 | + <artifactId>resteasy-jaxrs</artifactId> | |
| 58 | + <version>3.1.0.Final</version> | |
| 59 | + <scope>provided</scope> | |
| 60 | + </dependency> | |
| 61 | + | |
| 62 | + <dependency> | |
| 63 | + <groupId>org.jboss.resteasy</groupId> | |
| 64 | + <artifactId>resteasy-jackson-provider</artifactId> | |
| 65 | + <version>3.1.0.Final</version> | |
| 66 | + </dependency> | |
| 67 | + | |
| 68 | + <dependency> | |
| 69 | + <groupId>org.jboss.resteasy</groupId> | |
| 70 | + <artifactId>resteasy-jaxb-provider</artifactId> | |
| 71 | + <version>3.1.0.Final</version> | |
| 72 | + </dependency> | |
| 73 | + | |
| 74 | + <dependency> | |
| 75 | + <groupId>org.jboss.resteasy</groupId> | |
| 76 | + <artifactId>resteasy-wadl</artifactId> | |
| 77 | + <version>3.1.0.Final</version> | |
| 78 | + </dependency> | |
| 79 | + | |
| 80 | + <dependency> | |
| 81 | + <groupId>org.jboss.resteasy</groupId> | |
| 82 | + <artifactId>resteasy-hibernatevalidator-provider</artifactId> | |
| 83 | + <version>3.0.19.Final</version> | |
| 84 | + <scope>provided</scope> | |
| 85 | + </dependency> | |
| 86 | + | |
| 87 | + <!-- HTML MINIFY --> | |
| 88 | + <dependency> | |
| 89 | + <groupId>com.github.hazendaz</groupId> | |
| 90 | + <artifactId>htmlcompressor</artifactId> | |
| 91 | + <version>1.6.2</version> | |
| 92 | + </dependency> | |
| 93 | + | |
| 94 | + <!-- EJB --> | |
| 95 | + <dependency> | |
| 96 | + <groupId>org.jboss.ejb3</groupId> | |
| 97 | + <artifactId>jboss-ejb3-api</artifactId> | |
| 98 | + <version>3.1.0</version> | |
| 99 | + <scope>provided</scope> | |
| 100 | + </dependency> | |
| 101 | + | |
| 102 | + <!-- COMMONS --> | |
| 103 | + <dependency> | |
| 104 | + <groupId>org.apache.commons</groupId> | |
| 105 | + <artifactId>commons-lang3</artifactId> | |
| 106 | + <version>3.4</version> | |
| 107 | + <scope>provided</scope> | |
| 108 | + </dependency> | |
| 109 | + | |
| 110 | + <!-- GSON --> | |
| 111 | + <dependency> | |
| 112 | + <groupId>com.google.code.gson</groupId> | |
| 113 | + <artifactId>gson</artifactId> | |
| 114 | + <version>2.6.2</version> | |
| 115 | + </dependency> | |
| 116 | + | |
| 117 | + <!-- SERVLET --> | |
| 118 | + <dependency> | |
| 119 | + <groupId>javax.servlet</groupId> | |
| 120 | + <artifactId>javax.servlet-api</artifactId> | |
| 121 | + <version>3.0.1</version> | |
| 122 | + </dependency> | |
| 123 | + | |
| 124 | + <!-- SWAGGER --> | |
| 125 | + <dependency> | |
| 126 | + <groupId>io.swagger</groupId> | |
| 127 | + <artifactId>swagger-annotations</artifactId> | |
| 128 | + <version>1.5.12</version> | |
| 129 | + </dependency> | |
| 130 | + | |
| 131 | + <dependency> | |
| 132 | + <groupId>io.swagger</groupId> | |
| 133 | + <artifactId>swagger-jaxrs</artifactId> | |
| 134 | + <version>1.5.12</version> | |
| 135 | + </dependency> | |
| 136 | + | |
| 137 | + <!-- REST Assure --> | |
| 138 | + <dependency> | |
| 139 | + <groupId>junit</groupId> | |
| 140 | + <artifactId>junit</artifactId> | |
| 141 | + <version>4.12</version> | |
| 142 | + <scope>test</scope> | |
| 143 | + </dependency> | |
| 144 | + <dependency> | |
| 145 | + <groupId>org.hamcrest</groupId> | |
| 146 | + <artifactId>hamcrest-all</artifactId> | |
| 147 | + <version>1.3</version> | |
| 148 | + <scope>test</scope> | |
| 149 | + </dependency> | |
| 150 | + <dependency> | |
| 151 | + <groupId>com.jayway.restassured</groupId> | |
| 152 | + <artifactId>rest-assured</artifactId> | |
| 153 | + <version>2.9.0</version> | |
| 154 | + <scope>test</scope> | |
| 155 | + </dependency> | |
| 156 | + </dependencies> | |
| 157 | +</project> | |
| 0 | 158 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,99 @@ |
| 1 | +package br.gov.ans.dao; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.List; | |
| 5 | +import java.util.Map; | |
| 6 | + | |
| 7 | +import javax.persistence.EntityManager; | |
| 8 | +import javax.persistence.Query; | |
| 9 | +import javax.persistence.criteria.CriteriaQuery; | |
| 10 | +import javax.persistence.criteria.Root; | |
| 11 | +import javax.transaction.Transactional; | |
| 12 | + | |
| 13 | +public class DAO<T> implements Serializable{ | |
| 14 | + | |
| 15 | + private static final long serialVersionUID = 1L; | |
| 16 | + | |
| 17 | + private EntityManager em; | |
| 18 | + | |
| 19 | + | |
| 20 | + protected final Class<T> classe; | |
| 21 | + | |
| 22 | + public DAO(Class<T> classe, EntityManager em){ | |
| 23 | + this.classe = classe; | |
| 24 | + this.em = em; | |
| 25 | + } | |
| 26 | + | |
| 27 | + @Transactional | |
| 28 | + public void persist(T t){ | |
| 29 | + em.persist(t); | |
| 30 | + em.flush(); | |
| 31 | + } | |
| 32 | + | |
| 33 | + @Transactional | |
| 34 | + public void merge(T t){ | |
| 35 | + em.merge(t); | |
| 36 | + } | |
| 37 | + | |
| 38 | + @Transactional | |
| 39 | + public void remove(T t) { | |
| 40 | + em.remove(em.merge(t)); | |
| 41 | + } | |
| 42 | + | |
| 43 | + @Transactional | |
| 44 | + @SuppressWarnings({ "unchecked", "rawtypes" }) | |
| 45 | + public Long count() { | |
| 46 | + CriteriaQuery criteria = em.getCriteriaBuilder().createQuery(); | |
| 47 | + Root<T> root = criteria.from(classe); | |
| 48 | + | |
| 49 | + criteria.select(em.getCriteriaBuilder().count(root)); | |
| 50 | + javax.persistence.Query q = em.createQuery(criteria); | |
| 51 | + | |
| 52 | + return (Long) q.getSingleResult(); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @Transactional | |
| 56 | + @SuppressWarnings({ "unchecked", "rawtypes" }) | |
| 57 | + public List<T> executeNamedQuery(String queryName, Map<String, Object> params){ | |
| 58 | + Query query = em.createNamedQuery(queryName, classe); | |
| 59 | + | |
| 60 | + if ((params != null) && (!params.isEmpty())) { | |
| 61 | + for (Map.Entry entry : params.entrySet()) { | |
| 62 | + query.setParameter((String) entry.getKey(),entry.getValue()); | |
| 63 | + } | |
| 64 | + } | |
| 65 | + | |
| 66 | + return query.getResultList(); | |
| 67 | + } | |
| 68 | + | |
| 69 | + @Transactional | |
| 70 | + @SuppressWarnings({ "rawtypes" }) | |
| 71 | + public Query createNamedQuery(String queryName, Map<String, Object> params){ | |
| 72 | + Query query = em.createNamedQuery(queryName, classe); | |
| 73 | + | |
| 74 | + if ((params != null) && (!params.isEmpty())) { | |
| 75 | + for (Map.Entry entry : params.entrySet()) { | |
| 76 | + query.setParameter((String) entry.getKey(),entry.getValue()); | |
| 77 | + } | |
| 78 | + } | |
| 79 | + | |
| 80 | + return query; | |
| 81 | + } | |
| 82 | + | |
| 83 | + | |
| 84 | + @Transactional | |
| 85 | + @SuppressWarnings("unchecked") | |
| 86 | + public List<T> getPaginatedResultList(int first, int pageSize) { | |
| 87 | + Query query = em.createQuery("from " + classe.getName()); | |
| 88 | + | |
| 89 | + if (pageSize >= 0){ | |
| 90 | + query.setMaxResults(pageSize); | |
| 91 | + } | |
| 92 | + if (first >= 0){ | |
| 93 | + query.setFirstResult(first); | |
| 94 | + } | |
| 95 | + | |
| 96 | + return query.getResultList(); | |
| 97 | + } | |
| 98 | + | |
| 99 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/BusinessException.java
0 → 100644
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +package br.gov.ans.exceptions; | |
| 2 | + | |
| 3 | +public class BusinessException extends Exception{ | |
| 4 | + | |
| 5 | + private static final long serialVersionUID = 1L; | |
| 6 | + | |
| 7 | + private String message; | |
| 8 | + | |
| 9 | + public BusinessException(String message){ | |
| 10 | + this.message = message; | |
| 11 | + } | |
| 12 | + | |
| 13 | + public String getMessage() { | |
| 14 | + return message; | |
| 15 | + } | |
| 16 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,41 @@ |
| 1 | +package br.gov.ans.exceptions; | |
| 2 | + | |
| 3 | +import javax.xml.bind.annotation.XmlRootElement; | |
| 4 | + | |
| 5 | +@XmlRootElement | |
| 6 | +public class ErrorMessage { | |
| 7 | + private String error; | |
| 8 | + private String code; | |
| 9 | + | |
| 10 | + public ErrorMessage(){} | |
| 11 | + | |
| 12 | + public ErrorMessage(String error) { | |
| 13 | + this.error = error; | |
| 14 | + } | |
| 15 | + | |
| 16 | + public ErrorMessage(String error, String code) { | |
| 17 | + this.error = error; | |
| 18 | + this.code = code; | |
| 19 | + } | |
| 20 | + | |
| 21 | + public ErrorMessage(String error, int code) { | |
| 22 | + this.error = error; | |
| 23 | + this.code = String.valueOf(code); | |
| 24 | + } | |
| 25 | + | |
| 26 | + public String getError() { | |
| 27 | + return error; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public void setError(String error){ | |
| 31 | + this.error = error; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public String getCode() { | |
| 35 | + return code; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setCode(String code) { | |
| 39 | + this.code = code; | |
| 40 | + } | |
| 41 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/ResourceConflictException.java
0 → 100644
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +package br.gov.ans.exceptions; | |
| 2 | + | |
| 3 | +public class ResourceConflictException extends Exception{ | |
| 4 | + | |
| 5 | + private static final long serialVersionUID = 1L; | |
| 6 | + | |
| 7 | + private String message; | |
| 8 | + | |
| 9 | + public ResourceConflictException(String message){ | |
| 10 | + this.message = message; | |
| 11 | + } | |
| 12 | + | |
| 13 | + public String getMessage() { | |
| 14 | + return message; | |
| 15 | + } | |
| 16 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/ResourceNotFoundException.java
0 → 100644
| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | +package br.gov.ans.exceptions; | |
| 2 | + | |
| 3 | +public class ResourceNotFoundException extends Exception { | |
| 4 | + | |
| 5 | + private static final long serialVersionUID = 1L; | |
| 6 | + | |
| 7 | + private String message; | |
| 8 | + | |
| 9 | + public ResourceNotFoundException(String message) { | |
| 10 | + this.message = message; | |
| 11 | + } | |
| 12 | + | |
| 13 | + public String getMessage() { | |
| 14 | + return message; | |
| 15 | + } | |
| 16 | + | |
| 17 | + public void setMessage(String message) { | |
| 18 | + this.message = message; | |
| 19 | + } | |
| 20 | + | |
| 21 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/WrappedException.java
0 → 100644
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +package br.gov.ans.exceptions; | |
| 2 | + | |
| 3 | +public class WrappedException extends Exception{ | |
| 4 | + | |
| 5 | + private static final long serialVersionUID = 1L; | |
| 6 | + | |
| 7 | + private Exception ex; | |
| 8 | + | |
| 9 | + public WrappedException(Exception ex){ | |
| 10 | + this.ex = ex; | |
| 11 | + } | |
| 12 | + | |
| 13 | + public Exception getEx() { | |
| 14 | + return ex; | |
| 15 | + } | |
| 16 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/BusinessExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import javax.inject.Inject; | |
| 6 | +import javax.ws.rs.core.Context; | |
| 7 | +import javax.ws.rs.core.HttpHeaders; | |
| 8 | +import javax.ws.rs.core.Response; | |
| 9 | +import javax.ws.rs.core.Response.Status; | |
| 10 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 11 | +import javax.ws.rs.ext.Provider; | |
| 12 | + | |
| 13 | +import org.jboss.logging.Logger; | |
| 14 | + | |
| 15 | +import br.gov.ans.exceptions.BusinessException; | |
| 16 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 17 | + | |
| 18 | +@Provider | |
| 19 | +public class BusinessExceptionHandler implements ExceptionMapper<BusinessException>{ | |
| 20 | + | |
| 21 | + @Inject | |
| 22 | + private Logger logger; | |
| 23 | + | |
| 24 | + @Context | |
| 25 | + private HttpHeaders headers; | |
| 26 | + | |
| 27 | + public Response toResponse(BusinessException ex) { | |
| 28 | + logger.error(ex, ex); | |
| 29 | + | |
| 30 | + return Response.status(Status.BAD_REQUEST) | |
| 31 | + .entity(new ErrorMessage(ex.getMessage(),String.valueOf(Status.BAD_REQUEST.getStatusCode()))) | |
| 32 | + .type(getAcceptType(headers)) | |
| 33 | + .build(); | |
| 34 | + } | |
| 35 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/EJBAccessExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import javax.ejb.EJBAccessException; | |
| 6 | +import javax.inject.Inject; | |
| 7 | +import javax.ws.rs.core.Context; | |
| 8 | +import javax.ws.rs.core.HttpHeaders; | |
| 9 | +import javax.ws.rs.core.Response; | |
| 10 | +import javax.ws.rs.core.Response.Status; | |
| 11 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 12 | +import javax.ws.rs.ext.Provider; | |
| 13 | + | |
| 14 | +import org.jboss.logging.Logger; | |
| 15 | + | |
| 16 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 17 | + | |
| 18 | +@Provider | |
| 19 | +public class EJBAccessExceptionHandler implements ExceptionMapper<EJBAccessException>{ | |
| 20 | + | |
| 21 | + @Inject | |
| 22 | + private Logger logger; | |
| 23 | + | |
| 24 | + @Context | |
| 25 | + private HttpHeaders headers; | |
| 26 | + | |
| 27 | + public Response toResponse(EJBAccessException ex) { | |
| 28 | + logger.error(ex, ex); | |
| 29 | + | |
| 30 | + return Response.status(Status.UNAUTHORIZED) | |
| 31 | + .entity(new ErrorMessage(ex.getMessage(),String.valueOf(Status.UNAUTHORIZED.getStatusCode()))) | |
| 32 | + .type(getAcceptType(headers)) | |
| 33 | + .build(); | |
| 34 | + } | |
| 35 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/EJBTransactionRolledbackExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import javax.ejb.EJBTransactionRolledbackException; | |
| 6 | +import javax.inject.Inject; | |
| 7 | +import javax.ws.rs.core.Context; | |
| 8 | +import javax.ws.rs.core.HttpHeaders; | |
| 9 | +import javax.ws.rs.core.Response; | |
| 10 | +import javax.ws.rs.core.Response.Status; | |
| 11 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 12 | +import javax.ws.rs.ext.Provider; | |
| 13 | + | |
| 14 | +import org.jboss.logging.Logger; | |
| 15 | + | |
| 16 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 17 | +import br.gov.ans.utils.MessageUtils; | |
| 18 | + | |
| 19 | +@Provider | |
| 20 | +public class EJBTransactionRolledbackExceptionHandler implements ExceptionMapper<EJBTransactionRolledbackException>{ | |
| 21 | + | |
| 22 | + @Inject | |
| 23 | + private Logger logger; | |
| 24 | + | |
| 25 | + @Context | |
| 26 | + private HttpHeaders headers; | |
| 27 | + | |
| 28 | + @Inject | |
| 29 | + private MessageUtils messages; | |
| 30 | + | |
| 31 | + public Response toResponse(EJBTransactionRolledbackException ex) { | |
| 32 | + logger.error(ex, ex); | |
| 33 | + | |
| 34 | + return Response.status(Status.INTERNAL_SERVER_ERROR) | |
| 35 | + .entity(new ErrorMessage(messages.getMessage("erro.inesperado"),String.valueOf(Status.INTERNAL_SERVER_ERROR.getStatusCode()))) | |
| 36 | + .type(getAcceptType(headers)) | |
| 37 | + .build(); | |
| 38 | + } | |
| 39 | + | |
| 40 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/ExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import javax.inject.Inject; | |
| 6 | +import javax.ws.rs.core.Context; | |
| 7 | +import javax.ws.rs.core.HttpHeaders; | |
| 8 | +import javax.ws.rs.core.Response; | |
| 9 | +import javax.ws.rs.core.Response.Status; | |
| 10 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 11 | +import javax.ws.rs.ext.Provider; | |
| 12 | + | |
| 13 | +import org.jboss.logging.Logger; | |
| 14 | + | |
| 15 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 16 | + | |
| 17 | +@Provider | |
| 18 | +public class ExceptionHandler implements ExceptionMapper<Exception>{ | |
| 19 | + | |
| 20 | + @Inject | |
| 21 | + private Logger logger; | |
| 22 | + | |
| 23 | + @Context | |
| 24 | + private HttpHeaders headers; | |
| 25 | + | |
| 26 | + public Response toResponse(Exception ex) { | |
| 27 | + logger.error(ex, ex); | |
| 28 | + | |
| 29 | + return Response.status(Status.INTERNAL_SERVER_ERROR) | |
| 30 | + .entity(new ErrorMessage(ex.getMessage(),String.valueOf(Status.INTERNAL_SERVER_ERROR.getStatusCode()))) | |
| 31 | + .type(getAcceptType(headers)) | |
| 32 | + .build(); | |
| 33 | + } | |
| 34 | + | |
| 35 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/ForbiddenExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import javax.inject.Inject; | |
| 6 | +import javax.ws.rs.ForbiddenException; | |
| 7 | +import javax.ws.rs.core.Context; | |
| 8 | +import javax.ws.rs.core.HttpHeaders; | |
| 9 | +import javax.ws.rs.core.Response; | |
| 10 | +import javax.ws.rs.core.Response.Status; | |
| 11 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 12 | +import javax.ws.rs.ext.Provider; | |
| 13 | + | |
| 14 | +import org.jboss.logging.Logger; | |
| 15 | + | |
| 16 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 17 | + | |
| 18 | +@Provider | |
| 19 | +public class ForbiddenExceptionHandler implements ExceptionMapper<ForbiddenException>{ | |
| 20 | + | |
| 21 | + @Inject | |
| 22 | + private Logger logger; | |
| 23 | + | |
| 24 | + @Context | |
| 25 | + private HttpHeaders headers; | |
| 26 | + | |
| 27 | + public Response toResponse(ForbiddenException ex) { | |
| 28 | + logger.error(ex, ex); | |
| 29 | + | |
| 30 | + return Response.status(Status.FORBIDDEN) | |
| 31 | + .entity(new ErrorMessage(ex.getMessage(),String.valueOf(Status.FORBIDDEN.getStatusCode()))) | |
| 32 | + .type(getAcceptType(headers)) | |
| 33 | + .build(); | |
| 34 | + } | |
| 35 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/LoginExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,89 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import java.io.IOException; | |
| 6 | +import java.io.PrintWriter; | |
| 7 | +import java.io.StringWriter; | |
| 8 | + | |
| 9 | +import javax.inject.Inject; | |
| 10 | +import javax.servlet.ServletException; | |
| 11 | +import javax.servlet.annotation.WebServlet; | |
| 12 | +import javax.servlet.http.HttpServlet; | |
| 13 | +import javax.servlet.http.HttpServletRequest; | |
| 14 | +import javax.servlet.http.HttpServletResponse; | |
| 15 | +import javax.ws.rs.core.MediaType; | |
| 16 | +import javax.ws.rs.core.Response.Status; | |
| 17 | +import javax.xml.bind.JAXB; | |
| 18 | + | |
| 19 | +import org.jboss.logging.Logger; | |
| 20 | + | |
| 21 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 22 | + | |
| 23 | +import com.google.gson.Gson; | |
| 24 | + | |
| 25 | +public class LoginExceptionHandler extends HttpServlet{ | |
| 26 | + | |
| 27 | + private static final long serialVersionUID = 1L; | |
| 28 | + | |
| 29 | + @Inject | |
| 30 | + private Logger logger; | |
| 31 | + | |
| 32 | + @Override | |
| 33 | + protected void doPost(HttpServletRequest req, HttpServletResponse resp) | |
| 34 | + throws ServletException, IOException { | |
| 35 | + | |
| 36 | + String acceptType = getAcceptType(req); | |
| 37 | + | |
| 38 | + resp.setContentType(acceptType); | |
| 39 | + resp.setCharacterEncoding("utf-8"); | |
| 40 | + | |
| 41 | + CODE code = CODE.valueOf("_"+req.getParameter("code")); | |
| 42 | + | |
| 43 | + ErrorMessage error = new ErrorMessage(code.message, code.status.getStatusCode()); | |
| 44 | + | |
| 45 | + logger.error(error.getError()); | |
| 46 | + | |
| 47 | + PrintWriter out = resp.getWriter(); | |
| 48 | + | |
| 49 | + if(acceptType.equals(MediaType.APPLICATION_JSON)){ | |
| 50 | + out.write(new Gson().toJson(error)); | |
| 51 | + }else{ | |
| 52 | + StringWriter sw = new StringWriter(); | |
| 53 | + JAXB.marshal(error, sw); | |
| 54 | + | |
| 55 | + out.write(sw.toString()); | |
| 56 | + } | |
| 57 | + } | |
| 58 | + | |
| 59 | + @Override | |
| 60 | + protected void doGet(HttpServletRequest req, HttpServletResponse resp) | |
| 61 | + throws ServletException, IOException { | |
| 62 | + doPost(req, resp); | |
| 63 | + } | |
| 64 | + | |
| 65 | + @Override | |
| 66 | + protected void doPut(HttpServletRequest req, HttpServletResponse resp) | |
| 67 | + throws ServletException, IOException { | |
| 68 | + doPost(req, resp); | |
| 69 | + } | |
| 70 | + | |
| 71 | + @Override | |
| 72 | + protected void doDelete(HttpServletRequest req, HttpServletResponse resp) | |
| 73 | + throws ServletException, IOException { | |
| 74 | + doPost(req, resp); | |
| 75 | + } | |
| 76 | + | |
| 77 | + private enum CODE{ | |
| 78 | + _401(Status.UNAUTHORIZED, "Cliente não autenticado."), | |
| 79 | + _403(Status.FORBIDDEN, "Cliente não autorizado."); | |
| 80 | + | |
| 81 | + Status status; | |
| 82 | + String message; | |
| 83 | + | |
| 84 | + private CODE(Status restStatus, String message) { | |
| 85 | + this.status = restStatus; | |
| 86 | + this.message = message; | |
| 87 | + } | |
| 88 | + } | |
| 89 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/NotAcceptableExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import javax.inject.Inject; | |
| 6 | +import javax.ws.rs.NotAcceptableException; | |
| 7 | +import javax.ws.rs.core.Context; | |
| 8 | +import javax.ws.rs.core.HttpHeaders; | |
| 9 | +import javax.ws.rs.core.Response; | |
| 10 | +import javax.ws.rs.core.Response.Status; | |
| 11 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 12 | +import javax.ws.rs.ext.Provider; | |
| 13 | + | |
| 14 | +import org.jboss.logging.Logger; | |
| 15 | + | |
| 16 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 17 | + | |
| 18 | +@Provider | |
| 19 | +public class NotAcceptableExceptionHandler implements ExceptionMapper<NotAcceptableException>{ | |
| 20 | + | |
| 21 | + @Inject | |
| 22 | + private Logger logger; | |
| 23 | + | |
| 24 | + @Context | |
| 25 | + private HttpHeaders headers; | |
| 26 | + | |
| 27 | + public Response toResponse(NotAcceptableException ex) { | |
| 28 | + logger.error(ex, ex); | |
| 29 | + | |
| 30 | + return Response.status(Status.NOT_ACCEPTABLE) | |
| 31 | + .entity(new ErrorMessage(ex.getMessage(),String.valueOf(Status.NOT_ACCEPTABLE.getStatusCode()))) | |
| 32 | + .type(getAcceptType(headers)) | |
| 33 | + .build(); | |
| 34 | + } | |
| 35 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/NotAllowedExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import javax.inject.Inject; | |
| 6 | +import javax.ws.rs.NotAllowedException; | |
| 7 | +import javax.ws.rs.core.Context; | |
| 8 | +import javax.ws.rs.core.HttpHeaders; | |
| 9 | +import javax.ws.rs.core.Response; | |
| 10 | +import javax.ws.rs.core.Response.Status; | |
| 11 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 12 | +import javax.ws.rs.ext.Provider; | |
| 13 | + | |
| 14 | +import org.jboss.logging.Logger; | |
| 15 | + | |
| 16 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 17 | + | |
| 18 | +@Provider | |
| 19 | +public class NotAllowedExceptionHandler implements ExceptionMapper<NotAllowedException>{ | |
| 20 | + | |
| 21 | + @Inject | |
| 22 | + private Logger logger; | |
| 23 | + | |
| 24 | + @Context | |
| 25 | + private HttpHeaders headers; | |
| 26 | + | |
| 27 | + public Response toResponse(NotAllowedException ex) { | |
| 28 | + logger.error(ex, ex); | |
| 29 | + | |
| 30 | + return Response.status(Status.METHOD_NOT_ALLOWED) | |
| 31 | + .entity(new ErrorMessage(ex.getMessage(),String.valueOf(Status.METHOD_NOT_ALLOWED.getStatusCode()))) | |
| 32 | + .type(getAcceptType(headers)) | |
| 33 | + .build(); | |
| 34 | + } | |
| 35 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/NotAuthorizedExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import javax.inject.Inject; | |
| 6 | +import javax.ws.rs.NotAuthorizedException; | |
| 7 | +import javax.ws.rs.core.Context; | |
| 8 | +import javax.ws.rs.core.HttpHeaders; | |
| 9 | +import javax.ws.rs.core.Response; | |
| 10 | +import javax.ws.rs.core.Response.Status; | |
| 11 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 12 | +import javax.ws.rs.ext.Provider; | |
| 13 | + | |
| 14 | +import org.jboss.logging.Logger; | |
| 15 | + | |
| 16 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 17 | + | |
| 18 | +@Provider | |
| 19 | +public class NotAuthorizedExceptionHandler implements ExceptionMapper<NotAuthorizedException>{ | |
| 20 | + | |
| 21 | + @Inject | |
| 22 | + private Logger logger; | |
| 23 | + | |
| 24 | + @Context | |
| 25 | + private HttpHeaders headers; | |
| 26 | + | |
| 27 | + public Response toResponse(NotAuthorizedException ex) { | |
| 28 | + logger.error(ex, ex); | |
| 29 | + | |
| 30 | + return Response.status(Status.UNAUTHORIZED) | |
| 31 | + .entity(new ErrorMessage(ex.getMessage(),String.valueOf(Status.UNAUTHORIZED.getStatusCode()))) | |
| 32 | + .type(getAcceptType(headers)) | |
| 33 | + .build(); | |
| 34 | + } | |
| 35 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/NotFoundExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import javax.inject.Inject; | |
| 6 | +import javax.ws.rs.NotFoundException; | |
| 7 | +import javax.ws.rs.core.Context; | |
| 8 | +import javax.ws.rs.core.HttpHeaders; | |
| 9 | +import javax.ws.rs.core.Response; | |
| 10 | +import javax.ws.rs.core.Response.Status; | |
| 11 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 12 | +import javax.ws.rs.ext.Provider; | |
| 13 | + | |
| 14 | +import org.jboss.logging.Logger; | |
| 15 | + | |
| 16 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 17 | + | |
| 18 | +@Provider | |
| 19 | +public class NotFoundExceptionHandler implements ExceptionMapper<NotFoundException>{ | |
| 20 | + | |
| 21 | + @Inject | |
| 22 | + private Logger logger; | |
| 23 | + | |
| 24 | + @Context | |
| 25 | + private HttpHeaders headers; | |
| 26 | + | |
| 27 | + public Response toResponse(NotFoundException ex) { | |
| 28 | + logger.error(ex, ex); | |
| 29 | + | |
| 30 | + return Response.status(Status.NOT_FOUND) | |
| 31 | + .entity(new ErrorMessage(ex.getMessage(),String.valueOf(Status.NOT_FOUND.getStatusCode()))) | |
| 32 | + .type(getAcceptType(headers)) | |
| 33 | + .build(); | |
| 34 | + } | |
| 35 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/ResourceConflictExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import javax.inject.Inject; | |
| 6 | +import javax.ws.rs.core.Context; | |
| 7 | +import javax.ws.rs.core.HttpHeaders; | |
| 8 | +import javax.ws.rs.core.Response; | |
| 9 | +import javax.ws.rs.core.Response.Status; | |
| 10 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 11 | +import javax.ws.rs.ext.Provider; | |
| 12 | + | |
| 13 | +import org.jboss.logging.Logger; | |
| 14 | + | |
| 15 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 16 | +import br.gov.ans.exceptions.ResourceConflictException; | |
| 17 | + | |
| 18 | +@Provider | |
| 19 | +public class ResourceConflictExceptionHandler implements ExceptionMapper<ResourceConflictException>{ | |
| 20 | + | |
| 21 | + @Inject | |
| 22 | + private Logger logger; | |
| 23 | + | |
| 24 | + @Context | |
| 25 | + private HttpHeaders headers; | |
| 26 | + | |
| 27 | + public Response toResponse(ResourceConflictException ex) { | |
| 28 | + logger.error(ex, ex); | |
| 29 | + | |
| 30 | + return Response.status(Status.CONFLICT) | |
| 31 | + .entity(new ErrorMessage(ex.getMessage(),String.valueOf(Status.CONFLICT.getStatusCode()))) | |
| 32 | + .type(getAcceptType(headers)) | |
| 33 | + .build(); | |
| 34 | + } | |
| 35 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/ResourceNotFoundExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import javax.inject.Inject; | |
| 6 | +import javax.ws.rs.core.Context; | |
| 7 | +import javax.ws.rs.core.HttpHeaders; | |
| 8 | +import javax.ws.rs.core.Response; | |
| 9 | +import javax.ws.rs.core.Response.Status; | |
| 10 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 11 | +import javax.ws.rs.ext.Provider; | |
| 12 | + | |
| 13 | +import org.jboss.logging.Logger; | |
| 14 | + | |
| 15 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 16 | +import br.gov.ans.exceptions.ResourceNotFoundException; | |
| 17 | + | |
| 18 | +@Provider | |
| 19 | +public class ResourceNotFoundExceptionHandler implements ExceptionMapper<ResourceNotFoundException>{ | |
| 20 | + | |
| 21 | + @Inject | |
| 22 | + private Logger logger; | |
| 23 | + | |
| 24 | + @Context | |
| 25 | + private HttpHeaders headers; | |
| 26 | + | |
| 27 | + public Response toResponse(ResourceNotFoundException ex) { | |
| 28 | + logger.error(ex, ex); | |
| 29 | + | |
| 30 | + return Response.status(Status.NOT_FOUND) | |
| 31 | + .entity(new ErrorMessage(ex.getMessage(),String.valueOf(Status.NOT_FOUND.getStatusCode()))) | |
| 32 | + .type(getAcceptType(headers)) | |
| 33 | + .build(); | |
| 34 | + } | |
| 35 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/WebApplicationExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import javax.inject.Inject; | |
| 6 | +import javax.ws.rs.WebApplicationException; | |
| 7 | +import javax.ws.rs.core.Context; | |
| 8 | +import javax.ws.rs.core.HttpHeaders; | |
| 9 | +import javax.ws.rs.core.Response; | |
| 10 | +import javax.ws.rs.core.Response.Status; | |
| 11 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 12 | +import javax.ws.rs.ext.Provider; | |
| 13 | + | |
| 14 | +import org.jboss.logging.Logger; | |
| 15 | + | |
| 16 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 17 | + | |
| 18 | +@Provider | |
| 19 | +public class WebApplicationExceptionHandler implements ExceptionMapper<WebApplicationException>{ | |
| 20 | + | |
| 21 | + @Inject | |
| 22 | + private Logger logger; | |
| 23 | + | |
| 24 | + @Context | |
| 25 | + private HttpHeaders headers; | |
| 26 | + | |
| 27 | + public Response toResponse(WebApplicationException ex) { | |
| 28 | + logger.error(ex, ex); | |
| 29 | + | |
| 30 | + return Response.status(Status.INTERNAL_SERVER_ERROR) | |
| 31 | + .entity(new ErrorMessage(ex.getMessage(),String.valueOf(Status.INTERNAL_SERVER_ERROR.getStatusCode()))) | |
| 32 | + .type(getAcceptType(headers)) | |
| 33 | + .build(); | |
| 34 | + } | |
| 35 | +} | ... | ... |
src/main/java/br/gov/ans/exceptions/handlers/WrappedExceptionHandler.java
0 → 100644
| ... | ... | @@ -0,0 +1,71 @@ |
| 1 | +package br.gov.ans.exceptions.handlers; | |
| 2 | + | |
| 3 | +import static br.gov.ans.utils.HttpHeadersUtil.getAcceptType; | |
| 4 | + | |
| 5 | +import java.util.Set; | |
| 6 | + | |
| 7 | +import javax.inject.Inject; | |
| 8 | +import javax.validation.ConstraintViolation; | |
| 9 | +import javax.validation.ConstraintViolationException; | |
| 10 | +import javax.ws.rs.core.Context; | |
| 11 | +import javax.ws.rs.core.HttpHeaders; | |
| 12 | +import javax.ws.rs.core.Response; | |
| 13 | +import javax.ws.rs.core.Response.Status; | |
| 14 | +import javax.ws.rs.ext.ExceptionMapper; | |
| 15 | +import javax.ws.rs.ext.Provider; | |
| 16 | + | |
| 17 | +import org.apache.commons.lang3.StringUtils; | |
| 18 | +import org.jboss.logging.Logger; | |
| 19 | + | |
| 20 | +import br.gov.ans.exceptions.BusinessException; | |
| 21 | +import br.gov.ans.exceptions.ErrorMessage; | |
| 22 | +import br.gov.ans.exceptions.WrappedException; | |
| 23 | +import br.gov.ans.utils.MessageUtils; | |
| 24 | + | |
| 25 | +@Provider | |
| 26 | +public class WrappedExceptionHandler implements ExceptionMapper<WrappedException>{ | |
| 27 | + | |
| 28 | + @Inject | |
| 29 | + private Logger logger; | |
| 30 | + | |
| 31 | + @Inject | |
| 32 | + private MessageUtils messages; | |
| 33 | + | |
| 34 | + @Context | |
| 35 | + private HttpHeaders headers; | |
| 36 | + | |
| 37 | + public Response toResponse(WrappedException ex) { | |
| 38 | + logger.error(ex.getEx(), ex.getEx()); | |
| 39 | + | |
| 40 | + Status status = Status.INTERNAL_SERVER_ERROR; | |
| 41 | + String message = messages.getMessage("erro.interno"); | |
| 42 | + | |
| 43 | + if(ex.getEx() instanceof BusinessException){ | |
| 44 | + status = Status.BAD_REQUEST; | |
| 45 | + message = ex.getEx().getMessage(); | |
| 46 | + } | |
| 47 | + | |
| 48 | + if(ex.getEx() instanceof ConstraintViolationException){ | |
| 49 | + status = Status.BAD_REQUEST; | |
| 50 | + message = getViolacoes((ConstraintViolationException) ex.getEx()); | |
| 51 | + } | |
| 52 | + | |
| 53 | + return Response.status(status) | |
| 54 | + .entity(new ErrorMessage(message,String.valueOf(status.getStatusCode()))) | |
| 55 | + .type(getAcceptType(headers)) | |
| 56 | + .build(); | |
| 57 | + } | |
| 58 | + | |
| 59 | + public String getViolacoes(ConstraintViolationException ex){ | |
| 60 | + StringBuilder string = new StringBuilder(messages.getMessage("erro.validar")); | |
| 61 | + Set<ConstraintViolation<?>> violations = ex.getConstraintViolations(); | |
| 62 | + | |
| 63 | + for(ConstraintViolation<?> violation : violations){ | |
| 64 | + string.append(violation.getPropertyPath()+": "); | |
| 65 | + string.append(violation.getMessage()+", "); | |
| 66 | + } | |
| 67 | + | |
| 68 | + return StringUtils.left(string.toString(), (string.length() - 2)); | |
| 69 | + } | |
| 70 | + | |
| 71 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | +package br.gov.ans.factories; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.lang.reflect.ParameterizedType; | |
| 5 | + | |
| 6 | +import javax.enterprise.inject.Produces; | |
| 7 | +import javax.enterprise.inject.spi.InjectionPoint; | |
| 8 | +import javax.persistence.EntityManager; | |
| 9 | +import javax.persistence.PersistenceContext; | |
| 10 | +import javax.persistence.PersistenceContextType; | |
| 11 | + | |
| 12 | +import br.gov.ans.dao.DAO; | |
| 13 | + | |
| 14 | +public class DAOFactory implements Serializable{ | |
| 15 | + | |
| 16 | + private static final long serialVersionUID = 1L; | |
| 17 | + | |
| 18 | + @PersistenceContext(unitName = "templates_broker_pu", type = PersistenceContextType.EXTENDED) | |
| 19 | + private EntityManager em; | |
| 20 | + | |
| 21 | + @SuppressWarnings({ "unchecked", "rawtypes" }) | |
| 22 | + @Produces | |
| 23 | + public <T> DAO<T> createDAO(InjectionPoint injectionPoint) { | |
| 24 | + ParameterizedType type = (ParameterizedType) injectionPoint.getType(); | |
| 25 | + Class classe = (Class) type.getActualTypeArguments()[0]; | |
| 26 | + | |
| 27 | + return new DAO(classe, em); | |
| 28 | + } | |
| 29 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | +package br.gov.ans.factories; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | + | |
| 5 | +import javax.enterprise.inject.Produces; | |
| 6 | +import javax.enterprise.inject.spi.InjectionPoint; | |
| 7 | + | |
| 8 | +import org.jboss.logging.Logger; | |
| 9 | + | |
| 10 | +public class LoggerFactory implements Serializable { | |
| 11 | + | |
| 12 | + private static final long serialVersionUID = 1L; | |
| 13 | + | |
| 14 | + @Produces | |
| 15 | + public Logger produceLogger(InjectionPoint injectionPoint){ | |
| 16 | + return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName()); | |
| 17 | + } | |
| 18 | +} | ... | ... |
src/main/java/br/gov/ans/factories/PropertiesFactory.java
0 → 100644
| ... | ... | @@ -0,0 +1,38 @@ |
| 1 | +package br.gov.ans.factories; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.util.Properties; | |
| 5 | + | |
| 6 | +import javax.enterprise.inject.spi.Annotated; | |
| 7 | +import javax.enterprise.inject.spi.InjectionPoint; | |
| 8 | + | |
| 9 | +import org.apache.commons.lang3.StringUtils; | |
| 10 | + | |
| 11 | +import br.gov.ans.factories.qualifiers.PropertiesInfo; | |
| 12 | + | |
| 13 | + | |
| 14 | +public abstract class PropertiesFactory { | |
| 15 | + | |
| 16 | + protected Properties produceProperties(InjectionPoint injectionPoint) throws IOException{ | |
| 17 | + Annotated annotated = injectionPoint.getAnnotated(); | |
| 18 | + PropertiesInfo info = annotated.getAnnotation(PropertiesInfo.class); | |
| 19 | + | |
| 20 | + return getProperties(info.file()); | |
| 21 | + } | |
| 22 | + | |
| 23 | + protected String produceProperty(InjectionPoint injectionPoint) throws IOException{ | |
| 24 | + Annotated annotated = injectionPoint.getAnnotated(); | |
| 25 | + PropertiesInfo info = annotated.getAnnotation(PropertiesInfo.class); | |
| 26 | + | |
| 27 | + if(StringUtils.isBlank(info.key())){ | |
| 28 | + return null; | |
| 29 | + } | |
| 30 | + | |
| 31 | + Properties props = getProperties(info.file()); | |
| 32 | + | |
| 33 | + return props.getProperty(info.key()); | |
| 34 | + } | |
| 35 | + | |
| 36 | + abstract Properties getProperties(String file) throws IOException; | |
| 37 | + | |
| 38 | +} | |
| 0 | 39 | \ No newline at end of file | ... | ... |
src/main/java/br/gov/ans/factories/PropertiesFactoryLocal.java
0 → 100644
| ... | ... | @@ -0,0 +1,48 @@ |
| 1 | +package br.gov.ans.factories; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.Serializable; | |
| 5 | +import java.util.Properties; | |
| 6 | + | |
| 7 | +import javax.enterprise.context.ApplicationScoped; | |
| 8 | +import javax.enterprise.inject.Default; | |
| 9 | +import javax.enterprise.inject.Produces; | |
| 10 | +import javax.enterprise.inject.spi.InjectionPoint; | |
| 11 | + | |
| 12 | +import br.gov.ans.factories.qualifiers.Local; | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * Obtém propriedades locais. | |
| 18 | + * | |
| 19 | + */ | |
| 20 | +@ApplicationScoped | |
| 21 | +public class PropertiesFactoryLocal extends PropertiesFactory implements Serializable { | |
| 22 | + | |
| 23 | + private static final long serialVersionUID = 1L; | |
| 24 | + | |
| 25 | + @Produces | |
| 26 | + @Local @Default | |
| 27 | + @Override | |
| 28 | + public Properties produceProperties(InjectionPoint injectionPoint) throws IOException{ | |
| 29 | + return super.produceProperties(injectionPoint); | |
| 30 | + } | |
| 31 | + | |
| 32 | + @Produces | |
| 33 | + @Local @Default | |
| 34 | + @Override | |
| 35 | + public String produceProperty(InjectionPoint injectionPoint) throws IOException{ | |
| 36 | + return super.produceProperty(injectionPoint); | |
| 37 | + } | |
| 38 | + | |
| 39 | + @Override | |
| 40 | + protected Properties getProperties(String file) throws IOException{ | |
| 41 | + Properties props = new Properties(); | |
| 42 | + | |
| 43 | + props.load(PropertiesFactoryLocal.class.getClassLoader().getResourceAsStream(file)); | |
| 44 | + | |
| 45 | + return props; | |
| 46 | + } | |
| 47 | + | |
| 48 | +} | |
| 0 | 49 | \ No newline at end of file | ... | ... |
src/main/java/br/gov/ans/factories/PropertiesFactoryServer.java
0 → 100644
| ... | ... | @@ -0,0 +1,50 @@ |
| 1 | +package br.gov.ans.factories; | |
| 2 | + | |
| 3 | +import java.io.FileInputStream; | |
| 4 | +import java.io.IOException; | |
| 5 | +import java.io.Serializable; | |
| 6 | +import java.util.Properties; | |
| 7 | + | |
| 8 | +import javax.enterprise.context.ApplicationScoped; | |
| 9 | +import javax.enterprise.inject.Produces; | |
| 10 | +import javax.enterprise.inject.spi.InjectionPoint; | |
| 11 | + | |
| 12 | +import br.gov.ans.factories.qualifiers.Server; | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * Obtém propriedades externas do jboss. | |
| 18 | + * | |
| 19 | + */ | |
| 20 | + | |
| 21 | +@ApplicationScoped | |
| 22 | +public class PropertiesFactoryServer extends PropertiesFactory implements Serializable { | |
| 23 | + | |
| 24 | + private static final long serialVersionUID = 1L; | |
| 25 | + | |
| 26 | + private static final String SERVER_PATH = System.getProperty("jboss.home.dir") + "/ans/properties/"; | |
| 27 | + | |
| 28 | + @Produces | |
| 29 | + @Server | |
| 30 | + public Properties produceProperties(InjectionPoint injectionPoint) throws IOException{ | |
| 31 | + return super.produceProperties(injectionPoint); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Produces | |
| 35 | + @Server | |
| 36 | + public String produceProperty(InjectionPoint injectionPoint) throws IOException{ | |
| 37 | + return super.produceProperty(injectionPoint); | |
| 38 | + } | |
| 39 | + | |
| 40 | + @Override | |
| 41 | + protected Properties getProperties(String file) throws IOException{ | |
| 42 | + Properties props = new Properties(); | |
| 43 | + | |
| 44 | + FileInputStream f = new FileInputStream(SERVER_PATH + file); | |
| 45 | + props.load(f); | |
| 46 | + | |
| 47 | + return props; | |
| 48 | + } | |
| 49 | + | |
| 50 | +} | |
| 0 | 51 | \ No newline at end of file | ... | ... |
src/main/java/br/gov/ans/factories/qualifiers/Local.java
0 → 100644
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +package br.gov.ans.factories.qualifiers; | |
| 2 | + | |
| 3 | +import java.lang.annotation.ElementType; | |
| 4 | +import java.lang.annotation.Retention; | |
| 5 | +import java.lang.annotation.RetentionPolicy; | |
| 6 | +import java.lang.annotation.Target; | |
| 7 | + | |
| 8 | +import javax.inject.Qualifier; | |
| 9 | + | |
| 10 | +@Qualifier | |
| 11 | +@Retention(RetentionPolicy.RUNTIME) | |
| 12 | +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE}) | |
| 13 | +public @interface Local { | |
| 14 | + | |
| 15 | +} | ... | ... |
src/main/java/br/gov/ans/factories/qualifiers/PropertiesInfo.java
0 → 100644
| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | +package br.gov.ans.factories.qualifiers; | |
| 2 | + | |
| 3 | +import java.lang.annotation.Retention; | |
| 4 | +import java.lang.annotation.RetentionPolicy; | |
| 5 | +import java.lang.annotation.Target; | |
| 6 | +import java.lang.annotation.ElementType; | |
| 7 | + | |
| 8 | +@Retention(RetentionPolicy.RUNTIME) | |
| 9 | +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE}) | |
| 10 | +public @interface PropertiesInfo { | |
| 11 | + String file(); | |
| 12 | + String key() default ""; | |
| 13 | +} | ... | ... |
src/main/java/br/gov/ans/factories/qualifiers/Server.java
0 → 100644
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +package br.gov.ans.factories.qualifiers; | |
| 2 | + | |
| 3 | +import java.lang.annotation.ElementType; | |
| 4 | +import java.lang.annotation.Retention; | |
| 5 | +import java.lang.annotation.RetentionPolicy; | |
| 6 | +import java.lang.annotation.Target; | |
| 7 | + | |
| 8 | +import javax.inject.Qualifier; | |
| 9 | + | |
| 10 | +@Qualifier | |
| 11 | +@Retention(RetentionPolicy.RUNTIME) | |
| 12 | +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE}) | |
| 13 | +public @interface Server { | |
| 14 | + | |
| 15 | +} | ... | ... |
src/main/java/br/gov/ans/filters/SessionInvalidateFilter.java
0 → 100644
| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | +package br.gov.ans.filters; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | + | |
| 5 | +import javax.inject.Inject; | |
| 6 | +import javax.servlet.http.HttpServletRequest; | |
| 7 | +import javax.ws.rs.container.ContainerRequestContext; | |
| 8 | +import javax.ws.rs.container.ContainerResponseContext; | |
| 9 | +import javax.ws.rs.container.ContainerResponseFilter; | |
| 10 | +import javax.ws.rs.core.Context; | |
| 11 | +import javax.ws.rs.ext.Provider; | |
| 12 | + | |
| 13 | +import org.jboss.logging.Logger; | |
| 14 | + | |
| 15 | +@Provider | |
| 16 | +public class SessionInvalidateFilter implements ContainerResponseFilter{ | |
| 17 | + | |
| 18 | + @Context | |
| 19 | + private HttpServletRequest request; | |
| 20 | + | |
| 21 | + @Inject | |
| 22 | + private Logger logger; | |
| 23 | + | |
| 24 | + @Override | |
| 25 | + public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) | |
| 26 | + throws IOException { | |
| 27 | + try{ | |
| 28 | + request.getSession().invalidate(); | |
| 29 | + }catch(Exception ex){ | |
| 30 | + logger.error(ex); | |
| 31 | + } | |
| 32 | + } | |
| 33 | + | |
| 34 | +} | ... | ... |
src/main/java/br/gov/ans/templates/dao/ColaboradorDAO.java
0 → 100644
| ... | ... | @@ -0,0 +1,80 @@ |
| 1 | +package br.gov.ans.templates.dao; | |
| 2 | + | |
| 3 | +import static br.gov.ans.templates.util.DAOUtils.setPaginacaoQuery; | |
| 4 | +import static br.gov.ans.templates.util.DAOUtils.setParametrosQuery; | |
| 5 | + | |
| 6 | +import java.util.HashMap; | |
| 7 | +import java.util.List; | |
| 8 | + | |
| 9 | +import javax.inject.Inject; | |
| 10 | +import javax.persistence.EntityManager; | |
| 11 | +import javax.persistence.PersistenceContext; | |
| 12 | +import javax.persistence.PersistenceContextType; | |
| 13 | +import javax.persistence.Query; | |
| 14 | + | |
| 15 | +import br.gov.ans.dao.DAO; | |
| 16 | +import br.gov.ans.exceptions.ResourceNotFoundException; | |
| 17 | +import br.gov.ans.templates.modelo.Colaborador; | |
| 18 | +import br.gov.ans.utils.MessageUtils; | |
| 19 | + | |
| 20 | +public class ColaboradorDAO { | |
| 21 | + | |
| 22 | + @PersistenceContext(unitName = "templates_broker_pu", type = PersistenceContextType.EXTENDED) | |
| 23 | + private EntityManager em; | |
| 24 | + | |
| 25 | + @Inject | |
| 26 | + private DAO<Colaborador> dao; | |
| 27 | + | |
| 28 | + @Inject | |
| 29 | + private MessageUtils messages; | |
| 30 | + | |
| 31 | + public Colaborador getColaborador(Long idTemplate, String usuario) throws ResourceNotFoundException{ | |
| 32 | + HashMap<String, Object> params = new HashMap<String, Object>(); | |
| 33 | + | |
| 34 | + params.put("template", idTemplate); | |
| 35 | + params.put("usuario", usuario); | |
| 36 | + | |
| 37 | + List<Colaborador> resultado = dao.executeNamedQuery("Colaborador.recuperarColaborador", params); | |
| 38 | + | |
| 39 | + if(resultado.size() < 1){ | |
| 40 | + throw new ResourceNotFoundException(messages.getMessage("erro.colaborador.nao.encontrado", usuario)); | |
| 41 | + } | |
| 42 | + | |
| 43 | + return resultado.get(0); | |
| 44 | + } | |
| 45 | + | |
| 46 | + @SuppressWarnings("unchecked") | |
| 47 | + public List<Colaborador> getColaboradores(Long idTemplate, Integer pagina, Integer qtdRegistros){ | |
| 48 | + HashMap<String, Object> params = new HashMap<String, Object>(); | |
| 49 | + | |
| 50 | + params.put("template", idTemplate); | |
| 51 | + | |
| 52 | + Query query = em.createNamedQuery("Colaborador.recuperarColaboradores"); | |
| 53 | + | |
| 54 | + setParametrosQuery(query, params); | |
| 55 | + | |
| 56 | + setPaginacaoQuery(query, pagina, qtdRegistros); | |
| 57 | + | |
| 58 | + return query.getResultList(); | |
| 59 | + } | |
| 60 | + | |
| 61 | + public Long countColaboradores(Long idTemplate){ | |
| 62 | + HashMap<String, Object> params = new HashMap<String, Object>(); | |
| 63 | + | |
| 64 | + params.put("template", idTemplate); | |
| 65 | + | |
| 66 | + Query query = em.createNamedQuery("Colaborador.countColaboradores"); | |
| 67 | + | |
| 68 | + setParametrosQuery(query, params); | |
| 69 | + | |
| 70 | + return (Long) query.getSingleResult(); | |
| 71 | + } | |
| 72 | + | |
| 73 | + public void persist(Colaborador colaborador){ | |
| 74 | + dao.persist(colaborador); | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void merge(Colaborador colaborador){ | |
| 78 | + dao.merge(colaborador); | |
| 79 | + } | |
| 80 | +} | ... | ... |
src/main/java/br/gov/ans/templates/dao/TemplatesDAO.java
0 → 100644
| ... | ... | @@ -0,0 +1,97 @@ |
| 1 | +package br.gov.ans.templates.dao; | |
| 2 | + | |
| 3 | +import static br.gov.ans.templates.util.DAOUtils.setPaginacaoQuery; | |
| 4 | +import static br.gov.ans.templates.util.DAOUtils.setParametrosQuery; | |
| 5 | + | |
| 6 | +import java.util.HashMap; | |
| 7 | +import java.util.List; | |
| 8 | + | |
| 9 | +import javax.inject.Inject; | |
| 10 | +import javax.persistence.EntityManager; | |
| 11 | +import javax.persistence.PersistenceContext; | |
| 12 | +import javax.persistence.PersistenceContextType; | |
| 13 | +import javax.persistence.Query; | |
| 14 | + | |
| 15 | +import org.apache.commons.lang3.StringUtils; | |
| 16 | + | |
| 17 | +import br.gov.ans.dao.DAO; | |
| 18 | +import br.gov.ans.templates.modelo.Template;; | |
| 19 | + | |
| 20 | +public class TemplatesDAO { | |
| 21 | + | |
| 22 | + @PersistenceContext(unitName = "templates_broker_pu", type = PersistenceContextType.EXTENDED) | |
| 23 | + private EntityManager em; | |
| 24 | + | |
| 25 | + @Inject | |
| 26 | + private DAO<Template> dao; | |
| 27 | + | |
| 28 | + @SuppressWarnings("unchecked") | |
| 29 | + public List<Template> getTemplates(String filtro, Integer pagina, Integer qtdRegistros){ | |
| 30 | + HashMap<String, Object> parametros = new HashMap<String, Object>(); | |
| 31 | + StringBuilder sql = new StringBuilder("SELECT t FROM Template t "); | |
| 32 | + | |
| 33 | + if(StringUtils.isNotBlank(filtro)){ | |
| 34 | + sql.append("WHERE upper(t.nome) LIKE upper(:filtro) "); | |
| 35 | + parametros.put("filtro", "%"+filtro+"%"); | |
| 36 | + } | |
| 37 | + | |
| 38 | + sql.append(AndOrWhere(sql) + " t.dataExclusao is null "); | |
| 39 | + | |
| 40 | + sql.append("order by nome asc "); | |
| 41 | + | |
| 42 | + Query query = em.createQuery(sql.toString()); | |
| 43 | + | |
| 44 | + setParametrosQuery(query, parametros); | |
| 45 | + | |
| 46 | + setPaginacaoQuery(query, pagina, qtdRegistros); | |
| 47 | + | |
| 48 | + return query.getResultList(); | |
| 49 | + } | |
| 50 | + | |
| 51 | + public Long countTemplates(String filtro){ | |
| 52 | + HashMap<String, Object> parametros = new HashMap<String, Object>(); | |
| 53 | + StringBuilder sql = new StringBuilder("SELECT count(t) FROM Template t "); | |
| 54 | + | |
| 55 | + if(StringUtils.isNotBlank(filtro)){ | |
| 56 | + sql.append("WHERE upper(t.nome) LIKE upper(:filtro) "); | |
| 57 | + parametros.put("filtro", "%"+filtro+"%"); | |
| 58 | + } | |
| 59 | + | |
| 60 | + sql.append(AndOrWhere(sql) + " t.dataExclusao is null "); | |
| 61 | + | |
| 62 | + Query query = em.createQuery(sql.toString()); | |
| 63 | + | |
| 64 | + setParametrosQuery(query, parametros); | |
| 65 | + | |
| 66 | + return (Long) query.getSingleResult(); | |
| 67 | + } | |
| 68 | + | |
| 69 | + public Template getTemplate(String nome){ | |
| 70 | + HashMap<String, Object> params = new HashMap<String, Object>(); | |
| 71 | + params.put("nome", nome); | |
| 72 | + | |
| 73 | + List<Template> resultado = dao.executeNamedQuery("Template.recuperarPeloNome", params); | |
| 74 | + | |
| 75 | + if(resultado.size() < 1){ | |
| 76 | + return null; | |
| 77 | + } | |
| 78 | + | |
| 79 | + return resultado.get(0); | |
| 80 | + } | |
| 81 | + | |
| 82 | + public String AndOrWhere(StringBuilder sql){ | |
| 83 | + if(sql.toString().contains("WHERE")){ | |
| 84 | + return "AND"; | |
| 85 | + } | |
| 86 | + | |
| 87 | + return "WHERE"; | |
| 88 | + } | |
| 89 | + | |
| 90 | + public void persist(Template template){ | |
| 91 | + dao.persist(template); | |
| 92 | + } | |
| 93 | + | |
| 94 | + public void merge(Template template) { | |
| 95 | + dao.merge(template); | |
| 96 | + } | |
| 97 | +} | ... | ... |
src/main/java/br/gov/ans/templates/modelo/Colaborador.java
0 → 100644
| ... | ... | @@ -0,0 +1,97 @@ |
| 1 | +package br.gov.ans.templates.modelo; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.Date; | |
| 5 | + | |
| 6 | +import javax.persistence.Column; | |
| 7 | +import javax.persistence.Entity; | |
| 8 | +import javax.persistence.Id; | |
| 9 | +import javax.persistence.IdClass; | |
| 10 | +import javax.persistence.NamedQueries; | |
| 11 | +import javax.persistence.NamedQuery; | |
| 12 | +import javax.persistence.Table; | |
| 13 | +import javax.persistence.Temporal; | |
| 14 | +import javax.persistence.TemporalType; | |
| 15 | +import javax.validation.constraints.NotNull; | |
| 16 | +import javax.validation.constraints.Size; | |
| 17 | +import javax.xml.bind.annotation.XmlRootElement; | |
| 18 | +import javax.xml.bind.annotation.XmlTransient; | |
| 19 | + | |
| 20 | +import org.codehaus.jackson.annotate.JsonIgnore; | |
| 21 | +import org.hibernate.annotations.Type; | |
| 22 | + | |
| 23 | +@XmlRootElement | |
| 24 | +@Entity | |
| 25 | +@IdClass(ColaboradorId.class) | |
| 26 | +@Table(schema = "ANS_GERAL", name = "RL_USUARIO_TEMPLATE_DOCUMENTO") | |
| 27 | +@NamedQueries({ | |
| 28 | + @NamedQuery(name = "Colaborador.recuperarColaborador", query = "SELECT c FROM Colaborador c WHERE c.idTemplate = :template AND upper(c.usuario) = upper(:usuario) " | |
| 29 | + + "AND c.dataExclusao is null"), | |
| 30 | + @NamedQuery(name = "Colaborador.recuperarColaboradores", query = "SELECT c FROM Colaborador c WHERE c.idTemplate = :template AND c.dataExclusao is null ORDER BY c.usuario ASC"), | |
| 31 | + @NamedQuery(name = "Colaborador.countColaboradores", query = "SELECT count(c) FROM Colaborador c WHERE c.idTemplate = :template AND c.dataExclusao is null") }) | |
| 32 | +public class Colaborador implements Serializable { | |
| 33 | + | |
| 34 | + private static final long serialVersionUID = 1L; | |
| 35 | + | |
| 36 | + @XmlTransient | |
| 37 | + @JsonIgnore | |
| 38 | + @Id | |
| 39 | + @NotNull | |
| 40 | + @Column(name = "ID_TEMPLATE_DOCUMENTO") | |
| 41 | + private Long idTemplate; | |
| 42 | + | |
| 43 | + @Id | |
| 44 | + @NotNull | |
| 45 | + @Size(max = 30) | |
| 46 | + @Column(name = "DE_LOGIN_USUARIO") | |
| 47 | + private String usuario; | |
| 48 | + | |
| 49 | + @NotNull | |
| 50 | + @Column(name = "LG_USUARIO_EDITOR_TEMPLATE") | |
| 51 | + @Type(type = "org.hibernate.type.NumericBooleanType") | |
| 52 | + private boolean editor; | |
| 53 | + | |
| 54 | + @Temporal(TemporalType.TIMESTAMP) | |
| 55 | + @Column(name = "DT_EXCLUSAO_USUARIO_TEMPLATE") | |
| 56 | + private Date dataExclusao; | |
| 57 | + | |
| 58 | + @XmlTransient | |
| 59 | + @JsonIgnore | |
| 60 | + public Long getIdTemplate() { | |
| 61 | + return idTemplate; | |
| 62 | + } | |
| 63 | + | |
| 64 | + @JsonIgnore | |
| 65 | + public void setIdTemplate(Long idTemplate) { | |
| 66 | + this.idTemplate = idTemplate; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public String getUsuario() { | |
| 70 | + return usuario; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public void setUsuario(String usuario) { | |
| 74 | + this.usuario = usuario; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public boolean getEditor() { | |
| 78 | + return editor; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public void setEditor(boolean editor) { | |
| 82 | + this.editor = editor; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public Date getDataExclusao() { | |
| 86 | + return dataExclusao; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public void setDataExclusao(Date data) { | |
| 90 | + this.dataExclusao = data; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public static long getSerialversionuid() { | |
| 94 | + return serialVersionUID; | |
| 95 | + } | |
| 96 | + | |
| 97 | +} | ... | ... |
src/main/java/br/gov/ans/templates/modelo/ColaboradorId.java
0 → 100644
| ... | ... | @@ -0,0 +1,58 @@ |
| 1 | +package br.gov.ans.templates.modelo; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | + | |
| 5 | +public class ColaboradorId implements Serializable{ | |
| 6 | + | |
| 7 | + private static final long serialVersionUID = 1L; | |
| 8 | + | |
| 9 | + private Long idTemplate; | |
| 10 | + private String usuario; | |
| 11 | + | |
| 12 | + public Long getIdTemplate() { | |
| 13 | + return idTemplate; | |
| 14 | + } | |
| 15 | + | |
| 16 | + public void setIdTemplate(Long idTemplate) { | |
| 17 | + this.idTemplate = idTemplate; | |
| 18 | + } | |
| 19 | + | |
| 20 | + public String getUsuario() { | |
| 21 | + return usuario; | |
| 22 | + } | |
| 23 | + | |
| 24 | + public void setUsuario(String usuario) { | |
| 25 | + this.usuario = usuario; | |
| 26 | + } | |
| 27 | + | |
| 28 | + @Override | |
| 29 | + public int hashCode() { | |
| 30 | + final int prime = 31; | |
| 31 | + int result = 1; | |
| 32 | + result = prime * result + ((idTemplate == null) ? 0 : idTemplate.hashCode()); | |
| 33 | + result = prime * result + ((usuario == null) ? 0 : usuario.hashCode()); | |
| 34 | + return result; | |
| 35 | + } | |
| 36 | + | |
| 37 | + @Override | |
| 38 | + public boolean equals(Object obj) { | |
| 39 | + if (this == obj) | |
| 40 | + return true; | |
| 41 | + if (obj == null) | |
| 42 | + return false; | |
| 43 | + if (getClass() != obj.getClass()) | |
| 44 | + return false; | |
| 45 | + ColaboradorId other = (ColaboradorId) obj; | |
| 46 | + if (idTemplate == null) { | |
| 47 | + if (other.idTemplate != null) | |
| 48 | + return false; | |
| 49 | + } else if (!idTemplate.equals(other.idTemplate)) | |
| 50 | + return false; | |
| 51 | + if (usuario == null) { | |
| 52 | + if (other.usuario != null) | |
| 53 | + return false; | |
| 54 | + } else if (!usuario.equals(other.usuario)) | |
| 55 | + return false; | |
| 56 | + return true; | |
| 57 | + } | |
| 58 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,178 @@ |
| 1 | +package br.gov.ans.templates.modelo; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.Date; | |
| 5 | + | |
| 6 | +import javax.persistence.Basic; | |
| 7 | +import javax.persistence.Column; | |
| 8 | +import javax.persistence.Entity; | |
| 9 | +import javax.persistence.FetchType; | |
| 10 | +import javax.persistence.GeneratedValue; | |
| 11 | +import javax.persistence.GenerationType; | |
| 12 | +import javax.persistence.Id; | |
| 13 | +import javax.persistence.Lob; | |
| 14 | +import javax.persistence.NamedQueries; | |
| 15 | +import javax.persistence.NamedQuery; | |
| 16 | +import javax.persistence.Table; | |
| 17 | +import javax.persistence.Temporal; | |
| 18 | +import javax.persistence.TemporalType; | |
| 19 | +import javax.validation.constraints.NotNull; | |
| 20 | +import javax.validation.constraints.Size; | |
| 21 | +import javax.xml.bind.annotation.XmlElement; | |
| 22 | +import javax.xml.bind.annotation.XmlRootElement; | |
| 23 | +import javax.xml.bind.annotation.XmlTransient; | |
| 24 | + | |
| 25 | +import org.codehaus.jackson.annotate.JsonIgnore; | |
| 26 | +import org.codehaus.jackson.annotate.JsonProperty; | |
| 27 | +import org.hibernate.annotations.Type; | |
| 28 | + | |
| 29 | +@XmlRootElement | |
| 30 | +@Entity | |
| 31 | +@Table(schema="ANS_GERAL",name="TB_TEMPLATE_DOCUMENTO") | |
| 32 | +@NamedQueries({@NamedQuery(name = "Template.recuperarPeloNome", query = "SELECT t FROM Template t WHERE upper(t.nome) = upper(:nome) AND t.dataExclusao is null")}) | |
| 33 | +public class Template implements Serializable{ | |
| 34 | + | |
| 35 | + private static final long serialVersionUID = 1L; | |
| 36 | + | |
| 37 | + @XmlTransient | |
| 38 | + @JsonIgnore | |
| 39 | + @Id | |
| 40 | + @Column(name="ID_TEMPLATE_DOCUMENTO") | |
| 41 | + @GeneratedValue(strategy=GenerationType.IDENTITY) | |
| 42 | + private Long id; | |
| 43 | + | |
| 44 | + @NotNull | |
| 45 | + @Size(max=60) | |
| 46 | + @Column(name="NM_TEMPLATE_DOCUMENTO", unique=true) | |
| 47 | + private String nome; | |
| 48 | + | |
| 49 | + @NotNull | |
| 50 | + @Size(max=200) | |
| 51 | + @Column(name="DE_TEMPLATE_DOCUMENTO") | |
| 52 | + private String descricao; | |
| 53 | + | |
| 54 | + @NotNull | |
| 55 | + @Column(name="LG_TEMPLATE_DOCUMENTO_RESTRITO") | |
| 56 | + @Type(type = "org.hibernate.type.NumericBooleanType") | |
| 57 | + private Boolean restrito; | |
| 58 | + | |
| 59 | + @NotNull | |
| 60 | + @Lob @Basic(fetch = FetchType.LAZY) | |
| 61 | + @Column(name="TX_EXEMPLO_TEMPLATE_DOCUMENTO") | |
| 62 | + private String exemplo; | |
| 63 | + | |
| 64 | + @XmlTransient | |
| 65 | + @NotNull | |
| 66 | + @Lob | |
| 67 | + @Basic(fetch = FetchType.LAZY) | |
| 68 | + @Type(type = "org.hibernate.type.BinaryType") | |
| 69 | + @Column(name="OB_CORPO_TEMPLATE_DOCUMENTO") | |
| 70 | + private byte[] corpo; | |
| 71 | + | |
| 72 | + @JsonProperty("corpo") | |
| 73 | + @XmlElement(name = "corpo") | |
| 74 | + public String getCorpoString() { | |
| 75 | + return new String(corpo); | |
| 76 | + } | |
| 77 | + | |
| 78 | + @NotNull | |
| 79 | + @Size(max=30) | |
| 80 | + @Column(name="DE_LOGIN_USUARIO_RPSV_TMPL") | |
| 81 | + private String responsavel; | |
| 82 | + | |
| 83 | + @NotNull | |
| 84 | + @Temporal(TemporalType.TIMESTAMP) | |
| 85 | + @Column(name="DT_CADASTRO_TEMPLATE") | |
| 86 | + private Date dataCadastro; | |
| 87 | + | |
| 88 | + @Temporal(TemporalType.TIMESTAMP) | |
| 89 | + @Column(name="DT_EXCLUSAO_TEMPLATE") | |
| 90 | + private Date dataExclusao; | |
| 91 | + | |
| 92 | + | |
| 93 | + public Template(){ | |
| 94 | + } | |
| 95 | + | |
| 96 | + public Template(br.gov.ans.templates.to.Template template){ | |
| 97 | + setNome(template.getNome()); | |
| 98 | + setDescricao(template.getDescricao()); | |
| 99 | + setResponsavel(template.getResponsavel()); | |
| 100 | + setRestrito(template.getRestrito()); | |
| 101 | + setCorpo(template.getCorpo() == null? null : template.getCorpo().getBytes()); | |
| 102 | + setExemplo(template.getExemplo()); | |
| 103 | + | |
| 104 | + setDataCadastro(new Date()); | |
| 105 | + } | |
| 106 | + | |
| 107 | + @XmlTransient | |
| 108 | + public Long getId() { | |
| 109 | + return id; | |
| 110 | + } | |
| 111 | + | |
| 112 | + public void setId(Long id) { | |
| 113 | + this.id = id; | |
| 114 | + } | |
| 115 | + | |
| 116 | + public String getNome() { | |
| 117 | + return nome; | |
| 118 | + } | |
| 119 | + | |
| 120 | + public void setNome(String nome) { | |
| 121 | + this.nome = nome; | |
| 122 | + } | |
| 123 | + | |
| 124 | + public String getDescricao() { | |
| 125 | + return descricao; | |
| 126 | + } | |
| 127 | + | |
| 128 | + public void setDescricao(String descricao) { | |
| 129 | + this.descricao = descricao; | |
| 130 | + } | |
| 131 | + public Boolean getRestrito() { | |
| 132 | + return restrito; | |
| 133 | + } | |
| 134 | + public void setRestrito(Boolean restrito) { | |
| 135 | + this.restrito = restrito; | |
| 136 | + } | |
| 137 | + | |
| 138 | + public String getExemplo() { | |
| 139 | + return exemplo; | |
| 140 | + } | |
| 141 | + | |
| 142 | + public void setExemplo(String exemplo) { | |
| 143 | + this.exemplo = exemplo; | |
| 144 | + } | |
| 145 | + | |
| 146 | + @XmlTransient | |
| 147 | + public byte[] getCorpo() { | |
| 148 | + return corpo; | |
| 149 | + } | |
| 150 | + | |
| 151 | + public void setCorpo(byte[] corpo) { | |
| 152 | + this.corpo = corpo; | |
| 153 | + } | |
| 154 | + | |
| 155 | + public String getResponsavel() { | |
| 156 | + return responsavel; | |
| 157 | + } | |
| 158 | + | |
| 159 | + public void setResponsavel(String responsavel) { | |
| 160 | + this.responsavel = responsavel; | |
| 161 | + } | |
| 162 | + | |
| 163 | + public Date getDataCadastro() { | |
| 164 | + return dataCadastro; | |
| 165 | + } | |
| 166 | + | |
| 167 | + public void setDataCadastro(Date data) { | |
| 168 | + this.dataCadastro = data; | |
| 169 | + } | |
| 170 | + | |
| 171 | + public Date getDataExclusao() { | |
| 172 | + return dataExclusao; | |
| 173 | + } | |
| 174 | + | |
| 175 | + public void setDataExclusao(Date dataExclusao) { | |
| 176 | + this.dataExclusao = dataExclusao; | |
| 177 | + } | |
| 178 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,132 @@ |
| 1 | +package br.gov.ans.templates.modelo; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.Date; | |
| 5 | + | |
| 6 | +import javax.persistence.Basic; | |
| 7 | +import javax.persistence.Column; | |
| 8 | +import javax.persistence.Entity; | |
| 9 | +import javax.persistence.FetchType; | |
| 10 | +import javax.persistence.Id; | |
| 11 | +import javax.persistence.IdClass; | |
| 12 | +import javax.persistence.Lob; | |
| 13 | +import javax.persistence.NamedQueries; | |
| 14 | +import javax.persistence.NamedQuery; | |
| 15 | +import javax.persistence.Table; | |
| 16 | +import javax.persistence.Temporal; | |
| 17 | +import javax.persistence.TemporalType; | |
| 18 | +import javax.validation.constraints.NotNull; | |
| 19 | +import javax.validation.constraints.Size; | |
| 20 | +import javax.xml.bind.annotation.XmlRootElement; | |
| 21 | +import javax.xml.bind.annotation.XmlTransient; | |
| 22 | + | |
| 23 | +import org.codehaus.jackson.annotate.JsonIgnore; | |
| 24 | +import org.hibernate.annotations.Type; | |
| 25 | + | |
| 26 | +@XmlRootElement | |
| 27 | +@Entity | |
| 28 | +@IdClass(VersaoId.class) | |
| 29 | +@Table(schema="ANS_GERAL",name="TB_VERSAO_TEMPLATE_DOCUMENTO") | |
| 30 | +@NamedQueries({ | |
| 31 | + @NamedQuery(name = "Versao.recuperarVersoes", query = "SELECT v FROM Versao v WHERE v.idTemplate = :template ORDER BY v.data DESC")}) | |
| 32 | +public class Versao implements Serializable{ | |
| 33 | + | |
| 34 | + private static final long serialVersionUID = 1L; | |
| 35 | + | |
| 36 | + @JsonIgnore | |
| 37 | + @XmlTransient | |
| 38 | + @Id | |
| 39 | + @NotNull | |
| 40 | + @Column(name="ID_TEMPLATE_DOCUMENTO") | |
| 41 | + private Long idTemplate; | |
| 42 | + | |
| 43 | + @Id | |
| 44 | + @NotNull | |
| 45 | + @Size(max=30) | |
| 46 | + @Column(name="DE_LOGIN_USUARIO") | |
| 47 | + private String responsavel; | |
| 48 | + | |
| 49 | + @Id | |
| 50 | + @NotNull | |
| 51 | + @Temporal(TemporalType.TIMESTAMP) | |
| 52 | + @Column(name="DT_VERSAO_TEMPLATE") | |
| 53 | + private Date data; | |
| 54 | + | |
| 55 | + @NotNull | |
| 56 | + @Size(max=200) | |
| 57 | + @Column(name="DE_TEMPLATE_DOCUMENTO") | |
| 58 | + private String descricao; | |
| 59 | + | |
| 60 | + @NotNull | |
| 61 | + @Lob @Basic(fetch = FetchType.LAZY) | |
| 62 | + @Column(name="TX_EXEMPLO_TEMPLATE_DOCUMENTO") | |
| 63 | + private String exemplo; | |
| 64 | + | |
| 65 | + @Lob | |
| 66 | + @Basic(fetch = FetchType.LAZY) | |
| 67 | + @Type(type = "org.hibernate.type.BinaryType") | |
| 68 | + @Column(name="OB_CORPO_TEMPLATE_DOCUMENTO") | |
| 69 | + private byte[] corpo; | |
| 70 | + | |
| 71 | + public Versao(){ | |
| 72 | + } | |
| 73 | + | |
| 74 | + public Versao(Template template){ | |
| 75 | + this.idTemplate = template.getId(); | |
| 76 | + this.responsavel = template.getResponsavel(); | |
| 77 | + this.data = template.getDataCadastro(); | |
| 78 | + this.descricao = template.getDescricao(); | |
| 79 | + this.corpo = template.getCorpo(); | |
| 80 | + this.exemplo = template.getExemplo(); | |
| 81 | + } | |
| 82 | + | |
| 83 | + @JsonIgnore | |
| 84 | + @XmlTransient | |
| 85 | + public Long getIdTemplate() { | |
| 86 | + return idTemplate; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public void setIdTemplate(Long idTemplate) { | |
| 90 | + this.idTemplate = idTemplate; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public String getResponsavel() { | |
| 94 | + return responsavel; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public void setResponsavel(String usuario) { | |
| 98 | + this.responsavel = usuario; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public Date getData() { | |
| 102 | + return data; | |
| 103 | + } | |
| 104 | + | |
| 105 | + public void setData(Date data) { | |
| 106 | + this.data = data; | |
| 107 | + } | |
| 108 | + | |
| 109 | + public String getDescricao() { | |
| 110 | + return descricao; | |
| 111 | + } | |
| 112 | + | |
| 113 | + public void setDescricao(String descricao) { | |
| 114 | + this.descricao = descricao; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public String getExemplo() { | |
| 118 | + return exemplo; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public void setExemplo(String exemplo) { | |
| 122 | + this.exemplo = exemplo; | |
| 123 | + } | |
| 124 | + | |
| 125 | + public byte[] getCorpo() { | |
| 126 | + return corpo; | |
| 127 | + } | |
| 128 | + | |
| 129 | + public void setCorpo(byte[] corpo) { | |
| 130 | + this.corpo = corpo; | |
| 131 | + } | |
| 132 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,74 @@ |
| 1 | +package br.gov.ans.templates.modelo; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.Date; | |
| 5 | + | |
| 6 | +public class VersaoId implements Serializable { | |
| 7 | + | |
| 8 | + private static final long serialVersionUID = 1L; | |
| 9 | + | |
| 10 | + private Long idTemplate; | |
| 11 | + private String responsavel; | |
| 12 | + private Date data; | |
| 13 | + | |
| 14 | + public Long getIdTemplate() { | |
| 15 | + return idTemplate; | |
| 16 | + } | |
| 17 | + | |
| 18 | + public void setIdTemplate(Long idTemplate) { | |
| 19 | + this.idTemplate = idTemplate; | |
| 20 | + } | |
| 21 | + | |
| 22 | + public String getResponsavel() { | |
| 23 | + return responsavel; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public void setResponsavel(String usuario) { | |
| 27 | + this.responsavel = usuario; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public Date getData() { | |
| 31 | + return data; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public void setData(Date data) { | |
| 35 | + this.data = data; | |
| 36 | + } | |
| 37 | + | |
| 38 | + @Override | |
| 39 | + public int hashCode() { | |
| 40 | + final int prime = 31; | |
| 41 | + int result = 1; | |
| 42 | + result = prime * result + ((data == null) ? 0 : data.hashCode()); | |
| 43 | + result = prime * result + ((idTemplate == null) ? 0 : idTemplate.hashCode()); | |
| 44 | + result = prime * result + ((responsavel == null) ? 0 : responsavel.hashCode()); | |
| 45 | + return result; | |
| 46 | + } | |
| 47 | + | |
| 48 | + @Override | |
| 49 | + public boolean equals(Object obj) { | |
| 50 | + if (this == obj) | |
| 51 | + return true; | |
| 52 | + if (obj == null) | |
| 53 | + return false; | |
| 54 | + if (getClass() != obj.getClass()) | |
| 55 | + return false; | |
| 56 | + VersaoId other = (VersaoId) obj; | |
| 57 | + if (data == null) { | |
| 58 | + if (other.data != null) | |
| 59 | + return false; | |
| 60 | + } else if (!data.equals(other.data)) | |
| 61 | + return false; | |
| 62 | + if (idTemplate == null) { | |
| 63 | + if (other.idTemplate != null) | |
| 64 | + return false; | |
| 65 | + } else if (!idTemplate.equals(other.idTemplate)) | |
| 66 | + return false; | |
| 67 | + if (responsavel == null) { | |
| 68 | + if (other.responsavel != null) | |
| 69 | + return false; | |
| 70 | + } else if (!responsavel.equals(other.responsavel)) | |
| 71 | + return false; | |
| 72 | + return true; | |
| 73 | + } | |
| 74 | +} | ... | ... |
src/main/java/br/gov/ans/templates/rest/ColaboradorResource.java
0 → 100644
| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | +package br.gov.ans.templates.rest; | |
| 2 | + | |
| 3 | +import javax.ws.rs.GET; | |
| 4 | +import javax.ws.rs.Path; | |
| 5 | +import javax.ws.rs.PathParam; | |
| 6 | +import javax.ws.rs.core.Response; | |
| 7 | + | |
| 8 | +@Path("colaboradores") | |
| 9 | +public class ColaboradorResource { | |
| 10 | + | |
| 11 | + @GET | |
| 12 | + @Path("{colaborador}/templates") | |
| 13 | + public Response getTemplates(@PathParam("colaborador") String colaborador){ | |
| 14 | + return null; | |
| 15 | + } | |
| 16 | + | |
| 17 | +} | ... | ... |
src/main/java/br/gov/ans/templates/rest/TemplateResource.java
0 → 100644
| ... | ... | @@ -0,0 +1,642 @@ |
| 1 | +package br.gov.ans.templates.rest; | |
| 2 | + | |
| 3 | +import static br.gov.ans.templates.util.TemplatesUtils.getResourcePath; | |
| 4 | +import static br.gov.ans.templates.util.TemplatesUtils.parseInt; | |
| 5 | + | |
| 6 | +import java.util.ArrayList; | |
| 7 | +import java.util.Date; | |
| 8 | +import java.util.HashMap; | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +import javax.ejb.Stateless; | |
| 12 | +import javax.inject.Inject; | |
| 13 | +import javax.validation.Valid; | |
| 14 | +import javax.ws.rs.Consumes; | |
| 15 | +import javax.ws.rs.DELETE; | |
| 16 | +import javax.ws.rs.GET; | |
| 17 | +import javax.ws.rs.POST; | |
| 18 | +import javax.ws.rs.PUT; | |
| 19 | +import javax.ws.rs.Path; | |
| 20 | +import javax.ws.rs.PathParam; | |
| 21 | +import javax.ws.rs.Produces; | |
| 22 | +import javax.ws.rs.QueryParam; | |
| 23 | +import javax.ws.rs.core.Context; | |
| 24 | +import javax.ws.rs.core.GenericEntity; | |
| 25 | +import javax.ws.rs.core.MediaType; | |
| 26 | +import javax.ws.rs.core.Response; | |
| 27 | +import javax.ws.rs.core.UriInfo; | |
| 28 | + | |
| 29 | +import br.gov.ans.dao.DAO; | |
| 30 | +import br.gov.ans.exceptions.BusinessException; | |
| 31 | +import br.gov.ans.exceptions.ResourceConflictException; | |
| 32 | +import br.gov.ans.exceptions.ResourceNotFoundException; | |
| 33 | +import br.gov.ans.exceptions.WrappedException; | |
| 34 | +import br.gov.ans.templates.dao.ColaboradorDAO; | |
| 35 | +import br.gov.ans.templates.dao.TemplatesDAO; | |
| 36 | +import br.gov.ans.templates.modelo.Colaborador; | |
| 37 | +import br.gov.ans.templates.modelo.Template; | |
| 38 | +import br.gov.ans.templates.modelo.Versao; | |
| 39 | +import br.gov.ans.utils.MessageUtils; | |
| 40 | + | |
| 41 | +@Path("/templates") | |
| 42 | +@Stateless | |
| 43 | +public class TemplateResource { | |
| 44 | + | |
| 45 | + @Inject | |
| 46 | + private TemplatesDAO daoTemplate; | |
| 47 | + | |
| 48 | + @Inject | |
| 49 | + private DAO<Versao> daoVersao; | |
| 50 | + | |
| 51 | + @Inject | |
| 52 | + private ColaboradorDAO daoColaborador; | |
| 53 | + | |
| 54 | + @Context | |
| 55 | + private UriInfo uriInfo; | |
| 56 | + | |
| 57 | + @Inject | |
| 58 | + private MessageUtils messages; | |
| 59 | + | |
| 60 | + /** | |
| 61 | + * @api {get} /templates Listar templates | |
| 62 | + * @apiName listTemplates | |
| 63 | + * @apiGroup Template | |
| 64 | + * @apiVersion 1.0.0 | |
| 65 | + * @apiPermission RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE | |
| 66 | + * | |
| 67 | + * @apiDescription Consulta os templates disponíveis. | |
| 68 | + * | |
| 69 | + * @apiParam (Query Parameters) {String} [filtro] Valor utilizado para filtrar os templates. | |
| 70 | + * @apiParam (Query Parameters) {String} [itens = 20] Quantidade de templates que serão exibidos | |
| 71 | + * @apiParam (Query Parameters) {String} [pag = 1] Número da página | |
| 72 | + * | |
| 73 | + * @apiExample Exemplo de requisição: | |
| 74 | + * curl -i http://<host>/templates-broker/service/templates | |
| 75 | + * | |
| 76 | + * @apiSuccess (Sucesso - 200) {List} resultado Lista com os templates encontrados. | |
| 77 | + * @apiSuccess (Sucesso - 200) {Template} resultado.template Objeto representando o template. | |
| 78 | + * @apiSuccess (Sucesso - 200) {String} resultado.template.corpo Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados. | |
| 79 | + * @apiSuccess (Sucesso - 200) {String} resultado.template.dataCadastro Data de cadastro do template. | |
| 80 | + * @apiSuccess (Sucesso - 200) {String} resultado.template.descricao Descrição do template. | |
| 81 | + * @apiSuccess (Sucesso - 200) {String} resultado.template.exemplo Exemplo de request para preenchimento do template. | |
| 82 | + * @apiSuccess (Sucesso - 200) {String} resultado.template.nome Identificador do template | |
| 83 | + * @apiSuccess (Sucesso - 200) {String} resultado.template.responsavel Analista responsável pelo template. | |
| 84 | + * @apiSuccess (Sucesso - 200) {Boolean} resultado.template.restrito Flag identificando se a atualização deste template � restrita. | |
| 85 | + * | |
| 86 | + * @apiSuccessExample {json} Success-Response: | |
| 87 | + * HTTP/1.1 200 OK | |
| 88 | + * { | |
| 89 | + * "corpo": "Prezado {{fulano}}, seu cadastro foi realizado com sucesso.", | |
| 90 | + * "dataCadastro": "2017-03-14T16:57:47.405-03:00", | |
| 91 | + * "descricao": "Template de confirmação de cadastro.", | |
| 92 | + * "exemplo": "{"fulano":"André Guimarães"}", | |
| 93 | + * "nome": "confirmacao-cadastro", | |
| 94 | + * "responsavel": "andre.guimaraes", | |
| 95 | + * "restrito": false | |
| 96 | + * } | |
| 97 | + * | |
| 98 | + * @apiErrorExample {json} Error-Response: | |
| 99 | + * HTTP/1.1 500 Internal Server Error | |
| 100 | + * { | |
| 101 | + * "error":"Mensagem de erro." | |
| 102 | + * "code":"código do erro" | |
| 103 | + * } | |
| 104 | + */ | |
| 105 | + @GET | |
| 106 | + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 107 | + public Response listTemplates(@QueryParam("filtro") String filtro, @QueryParam("pag") String pagina, @QueryParam("itens") String tamanhoPagina) throws BusinessException, ResourceNotFoundException{ | |
| 108 | + List<Template> templates = daoTemplate.getTemplates(filtro, pagina == null? null:parseInt(pagina), tamanhoPagina == null? null : parseInt(tamanhoPagina)); | |
| 109 | + | |
| 110 | + if(templates.isEmpty()){ | |
| 111 | + throw new ResourceNotFoundException(messages.getMessage("templates.nao.encontrados.filtro",filtro)); | |
| 112 | + } | |
| 113 | + | |
| 114 | + GenericEntity<List<Template>> entity = new GenericEntity<List<Template>>(templates){}; | |
| 115 | + | |
| 116 | + Long totalRegistros = daoTemplate.countTemplates(filtro); | |
| 117 | + | |
| 118 | + return Response.ok().entity(entity).header("total_registros", totalRegistros).build(); | |
| 119 | + } | |
| 120 | + | |
| 121 | + /** | |
| 122 | + * @api {get} /templates/:template Consultar template | |
| 123 | + * @apiName getTemplate | |
| 124 | + * @apiGroup Template | |
| 125 | + * @apiVersion 1.0.0 | |
| 126 | + * @apiPermission RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE | |
| 127 | + * | |
| 128 | + * @apiDescription Consulta um template. | |
| 129 | + * | |
| 130 | + * @apiParam (Path Parameters) {String} template Identificador do template | |
| 131 | + * | |
| 132 | + * @apiExample Exemplo de requisição: | |
| 133 | + * curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro | |
| 134 | + * | |
| 135 | + * @apiSuccess (Sucesso - 200) {Template} template Objeto representando o template. | |
| 136 | + * @apiSuccess (Sucesso - 200) {String} template.corpo Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados. | |
| 137 | + * @apiSuccess (Sucesso - 200) {String} template.dataCadastro Data de cadastro do template. | |
| 138 | + * @apiSuccess (Sucesso - 200) {String} template.descricao Descrição do template. | |
| 139 | + * @apiSuccess (Sucesso - 200) {String} template.exemplo Exemplo de request para preenchimento do template. | |
| 140 | + * @apiSuccess (Sucesso - 200) {String} template.nome Identificador do template. | |
| 141 | + * @apiSuccess (Sucesso - 200) {String} template.responsavel Analista responsável pelo template. | |
| 142 | + * @apiSuccess (Sucesso - 200) {Boolean} template.restrito Flag identificando se a atualização deste template � restrita. | |
| 143 | + * | |
| 144 | + * @apiSuccessExample {json} Success-Response: | |
| 145 | + * HTTP/1.1 200 OK | |
| 146 | + * { | |
| 147 | + * "corpo": "Prezado {{fulano}}, seu cadastro foi realizado com sucesso.", | |
| 148 | + * "dataCadastro": "2017-03-14T16:57:47.405-03:00", | |
| 149 | + * "descricao": "Template de confirmação de cadastro.", | |
| 150 | + * "exemplo": "{"fulano":"André Guimarães"}", | |
| 151 | + * "nome": "confirmacao-cadastro", | |
| 152 | + * "responsavel": "andre.guimaraes", | |
| 153 | + * "restrito": false, | |
| 154 | + * } | |
| 155 | + * | |
| 156 | + * @apiErrorExample {json} Error-Response: | |
| 157 | + * HTTP/1.1 500 Internal Server Error | |
| 158 | + * { | |
| 159 | + * "error":"Mensagem de erro." | |
| 160 | + * "code":"código do erro" | |
| 161 | + * } | |
| 162 | + */ | |
| 163 | + @GET | |
| 164 | + @Path("{template}") | |
| 165 | + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 166 | + public Template getTemplate(@PathParam("template") String nomeTemplate) throws ResourceNotFoundException{ | |
| 167 | + Template template = daoTemplate.getTemplate(nomeTemplate); | |
| 168 | + | |
| 169 | + if(template == null){ | |
| 170 | + throw new ResourceNotFoundException(messages.getMessage("erro.template.nao.encontrado", nomeTemplate)); | |
| 171 | + } | |
| 172 | + | |
| 173 | + return template; | |
| 174 | + } | |
| 175 | + | |
| 176 | + /** | |
| 177 | + * @api {get} /templates/:template/corpo Recuperar corpo | |
| 178 | + * @apiName getCorpoTemplate | |
| 179 | + * @apiGroup Template | |
| 180 | + * @apiVersion 1.0.0 | |
| 181 | + * @apiPermission RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE | |
| 182 | + * | |
| 183 | + * @apiDescription Recupera o corpo de um template para utilização. | |
| 184 | + * | |
| 185 | + * @apiParam (Path Parameters) {String} template Identificador do template | |
| 186 | + * | |
| 187 | + * @apiExample Exemplo de requisição: | |
| 188 | + * curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro | |
| 189 | + * | |
| 190 | + * @apiSuccess (Sucesso - 200) {String} corpo String com o corpo do template pronto para utilização. | |
| 191 | + * | |
| 192 | + * @apiSuccessExample {json} Success-Response: | |
| 193 | + * HTTP/1.1 200 OK | |
| 194 | + * Prezado {{fulano}}, seu cadastro foi realizado com sucesso. | |
| 195 | + * | |
| 196 | + * @apiErrorExample {json} Error-Response: | |
| 197 | + * HTTP/1.1 500 Internal Server Error | |
| 198 | + * { | |
| 199 | + * "error":"Mensagem de erro." | |
| 200 | + * "code":"código do erro" | |
| 201 | + * } | |
| 202 | + */ | |
| 203 | + @GET | |
| 204 | + @Path("{template}/corpo") | |
| 205 | + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 206 | + public String getCorpoTemplate(@PathParam("template") String nomeTemplate) throws ResourceNotFoundException{ | |
| 207 | + return new String(getTemplate(nomeTemplate).getCorpo()); | |
| 208 | + } | |
| 209 | + | |
| 210 | + /** | |
| 211 | + * @api {post} /templates Adicionar template | |
| 212 | + * @apiName createTemplate | |
| 213 | + * @apiGroup Template | |
| 214 | + * @apiVersion 1.0.0 | |
| 215 | + * @apiPermission RO_ADMIN_TEMPLATE | |
| 216 | + * | |
| 217 | + * @apiDescription Cria um novo template. | |
| 218 | + * | |
| 219 | + * @apiParam (Request Body) {Template} template Objeto de representação do template. | |
| 220 | + * @apiParam (Request Body) {String} corpo Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados. | |
| 221 | + * @apiParam (Request Body) {String} descricao Descrição do template. | |
| 222 | + * @apiParam (Request Body) {String} exemplo Exemplo de request para preenchimento do template. | |
| 223 | + * @apiParam (Request Body) {String} nome Identificador do template. | |
| 224 | + * @apiParam (Request Body) {String} responsavel Analista responsável pelo template. | |
| 225 | + * @apiParam (Request Body) {String} restrito Flag identificando se a atualização deste template � restrita. | |
| 226 | + * | |
| 227 | + * @apiExample Exemplo de requisição: | |
| 228 | + * endpoint: [PUT] http://<host>/templates-broker/service/templates/confirmacao-cadastro | |
| 229 | + * | |
| 230 | + * body: | |
| 231 | + * { | |
| 232 | + * "corpo": "Prezado {{fulano}}, seu cadastro foi realizado com sucesso.", | |
| 233 | + * "descricao": "Template de confirmação de cadastro.", | |
| 234 | + * "exemplo": "{"fulano":"André Guimarães"}", | |
| 235 | + * "nome": "confirmacao-cadastro", | |
| 236 | + * "responsavel": "andre.guimaraes", | |
| 237 | + * "restrito": true, | |
| 238 | + * } | |
| 239 | + * | |
| 240 | + * @apiSuccess (Sucesso - 201) {header} Location Caminho para o recurso criado. | |
| 241 | + * | |
| 242 | + * @apiSuccessExample {json} Success-Response: | |
| 243 | + * HTTP/1.1 201 Created | |
| 244 | + * | |
| 245 | + * @apiErrorExample {json} Error-Response: | |
| 246 | + * HTTP/1.1 500 Internal Server Error | |
| 247 | + * { | |
| 248 | + * "error":"Mensagem de erro." | |
| 249 | + * "code":"código do erro" | |
| 250 | + * } | |
| 251 | + */ | |
| 252 | + @POST | |
| 253 | + @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 254 | + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 255 | + public Response createTemplate(@Valid br.gov.ans.templates.to.Template template) throws WrappedException, ResourceNotFoundException, ResourceConflictException{ | |
| 256 | + Template entity = new Template(template); | |
| 257 | + | |
| 258 | + if(daoTemplate.getTemplate(template.getNome()) != null){ | |
| 259 | + throw new ResourceConflictException(messages.getMessage("erro.template.existente",template.getNome())); | |
| 260 | + } | |
| 261 | + | |
| 262 | + try{ | |
| 263 | + daoTemplate.persist(entity); | |
| 264 | + adicionarColaboradorCriador(entity, template.getResponsavel()); | |
| 265 | + }catch(Exception ex){ | |
| 266 | + throw new WrappedException(ex); | |
| 267 | + } | |
| 268 | + | |
| 269 | + return Response.created(getResourcePath(uriInfo, entity.getNome())).build(); | |
| 270 | + } | |
| 271 | + | |
| 272 | + /** | |
| 273 | + * @api {put} /templates/:template Atualizar template | |
| 274 | + * @apiName editTemplate | |
| 275 | + * @apiGroup Template | |
| 276 | + * @apiVersion 1.0.0 | |
| 277 | + * @apiPermission RO_ADMIN_TEMPLATE | |
| 278 | + * | |
| 279 | + * @apiDescription Atualiza um template. | |
| 280 | + * | |
| 281 | + * @apiParam (Path Parameters) {String} template Identificador do template | |
| 282 | + * | |
| 283 | + * @apiParam (Request Body) {Template} template Objeto de representação do template. | |
| 284 | + * @apiParam (Request Body) {String} corpo Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados. | |
| 285 | + * @apiParam (Request Body) {String} descricao Descrição do template. | |
| 286 | + * @apiParam (Request Body) {String} exemplo Exemplo de request para preenchimento do template. | |
| 287 | + * @apiParam (Request Body) {String} nome Identificador do template. | |
| 288 | + * @apiParam (Request Body) {String} responsavel Analista responsável pelo template. | |
| 289 | + * @apiParam (Request Body) {String} restrito Flag identificando se a atualização deste template � restrita. | |
| 290 | + * | |
| 291 | + * @apiExample Exemplo de requisição: | |
| 292 | + * endpoint: [PUT] http://<host>/templates-broker/service/templates/confirmacao-cadastro | |
| 293 | + * | |
| 294 | + * body: | |
| 295 | + * { | |
| 296 | + * "corpo": "Prezado {{fulano}}, seu cadastro foi realizado com sucesso.", | |
| 297 | + * "descricao": "Template de confirmação de cadastro.", | |
| 298 | + * "exemplo": "{"fulano":"André Guimarães"}", | |
| 299 | + * "nome": "confirmacao-cadastro", | |
| 300 | + * "responsavel": "andre.guimaraes", | |
| 301 | + * "restrito": true, | |
| 302 | + * } | |
| 303 | + * | |
| 304 | + * | |
| 305 | + * @apiSuccess (Sucesso - 200) {header} Location Caminho para o recurso editado. | |
| 306 | + * | |
| 307 | + * @apiSuccessExample {json} Success-Response: | |
| 308 | + * HTTP/1.1 200 OK | |
| 309 | + * | |
| 310 | + * @apiErrorExample {json} Error-Response: | |
| 311 | + * HTTP/1.1 500 Internal Server Error | |
| 312 | + * { | |
| 313 | + * "error":"Mensagem de erro." | |
| 314 | + * "code":"código do erro" | |
| 315 | + * } | |
| 316 | + */ | |
| 317 | + @PUT | |
| 318 | + @Path("{template}") | |
| 319 | + @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 320 | + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 321 | + public Response editTemplate(@PathParam("template") String nomeTemplate, br.gov.ans.templates.to.Template template) throws ResourceNotFoundException{ | |
| 322 | + Template templateAtual = getTemplate(nomeTemplate); | |
| 323 | + | |
| 324 | + if(templateAtual.getRestrito()){ | |
| 325 | + verificaPermissaoColaborador(templateAtual.getId(),template.getResponsavel()); | |
| 326 | + }else{ | |
| 327 | + registrarColaborador(templateAtual.getId(),template.getResponsavel()); | |
| 328 | + } | |
| 329 | + | |
| 330 | + registrarHistoricoVersao(templateAtual); | |
| 331 | + | |
| 332 | + templateAtual.setNome(template.getNome()); | |
| 333 | + templateAtual.setDescricao(template.getDescricao()); | |
| 334 | + templateAtual.setCorpo(template.getCorpo().getBytes()); | |
| 335 | + templateAtual.setExemplo(template.getExemplo()); | |
| 336 | + templateAtual.setResponsavel(template.getResponsavel()); | |
| 337 | + templateAtual.setRestrito(template.getRestrito()); | |
| 338 | + templateAtual.setDataCadastro(new Date()); | |
| 339 | + | |
| 340 | + daoTemplate.merge(templateAtual); | |
| 341 | + | |
| 342 | + return Response.ok().contentLocation(getResourcePath(uriInfo, template.getNome())).build(); | |
| 343 | + } | |
| 344 | + | |
| 345 | + /** | |
| 346 | + * @api {delete} /templates/:template Excluir template | |
| 347 | + * @apiName deleteTemplate | |
| 348 | + * @apiGroup Template | |
| 349 | + * @apiVersion 1.0.0 | |
| 350 | + * @apiPermission RO_ADMIN_TEMPLATE | |
| 351 | + * | |
| 352 | + * @apiDescription Exclui determinado template. | |
| 353 | + * | |
| 354 | + * @apiParam (Path Parameters) {String} template Identificador do template | |
| 355 | + * | |
| 356 | + * @apiExample Exemplo de requisição: | |
| 357 | + * curl -X DELETE http://<host>/templates-broker/service/templates/confirmacao-cadastro | |
| 358 | + * | |
| 359 | + * @apiSuccessExample {json} Success-Response: | |
| 360 | + * HTTP/1.1 200 OK | |
| 361 | + * | |
| 362 | + * @apiErrorExample {json} Error-Response: | |
| 363 | + * HTTP/1.1 500 Internal Server Error | |
| 364 | + * { | |
| 365 | + * "error":"Mensagem de erro." | |
| 366 | + * "code":"código do erro" | |
| 367 | + * } | |
| 368 | + */ | |
| 369 | + @DELETE | |
| 370 | + @Path("{template}") | |
| 371 | + @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 372 | + public Response deleteTemplate(@PathParam("template") String nomeTemplate) throws ResourceNotFoundException{ | |
| 373 | + Template template = getTemplate(nomeTemplate); | |
| 374 | + | |
| 375 | + template.setDataExclusao(new Date()); | |
| 376 | + | |
| 377 | + daoTemplate.merge(template); | |
| 378 | + | |
| 379 | + return Response.ok().build(); | |
| 380 | + } | |
| 381 | + | |
| 382 | + /** | |
| 383 | + * @api {get} /templates/:template/colaboradores Listar colaboradores | |
| 384 | + * @apiName getColaboradores | |
| 385 | + * @apiGroup Colaborador | |
| 386 | + * @apiVersion 1.0.0 | |
| 387 | + * @apiPermission RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE | |
| 388 | + * | |
| 389 | + * @apiDescription Consulta os colaboradores do template. | |
| 390 | + * | |
| 391 | + * @apiParam (Path Parameters) {String} template Identificador do template | |
| 392 | + * | |
| 393 | + * @apiParam (Query Parameters) {String} [itens = 20] Quantidade de templates que serão exibidos | |
| 394 | + * @apiParam (Query Parameters) {String} [pag = 1] Número da página | |
| 395 | + * | |
| 396 | + * @apiExample Exemplo de requisição: | |
| 397 | + * curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro/colaboradores | |
| 398 | + * | |
| 399 | + * @apiSuccess (Sucesso - 200) {List} resultado Lista com os colaboradores do template. | |
| 400 | + * @apiSuccess (Sucesso - 200) {Colaborador} resultado.colaborador Objeto representando um colaborador. | |
| 401 | + * @apiSuccess (Sucesso - 200) {String} resultado.colaborador.usuario Identificador do colaborador. | |
| 402 | + * @apiSuccess (Sucesso - 200) {Boolean} resultado.colaborador.editor Flag que determina se o colaborador tem o poder para editar o template. | |
| 403 | + * | |
| 404 | + * @apiSuccessExample {json} Success-Response: | |
| 405 | + * HTTP/1.1 200 OK | |
| 406 | + * { | |
| 407 | + * "editor": true, | |
| 408 | + * "usuario": "andre.guimaraes", | |
| 409 | + * } | |
| 410 | + * | |
| 411 | + * @apiErrorExample {json} Error-Response: | |
| 412 | + * HTTP/1.1 500 Internal Server Error | |
| 413 | + * { | |
| 414 | + * "error":"Mensagem de erro." | |
| 415 | + * "code":"código do erro" | |
| 416 | + * } | |
| 417 | + */ | |
| 418 | + @GET | |
| 419 | + @Path("{template}/colaboradores") | |
| 420 | + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 421 | + public Response getColaboradores(@PathParam("template") String template, @QueryParam("pag") String pagina, @QueryParam("itens") String tamanhoPagina) throws ResourceNotFoundException, BusinessException{ | |
| 422 | + Long idTemplate = getTemplate(template).getId(); | |
| 423 | + | |
| 424 | + ArrayList<Colaborador> colaboradores = (ArrayList<Colaborador>) daoColaborador.getColaboradores( | |
| 425 | + idTemplate, pagina == null ? null : parseInt(pagina), | |
| 426 | + tamanhoPagina == null ? null : parseInt(tamanhoPagina)); | |
| 427 | + | |
| 428 | + GenericEntity<List<Colaborador>> entity = new GenericEntity<List<Colaborador>>(colaboradores){}; | |
| 429 | + | |
| 430 | + Long totalRegistros = daoColaborador.countColaboradores(idTemplate); | |
| 431 | + | |
| 432 | + return Response.ok().entity(entity).header("total_registros", totalRegistros).build(); | |
| 433 | + } | |
| 434 | + | |
| 435 | + /** | |
| 436 | + * @api {get} /templates/:template/colaboradores/:colaborador Consultar colaborador | |
| 437 | + * @apiName getColaborador | |
| 438 | + * @apiGroup Colaborador | |
| 439 | + * @apiVersion 1.0.0 | |
| 440 | + * @apiPermission RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE | |
| 441 | + * | |
| 442 | + * @apiDescription Consulta um colaborador. | |
| 443 | + * | |
| 444 | + * @apiParam (Path Parameters) {String} template Identificador do template | |
| 445 | + * @apiParam (Path Parameters) {String} colaborador Identificador do colaborador | |
| 446 | + * | |
| 447 | + * @apiExample Exemplo de requisição: | |
| 448 | + * curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro/colaboradores/andre.guimaraes | |
| 449 | + * | |
| 450 | + * @apiSuccess (Sucesso - 200) {Colaborador} colaborador Objeto representando um colaborador. | |
| 451 | + * @apiSuccess (Sucesso - 200) {String} colaborador.usuario Identificador do colaborador. | |
| 452 | + * @apiSuccess (Sucesso - 200) {Boolean} colaborador.editor Flag que determina se o colaborador tem o poder para editar o template. | |
| 453 | + * | |
| 454 | + * @apiSuccessExample {json} Success-Response: | |
| 455 | + * HTTP/1.1 200 OK | |
| 456 | + * { | |
| 457 | + * "editor": true, | |
| 458 | + * "usuario": "andre.guimaraes" | |
| 459 | + * } | |
| 460 | + * | |
| 461 | + * @apiErrorExample {json} Error-Response: | |
| 462 | + * HTTP/1.1 500 Internal Server Error | |
| 463 | + * { | |
| 464 | + * "error":"Mensagem de erro." | |
| 465 | + * "code":"código do erro" | |
| 466 | + * } | |
| 467 | + */ | |
| 468 | + @GET | |
| 469 | + @Path("{template}/colaboradores/{colaborador}") | |
| 470 | + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 471 | + public Colaborador getColaborador(@PathParam("template") String template, @PathParam("colaborador") String colaborador) throws ResourceNotFoundException{ | |
| 472 | + return daoColaborador.getColaborador(getTemplate(template).getId(), colaborador); | |
| 473 | + } | |
| 474 | + | |
| 475 | + /** | |
| 476 | + * @api {post} /templates/:template/colaboradores Adicionar colaborador | |
| 477 | + * @apiName addColaborador | |
| 478 | + * @apiGroup Colaborador | |
| 479 | + * @apiVersion 1.0.0 | |
| 480 | + * @apiPermission RO_ADMIN_TEMPLATE | |
| 481 | + * | |
| 482 | + * @apiDescription Adiciona um colaborador ao template. | |
| 483 | + * | |
| 484 | + * @apiParam (Path Parameters) {String} template Identificador do template | |
| 485 | + * | |
| 486 | + * @apiExample Exemplo de requisição: | |
| 487 | + * endpoint: [POST] http://<host>/templates-broker/service/templates/confirmacao-cadastro/colaboradores | |
| 488 | + * | |
| 489 | + * body: | |
| 490 | + * { | |
| 491 | + * "usuario": "andre.guimaraes", | |
| 492 | + * "editor": true | |
| 493 | + * } | |
| 494 | + * | |
| 495 | + * @apiSuccess (Sucesso - 201) {header} Location Caminho para o recurso criado. | |
| 496 | + * | |
| 497 | + * @apiSuccessExample {json} Success-Response: | |
| 498 | + * HTTP/1.1 201 Created | |
| 499 | + * | |
| 500 | + * @apiErrorExample {json} Error-Response: | |
| 501 | + * HTTP/1.1 500 Internal Server Error | |
| 502 | + * { | |
| 503 | + * "error":"Mensagem de erro." | |
| 504 | + * "code":"código do erro" | |
| 505 | + * } | |
| 506 | + */ | |
| 507 | + @POST | |
| 508 | + @Path("{template}/colaboradores") | |
| 509 | + @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 510 | + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 511 | + public Response addColaborador(@PathParam("template") String nomeTemplate, Colaborador colaborador) throws ResourceNotFoundException{ | |
| 512 | + Template template = getTemplate(nomeTemplate); | |
| 513 | + | |
| 514 | + colaborador.setIdTemplate(template.getId()); | |
| 515 | + | |
| 516 | + daoColaborador.merge(colaborador); | |
| 517 | + | |
| 518 | + return Response.ok().contentLocation(getResourcePath(uriInfo, colaborador.getUsuario())).build(); | |
| 519 | + } | |
| 520 | + | |
| 521 | + /** | |
| 522 | + * @api {delete} /templates/:template/colaboradores/:colaborador Remover colaborador | |
| 523 | + * @apiName removeColaborador | |
| 524 | + * @apiGroup Colaborador | |
| 525 | + * @apiVersion 1.0.0 | |
| 526 | + * @apiPermission RO_ADMIN_TEMPLATE | |
| 527 | + * | |
| 528 | + * @apiDescription Remove colaborador de um template. | |
| 529 | + * | |
| 530 | + * @apiParam (Path Parameters) {String} template Identificador do template | |
| 531 | + * @apiParam (Path Parameters) {String} colaborador Identificador do colaborador | |
| 532 | + * | |
| 533 | + * @apiExample Exemplo de requisição: | |
| 534 | + * curl -X DELETE http://<host>/templates-broker/service/templates/confirmacao-cadastro/colaboradores/andre.guimaraes | |
| 535 | + * | |
| 536 | + * @apiSuccessExample {json} Success-Response: | |
| 537 | + * HTTP/1.1 200 OK | |
| 538 | + * | |
| 539 | + * @apiErrorExample {json} Error-Response: | |
| 540 | + * HTTP/1.1 500 Internal Server Error | |
| 541 | + * { | |
| 542 | + * "error":"Mensagem de erro." | |
| 543 | + * "code":"código do erro" | |
| 544 | + * } | |
| 545 | + */ | |
| 546 | + @DELETE | |
| 547 | + @Path("{template}/colaboradores/{colaborador}") | |
| 548 | + public Response removeColaborador(@PathParam("template") String template,@PathParam("colaborador") String nomeColaborador) throws ResourceNotFoundException{ | |
| 549 | + Colaborador colaborador = getColaborador(template, nomeColaborador); | |
| 550 | + | |
| 551 | + colaborador.setDataExclusao(new Date()); | |
| 552 | + | |
| 553 | + daoColaborador.merge(colaborador); | |
| 554 | + | |
| 555 | + return Response.ok().build(); | |
| 556 | + } | |
| 557 | + | |
| 558 | + /** | |
| 559 | + * @api {get} /templates/:template/versoes Listar versões | |
| 560 | + * @apiName getVersoes | |
| 561 | + * @apiGroup Template | |
| 562 | + * @apiVersion 1.0.0 | |
| 563 | + * @apiPermission RO_ADMIN_TEMPLATE, RO_ADMIN_TEMPLATE | |
| 564 | + * | |
| 565 | + * @apiDescription Lista as versões de um template | |
| 566 | + * | |
| 567 | + * @apiParam (Path Parameters) {String} template Identificador do template | |
| 568 | + * | |
| 569 | + * @apiExample Exemplo de requisição: | |
| 570 | + * curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro/versoes | |
| 571 | + * | |
| 572 | + * @apiSuccess (Sucesso - 200) {List} resultado Lista com as versões do template. | |
| 573 | + * @apiSuccess (Sucesso - 200) {Versao} resultado.versao Objeto representando uma versão do template. | |
| 574 | + * @apiSuccess (Sucesso - 200) {String} resultado.versao.corpo Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados. | |
| 575 | + * @apiSuccess (Sucesso - 200) {Date} resultado.versao.data Data da versão. | |
| 576 | + * @apiSuccess (Sucesso - 200) {String} resultado.versao.descricao Descrição do template. | |
| 577 | + * @apiSuccess (Sucesso - 200) {String} resultado.versao.exemplo Exemplo de request para preenchimento do template. | |
| 578 | + * @apiSuccess (Sucesso - 200) {String} resultado.versao.responsavel Identificador do colaborador responsável. | |
| 579 | + * | |
| 580 | + * @apiSuccessExample {json} Success-Response: | |
| 581 | + * HTTP/1.1 200 OK | |
| 582 | + * { | |
| 583 | + * "corpo": "Prezado {{fulano}}, seu cadastro foi realizado com sucesso.", | |
| 584 | + * "data":"2017-03-14T16:57:47.405-03:00", | |
| 585 | + * "descricao": "Template de confirmação de cadastro.", | |
| 586 | + * "exemplo": "{"fulano":"André Guimarães"}", | |
| 587 | + * "responsavel": "andre.guimaraes", | |
| 588 | + * } | |
| 589 | + * | |
| 590 | + * @apiErrorExample {json} Error-Response: | |
| 591 | + * HTTP/1.1 500 Internal Server Error | |
| 592 | + * { | |
| 593 | + * "error":"Mensagem de erro." | |
| 594 | + * "code":"código do erro" | |
| 595 | + * } | |
| 596 | + */ | |
| 597 | + @GET | |
| 598 | + @Path("{template}/versoes/") | |
| 599 | + @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) | |
| 600 | + public Response getVersoes(@PathParam("template") String nomeTemplate) throws ResourceNotFoundException{ | |
| 601 | + Template template = getTemplate(nomeTemplate); | |
| 602 | + | |
| 603 | + HashMap<String, Object> params = new HashMap<String, Object>(); | |
| 604 | + params.put("template", template.getId()); | |
| 605 | + | |
| 606 | + List<Versao> versoes = daoVersao.executeNamedQuery("Versao.recuperarVersoes", params); | |
| 607 | + | |
| 608 | + GenericEntity<List<Versao>> entity = new GenericEntity<List<Versao>>(versoes){}; | |
| 609 | + | |
| 610 | + return Response.ok().entity(entity).build(); | |
| 611 | + } | |
| 612 | + | |
| 613 | + public void registrarHistoricoVersao(Template template){ | |
| 614 | + Versao versao = new Versao(template); | |
| 615 | + | |
| 616 | + daoVersao.persist(versao); | |
| 617 | + } | |
| 618 | + | |
| 619 | + public void adicionarColaboradorCriador(Template template, String usuario){ | |
| 620 | + Colaborador colaborador = new Colaborador(); | |
| 621 | + | |
| 622 | + colaborador.setUsuario(usuario); | |
| 623 | + colaborador.setEditor(true); | |
| 624 | + colaborador.setIdTemplate(template.getId()); | |
| 625 | + | |
| 626 | + daoColaborador.persist(colaborador); | |
| 627 | + } | |
| 628 | + | |
| 629 | + public void verificaPermissaoColaborador(Long idTemplate, String colaborador) throws ResourceNotFoundException{ | |
| 630 | + daoColaborador.getColaborador(idTemplate, colaborador); | |
| 631 | + } | |
| 632 | + | |
| 633 | + public void registrarColaborador(Long idTemplate, String usuario){ | |
| 634 | + Colaborador colaborador = new Colaborador(); | |
| 635 | + | |
| 636 | + colaborador.setUsuario(usuario); | |
| 637 | + colaborador.setEditor(true); | |
| 638 | + colaborador.setIdTemplate(idTemplate); | |
| 639 | + | |
| 640 | + daoColaborador.merge(colaborador); | |
| 641 | + } | |
| 642 | +} | ... | ... |
src/main/java/br/gov/ans/templates/rest/TemplatesService.java
0 → 100644
| ... | ... | @@ -0,0 +1,89 @@ |
| 1 | +package br.gov.ans.templates.to; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +import javax.xml.bind.annotation.XmlRootElement; | |
| 6 | + | |
| 7 | +@XmlRootElement | |
| 8 | +public class Template { | |
| 9 | + private String nome; | |
| 10 | + private String descricao; | |
| 11 | + private Boolean restrito; | |
| 12 | + private String exemplo; | |
| 13 | + private String corpo; | |
| 14 | + private String responsavel; | |
| 15 | + private Date data; | |
| 16 | + | |
| 17 | + public Template(){ | |
| 18 | + } | |
| 19 | + | |
| 20 | + public Template(br.gov.ans.templates.modelo.Template template){ | |
| 21 | + setNome(template.getNome()); | |
| 22 | + setDescricao(template.getDescricao()); | |
| 23 | + setRestrito(template.getRestrito()); | |
| 24 | + setExemplo(template.getExemplo()); | |
| 25 | + setCorpo(new String(template.getCorpo())); | |
| 26 | + setResponsavel(template.getResponsavel()); | |
| 27 | + setData(template.getDataCadastro()); | |
| 28 | + } | |
| 29 | + | |
| 30 | + public String getNome() { | |
| 31 | + return nome; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public void setNome(String nome) { | |
| 35 | + this.nome = nome; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public String getDescricao() { | |
| 39 | + return descricao; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public void setDescricao(String descricao) { | |
| 43 | + this.descricao = descricao; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public Boolean getRestrito() { | |
| 47 | + if(restrito == null){ | |
| 48 | + return false; | |
| 49 | + } | |
| 50 | + | |
| 51 | + return restrito; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public void setRestrito(Boolean restrito) { | |
| 55 | + this.restrito = restrito; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public String getExemplo() { | |
| 59 | + return exemplo; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public void setExemplo(String exemplo) { | |
| 63 | + this.exemplo = exemplo; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public String getCorpo() { | |
| 67 | + return corpo; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public void setCorpo(String corpo) { | |
| 71 | + this.corpo = corpo; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public String getResponsavel() { | |
| 75 | + return responsavel; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public void setResponsavel(String responsavel) { | |
| 79 | + this.responsavel = responsavel; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public Date getData() { | |
| 83 | + return data; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public void setData(Date data) { | |
| 87 | + this.data = data; | |
| 88 | + } | |
| 89 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +package br.gov.ans.templates.util; | |
| 2 | + | |
| 3 | +import java.util.HashMap; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +import javax.persistence.Query; | |
| 7 | + | |
| 8 | +public class DAOUtils { | |
| 9 | + @SuppressWarnings("rawtypes") | |
| 10 | + public static void setParametrosQuery(Query query, HashMap<String, Object> parametros){ | |
| 11 | + if ((parametros != null) && (!parametros.isEmpty())) { | |
| 12 | + for (Map.Entry entry : parametros.entrySet()) { | |
| 13 | + query.setParameter((String) entry.getKey(),entry.getValue()); | |
| 14 | + } | |
| 15 | + } | |
| 16 | + } | |
| 17 | + | |
| 18 | + public static void setPaginacaoQuery(Query query, Integer pagina, Integer qtdRegistros){ | |
| 19 | + if(qtdRegistros == null){ | |
| 20 | + qtdRegistros = Constantes.TAMANHO_PAGINA_PADRAO; | |
| 21 | + } | |
| 22 | + | |
| 23 | + if(pagina == null){ | |
| 24 | + pagina = 1; | |
| 25 | + } | |
| 26 | + | |
| 27 | + int firstResult = ((pagina - 1)* qtdRegistros); | |
| 28 | + query.setFirstResult(firstResult); | |
| 29 | + query.setMaxResults(qtdRegistros); | |
| 30 | + } | |
| 31 | +} | ... | ... |
src/main/java/br/gov/ans/templates/util/TemplatesUtils.java
0 → 100644
| ... | ... | @@ -0,0 +1,28 @@ |
| 1 | +package br.gov.ans.templates.util; | |
| 2 | + | |
| 3 | +import java.net.URI; | |
| 4 | + | |
| 5 | +import javax.ws.rs.core.UriBuilder; | |
| 6 | +import javax.ws.rs.core.UriInfo; | |
| 7 | + | |
| 8 | +import br.gov.ans.exceptions.BusinessException; | |
| 9 | + | |
| 10 | + | |
| 11 | +public class TemplatesUtils { | |
| 12 | + | |
| 13 | + public static URI getResourcePath(UriInfo uriInfo,String resourceId){ | |
| 14 | + UriBuilder builder = uriInfo.getAbsolutePathBuilder(); | |
| 15 | + | |
| 16 | + builder.path(resourceId); | |
| 17 | + | |
| 18 | + return builder.build(); | |
| 19 | + } | |
| 20 | + | |
| 21 | + public static Integer parseInt(String valor) throws BusinessException{ | |
| 22 | + try{ | |
| 23 | + return Integer.parseInt(valor); | |
| 24 | + }catch(Exception e){ | |
| 25 | + throw new BusinessException("O valor '"+valor+"' não pode ser convertido para int."); | |
| 26 | + } | |
| 27 | + } | |
| 28 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,41 @@ |
| 1 | +package br.gov.ans.utils; | |
| 2 | + | |
| 3 | +import javax.servlet.http.HttpServletRequest; | |
| 4 | +import javax.ws.rs.core.HttpHeaders; | |
| 5 | +import javax.ws.rs.core.MediaType; | |
| 6 | + | |
| 7 | +import org.apache.commons.lang3.StringUtils; | |
| 8 | +import org.jboss.logging.Logger; | |
| 9 | + | |
| 10 | +public class HttpHeadersUtil { | |
| 11 | + | |
| 12 | + private static Logger logger = Logger.getLogger(HttpHeadersUtil.class); | |
| 13 | + | |
| 14 | + public static String getAcceptType(HttpHeaders headers){ | |
| 15 | + try{ | |
| 16 | + String accept = headers.getRequestHeader("Accept").get(0); | |
| 17 | + | |
| 18 | + if(!StringUtils.isBlank(accept)&& StringUtils.contains(accept, MediaType.APPLICATION_XML)){ | |
| 19 | + return MediaType.APPLICATION_XML; | |
| 20 | + } | |
| 21 | + }catch(Exception e){ | |
| 22 | + logger.warn("Não foi encontrado o campo Accept na requisição, respondendo com JSON."); | |
| 23 | + } | |
| 24 | + | |
| 25 | + return MediaType.APPLICATION_JSON; | |
| 26 | + } | |
| 27 | + | |
| 28 | + public static String getAcceptType(HttpServletRequest request){ | |
| 29 | + try{ | |
| 30 | + String accept = request.getHeader("Accept"); | |
| 31 | + | |
| 32 | + if(!StringUtils.isBlank(accept)&& StringUtils.contains(accept, MediaType.APPLICATION_XML)){ | |
| 33 | + return MediaType.APPLICATION_XML; | |
| 34 | + } | |
| 35 | + }catch(Exception e){ | |
| 36 | + logger.warn("Não foi encontrado o campo Accept na requisição, respondendo com JSON."); | |
| 37 | + } | |
| 38 | + | |
| 39 | + return MediaType.APPLICATION_JSON; | |
| 40 | + } | |
| 41 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,47 @@ |
| 1 | +package br.gov.ans.utils; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.Serializable; | |
| 5 | +import java.text.MessageFormat; | |
| 6 | +import java.util.Properties; | |
| 7 | + | |
| 8 | +import javax.enterprise.context.ApplicationScoped; | |
| 9 | +import javax.inject.Inject; | |
| 10 | + | |
| 11 | +import br.gov.ans.factories.qualifiers.PropertiesInfo; | |
| 12 | + | |
| 13 | +@ApplicationScoped | |
| 14 | +public class MessageUtils implements Serializable{ | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * | |
| 18 | + */ | |
| 19 | + private static final long serialVersionUID = 1L; | |
| 20 | + | |
| 21 | + @ApplicationScoped | |
| 22 | + @Inject | |
| 23 | + @PropertiesInfo(file="messages.properties") | |
| 24 | + private Properties properties; | |
| 25 | + | |
| 26 | + public MessageUtils(){ | |
| 27 | + } | |
| 28 | + | |
| 29 | + public MessageUtils(Properties properties){ | |
| 30 | + this.properties = properties; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public static MessageUtils build() throws IOException{ | |
| 34 | + Properties properties = new Properties(); | |
| 35 | + properties.load(MessageUtils.class.getClassLoader().getResourceAsStream("messages.properties")); | |
| 36 | + | |
| 37 | + return new MessageUtils(properties); | |
| 38 | + } | |
| 39 | + | |
| 40 | + public String getMessage(String key){ | |
| 41 | + return (String) properties.get(key); | |
| 42 | + } | |
| 43 | + | |
| 44 | + public String getMessage(String key, Object... args){ | |
| 45 | + return MessageFormat.format(getMessage(key), args); | |
| 46 | + } | |
| 47 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 3 | + xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> | |
| 4 | + | |
| 5 | + <persistence-unit name="templates_broker_pu" transaction-type="JTA"> | |
| 6 | + <provider>org.hibernate.ejb.HibernatePersistence</provider> | |
| 7 | + | |
| 8 | + <jta-data-source>jdbc/templates</jta-data-source> | |
| 9 | +<!-- <exclude-unlisted-classes>true</exclude-unlisted-classes> --> | |
| 10 | + | |
| 11 | + <class>br.gov.ans.templates.modelo.Colaborador</class> | |
| 12 | + <class>br.gov.ans.templates.modelo.Template</class> | |
| 13 | + <class>br.gov.ans.templates.modelo.Versao</class> | |
| 14 | + | |
| 15 | + | |
| 16 | + <properties> | |
| 17 | + <property name="hibernate.show_sql" value="false"/> | |
| 18 | + <property name="hibernate.format_sql" value="true"/> | |
| 19 | + <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle12cDialect"/> | |
| 20 | + </properties> | |
| 21 | + </persistence-unit> | |
| 22 | +</persistence> | ... | ... |
| ... | ... | @@ -0,0 +1,6 @@ |
| 1 | +erro.colaborador.nao.encontrado = O usuário {0} não é um colaborador deste template. | |
| 2 | +erro.interno = Ocorreu um erro interno no templates-broker, contacte os responsáveis. | |
| 3 | +erro.template.existente = Já existe um template identificado com o nome {0}. | |
| 4 | +erro.template.nao.encontrado = Template {0} não encontrado. | |
| 5 | +erro.validar = Erro ao validar - | |
| 6 | +templates.nao.encontrados.filtro = Não foram encontrados templates para o filtro {0}. | ... | ... |
| ... | ... | @@ -0,0 +1,5 @@ |
| 1 | +<?xml version="1.0"?> | |
| 2 | +<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 3 | + xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd" | |
| 4 | + bean-discovery-mode="all"> | |
| 5 | +</beans> | ... | ... |
| ... | ... | @@ -0,0 +1,161 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 3 | + xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee" | |
| 4 | + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" | |
| 5 | + version="3.0"> | |
| 6 | + <display-name>templates-broker</display-name> | |
| 7 | + <context-param> | |
| 8 | + <param-name>PARAMETER_ENCODING</param-name> | |
| 9 | + <param-value>UTF-8</param-value> | |
| 10 | + </context-param> | |
| 11 | + | |
| 12 | + <context-param> | |
| 13 | + <param-name>resteasy.scan</param-name> | |
| 14 | + <param-value>true</param-value> | |
| 15 | + </context-param> | |
| 16 | + | |
| 17 | + <servlet> | |
| 18 | + <servlet-name>Jersey2Config</servlet-name> | |
| 19 | + <servlet-class>io.swagger.jaxrs.config.DefaultJaxrsConfig</servlet-class> | |
| 20 | + <init-param> | |
| 21 | + <param-name>api.version</param-name> | |
| 22 | + <param-value>1.0.0</param-value> | |
| 23 | + </init-param> | |
| 24 | + <init-param> | |
| 25 | + <param-name>swagger.api.basepath</param-name> | |
| 26 | + <param-value>http://localhost:8080/templates-broker/service</param-value> | |
| 27 | + </init-param> | |
| 28 | + <load-on-startup>2</load-on-startup> | |
| 29 | + </servlet> | |
| 30 | + | |
| 31 | + | |
| 32 | + <login-config> | |
| 33 | + <auth-method>BASIC</auth-method> | |
| 34 | + </login-config> | |
| 35 | + | |
| 36 | + <security-constraint> | |
| 37 | + <display-name>Métodos de escrita dos templates</display-name> | |
| 38 | + <web-resource-collection> | |
| 39 | + <web-resource-name>Métodos de edição</web-resource-name> | |
| 40 | + <url-pattern>/service/*</url-pattern> | |
| 41 | + <http-method>DELETE</http-method> | |
| 42 | + <http-method>POST</http-method> | |
| 43 | + <http-method>PUT</http-method> | |
| 44 | + </web-resource-collection> | |
| 45 | + <auth-constraint> | |
| 46 | + <role-name>RO_ADMIN_TEMPLATE</role-name> | |
| 47 | + </auth-constraint> | |
| 48 | + </security-constraint> | |
| 49 | + | |
| 50 | + <security-constraint> | |
| 51 | + <display-name>Métodos de consulta aos Templates</display-name> | |
| 52 | + <web-resource-collection> | |
| 53 | + <web-resource-name>Métodos de consulta</web-resource-name> | |
| 54 | + <url-pattern>/service/templates/*</url-pattern> | |
| 55 | + <http-method>GET</http-method> | |
| 56 | + </web-resource-collection> | |
| 57 | + <auth-constraint> | |
| 58 | + <role-name>RO_USUARIO_TEMPLATE</role-name> | |
| 59 | + <role-name>RO_ADMIN_TEMPLATE</role-name> | |
| 60 | + </auth-constraint> | |
| 61 | + </security-constraint> | |
| 62 | + | |
| 63 | + <security-constraint> | |
| 64 | + <display-name>Serviço Rest de Apoio</display-name> | |
| 65 | + <web-resource-collection> | |
| 66 | + <web-resource-name>Serviço de verificação da versão</web-resource-name> | |
| 67 | + <url-pattern>/service/info/*</url-pattern> | |
| 68 | + <url-pattern>/service/resteasy/*</url-pattern> | |
| 69 | + <http-method>GET</http-method> | |
| 70 | + </web-resource-collection> | |
| 71 | + </security-constraint> | |
| 72 | + | |
| 73 | + <security-role> | |
| 74 | + <role-name>RO_ADMIN_TEMPLATE</role-name> | |
| 75 | + </security-role> | |
| 76 | + | |
| 77 | + <security-role> | |
| 78 | + <role-name>RO_USUARIO_TEMPLATE</role-name> | |
| 79 | + </security-role> | |
| 80 | + | |
| 81 | + <servlet> | |
| 82 | + <servlet-name>WADL</servlet-name> | |
| 83 | + <servlet-class>org.jboss.resteasy.wadl.ResteasyWadlServlet</servlet-class> | |
| 84 | + </servlet> | |
| 85 | + | |
| 86 | + <servlet-mapping> | |
| 87 | + <servlet-name>WADL</servlet-name> | |
| 88 | + <url-pattern>/application.wadl</url-pattern> | |
| 89 | + </servlet-mapping> | |
| 90 | + | |
| 91 | + | |
| 92 | + <servlet> | |
| 93 | + <servlet-name>LoginExceptionHandler</servlet-name> | |
| 94 | + <servlet-class>br.gov.ans.exceptions.handlers.LoginExceptionHandler</servlet-class> | |
| 95 | + </servlet> | |
| 96 | + | |
| 97 | + <servlet-mapping> | |
| 98 | + <servlet-name>LoginExceptionHandler</servlet-name> | |
| 99 | + <url-pattern>/loginExceptionHandler</url-pattern> | |
| 100 | + </servlet-mapping> | |
| 101 | + | |
| 102 | + <!-- ExceptionsHandles para erros fora do contexto do RESTEasy --> | |
| 103 | + <error-page> | |
| 104 | + <error-code>401</error-code> | |
| 105 | + <location>/loginExceptionHandler?code=401</location> | |
| 106 | + </error-page> | |
| 107 | + <error-page> | |
| 108 | + <error-code>403</error-code> | |
| 109 | + <location>/loginExceptionHandler?code=403</location> | |
| 110 | + </error-page> | |
| 111 | + | |
| 112 | + <!-- Declaração dos ExceptionHandlers --> | |
| 113 | +<!-- <context-param> --> | |
| 114 | +<!-- <param-name>resteasy.businessExceptionHandler</param-name> --> | |
| 115 | +<!-- <param-value>br.gov.ans.exceptions.handlers.BusinessExceptionHandler</param-value> --> | |
| 116 | +<!-- </context-param> --> | |
| 117 | +<!-- <context-param> --> | |
| 118 | +<!-- <param-name>resteasy.EJBTransactionRolledbackExceptionHandler</param-name> --> | |
| 119 | +<!-- <param-value>br.gov.ans.exceptions.handlers.EJBTransactionRolledbackExceptionHandler</param-value> --> | |
| 120 | +<!-- </context-param> --> | |
| 121 | +<!-- <context-param> --> | |
| 122 | +<!-- <param-name>resteasy.notAllowedExceptionHandler</param-name> --> | |
| 123 | +<!-- <param-value>br.gov.ans.exceptions.handlers.NotAllowedExceptionHandler</param-value> --> | |
| 124 | +<!-- </context-param> --> | |
| 125 | +<!-- <context-param> --> | |
| 126 | +<!-- <param-name>resteasy.notAcceptableExceptionHandler</param-name> --> | |
| 127 | +<!-- <param-value>br.gov.ans.exceptions.handlers.NotAcceptableExceptionHandler</param-value> --> | |
| 128 | +<!-- </context-param> --> | |
| 129 | +<!-- <context-param> --> | |
| 130 | +<!-- <param-name>resteasy.ejbAccessExceptionHandler</param-name> --> | |
| 131 | +<!-- <param-value>br.gov.ans.exceptions.handlers.EJBAccessExceptionHandler</param-value> --> | |
| 132 | +<!-- </context-param> --> | |
| 133 | +<!-- <context-param> --> | |
| 134 | +<!-- <param-name>resteasy.notFoundExceptionHandler</param-name> --> | |
| 135 | +<!-- <param-value>br.gov.ans.exceptions.handlers.NotFoundExceptionHandler</param-value> --> | |
| 136 | +<!-- </context-param> --> | |
| 137 | +<!-- <context-param> --> | |
| 138 | +<!-- <param-name>resteasy.exceptionHandler</param-name> --> | |
| 139 | +<!-- <param-value>br.gov.ans.exceptions.handlers.ExceptionHandler</param-value> --> | |
| 140 | +<!-- </context-param> --> | |
| 141 | +<!-- <context-param> --> | |
| 142 | +<!-- <param-name>resteasy.notAuthorizedExceptionHandler</param-name> --> | |
| 143 | +<!-- <param-value>br.gov.ans.exceptions.handlers.NotAuthorizedExceptionHandler</param-value> --> | |
| 144 | +<!-- </context-param> --> | |
| 145 | +<!-- <context-param> --> | |
| 146 | +<!-- <param-name>resteasy.forbiddenException</param-name> --> | |
| 147 | +<!-- <param-value>br.gov.ans.exceptions.handlers.ForbiddenException</param-value> --> | |
| 148 | +<!-- </context-param> --> | |
| 149 | +<!-- <context-param> --> | |
| 150 | +<!-- <param-name>resteasy.webApplicationException</param-name> --> | |
| 151 | +<!-- <param-value>br.gov.ans.exceptions.handlers.WebApplicationException</param-value> --> | |
| 152 | +<!-- </context-param> --> | |
| 153 | +<!-- <context-param> --> | |
| 154 | +<!-- <param-name>resteasy.wrappedExceptionHandler</param-name> --> | |
| 155 | +<!-- <param-value>br.gov.ans.exceptions.handlers.WrappedExceptionHandler</param-value> --> | |
| 156 | +<!-- </context-param> --> | |
| 157 | +<!-- <context-param> --> | |
| 158 | +<!-- <param-name>resteasy.resourceNotFoundExceptionHandler</param-name> --> | |
| 159 | +<!-- <param-value>br.gov.ans.exceptions.handlers.ResourceNotFoundExceptionHandler</param-value> --> | |
| 160 | +<!-- </context-param> --> | |
| 161 | +</web-app> | |
| 0 | 162 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,1074 @@ |
| 1 | +define({ "api": [ | |
| 2 | + { | |
| 3 | + "success": { | |
| 4 | + "fields": { | |
| 5 | + "Success 200": [ | |
| 6 | + { | |
| 7 | + "group": "Success 200", | |
| 8 | + "optional": false, | |
| 9 | + "field": "varname1", | |
| 10 | + "description": "<p>No type.</p>" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "group": "Success 200", | |
| 14 | + "type": "String", | |
| 15 | + "optional": false, | |
| 16 | + "field": "varname2", | |
| 17 | + "description": "<p>With type.</p>" | |
| 18 | + } | |
| 19 | + ] | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + "type": "", | |
| 23 | + "url": "", | |
| 24 | + "version": "0.0.0", | |
| 25 | + "filename": "templates-broker/src/main/webapp/api-docs/main.js", | |
| 26 | + "group": "C__ANS_ans_templates_templates_broker_src_main_webapp_api_docs_main_js", | |
| 27 | + "groupTitle": "C__ANS_ans_templates_templates_broker_src_main_webapp_api_docs_main_js", | |
| 28 | + "name": "" | |
| 29 | + }, | |
| 30 | + { | |
| 31 | + "success": { | |
| 32 | + "fields": { | |
| 33 | + "Success 200": [ | |
| 34 | + { | |
| 35 | + "group": "Success 200", | |
| 36 | + "optional": false, | |
| 37 | + "field": "varname1", | |
| 38 | + "description": "<p>No type.</p>" | |
| 39 | + }, | |
| 40 | + { | |
| 41 | + "group": "Success 200", | |
| 42 | + "type": "String", | |
| 43 | + "optional": false, | |
| 44 | + "field": "varname2", | |
| 45 | + "description": "<p>With type.</p>" | |
| 46 | + } | |
| 47 | + ] | |
| 48 | + } | |
| 49 | + }, | |
| 50 | + "type": "", | |
| 51 | + "url": "", | |
| 52 | + "version": "0.0.0", | |
| 53 | + "filename": "templates-broker/target/templates-broker-0.1/api-docs/main.js", | |
| 54 | + "group": "C__ANS_ans_templates_templates_broker_target_templates_broker_0_1_api_docs_main_js", | |
| 55 | + "groupTitle": "C__ANS_ans_templates_templates_broker_target_templates_broker_0_1_api_docs_main_js", | |
| 56 | + "name": "" | |
| 57 | + }, | |
| 58 | + { | |
| 59 | + "type": "post", | |
| 60 | + "url": "/templates/:template/colaboradores", | |
| 61 | + "title": "Adicionar colaborador", | |
| 62 | + "name": "addColaborador", | |
| 63 | + "group": "Colaborador", | |
| 64 | + "version": "1.0.0", | |
| 65 | + "permission": [ | |
| 66 | + { | |
| 67 | + "name": "RO_ADMIN_TEMPLATE" | |
| 68 | + } | |
| 69 | + ], | |
| 70 | + "description": "<p>Adiciona um colaborador ao template.</p>", | |
| 71 | + "parameter": { | |
| 72 | + "fields": { | |
| 73 | + "Path Parameters": [ | |
| 74 | + { | |
| 75 | + "group": "Path Parameters", | |
| 76 | + "type": "String", | |
| 77 | + "optional": false, | |
| 78 | + "field": "template", | |
| 79 | + "description": "<p>Identificador do template</p>" | |
| 80 | + } | |
| 81 | + ] | |
| 82 | + } | |
| 83 | + }, | |
| 84 | + "examples": [ | |
| 85 | + { | |
| 86 | + "title": "Exemplo de requisição:\t", | |
| 87 | + "content": "\tendpoint: [POST] http://<host>/templates-broker/service/templates/confirmacao-cadastro/colaboradores\n\n\tbody:\n {\n \"usuario\": \"andre.guimaraes\",\n \"editor\": true\n }", | |
| 88 | + "type": "json" | |
| 89 | + } | |
| 90 | + ], | |
| 91 | + "success": { | |
| 92 | + "fields": { | |
| 93 | + "Sucesso - 201": [ | |
| 94 | + { | |
| 95 | + "group": "Sucesso - 201", | |
| 96 | + "type": "header", | |
| 97 | + "optional": false, | |
| 98 | + "field": "Location", | |
| 99 | + "description": "<p>Caminho para o recurso criado.</p>" | |
| 100 | + } | |
| 101 | + ] | |
| 102 | + }, | |
| 103 | + "examples": [ | |
| 104 | + { | |
| 105 | + "title": "Success-Response:", | |
| 106 | + "content": "HTTP/1.1 201 Created", | |
| 107 | + "type": "json" | |
| 108 | + } | |
| 109 | + ] | |
| 110 | + }, | |
| 111 | + "error": { | |
| 112 | + "examples": [ | |
| 113 | + { | |
| 114 | + "title": "Error-Response:", | |
| 115 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 116 | + "type": "json" | |
| 117 | + } | |
| 118 | + ] | |
| 119 | + }, | |
| 120 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 121 | + "groupTitle": "Colaborador" | |
| 122 | + }, | |
| 123 | + { | |
| 124 | + "type": "get", | |
| 125 | + "url": "/templates/:template/colaboradores/:colaborador", | |
| 126 | + "title": "Consultar colaborador", | |
| 127 | + "name": "getColaborador", | |
| 128 | + "group": "Colaborador", | |
| 129 | + "version": "1.0.0", | |
| 130 | + "permission": [ | |
| 131 | + { | |
| 132 | + "name": "RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE" | |
| 133 | + } | |
| 134 | + ], | |
| 135 | + "description": "<p>Consulta um colaborador.</p>", | |
| 136 | + "parameter": { | |
| 137 | + "fields": { | |
| 138 | + "Path Parameters": [ | |
| 139 | + { | |
| 140 | + "group": "Path Parameters", | |
| 141 | + "type": "String", | |
| 142 | + "optional": false, | |
| 143 | + "field": "template", | |
| 144 | + "description": "<p>Identificador do template</p>" | |
| 145 | + }, | |
| 146 | + { | |
| 147 | + "group": "Path Parameters", | |
| 148 | + "type": "String", | |
| 149 | + "optional": false, | |
| 150 | + "field": "colaborador", | |
| 151 | + "description": "<p>Identificador do colaborador</p>" | |
| 152 | + } | |
| 153 | + ] | |
| 154 | + } | |
| 155 | + }, | |
| 156 | + "examples": [ | |
| 157 | + { | |
| 158 | + "title": "Exemplo de requisição:\t", | |
| 159 | + "content": "curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro/colaboradores/andre.guimaraes", | |
| 160 | + "type": "json" | |
| 161 | + } | |
| 162 | + ], | |
| 163 | + "success": { | |
| 164 | + "fields": { | |
| 165 | + "Sucesso - 200": [ | |
| 166 | + { | |
| 167 | + "group": "Sucesso - 200", | |
| 168 | + "type": "Colaborador", | |
| 169 | + "optional": false, | |
| 170 | + "field": "colaborador", | |
| 171 | + "description": "<p>Objeto representando um colaborador.</p>" | |
| 172 | + }, | |
| 173 | + { | |
| 174 | + "group": "Sucesso - 200", | |
| 175 | + "type": "String", | |
| 176 | + "optional": false, | |
| 177 | + "field": "colaborador.usuario", | |
| 178 | + "description": "<p>Identificador do colaborador.</p>" | |
| 179 | + }, | |
| 180 | + { | |
| 181 | + "group": "Sucesso - 200", | |
| 182 | + "type": "Boolean", | |
| 183 | + "optional": false, | |
| 184 | + "field": "colaborador.editor", | |
| 185 | + "description": "<p>Flag que determina se o colaborador tem o poder para editar o template.</p>" | |
| 186 | + } | |
| 187 | + ] | |
| 188 | + }, | |
| 189 | + "examples": [ | |
| 190 | + { | |
| 191 | + "title": "Success-Response:", | |
| 192 | + "content": "HTTP/1.1 200 OK\n{\n \"editor\": true,\n \"usuario\": \"andre.guimaraes\"\n}", | |
| 193 | + "type": "json" | |
| 194 | + } | |
| 195 | + ] | |
| 196 | + }, | |
| 197 | + "error": { | |
| 198 | + "examples": [ | |
| 199 | + { | |
| 200 | + "title": "Error-Response:", | |
| 201 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 202 | + "type": "json" | |
| 203 | + } | |
| 204 | + ] | |
| 205 | + }, | |
| 206 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 207 | + "groupTitle": "Colaborador" | |
| 208 | + }, | |
| 209 | + { | |
| 210 | + "type": "get", | |
| 211 | + "url": "/templates/:template/colaboradores", | |
| 212 | + "title": "Listar colaboradores", | |
| 213 | + "name": "getColaboradores", | |
| 214 | + "group": "Colaborador", | |
| 215 | + "version": "1.0.0", | |
| 216 | + "permission": [ | |
| 217 | + { | |
| 218 | + "name": "RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE" | |
| 219 | + } | |
| 220 | + ], | |
| 221 | + "description": "<p>Consulta os colaboradores do template.</p>", | |
| 222 | + "parameter": { | |
| 223 | + "fields": { | |
| 224 | + "Path Parameters": [ | |
| 225 | + { | |
| 226 | + "group": "Path Parameters", | |
| 227 | + "type": "String", | |
| 228 | + "optional": false, | |
| 229 | + "field": "template", | |
| 230 | + "description": "<p>Identificador do template</p>" | |
| 231 | + } | |
| 232 | + ], | |
| 233 | + "Query Parameters": [ | |
| 234 | + { | |
| 235 | + "group": "Query Parameters", | |
| 236 | + "type": "String", | |
| 237 | + "optional": true, | |
| 238 | + "field": "itens", | |
| 239 | + "defaultValue": "20", | |
| 240 | + "description": "<p>Quantidade de templates que serão exibidos</p>" | |
| 241 | + }, | |
| 242 | + { | |
| 243 | + "group": "Query Parameters", | |
| 244 | + "type": "String", | |
| 245 | + "optional": true, | |
| 246 | + "field": "pag", | |
| 247 | + "defaultValue": "1", | |
| 248 | + "description": "<p>Número da página</p>" | |
| 249 | + } | |
| 250 | + ] | |
| 251 | + } | |
| 252 | + }, | |
| 253 | + "examples": [ | |
| 254 | + { | |
| 255 | + "title": "Exemplo de requisição:\t", | |
| 256 | + "content": "curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro/colaboradores", | |
| 257 | + "type": "json" | |
| 258 | + } | |
| 259 | + ], | |
| 260 | + "success": { | |
| 261 | + "fields": { | |
| 262 | + "Sucesso - 200": [ | |
| 263 | + { | |
| 264 | + "group": "Sucesso - 200", | |
| 265 | + "type": "List", | |
| 266 | + "optional": false, | |
| 267 | + "field": "resultado", | |
| 268 | + "description": "<p>Lista com os colaboradores do template.</p>" | |
| 269 | + }, | |
| 270 | + { | |
| 271 | + "group": "Sucesso - 200", | |
| 272 | + "type": "Colaborador", | |
| 273 | + "optional": false, | |
| 274 | + "field": "resultado.colaborador", | |
| 275 | + "description": "<p>Objeto representando um colaborador.</p>" | |
| 276 | + }, | |
| 277 | + { | |
| 278 | + "group": "Sucesso - 200", | |
| 279 | + "type": "String", | |
| 280 | + "optional": false, | |
| 281 | + "field": "resultado.colaborador.usuario", | |
| 282 | + "description": "<p>Identificador do colaborador.</p>" | |
| 283 | + }, | |
| 284 | + { | |
| 285 | + "group": "Sucesso - 200", | |
| 286 | + "type": "Boolean", | |
| 287 | + "optional": false, | |
| 288 | + "field": "resultado.colaborador.editor", | |
| 289 | + "description": "<p>Flag que determina se o colaborador tem o poder para editar o template.</p>" | |
| 290 | + } | |
| 291 | + ] | |
| 292 | + }, | |
| 293 | + "examples": [ | |
| 294 | + { | |
| 295 | + "title": "Success-Response:", | |
| 296 | + "content": "HTTP/1.1 200 OK\n{\n \"editor\": true,\n \"usuario\": \"andre.guimaraes\",\n}", | |
| 297 | + "type": "json" | |
| 298 | + } | |
| 299 | + ] | |
| 300 | + }, | |
| 301 | + "error": { | |
| 302 | + "examples": [ | |
| 303 | + { | |
| 304 | + "title": "Error-Response:", | |
| 305 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 306 | + "type": "json" | |
| 307 | + } | |
| 308 | + ] | |
| 309 | + }, | |
| 310 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 311 | + "groupTitle": "Colaborador" | |
| 312 | + }, | |
| 313 | + { | |
| 314 | + "type": "delete", | |
| 315 | + "url": "/templates/:template/colaboradores/:colaborador", | |
| 316 | + "title": "Remover colaborador", | |
| 317 | + "name": "removeColaborador", | |
| 318 | + "group": "Colaborador", | |
| 319 | + "version": "1.0.0", | |
| 320 | + "permission": [ | |
| 321 | + { | |
| 322 | + "name": "RO_ADMIN_TEMPLATE" | |
| 323 | + } | |
| 324 | + ], | |
| 325 | + "description": "<p>Remove colaborador de um template.</p>", | |
| 326 | + "parameter": { | |
| 327 | + "fields": { | |
| 328 | + "Path Parameters": [ | |
| 329 | + { | |
| 330 | + "group": "Path Parameters", | |
| 331 | + "type": "String", | |
| 332 | + "optional": false, | |
| 333 | + "field": "template", | |
| 334 | + "description": "<p>Identificador do template</p>" | |
| 335 | + }, | |
| 336 | + { | |
| 337 | + "group": "Path Parameters", | |
| 338 | + "type": "String", | |
| 339 | + "optional": false, | |
| 340 | + "field": "colaborador", | |
| 341 | + "description": "<p>Identificador do colaborador</p>" | |
| 342 | + } | |
| 343 | + ] | |
| 344 | + } | |
| 345 | + }, | |
| 346 | + "examples": [ | |
| 347 | + { | |
| 348 | + "title": "Exemplo de requisição:\t", | |
| 349 | + "content": "curl -X DELETE http://<host>/templates-broker/service/templates/confirmacao-cadastro/colaboradores/andre.guimaraes", | |
| 350 | + "type": "json" | |
| 351 | + } | |
| 352 | + ], | |
| 353 | + "success": { | |
| 354 | + "examples": [ | |
| 355 | + { | |
| 356 | + "title": "Success-Response:", | |
| 357 | + "content": "HTTP/1.1 200 OK", | |
| 358 | + "type": "json" | |
| 359 | + } | |
| 360 | + ] | |
| 361 | + }, | |
| 362 | + "error": { | |
| 363 | + "examples": [ | |
| 364 | + { | |
| 365 | + "title": "Error-Response:", | |
| 366 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 367 | + "type": "json" | |
| 368 | + } | |
| 369 | + ] | |
| 370 | + }, | |
| 371 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 372 | + "groupTitle": "Colaborador" | |
| 373 | + }, | |
| 374 | + { | |
| 375 | + "type": "post", | |
| 376 | + "url": "/templates", | |
| 377 | + "title": "Adicionar template", | |
| 378 | + "name": "createTemplate", | |
| 379 | + "group": "Template", | |
| 380 | + "version": "1.0.0", | |
| 381 | + "permission": [ | |
| 382 | + { | |
| 383 | + "name": "RO_ADMIN_TEMPLATE" | |
| 384 | + } | |
| 385 | + ], | |
| 386 | + "description": "<p>Cria um novo template.</p>", | |
| 387 | + "parameter": { | |
| 388 | + "fields": { | |
| 389 | + "Request Body": [ | |
| 390 | + { | |
| 391 | + "group": "Request Body", | |
| 392 | + "type": "Template", | |
| 393 | + "optional": false, | |
| 394 | + "field": "template", | |
| 395 | + "description": "<p>Objeto de representação do template.</p>" | |
| 396 | + }, | |
| 397 | + { | |
| 398 | + "group": "Request Body", | |
| 399 | + "type": "String", | |
| 400 | + "optional": false, | |
| 401 | + "field": "corpo", | |
| 402 | + "description": "<p>Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados.</p>" | |
| 403 | + }, | |
| 404 | + { | |
| 405 | + "group": "Request Body", | |
| 406 | + "type": "String", | |
| 407 | + "optional": false, | |
| 408 | + "field": "descricao", | |
| 409 | + "description": "<p>Descrição do template.</p>" | |
| 410 | + }, | |
| 411 | + { | |
| 412 | + "group": "Request Body", | |
| 413 | + "type": "String", | |
| 414 | + "optional": false, | |
| 415 | + "field": "exemplo", | |
| 416 | + "description": "<p>Exemplo de request para preenchimento do template.</p>" | |
| 417 | + }, | |
| 418 | + { | |
| 419 | + "group": "Request Body", | |
| 420 | + "type": "String", | |
| 421 | + "optional": false, | |
| 422 | + "field": "nome", | |
| 423 | + "description": "<p>Identificador do template.</p>" | |
| 424 | + }, | |
| 425 | + { | |
| 426 | + "group": "Request Body", | |
| 427 | + "type": "String", | |
| 428 | + "optional": false, | |
| 429 | + "field": "responsavel", | |
| 430 | + "description": "<p>Analista responsável pelo template.</p>" | |
| 431 | + }, | |
| 432 | + { | |
| 433 | + "group": "Request Body", | |
| 434 | + "type": "String", | |
| 435 | + "optional": false, | |
| 436 | + "field": "restrito", | |
| 437 | + "description": "<p>Flag identificando se a atualização deste template � restrita.</p>" | |
| 438 | + } | |
| 439 | + ] | |
| 440 | + } | |
| 441 | + }, | |
| 442 | + "examples": [ | |
| 443 | + { | |
| 444 | + "title": "Exemplo de requisição:\t", | |
| 445 | + "content": "\tendpoint: [PUT] http://<host>/templates-broker/service/templates/confirmacao-cadastro\n\n\tbody:\n {\n \"corpo\": \"Prezado {{fulano}}, seu cadastro foi realizado com sucesso.\",\n \"descricao\": \"Template de confirmação de cadastro.\",\n \"exemplo\": \"{\"fulano\":\"André Guimarães\"}\",\n \"nome\": \"confirmacao-cadastro\",\n \"responsavel\": \"andre.guimaraes\",\n \"restrito\": true,\n }", | |
| 446 | + "type": "json" | |
| 447 | + } | |
| 448 | + ], | |
| 449 | + "success": { | |
| 450 | + "fields": { | |
| 451 | + "Sucesso - 201": [ | |
| 452 | + { | |
| 453 | + "group": "Sucesso - 201", | |
| 454 | + "type": "header", | |
| 455 | + "optional": false, | |
| 456 | + "field": "Location", | |
| 457 | + "description": "<p>Caminho para o recurso criado.</p>" | |
| 458 | + } | |
| 459 | + ] | |
| 460 | + }, | |
| 461 | + "examples": [ | |
| 462 | + { | |
| 463 | + "title": "Success-Response:", | |
| 464 | + "content": "HTTP/1.1 201 Created", | |
| 465 | + "type": "json" | |
| 466 | + } | |
| 467 | + ] | |
| 468 | + }, | |
| 469 | + "error": { | |
| 470 | + "examples": [ | |
| 471 | + { | |
| 472 | + "title": "Error-Response:", | |
| 473 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 474 | + "type": "json" | |
| 475 | + } | |
| 476 | + ] | |
| 477 | + }, | |
| 478 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 479 | + "groupTitle": "Template" | |
| 480 | + }, | |
| 481 | + { | |
| 482 | + "type": "delete", | |
| 483 | + "url": "/templates/:template", | |
| 484 | + "title": "Excluir template", | |
| 485 | + "name": "deleteTemplate", | |
| 486 | + "group": "Template", | |
| 487 | + "version": "1.0.0", | |
| 488 | + "permission": [ | |
| 489 | + { | |
| 490 | + "name": "RO_ADMIN_TEMPLATE" | |
| 491 | + } | |
| 492 | + ], | |
| 493 | + "description": "<p>Exclui determinado template.</p>", | |
| 494 | + "parameter": { | |
| 495 | + "fields": { | |
| 496 | + "Path Parameters": [ | |
| 497 | + { | |
| 498 | + "group": "Path Parameters", | |
| 499 | + "type": "String", | |
| 500 | + "optional": false, | |
| 501 | + "field": "template", | |
| 502 | + "description": "<p>Identificador do template</p>" | |
| 503 | + } | |
| 504 | + ] | |
| 505 | + } | |
| 506 | + }, | |
| 507 | + "examples": [ | |
| 508 | + { | |
| 509 | + "title": "Exemplo de requisição:\t", | |
| 510 | + "content": "curl -X DELETE http://<host>/templates-broker/service/templates/confirmacao-cadastro", | |
| 511 | + "type": "json" | |
| 512 | + } | |
| 513 | + ], | |
| 514 | + "success": { | |
| 515 | + "examples": [ | |
| 516 | + { | |
| 517 | + "title": "Success-Response:", | |
| 518 | + "content": "HTTP/1.1 200 OK", | |
| 519 | + "type": "json" | |
| 520 | + } | |
| 521 | + ] | |
| 522 | + }, | |
| 523 | + "error": { | |
| 524 | + "examples": [ | |
| 525 | + { | |
| 526 | + "title": "Error-Response:", | |
| 527 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 528 | + "type": "json" | |
| 529 | + } | |
| 530 | + ] | |
| 531 | + }, | |
| 532 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 533 | + "groupTitle": "Template" | |
| 534 | + }, | |
| 535 | + { | |
| 536 | + "type": "put", | |
| 537 | + "url": "/templates/:template", | |
| 538 | + "title": "Atualizar template", | |
| 539 | + "name": "editTemplate", | |
| 540 | + "group": "Template", | |
| 541 | + "version": "1.0.0", | |
| 542 | + "permission": [ | |
| 543 | + { | |
| 544 | + "name": "RO_ADMIN_TEMPLATE" | |
| 545 | + } | |
| 546 | + ], | |
| 547 | + "description": "<p>Atualiza um template.</p>", | |
| 548 | + "parameter": { | |
| 549 | + "fields": { | |
| 550 | + "Path Parameters": [ | |
| 551 | + { | |
| 552 | + "group": "Path Parameters", | |
| 553 | + "type": "String", | |
| 554 | + "optional": false, | |
| 555 | + "field": "template", | |
| 556 | + "description": "<p>Identificador do template</p>" | |
| 557 | + } | |
| 558 | + ], | |
| 559 | + "Request Body": [ | |
| 560 | + { | |
| 561 | + "group": "Request Body", | |
| 562 | + "type": "Template", | |
| 563 | + "optional": false, | |
| 564 | + "field": "template", | |
| 565 | + "description": "<p>Objeto de representação do template.</p>" | |
| 566 | + }, | |
| 567 | + { | |
| 568 | + "group": "Request Body", | |
| 569 | + "type": "String", | |
| 570 | + "optional": false, | |
| 571 | + "field": "corpo", | |
| 572 | + "description": "<p>Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados.</p>" | |
| 573 | + }, | |
| 574 | + { | |
| 575 | + "group": "Request Body", | |
| 576 | + "type": "String", | |
| 577 | + "optional": false, | |
| 578 | + "field": "descricao", | |
| 579 | + "description": "<p>Descrição do template.</p>" | |
| 580 | + }, | |
| 581 | + { | |
| 582 | + "group": "Request Body", | |
| 583 | + "type": "String", | |
| 584 | + "optional": false, | |
| 585 | + "field": "exemplo", | |
| 586 | + "description": "<p>Exemplo de request para preenchimento do template.</p>" | |
| 587 | + }, | |
| 588 | + { | |
| 589 | + "group": "Request Body", | |
| 590 | + "type": "String", | |
| 591 | + "optional": false, | |
| 592 | + "field": "nome", | |
| 593 | + "description": "<p>Identificador do template.</p>" | |
| 594 | + }, | |
| 595 | + { | |
| 596 | + "group": "Request Body", | |
| 597 | + "type": "String", | |
| 598 | + "optional": false, | |
| 599 | + "field": "responsavel", | |
| 600 | + "description": "<p>Analista responsável pelo template.</p>" | |
| 601 | + }, | |
| 602 | + { | |
| 603 | + "group": "Request Body", | |
| 604 | + "type": "String", | |
| 605 | + "optional": false, | |
| 606 | + "field": "restrito", | |
| 607 | + "description": "<p>Flag identificando se a atualização deste template � restrita.</p>" | |
| 608 | + } | |
| 609 | + ] | |
| 610 | + } | |
| 611 | + }, | |
| 612 | + "examples": [ | |
| 613 | + { | |
| 614 | + "title": "Exemplo de requisição:\t", | |
| 615 | + "content": "\tendpoint: [PUT] http://<host>/templates-broker/service/templates/confirmacao-cadastro\n\n\tbody:\n {\n \"corpo\": \"Prezado {{fulano}}, seu cadastro foi realizado com sucesso.\",\n \"descricao\": \"Template de confirmação de cadastro.\",\n \"exemplo\": \"{\"fulano\":\"André Guimarães\"}\",\n \"nome\": \"confirmacao-cadastro\",\n \"responsavel\": \"andre.guimaraes\",\n \"restrito\": true,\n }", | |
| 616 | + "type": "json" | |
| 617 | + } | |
| 618 | + ], | |
| 619 | + "success": { | |
| 620 | + "fields": { | |
| 621 | + "Sucesso - 200": [ | |
| 622 | + { | |
| 623 | + "group": "Sucesso - 200", | |
| 624 | + "type": "header", | |
| 625 | + "optional": false, | |
| 626 | + "field": "Location", | |
| 627 | + "description": "<p>Caminho para o recurso editado.</p>" | |
| 628 | + } | |
| 629 | + ] | |
| 630 | + }, | |
| 631 | + "examples": [ | |
| 632 | + { | |
| 633 | + "title": "Success-Response:", | |
| 634 | + "content": "HTTP/1.1 200 OK", | |
| 635 | + "type": "json" | |
| 636 | + } | |
| 637 | + ] | |
| 638 | + }, | |
| 639 | + "error": { | |
| 640 | + "examples": [ | |
| 641 | + { | |
| 642 | + "title": "Error-Response:", | |
| 643 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 644 | + "type": "json" | |
| 645 | + } | |
| 646 | + ] | |
| 647 | + }, | |
| 648 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 649 | + "groupTitle": "Template" | |
| 650 | + }, | |
| 651 | + { | |
| 652 | + "type": "get", | |
| 653 | + "url": "/templates/:template/corpo", | |
| 654 | + "title": "Recuperar corpo", | |
| 655 | + "name": "getCorpoTemplate", | |
| 656 | + "group": "Template", | |
| 657 | + "version": "1.0.0", | |
| 658 | + "permission": [ | |
| 659 | + { | |
| 660 | + "name": "RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE" | |
| 661 | + } | |
| 662 | + ], | |
| 663 | + "description": "<p>Recupera o corpo de um template para utilização.</p>", | |
| 664 | + "parameter": { | |
| 665 | + "fields": { | |
| 666 | + "Path Parameters": [ | |
| 667 | + { | |
| 668 | + "group": "Path Parameters", | |
| 669 | + "type": "String", | |
| 670 | + "optional": false, | |
| 671 | + "field": "template", | |
| 672 | + "description": "<p>Identificador do template</p>" | |
| 673 | + } | |
| 674 | + ] | |
| 675 | + } | |
| 676 | + }, | |
| 677 | + "examples": [ | |
| 678 | + { | |
| 679 | + "title": "Exemplo de requisição:\t", | |
| 680 | + "content": "curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro", | |
| 681 | + "type": "json" | |
| 682 | + } | |
| 683 | + ], | |
| 684 | + "success": { | |
| 685 | + "fields": { | |
| 686 | + "Sucesso - 200": [ | |
| 687 | + { | |
| 688 | + "group": "Sucesso - 200", | |
| 689 | + "type": "String", | |
| 690 | + "optional": false, | |
| 691 | + "field": "corpo", | |
| 692 | + "description": "<p>String com o corpo do template pronto para utilização.</p>" | |
| 693 | + } | |
| 694 | + ] | |
| 695 | + }, | |
| 696 | + "examples": [ | |
| 697 | + { | |
| 698 | + "title": "Success-Response:", | |
| 699 | + "content": "HTTP/1.1 200 OK\nPrezado {{fulano}}, seu cadastro foi realizado com sucesso.", | |
| 700 | + "type": "json" | |
| 701 | + } | |
| 702 | + ] | |
| 703 | + }, | |
| 704 | + "error": { | |
| 705 | + "examples": [ | |
| 706 | + { | |
| 707 | + "title": "Error-Response:", | |
| 708 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 709 | + "type": "json" | |
| 710 | + } | |
| 711 | + ] | |
| 712 | + }, | |
| 713 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 714 | + "groupTitle": "Template" | |
| 715 | + }, | |
| 716 | + { | |
| 717 | + "type": "get", | |
| 718 | + "url": "/templates/:template", | |
| 719 | + "title": "Consultar template", | |
| 720 | + "name": "getTemplate", | |
| 721 | + "group": "Template", | |
| 722 | + "version": "1.0.0", | |
| 723 | + "permission": [ | |
| 724 | + { | |
| 725 | + "name": "RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE" | |
| 726 | + } | |
| 727 | + ], | |
| 728 | + "description": "<p>Consulta um template.</p>", | |
| 729 | + "parameter": { | |
| 730 | + "fields": { | |
| 731 | + "Path Parameters": [ | |
| 732 | + { | |
| 733 | + "group": "Path Parameters", | |
| 734 | + "type": "String", | |
| 735 | + "optional": false, | |
| 736 | + "field": "template", | |
| 737 | + "description": "<p>Identificador do template</p>" | |
| 738 | + } | |
| 739 | + ] | |
| 740 | + } | |
| 741 | + }, | |
| 742 | + "examples": [ | |
| 743 | + { | |
| 744 | + "title": "Exemplo de requisição:\t", | |
| 745 | + "content": "curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro", | |
| 746 | + "type": "json" | |
| 747 | + } | |
| 748 | + ], | |
| 749 | + "success": { | |
| 750 | + "fields": { | |
| 751 | + "Sucesso - 200": [ | |
| 752 | + { | |
| 753 | + "group": "Sucesso - 200", | |
| 754 | + "type": "Template", | |
| 755 | + "optional": false, | |
| 756 | + "field": "template", | |
| 757 | + "description": "<p>Objeto representando o template.</p>" | |
| 758 | + }, | |
| 759 | + { | |
| 760 | + "group": "Sucesso - 200", | |
| 761 | + "type": "String", | |
| 762 | + "optional": false, | |
| 763 | + "field": "template.corpo", | |
| 764 | + "description": "<p>Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados.</p>" | |
| 765 | + }, | |
| 766 | + { | |
| 767 | + "group": "Sucesso - 200", | |
| 768 | + "type": "String", | |
| 769 | + "optional": false, | |
| 770 | + "field": "template.dataCadastro", | |
| 771 | + "description": "<p>Data de cadastro do template.</p>" | |
| 772 | + }, | |
| 773 | + { | |
| 774 | + "group": "Sucesso - 200", | |
| 775 | + "type": "String", | |
| 776 | + "optional": false, | |
| 777 | + "field": "template.descricao", | |
| 778 | + "description": "<p>Descrição do template.</p>" | |
| 779 | + }, | |
| 780 | + { | |
| 781 | + "group": "Sucesso - 200", | |
| 782 | + "type": "String", | |
| 783 | + "optional": false, | |
| 784 | + "field": "template.exemplo", | |
| 785 | + "description": "<p>Exemplo de request para preenchimento do template.</p>" | |
| 786 | + }, | |
| 787 | + { | |
| 788 | + "group": "Sucesso - 200", | |
| 789 | + "type": "String", | |
| 790 | + "optional": false, | |
| 791 | + "field": "template.nome", | |
| 792 | + "description": "<p>Identificador do template.</p>" | |
| 793 | + }, | |
| 794 | + { | |
| 795 | + "group": "Sucesso - 200", | |
| 796 | + "type": "String", | |
| 797 | + "optional": false, | |
| 798 | + "field": "template.responsavel", | |
| 799 | + "description": "<p>Analista responsável pelo template.</p>" | |
| 800 | + }, | |
| 801 | + { | |
| 802 | + "group": "Sucesso - 200", | |
| 803 | + "type": "Boolean", | |
| 804 | + "optional": false, | |
| 805 | + "field": "template.restrito", | |
| 806 | + "description": "<p>Flag identificando se a atualização deste template � restrita.</p>" | |
| 807 | + } | |
| 808 | + ] | |
| 809 | + }, | |
| 810 | + "examples": [ | |
| 811 | + { | |
| 812 | + "title": "Success-Response:", | |
| 813 | + "content": "HTTP/1.1 200 OK\n{\n \"corpo\": \"Prezado {{fulano}}, seu cadastro foi realizado com sucesso.\",\n \"dataCadastro\": \"2017-03-14T16:57:47.405-03:00\",\n \"descricao\": \"Template de confirmação de cadastro.\",\n \"exemplo\": \"{\"fulano\":\"André Guimarães\"}\",\n \"nome\": \"confirmacao-cadastro\",\n \"responsavel\": \"andre.guimaraes\",\n \"restrito\": false,\n}", | |
| 814 | + "type": "json" | |
| 815 | + } | |
| 816 | + ] | |
| 817 | + }, | |
| 818 | + "error": { | |
| 819 | + "examples": [ | |
| 820 | + { | |
| 821 | + "title": "Error-Response:", | |
| 822 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 823 | + "type": "json" | |
| 824 | + } | |
| 825 | + ] | |
| 826 | + }, | |
| 827 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 828 | + "groupTitle": "Template" | |
| 829 | + }, | |
| 830 | + { | |
| 831 | + "type": "get", | |
| 832 | + "url": "/templates/:template/versoes", | |
| 833 | + "title": "Listar versões", | |
| 834 | + "name": "getVersoes", | |
| 835 | + "group": "Template", | |
| 836 | + "version": "1.0.0", | |
| 837 | + "permission": [ | |
| 838 | + { | |
| 839 | + "name": "RO_ADMIN_TEMPLATE, RO_ADMIN_TEMPLATE" | |
| 840 | + } | |
| 841 | + ], | |
| 842 | + "description": "<p>Lista as versões de um template</p>", | |
| 843 | + "parameter": { | |
| 844 | + "fields": { | |
| 845 | + "Path Parameters": [ | |
| 846 | + { | |
| 847 | + "group": "Path Parameters", | |
| 848 | + "type": "String", | |
| 849 | + "optional": false, | |
| 850 | + "field": "template", | |
| 851 | + "description": "<p>Identificador do template</p>" | |
| 852 | + } | |
| 853 | + ] | |
| 854 | + } | |
| 855 | + }, | |
| 856 | + "examples": [ | |
| 857 | + { | |
| 858 | + "title": "Exemplo de requisição:\t", | |
| 859 | + "content": "curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro/versoes", | |
| 860 | + "type": "json" | |
| 861 | + } | |
| 862 | + ], | |
| 863 | + "success": { | |
| 864 | + "fields": { | |
| 865 | + "Sucesso - 200": [ | |
| 866 | + { | |
| 867 | + "group": "Sucesso - 200", | |
| 868 | + "type": "List", | |
| 869 | + "optional": false, | |
| 870 | + "field": "resultado", | |
| 871 | + "description": "<p>Lista com as versões do template.</p>" | |
| 872 | + }, | |
| 873 | + { | |
| 874 | + "group": "Sucesso - 200", | |
| 875 | + "type": "Versao", | |
| 876 | + "optional": false, | |
| 877 | + "field": "resultado.versao", | |
| 878 | + "description": "<p>Objeto representando uma versão do template.</p>" | |
| 879 | + }, | |
| 880 | + { | |
| 881 | + "group": "Sucesso - 200", | |
| 882 | + "type": "String", | |
| 883 | + "optional": false, | |
| 884 | + "field": "resultado.versao.corpo", | |
| 885 | + "description": "<p>Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados.</p>" | |
| 886 | + }, | |
| 887 | + { | |
| 888 | + "group": "Sucesso - 200", | |
| 889 | + "type": "Date", | |
| 890 | + "optional": false, | |
| 891 | + "field": "resultado.versao.data", | |
| 892 | + "description": "<p>Data da versão.</p>" | |
| 893 | + }, | |
| 894 | + { | |
| 895 | + "group": "Sucesso - 200", | |
| 896 | + "type": "String", | |
| 897 | + "optional": false, | |
| 898 | + "field": "resultado.versao.descricao", | |
| 899 | + "description": "<p>Descrição do template.</p>" | |
| 900 | + }, | |
| 901 | + { | |
| 902 | + "group": "Sucesso - 200", | |
| 903 | + "type": "String", | |
| 904 | + "optional": false, | |
| 905 | + "field": "resultado.versao.exemplo", | |
| 906 | + "description": "<p>Exemplo de request para preenchimento do template.</p>" | |
| 907 | + }, | |
| 908 | + { | |
| 909 | + "group": "Sucesso - 200", | |
| 910 | + "type": "String", | |
| 911 | + "optional": false, | |
| 912 | + "field": "resultado.versao.responsavel", | |
| 913 | + "description": "<p>Identificador do colaborador responsável.</p>" | |
| 914 | + } | |
| 915 | + ] | |
| 916 | + }, | |
| 917 | + "examples": [ | |
| 918 | + { | |
| 919 | + "title": "Success-Response:", | |
| 920 | + "content": "HTTP/1.1 200 OK\n{\n \"corpo\": \"Prezado {{fulano}}, seu cadastro foi realizado com sucesso.\",\n \"data\":\"2017-03-14T16:57:47.405-03:00\",\n \"descricao\": \"Template de confirmação de cadastro.\",\n \"exemplo\": \"{\"fulano\":\"André Guimarães\"}\",\n \"responsavel\": \"andre.guimaraes\",\n}", | |
| 921 | + "type": "json" | |
| 922 | + } | |
| 923 | + ] | |
| 924 | + }, | |
| 925 | + "error": { | |
| 926 | + "examples": [ | |
| 927 | + { | |
| 928 | + "title": "Error-Response:", | |
| 929 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 930 | + "type": "json" | |
| 931 | + } | |
| 932 | + ] | |
| 933 | + }, | |
| 934 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 935 | + "groupTitle": "Template" | |
| 936 | + }, | |
| 937 | + { | |
| 938 | + "type": "get", | |
| 939 | + "url": "/templates", | |
| 940 | + "title": "Listar templates", | |
| 941 | + "name": "listTemplates", | |
| 942 | + "group": "Template", | |
| 943 | + "version": "1.0.0", | |
| 944 | + "permission": [ | |
| 945 | + { | |
| 946 | + "name": "RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE" | |
| 947 | + } | |
| 948 | + ], | |
| 949 | + "description": "<p>Consulta os templates disponíveis.</p>", | |
| 950 | + "parameter": { | |
| 951 | + "fields": { | |
| 952 | + "Query Parameters": [ | |
| 953 | + { | |
| 954 | + "group": "Query Parameters", | |
| 955 | + "type": "String", | |
| 956 | + "optional": true, | |
| 957 | + "field": "filtro", | |
| 958 | + "description": "<p>Valor utilizado para filtrar os templates.</p>" | |
| 959 | + }, | |
| 960 | + { | |
| 961 | + "group": "Query Parameters", | |
| 962 | + "type": "String", | |
| 963 | + "optional": true, | |
| 964 | + "field": "itens", | |
| 965 | + "defaultValue": "20", | |
| 966 | + "description": "<p>Quantidade de templates que serão exibidos</p>" | |
| 967 | + }, | |
| 968 | + { | |
| 969 | + "group": "Query Parameters", | |
| 970 | + "type": "String", | |
| 971 | + "optional": true, | |
| 972 | + "field": "pag", | |
| 973 | + "defaultValue": "1", | |
| 974 | + "description": "<p>Número da página</p>" | |
| 975 | + } | |
| 976 | + ] | |
| 977 | + } | |
| 978 | + }, | |
| 979 | + "examples": [ | |
| 980 | + { | |
| 981 | + "title": "Exemplo de requisição:\t", | |
| 982 | + "content": "curl -i http://<host>/templates-broker/service/templates", | |
| 983 | + "type": "json" | |
| 984 | + } | |
| 985 | + ], | |
| 986 | + "success": { | |
| 987 | + "fields": { | |
| 988 | + "Sucesso - 200": [ | |
| 989 | + { | |
| 990 | + "group": "Sucesso - 200", | |
| 991 | + "type": "List", | |
| 992 | + "optional": false, | |
| 993 | + "field": "resultado", | |
| 994 | + "description": "<p>Lista com os templates encontrados.</p>" | |
| 995 | + }, | |
| 996 | + { | |
| 997 | + "group": "Sucesso - 200", | |
| 998 | + "type": "Template", | |
| 999 | + "optional": false, | |
| 1000 | + "field": "resultado.template", | |
| 1001 | + "description": "<p>Objeto representando o template.</p>" | |
| 1002 | + }, | |
| 1003 | + { | |
| 1004 | + "group": "Sucesso - 200", | |
| 1005 | + "type": "String", | |
| 1006 | + "optional": false, | |
| 1007 | + "field": "resultado.template.corpo", | |
| 1008 | + "description": "<p>Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados.</p>" | |
| 1009 | + }, | |
| 1010 | + { | |
| 1011 | + "group": "Sucesso - 200", | |
| 1012 | + "type": "String", | |
| 1013 | + "optional": false, | |
| 1014 | + "field": "resultado.template.dataCadastro", | |
| 1015 | + "description": "<p>Data de cadastro do template.</p>" | |
| 1016 | + }, | |
| 1017 | + { | |
| 1018 | + "group": "Sucesso - 200", | |
| 1019 | + "type": "String", | |
| 1020 | + "optional": false, | |
| 1021 | + "field": "resultado.template.descricao", | |
| 1022 | + "description": "<p>Descrição do template.</p>" | |
| 1023 | + }, | |
| 1024 | + { | |
| 1025 | + "group": "Sucesso - 200", | |
| 1026 | + "type": "String", | |
| 1027 | + "optional": false, | |
| 1028 | + "field": "resultado.template.exemplo", | |
| 1029 | + "description": "<p>Exemplo de request para preenchimento do template.</p>" | |
| 1030 | + }, | |
| 1031 | + { | |
| 1032 | + "group": "Sucesso - 200", | |
| 1033 | + "type": "String", | |
| 1034 | + "optional": false, | |
| 1035 | + "field": "resultado.template.nome", | |
| 1036 | + "description": "<p>Identificador do template</p>" | |
| 1037 | + }, | |
| 1038 | + { | |
| 1039 | + "group": "Sucesso - 200", | |
| 1040 | + "type": "String", | |
| 1041 | + "optional": false, | |
| 1042 | + "field": "resultado.template.responsavel", | |
| 1043 | + "description": "<p>Analista responsável pelo template.</p>" | |
| 1044 | + }, | |
| 1045 | + { | |
| 1046 | + "group": "Sucesso - 200", | |
| 1047 | + "type": "Boolean", | |
| 1048 | + "optional": false, | |
| 1049 | + "field": "resultado.template.restrito", | |
| 1050 | + "description": "<p>Flag identificando se a atualização deste template � restrita.</p>" | |
| 1051 | + } | |
| 1052 | + ] | |
| 1053 | + }, | |
| 1054 | + "examples": [ | |
| 1055 | + { | |
| 1056 | + "title": "Success-Response:", | |
| 1057 | + "content": "HTTP/1.1 200 OK\n{\n \"corpo\": \"Prezado {{fulano}}, seu cadastro foi realizado com sucesso.\",\n \"dataCadastro\": \"2017-03-14T16:57:47.405-03:00\",\n \"descricao\": \"Template de confirmação de cadastro.\",\n \"exemplo\": \"{\"fulano\":\"André Guimarães\"}\",\n \"nome\": \"confirmacao-cadastro\",\n \"responsavel\": \"andre.guimaraes\",\n \"restrito\": false\n}", | |
| 1058 | + "type": "json" | |
| 1059 | + } | |
| 1060 | + ] | |
| 1061 | + }, | |
| 1062 | + "error": { | |
| 1063 | + "examples": [ | |
| 1064 | + { | |
| 1065 | + "title": "Error-Response:", | |
| 1066 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 1067 | + "type": "json" | |
| 1068 | + } | |
| 1069 | + ] | |
| 1070 | + }, | |
| 1071 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 1072 | + "groupTitle": "Template" | |
| 1073 | + } | |
| 1074 | +] }); | ... | ... |
| ... | ... | @@ -0,0 +1,1074 @@ |
| 1 | +[ | |
| 2 | + { | |
| 3 | + "success": { | |
| 4 | + "fields": { | |
| 5 | + "Success 200": [ | |
| 6 | + { | |
| 7 | + "group": "Success 200", | |
| 8 | + "optional": false, | |
| 9 | + "field": "varname1", | |
| 10 | + "description": "<p>No type.</p>" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "group": "Success 200", | |
| 14 | + "type": "String", | |
| 15 | + "optional": false, | |
| 16 | + "field": "varname2", | |
| 17 | + "description": "<p>With type.</p>" | |
| 18 | + } | |
| 19 | + ] | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + "type": "", | |
| 23 | + "url": "", | |
| 24 | + "version": "0.0.0", | |
| 25 | + "filename": "templates-broker/src/main/webapp/api-docs/main.js", | |
| 26 | + "group": "C__ANS_ans_templates_templates_broker_src_main_webapp_api_docs_main_js", | |
| 27 | + "groupTitle": "C__ANS_ans_templates_templates_broker_src_main_webapp_api_docs_main_js", | |
| 28 | + "name": "" | |
| 29 | + }, | |
| 30 | + { | |
| 31 | + "success": { | |
| 32 | + "fields": { | |
| 33 | + "Success 200": [ | |
| 34 | + { | |
| 35 | + "group": "Success 200", | |
| 36 | + "optional": false, | |
| 37 | + "field": "varname1", | |
| 38 | + "description": "<p>No type.</p>" | |
| 39 | + }, | |
| 40 | + { | |
| 41 | + "group": "Success 200", | |
| 42 | + "type": "String", | |
| 43 | + "optional": false, | |
| 44 | + "field": "varname2", | |
| 45 | + "description": "<p>With type.</p>" | |
| 46 | + } | |
| 47 | + ] | |
| 48 | + } | |
| 49 | + }, | |
| 50 | + "type": "", | |
| 51 | + "url": "", | |
| 52 | + "version": "0.0.0", | |
| 53 | + "filename": "templates-broker/target/templates-broker-0.1/api-docs/main.js", | |
| 54 | + "group": "C__ANS_ans_templates_templates_broker_target_templates_broker_0_1_api_docs_main_js", | |
| 55 | + "groupTitle": "C__ANS_ans_templates_templates_broker_target_templates_broker_0_1_api_docs_main_js", | |
| 56 | + "name": "" | |
| 57 | + }, | |
| 58 | + { | |
| 59 | + "type": "post", | |
| 60 | + "url": "/templates/:template/colaboradores", | |
| 61 | + "title": "Adicionar colaborador", | |
| 62 | + "name": "addColaborador", | |
| 63 | + "group": "Colaborador", | |
| 64 | + "version": "1.0.0", | |
| 65 | + "permission": [ | |
| 66 | + { | |
| 67 | + "name": "RO_ADMIN_TEMPLATE" | |
| 68 | + } | |
| 69 | + ], | |
| 70 | + "description": "<p>Adiciona um colaborador ao template.</p>", | |
| 71 | + "parameter": { | |
| 72 | + "fields": { | |
| 73 | + "Path Parameters": [ | |
| 74 | + { | |
| 75 | + "group": "Path Parameters", | |
| 76 | + "type": "String", | |
| 77 | + "optional": false, | |
| 78 | + "field": "template", | |
| 79 | + "description": "<p>Identificador do template</p>" | |
| 80 | + } | |
| 81 | + ] | |
| 82 | + } | |
| 83 | + }, | |
| 84 | + "examples": [ | |
| 85 | + { | |
| 86 | + "title": "Exemplo de requisição:\t", | |
| 87 | + "content": "\tendpoint: [POST] http://<host>/templates-broker/service/templates/confirmacao-cadastro/colaboradores\n\n\tbody:\n {\n \"usuario\": \"andre.guimaraes\",\n \"editor\": true\n }", | |
| 88 | + "type": "json" | |
| 89 | + } | |
| 90 | + ], | |
| 91 | + "success": { | |
| 92 | + "fields": { | |
| 93 | + "Sucesso - 201": [ | |
| 94 | + { | |
| 95 | + "group": "Sucesso - 201", | |
| 96 | + "type": "header", | |
| 97 | + "optional": false, | |
| 98 | + "field": "Location", | |
| 99 | + "description": "<p>Caminho para o recurso criado.</p>" | |
| 100 | + } | |
| 101 | + ] | |
| 102 | + }, | |
| 103 | + "examples": [ | |
| 104 | + { | |
| 105 | + "title": "Success-Response:", | |
| 106 | + "content": "HTTP/1.1 201 Created", | |
| 107 | + "type": "json" | |
| 108 | + } | |
| 109 | + ] | |
| 110 | + }, | |
| 111 | + "error": { | |
| 112 | + "examples": [ | |
| 113 | + { | |
| 114 | + "title": "Error-Response:", | |
| 115 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 116 | + "type": "json" | |
| 117 | + } | |
| 118 | + ] | |
| 119 | + }, | |
| 120 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 121 | + "groupTitle": "Colaborador" | |
| 122 | + }, | |
| 123 | + { | |
| 124 | + "type": "get", | |
| 125 | + "url": "/templates/:template/colaboradores/:colaborador", | |
| 126 | + "title": "Consultar colaborador", | |
| 127 | + "name": "getColaborador", | |
| 128 | + "group": "Colaborador", | |
| 129 | + "version": "1.0.0", | |
| 130 | + "permission": [ | |
| 131 | + { | |
| 132 | + "name": "RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE" | |
| 133 | + } | |
| 134 | + ], | |
| 135 | + "description": "<p>Consulta um colaborador.</p>", | |
| 136 | + "parameter": { | |
| 137 | + "fields": { | |
| 138 | + "Path Parameters": [ | |
| 139 | + { | |
| 140 | + "group": "Path Parameters", | |
| 141 | + "type": "String", | |
| 142 | + "optional": false, | |
| 143 | + "field": "template", | |
| 144 | + "description": "<p>Identificador do template</p>" | |
| 145 | + }, | |
| 146 | + { | |
| 147 | + "group": "Path Parameters", | |
| 148 | + "type": "String", | |
| 149 | + "optional": false, | |
| 150 | + "field": "colaborador", | |
| 151 | + "description": "<p>Identificador do colaborador</p>" | |
| 152 | + } | |
| 153 | + ] | |
| 154 | + } | |
| 155 | + }, | |
| 156 | + "examples": [ | |
| 157 | + { | |
| 158 | + "title": "Exemplo de requisição:\t", | |
| 159 | + "content": "curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro/colaboradores/andre.guimaraes", | |
| 160 | + "type": "json" | |
| 161 | + } | |
| 162 | + ], | |
| 163 | + "success": { | |
| 164 | + "fields": { | |
| 165 | + "Sucesso - 200": [ | |
| 166 | + { | |
| 167 | + "group": "Sucesso - 200", | |
| 168 | + "type": "Colaborador", | |
| 169 | + "optional": false, | |
| 170 | + "field": "colaborador", | |
| 171 | + "description": "<p>Objeto representando um colaborador.</p>" | |
| 172 | + }, | |
| 173 | + { | |
| 174 | + "group": "Sucesso - 200", | |
| 175 | + "type": "String", | |
| 176 | + "optional": false, | |
| 177 | + "field": "colaborador.usuario", | |
| 178 | + "description": "<p>Identificador do colaborador.</p>" | |
| 179 | + }, | |
| 180 | + { | |
| 181 | + "group": "Sucesso - 200", | |
| 182 | + "type": "Boolean", | |
| 183 | + "optional": false, | |
| 184 | + "field": "colaborador.editor", | |
| 185 | + "description": "<p>Flag que determina se o colaborador tem o poder para editar o template.</p>" | |
| 186 | + } | |
| 187 | + ] | |
| 188 | + }, | |
| 189 | + "examples": [ | |
| 190 | + { | |
| 191 | + "title": "Success-Response:", | |
| 192 | + "content": "HTTP/1.1 200 OK\n{\n \"editor\": true,\n \"usuario\": \"andre.guimaraes\"\n}", | |
| 193 | + "type": "json" | |
| 194 | + } | |
| 195 | + ] | |
| 196 | + }, | |
| 197 | + "error": { | |
| 198 | + "examples": [ | |
| 199 | + { | |
| 200 | + "title": "Error-Response:", | |
| 201 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 202 | + "type": "json" | |
| 203 | + } | |
| 204 | + ] | |
| 205 | + }, | |
| 206 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 207 | + "groupTitle": "Colaborador" | |
| 208 | + }, | |
| 209 | + { | |
| 210 | + "type": "get", | |
| 211 | + "url": "/templates/:template/colaboradores", | |
| 212 | + "title": "Listar colaboradores", | |
| 213 | + "name": "getColaboradores", | |
| 214 | + "group": "Colaborador", | |
| 215 | + "version": "1.0.0", | |
| 216 | + "permission": [ | |
| 217 | + { | |
| 218 | + "name": "RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE" | |
| 219 | + } | |
| 220 | + ], | |
| 221 | + "description": "<p>Consulta os colaboradores do template.</p>", | |
| 222 | + "parameter": { | |
| 223 | + "fields": { | |
| 224 | + "Path Parameters": [ | |
| 225 | + { | |
| 226 | + "group": "Path Parameters", | |
| 227 | + "type": "String", | |
| 228 | + "optional": false, | |
| 229 | + "field": "template", | |
| 230 | + "description": "<p>Identificador do template</p>" | |
| 231 | + } | |
| 232 | + ], | |
| 233 | + "Query Parameters": [ | |
| 234 | + { | |
| 235 | + "group": "Query Parameters", | |
| 236 | + "type": "String", | |
| 237 | + "optional": true, | |
| 238 | + "field": "itens", | |
| 239 | + "defaultValue": "20", | |
| 240 | + "description": "<p>Quantidade de templates que serão exibidos</p>" | |
| 241 | + }, | |
| 242 | + { | |
| 243 | + "group": "Query Parameters", | |
| 244 | + "type": "String", | |
| 245 | + "optional": true, | |
| 246 | + "field": "pag", | |
| 247 | + "defaultValue": "1", | |
| 248 | + "description": "<p>Número da página</p>" | |
| 249 | + } | |
| 250 | + ] | |
| 251 | + } | |
| 252 | + }, | |
| 253 | + "examples": [ | |
| 254 | + { | |
| 255 | + "title": "Exemplo de requisição:\t", | |
| 256 | + "content": "curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro/colaboradores", | |
| 257 | + "type": "json" | |
| 258 | + } | |
| 259 | + ], | |
| 260 | + "success": { | |
| 261 | + "fields": { | |
| 262 | + "Sucesso - 200": [ | |
| 263 | + { | |
| 264 | + "group": "Sucesso - 200", | |
| 265 | + "type": "List", | |
| 266 | + "optional": false, | |
| 267 | + "field": "resultado", | |
| 268 | + "description": "<p>Lista com os colaboradores do template.</p>" | |
| 269 | + }, | |
| 270 | + { | |
| 271 | + "group": "Sucesso - 200", | |
| 272 | + "type": "Colaborador", | |
| 273 | + "optional": false, | |
| 274 | + "field": "resultado.colaborador", | |
| 275 | + "description": "<p>Objeto representando um colaborador.</p>" | |
| 276 | + }, | |
| 277 | + { | |
| 278 | + "group": "Sucesso - 200", | |
| 279 | + "type": "String", | |
| 280 | + "optional": false, | |
| 281 | + "field": "resultado.colaborador.usuario", | |
| 282 | + "description": "<p>Identificador do colaborador.</p>" | |
| 283 | + }, | |
| 284 | + { | |
| 285 | + "group": "Sucesso - 200", | |
| 286 | + "type": "Boolean", | |
| 287 | + "optional": false, | |
| 288 | + "field": "resultado.colaborador.editor", | |
| 289 | + "description": "<p>Flag que determina se o colaborador tem o poder para editar o template.</p>" | |
| 290 | + } | |
| 291 | + ] | |
| 292 | + }, | |
| 293 | + "examples": [ | |
| 294 | + { | |
| 295 | + "title": "Success-Response:", | |
| 296 | + "content": "HTTP/1.1 200 OK\n{\n \"editor\": true,\n \"usuario\": \"andre.guimaraes\",\n}", | |
| 297 | + "type": "json" | |
| 298 | + } | |
| 299 | + ] | |
| 300 | + }, | |
| 301 | + "error": { | |
| 302 | + "examples": [ | |
| 303 | + { | |
| 304 | + "title": "Error-Response:", | |
| 305 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 306 | + "type": "json" | |
| 307 | + } | |
| 308 | + ] | |
| 309 | + }, | |
| 310 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 311 | + "groupTitle": "Colaborador" | |
| 312 | + }, | |
| 313 | + { | |
| 314 | + "type": "delete", | |
| 315 | + "url": "/templates/:template/colaboradores/:colaborador", | |
| 316 | + "title": "Remover colaborador", | |
| 317 | + "name": "removeColaborador", | |
| 318 | + "group": "Colaborador", | |
| 319 | + "version": "1.0.0", | |
| 320 | + "permission": [ | |
| 321 | + { | |
| 322 | + "name": "RO_ADMIN_TEMPLATE" | |
| 323 | + } | |
| 324 | + ], | |
| 325 | + "description": "<p>Remove colaborador de um template.</p>", | |
| 326 | + "parameter": { | |
| 327 | + "fields": { | |
| 328 | + "Path Parameters": [ | |
| 329 | + { | |
| 330 | + "group": "Path Parameters", | |
| 331 | + "type": "String", | |
| 332 | + "optional": false, | |
| 333 | + "field": "template", | |
| 334 | + "description": "<p>Identificador do template</p>" | |
| 335 | + }, | |
| 336 | + { | |
| 337 | + "group": "Path Parameters", | |
| 338 | + "type": "String", | |
| 339 | + "optional": false, | |
| 340 | + "field": "colaborador", | |
| 341 | + "description": "<p>Identificador do colaborador</p>" | |
| 342 | + } | |
| 343 | + ] | |
| 344 | + } | |
| 345 | + }, | |
| 346 | + "examples": [ | |
| 347 | + { | |
| 348 | + "title": "Exemplo de requisição:\t", | |
| 349 | + "content": "curl -X DELETE http://<host>/templates-broker/service/templates/confirmacao-cadastro/colaboradores/andre.guimaraes", | |
| 350 | + "type": "json" | |
| 351 | + } | |
| 352 | + ], | |
| 353 | + "success": { | |
| 354 | + "examples": [ | |
| 355 | + { | |
| 356 | + "title": "Success-Response:", | |
| 357 | + "content": "HTTP/1.1 200 OK", | |
| 358 | + "type": "json" | |
| 359 | + } | |
| 360 | + ] | |
| 361 | + }, | |
| 362 | + "error": { | |
| 363 | + "examples": [ | |
| 364 | + { | |
| 365 | + "title": "Error-Response:", | |
| 366 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 367 | + "type": "json" | |
| 368 | + } | |
| 369 | + ] | |
| 370 | + }, | |
| 371 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 372 | + "groupTitle": "Colaborador" | |
| 373 | + }, | |
| 374 | + { | |
| 375 | + "type": "post", | |
| 376 | + "url": "/templates", | |
| 377 | + "title": "Adicionar template", | |
| 378 | + "name": "createTemplate", | |
| 379 | + "group": "Template", | |
| 380 | + "version": "1.0.0", | |
| 381 | + "permission": [ | |
| 382 | + { | |
| 383 | + "name": "RO_ADMIN_TEMPLATE" | |
| 384 | + } | |
| 385 | + ], | |
| 386 | + "description": "<p>Cria um novo template.</p>", | |
| 387 | + "parameter": { | |
| 388 | + "fields": { | |
| 389 | + "Request Body": [ | |
| 390 | + { | |
| 391 | + "group": "Request Body", | |
| 392 | + "type": "Template", | |
| 393 | + "optional": false, | |
| 394 | + "field": "template", | |
| 395 | + "description": "<p>Objeto de representação do template.</p>" | |
| 396 | + }, | |
| 397 | + { | |
| 398 | + "group": "Request Body", | |
| 399 | + "type": "String", | |
| 400 | + "optional": false, | |
| 401 | + "field": "corpo", | |
| 402 | + "description": "<p>Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados.</p>" | |
| 403 | + }, | |
| 404 | + { | |
| 405 | + "group": "Request Body", | |
| 406 | + "type": "String", | |
| 407 | + "optional": false, | |
| 408 | + "field": "descricao", | |
| 409 | + "description": "<p>Descrição do template.</p>" | |
| 410 | + }, | |
| 411 | + { | |
| 412 | + "group": "Request Body", | |
| 413 | + "type": "String", | |
| 414 | + "optional": false, | |
| 415 | + "field": "exemplo", | |
| 416 | + "description": "<p>Exemplo de request para preenchimento do template.</p>" | |
| 417 | + }, | |
| 418 | + { | |
| 419 | + "group": "Request Body", | |
| 420 | + "type": "String", | |
| 421 | + "optional": false, | |
| 422 | + "field": "nome", | |
| 423 | + "description": "<p>Identificador do template.</p>" | |
| 424 | + }, | |
| 425 | + { | |
| 426 | + "group": "Request Body", | |
| 427 | + "type": "String", | |
| 428 | + "optional": false, | |
| 429 | + "field": "responsavel", | |
| 430 | + "description": "<p>Analista responsável pelo template.</p>" | |
| 431 | + }, | |
| 432 | + { | |
| 433 | + "group": "Request Body", | |
| 434 | + "type": "String", | |
| 435 | + "optional": false, | |
| 436 | + "field": "restrito", | |
| 437 | + "description": "<p>Flag identificando se a atualização deste template � restrita.</p>" | |
| 438 | + } | |
| 439 | + ] | |
| 440 | + } | |
| 441 | + }, | |
| 442 | + "examples": [ | |
| 443 | + { | |
| 444 | + "title": "Exemplo de requisição:\t", | |
| 445 | + "content": "\tendpoint: [PUT] http://<host>/templates-broker/service/templates/confirmacao-cadastro\n\n\tbody:\n {\n \"corpo\": \"Prezado {{fulano}}, seu cadastro foi realizado com sucesso.\",\n \"descricao\": \"Template de confirmação de cadastro.\",\n \"exemplo\": \"{\"fulano\":\"André Guimarães\"}\",\n \"nome\": \"confirmacao-cadastro\",\n \"responsavel\": \"andre.guimaraes\",\n \"restrito\": true,\n }", | |
| 446 | + "type": "json" | |
| 447 | + } | |
| 448 | + ], | |
| 449 | + "success": { | |
| 450 | + "fields": { | |
| 451 | + "Sucesso - 201": [ | |
| 452 | + { | |
| 453 | + "group": "Sucesso - 201", | |
| 454 | + "type": "header", | |
| 455 | + "optional": false, | |
| 456 | + "field": "Location", | |
| 457 | + "description": "<p>Caminho para o recurso criado.</p>" | |
| 458 | + } | |
| 459 | + ] | |
| 460 | + }, | |
| 461 | + "examples": [ | |
| 462 | + { | |
| 463 | + "title": "Success-Response:", | |
| 464 | + "content": "HTTP/1.1 201 Created", | |
| 465 | + "type": "json" | |
| 466 | + } | |
| 467 | + ] | |
| 468 | + }, | |
| 469 | + "error": { | |
| 470 | + "examples": [ | |
| 471 | + { | |
| 472 | + "title": "Error-Response:", | |
| 473 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 474 | + "type": "json" | |
| 475 | + } | |
| 476 | + ] | |
| 477 | + }, | |
| 478 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 479 | + "groupTitle": "Template" | |
| 480 | + }, | |
| 481 | + { | |
| 482 | + "type": "delete", | |
| 483 | + "url": "/templates/:template", | |
| 484 | + "title": "Excluir template", | |
| 485 | + "name": "deleteTemplate", | |
| 486 | + "group": "Template", | |
| 487 | + "version": "1.0.0", | |
| 488 | + "permission": [ | |
| 489 | + { | |
| 490 | + "name": "RO_ADMIN_TEMPLATE" | |
| 491 | + } | |
| 492 | + ], | |
| 493 | + "description": "<p>Exclui determinado template.</p>", | |
| 494 | + "parameter": { | |
| 495 | + "fields": { | |
| 496 | + "Path Parameters": [ | |
| 497 | + { | |
| 498 | + "group": "Path Parameters", | |
| 499 | + "type": "String", | |
| 500 | + "optional": false, | |
| 501 | + "field": "template", | |
| 502 | + "description": "<p>Identificador do template</p>" | |
| 503 | + } | |
| 504 | + ] | |
| 505 | + } | |
| 506 | + }, | |
| 507 | + "examples": [ | |
| 508 | + { | |
| 509 | + "title": "Exemplo de requisição:\t", | |
| 510 | + "content": "curl -X DELETE http://<host>/templates-broker/service/templates/confirmacao-cadastro", | |
| 511 | + "type": "json" | |
| 512 | + } | |
| 513 | + ], | |
| 514 | + "success": { | |
| 515 | + "examples": [ | |
| 516 | + { | |
| 517 | + "title": "Success-Response:", | |
| 518 | + "content": "HTTP/1.1 200 OK", | |
| 519 | + "type": "json" | |
| 520 | + } | |
| 521 | + ] | |
| 522 | + }, | |
| 523 | + "error": { | |
| 524 | + "examples": [ | |
| 525 | + { | |
| 526 | + "title": "Error-Response:", | |
| 527 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 528 | + "type": "json" | |
| 529 | + } | |
| 530 | + ] | |
| 531 | + }, | |
| 532 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 533 | + "groupTitle": "Template" | |
| 534 | + }, | |
| 535 | + { | |
| 536 | + "type": "put", | |
| 537 | + "url": "/templates/:template", | |
| 538 | + "title": "Atualizar template", | |
| 539 | + "name": "editTemplate", | |
| 540 | + "group": "Template", | |
| 541 | + "version": "1.0.0", | |
| 542 | + "permission": [ | |
| 543 | + { | |
| 544 | + "name": "RO_ADMIN_TEMPLATE" | |
| 545 | + } | |
| 546 | + ], | |
| 547 | + "description": "<p>Atualiza um template.</p>", | |
| 548 | + "parameter": { | |
| 549 | + "fields": { | |
| 550 | + "Path Parameters": [ | |
| 551 | + { | |
| 552 | + "group": "Path Parameters", | |
| 553 | + "type": "String", | |
| 554 | + "optional": false, | |
| 555 | + "field": "template", | |
| 556 | + "description": "<p>Identificador do template</p>" | |
| 557 | + } | |
| 558 | + ], | |
| 559 | + "Request Body": [ | |
| 560 | + { | |
| 561 | + "group": "Request Body", | |
| 562 | + "type": "Template", | |
| 563 | + "optional": false, | |
| 564 | + "field": "template", | |
| 565 | + "description": "<p>Objeto de representação do template.</p>" | |
| 566 | + }, | |
| 567 | + { | |
| 568 | + "group": "Request Body", | |
| 569 | + "type": "String", | |
| 570 | + "optional": false, | |
| 571 | + "field": "corpo", | |
| 572 | + "description": "<p>Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados.</p>" | |
| 573 | + }, | |
| 574 | + { | |
| 575 | + "group": "Request Body", | |
| 576 | + "type": "String", | |
| 577 | + "optional": false, | |
| 578 | + "field": "descricao", | |
| 579 | + "description": "<p>Descrição do template.</p>" | |
| 580 | + }, | |
| 581 | + { | |
| 582 | + "group": "Request Body", | |
| 583 | + "type": "String", | |
| 584 | + "optional": false, | |
| 585 | + "field": "exemplo", | |
| 586 | + "description": "<p>Exemplo de request para preenchimento do template.</p>" | |
| 587 | + }, | |
| 588 | + { | |
| 589 | + "group": "Request Body", | |
| 590 | + "type": "String", | |
| 591 | + "optional": false, | |
| 592 | + "field": "nome", | |
| 593 | + "description": "<p>Identificador do template.</p>" | |
| 594 | + }, | |
| 595 | + { | |
| 596 | + "group": "Request Body", | |
| 597 | + "type": "String", | |
| 598 | + "optional": false, | |
| 599 | + "field": "responsavel", | |
| 600 | + "description": "<p>Analista responsável pelo template.</p>" | |
| 601 | + }, | |
| 602 | + { | |
| 603 | + "group": "Request Body", | |
| 604 | + "type": "String", | |
| 605 | + "optional": false, | |
| 606 | + "field": "restrito", | |
| 607 | + "description": "<p>Flag identificando se a atualização deste template � restrita.</p>" | |
| 608 | + } | |
| 609 | + ] | |
| 610 | + } | |
| 611 | + }, | |
| 612 | + "examples": [ | |
| 613 | + { | |
| 614 | + "title": "Exemplo de requisição:\t", | |
| 615 | + "content": "\tendpoint: [PUT] http://<host>/templates-broker/service/templates/confirmacao-cadastro\n\n\tbody:\n {\n \"corpo\": \"Prezado {{fulano}}, seu cadastro foi realizado com sucesso.\",\n \"descricao\": \"Template de confirmação de cadastro.\",\n \"exemplo\": \"{\"fulano\":\"André Guimarães\"}\",\n \"nome\": \"confirmacao-cadastro\",\n \"responsavel\": \"andre.guimaraes\",\n \"restrito\": true,\n }", | |
| 616 | + "type": "json" | |
| 617 | + } | |
| 618 | + ], | |
| 619 | + "success": { | |
| 620 | + "fields": { | |
| 621 | + "Sucesso - 200": [ | |
| 622 | + { | |
| 623 | + "group": "Sucesso - 200", | |
| 624 | + "type": "header", | |
| 625 | + "optional": false, | |
| 626 | + "field": "Location", | |
| 627 | + "description": "<p>Caminho para o recurso editado.</p>" | |
| 628 | + } | |
| 629 | + ] | |
| 630 | + }, | |
| 631 | + "examples": [ | |
| 632 | + { | |
| 633 | + "title": "Success-Response:", | |
| 634 | + "content": "HTTP/1.1 200 OK", | |
| 635 | + "type": "json" | |
| 636 | + } | |
| 637 | + ] | |
| 638 | + }, | |
| 639 | + "error": { | |
| 640 | + "examples": [ | |
| 641 | + { | |
| 642 | + "title": "Error-Response:", | |
| 643 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 644 | + "type": "json" | |
| 645 | + } | |
| 646 | + ] | |
| 647 | + }, | |
| 648 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 649 | + "groupTitle": "Template" | |
| 650 | + }, | |
| 651 | + { | |
| 652 | + "type": "get", | |
| 653 | + "url": "/templates/:template/corpo", | |
| 654 | + "title": "Recuperar corpo", | |
| 655 | + "name": "getCorpoTemplate", | |
| 656 | + "group": "Template", | |
| 657 | + "version": "1.0.0", | |
| 658 | + "permission": [ | |
| 659 | + { | |
| 660 | + "name": "RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE" | |
| 661 | + } | |
| 662 | + ], | |
| 663 | + "description": "<p>Recupera o corpo de um template para utilização.</p>", | |
| 664 | + "parameter": { | |
| 665 | + "fields": { | |
| 666 | + "Path Parameters": [ | |
| 667 | + { | |
| 668 | + "group": "Path Parameters", | |
| 669 | + "type": "String", | |
| 670 | + "optional": false, | |
| 671 | + "field": "template", | |
| 672 | + "description": "<p>Identificador do template</p>" | |
| 673 | + } | |
| 674 | + ] | |
| 675 | + } | |
| 676 | + }, | |
| 677 | + "examples": [ | |
| 678 | + { | |
| 679 | + "title": "Exemplo de requisição:\t", | |
| 680 | + "content": "curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro", | |
| 681 | + "type": "json" | |
| 682 | + } | |
| 683 | + ], | |
| 684 | + "success": { | |
| 685 | + "fields": { | |
| 686 | + "Sucesso - 200": [ | |
| 687 | + { | |
| 688 | + "group": "Sucesso - 200", | |
| 689 | + "type": "String", | |
| 690 | + "optional": false, | |
| 691 | + "field": "corpo", | |
| 692 | + "description": "<p>String com o corpo do template pronto para utilização.</p>" | |
| 693 | + } | |
| 694 | + ] | |
| 695 | + }, | |
| 696 | + "examples": [ | |
| 697 | + { | |
| 698 | + "title": "Success-Response:", | |
| 699 | + "content": "HTTP/1.1 200 OK\nPrezado {{fulano}}, seu cadastro foi realizado com sucesso.", | |
| 700 | + "type": "json" | |
| 701 | + } | |
| 702 | + ] | |
| 703 | + }, | |
| 704 | + "error": { | |
| 705 | + "examples": [ | |
| 706 | + { | |
| 707 | + "title": "Error-Response:", | |
| 708 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 709 | + "type": "json" | |
| 710 | + } | |
| 711 | + ] | |
| 712 | + }, | |
| 713 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 714 | + "groupTitle": "Template" | |
| 715 | + }, | |
| 716 | + { | |
| 717 | + "type": "get", | |
| 718 | + "url": "/templates/:template", | |
| 719 | + "title": "Consultar template", | |
| 720 | + "name": "getTemplate", | |
| 721 | + "group": "Template", | |
| 722 | + "version": "1.0.0", | |
| 723 | + "permission": [ | |
| 724 | + { | |
| 725 | + "name": "RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE" | |
| 726 | + } | |
| 727 | + ], | |
| 728 | + "description": "<p>Consulta um template.</p>", | |
| 729 | + "parameter": { | |
| 730 | + "fields": { | |
| 731 | + "Path Parameters": [ | |
| 732 | + { | |
| 733 | + "group": "Path Parameters", | |
| 734 | + "type": "String", | |
| 735 | + "optional": false, | |
| 736 | + "field": "template", | |
| 737 | + "description": "<p>Identificador do template</p>" | |
| 738 | + } | |
| 739 | + ] | |
| 740 | + } | |
| 741 | + }, | |
| 742 | + "examples": [ | |
| 743 | + { | |
| 744 | + "title": "Exemplo de requisição:\t", | |
| 745 | + "content": "curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro", | |
| 746 | + "type": "json" | |
| 747 | + } | |
| 748 | + ], | |
| 749 | + "success": { | |
| 750 | + "fields": { | |
| 751 | + "Sucesso - 200": [ | |
| 752 | + { | |
| 753 | + "group": "Sucesso - 200", | |
| 754 | + "type": "Template", | |
| 755 | + "optional": false, | |
| 756 | + "field": "template", | |
| 757 | + "description": "<p>Objeto representando o template.</p>" | |
| 758 | + }, | |
| 759 | + { | |
| 760 | + "group": "Sucesso - 200", | |
| 761 | + "type": "String", | |
| 762 | + "optional": false, | |
| 763 | + "field": "template.corpo", | |
| 764 | + "description": "<p>Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados.</p>" | |
| 765 | + }, | |
| 766 | + { | |
| 767 | + "group": "Sucesso - 200", | |
| 768 | + "type": "String", | |
| 769 | + "optional": false, | |
| 770 | + "field": "template.dataCadastro", | |
| 771 | + "description": "<p>Data de cadastro do template.</p>" | |
| 772 | + }, | |
| 773 | + { | |
| 774 | + "group": "Sucesso - 200", | |
| 775 | + "type": "String", | |
| 776 | + "optional": false, | |
| 777 | + "field": "template.descricao", | |
| 778 | + "description": "<p>Descrição do template.</p>" | |
| 779 | + }, | |
| 780 | + { | |
| 781 | + "group": "Sucesso - 200", | |
| 782 | + "type": "String", | |
| 783 | + "optional": false, | |
| 784 | + "field": "template.exemplo", | |
| 785 | + "description": "<p>Exemplo de request para preenchimento do template.</p>" | |
| 786 | + }, | |
| 787 | + { | |
| 788 | + "group": "Sucesso - 200", | |
| 789 | + "type": "String", | |
| 790 | + "optional": false, | |
| 791 | + "field": "template.nome", | |
| 792 | + "description": "<p>Identificador do template.</p>" | |
| 793 | + }, | |
| 794 | + { | |
| 795 | + "group": "Sucesso - 200", | |
| 796 | + "type": "String", | |
| 797 | + "optional": false, | |
| 798 | + "field": "template.responsavel", | |
| 799 | + "description": "<p>Analista responsável pelo template.</p>" | |
| 800 | + }, | |
| 801 | + { | |
| 802 | + "group": "Sucesso - 200", | |
| 803 | + "type": "Boolean", | |
| 804 | + "optional": false, | |
| 805 | + "field": "template.restrito", | |
| 806 | + "description": "<p>Flag identificando se a atualização deste template � restrita.</p>" | |
| 807 | + } | |
| 808 | + ] | |
| 809 | + }, | |
| 810 | + "examples": [ | |
| 811 | + { | |
| 812 | + "title": "Success-Response:", | |
| 813 | + "content": "HTTP/1.1 200 OK\n{\n \"corpo\": \"Prezado {{fulano}}, seu cadastro foi realizado com sucesso.\",\n \"dataCadastro\": \"2017-03-14T16:57:47.405-03:00\",\n \"descricao\": \"Template de confirmação de cadastro.\",\n \"exemplo\": \"{\"fulano\":\"André Guimarães\"}\",\n \"nome\": \"confirmacao-cadastro\",\n \"responsavel\": \"andre.guimaraes\",\n \"restrito\": false,\n}", | |
| 814 | + "type": "json" | |
| 815 | + } | |
| 816 | + ] | |
| 817 | + }, | |
| 818 | + "error": { | |
| 819 | + "examples": [ | |
| 820 | + { | |
| 821 | + "title": "Error-Response:", | |
| 822 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 823 | + "type": "json" | |
| 824 | + } | |
| 825 | + ] | |
| 826 | + }, | |
| 827 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 828 | + "groupTitle": "Template" | |
| 829 | + }, | |
| 830 | + { | |
| 831 | + "type": "get", | |
| 832 | + "url": "/templates/:template/versoes", | |
| 833 | + "title": "Listar versões", | |
| 834 | + "name": "getVersoes", | |
| 835 | + "group": "Template", | |
| 836 | + "version": "1.0.0", | |
| 837 | + "permission": [ | |
| 838 | + { | |
| 839 | + "name": "RO_ADMIN_TEMPLATE, RO_ADMIN_TEMPLATE" | |
| 840 | + } | |
| 841 | + ], | |
| 842 | + "description": "<p>Lista as versões de um template</p>", | |
| 843 | + "parameter": { | |
| 844 | + "fields": { | |
| 845 | + "Path Parameters": [ | |
| 846 | + { | |
| 847 | + "group": "Path Parameters", | |
| 848 | + "type": "String", | |
| 849 | + "optional": false, | |
| 850 | + "field": "template", | |
| 851 | + "description": "<p>Identificador do template</p>" | |
| 852 | + } | |
| 853 | + ] | |
| 854 | + } | |
| 855 | + }, | |
| 856 | + "examples": [ | |
| 857 | + { | |
| 858 | + "title": "Exemplo de requisição:\t", | |
| 859 | + "content": "curl -i http://<host>/templates-broker/service/templates/confirmacao-cadastro/versoes", | |
| 860 | + "type": "json" | |
| 861 | + } | |
| 862 | + ], | |
| 863 | + "success": { | |
| 864 | + "fields": { | |
| 865 | + "Sucesso - 200": [ | |
| 866 | + { | |
| 867 | + "group": "Sucesso - 200", | |
| 868 | + "type": "List", | |
| 869 | + "optional": false, | |
| 870 | + "field": "resultado", | |
| 871 | + "description": "<p>Lista com as versões do template.</p>" | |
| 872 | + }, | |
| 873 | + { | |
| 874 | + "group": "Sucesso - 200", | |
| 875 | + "type": "Versao", | |
| 876 | + "optional": false, | |
| 877 | + "field": "resultado.versao", | |
| 878 | + "description": "<p>Objeto representando uma versão do template.</p>" | |
| 879 | + }, | |
| 880 | + { | |
| 881 | + "group": "Sucesso - 200", | |
| 882 | + "type": "String", | |
| 883 | + "optional": false, | |
| 884 | + "field": "resultado.versao.corpo", | |
| 885 | + "description": "<p>Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados.</p>" | |
| 886 | + }, | |
| 887 | + { | |
| 888 | + "group": "Sucesso - 200", | |
| 889 | + "type": "Date", | |
| 890 | + "optional": false, | |
| 891 | + "field": "resultado.versao.data", | |
| 892 | + "description": "<p>Data da versão.</p>" | |
| 893 | + }, | |
| 894 | + { | |
| 895 | + "group": "Sucesso - 200", | |
| 896 | + "type": "String", | |
| 897 | + "optional": false, | |
| 898 | + "field": "resultado.versao.descricao", | |
| 899 | + "description": "<p>Descrição do template.</p>" | |
| 900 | + }, | |
| 901 | + { | |
| 902 | + "group": "Sucesso - 200", | |
| 903 | + "type": "String", | |
| 904 | + "optional": false, | |
| 905 | + "field": "resultado.versao.exemplo", | |
| 906 | + "description": "<p>Exemplo de request para preenchimento do template.</p>" | |
| 907 | + }, | |
| 908 | + { | |
| 909 | + "group": "Sucesso - 200", | |
| 910 | + "type": "String", | |
| 911 | + "optional": false, | |
| 912 | + "field": "resultado.versao.responsavel", | |
| 913 | + "description": "<p>Identificador do colaborador responsável.</p>" | |
| 914 | + } | |
| 915 | + ] | |
| 916 | + }, | |
| 917 | + "examples": [ | |
| 918 | + { | |
| 919 | + "title": "Success-Response:", | |
| 920 | + "content": "HTTP/1.1 200 OK\n{\n \"corpo\": \"Prezado {{fulano}}, seu cadastro foi realizado com sucesso.\",\n \"data\":\"2017-03-14T16:57:47.405-03:00\",\n \"descricao\": \"Template de confirmação de cadastro.\",\n \"exemplo\": \"{\"fulano\":\"André Guimarães\"}\",\n \"responsavel\": \"andre.guimaraes\",\n}", | |
| 921 | + "type": "json" | |
| 922 | + } | |
| 923 | + ] | |
| 924 | + }, | |
| 925 | + "error": { | |
| 926 | + "examples": [ | |
| 927 | + { | |
| 928 | + "title": "Error-Response:", | |
| 929 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 930 | + "type": "json" | |
| 931 | + } | |
| 932 | + ] | |
| 933 | + }, | |
| 934 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 935 | + "groupTitle": "Template" | |
| 936 | + }, | |
| 937 | + { | |
| 938 | + "type": "get", | |
| 939 | + "url": "/templates", | |
| 940 | + "title": "Listar templates", | |
| 941 | + "name": "listTemplates", | |
| 942 | + "group": "Template", | |
| 943 | + "version": "1.0.0", | |
| 944 | + "permission": [ | |
| 945 | + { | |
| 946 | + "name": "RO_ADMIN_TEMPLATE, RO_USUARIO_TEMPLATE" | |
| 947 | + } | |
| 948 | + ], | |
| 949 | + "description": "<p>Consulta os templates disponíveis.</p>", | |
| 950 | + "parameter": { | |
| 951 | + "fields": { | |
| 952 | + "Query Parameters": [ | |
| 953 | + { | |
| 954 | + "group": "Query Parameters", | |
| 955 | + "type": "String", | |
| 956 | + "optional": true, | |
| 957 | + "field": "filtro", | |
| 958 | + "description": "<p>Valor utilizado para filtrar os templates.</p>" | |
| 959 | + }, | |
| 960 | + { | |
| 961 | + "group": "Query Parameters", | |
| 962 | + "type": "String", | |
| 963 | + "optional": true, | |
| 964 | + "field": "itens", | |
| 965 | + "defaultValue": "20", | |
| 966 | + "description": "<p>Quantidade de templates que serão exibidos</p>" | |
| 967 | + }, | |
| 968 | + { | |
| 969 | + "group": "Query Parameters", | |
| 970 | + "type": "String", | |
| 971 | + "optional": true, | |
| 972 | + "field": "pag", | |
| 973 | + "defaultValue": "1", | |
| 974 | + "description": "<p>Número da página</p>" | |
| 975 | + } | |
| 976 | + ] | |
| 977 | + } | |
| 978 | + }, | |
| 979 | + "examples": [ | |
| 980 | + { | |
| 981 | + "title": "Exemplo de requisição:\t", | |
| 982 | + "content": "curl -i http://<host>/templates-broker/service/templates", | |
| 983 | + "type": "json" | |
| 984 | + } | |
| 985 | + ], | |
| 986 | + "success": { | |
| 987 | + "fields": { | |
| 988 | + "Sucesso - 200": [ | |
| 989 | + { | |
| 990 | + "group": "Sucesso - 200", | |
| 991 | + "type": "List", | |
| 992 | + "optional": false, | |
| 993 | + "field": "resultado", | |
| 994 | + "description": "<p>Lista com os templates encontrados.</p>" | |
| 995 | + }, | |
| 996 | + { | |
| 997 | + "group": "Sucesso - 200", | |
| 998 | + "type": "Template", | |
| 999 | + "optional": false, | |
| 1000 | + "field": "resultado.template", | |
| 1001 | + "description": "<p>Objeto representando o template.</p>" | |
| 1002 | + }, | |
| 1003 | + { | |
| 1004 | + "group": "Sucesso - 200", | |
| 1005 | + "type": "String", | |
| 1006 | + "optional": false, | |
| 1007 | + "field": "resultado.template.corpo", | |
| 1008 | + "description": "<p>Corpo do template, conteúdo que as aplicações usarão para preencher e exibir os dados.</p>" | |
| 1009 | + }, | |
| 1010 | + { | |
| 1011 | + "group": "Sucesso - 200", | |
| 1012 | + "type": "String", | |
| 1013 | + "optional": false, | |
| 1014 | + "field": "resultado.template.dataCadastro", | |
| 1015 | + "description": "<p>Data de cadastro do template.</p>" | |
| 1016 | + }, | |
| 1017 | + { | |
| 1018 | + "group": "Sucesso - 200", | |
| 1019 | + "type": "String", | |
| 1020 | + "optional": false, | |
| 1021 | + "field": "resultado.template.descricao", | |
| 1022 | + "description": "<p>Descrição do template.</p>" | |
| 1023 | + }, | |
| 1024 | + { | |
| 1025 | + "group": "Sucesso - 200", | |
| 1026 | + "type": "String", | |
| 1027 | + "optional": false, | |
| 1028 | + "field": "resultado.template.exemplo", | |
| 1029 | + "description": "<p>Exemplo de request para preenchimento do template.</p>" | |
| 1030 | + }, | |
| 1031 | + { | |
| 1032 | + "group": "Sucesso - 200", | |
| 1033 | + "type": "String", | |
| 1034 | + "optional": false, | |
| 1035 | + "field": "resultado.template.nome", | |
| 1036 | + "description": "<p>Identificador do template</p>" | |
| 1037 | + }, | |
| 1038 | + { | |
| 1039 | + "group": "Sucesso - 200", | |
| 1040 | + "type": "String", | |
| 1041 | + "optional": false, | |
| 1042 | + "field": "resultado.template.responsavel", | |
| 1043 | + "description": "<p>Analista responsável pelo template.</p>" | |
| 1044 | + }, | |
| 1045 | + { | |
| 1046 | + "group": "Sucesso - 200", | |
| 1047 | + "type": "Boolean", | |
| 1048 | + "optional": false, | |
| 1049 | + "field": "resultado.template.restrito", | |
| 1050 | + "description": "<p>Flag identificando se a atualização deste template � restrita.</p>" | |
| 1051 | + } | |
| 1052 | + ] | |
| 1053 | + }, | |
| 1054 | + "examples": [ | |
| 1055 | + { | |
| 1056 | + "title": "Success-Response:", | |
| 1057 | + "content": "HTTP/1.1 200 OK\n{\n \"corpo\": \"Prezado {{fulano}}, seu cadastro foi realizado com sucesso.\",\n \"dataCadastro\": \"2017-03-14T16:57:47.405-03:00\",\n \"descricao\": \"Template de confirmação de cadastro.\",\n \"exemplo\": \"{\"fulano\":\"André Guimarães\"}\",\n \"nome\": \"confirmacao-cadastro\",\n \"responsavel\": \"andre.guimaraes\",\n \"restrito\": false\n}", | |
| 1058 | + "type": "json" | |
| 1059 | + } | |
| 1060 | + ] | |
| 1061 | + }, | |
| 1062 | + "error": { | |
| 1063 | + "examples": [ | |
| 1064 | + { | |
| 1065 | + "title": "Error-Response:", | |
| 1066 | + "content": "HTTP/1.1 500 Internal Server Error\n{\n\t\"error\":\"Mensagem de erro.\"\n\t\"code\":\"código do erro\"\n}", | |
| 1067 | + "type": "json" | |
| 1068 | + } | |
| 1069 | + ] | |
| 1070 | + }, | |
| 1071 | + "filename": "templates-broker/src/main/java/br/gov/ans/templates/rest/TemplateResource.java", | |
| 1072 | + "groupTitle": "Template" | |
| 1073 | + } | |
| 1074 | +] | ... | ... |
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +define({ | |
| 2 | + "name": "templates-broker", | |
| 3 | + "version": "1.0.0", | |
| 4 | + "description": "API de manipulação de templates", | |
| 5 | + "title": "Documentação - templates-broker", | |
| 6 | + "url": "http://<host>/templates-broker/service", | |
| 7 | + "sampleUrl": false, | |
| 8 | + "apidoc": "0.2.0", | |
| 9 | + "generator": { | |
| 10 | + "name": "apidoc", | |
| 11 | + "time": "2017-03-17T12:50:53.461Z", | |
| 12 | + "url": "http://apidocjs.com", | |
| 13 | + "version": "0.15.1" | |
| 14 | + } | |
| 15 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +{ | |
| 2 | + "name": "templates-broker", | |
| 3 | + "version": "1.0.0", | |
| 4 | + "description": "API de manipulação de templates", | |
| 5 | + "title": "Documentação - templates-broker", | |
| 6 | + "url": "http://<host>/templates-broker/service", | |
| 7 | + "sampleUrl": false, | |
| 8 | + "apidoc": "0.2.0", | |
| 9 | + "generator": { | |
| 10 | + "name": "apidoc", | |
| 11 | + "time": "2017-03-17T12:50:53.461Z", | |
| 12 | + "url": "http://apidocjs.com", | |
| 13 | + "version": "0.15.1" | |
| 14 | + } | |
| 15 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,532 @@ |
| 1 | +/* ------------------------------------------------------------------------------------------ | |
| 2 | + * Content | |
| 3 | + * ------------------------------------------------------------------------------------------ */ | |
| 4 | +body { | |
| 5 | + min-width: 980px; | |
| 6 | + max-width: 1280px; | |
| 7 | +} | |
| 8 | + | |
| 9 | +body, p, a, div, th, td { | |
| 10 | + font-family: "Source Sans Pro", monospace, sans-serif; | |
| 11 | + font-weight: 400; | |
| 12 | + font-size: 16px; | |
| 13 | +} | |
| 14 | + | |
| 15 | +td.code { | |
| 16 | + font-size: 14px; | |
| 17 | + font-family: "Source Code Pro", monospace; | |
| 18 | + font-style: normal; | |
| 19 | + font-weight: 400; | |
| 20 | +} | |
| 21 | + | |
| 22 | +#content { | |
| 23 | + padding-top: 16px; | |
| 24 | + z-Index: -1; | |
| 25 | + margin-left: 270px; | |
| 26 | +} | |
| 27 | + | |
| 28 | +p { | |
| 29 | + color: #808080; | |
| 30 | +} | |
| 31 | + | |
| 32 | +h1 { | |
| 33 | + font-family: "Source Sans Pro Semibold", monospace, sans-serif; | |
| 34 | + font-weight: normal; | |
| 35 | + font-size: 44px; | |
| 36 | + line-height: 50px; | |
| 37 | + margin: 0 0 10px 0; | |
| 38 | + padding: 0; | |
| 39 | +} | |
| 40 | + | |
| 41 | +h2 { | |
| 42 | + font-family: "Source Sans Pro", monospace, sans-serif; | |
| 43 | + font-weight: normal; | |
| 44 | + font-size: 24px; | |
| 45 | + line-height: 40px; | |
| 46 | + margin: 0 0 20px 0; | |
| 47 | + padding: 0; | |
| 48 | +} | |
| 49 | + | |
| 50 | +section { | |
| 51 | + border-top: 1px solid #ebebeb; | |
| 52 | + padding: 30px 0; | |
| 53 | +} | |
| 54 | + | |
| 55 | +section h1 { | |
| 56 | + font-family: "Source Sans Pro", monospace, sans-serif; | |
| 57 | + font-weight: 700; | |
| 58 | + font-size: 32px; | |
| 59 | + line-height: 40px; | |
| 60 | + padding-bottom: 14px; | |
| 61 | + margin: 0 0 20px 0; | |
| 62 | + padding: 0; | |
| 63 | +} | |
| 64 | + | |
| 65 | +article { | |
| 66 | + padding: 14px 0 30px 0; | |
| 67 | +} | |
| 68 | + | |
| 69 | +article h1 { | |
| 70 | + font-family: "Source Sans Pro Bold", monospace, sans-serif; | |
| 71 | + font-weight: 600; | |
| 72 | + font-size: 24px; | |
| 73 | + line-height: 26px; | |
| 74 | +} | |
| 75 | + | |
| 76 | +article h2 { | |
| 77 | + font-family: "Source Sans Pro", monospace, sans-serif; | |
| 78 | + font-weight: 600; | |
| 79 | + font-size: 18px; | |
| 80 | + line-height: 24px; | |
| 81 | + margin: 0 0 10px 0; | |
| 82 | +} | |
| 83 | + | |
| 84 | +article h3 { | |
| 85 | + font-family: "Source Sans Pro", monospace, sans-serif; | |
| 86 | + font-weight: 600; | |
| 87 | + font-size: 16px; | |
| 88 | + line-height: 18px; | |
| 89 | + margin: 0 0 10px 0; | |
| 90 | +} | |
| 91 | + | |
| 92 | +article h4 { | |
| 93 | + font-family: "Source Sans Pro", monospace, sans-serif; | |
| 94 | + font-weight: 600; | |
| 95 | + font-size: 14px; | |
| 96 | + line-height: 16px; | |
| 97 | + margin: 0 0 8px 0; | |
| 98 | +} | |
| 99 | + | |
| 100 | +table { | |
| 101 | + border-collapse: collapse; | |
| 102 | + width: 100%; | |
| 103 | + margin: 0 0 20px 0; | |
| 104 | +} | |
| 105 | + | |
| 106 | +th { | |
| 107 | + background-color: #f5f5f5; | |
| 108 | + text-align: left; | |
| 109 | + font-family: "Source Sans Pro", monospace, sans-serif; | |
| 110 | + font-weight: 700; | |
| 111 | + padding: 4px 8px; | |
| 112 | + border: #e0e0e0 1px solid; | |
| 113 | +} | |
| 114 | + | |
| 115 | +td { | |
| 116 | + vertical-align: top; | |
| 117 | + padding: 2px 8px; | |
| 118 | + border: #e0e0e0 1px solid; | |
| 119 | +} | |
| 120 | + | |
| 121 | +#generator .content { | |
| 122 | + color: #b0b0b0; | |
| 123 | + border-top: 1px solid #ebebeb; | |
| 124 | + padding: 10px 0; | |
| 125 | +} | |
| 126 | + | |
| 127 | +.label-optional { | |
| 128 | + float: right; | |
| 129 | +} | |
| 130 | + | |
| 131 | +.open-left { | |
| 132 | + right: 0; | |
| 133 | + left: auto; | |
| 134 | +} | |
| 135 | + | |
| 136 | +/* ------------------------------------------------------------------------------------------ | |
| 137 | + * apidoc - intro | |
| 138 | + * ------------------------------------------------------------------------------------------ */ | |
| 139 | + | |
| 140 | +#apidoc .apidoc { | |
| 141 | + border-top: 1px solid #ebebeb; | |
| 142 | + padding: 30px 0; | |
| 143 | +} | |
| 144 | + | |
| 145 | +#apidoc h1 { | |
| 146 | + font-family: "Source Sans Pro", monospace, sans-serif; | |
| 147 | + font-weight: 700; | |
| 148 | + font-size: 32px; | |
| 149 | + line-height: 40px; | |
| 150 | + padding-bottom: 14px; | |
| 151 | + margin: 0 0 20px 0; | |
| 152 | + padding: 0; | |
| 153 | +} | |
| 154 | + | |
| 155 | +#apidoc h2 { | |
| 156 | + font-family: "Source Sans Pro Bold", monospace, sans-serif; | |
| 157 | + font-weight: 600; | |
| 158 | + font-size: 22px; | |
| 159 | + line-height: 26px; | |
| 160 | + padding-top: 14px; | |
| 161 | +} | |
| 162 | + | |
| 163 | +/* ------------------------------------------------------------------------------------------ | |
| 164 | + * pre / code | |
| 165 | + * ------------------------------------------------------------------------------------------ */ | |
| 166 | +pre { | |
| 167 | + background-color: #292b36; | |
| 168 | + color: #ffffff; | |
| 169 | + padding: 10px; | |
| 170 | + border-radius: 6px; | |
| 171 | + position: relative; | |
| 172 | + margin: 10px 0 20px 0; | |
| 173 | +} | |
| 174 | + | |
| 175 | +code.language-text { | |
| 176 | + word-wrap: break-word; | |
| 177 | +} | |
| 178 | + | |
| 179 | +pre.language-json { | |
| 180 | + overflow: auto; | |
| 181 | +} | |
| 182 | + | |
| 183 | +pre.language-html { | |
| 184 | + margin: 40px 0 20px 0; | |
| 185 | +} | |
| 186 | + | |
| 187 | +pre.language-html:before { | |
| 188 | + content: attr(data-type); | |
| 189 | + position: absolute; | |
| 190 | + top: -30px; | |
| 191 | + left: 0; | |
| 192 | + font-family: "Source Sans Pro", monospace, sans-serif; | |
| 193 | + font-weight: 600; | |
| 194 | + font-size: 15px; | |
| 195 | + display: inline-block; | |
| 196 | + padding: 2px 5px; | |
| 197 | + border-radius: 6px; | |
| 198 | + text-transform: uppercase; | |
| 199 | + background-color: #3387CC; | |
| 200 | + color: #ffffff; | |
| 201 | +} | |
| 202 | + | |
| 203 | +pre.language-html[data-type="get"]:before { | |
| 204 | + background-color: green; | |
| 205 | +} | |
| 206 | + | |
| 207 | +pre.language-html[data-type="put"]:before { | |
| 208 | + background-color: #e5c500; | |
| 209 | +} | |
| 210 | + | |
| 211 | +pre.language-html[data-type="post"]:before { | |
| 212 | + background-color: #4070ec; | |
| 213 | +} | |
| 214 | + | |
| 215 | +pre.language-html[data-type="delete"]:before { | |
| 216 | + background-color: #ed0039; | |
| 217 | +} | |
| 218 | + | |
| 219 | +pre.language-api .str { | |
| 220 | + color: #ffffff; | |
| 221 | +} | |
| 222 | + | |
| 223 | +pre.language-api .pln, | |
| 224 | +pre.language-api .pun { | |
| 225 | + color: #65B042; | |
| 226 | +} | |
| 227 | + | |
| 228 | +pre code { | |
| 229 | + display: block; | |
| 230 | + font-size: 14px; | |
| 231 | + font-family: "Source Code Pro"; | |
| 232 | + font-style: normal; | |
| 233 | + font-weight: 400; | |
| 234 | + word-wrap: normal; | |
| 235 | + white-space: pre; | |
| 236 | +} | |
| 237 | + | |
| 238 | +pre code.sample-request-response-json { | |
| 239 | + white-space: pre-wrap; | |
| 240 | + max-height: 500px; | |
| 241 | + overflow: auto; | |
| 242 | +} | |
| 243 | + | |
| 244 | +/* ------------------------------------------------------------------------------------------ | |
| 245 | + * Sidenav | |
| 246 | + * ------------------------------------------------------------------------------------------ */ | |
| 247 | +.sidenav { | |
| 248 | + width: 228px; | |
| 249 | + margin: 0; | |
| 250 | + padding: 20px; | |
| 251 | + position: fixed; | |
| 252 | + top: 0; | |
| 253 | + left: 0; | |
| 254 | + bottom: 0; | |
| 255 | + overflow-x: hidden; | |
| 256 | + overflow-y: auto; | |
| 257 | + background-color: #f5f5f5; | |
| 258 | + z-index: 10; | |
| 259 | +} | |
| 260 | + | |
| 261 | +.sidenav > li > a { | |
| 262 | + display: block; | |
| 263 | + width: 192px; | |
| 264 | + margin: 0; | |
| 265 | + padding: 2px 11px; | |
| 266 | + border: 0; | |
| 267 | + border-left: transparent 4px solid; | |
| 268 | + border-right: transparent 4px solid; | |
| 269 | + font-family: "Source Sans Pro", monospace, sans-serif; | |
| 270 | + font-weight: 400; | |
| 271 | + font-size: 14px; | |
| 272 | +} | |
| 273 | + | |
| 274 | +.sidenav > li.nav-header > a { | |
| 275 | + padding: 5px 15px; | |
| 276 | + border: 1px solid #e5e5e5; | |
| 277 | + width: 190px; | |
| 278 | + font-family: "Source Sans Pro", monospace, sans-serif; | |
| 279 | + font-weight: 700; | |
| 280 | + font-size: 16px; | |
| 281 | + background-color: #ffffff; | |
| 282 | +} | |
| 283 | + | |
| 284 | +.sidenav > li.nav-header.active > a { | |
| 285 | + background-color: #0088cc; | |
| 286 | +} | |
| 287 | + | |
| 288 | +.sidenav > .active > a { | |
| 289 | + position: relative; | |
| 290 | + z-index: 2; | |
| 291 | +} | |
| 292 | + | |
| 293 | +.sidenav > li > a:hover { | |
| 294 | + background-color: #ffffff; | |
| 295 | +} | |
| 296 | + | |
| 297 | +.sidenav > li.has-modifications a { | |
| 298 | + border-right: #60d060 4px solid; | |
| 299 | +} | |
| 300 | + | |
| 301 | +.sidenav > li.is-new a { | |
| 302 | + border-left: #e5e5e5 4px solid; | |
| 303 | +} | |
| 304 | + | |
| 305 | +/* ------------------------------------------------------------------------------------------ | |
| 306 | + * Compare | |
| 307 | + * ------------------------------------------------------------------------------------------ */ | |
| 308 | + | |
| 309 | +ins { | |
| 310 | + background: #60d060; | |
| 311 | + text-decoration: none; | |
| 312 | + color: #000000; | |
| 313 | +} | |
| 314 | + | |
| 315 | +del { | |
| 316 | + background: #f05050; | |
| 317 | + color: #000000; | |
| 318 | +} | |
| 319 | + | |
| 320 | +.label-ins { | |
| 321 | + background-color: #60d060; | |
| 322 | +} | |
| 323 | + | |
| 324 | +.label-del { | |
| 325 | + background-color: #f05050; | |
| 326 | + text-decoration: line-through; | |
| 327 | +} | |
| 328 | + | |
| 329 | +pre.ins { | |
| 330 | + background-color: #60d060; | |
| 331 | +} | |
| 332 | + | |
| 333 | +pre.del { | |
| 334 | + background-color: #f05050; | |
| 335 | + text-decoration: line-through; | |
| 336 | +} | |
| 337 | + | |
| 338 | +table.ins th, | |
| 339 | +table.ins td { | |
| 340 | + background-color: #60d060; | |
| 341 | +} | |
| 342 | + | |
| 343 | +table.del th, | |
| 344 | +table.del td { | |
| 345 | + background-color: #f05050; | |
| 346 | + text-decoration: line-through; | |
| 347 | +} | |
| 348 | + | |
| 349 | +tr.ins td { | |
| 350 | + background-color: #60d060; | |
| 351 | +} | |
| 352 | + | |
| 353 | +tr.del td { | |
| 354 | + background-color: #f05050; | |
| 355 | + text-decoration: line-through; | |
| 356 | +} | |
| 357 | + | |
| 358 | +/* ------------------------------------------------------------------------------------------ | |
| 359 | + * Spinner | |
| 360 | + * ------------------------------------------------------------------------------------------ */ | |
| 361 | + | |
| 362 | +#loader { | |
| 363 | + position: absolute; | |
| 364 | + width: 100%; | |
| 365 | +} | |
| 366 | + | |
| 367 | +#loader p { | |
| 368 | + padding-top: 80px; | |
| 369 | + margin-left: -4px; | |
| 370 | +} | |
| 371 | + | |
| 372 | +.spinner { | |
| 373 | + margin: 200px auto; | |
| 374 | + width: 60px; | |
| 375 | + height: 60px; | |
| 376 | + position: relative; | |
| 377 | +} | |
| 378 | + | |
| 379 | +.container1 > div, .container2 > div, .container3 > div { | |
| 380 | + width: 14px; | |
| 381 | + height: 14px; | |
| 382 | + background-color: #0088cc; | |
| 383 | + | |
| 384 | + border-radius: 100%; | |
| 385 | + position: absolute; | |
| 386 | + -webkit-animation: bouncedelay 1.2s infinite ease-in-out; | |
| 387 | + animation: bouncedelay 1.2s infinite ease-in-out; | |
| 388 | + /* Prevent first frame from flickering when animation starts */ | |
| 389 | + -webkit-animation-fill-mode: both; | |
| 390 | + animation-fill-mode: both; | |
| 391 | +} | |
| 392 | + | |
| 393 | +.spinner .spinner-container { | |
| 394 | + position: absolute; | |
| 395 | + width: 100%; | |
| 396 | + height: 100%; | |
| 397 | +} | |
| 398 | + | |
| 399 | +.container2 { | |
| 400 | + -webkit-transform: rotateZ(45deg); | |
| 401 | + transform: rotateZ(45deg); | |
| 402 | +} | |
| 403 | + | |
| 404 | +.container3 { | |
| 405 | + -webkit-transform: rotateZ(90deg); | |
| 406 | + transform: rotateZ(90deg); | |
| 407 | +} | |
| 408 | + | |
| 409 | +.circle1 { top: 0; left: 0; } | |
| 410 | +.circle2 { top: 0; right: 0; } | |
| 411 | +.circle3 { right: 0; bottom: 0; } | |
| 412 | +.circle4 { left: 0; bottom: 0; } | |
| 413 | + | |
| 414 | +.container2 .circle1 { | |
| 415 | + -webkit-animation-delay: -1.1s; | |
| 416 | + animation-delay: -1.1s; | |
| 417 | +} | |
| 418 | + | |
| 419 | +.container3 .circle1 { | |
| 420 | + -webkit-animation-delay: -1.0s; | |
| 421 | + animation-delay: -1.0s; | |
| 422 | +} | |
| 423 | + | |
| 424 | +.container1 .circle2 { | |
| 425 | + -webkit-animation-delay: -0.9s; | |
| 426 | + animation-delay: -0.9s; | |
| 427 | +} | |
| 428 | + | |
| 429 | +.container2 .circle2 { | |
| 430 | + -webkit-animation-delay: -0.8s; | |
| 431 | + animation-delay: -0.8s; | |
| 432 | +} | |
| 433 | + | |
| 434 | +.container3 .circle2 { | |
| 435 | + -webkit-animation-delay: -0.7s; | |
| 436 | + animation-delay: -0.7s; | |
| 437 | +} | |
| 438 | + | |
| 439 | +.container1 .circle3 { | |
| 440 | + -webkit-animation-delay: -0.6s; | |
| 441 | + animation-delay: -0.6s; | |
| 442 | +} | |
| 443 | + | |
| 444 | +.container2 .circle3 { | |
| 445 | + -webkit-animation-delay: -0.5s; | |
| 446 | + animation-delay: -0.5s; | |
| 447 | +} | |
| 448 | + | |
| 449 | +.container3 .circle3 { | |
| 450 | + -webkit-animation-delay: -0.4s; | |
| 451 | + animation-delay: -0.4s; | |
| 452 | +} | |
| 453 | + | |
| 454 | +.container1 .circle4 { | |
| 455 | + -webkit-animation-delay: -0.3s; | |
| 456 | + animation-delay: -0.3s; | |
| 457 | +} | |
| 458 | + | |
| 459 | +.container2 .circle4 { | |
| 460 | + -webkit-animation-delay: -0.2s; | |
| 461 | + animation-delay: -0.2s; | |
| 462 | +} | |
| 463 | + | |
| 464 | +.container3 .circle4 { | |
| 465 | + -webkit-animation-delay: -0.1s; | |
| 466 | + animation-delay: -0.1s; | |
| 467 | +} | |
| 468 | + | |
| 469 | +@-webkit-keyframes bouncedelay { | |
| 470 | + 0%, 80%, 100% { -webkit-transform: scale(0.0) } | |
| 471 | + 40% { -webkit-transform: scale(1.0) } | |
| 472 | +} | |
| 473 | + | |
| 474 | +@keyframes bouncedelay { | |
| 475 | + 0%, 80%, 100% { | |
| 476 | + transform: scale(0.0); | |
| 477 | + -webkit-transform: scale(0.0); | |
| 478 | + } 40% { | |
| 479 | + transform: scale(1.0); | |
| 480 | + -webkit-transform: scale(1.0); | |
| 481 | + } | |
| 482 | +} | |
| 483 | + | |
| 484 | +/* ------------------------------------------------------------------------------------------ | |
| 485 | + * Tabs | |
| 486 | + * ------------------------------------------------------------------------------------------ */ | |
| 487 | +ul.nav-tabs { | |
| 488 | + margin: 0; | |
| 489 | +} | |
| 490 | + | |
| 491 | +/* ------------------------------------------------------------------------------------------ | |
| 492 | ||
| 493 | + * ------------------------------------------------------------------------------------------ */ | |
| 494 | + | |
| 495 | +@media print { | |
| 496 | + | |
| 497 | + #sidenav, | |
| 498 | + #version, | |
| 499 | + #versions, | |
| 500 | + section .version, | |
| 501 | + section .versions { | |
| 502 | + display: none; | |
| 503 | + } | |
| 504 | + | |
| 505 | + #content { | |
| 506 | + margin-left: 0; | |
| 507 | + } | |
| 508 | + | |
| 509 | + a { | |
| 510 | + text-decoration: none; | |
| 511 | + color: inherit; | |
| 512 | + } | |
| 513 | + | |
| 514 | + a:after { | |
| 515 | + content: " [" attr(href) "] "; | |
| 516 | + } | |
| 517 | + | |
| 518 | + p { | |
| 519 | + color: #000000 | |
| 520 | + } | |
| 521 | + | |
| 522 | + pre { | |
| 523 | + background-color: #ffffff; | |
| 524 | + color: #000000; | |
| 525 | + padding: 10px; | |
| 526 | + border: #808080 1px solid; | |
| 527 | + border-radius: 6px; | |
| 528 | + position: relative; | |
| 529 | + margin: 10px 0 20px 0; | |
| 530 | + } | |
| 531 | + | |
| 532 | +} /* /@media print */ | ... | ... |
No preview for this file type
8.57 KB
12.5 KB
| ... | ... | @@ -0,0 +1,658 @@ |
| 1 | +<!DOCTYPE html> | |
| 2 | +<html> | |
| 3 | +<head> | |
| 4 | + <title>Loading...</title> | |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| 6 | + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| 7 | + <link href="vendor/bootstrap.min.css" rel="stylesheet" media="screen"> | |
| 8 | + <link href="vendor/prettify.css" rel="stylesheet" media="screen"> | |
| 9 | + <link href="css/style.css" rel="stylesheet" media="screen, print"> | |
| 10 | + <link href="img/favicon.ico" rel="icon" type="image/x-icon"> | |
| 11 | + <script src="vendor/polyfill.js"></script> | |
| 12 | +</head> | |
| 13 | +<body> | |
| 14 | + | |
| 15 | +<script id="template-sidenav" type="text/x-handlebars-template"> | |
| 16 | +<nav id="scrollingNav"> | |
| 17 | + <ul class="sidenav nav nav-list"> | |
| 18 | + {{#each nav}} | |
| 19 | + {{#if title}} | |
| 20 | + {{#if isHeader}} | |
| 21 | + {{#if isFixed}} | |
| 22 | + <li class="nav-fixed nav-header" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li> | |
| 23 | + {{else}} | |
| 24 | + <li class="nav-header" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li> | |
| 25 | + {{/if}} | |
| 26 | + {{else}} | |
| 27 | + <li {{#if hidden}}class="hide" {{/if}}data-group="{{group}}" data-name="{{name}}" data-version="{{version}}"> | |
| 28 | + <a href="#api-{{group}}-{{name}}">{{title}}</a> | |
| 29 | + </li> | |
| 30 | + {{/if}} | |
| 31 | + {{/if}} | |
| 32 | + {{/each}} | |
| 33 | + </ul> | |
| 34 | +</nav> | |
| 35 | +</script> | |
| 36 | + | |
| 37 | +<script id="template-project" type="text/x-handlebars-template"> | |
| 38 | + <div class="pull-left"> | |
| 39 | + <h1>{{name}}</h1> | |
| 40 | + {{#if description}}<h2>{{{nl2br description}}}</h2>{{/if}} | |
| 41 | + </div> | |
| 42 | + {{#if template.withCompare}} | |
| 43 | + <div class="pull-right"> | |
| 44 | + <div class="btn-group"> | |
| 45 | + <button id="version" class="btn btn-large dropdown-toggle" data-toggle="dropdown"> | |
| 46 | + <strong>{{version}}</strong> <span class="caret"></span> | |
| 47 | + </button> | |
| 48 | + <ul id="versions" class="dropdown-menu open-left"> | |
| 49 | + <li><a id="compareAllWithPredecessor" href="#">{{__ "Compare all with predecessor"}}</a></li> | |
| 50 | + <li class="divider"></li> | |
| 51 | + <li class="disabled"><a href="#">{{__ "show up to version:"}}</a></li> | |
| 52 | + {{#each versions}} | |
| 53 | + <li class="version"><a href="#">{{this}}</a></li> | |
| 54 | + {{/each}} | |
| 55 | + </ul> | |
| 56 | + </div> | |
| 57 | + </div> | |
| 58 | + {{/if}} | |
| 59 | + <div class="clearfix"></div> | |
| 60 | +</script> | |
| 61 | + | |
| 62 | +<script id="template-header" type="text/x-handlebars-template"> | |
| 63 | + {{#if content}} | |
| 64 | + <div id="api-_">{{{content}}}</div> | |
| 65 | + {{/if}} | |
| 66 | +</script> | |
| 67 | + | |
| 68 | +<script id="template-footer" type="text/x-handlebars-template"> | |
| 69 | + {{#if content}} | |
| 70 | + <div id="api-_footer">{{{content}}}</div> | |
| 71 | + {{/if}} | |
| 72 | +</script> | |
| 73 | + | |
| 74 | +<script id="template-generator" type="text/x-handlebars-template"> | |
| 75 | + {{#if template.withGenerator}} | |
| 76 | + {{#if generator}} | |
| 77 | + <div class="content"> | |
| 78 | + {{__ "Generated with"}} <a href="{{{generator.url}}}">{{{generator.name}}}</a> {{{generator.version}}} - {{{generator.time}}} | |
| 79 | + </div> | |
| 80 | + {{/if}} | |
| 81 | + {{/if}} | |
| 82 | +</script> | |
| 83 | + | |
| 84 | +<script id="template-sections" type="text/x-handlebars-template"> | |
| 85 | + <section id="api-{{group}}"> | |
| 86 | + <h1>{{underscoreToSpace title}}</h1> | |
| 87 | + {{#if description}} | |
| 88 | + <p>{{{nl2br description}}}</p> | |
| 89 | + {{/if}} | |
| 90 | + {{#each articles}} | |
| 91 | + <div id="api-{{group}}-{{name}}"> | |
| 92 | + {{{article}}} | |
| 93 | + </div> | |
| 94 | + {{/each}} | |
| 95 | + </section> | |
| 96 | +</script> | |
| 97 | + | |
| 98 | +<script id="template-article" type="text/x-handlebars-template"> | |
| 99 | + <article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}"> | |
| 100 | + <div class="pull-left"> | |
| 101 | + <h1>{{article.groupTitle}}{{#if article.title}} - {{article.title}}{{/if}}</h1> | |
| 102 | + </div> | |
| 103 | + {{#if template.withCompare}} | |
| 104 | + <div class="pull-right"> | |
| 105 | + <div class="btn-group"> | |
| 106 | + <button class="version btn dropdown-toggle" data-toggle="dropdown"> | |
| 107 | + <strong>{{article.version}}</strong> <span class="caret"></span> | |
| 108 | + </button> | |
| 109 | + <ul class="versions dropdown-menu open-left"> | |
| 110 | + <li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li> | |
| 111 | + {{#each versions}} | |
| 112 | + <li class="version"><a href="#">{{this}}</a></li> | |
| 113 | + {{/each}} | |
| 114 | + </ul> | |
| 115 | + </div> | |
| 116 | + </div> | |
| 117 | + {{/if}} | |
| 118 | + <div class="clearfix"></div> | |
| 119 | + | |
| 120 | + {{#if article.description}} | |
| 121 | + <p>{{{nl2br article.description}}}</p> | |
| 122 | + {{/if}} | |
| 123 | + | |
| 124 | + <pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{article.url}}</code></pre> | |
| 125 | + | |
| 126 | + {{#if article.permission}} | |
| 127 | + <p> | |
| 128 | + {{__ "Permission:"}} | |
| 129 | + {{#each article.permission}} | |
| 130 | + {{name}} | |
| 131 | + {{#if title}} | |
| 132 | + <a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br description}}" title="" data-original-title="{{title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a> | |
| 133 | + {{#unless @last}}, {{/unless}} | |
| 134 | + {{/if}} | |
| 135 | + {{/each}} | |
| 136 | + </p> | |
| 137 | + {{/if}} | |
| 138 | + | |
| 139 | + {{#if_gt article.examples.length compare=0}} | |
| 140 | + <ul class="nav nav-tabs nav-tabs-examples"> | |
| 141 | + {{#each article.examples}} | |
| 142 | + <li{{#if_eq @index compare=0}} class="active"{{/if_eq}}> | |
| 143 | + <a href="#examples-{{../id}}-{{@index}}">{{title}}</a> | |
| 144 | + </li> | |
| 145 | + {{/each}} | |
| 146 | + </ul> | |
| 147 | + | |
| 148 | + <div class="tab-content"> | |
| 149 | + {{#each article.examples}} | |
| 150 | + <div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="examples-{{../id}}-{{@index}}"> | |
| 151 | + <pre class="prettyprint language-{{type}}" data-type="{{type}}"><code>{{content}}</code></pre> | |
| 152 | + </div> | |
| 153 | + {{/each}} | |
| 154 | + </div> | |
| 155 | + {{/if_gt}} | |
| 156 | + | |
| 157 | + {{subTemplate "article-param-block" params=article.header _hasType=_hasTypeInHeaderFields section="header"}} | |
| 158 | + {{subTemplate "article-param-block" params=article.parameter _hasType=_hasTypeInParameterFields section="parameter"}} | |
| 159 | + {{subTemplate "article-param-block" params=article.success _hasType=_hasTypeInSuccessFields section="success"}} | |
| 160 | + {{subTemplate "article-param-block" params=article.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}} | |
| 161 | + | |
| 162 | + {{subTemplate "article-sample-request" article=article id=id}} | |
| 163 | + | |
| 164 | + </article> | |
| 165 | +</script> | |
| 166 | + | |
| 167 | +<script id="template-article-param-block" type="text/x-handlebars-template"> | |
| 168 | + {{#if params}} | |
| 169 | + {{#each params.fields}} | |
| 170 | + <h2>{{__ @key}}</h2> | |
| 171 | + <table> | |
| 172 | + <thead> | |
| 173 | + <tr> | |
| 174 | + <th style="width: 30%">{{#if ../../_col1}}{{__ ../../_col1}}{{else}}{{__ "Field"}}{{/if}}</th> | |
| 175 | + {{#if ../../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}} | |
| 176 | + <th style="width: {{#if _hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th> | |
| 177 | + </tr> | |
| 178 | + </thead> | |
| 179 | + <tbody> | |
| 180 | + {{#each this}} | |
| 181 | + <tr> | |
| 182 | + <td class="code">{{{splitFill field "." " "}}}{{#if optional}} <span class="label label-optional">{{__ "optional"}}</span>{{/if}}</td> | |
| 183 | + {{#if ../../_hasType}} | |
| 184 | + <td> | |
| 185 | + {{{type}}} | |
| 186 | + </td> | |
| 187 | + {{/if}} | |
| 188 | + <td> | |
| 189 | + {{{nl2br description}}} | |
| 190 | + {{#if defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{defaultValue}}}</code></p>{{/if}} | |
| 191 | + {{#if size}}<p class="type-size">{{__ "Size range:"}} <code>{{{size}}}</code></p>{{/if}} | |
| 192 | + {{#if allowedValues}}<p class="type-size">{{__ "Allowed values:"}} | |
| 193 | + {{#each allowedValues}} | |
| 194 | + <code>{{{this}}}</code>{{#unless @last}}, {{/unless}} | |
| 195 | + {{/each}} | |
| 196 | + </p> | |
| 197 | + {{/if}} | |
| 198 | + </td> | |
| 199 | + </tr> | |
| 200 | + {{/each}} | |
| 201 | + </tbody> | |
| 202 | + </table> | |
| 203 | + {{/each}} | |
| 204 | + | |
| 205 | + {{#if_gt params.examples.length compare=0}} | |
| 206 | + <ul class="nav nav-tabs nav-tabs-examples"> | |
| 207 | + {{#each params.examples}} | |
| 208 | + <li{{#if_eq @index compare=0}} class="active"{{/if_eq}}> | |
| 209 | + <a href="#{{../section}}-examples-{{../id}}-{{@index}}">{{title}}</a> | |
| 210 | + </li> | |
| 211 | + {{/each}} | |
| 212 | + </ul> | |
| 213 | + | |
| 214 | + <div class="tab-content"> | |
| 215 | + {{#each params.examples}} | |
| 216 | + <div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="{{../section}}-examples-{{../id}}-{{@index}}"> | |
| 217 | + <pre class="prettyprint language-{{type}}" data-type="{{type}}"><code>{{content}}</code></pre> | |
| 218 | + </div> | |
| 219 | + {{/each}} | |
| 220 | + </div> | |
| 221 | + {{/if_gt}} | |
| 222 | + | |
| 223 | + {{/if}} | |
| 224 | +</script> | |
| 225 | + | |
| 226 | +<script id="template-article-sample-request" type="text/x-handlebars-template"> | |
| 227 | + {{#if article.sampleRequest}} | |
| 228 | + <h2>{{__ "Send a Sample Request"}}</h2> | |
| 229 | + <form class="form-horizontal"> | |
| 230 | + <fieldset> | |
| 231 | + <div class="control-group"> | |
| 232 | + <div class="controls"> | |
| 233 | + <div class="input-prepend">> | |
| 234 | + <span class="add-on">{{__ "url"}}</span> | |
| 235 | + <input type="text" class="input-xxlarge sample-request-url" value="{{article.sampleRequest.0.url}}" /> | |
| 236 | + </div> | |
| 237 | + </div> | |
| 238 | + </div> | |
| 239 | + | |
| 240 | + {{#if article.header}} | |
| 241 | + {{#if article.header.fields}} | |
| 242 | + <h3>{{__ "Headers"}}</h3> | |
| 243 | + {{#each article.header.fields}} | |
| 244 | + <h4><input type="radio" data-sample-request-header-group-id="sample-request-header-{{@index}}" name="{{../id}}-sample-request-header" value="{{@index}}" class="sample-request-header sample-request-switch"{{#if_eq @index compare=0}} checked{{/if_eq}}> {{@key}}</h4> | |
| 245 | + <div class="{{../id}}-sample-request-header-fields{{#if_gt @index compare=0}} hide{{/if_gt}}"> | |
| 246 | + {{#each this}} | |
| 247 | + <div class="control-group"> | |
| 248 | + <label class="control-label" for="sample-request-header-field-{{field}}">{{field}}</label> | |
| 249 | + <div class="controls"> | |
| 250 | + <div class="input-append">> | |
| 251 | + <input type="text" placeholder="{{field}}" class="input-xxlarge sample-request-header" data-sample-request-header-name="{{field}}" data-sample-request-header-group="sample-request-header-{{@../index}}"> | |
| 252 | + <span class="add-on">{{{type}}}</span> | |
| 253 | + </div> | |
| 254 | + </div> | |
| 255 | + </div> | |
| 256 | + {{/each}} | |
| 257 | + </div> | |
| 258 | + {{/each}} | |
| 259 | + {{/if}} | |
| 260 | + {{/if}} | |
| 261 | + | |
| 262 | + {{#if article.parameter}} | |
| 263 | + {{#if article.parameter.fields}} | |
| 264 | + <h3>{{__ "Parameters"}}</h3> | |
| 265 | + {{#each article.parameter.fields}} | |
| 266 | + <h4><input type="radio" data-sample-request-param-group-id="sample-request-param-{{@index}}" name="{{../id}}-sample-request-param" value="{{@index}}" class="sample-request-param sample-request-switch"{{#if_eq @index compare=0}} checked{{/if_eq}}> {{@key}}</h4> | |
| 267 | + <div class="{{../id}}-sample-request-param-fields{{#if_gt @index compare=0}} hide{{/if_gt}}"> | |
| 268 | + {{#each this}} | |
| 269 | + <div class="control-group"> | |
| 270 | + <label class="control-label" for="sample-request-param-field-{{field}}">{{field}}</label> | |
| 271 | + <div class="controls"> | |
| 272 | + <div class="input-append">> | |
| 273 | + <input type="text" placeholder="{{field}}" class="input-xxlarge sample-request-param" data-sample-request-param-name="{{field}}" data-sample-request-param-group="sample-request-param-{{@../index}}"> | |
| 274 | + <span class="add-on">{{{type}}}</span> | |
| 275 | + </div> | |
| 276 | + </div> | |
| 277 | + </div> | |
| 278 | + {{/each}} | |
| 279 | + </div> | |
| 280 | + {{/each}} | |
| 281 | + {{/if}} | |
| 282 | + {{/if}} | |
| 283 | + | |
| 284 | + <div class="control-group"> | |
| 285 | + <div class="controls"> | |
| 286 | + <button class="btn btn-default sample-request-send" data-sample-request-type="{{article.type}}">{{__ "Send"}}</button> | |
| 287 | + </div> | |
| 288 | + </div> | |
| 289 | + | |
| 290 | + <div class="sample-request-response" style="display: none;"> | |
| 291 | + <h3> | |
| 292 | + {{__ "Response"}} | |
| 293 | + <button class="btn btn-small btn-default pull-right sample-request-clear">X</button> | |
| 294 | + </h3> | |
| 295 | + <pre class="prettyprint language-json" data-type="json"><code class="sample-request-response-json"></code></pre> | |
| 296 | + </div> | |
| 297 | + | |
| 298 | + </fieldset> | |
| 299 | + </form> | |
| 300 | + {{/if}} | |
| 301 | +</script> | |
| 302 | + | |
| 303 | +<script id="template-compare-article" type="text/x-handlebars-template"> | |
| 304 | + <article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}" data-compare-version="{{compare.version}}"> | |
| 305 | + <div class="pull-left"> | |
| 306 | + <h1>{{underscoreToSpace article.group}} - {{{showDiff article.title compare.title}}}</h1> | |
| 307 | + </div> | |
| 308 | + | |
| 309 | + <div class="pull-right"> | |
| 310 | + <div class="btn-group"> | |
| 311 | + <button class="btn btn-success" disabled> | |
| 312 | + <strong>{{article.version}}</strong> {{__ "compared to"}} | |
| 313 | + </button> | |
| 314 | + <button class="version btn btn-danger dropdown-toggle" data-toggle="dropdown"> | |
| 315 | + <strong>{{compare.version}}</strong> <span class="caret"></span> | |
| 316 | + </button> | |
| 317 | + <ul class="versions dropdown-menu open-left"> | |
| 318 | + <li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li> | |
| 319 | + <li class="divider"></li> | |
| 320 | + {{#each versions}} | |
| 321 | + <li class="version"><a href="#">{{this}}</a></li> | |
| 322 | + {{/each}} | |
| 323 | + </ul> | |
| 324 | + </div> | |
| 325 | + </div> | |
| 326 | + <div class="clearfix"></div> | |
| 327 | + | |
| 328 | + {{#if article.description}} | |
| 329 | + <p>{{{showDiff article.description compare.description "nl2br"}}}</p> | |
| 330 | + {{else}} | |
| 331 | + {{#if compare.description}} | |
| 332 | + <p>{{{showDiff "" compare.description "nl2br"}}}</p> | |
| 333 | + {{/if}} | |
| 334 | + {{/if}} | |
| 335 | + | |
| 336 | + <pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{{showDiff article.url compare.url}}}</code></pre> | |
| 337 | + | |
| 338 | + {{subTemplate "article-compare-permission" article=article compare=compare}} | |
| 339 | + | |
| 340 | + <ul class="nav nav-tabs nav-tabs-examples"> | |
| 341 | + {{#each_compare_title article.examples compare.examples}} | |
| 342 | + | |
| 343 | + {{#if typeSame}} | |
| 344 | + <li{{#if_eq index compare=0}} class="active"{{/if_eq}}> | |
| 345 | + <a href="#compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a> | |
| 346 | + </li> | |
| 347 | + {{/if}} | |
| 348 | + | |
| 349 | + {{#if typeIns}} | |
| 350 | + <li{{#if_eq index compare=0}} class="active"{{/if_eq}}> | |
| 351 | + <a href="#compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a> | |
| 352 | + </li> | |
| 353 | + {{/if}} | |
| 354 | + | |
| 355 | + {{#if typeDel}} | |
| 356 | + <li{{#if_eq index compare=0}} class="active"{{/if_eq}}> | |
| 357 | + <a href="#compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a> | |
| 358 | + </li> | |
| 359 | + {{/if}} | |
| 360 | + | |
| 361 | + {{/each_compare_title}} | |
| 362 | + </ul> | |
| 363 | + | |
| 364 | + <div class="tab-content"> | |
| 365 | + {{#each_compare_title article.examples compare.examples}} | |
| 366 | + | |
| 367 | + {{#if typeSame}} | |
| 368 | + <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}"> | |
| 369 | + <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre> | |
| 370 | + </div> | |
| 371 | + {{/if}} | |
| 372 | + | |
| 373 | + {{#if typeIns}} | |
| 374 | + <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}"> | |
| 375 | + <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre> | |
| 376 | + </div> | |
| 377 | + {{/if}} | |
| 378 | + | |
| 379 | + {{#if typeDel}} | |
| 380 | + <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}"> | |
| 381 | + <pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre> | |
| 382 | + </div> | |
| 383 | + {{/if}} | |
| 384 | + | |
| 385 | + {{/each_compare_title}} | |
| 386 | + </div> | |
| 387 | + | |
| 388 | + {{subTemplate "article-compare-param-block" source=article.parameter compare=compare.parameter _hasType=_hasTypeInParameterFields section="parameter"}} | |
| 389 | + {{subTemplate "article-compare-param-block" source=article.success compare=compare.success _hasType=_hasTypeInSuccessFields section="success"}} | |
| 390 | + {{subTemplate "article-compare-param-block" source=article.error compare=compare.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}} | |
| 391 | + | |
| 392 | + {{subTemplate "article-sample-request" article=article id=id}} | |
| 393 | + | |
| 394 | + </article> | |
| 395 | +</script> | |
| 396 | + | |
| 397 | +<script id="template-article-compare-permission" type="text/x-handlebars-template"> | |
| 398 | + {{#each_compare_list_field article.permission compare.permission field="name"}} | |
| 399 | + {{#if source}} | |
| 400 | + {{#if typeSame}} | |
| 401 | + {{source.name}} | |
| 402 | + {{#if source.title}} | |
| 403 | + <a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br source.description}}" title="" data-original-title="{{source.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a> | |
| 404 | + {{#unless _last}}, {{/unless}} | |
| 405 | + {{/if}} | |
| 406 | + {{/if}} | |
| 407 | + | |
| 408 | + {{#if typeIns}} | |
| 409 | + <ins>{{source.name}}</ins> | |
| 410 | + {{#if source.title}} | |
| 411 | + <a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br source.description}}" title="" data-original-title="{{source.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a> | |
| 412 | + {{#unless _last}}, {{/unless}} | |
| 413 | + {{/if}} | |
| 414 | + {{/if}} | |
| 415 | + | |
| 416 | + {{#if typeDel}} | |
| 417 | + <del>{{source.name}}</del> | |
| 418 | + {{#if source.title}} | |
| 419 | + <a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br source.description}}" title="" data-original-title="{{source.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a> | |
| 420 | + {{#unless _last}}, {{/unless}} | |
| 421 | + {{/if}} | |
| 422 | + {{/if}} | |
| 423 | + {{else}} | |
| 424 | + {{#if typeSame}} | |
| 425 | + {{compare.name}} | |
| 426 | + {{#if compare.title}} | |
| 427 | + <a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br compare.description}}" title="" data-original-title="{{compare.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a> | |
| 428 | + {{#unless _last}}, {{/unless}} | |
| 429 | + {{/if}} | |
| 430 | + {{/if}} | |
| 431 | + | |
| 432 | + {{#if typeIns}} | |
| 433 | + <ins>{{compare.name}}</ins> | |
| 434 | + {{#if compare.title}} | |
| 435 | + <a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br compare.description}}" title="" data-original-title="{{compare.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a> | |
| 436 | + {{#unless _last}}, {{/unless}} | |
| 437 | + {{/if}} | |
| 438 | + {{/if}} | |
| 439 | + | |
| 440 | + {{#if typeDel}} | |
| 441 | + <del>{{compare.name}}</del> | |
| 442 | + {{#if compare.title}} | |
| 443 | + <a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br compare.description}}" title="" data-original-title="{{compare.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a> | |
| 444 | + {{#unless _last}}, {{/unless}} | |
| 445 | + {{/if}} | |
| 446 | + {{/if}} | |
| 447 | + {{/if}} | |
| 448 | + {{/each_compare_list_field}} | |
| 449 | +</script> | |
| 450 | + | |
| 451 | +<script id="template-article-compare-param-block" type="text/x-handlebars-template"> | |
| 452 | + {{#if source}} | |
| 453 | + {{#each_compare_keys source.fields compare.fields}} | |
| 454 | + {{#if typeSame}} | |
| 455 | + <h2>{{__ source.key}}</h2> | |
| 456 | + <table> | |
| 457 | + <thead> | |
| 458 | + <tr> | |
| 459 | + <th style="width: 30%">{{#if ../../_col1}}{{__ ../../_col1}}{{else}}{{__ "Field"}}{{/if}}</th> | |
| 460 | + {{#if ../../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}} | |
| 461 | + <th style="width: {{#if _hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th> | |
| 462 | + </tr> | |
| 463 | + </thead> | |
| 464 | + {{subTemplate "article-compare-param-block-body" source=source.value compare=compare.value _hasType=../../_hasType}} | |
| 465 | + </table> | |
| 466 | + {{/if}} | |
| 467 | + | |
| 468 | + {{#if typeIns}} | |
| 469 | + <h2><ins>{{__ source.key}}</ins></h2> | |
| 470 | + <table class="ins"> | |
| 471 | + <thead> | |
| 472 | + <tr> | |
| 473 | + <th style="width: 30%">{{#if ../../_col1}}{{__ ../../_col1}}{{else}}{{__ "Field"}}{{/if}}</th> | |
| 474 | + {{#if ../../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}} | |
| 475 | + <th style="width: {{#if _hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th> | |
| 476 | + </tr> | |
| 477 | + </thead> | |
| 478 | + {{subTemplate "article-compare-param-block-body" source=source.value compare=source.value _hasType=../../_hasType}} | |
| 479 | + </table> | |
| 480 | + {{/if}} | |
| 481 | + | |
| 482 | + {{#if typeDel}} | |
| 483 | + <h2><del>{{__ compare.key}}</del></h2> | |
| 484 | + <table class="del"> | |
| 485 | + <thead> | |
| 486 | + <tr> | |
| 487 | + <th style="width: 30%">{{#if ../../_col1}}{{__ ../../_col1}}{{else}}{{__ "Field"}}{{/if}}</th> | |
| 488 | + {{#if ../../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}} | |
| 489 | + <th style="width: {{#if _hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th> | |
| 490 | + </tr> | |
| 491 | + </thead> | |
| 492 | + {{subTemplate "article-compare-param-block-body" source=compare.value compare=compare.value _hasType=../../_hasType}} | |
| 493 | + </table> | |
| 494 | + {{/if}} | |
| 495 | + {{/each_compare_keys}} | |
| 496 | + | |
| 497 | + <ul class="nav nav-tabs nav-tabs-examples"> | |
| 498 | + {{#each_compare_title source.examples compare.examples}} | |
| 499 | + | |
| 500 | + {{#if typeSame}} | |
| 501 | + <li{{#if_eq index compare=0}} class="active"{{/if_eq}}> | |
| 502 | + <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a> | |
| 503 | + </li> | |
| 504 | + {{/if}} | |
| 505 | + | |
| 506 | + {{#if typeIns}} | |
| 507 | + <li{{#if_eq index compare=0}} class="active"{{/if_eq}}> | |
| 508 | + <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a> | |
| 509 | + </li> | |
| 510 | + {{/if}} | |
| 511 | + | |
| 512 | + {{#if typeDel}} | |
| 513 | + <li{{#if_eq index compare=0}} class="active"{{/if_eq}}> | |
| 514 | + <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a> | |
| 515 | + </li> | |
| 516 | + {{/if}} | |
| 517 | + | |
| 518 | + {{/each_compare_title}} | |
| 519 | + </ul> | |
| 520 | + | |
| 521 | + <div class="tab-content"> | |
| 522 | + {{#each_compare_title source.examples compare.examples}} | |
| 523 | + | |
| 524 | + {{#if typeSame}} | |
| 525 | + <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"> | |
| 526 | + <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre> | |
| 527 | + </div> | |
| 528 | + {{/if}} | |
| 529 | + | |
| 530 | + {{#if typeIns}} | |
| 531 | + <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"> | |
| 532 | + <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre> | |
| 533 | + </div> | |
| 534 | + {{/if}} | |
| 535 | + | |
| 536 | + {{#if typeDel}} | |
| 537 | + <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"> | |
| 538 | + <pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre> | |
| 539 | + </div> | |
| 540 | + {{/if}} | |
| 541 | + | |
| 542 | + {{/each_compare_title}} | |
| 543 | + </div> | |
| 544 | + | |
| 545 | + {{/if}} | |
| 546 | +</script> | |
| 547 | + | |
| 548 | +<script id="template-article-compare-param-block-body" type="text/x-handlebars-template"> | |
| 549 | + <tbody> | |
| 550 | + {{#each_compare_field source compare}} | |
| 551 | + {{#if typeSame}} | |
| 552 | + <tr> | |
| 553 | + <td class="code"> | |
| 554 | + {{{splitFill source.field "." " "}}} | |
| 555 | + {{#if source.optional}} | |
| 556 | + {{#if compare.optional}} <span class="label label-optional">{{__ "optional"}}</span> | |
| 557 | + {{else}} <span class="label label-optional label-ins">{{__ "optional"}}</span> | |
| 558 | + {{/if}} | |
| 559 | + {{else}} | |
| 560 | + {{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}} | |
| 561 | + {{/if}} | |
| 562 | + </td> | |
| 563 | + | |
| 564 | + {{#if source.type}} | |
| 565 | + {{#if compare.type}} | |
| 566 | + <td>{{{showDiff source.type compare.type}}}</td> | |
| 567 | + {{else}} | |
| 568 | + <td>{{{source.type}}}</td> | |
| 569 | + {{/if}} | |
| 570 | + {{else}} | |
| 571 | + {{#if compare.type}} | |
| 572 | + <td>{{{compare.type}}}</td> | |
| 573 | + {{else}} | |
| 574 | + {{#if ../../../../_hasType}}<td></td>{{/if}} | |
| 575 | + {{/if}} | |
| 576 | + {{/if}} | |
| 577 | + <td> | |
| 578 | + {{{showDiff source.description compare.description "nl2br"}}} | |
| 579 | + {{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{showDiff source.defaultValue compare.defaultValue}}}</code><p>{{/if}} | |
| 580 | + </td> | |
| 581 | + </tr> | |
| 582 | + {{/if}} | |
| 583 | + | |
| 584 | + {{#if typeIns}} | |
| 585 | + <tr class="ins"> | |
| 586 | + <td class="code"> | |
| 587 | + {{{splitFill source.field "." " "}}} | |
| 588 | + {{#if source.optional}} <span class="label label-optional label-ins">{{__ "optional"}}</span>{{/if}} | |
| 589 | + </td> | |
| 590 | + | |
| 591 | + {{#if source.type}} | |
| 592 | + <td>{{{source.type}}}</td> | |
| 593 | + {{else}} | |
| 594 | + {{{typRowTd}}} | |
| 595 | + {{/if}} | |
| 596 | + | |
| 597 | + <td> | |
| 598 | + {{{nl2br source.description}}} | |
| 599 | + {{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{source.defaultValue}}}</code><p>{{/if}} | |
| 600 | + </td> | |
| 601 | + </tr> | |
| 602 | + {{/if}} | |
| 603 | + | |
| 604 | + {{#if typeDel}} | |
| 605 | + <tr class="del"> | |
| 606 | + <td class="code"> | |
| 607 | + {{{splitFill compare.field "." " "}}} | |
| 608 | + {{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}} | |
| 609 | + </td> | |
| 610 | + | |
| 611 | + {{#if compare.type}} | |
| 612 | + <td>{{{compare.type}}}</td> | |
| 613 | + {{else}} | |
| 614 | + {{{typRowTd}}} | |
| 615 | + {{/if}} | |
| 616 | + | |
| 617 | + <td> | |
| 618 | + {{{nl2br compare.description}}} | |
| 619 | + {{#if compare.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{compare.defaultValue}}}</code><p>{{/if}} | |
| 620 | + </td> | |
| 621 | + </tr> | |
| 622 | + {{/if}} | |
| 623 | + | |
| 624 | + {{/each_compare_field}} | |
| 625 | + </tbody> | |
| 626 | +</script> | |
| 627 | + | |
| 628 | +<div class="container-fluid"> | |
| 629 | + <div class="row-fluid"> | |
| 630 | + <div id="sidenav" class="span2"></div> | |
| 631 | + <div id="content"> | |
| 632 | + <div id="project"></div> | |
| 633 | + <div id="header"></div> | |
| 634 | + <div id="sections"></div> | |
| 635 | + <div id="footer"></div> | |
| 636 | + <div id="generator"></div> | |
| 637 | + </div> | |
| 638 | + </div> | |
| 639 | +</div> | |
| 640 | + | |
| 641 | +<div id="loader"> | |
| 642 | + <div class="spinner"> | |
| 643 | + <div class="spinner-container container1"> | |
| 644 | + <div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div> | |
| 645 | + </div> | |
| 646 | + <div class="spinner-container container2"> | |
| 647 | + <div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div> | |
| 648 | + </div> | |
| 649 | + <div class="spinner-container container3"> | |
| 650 | + <div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div> | |
| 651 | + </div> | |
| 652 | + <p>Loading...</p> | |
| 653 | + </div> | |
| 654 | +</div> | |
| 655 | + | |
| 656 | +<script data-main="main.js" src="vendor/require.min.js"></script> | |
| 657 | +</body> | |
| 658 | +</html> | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +define({ | |
| 2 | + ca: { | |
| 3 | + 'Allowed values:' : 'Valors permesos:', | |
| 4 | + 'Compare all with predecessor': 'Comparar tot amb versió anterior', | |
| 5 | + 'compare changes to:' : 'comparar canvis amb:', | |
| 6 | + 'compared to' : 'comparat amb', | |
| 7 | + 'Default value:' : 'Valor per defecte:', | |
| 8 | + 'Description' : 'Descripció', | |
| 9 | + 'Field' : 'Camp', | |
| 10 | + 'General' : 'General', | |
| 11 | + 'Generated with' : 'Generat amb', | |
| 12 | + 'Name' : 'Nom', | |
| 13 | + 'No response values.' : 'Sense valors en la resposta.', | |
| 14 | + 'optional' : 'opcional', | |
| 15 | + 'Parameter' : 'Paràmetre', | |
| 16 | + 'Permission:' : 'Permisos:', | |
| 17 | + 'Response' : 'Resposta', | |
| 18 | + 'Send' : 'Enviar', | |
| 19 | + 'Send a Sample Request' : 'Enviar una petició d\'exemple', | |
| 20 | + 'show up to version:' : 'mostrar versió:', | |
| 21 | + 'Size range:' : 'Tamany de rang:', | |
| 22 | + 'Type' : 'Tipus', | |
| 23 | + 'url' : 'url' | |
| 24 | + } | |
| 25 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +define({ | |
| 2 | + de: { | |
| 3 | + 'Allowed values:' : 'Erlaubte Werte:', | |
| 4 | + 'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern', | |
| 5 | + 'compare changes to:' : 'vergleiche Änderungen mit:', | |
| 6 | + 'compared to' : 'verglichen mit', | |
| 7 | + 'Default value:' : 'Standardwert:', | |
| 8 | + 'Description' : 'Beschreibung', | |
| 9 | + 'Field' : 'Feld', | |
| 10 | + 'General' : 'Allgemein', | |
| 11 | + 'Generated with' : 'Erstellt mit', | |
| 12 | + 'Name' : 'Name', | |
| 13 | + 'No response values.' : 'Keine Rückgabewerte.', | |
| 14 | + 'optional' : 'optional', | |
| 15 | + 'Parameter' : 'Parameter', | |
| 16 | + 'Permission:' : 'Berechtigung:', | |
| 17 | + 'Response' : 'Antwort', | |
| 18 | + 'Send' : 'Senden', | |
| 19 | + 'Send a Sample Request' : 'Eine Beispielanfrage senden', | |
| 20 | + 'show up to version:' : 'zeige bis zur Version:', | |
| 21 | + 'Size range:' : 'Größenbereich:', | |
| 22 | + 'Type' : 'Typ', | |
| 23 | + 'url' : 'url' | |
| 24 | + } | |
| 25 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +define({ | |
| 2 | + es: { | |
| 3 | + 'Allowed values:' : 'Valores permitidos:', | |
| 4 | + 'Compare all with predecessor': 'Comparar todo con versión anterior', | |
| 5 | + 'compare changes to:' : 'comparar cambios con:', | |
| 6 | + 'compared to' : 'comparado con', | |
| 7 | + 'Default value:' : 'Valor por defecto:', | |
| 8 | + 'Description' : 'Descripción', | |
| 9 | + 'Field' : 'Campo', | |
| 10 | + 'General' : 'General', | |
| 11 | + 'Generated with' : 'Generado con', | |
| 12 | + 'Name' : 'Nombre', | |
| 13 | + 'No response values.' : 'Sin valores en la respuesta.', | |
| 14 | + 'optional' : 'opcional', | |
| 15 | + 'Parameter' : 'Parámetro', | |
| 16 | + 'Permission:' : 'Permisos:', | |
| 17 | + 'Response' : 'Respuesta', | |
| 18 | + 'Send' : 'Enviar', | |
| 19 | + 'Send a Sample Request' : 'Enviar una petición de ejemplo', | |
| 20 | + 'show up to version:' : 'mostrar a versión:', | |
| 21 | + 'Size range:' : 'Tamaño de rango:', | |
| 22 | + 'Type' : 'Tipo', | |
| 23 | + 'url' : 'url' | |
| 24 | + } | |
| 25 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +define({ | |
| 2 | + fr: { | |
| 3 | + 'Allowed values:' : 'Valeurs autorisées :', | |
| 4 | + 'Compare all with predecessor': 'Tout comparer avec ...', | |
| 5 | + 'compare changes to:' : 'comparer les changements à :', | |
| 6 | + 'compared to' : 'comparer à', | |
| 7 | + 'Default value:' : 'Valeur par défaut :', | |
| 8 | + 'Description' : 'Description', | |
| 9 | + 'Field' : 'Champ', | |
| 10 | + 'General' : 'Général', | |
| 11 | + 'Generated with' : 'Généré avec', | |
| 12 | + 'Name' : 'Nom', | |
| 13 | + 'No response values.' : 'Aucune valeur de réponse.', | |
| 14 | + 'optional' : 'optionnel', | |
| 15 | + 'Parameter' : 'Paramètre', | |
| 16 | + 'Permission:' : 'Permission :', | |
| 17 | + 'Response' : 'Réponse', | |
| 18 | + 'Send' : 'Envoyer', | |
| 19 | + 'Send a Sample Request' : 'Envoyer une requête représentative', | |
| 20 | + 'show up to version:' : 'Montrer à partir de la version :', | |
| 21 | + 'Size range:' : 'Ordre de grandeur :', | |
| 22 | + 'Type' : 'Type', | |
| 23 | + 'url' : 'url' | |
| 24 | + } | |
| 25 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,46 @@ |
| 1 | +define([ | |
| 2 | + './locales/ca.js', | |
| 3 | + './locales/de.js', | |
| 4 | + './locales/es.js', | |
| 5 | + './locales/fr.js', | |
| 6 | + './locales/nl.js', | |
| 7 | + './locales/pl.js', | |
| 8 | + './locales/pt_br.js', | |
| 9 | + './locales/ru.js', | |
| 10 | + './locales/zh.js', | |
| 11 | + './locales/zh_cn.js' | |
| 12 | +], function() { | |
| 13 | + var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_'); | |
| 14 | + var language = langId.substr(0, 2); | |
| 15 | + var locales = {}; | |
| 16 | + | |
| 17 | + for (index in arguments) { | |
| 18 | + for (property in arguments[index]) | |
| 19 | + locales[property] = arguments[index][property]; | |
| 20 | + } | |
| 21 | + if ( ! locales['en']) | |
| 22 | + locales['en'] = {}; | |
| 23 | + | |
| 24 | + if ( ! locales[langId] && ! locales[language]) | |
| 25 | + language = 'en'; | |
| 26 | + | |
| 27 | + var locale = (locales[langId] ? locales[langId] : locales[language]); | |
| 28 | + | |
| 29 | + function __(text) { | |
| 30 | + var index = locale[text]; | |
| 31 | + if (index === undefined) | |
| 32 | + return text; | |
| 33 | + return index; | |
| 34 | + }; | |
| 35 | + | |
| 36 | + function setLanguage(language) { | |
| 37 | + locale = locales[language]; | |
| 38 | + } | |
| 39 | + | |
| 40 | + return { | |
| 41 | + __ : __, | |
| 42 | + locales : locales, | |
| 43 | + locale : locale, | |
| 44 | + setLanguage: setLanguage | |
| 45 | + }; | |
| 46 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +define({ | |
| 2 | + nl: { | |
| 3 | + 'Allowed values:' : 'Toegestane waarden:', | |
| 4 | + 'Compare all with predecessor': 'Vergelijk alle met voorgaande versie', | |
| 5 | + 'compare changes to:' : 'vergelijk veranderingen met:', | |
| 6 | + 'compared to' : 'vergelijk met', | |
| 7 | + 'Default value:' : 'Standaard waarde:', | |
| 8 | + 'Description' : 'Omschrijving', | |
| 9 | + 'Field' : 'Veld', | |
| 10 | + 'General' : 'Algemeen', | |
| 11 | + 'Generated with' : 'Gegenereerd met', | |
| 12 | + 'Name' : 'Naam', | |
| 13 | + 'No response values.' : 'Geen response waardes.', | |
| 14 | + 'optional' : 'optioneel', | |
| 15 | + 'Parameter' : 'Parameter', | |
| 16 | + 'Permission:' : 'Permissie:', | |
| 17 | + 'Response' : 'Antwoorden', | |
| 18 | + 'Send' : 'Sturen', | |
| 19 | + 'Send a Sample Request' : 'Stuur een sample aanvragen', | |
| 20 | + 'show up to version:' : 'toon tot en met versie:', | |
| 21 | + 'Size range:' : 'Maatbereik:', | |
| 22 | + 'Type' : 'Type', | |
| 23 | + 'url' : 'url' | |
| 24 | + } | |
| 25 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +define({ | |
| 2 | + pl: { | |
| 3 | + 'Allowed values:' : 'Dozwolone wartości:', | |
| 4 | + 'Compare all with predecessor': 'Porównaj z poprzednimi wersjami', | |
| 5 | + 'compare changes to:' : 'porównaj zmiany do:', | |
| 6 | + 'compared to' : 'porównaj do:', | |
| 7 | + 'Default value:' : 'Wartość domyślna:', | |
| 8 | + 'Description' : 'Opis', | |
| 9 | + 'Field' : 'Pole', | |
| 10 | + 'General' : 'Generalnie', | |
| 11 | + 'Generated with' : 'Wygenerowano z', | |
| 12 | + 'Name' : 'Nazwa', | |
| 13 | + 'No response values.' : 'Brak odpowiedzi.', | |
| 14 | + 'optional' : 'opcjonalny', | |
| 15 | + 'Parameter' : 'Parametr', | |
| 16 | + 'Permission:' : 'Uprawnienia:', | |
| 17 | + 'Response' : 'Odpowiedź', | |
| 18 | + 'Send' : 'Wyślij', | |
| 19 | + 'Send a Sample Request' : 'Wyślij przykładowe żądanie', | |
| 20 | + 'show up to version:' : 'pokaż do wersji:', | |
| 21 | + 'Size range:' : 'Zakres rozmiaru:', | |
| 22 | + 'Type' : 'Typ', | |
| 23 | + 'url' : 'url' | |
| 24 | + } | |
| 25 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +define({ | |
| 2 | + 'pt_br': { | |
| 3 | + 'Allowed values:' : 'Valores permitidos:', | |
| 4 | + 'Compare all with predecessor': 'Compare todos com antecessores', | |
| 5 | + 'compare changes to:' : 'comparar alterações com:', | |
| 6 | + 'compared to' : 'comparado com', | |
| 7 | + 'Default value:' : 'Valor padrão:', | |
| 8 | + 'Description' : 'Descrição', | |
| 9 | + 'Field' : 'Campo', | |
| 10 | + 'General' : 'Geral', | |
| 11 | + 'Generated with' : 'Gerado com', | |
| 12 | + 'Name' : 'Nome', | |
| 13 | + 'No response values.' : 'Sem valores de resposta.', | |
| 14 | + 'optional' : 'opcional', | |
| 15 | + 'Parameter' : 'Parâmetro', | |
| 16 | + 'Permission:' : 'Permissão:', | |
| 17 | + 'Response' : 'Resposta', | |
| 18 | + 'Send' : 'Enviar', | |
| 19 | + 'Send a Sample Request' : 'Enviar um Exemplo de Pedido', | |
| 20 | + 'show up to version:' : 'aparecer para a versão:', | |
| 21 | + 'Size range:' : 'Faixa de tamanho:', | |
| 22 | + 'Type' : 'Tipo', | |
| 23 | + 'url' : 'url' | |
| 24 | + } | |
| 25 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +define({ | |
| 2 | + ru: { | |
| 3 | + 'Allowed values:' : 'Допустимые значения:', | |
| 4 | + 'Compare all with predecessor': 'Сравнить с предыдущей версией', | |
| 5 | + 'compare changes to:' : 'сравнить с:', | |
| 6 | + 'compared to' : 'в сравнении с', | |
| 7 | + 'Default value:' : 'По умолчанию:', | |
| 8 | + 'Description' : 'Описание', | |
| 9 | + 'Field' : 'Название', | |
| 10 | + 'General' : 'Общая информация', | |
| 11 | + 'Generated with' : 'Сгенерировано с помощью', | |
| 12 | + 'Name' : 'Название', | |
| 13 | + 'No response values.' : 'Нет значений для ответа.', | |
| 14 | + 'optional' : 'необязательный', | |
| 15 | + 'Parameter' : 'Параметр', | |
| 16 | + 'Permission:' : 'Разрешено:', | |
| 17 | + 'Response' : 'Ответ', | |
| 18 | + 'Send' : 'Отправить', | |
| 19 | + 'Send a Sample Request' : 'Отправить тестовый запрос', | |
| 20 | + 'show up to version:' : 'показать версию:', | |
| 21 | + 'Size range:' : 'Ограничения:', | |
| 22 | + 'Type' : 'Тип', | |
| 23 | + 'url' : 'URL' | |
| 24 | + } | |
| 25 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +define({ | |
| 2 | + zh: { | |
| 3 | + 'Allowed values:' : '允許值:', | |
| 4 | + 'Compare all with predecessor': '預先比較所有', | |
| 5 | + 'compare changes to:' : '比較變更:', | |
| 6 | + 'compared to' : '對比', | |
| 7 | + 'Default value:' : '默認值:', | |
| 8 | + 'Description' : '描述', | |
| 9 | + 'Field' : '字段', | |
| 10 | + 'General' : '概括', | |
| 11 | + 'Generated with' : '生成工具', | |
| 12 | + 'Name' : '名稱', | |
| 13 | + 'No response values.' : '無對應資料.', | |
| 14 | + 'optional' : '選項', | |
| 15 | + 'Parameter' : '參數', | |
| 16 | + 'Permission:' : '允許:', | |
| 17 | + 'Response' : '回應', | |
| 18 | + 'Send' : '發送', | |
| 19 | + 'Send a Sample Request' : '發送試用需求', | |
| 20 | + 'show up to version:' : '顯示到版本:', | |
| 21 | + 'Size range:' : '尺寸範圍:', | |
| 22 | + 'Type' : '類型', | |
| 23 | + 'url' : '網址' | |
| 24 | + } | |
| 25 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +define({ | |
| 2 | + 'zh_cn': { | |
| 3 | + 'Allowed values:' : '允许值:', | |
| 4 | + 'Compare all with predecessor': '与所有较早的比较', | |
| 5 | + 'compare changes to:' : '将当前版本与指定版本比较:', | |
| 6 | + 'compared to' : '相比于', | |
| 7 | + 'Default value:' : '默认值:', | |
| 8 | + 'Description' : '描述', | |
| 9 | + 'Field' : '字段', | |
| 10 | + 'General' : '概要', | |
| 11 | + 'Generated with' : '基于', | |
| 12 | + 'Name' : '名称', | |
| 13 | + 'No response values.' : '无返回值.', | |
| 14 | + 'optional' : '可选', | |
| 15 | + 'Parameter' : '参数', | |
| 16 | + 'Permission:' : '权限:', | |
| 17 | + 'Response' : '返回', | |
| 18 | + 'Send' : '发送', | |
| 19 | + 'Send a Sample Request' : '发送示例请求', | |
| 20 | + 'show up to version:' : '显示到指定版本:', | |
| 21 | + 'Size range:' : '取值范围:', | |
| 22 | + 'Type' : '类型', | |
| 23 | + 'url' : '网址' | |
| 24 | + } | |
| 25 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,705 @@ |
| 1 | +require.config({ | |
| 2 | + paths: { | |
| 3 | + bootstrap: './vendor/bootstrap.min', | |
| 4 | + diffMatchPatch: './vendor/diff_match_patch.min', | |
| 5 | + handlebars: './vendor/handlebars.min', | |
| 6 | + handlebarsExtended: './utils/handlebars_helper', | |
| 7 | + jquery: './vendor/jquery.min', | |
| 8 | + locales: './locales/locale', | |
| 9 | + lodash: './vendor/lodash.min', | |
| 10 | + pathToRegexp: './vendor/path-to-regexp/index', | |
| 11 | + prettify: './vendor/prettify/prettify', | |
| 12 | + semver: './vendor/semver.min', | |
| 13 | + utilsSampleRequest: './utils/send_sample_request', | |
| 14 | + webfontloader: './vendor/webfontloader' | |
| 15 | + }, | |
| 16 | + shim: { | |
| 17 | + bootstrap: { | |
| 18 | + deps: ['jquery'] | |
| 19 | + }, | |
| 20 | + diffMatchPatch: { | |
| 21 | + exports: 'diff_match_patch' | |
| 22 | + }, | |
| 23 | + handlebars: { | |
| 24 | + exports: 'Handlebars' | |
| 25 | + }, | |
| 26 | + handlebarsExtended: { | |
| 27 | + deps: ['jquery', 'handlebars'], | |
| 28 | + exports: 'Handlebars' | |
| 29 | + }, | |
| 30 | + prettify: { | |
| 31 | + exports: 'prettyPrint' | |
| 32 | + } | |
| 33 | + }, | |
| 34 | + urlArgs: 'v=' + (new Date()).getTime(), | |
| 35 | + waitSeconds: 15 | |
| 36 | +}); | |
| 37 | + | |
| 38 | +require([ | |
| 39 | + 'jquery', | |
| 40 | + 'lodash', | |
| 41 | + 'locales', | |
| 42 | + 'handlebarsExtended', | |
| 43 | + './api_project.js', | |
| 44 | + './api_data.js', | |
| 45 | + 'prettify', | |
| 46 | + 'utilsSampleRequest', | |
| 47 | + 'semver', | |
| 48 | + 'webfontloader', | |
| 49 | + 'bootstrap', | |
| 50 | + 'pathToRegexp' | |
| 51 | +], function($, _, locale, Handlebars, apiProject, apiData, prettyPrint, sampleRequest, semver, WebFont) { | |
| 52 | + | |
| 53 | + // load google web fonts | |
| 54 | + loadGoogleFontCss(); | |
| 55 | + | |
| 56 | + var api = apiData.api; | |
| 57 | + | |
| 58 | + // | |
| 59 | + // Templates | |
| 60 | + // | |
| 61 | + var templateHeader = Handlebars.compile( $('#template-header').html() ); | |
| 62 | + var templateFooter = Handlebars.compile( $('#template-footer').html() ); | |
| 63 | + var templateArticle = Handlebars.compile( $('#template-article').html() ); | |
| 64 | + var templateCompareArticle = Handlebars.compile( $('#template-compare-article').html() ); | |
| 65 | + var templateGenerator = Handlebars.compile( $('#template-generator').html() ); | |
| 66 | + var templateProject = Handlebars.compile( $('#template-project').html() ); | |
| 67 | + var templateSections = Handlebars.compile( $('#template-sections').html() ); | |
| 68 | + var templateSidenav = Handlebars.compile( $('#template-sidenav').html() ); | |
| 69 | + | |
| 70 | + // | |
| 71 | + // apiProject defaults | |
| 72 | + // | |
| 73 | + if ( ! apiProject.template) | |
| 74 | + apiProject.template = {}; | |
| 75 | + | |
| 76 | + if (apiProject.template.withCompare == null) | |
| 77 | + apiProject.template.withCompare = true; | |
| 78 | + | |
| 79 | + if (apiProject.template.withGenerator == null) | |
| 80 | + apiProject.template.withGenerator = true; | |
| 81 | + | |
| 82 | + if (apiProject.template.forceLanguage) | |
| 83 | + locale.setLanguage(apiProject.template.forceLanguage); | |
| 84 | + | |
| 85 | + // Setup jQuery Ajax | |
| 86 | + $.ajaxSetup(apiProject.template.jQueryAjaxSetup); | |
| 87 | + | |
| 88 | + // | |
| 89 | + // Data transform | |
| 90 | + // | |
| 91 | + // grouped by group | |
| 92 | + var apiByGroup = _.groupBy(api, function(entry) { | |
| 93 | + return entry.group; | |
| 94 | + }); | |
| 95 | + | |
| 96 | + // grouped by group and name | |
| 97 | + var apiByGroupAndName = {}; | |
| 98 | + $.each(apiByGroup, function(index, entries) { | |
| 99 | + apiByGroupAndName[index] = _.groupBy(entries, function(entry) { | |
| 100 | + return entry.name; | |
| 101 | + }); | |
| 102 | + }); | |
| 103 | + | |
| 104 | + // | |
| 105 | + // sort api within a group by title ASC and custom order | |
| 106 | + // | |
| 107 | + var newList = []; | |
| 108 | + var umlauts = { 'ä': 'ae', 'ü': 'ue', 'ö': 'oe', 'ß': 'ss' }; // TODO: remove in version 1.0 | |
| 109 | + $.each (apiByGroupAndName, function(index, groupEntries) { | |
| 110 | + // get titles from the first entry of group[].name[] (name has versioning) | |
| 111 | + var titles = []; | |
| 112 | + $.each (groupEntries, function(titleName, entries) { | |
| 113 | + var title = entries[0].title; | |
| 114 | + if(title !== undefined) { | |
| 115 | + title.toLowerCase().replace(/[äöüß]/g, function($0) { return umlauts[$0]; }); | |
| 116 | + titles.push(title + '#~#' + titleName); // '#~#' keep reference to titleName after sorting | |
| 117 | + } | |
| 118 | + }); | |
| 119 | + // sort by name ASC | |
| 120 | + titles.sort(); | |
| 121 | + | |
| 122 | + // custom order | |
| 123 | + if (apiProject.order) | |
| 124 | + titles = sortByOrder(titles, apiProject.order, '#~#'); | |
| 125 | + | |
| 126 | + // add single elements to the new list | |
| 127 | + titles.forEach(function(name) { | |
| 128 | + var values = name.split('#~#'); | |
| 129 | + var key = values[1]; | |
| 130 | + groupEntries[key].forEach(function(entry) { | |
| 131 | + newList.push(entry); | |
| 132 | + }); | |
| 133 | + }); | |
| 134 | + }); | |
| 135 | + // api overwrite with ordered list | |
| 136 | + api = newList; | |
| 137 | + | |
| 138 | + // | |
| 139 | + // Group- and Versionlists | |
| 140 | + // | |
| 141 | + var apiGroups = {}; | |
| 142 | + var apiGroupTitles = {}; | |
| 143 | + var apiVersions = {}; | |
| 144 | + apiVersions[apiProject.version] = 1; | |
| 145 | + | |
| 146 | + $.each(api, function(index, entry) { | |
| 147 | + apiGroups[entry.group] = 1; | |
| 148 | + apiGroupTitles[entry.group] = entry.groupTitle || entry.group; | |
| 149 | + apiVersions[entry.version] = 1; | |
| 150 | + }); | |
| 151 | + | |
| 152 | + // sort groups | |
| 153 | + apiGroups = Object.keys(apiGroups); | |
| 154 | + apiGroups.sort(); | |
| 155 | + | |
| 156 | + // custom order | |
| 157 | + if (apiProject.order) | |
| 158 | + apiGroups = sortByOrder(apiGroups, apiProject.order); | |
| 159 | + | |
| 160 | + // sort versions DESC | |
| 161 | + apiVersions = Object.keys(apiVersions); | |
| 162 | + apiVersions.sort(semver.compare); | |
| 163 | + apiVersions.reverse(); | |
| 164 | + | |
| 165 | + // | |
| 166 | + // create Navigationlist | |
| 167 | + // | |
| 168 | + var nav = []; | |
| 169 | + apiGroups.forEach(function(group) { | |
| 170 | + // Mainmenu entry | |
| 171 | + nav.push({ | |
| 172 | + group: group, | |
| 173 | + isHeader: true, | |
| 174 | + title: apiGroupTitles[group] | |
| 175 | + }); | |
| 176 | + | |
| 177 | + // Submenu | |
| 178 | + var oldName = ''; | |
| 179 | + api.forEach(function(entry) { | |
| 180 | + if (entry.group === group) { | |
| 181 | + if (oldName !== entry.name) { | |
| 182 | + nav.push({ | |
| 183 | + title: entry.title, | |
| 184 | + group: group, | |
| 185 | + name: entry.name, | |
| 186 | + type: entry.type, | |
| 187 | + version: entry.version | |
| 188 | + }); | |
| 189 | + } else { | |
| 190 | + nav.push({ | |
| 191 | + title: entry.title, | |
| 192 | + group: group, | |
| 193 | + hidden: true, | |
| 194 | + name: entry.name, | |
| 195 | + type: entry.type, | |
| 196 | + version: entry.version | |
| 197 | + }); | |
| 198 | + } | |
| 199 | + oldName = entry.name; | |
| 200 | + } | |
| 201 | + }); | |
| 202 | + }); | |
| 203 | + | |
| 204 | + // Mainmenu Header entry | |
| 205 | + if (apiProject.header) { | |
| 206 | + nav.unshift({ | |
| 207 | + group: '_', | |
| 208 | + isHeader: true, | |
| 209 | + title: (apiProject.header.title == null) ? locale.__('General') : apiProject.header.title, | |
| 210 | + isFixed: true | |
| 211 | + }); | |
| 212 | + } | |
| 213 | + | |
| 214 | + // Mainmenu Footer entry | |
| 215 | + if (apiProject.footer && apiProject.footer.title != null) { | |
| 216 | + nav.push({ | |
| 217 | + group: '_footer', | |
| 218 | + isHeader: true, | |
| 219 | + title: apiProject.footer.title, | |
| 220 | + isFixed: true | |
| 221 | + }); | |
| 222 | + } | |
| 223 | + | |
| 224 | + // render pagetitle | |
| 225 | + var title = apiProject.title ? apiProject.title : 'apiDoc: ' + apiProject.name + ' - ' + apiProject.version; | |
| 226 | + $(document).attr('title', title); | |
| 227 | + | |
| 228 | + // remove loader | |
| 229 | + $('#loader').remove(); | |
| 230 | + | |
| 231 | + // render sidenav | |
| 232 | + var fields = { | |
| 233 | + nav: nav | |
| 234 | + }; | |
| 235 | + $('#sidenav').append( templateSidenav(fields) ); | |
| 236 | + | |
| 237 | + // render Generator | |
| 238 | + $('#generator').append( templateGenerator(apiProject) ); | |
| 239 | + | |
| 240 | + // render Project | |
| 241 | + _.extend(apiProject, { versions: apiVersions}); | |
| 242 | + $('#project').append( templateProject(apiProject) ); | |
| 243 | + | |
| 244 | + // render apiDoc, header/footer documentation | |
| 245 | + if (apiProject.header) | |
| 246 | + $('#header').append( templateHeader(apiProject.header) ); | |
| 247 | + | |
| 248 | + if (apiProject.footer) | |
| 249 | + $('#footer').append( templateFooter(apiProject.footer) ); | |
| 250 | + | |
| 251 | + // | |
| 252 | + // Render Sections and Articles | |
| 253 | + // | |
| 254 | + var articleVersions = {}; | |
| 255 | + var content = ''; | |
| 256 | + apiGroups.forEach(function(groupEntry) { | |
| 257 | + var articles = []; | |
| 258 | + var oldName = ''; | |
| 259 | + var fields = {}; | |
| 260 | + var title = groupEntry; | |
| 261 | + var description = ''; | |
| 262 | + articleVersions[groupEntry] = {}; | |
| 263 | + | |
| 264 | + // render all articles of a group | |
| 265 | + api.forEach(function(entry) { | |
| 266 | + if(groupEntry === entry.group) { | |
| 267 | + if (oldName !== entry.name) { | |
| 268 | + // determine versions | |
| 269 | + api.forEach(function(versionEntry) { | |
| 270 | + if (groupEntry === versionEntry.group && entry.name === versionEntry.name) { | |
| 271 | + if ( ! articleVersions[entry.group].hasOwnProperty(entry.name) ) { | |
| 272 | + articleVersions[entry.group][entry.name] = []; | |
| 273 | + } | |
| 274 | + articleVersions[entry.group][entry.name].push(versionEntry.version); | |
| 275 | + } | |
| 276 | + }); | |
| 277 | + fields = { | |
| 278 | + article: entry, | |
| 279 | + versions: articleVersions[entry.group][entry.name] | |
| 280 | + }; | |
| 281 | + } else { | |
| 282 | + fields = { | |
| 283 | + article: entry, | |
| 284 | + hidden: true, | |
| 285 | + versions: articleVersions[entry.group][entry.name] | |
| 286 | + }; | |
| 287 | + } | |
| 288 | + | |
| 289 | + // add prefix URL for endpoint | |
| 290 | + if (apiProject.url) | |
| 291 | + fields.article.url = apiProject.url + fields.article.url; | |
| 292 | + | |
| 293 | + addArticleSettings(fields, entry); | |
| 294 | + | |
| 295 | + if (entry.groupTitle) | |
| 296 | + title = entry.groupTitle; | |
| 297 | + | |
| 298 | + // TODO: make groupDescription compareable with older versions (not important for the moment) | |
| 299 | + if (entry.groupDescription) | |
| 300 | + description = entry.groupDescription; | |
| 301 | + | |
| 302 | + articles.push({ | |
| 303 | + article: templateArticle(fields), | |
| 304 | + group: entry.group, | |
| 305 | + name: entry.name | |
| 306 | + }); | |
| 307 | + oldName = entry.name; | |
| 308 | + } | |
| 309 | + }); | |
| 310 | + | |
| 311 | + // render Section with Articles | |
| 312 | + var fields = { | |
| 313 | + group: groupEntry, | |
| 314 | + title: title, | |
| 315 | + description: description, | |
| 316 | + articles: articles | |
| 317 | + }; | |
| 318 | + content += templateSections(fields); | |
| 319 | + }); | |
| 320 | + $('#sections').append( content ); | |
| 321 | + | |
| 322 | + // Bootstrap Scrollspy | |
| 323 | + $(this).scrollspy({ target: '#scrollingNav', offset: 18 }); | |
| 324 | + | |
| 325 | + // Content-Scroll on Navigation click. | |
| 326 | + $('.sidenav').find('a').on('click', function(e) { | |
| 327 | + e.preventDefault(); | |
| 328 | + var id = $(this).attr('href'); | |
| 329 | + if ($(id).length > 0) | |
| 330 | + $('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 400); | |
| 331 | + window.location.hash = $(this).attr('href'); | |
| 332 | + }); | |
| 333 | + | |
| 334 | + // Quickjump on Pageload to hash position. | |
| 335 | + if(window.location.hash) { | |
| 336 | + var id = window.location.hash; | |
| 337 | + if ($(id).length > 0) | |
| 338 | + $('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 0); | |
| 339 | + } | |
| 340 | + | |
| 341 | + /** | |
| 342 | + * Check if Parameter (sub) List has a type Field. | |
| 343 | + * Example: @apiSuccess varname1 No type. | |
| 344 | + * @apiSuccess {String} varname2 With type. | |
| 345 | + * | |
| 346 | + * @param {Object} fields | |
| 347 | + */ | |
| 348 | + function _hasTypeInFields(fields) { | |
| 349 | + var result = false; | |
| 350 | + $.each(fields, function(name) { | |
| 351 | + if (_.any(fields[name], function(item) { return item.type; }) ) | |
| 352 | + result = true; | |
| 353 | + }); | |
| 354 | + return result; | |
| 355 | + } | |
| 356 | + | |
| 357 | + /** | |
| 358 | + * On Template changes, recall plugins. | |
| 359 | + */ | |
| 360 | + function initDynamic() { | |
| 361 | + // bootstrap popover | |
| 362 | + $('a[data-toggle=popover]') | |
| 363 | + .popover() | |
| 364 | + .click(function(e) { | |
| 365 | + e.preventDefault(); | |
| 366 | + }) | |
| 367 | + ; | |
| 368 | + | |
| 369 | + var version = $('#version strong').html(); | |
| 370 | + $('#sidenav li').removeClass('is-new'); | |
| 371 | + if (apiProject.template.withCompare) { | |
| 372 | + $('#sidenav li[data-version=\'' + version + '\']').each(function(){ | |
| 373 | + var group = $(this).data('group'); | |
| 374 | + var name = $(this).data('name'); | |
| 375 | + var length = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').length; | |
| 376 | + var index = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').index($(this)); | |
| 377 | + if (length === 1 || index === (length - 1)) | |
| 378 | + $(this).addClass('is-new'); | |
| 379 | + }); | |
| 380 | + } | |
| 381 | + | |
| 382 | + // tabs | |
| 383 | + $('.nav-tabs-examples a').click(function (e) { | |
| 384 | + e.preventDefault(); | |
| 385 | + $(this).tab('show'); | |
| 386 | + }); | |
| 387 | + $('.nav-tabs-examples').find('a:first').tab('show'); | |
| 388 | + | |
| 389 | + // sample request switch | |
| 390 | + $('.sample-request-switch').click(function (e) { | |
| 391 | + var name = '.' + $(this).attr('name') + '-fields'; | |
| 392 | + $(name).addClass('hide'); | |
| 393 | + $(this).parent().next(name).removeClass('hide'); | |
| 394 | + }); | |
| 395 | + | |
| 396 | + // call scrollspy refresh method | |
| 397 | + $(window).scrollspy('refresh'); | |
| 398 | + | |
| 399 | + // init modules | |
| 400 | + sampleRequest.initDynamic(); | |
| 401 | + } | |
| 402 | + initDynamic(); | |
| 403 | + | |
| 404 | + // Pre- / Code-Format | |
| 405 | + prettyPrint(); | |
| 406 | + | |
| 407 | + // | |
| 408 | + // HTML-Template specific jQuery-Functions | |
| 409 | + // | |
| 410 | + // Change Main Version | |
| 411 | + $('#versions li.version a').on('click', function(e) { | |
| 412 | + e.preventDefault(); | |
| 413 | + | |
| 414 | + var selectedVersion = $(this).html(); | |
| 415 | + $('#version strong').html(selectedVersion); | |
| 416 | + | |
| 417 | + // hide all | |
| 418 | + $('article').addClass('hide'); | |
| 419 | + $('#sidenav li:not(.nav-fixed)').addClass('hide'); | |
| 420 | + | |
| 421 | + // show 1st equal or lower Version of each entry | |
| 422 | + $('article[data-version]').each(function(index) { | |
| 423 | + var group = $(this).data('group'); | |
| 424 | + var name = $(this).data('name'); | |
| 425 | + var version = $(this).data('version'); | |
| 426 | + | |
| 427 | + if (version <= selectedVersion) { | |
| 428 | + if ($('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible').length === 0) { | |
| 429 | + // enable Article | |
| 430 | + $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide'); | |
| 431 | + // enable Navigation | |
| 432 | + $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide'); | |
| 433 | + $('#sidenav li.nav-header[data-group=\'' + group + '\']').removeClass('hide'); | |
| 434 | + } | |
| 435 | + } | |
| 436 | + }); | |
| 437 | + | |
| 438 | + | |
| 439 | + // show 1st equal or lower Version of each entry | |
| 440 | + $('article[data-version]').each(function(index) { | |
| 441 | + var group = $(this).data('group'); | |
| 442 | + $('section#api-' + group).removeClass('hide'); | |
| 443 | + if ($('section#api-' + group + ' article:visible').length === 0) { | |
| 444 | + $('section#api-' + group).addClass('hide'); | |
| 445 | + } else { | |
| 446 | + $('section#api-' + group).removeClass('hide'); | |
| 447 | + } | |
| 448 | + }); | |
| 449 | + | |
| 450 | + initDynamic(); | |
| 451 | + return; | |
| 452 | + }); | |
| 453 | + | |
| 454 | + // compare all article with their predecessor | |
| 455 | + $('#compareAllWithPredecessor').on('click', changeAllVersionCompareTo); | |
| 456 | + | |
| 457 | + // change version of an article | |
| 458 | + $('article .versions li.version a').on('click', changeVersionCompareTo); | |
| 459 | + | |
| 460 | + // compare url-parameter | |
| 461 | + $.urlParam = function(name) { | |
| 462 | + var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); | |
| 463 | + return (results && results[1]) ? results[1] : null; | |
| 464 | + }; | |
| 465 | + | |
| 466 | + if ($.urlParam('compare')) { | |
| 467 | + // URL Paramter ?compare=1 is set | |
| 468 | + $('#compareAllWithPredecessor').trigger('click'); | |
| 469 | + | |
| 470 | + if (window.location.hash) { | |
| 471 | + var id = window.location.hash; | |
| 472 | + $('html,body').animate({ scrollTop: parseInt($(id).offset().top) - 18 }, 0); | |
| 473 | + } | |
| 474 | + } | |
| 475 | + | |
| 476 | + /** | |
| 477 | + * Change version of an article to compare it to an other version. | |
| 478 | + */ | |
| 479 | + function changeVersionCompareTo(e) { | |
| 480 | + e.preventDefault(); | |
| 481 | + | |
| 482 | + var $root = $(this).parents('article'); | |
| 483 | + var selectedVersion = $(this).html(); | |
| 484 | + var $button = $root.find('.version'); | |
| 485 | + var currentVersion = $button.find('strong').html(); | |
| 486 | + $button.find('strong').html(selectedVersion); | |
| 487 | + | |
| 488 | + var group = $root.data('group'); | |
| 489 | + var name = $root.data('name'); | |
| 490 | + var version = $root.data('version'); | |
| 491 | + | |
| 492 | + var compareVersion = $root.data('compare-version'); | |
| 493 | + | |
| 494 | + if (compareVersion === selectedVersion) | |
| 495 | + return; | |
| 496 | + | |
| 497 | + if ( ! compareVersion && version == selectedVersion) | |
| 498 | + return; | |
| 499 | + | |
| 500 | + if (compareVersion && articleVersions[group][name][0] === selectedVersion || version === selectedVersion) { | |
| 501 | + // the version of the entry is set to the highest version (reset) | |
| 502 | + resetArticle(group, name, version); | |
| 503 | + } else { | |
| 504 | + var $compareToArticle = $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + selectedVersion + '\']'); | |
| 505 | + | |
| 506 | + var sourceEntry = {}; | |
| 507 | + var compareEntry = {}; | |
| 508 | + $.each(apiByGroupAndName[group][name], function(index, entry) { | |
| 509 | + if (entry.version === version) | |
| 510 | + sourceEntry = entry; | |
| 511 | + if (entry.version === selectedVersion) | |
| 512 | + compareEntry = entry; | |
| 513 | + }); | |
| 514 | + | |
| 515 | + var fields = { | |
| 516 | + article: sourceEntry, | |
| 517 | + compare: compareEntry, | |
| 518 | + versions: articleVersions[group][name] | |
| 519 | + }; | |
| 520 | + | |
| 521 | + // add unique id | |
| 522 | + // TODO: replace all group-name-version in template with id. | |
| 523 | + fields.article.id = fields.article.group + '-' + fields.article.name + '-' + fields.article.version; | |
| 524 | + fields.article.id = fields.article.id.replace(/\./g, '_'); | |
| 525 | + | |
| 526 | + fields.compare.id = fields.compare.group + '-' + fields.compare.name + '-' + fields.compare.version; | |
| 527 | + fields.compare.id = fields.compare.id.replace(/\./g, '_'); | |
| 528 | + | |
| 529 | + var entry = sourceEntry; | |
| 530 | + if (entry.parameter && entry.parameter.fields) | |
| 531 | + fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields); | |
| 532 | + | |
| 533 | + if (entry.error && entry.error.fields) | |
| 534 | + fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields); | |
| 535 | + | |
| 536 | + if (entry.success && entry.success.fields) | |
| 537 | + fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields); | |
| 538 | + | |
| 539 | + if (entry.info && entry.info.fields) | |
| 540 | + fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields); | |
| 541 | + | |
| 542 | + var entry = compareEntry; | |
| 543 | + if (fields._hasTypeInParameterFields !== true && entry.parameter && entry.parameter.fields) | |
| 544 | + fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields); | |
| 545 | + | |
| 546 | + if (fields._hasTypeInErrorFields !== true && entry.error && entry.error.fields) | |
| 547 | + fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields); | |
| 548 | + | |
| 549 | + if (fields._hasTypeInSuccessFields !== true && entry.success && entry.success.fields) | |
| 550 | + fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields); | |
| 551 | + | |
| 552 | + if (fields._hasTypeInInfoFields !== true && entry.info && entry.info.fields) | |
| 553 | + fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields); | |
| 554 | + | |
| 555 | + var content = templateCompareArticle(fields); | |
| 556 | + $root.after(content); | |
| 557 | + var $content = $root.next(); | |
| 558 | + | |
| 559 | + // Event on.click re-assign | |
| 560 | + $content.find('.versions li.version a').on('click', changeVersionCompareTo); | |
| 561 | + | |
| 562 | + // select navigation | |
| 563 | + $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + currentVersion + '\']').addClass('has-modifications'); | |
| 564 | + | |
| 565 | + $root.remove(); | |
| 566 | + // TODO: on change main version or select the highest version re-render | |
| 567 | + } | |
| 568 | + | |
| 569 | + initDynamic(); | |
| 570 | + } | |
| 571 | + | |
| 572 | + /** | |
| 573 | + * Compare all currently selected Versions with their predecessor. | |
| 574 | + */ | |
| 575 | + function changeAllVersionCompareTo(e) { | |
| 576 | + e.preventDefault(); | |
| 577 | + $('article:visible .versions').each(function(){ | |
| 578 | + var $root = $(this).parents('article'); | |
| 579 | + var currentVersion = $root.data('version'); | |
| 580 | + var $foundElement = null; | |
| 581 | + $(this).find('li.version a').each(function() { | |
| 582 | + var selectVersion = $(this).html(); | |
| 583 | + if (selectVersion < currentVersion && ! $foundElement) | |
| 584 | + $foundElement = $(this); | |
| 585 | + }); | |
| 586 | + | |
| 587 | + if($foundElement) | |
| 588 | + $foundElement.trigger('click'); | |
| 589 | + }); | |
| 590 | + initDynamic(); | |
| 591 | + } | |
| 592 | + | |
| 593 | + /** | |
| 594 | + * Add article settings. | |
| 595 | + */ | |
| 596 | + function addArticleSettings(fields, entry) { | |
| 597 | + // add unique id | |
| 598 | + // TODO: replace all group-name-version in template with id. | |
| 599 | + fields.id = fields.article.group + '-' + fields.article.name + '-' + fields.article.version; | |
| 600 | + fields.id = fields.id.replace(/\./g, '_'); | |
| 601 | + | |
| 602 | + if (entry.header && entry.header.fields) | |
| 603 | + fields._hasTypeInHeaderFields = _hasTypeInFields(entry.header.fields); | |
| 604 | + | |
| 605 | + if (entry.parameter && entry.parameter.fields) | |
| 606 | + fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields); | |
| 607 | + | |
| 608 | + if (entry.error && entry.error.fields) | |
| 609 | + fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields); | |
| 610 | + | |
| 611 | + if (entry.success && entry.success.fields) | |
| 612 | + fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields); | |
| 613 | + | |
| 614 | + if (entry.info && entry.info.fields) | |
| 615 | + fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields); | |
| 616 | + | |
| 617 | + // add template settings | |
| 618 | + fields.template = apiProject.template; | |
| 619 | + } | |
| 620 | + | |
| 621 | + /** | |
| 622 | + * Render Article. | |
| 623 | + */ | |
| 624 | + function renderArticle(group, name, version) { | |
| 625 | + var entry = {}; | |
| 626 | + $.each(apiByGroupAndName[group][name], function(index, currentEntry) { | |
| 627 | + if (currentEntry.version === version) | |
| 628 | + entry = currentEntry; | |
| 629 | + }); | |
| 630 | + var fields = { | |
| 631 | + article: entry, | |
| 632 | + versions: articleVersions[group][name] | |
| 633 | + }; | |
| 634 | + | |
| 635 | + addArticleSettings(fields, entry); | |
| 636 | + | |
| 637 | + return templateArticle(fields); | |
| 638 | + } | |
| 639 | + | |
| 640 | + /** | |
| 641 | + * Render original Article and remove the current visible Article. | |
| 642 | + */ | |
| 643 | + function resetArticle(group, name, version) { | |
| 644 | + var $root = $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible'); | |
| 645 | + var content = renderArticle(group, name, version); | |
| 646 | + | |
| 647 | + $root.after(content); | |
| 648 | + var $content = $root.next(); | |
| 649 | + | |
| 650 | + // Event on.click muss neu zugewiesen werden (sollte eigentlich mit on automatisch funktionieren... sollte) | |
| 651 | + $content.find('.versions li.version a').on('click', changeVersionCompareTo); | |
| 652 | + | |
| 653 | + $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('has-modifications'); | |
| 654 | + | |
| 655 | + $root.remove(); | |
| 656 | + return; | |
| 657 | + } | |
| 658 | + | |
| 659 | + /** | |
| 660 | + * Load google fonts. | |
| 661 | + */ | |
| 662 | + function loadGoogleFontCss() { | |
| 663 | + WebFont.load({ | |
| 664 | + active: function() { | |
| 665 | + // Update scrollspy | |
| 666 | + $(window).scrollspy('refresh') | |
| 667 | + }, | |
| 668 | + google: { | |
| 669 | + families: ['Source Code Pro', 'Source Sans Pro:n4,n6,n7'] | |
| 670 | + } | |
| 671 | + }); | |
| 672 | + } | |
| 673 | + | |
| 674 | + /** | |
| 675 | + * Return ordered entries by custom order and append not defined entries to the end. | |
| 676 | + * @param {String[]} elements | |
| 677 | + * @param {String[]} order | |
| 678 | + * @param {String} splitBy | |
| 679 | + * @return {String[]} Custom ordered list. | |
| 680 | + */ | |
| 681 | + function sortByOrder(elements, order, splitBy) { | |
| 682 | + var results = []; | |
| 683 | + order.forEach (function(name) { | |
| 684 | + if (splitBy) | |
| 685 | + elements.forEach (function(element) { | |
| 686 | + var parts = element.split(splitBy); | |
| 687 | + var key = parts[1]; // reference keep for sorting | |
| 688 | + if (key == name) | |
| 689 | + results.push(element); | |
| 690 | + }); | |
| 691 | + else | |
| 692 | + elements.forEach (function(key) { | |
| 693 | + if (key == name) | |
| 694 | + results.push(name); | |
| 695 | + }); | |
| 696 | + }); | |
| 697 | + // Append all other entries that ar not defined in order | |
| 698 | + elements.forEach(function(element) { | |
| 699 | + if (results.indexOf(element) === -1) | |
| 700 | + results.push(element); | |
| 701 | + }); | |
| 702 | + return results; | |
| 703 | + } | |
| 704 | + | |
| 705 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,327 @@ |
| 1 | +define([ | |
| 2 | + 'locales', | |
| 3 | + 'handlebars', | |
| 4 | + 'diffMatchPatch' | |
| 5 | +], function(locale, Handlebars, DiffMatchPatch) { | |
| 6 | + | |
| 7 | + /** | |
| 8 | + * start/stop timer for simple performance check. | |
| 9 | + */ | |
| 10 | + var timer; | |
| 11 | + Handlebars.registerHelper('startTimer', function(text) { | |
| 12 | + timer = new Date(); | |
| 13 | + return ''; | |
| 14 | + }); | |
| 15 | + | |
| 16 | + Handlebars.registerHelper('stopTimer', function(text) { | |
| 17 | + console.log(new Date() - timer); | |
| 18 | + return ''; | |
| 19 | + }); | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * Return localized Text. | |
| 23 | + * @param string text | |
| 24 | + */ | |
| 25 | + Handlebars.registerHelper('__', function(text) { | |
| 26 | + return locale.__(text); | |
| 27 | + }); | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * Console log. | |
| 31 | + * @param mixed obj | |
| 32 | + */ | |
| 33 | + Handlebars.registerHelper('cl', function(obj) { | |
| 34 | + console.log(obj); | |
| 35 | + return ''; | |
| 36 | + }); | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * Replace underscore with space. | |
| 40 | + * @param string text | |
| 41 | + */ | |
| 42 | + Handlebars.registerHelper('underscoreToSpace', function(text) { | |
| 43 | + return text.replace(/(_+)/g, ' '); | |
| 44 | + }); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * | |
| 48 | + */ | |
| 49 | + Handlebars.registerHelper('assign', function(name) { | |
| 50 | + if(arguments.length > 0) { | |
| 51 | + var type = typeof(arguments[1]); | |
| 52 | + var arg = null; | |
| 53 | + if(type === 'string' || type === 'number' || type === 'boolean') arg = arguments[1]; | |
| 54 | + Handlebars.registerHelper(name, function() { return arg; }); | |
| 55 | + } | |
| 56 | + return ''; | |
| 57 | + }); | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * | |
| 61 | + */ | |
| 62 | + Handlebars.registerHelper('nl2br', function(text) { | |
| 63 | + return _handlebarsNewlineToBreak(text); | |
| 64 | + }); | |
| 65 | + | |
| 66 | + /** | |
| 67 | + * | |
| 68 | + */ | |
| 69 | + Handlebars.registerHelper('if_eq', function(context, options) { | |
| 70 | + var compare = context; | |
| 71 | + // Get length if context is an object | |
| 72 | + if (context instanceof Object && ! (options.hash.compare instanceof Object)) | |
| 73 | + compare = Object.keys(context).length; | |
| 74 | + | |
| 75 | + if (compare === options.hash.compare) | |
| 76 | + return options.fn(this); | |
| 77 | + | |
| 78 | + return options.inverse(this); | |
| 79 | + }); | |
| 80 | + | |
| 81 | + /** | |
| 82 | + * | |
| 83 | + */ | |
| 84 | + Handlebars.registerHelper('if_gt', function(context, options) { | |
| 85 | + var compare = context; | |
| 86 | + // Get length if context is an object | |
| 87 | + if (context instanceof Object && ! (options.hash.compare instanceof Object)) | |
| 88 | + compare = Object.keys(context).length; | |
| 89 | + | |
| 90 | + if(compare > options.hash.compare) | |
| 91 | + return options.fn(this); | |
| 92 | + | |
| 93 | + return options.inverse(this); | |
| 94 | + }); | |
| 95 | + | |
| 96 | + /** | |
| 97 | + * | |
| 98 | + */ | |
| 99 | + var templateCache = {}; | |
| 100 | + Handlebars.registerHelper('subTemplate', function(name, sourceContext) { | |
| 101 | + if ( ! templateCache[name]) | |
| 102 | + templateCache[name] = Handlebars.compile($('#template-' + name).html()); | |
| 103 | + | |
| 104 | + var template = templateCache[name]; | |
| 105 | + var templateContext = $.extend({}, this, sourceContext.hash); | |
| 106 | + return new Handlebars.SafeString( template(templateContext) ); | |
| 107 | + }); | |
| 108 | + | |
| 109 | + /** | |
| 110 | + * | |
| 111 | + */ | |
| 112 | + Handlebars.registerHelper('toLowerCase', function(value) { | |
| 113 | + return (value && typeof value === 'string') ? value.toLowerCase() : ''; | |
| 114 | + }); | |
| 115 | + | |
| 116 | + /** | |
| 117 | + * | |
| 118 | + */ | |
| 119 | + Handlebars.registerHelper('splitFill', function(value, splitChar, fillChar) { | |
| 120 | + var splits = value.split(splitChar); | |
| 121 | + return new Array(splits.length).join(fillChar) + splits[splits.length - 1]; | |
| 122 | + }); | |
| 123 | + | |
| 124 | + /** | |
| 125 | + * Convert Newline to HTML-Break (nl2br). | |
| 126 | + * | |
| 127 | + * @param {String} text | |
| 128 | + * @returns {String} | |
| 129 | + */ | |
| 130 | + function _handlebarsNewlineToBreak(text) { | |
| 131 | + return ('' + text).replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '<br>' + '$2'); | |
| 132 | + } | |
| 133 | + | |
| 134 | + /** | |
| 135 | + * | |
| 136 | + */ | |
| 137 | + Handlebars.registerHelper('each_compare_list_field', function(source, compare, options) { | |
| 138 | + var fieldName = options.hash.field; | |
| 139 | + var newSource = []; | |
| 140 | + if (source) { | |
| 141 | + source.forEach(function(entry) { | |
| 142 | + var values = entry; | |
| 143 | + values['key'] = entry[fieldName]; | |
| 144 | + newSource.push(values); | |
| 145 | + }); | |
| 146 | + } | |
| 147 | + | |
| 148 | + var newCompare = []; | |
| 149 | + if (compare) { | |
| 150 | + compare.forEach(function(entry) { | |
| 151 | + var values = entry; | |
| 152 | + values['key'] = entry[fieldName]; | |
| 153 | + newCompare.push(values); | |
| 154 | + }); | |
| 155 | + } | |
| 156 | + return _handlebarsEachCompared('key', newSource, newCompare, options); | |
| 157 | + }); | |
| 158 | + | |
| 159 | + /** | |
| 160 | + * | |
| 161 | + */ | |
| 162 | + Handlebars.registerHelper('each_compare_keys', function(source, compare, options) { | |
| 163 | + var newSource = []; | |
| 164 | + if (source) { | |
| 165 | + var sourceFields = Object.keys(source); | |
| 166 | + sourceFields.forEach(function(name) { | |
| 167 | + var values = {}; | |
| 168 | + values['value'] = source[name]; | |
| 169 | + values['key'] = name; | |
| 170 | + newSource.push(values); | |
| 171 | + }); | |
| 172 | + } | |
| 173 | + | |
| 174 | + var newCompare = []; | |
| 175 | + if (compare) { | |
| 176 | + var compareFields = Object.keys(compare); | |
| 177 | + compareFields.forEach(function(name) { | |
| 178 | + var values = {}; | |
| 179 | + values['value'] = compare[name]; | |
| 180 | + values['key'] = name; | |
| 181 | + newCompare.push(values); | |
| 182 | + }); | |
| 183 | + } | |
| 184 | + return _handlebarsEachCompared('key', newSource, newCompare, options); | |
| 185 | + }); | |
| 186 | + | |
| 187 | + /** | |
| 188 | + * | |
| 189 | + */ | |
| 190 | + Handlebars.registerHelper('each_compare_field', function(source, compare, options) { | |
| 191 | + return _handlebarsEachCompared('field', source, compare, options); | |
| 192 | + }); | |
| 193 | + | |
| 194 | + /** | |
| 195 | + * | |
| 196 | + */ | |
| 197 | + Handlebars.registerHelper('each_compare_title', function(source, compare, options) { | |
| 198 | + return _handlebarsEachCompared('title', source, compare, options); | |
| 199 | + }); | |
| 200 | + | |
| 201 | + /** | |
| 202 | + * | |
| 203 | + */ | |
| 204 | + Handlebars.registerHelper('showDiff', function(source, compare, options) { | |
| 205 | + var ds = ''; | |
| 206 | + if(source === compare) { | |
| 207 | + ds = source; | |
| 208 | + } else { | |
| 209 | + if( ! source) | |
| 210 | + return compare; | |
| 211 | + | |
| 212 | + if( ! compare) | |
| 213 | + return source; | |
| 214 | + | |
| 215 | + var d = diffMatchPatch.diff_main(compare, source); | |
| 216 | + diffMatchPatch.diff_cleanupSemantic(d); | |
| 217 | + ds = diffMatchPatch.diff_prettyHtml(d); | |
| 218 | + ds = ds.replace(/¶/gm, ''); | |
| 219 | + } | |
| 220 | + if(options === 'nl2br') | |
| 221 | + ds = _handlebarsNewlineToBreak(ds); | |
| 222 | + | |
| 223 | + return ds; | |
| 224 | + }); | |
| 225 | + | |
| 226 | + /** | |
| 227 | + * | |
| 228 | + */ | |
| 229 | + function _handlebarsEachCompared(fieldname, source, compare, options) | |
| 230 | + { | |
| 231 | + var dataList = []; | |
| 232 | + var index = 0; | |
| 233 | + if(source) { | |
| 234 | + source.forEach(function(sourceEntry) { | |
| 235 | + var found = false; | |
| 236 | + if (compare) { | |
| 237 | + compare.forEach(function(compareEntry) { | |
| 238 | + if(sourceEntry[fieldname] === compareEntry[fieldname]) { | |
| 239 | + var data = { | |
| 240 | + typeSame: true, | |
| 241 | + source: sourceEntry, | |
| 242 | + compare: compareEntry, | |
| 243 | + index: index | |
| 244 | + }; | |
| 245 | + dataList.push(data); | |
| 246 | + found = true; | |
| 247 | + index++; | |
| 248 | + } | |
| 249 | + }); | |
| 250 | + } | |
| 251 | + if ( ! found) { | |
| 252 | + var data = { | |
| 253 | + typeIns: true, | |
| 254 | + source: sourceEntry, | |
| 255 | + index: index | |
| 256 | + }; | |
| 257 | + dataList.push(data); | |
| 258 | + index++; | |
| 259 | + } | |
| 260 | + }); | |
| 261 | + } | |
| 262 | + | |
| 263 | + if (compare) { | |
| 264 | + compare.forEach(function(compareEntry) { | |
| 265 | + var found = false; | |
| 266 | + if (source) { | |
| 267 | + source.forEach(function(sourceEntry) { | |
| 268 | + if(sourceEntry[fieldname] === compareEntry[fieldname]) | |
| 269 | + found = true; | |
| 270 | + }); | |
| 271 | + } | |
| 272 | + if ( ! found) { | |
| 273 | + var data = { | |
| 274 | + typeDel: true, | |
| 275 | + compare: compareEntry, | |
| 276 | + index: index | |
| 277 | + }; | |
| 278 | + dataList.push(data); | |
| 279 | + index++; | |
| 280 | + } | |
| 281 | + }); | |
| 282 | + } | |
| 283 | + | |
| 284 | + var ret = ''; | |
| 285 | + var length = dataList.length; | |
| 286 | + for (var index in dataList) { | |
| 287 | + if(index == (length - 1)) | |
| 288 | + dataList[index]['_last'] = true; | |
| 289 | + ret = ret + options.fn(dataList[index]); | |
| 290 | + } | |
| 291 | + return ret; | |
| 292 | + } | |
| 293 | + | |
| 294 | + var diffMatchPatch = new DiffMatchPatch(); | |
| 295 | + | |
| 296 | + /** | |
| 297 | + * Overwrite Colors | |
| 298 | + */ | |
| 299 | + DiffMatchPatch.prototype.diff_prettyHtml = function(diffs) { | |
| 300 | + var html = []; | |
| 301 | + var pattern_amp = /&/g; | |
| 302 | + var pattern_lt = /</g; | |
| 303 | + var pattern_gt = />/g; | |
| 304 | + var pattern_para = /\n/g; | |
| 305 | + for (var x = 0; x < diffs.length; x++) { | |
| 306 | + var op = diffs[x][0]; // Operation (insert, delete, equal) | |
| 307 | + var data = diffs[x][1]; // Text of change. | |
| 308 | + var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<') | |
| 309 | + .replace(pattern_gt, '>').replace(pattern_para, '¶<br>'); | |
| 310 | + switch (op) { | |
| 311 | + case DIFF_INSERT: | |
| 312 | + html[x] = '<ins>' + text + '</ins>'; | |
| 313 | + break; | |
| 314 | + case DIFF_DELETE: | |
| 315 | + html[x] = '<del>' + text + '</del>'; | |
| 316 | + break; | |
| 317 | + case DIFF_EQUAL: | |
| 318 | + html[x] = '<span>' + text + '</span>'; | |
| 319 | + break; | |
| 320 | + } | |
| 321 | + } | |
| 322 | + return html.join(''); | |
| 323 | + }; | |
| 324 | + | |
| 325 | + // Exports | |
| 326 | + return Handlebars; | |
| 327 | +}); | ... | ... |
| ... | ... | @@ -0,0 +1,181 @@ |
| 1 | +define([ | |
| 2 | + 'jquery' | |
| 3 | +], function($) { | |
| 4 | + | |
| 5 | + var initDynamic = function() { | |
| 6 | + // Button send | |
| 7 | + $(".sample-request-send").off("click"); | |
| 8 | + $(".sample-request-send").on("click", function(e) { | |
| 9 | + e.preventDefault(); | |
| 10 | + var $root = $(this).parents("article"); | |
| 11 | + var group = $root.data("group"); | |
| 12 | + var name = $root.data("name"); | |
| 13 | + var version = $root.data("version"); | |
| 14 | + sendSampleRequest(group, name, version, $(this).data("sample-request-type")); | |
| 15 | + }); | |
| 16 | + | |
| 17 | + // Button clear | |
| 18 | + $(".sample-request-clear").off("click"); | |
| 19 | + $(".sample-request-clear").on("click", function(e) { | |
| 20 | + e.preventDefault(); | |
| 21 | + var $root = $(this).parents("article"); | |
| 22 | + var group = $root.data("group"); | |
| 23 | + var name = $root.data("name"); | |
| 24 | + var version = $root.data("version"); | |
| 25 | + clearSampleRequest(group, name, version); | |
| 26 | + }); | |
| 27 | + }; // initDynamic | |
| 28 | + | |
| 29 | + function sendSampleRequest(group, name, version, type) | |
| 30 | + { | |
| 31 | + var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]'); | |
| 32 | + | |
| 33 | + // Optional header | |
| 34 | + var header = {}; | |
| 35 | + $root.find(".sample-request-header:checked").each(function(i, element) { | |
| 36 | + var group = $(element).data("sample-request-header-group-id"); | |
| 37 | + $root.find("[data-sample-request-header-group=\"" + group + "\"]").each(function(i, element) { | |
| 38 | + var key = $(element).data("sample-request-header-name"); | |
| 39 | + var value = element.value; | |
| 40 | + if ( ! element.optional && element.defaultValue !== '') { | |
| 41 | + value = element.defaultValue; | |
| 42 | + } | |
| 43 | + header[key] = value; | |
| 44 | + }); | |
| 45 | + }); | |
| 46 | + | |
| 47 | + // create JSON dictionary of parameters | |
| 48 | + var param = {}; | |
| 49 | + var paramType = {}; | |
| 50 | + $root.find(".sample-request-param:checked").each(function(i, element) { | |
| 51 | + var group = $(element).data("sample-request-param-group-id"); | |
| 52 | + $root.find("[data-sample-request-param-group=\"" + group + "\"]").each(function(i, element) { | |
| 53 | + var key = $(element).data("sample-request-param-name"); | |
| 54 | + var value = element.value; | |
| 55 | + if ( ! element.optional && element.defaultValue !== '') { | |
| 56 | + value = element.defaultValue; | |
| 57 | + } | |
| 58 | + param[key] = value; | |
| 59 | + paramType[key] = $(element).next().text(); | |
| 60 | + }); | |
| 61 | + }); | |
| 62 | + | |
| 63 | + // grab user-inputted URL | |
| 64 | + var url = $root.find(".sample-request-url").val(); | |
| 65 | + | |
| 66 | + // Insert url parameter | |
| 67 | + var pattern = pathToRegexp(url, null); | |
| 68 | + var matches = pattern.exec(url); | |
| 69 | + for (var i = 1; i < matches.length; i++) { | |
| 70 | + var key = matches[i].substr(1); | |
| 71 | + if (param[key] !== undefined) { | |
| 72 | + url = url.replace(matches[i], encodeURIComponent(param[key])); | |
| 73 | + | |
| 74 | + // remove URL parameters from list | |
| 75 | + delete param[key]; | |
| 76 | + } | |
| 77 | + } // for | |
| 78 | + | |
| 79 | + $root.find(".sample-request-response").fadeTo(250, 1); | |
| 80 | + $root.find(".sample-request-response-json").html("Loading..."); | |
| 81 | + refreshScrollSpy(); | |
| 82 | + | |
| 83 | + _.each( param, function( val, key ) { | |
| 84 | + var t = paramType[ key ].toLowerCase(); | |
| 85 | + if ( t === 'object' || t === 'array' ) { | |
| 86 | + try { | |
| 87 | + param[ key ] = JSON.parse( val ); | |
| 88 | + } catch (e) { | |
| 89 | + } | |
| 90 | + } | |
| 91 | + }); | |
| 92 | + | |
| 93 | + // send AJAX request, catch success or error callback | |
| 94 | + var ajaxRequest = { | |
| 95 | + url : url, | |
| 96 | + headers : header, | |
| 97 | + data : param, | |
| 98 | + type : type.toUpperCase(), | |
| 99 | + success : displaySuccess, | |
| 100 | + error : displayError | |
| 101 | + }; | |
| 102 | + | |
| 103 | + $.ajax(ajaxRequest); | |
| 104 | + | |
| 105 | + | |
| 106 | + function displaySuccess(data, status, jqXHR) { | |
| 107 | + var jsonResponse; | |
| 108 | + try { | |
| 109 | + jsonResponse = JSON.parse(jqXHR.responseText); | |
| 110 | + jsonResponse = JSON.stringify(jsonResponse, null, 4); | |
| 111 | + } catch (e) { | |
| 112 | + jsonResponse = data; | |
| 113 | + } | |
| 114 | + $root.find(".sample-request-response-json").html(jsonResponse); | |
| 115 | + refreshScrollSpy(); | |
| 116 | + }; | |
| 117 | + | |
| 118 | + function displayError(jqXHR, textStatus, error) { | |
| 119 | + var message = "Error " + jqXHR.status + ": " + error; | |
| 120 | + var jsonResponse; | |
| 121 | + try { | |
| 122 | + jsonResponse = JSON.parse(jqXHR.responseText); | |
| 123 | + jsonResponse = JSON.stringify(jsonResponse, null, 4); | |
| 124 | + } catch (e) { | |
| 125 | + jsonResponse = escape(jqXHR.responseText); | |
| 126 | + } | |
| 127 | + | |
| 128 | + if (jsonResponse) | |
| 129 | + message += "<br>" + jsonResponse; | |
| 130 | + | |
| 131 | + // flicker on previous error to make clear that there is a new response | |
| 132 | + if($root.find(".sample-request-response").is(":visible")) | |
| 133 | + $root.find(".sample-request-response").fadeTo(1, 0.1); | |
| 134 | + | |
| 135 | + $root.find(".sample-request-response").fadeTo(250, 1); | |
| 136 | + $root.find(".sample-request-response-json").html(message); | |
| 137 | + refreshScrollSpy(); | |
| 138 | + }; | |
| 139 | + } | |
| 140 | + | |
| 141 | + function clearSampleRequest(group, name, version) | |
| 142 | + { | |
| 143 | + var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]'); | |
| 144 | + | |
| 145 | + // hide sample response | |
| 146 | + $root.find(".sample-request-response-json").html(""); | |
| 147 | + $root.find(".sample-request-response").hide(); | |
| 148 | + | |
| 149 | + // reset value of parameters | |
| 150 | + $root.find(".sample-request-param").each(function(i, element) { | |
| 151 | + element.value = ""; | |
| 152 | + }); | |
| 153 | + | |
| 154 | + // restore default URL | |
| 155 | + var $urlElement = $root.find(".sample-request-url"); | |
| 156 | + $urlElement.val($urlElement.prop("defaultValue")); | |
| 157 | + | |
| 158 | + refreshScrollSpy(); | |
| 159 | + } | |
| 160 | + | |
| 161 | + function refreshScrollSpy() | |
| 162 | + { | |
| 163 | + $('[data-spy="scroll"]').each(function () { | |
| 164 | + $(this).scrollspy("refresh"); | |
| 165 | + }); | |
| 166 | + } | |
| 167 | + | |
| 168 | + function escapeHtml(str) { | |
| 169 | + var div = document.createElement("div"); | |
| 170 | + div.appendChild(document.createTextNode(str)); | |
| 171 | + return div.innerHTML; | |
| 172 | + } | |
| 173 | + | |
| 174 | + /** | |
| 175 | + * Exports. | |
| 176 | + */ | |
| 177 | + return { | |
| 178 | + initDynamic: initDynamic | |
| 179 | + }; | |
| 180 | + | |
| 181 | +}); | ... | ... |
src/main/webapp/api-docs/vendor/bootstrap-responsive.min.css
0 → 100644
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +/*! | |
| 2 | + * Bootstrap Responsive v2.3.2 | |
| 3 | + * | |
| 4 | + * Copyright 2013 Twitter, Inc | |
| 5 | + * Licensed under the Apache License v2.0 | |
| 6 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 7 | + * | |
| 8 | + * Designed and built with all the love in the world by @mdo and @fat. | |
| 9 | + */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@-ms-viewport{width:device-width}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:inherit!important}.hidden-print{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .nav>li>a:focus,.nav-collapse .dropdown-menu a:hover,.nav-collapse .dropdown-menu a:focus{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .nav>li>a:focus,.navbar-inverse .nav-collapse .dropdown-menu a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:focus{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} | ... | ... |
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +/*! | |
| 2 | + * Bootstrap v2.3.2 | |
| 3 | + * | |
| 4 | + * Copyright 2013 Twitter, Inc | |
| 5 | + * Licensed under the Apache License v2.0 | |
| 6 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 7 | + * | |
| 8 | + * Designed and built with all the love in the world by @mdo and @fat. | |
| 9 | + */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover,a:focus{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}a.muted:hover,a.muted:focus{color:#808080}.text-warning{color:#c09853}a.text-warning:hover,a.text-warning:focus{color:#a47e3c}.text-error{color:#b94a48}a.text-error:hover,a.text-error:focus{color:#953b39}.text-info{color:#3a87ad}a.text-info:hover,a.text-info:focus{color:#2d6987}.text-success{color:#468847}a.text-success:hover,a.text-success:focus{color:#356635}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}ul.inline,ol.inline{margin-left:0;list-style:none}ul.inline>li,ol.inline>li{display:inline-block;*display:inline;padding-right:5px;padding-left:5px;*zoom:1}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:17.5px;font-weight:300;line-height:1.25}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;white-space:nowrap;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;vertical-align:middle;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #ccc}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:20px;padding-left:20px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left}.controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{display:inline-block;margin-bottom:10px;font-size:0;white-space:nowrap;vertical-align:middle}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu,.input-append .popover,.input-prepend .popover{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child,.table-bordered tbody:first-child tr:first-child>th:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child,.table-bordered tbody:first-child tr:first-child>th:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tbody:last-child tr:last-child>th:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>th:first-child{-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tbody:last-child tr:last-child>th:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child tr:last-child>th:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child{-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-bottomleft:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomright:0}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover tbody tr:hover>td,.table-hover tbody tr:hover>th{background-color:#f5f5f5}table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success>td{background-color:#dff0d8}.table tbody tr.error>td{background-color:#f2dede}.table tbody tr.warning>td{background-color:#fcf8e3}.table tbody tr.info>td{background-color:#d9edf7}.table-hover tbody tr.success:hover>td{background-color:#d0e9c6}.table-hover tbody tr.error:hover>td{background-color:#ebcccc}.table-hover tbody tr.warning:hover>td{background-color:#faf2cc}.table-hover tbody tr.info:hover>td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:focus>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>li>a:focus>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:focus>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"],.dropdown-submenu:focus>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{width:16px;background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus,.dropdown-submenu:hover>a,.dropdown-submenu:focus>a{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:default;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open{*z-index:1000}.open>.dropdown-menu{display:block}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #ccc;*border:0;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:focus,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover,.btn:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:focus,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover,.btn-link:focus{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,.btn-link[disabled]:focus{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px}.btn-group>.btn-mini{font-size:10.5px}.btn-group>.btn-small{font-size:11.9px}.btn-group>.btn-large{font-size:17.5px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.btn-mini .caret,.btn-small .caret{margin-top:8px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical>.btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical>.btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert,.alert h4{color:#c09853}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success h4{color:#468847}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger h4,.alert-error h4{color:#b94a48}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info h4{color:#3a87ad}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li>a>img{max-width:none}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover,.nav-list>.active>a:focus{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover,.nav-tabs>li>a:focus{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover,.nav-tabs>.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover,.nav-pills>.active>a:focus{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover,.nav-tabs.nav-stacked>li>a:focus{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret,.nav .dropdown-toggle:focus .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover,.nav>.dropdown.active>a:focus{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover,.nav>li.dropdown.open.active>a:focus{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret,.nav li.dropdown.open a:focus .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover,.tabs-stacked .open>a:focus{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover,.tabs-below>.nav-tabs>li>a:focus{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover,.tabs-below>.nav-tabs>.active>a:focus{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover,.tabs-left>.nav-tabs>li>a:focus{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover,.tabs-left>.nav-tabs .active>a:focus{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover,.tabs-right>.nav-tabs>li>a:focus{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover,.tabs-right>.nav-tabs .active>a:focus{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover,.nav>.disabled>a:focus{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto;overflow:visible}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover,.navbar .brand:focus{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px;color:#777}.navbar-link{color:#777}.navbar-link:hover,.navbar-link:focus{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn,.navbar .input-prepend .btn-group,.navbar .input-append .btn-group{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:5px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:focus,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown>a:hover .caret,.navbar .nav li.dropdown>a:focus .caret{border-top-color:#333;border-bottom-color:#333}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover,.navbar-inverse .brand:focus,.navbar-inverse .nav>li>a:focus{color:#fff}.navbar-inverse .brand{color:#999}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover,.navbar-inverse .navbar-link:focus{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>a:hover .caret,.navbar-inverse .nav li.dropdown>a:focus .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top,#151515,#040404);background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:focus,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb>li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb>li>.divider{padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>li>a:focus,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover,.pagination ul>.disabled>a:focus{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:0 6px;font-size:10.5px}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#f5f5f5}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;cursor:default;background-color:#fff}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:10%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{position:relative;max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.tooltip{position:absolute;z-index:1030;display:block;font-size:11px;line-height:1.4;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-title:empty{display:none}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover,a.thumbnail:focus{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.media,.media-body{overflow:hidden;*overflow:visible;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{margin-left:0;list-style:none}.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}.label:empty,.badge:empty{display:none}a.label:hover,a.label:focus,a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-indicators{position:absolute;top:15px;right:15px;z-index:5;margin:0;list-style:none}.carousel-indicators li{display:block;float:left;width:10px;height:10px;margin-left:5px;text-indent:-999px;background-color:#ccc;background-color:rgba(255,255,255,0.25);border-radius:5px}.carousel-indicators .active{background-color:#fff}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li{line-height:30px}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed} | ... | ... |
| ... | ... | @@ -0,0 +1,6 @@ |
| 1 | +/*! | |
| 2 | +* Bootstrap.js by @fat & @mdo | |
| 3 | +* Copyright 2013 Twitter, Inc. | |
| 4 | +* http://www.apache.org/licenses/LICENSE-2.0.txt | |
| 5 | +*/ | |
| 6 | +!function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(".dropdown-backdrop").remove(),e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||("ontouchstart"in document.documentElement&&e('<div class="dropdown-backdrop"/>').insertBefore(e(this)).on("click",r),s.toggleClass("open")),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f<s.length-1&&f++,~f||(f=0),s.eq(f).focus()}};var s=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=s,this},e(document).on("click.dropdown.data-api",r).on("click.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.dropdown.data-api",t,n.prototype.toggle).on("keydown.dropdown.data-api",t+", [role=menu]",n.prototype.keydown)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e.fn[this.type].defaults,r={},i;this._options&&e.each(this._options,function(e,t){n[e]!=t&&(r[e]=t)},this),i=e(t.currentTarget)[this.type](r).data(this.type);if(!i.options.delay||!i.options.delay.show)return i.show();clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(n=e.isFunction(this.source)?this.source(this.query,e.proxy(this.process,this)):this.source,n?this.process(n):this)},process:function(t){var n=this;return t=e.grep(t,function(e){return n.matcher(e)}),t=this.sorter(t),t.length?this.render(t.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(e){return~e.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(e){var t=[],n=[],r=[],i;while(i=e.shift())i.toLowerCase().indexOf(this.query.toLowerCase())?~i.indexOf(this.query)?n.push(i):r.push(i):t.push(i);return t.concat(n,r)},highlighter:function(e){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),function(e,t){return"<strong>"+t+"</strong>"})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery); | |
| 0 | 7 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | +(function(){function diff_match_patch(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32} | |
| 2 | +diff_match_patch.prototype.diff_main=function(a,b,c,d){"undefined"==typeof d&&(d=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1E3*this.Diff_Timeout);if(null==a||null==b)throw Error("Null input. (diff_main)");if(a==b)return a?[[0,a]]:[];"undefined"==typeof c&&(c=!0);var e=c,f=this.diff_commonPrefix(a,b);c=a.substring(0,f);a=a.substring(f);b=b.substring(f);var f=this.diff_commonSuffix(a,b),g=a.substring(a.length-f);a=a.substring(0,a.length-f);b=b.substring(0,b.length-f);a=this.diff_compute_(a, | |
| 3 | +b,e,d);c&&a.unshift([0,c]);g&&a.push([0,g]);this.diff_cleanupMerge(a);return a}; | |
| 4 | +diff_match_patch.prototype.diff_compute_=function(a,b,c,d){if(!a)return[[1,b]];if(!b)return[[-1,a]];var e=a.length>b.length?a:b,f=a.length>b.length?b:a,g=e.indexOf(f);return-1!=g?(c=[[1,e.substring(0,g)],[0,f],[1,e.substring(g+f.length)]],a.length>b.length&&(c[0][0]=c[2][0]=-1),c):1==f.length?[[-1,a],[1,b]]:(e=this.diff_halfMatch_(a,b))?(f=e[0],a=e[1],g=e[2],b=e[3],e=e[4],f=this.diff_main(f,g,c,d),c=this.diff_main(a,b,c,d),f.concat([[0,e]],c)):c&&100<a.length&&100<b.length?this.diff_lineMode_(a,b, | |
| 5 | +d):this.diff_bisect_(a,b,d)}; | |
| 6 | +diff_match_patch.prototype.diff_lineMode_=function(a,b,c){var d=this.diff_linesToChars_(a,b);a=d.chars1;b=d.chars2;d=d.lineArray;a=this.diff_main(a,b,!1,c);this.diff_charsToLines_(a,d);this.diff_cleanupSemantic(a);a.push([0,""]);for(var e=d=b=0,f="",g="";b<a.length;){switch(a[b][0]){case 1:e++;g+=a[b][1];break;case -1:d++;f+=a[b][1];break;case 0:if(1<=d&&1<=e){a.splice(b-d-e,d+e);b=b-d-e;d=this.diff_main(f,g,!1,c);for(e=d.length-1;0<=e;e--)a.splice(b,0,d[e]);b+=d.length}d=e=0;g=f=""}b++}a.pop();return a}; | |
| 7 | +diff_match_patch.prototype.diff_bisect_=function(a,b,c){for(var d=a.length,e=b.length,f=Math.ceil((d+e)/2),g=f,h=2*f,j=Array(h),i=Array(h),k=0;k<h;k++)j[k]=-1,i[k]=-1;j[g+1]=0;i[g+1]=0;for(var k=d-e,q=0!=k%2,r=0,t=0,p=0,w=0,v=0;v<f&&!((new Date).getTime()>c);v++){for(var n=-v+r;n<=v-t;n+=2){var l=g+n,m;m=n==-v||n!=v&&j[l-1]<j[l+1]?j[l+1]:j[l-1]+1;for(var s=m-n;m<d&&s<e&&a.charAt(m)==b.charAt(s);)m++,s++;j[l]=m;if(m>d)t+=2;else if(s>e)r+=2;else if(q&&(l=g+k-n,0<=l&&l<h&&-1!=i[l])){var u=d-i[l];if(m>= | |
| 8 | +u)return this.diff_bisectSplit_(a,b,m,s,c)}}for(n=-v+p;n<=v-w;n+=2){l=g+n;u=n==-v||n!=v&&i[l-1]<i[l+1]?i[l+1]:i[l-1]+1;for(m=u-n;u<d&&m<e&&a.charAt(d-u-1)==b.charAt(e-m-1);)u++,m++;i[l]=u;if(u>d)w+=2;else if(m>e)p+=2;else if(!q&&(l=g+k-n,0<=l&&(l<h&&-1!=j[l])&&(m=j[l],s=g+m-l,u=d-u,m>=u)))return this.diff_bisectSplit_(a,b,m,s,c)}}return[[-1,a],[1,b]]}; | |
| 9 | +diff_match_patch.prototype.diff_bisectSplit_=function(a,b,c,d,e){var f=a.substring(0,c),g=b.substring(0,d);a=a.substring(c);b=b.substring(d);f=this.diff_main(f,g,!1,e);e=this.diff_main(a,b,!1,e);return f.concat(e)}; | |
| 10 | +diff_match_patch.prototype.diff_linesToChars_=function(a,b){function c(a){for(var b="",c=0,f=-1,g=d.length;f<a.length-1;){f=a.indexOf("\n",c);-1==f&&(f=a.length-1);var r=a.substring(c,f+1),c=f+1;(e.hasOwnProperty?e.hasOwnProperty(r):void 0!==e[r])?b+=String.fromCharCode(e[r]):(b+=String.fromCharCode(g),e[r]=g,d[g++]=r)}return b}var d=[],e={};d[0]="";var f=c(a),g=c(b);return{chars1:f,chars2:g,lineArray:d}}; | |
| 11 | +diff_match_patch.prototype.diff_charsToLines_=function(a,b){for(var c=0;c<a.length;c++){for(var d=a[c][1],e=[],f=0;f<d.length;f++)e[f]=b[d.charCodeAt(f)];a[c][1]=e.join("")}};diff_match_patch.prototype.diff_commonPrefix=function(a,b){if(!a||!b||a.charAt(0)!=b.charAt(0))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(f,e)==b.substring(f,e)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e}; | |
| 12 | +diff_match_patch.prototype.diff_commonSuffix=function(a,b){if(!a||!b||a.charAt(a.length-1)!=b.charAt(b.length-1))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(a.length-e,a.length-f)==b.substring(b.length-e,b.length-f)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e}; | |
| 13 | +diff_match_patch.prototype.diff_commonOverlap_=function(a,b){var c=a.length,d=b.length;if(0==c||0==d)return 0;c>d?a=a.substring(c-d):c<d&&(b=b.substring(0,c));c=Math.min(c,d);if(a==b)return c;for(var d=0,e=1;;){var f=a.substring(c-e),f=b.indexOf(f);if(-1==f)return d;e+=f;if(0==f||a.substring(c-e)==b.substring(0,e))d=e,e++}}; | |
| 14 | +diff_match_patch.prototype.diff_halfMatch_=function(a,b){function c(a,b,c){for(var d=a.substring(c,c+Math.floor(a.length/4)),e=-1,g="",h,j,n,l;-1!=(e=b.indexOf(d,e+1));){var m=f.diff_commonPrefix(a.substring(c),b.substring(e)),s=f.diff_commonSuffix(a.substring(0,c),b.substring(0,e));g.length<s+m&&(g=b.substring(e-s,e)+b.substring(e,e+m),h=a.substring(0,c-s),j=a.substring(c+m),n=b.substring(0,e-s),l=b.substring(e+m))}return 2*g.length>=a.length?[h,j,n,l,g]:null}if(0>=this.Diff_Timeout)return null; | |
| 15 | +var d=a.length>b.length?a:b,e=a.length>b.length?b:a;if(4>d.length||2*e.length<d.length)return null;var f=this,g=c(d,e,Math.ceil(d.length/4)),d=c(d,e,Math.ceil(d.length/2)),h;if(!g&&!d)return null;h=d?g?g[4].length>d[4].length?g:d:d:g;var j;a.length>b.length?(g=h[0],d=h[1],e=h[2],j=h[3]):(e=h[0],j=h[1],g=h[2],d=h[3]);h=h[4];return[g,d,e,j,h]}; | |
| 16 | +diff_match_patch.prototype.diff_cleanupSemantic=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=0,h=0,j=0,i=0;f<a.length;)0==a[f][0]?(c[d++]=f,g=j,h=i,i=j=0,e=a[f][1]):(1==a[f][0]?j+=a[f][1].length:i+=a[f][1].length,e&&(e.length<=Math.max(g,h)&&e.length<=Math.max(j,i))&&(a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,d--,f=0<d?c[d-1]:-1,i=j=h=g=0,e=null,b=!0)),f++;b&&this.diff_cleanupMerge(a);this.diff_cleanupSemanticLossless(a);for(f=1;f<a.length;){if(-1==a[f-1][0]&&1==a[f][0]){b=a[f-1][1];c=a[f][1]; | |
| 17 | +d=this.diff_commonOverlap_(b,c);e=this.diff_commonOverlap_(c,b);if(d>=e){if(d>=b.length/2||d>=c.length/2)a.splice(f,0,[0,c.substring(0,d)]),a[f-1][1]=b.substring(0,b.length-d),a[f+1][1]=c.substring(d),f++}else if(e>=b.length/2||e>=c.length/2)a.splice(f,0,[0,b.substring(0,e)]),a[f-1][0]=1,a[f-1][1]=c.substring(0,c.length-e),a[f+1][0]=-1,a[f+1][1]=b.substring(e),f++;f++}f++}}; | |
| 18 | +diff_match_patch.prototype.diff_cleanupSemanticLossless=function(a){function b(a,b){if(!a||!b)return 6;var c=a.charAt(a.length-1),d=b.charAt(0),e=c.match(diff_match_patch.nonAlphaNumericRegex_),f=d.match(diff_match_patch.nonAlphaNumericRegex_),g=e&&c.match(diff_match_patch.whitespaceRegex_),h=f&&d.match(diff_match_patch.whitespaceRegex_),c=g&&c.match(diff_match_patch.linebreakRegex_),d=h&&d.match(diff_match_patch.linebreakRegex_),i=c&&a.match(diff_match_patch.blanklineEndRegex_),j=d&&b.match(diff_match_patch.blanklineStartRegex_); | |
| 19 | +return i||j?5:c||d?4:e&&!g&&h?3:g||h?2:e||f?1:0}for(var c=1;c<a.length-1;){if(0==a[c-1][0]&&0==a[c+1][0]){var d=a[c-1][1],e=a[c][1],f=a[c+1][1],g=this.diff_commonSuffix(d,e);if(g)var h=e.substring(e.length-g),d=d.substring(0,d.length-g),e=h+e.substring(0,e.length-g),f=h+f;for(var g=d,h=e,j=f,i=b(d,e)+b(e,f);e.charAt(0)===f.charAt(0);){var d=d+e.charAt(0),e=e.substring(1)+f.charAt(0),f=f.substring(1),k=b(d,e)+b(e,f);k>=i&&(i=k,g=d,h=e,j=f)}a[c-1][1]!=g&&(g?a[c-1][1]=g:(a.splice(c-1,1),c--),a[c][1]= | |
| 20 | +h,j?a[c+1][1]=j:(a.splice(c+1,1),c--))}c++}};diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;diff_match_patch.whitespaceRegex_=/\s/;diff_match_patch.linebreakRegex_=/[\r\n]/;diff_match_patch.blanklineEndRegex_=/\n\r?\n$/;diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/; | |
| 21 | +diff_match_patch.prototype.diff_cleanupEfficiency=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=!1,h=!1,j=!1,i=!1;f<a.length;){if(0==a[f][0])a[f][1].length<this.Diff_EditCost&&(j||i)?(c[d++]=f,g=j,h=i,e=a[f][1]):(d=0,e=null),j=i=!1;else if(-1==a[f][0]?i=!0:j=!0,e&&(g&&h&&j&&i||e.length<this.Diff_EditCost/2&&3==g+h+j+i))a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,e=null,g&&h?(j=i=!0,d=0):(d--,f=0<d?c[d-1]:-1,j=i=!1),b=!0;f++}b&&this.diff_cleanupMerge(a)}; | |
| 22 | +diff_match_patch.prototype.diff_cleanupMerge=function(a){a.push([0,""]);for(var b=0,c=0,d=0,e="",f="",g;b<a.length;)switch(a[b][0]){case 1:d++;f+=a[b][1];b++;break;case -1:c++;e+=a[b][1];b++;break;case 0:1<c+d?(0!==c&&0!==d&&(g=this.diff_commonPrefix(f,e),0!==g&&(0<b-c-d&&0==a[b-c-d-1][0]?a[b-c-d-1][1]+=f.substring(0,g):(a.splice(0,0,[0,f.substring(0,g)]),b++),f=f.substring(g),e=e.substring(g)),g=this.diff_commonSuffix(f,e),0!==g&&(a[b][1]=f.substring(f.length-g)+a[b][1],f=f.substring(0,f.length- | |
| 23 | +g),e=e.substring(0,e.length-g))),0===c?a.splice(b-d,c+d,[1,f]):0===d?a.splice(b-c,c+d,[-1,e]):a.splice(b-c-d,c+d,[-1,e],[1,f]),b=b-c-d+(c?1:0)+(d?1:0)+1):0!==b&&0==a[b-1][0]?(a[b-1][1]+=a[b][1],a.splice(b,1)):b++,c=d=0,f=e=""}""===a[a.length-1][1]&&a.pop();c=!1;for(b=1;b<a.length-1;)0==a[b-1][0]&&0==a[b+1][0]&&(a[b][1].substring(a[b][1].length-a[b-1][1].length)==a[b-1][1]?(a[b][1]=a[b-1][1]+a[b][1].substring(0,a[b][1].length-a[b-1][1].length),a[b+1][1]=a[b-1][1]+a[b+1][1],a.splice(b-1,1),c=!0):a[b][1].substring(0, | |
| 24 | +a[b+1][1].length)==a[b+1][1]&&(a[b-1][1]+=a[b+1][1],a[b][1]=a[b][1].substring(a[b+1][1].length)+a[b+1][1],a.splice(b+1,1),c=!0)),b++;c&&this.diff_cleanupMerge(a)};diff_match_patch.prototype.diff_xIndex=function(a,b){var c=0,d=0,e=0,f=0,g;for(g=0;g<a.length;g++){1!==a[g][0]&&(c+=a[g][1].length);-1!==a[g][0]&&(d+=a[g][1].length);if(c>b)break;e=c;f=d}return a.length!=g&&-1===a[g][0]?f:f+(b-e)}; | |
| 25 | +diff_match_patch.prototype.diff_prettyHtml=function(a){for(var b=[],c=/&/g,d=/</g,e=/>/g,f=/\n/g,g=0;g<a.length;g++){var h=a[g][0],j=a[g][1],j=j.replace(c,"&").replace(d,"<").replace(e,">").replace(f,"¶<br>");switch(h){case 1:b[g]='<ins style="background:#e6ffe6;">'+j+"</ins>";break;case -1:b[g]='<del style="background:#ffe6e6;">'+j+"</del>";break;case 0:b[g]="<span>"+j+"</span>"}}return b.join("")}; | |
| 26 | +diff_match_patch.prototype.diff_text1=function(a){for(var b=[],c=0;c<a.length;c++)1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_text2=function(a){for(var b=[],c=0;c<a.length;c++)-1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_levenshtein=function(a){for(var b=0,c=0,d=0,e=0;e<a.length;e++){var f=a[e][0],g=a[e][1];switch(f){case 1:c+=g.length;break;case -1:d+=g.length;break;case 0:b+=Math.max(c,d),d=c=0}}return b+=Math.max(c,d)}; | |
| 27 | +diff_match_patch.prototype.diff_toDelta=function(a){for(var b=[],c=0;c<a.length;c++)switch(a[c][0]){case 1:b[c]="+"+encodeURI(a[c][1]);break;case -1:b[c]="-"+a[c][1].length;break;case 0:b[c]="="+a[c][1].length}return b.join("\t").replace(/%20/g," ")}; | |
| 28 | +diff_match_patch.prototype.diff_fromDelta=function(a,b){for(var c=[],d=0,e=0,f=b.split(/\t/g),g=0;g<f.length;g++){var h=f[g].substring(1);switch(f[g].charAt(0)){case "+":try{c[d++]=[1,decodeURI(h)]}catch(j){throw Error("Illegal escape in diff_fromDelta: "+h);}break;case "-":case "=":var i=parseInt(h,10);if(isNaN(i)||0>i)throw Error("Invalid number in diff_fromDelta: "+h);h=a.substring(e,e+=i);"="==f[g].charAt(0)?c[d++]=[0,h]:c[d++]=[-1,h];break;default:if(f[g])throw Error("Invalid diff operation in diff_fromDelta: "+ | |
| 29 | +f[g]);}}if(e!=a.length)throw Error("Delta length ("+e+") does not equal source text length ("+a.length+").");return c};diff_match_patch.prototype.match_main=function(a,b,c){if(null==a||null==b||null==c)throw Error("Null input. (match_main)");c=Math.max(0,Math.min(c,a.length));return a==b?0:a.length?a.substring(c,c+b.length)==b?c:this.match_bitap_(a,b,c):-1}; | |
| 30 | +diff_match_patch.prototype.match_bitap_=function(a,b,c){function d(a,d){var e=a/b.length,g=Math.abs(c-d);return!f.Match_Distance?g?1:e:e+g/f.Match_Distance}if(b.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var e=this.match_alphabet_(b),f=this,g=this.Match_Threshold,h=a.indexOf(b,c);-1!=h&&(g=Math.min(d(0,h),g),h=a.lastIndexOf(b,c+b.length),-1!=h&&(g=Math.min(d(0,h),g)));for(var j=1<<b.length-1,h=-1,i,k,q=b.length+a.length,r,t=0;t<b.length;t++){i=0;for(k=q;i<k;)d(t,c+ | |
| 31 | +k)<=g?i=k:q=k,k=Math.floor((q-i)/2+i);q=k;i=Math.max(1,c-k+1);var p=Math.min(c+k,a.length)+b.length;k=Array(p+2);for(k[p+1]=(1<<t)-1;p>=i;p--){var w=e[a.charAt(p-1)];k[p]=0===t?(k[p+1]<<1|1)&w:(k[p+1]<<1|1)&w|((r[p+1]|r[p])<<1|1)|r[p+1];if(k[p]&j&&(w=d(t,p-1),w<=g))if(g=w,h=p-1,h>c)i=Math.max(1,2*c-h);else break}if(d(t+1,c)>g)break;r=k}return h}; | |
| 32 | +diff_match_patch.prototype.match_alphabet_=function(a){for(var b={},c=0;c<a.length;c++)b[a.charAt(c)]=0;for(c=0;c<a.length;c++)b[a.charAt(c)]|=1<<a.length-c-1;return b}; | |
| 33 | +diff_match_patch.prototype.patch_addContext_=function(a,b){if(0!=b.length){for(var c=b.substring(a.start2,a.start2+a.length1),d=0;b.indexOf(c)!=b.lastIndexOf(c)&&c.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)d+=this.Patch_Margin,c=b.substring(a.start2-d,a.start2+a.length1+d);d+=this.Patch_Margin;(c=b.substring(a.start2-d,a.start2))&&a.diffs.unshift([0,c]);(d=b.substring(a.start2+a.length1,a.start2+a.length1+d))&&a.diffs.push([0,d]);a.start1-=c.length;a.start2-=c.length;a.length1+= | |
| 34 | +c.length+d.length;a.length2+=c.length+d.length}}; | |
| 35 | +diff_match_patch.prototype.patch_make=function(a,b,c){var d;if("string"==typeof a&&"string"==typeof b&&"undefined"==typeof c)d=a,b=this.diff_main(d,b,!0),2<b.length&&(this.diff_cleanupSemantic(b),this.diff_cleanupEfficiency(b));else if(a&&"object"==typeof a&&"undefined"==typeof b&&"undefined"==typeof c)b=a,d=this.diff_text1(b);else if("string"==typeof a&&b&&"object"==typeof b&&"undefined"==typeof c)d=a;else if("string"==typeof a&&"string"==typeof b&&c&&"object"==typeof c)d=a,b=c;else throw Error("Unknown call format to patch_make."); | |
| 36 | +if(0===b.length)return[];c=[];a=new diff_match_patch.patch_obj;for(var e=0,f=0,g=0,h=d,j=0;j<b.length;j++){var i=b[j][0],k=b[j][1];!e&&0!==i&&(a.start1=f,a.start2=g);switch(i){case 1:a.diffs[e++]=b[j];a.length2+=k.length;d=d.substring(0,g)+k+d.substring(g);break;case -1:a.length1+=k.length;a.diffs[e++]=b[j];d=d.substring(0,g)+d.substring(g+k.length);break;case 0:k.length<=2*this.Patch_Margin&&e&&b.length!=j+1?(a.diffs[e++]=b[j],a.length1+=k.length,a.length2+=k.length):k.length>=2*this.Patch_Margin&& | |
| 37 | +e&&(this.patch_addContext_(a,h),c.push(a),a=new diff_match_patch.patch_obj,e=0,h=d,f=g)}1!==i&&(f+=k.length);-1!==i&&(g+=k.length)}e&&(this.patch_addContext_(a,h),c.push(a));return c};diff_match_patch.prototype.patch_deepCopy=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=new diff_match_patch.patch_obj;e.diffs=[];for(var f=0;f<d.diffs.length;f++)e.diffs[f]=d.diffs[f].slice();e.start1=d.start1;e.start2=d.start2;e.length1=d.length1;e.length2=d.length2;b[c]=e}return b}; | |
| 38 | +diff_match_patch.prototype.patch_apply=function(a,b){if(0==a.length)return[b,[]];a=this.patch_deepCopy(a);var c=this.patch_addPadding(a);b=c+b+c;this.patch_splitMax(a);for(var d=0,e=[],f=0;f<a.length;f++){var g=a[f].start2+d,h=this.diff_text1(a[f].diffs),j,i=-1;if(h.length>this.Match_MaxBits){if(j=this.match_main(b,h.substring(0,this.Match_MaxBits),g),-1!=j&&(i=this.match_main(b,h.substring(h.length-this.Match_MaxBits),g+h.length-this.Match_MaxBits),-1==i||j>=i))j=-1}else j=this.match_main(b,h,g); | |
| 39 | +if(-1==j)e[f]=!1,d-=a[f].length2-a[f].length1;else if(e[f]=!0,d=j-g,g=-1==i?b.substring(j,j+h.length):b.substring(j,i+this.Match_MaxBits),h==g)b=b.substring(0,j)+this.diff_text2(a[f].diffs)+b.substring(j+h.length);else if(g=this.diff_main(h,g,!1),h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)e[f]=!1;else{this.diff_cleanupSemanticLossless(g);for(var h=0,k,i=0;i<a[f].diffs.length;i++){var q=a[f].diffs[i];0!==q[0]&&(k=this.diff_xIndex(g,h));1===q[0]?b=b.substring(0, | |
| 40 | +j+k)+q[1]+b.substring(j+k):-1===q[0]&&(b=b.substring(0,j+k)+b.substring(j+this.diff_xIndex(g,h+q[1].length)));-1!==q[0]&&(h+=q[1].length)}}}b=b.substring(c.length,b.length-c.length);return[b,e]}; | |
| 41 | +diff_match_patch.prototype.patch_addPadding=function(a){for(var b=this.Patch_Margin,c="",d=1;d<=b;d++)c+=String.fromCharCode(d);for(d=0;d<a.length;d++)a[d].start1+=b,a[d].start2+=b;var d=a[0],e=d.diffs;if(0==e.length||0!=e[0][0])e.unshift([0,c]),d.start1-=b,d.start2-=b,d.length1+=b,d.length2+=b;else if(b>e[0][1].length){var f=b-e[0][1].length;e[0][1]=c.substring(e[0][1].length)+e[0][1];d.start1-=f;d.start2-=f;d.length1+=f;d.length2+=f}d=a[a.length-1];e=d.diffs;0==e.length||0!=e[e.length-1][0]?(e.push([0, | |
| 42 | +c]),d.length1+=b,d.length2+=b):b>e[e.length-1][1].length&&(f=b-e[e.length-1][1].length,e[e.length-1][1]+=c.substring(0,f),d.length1+=f,d.length2+=f);return c}; | |
| 43 | +diff_match_patch.prototype.patch_splitMax=function(a){for(var b=this.Match_MaxBits,c=0;c<a.length;c++)if(!(a[c].length1<=b)){var d=a[c];a.splice(c--,1);for(var e=d.start1,f=d.start2,g="";0!==d.diffs.length;){var h=new diff_match_patch.patch_obj,j=!0;h.start1=e-g.length;h.start2=f-g.length;""!==g&&(h.length1=h.length2=g.length,h.diffs.push([0,g]));for(;0!==d.diffs.length&&h.length1<b-this.Patch_Margin;){var g=d.diffs[0][0],i=d.diffs[0][1];1===g?(h.length2+=i.length,f+=i.length,h.diffs.push(d.diffs.shift()), | |
| 44 | +j=!1):-1===g&&1==h.diffs.length&&0==h.diffs[0][0]&&i.length>2*b?(h.length1+=i.length,e+=i.length,j=!1,h.diffs.push([g,i]),d.diffs.shift()):(i=i.substring(0,b-h.length1-this.Patch_Margin),h.length1+=i.length,e+=i.length,0===g?(h.length2+=i.length,f+=i.length):j=!1,h.diffs.push([g,i]),i==d.diffs[0][1]?d.diffs.shift():d.diffs[0][1]=d.diffs[0][1].substring(i.length))}g=this.diff_text2(h.diffs);g=g.substring(g.length-this.Patch_Margin);i=this.diff_text1(d.diffs).substring(0,this.Patch_Margin);""!==i&& | |
| 45 | +(h.length1+=i.length,h.length2+=i.length,0!==h.diffs.length&&0===h.diffs[h.diffs.length-1][0]?h.diffs[h.diffs.length-1][1]+=i:h.diffs.push([0,i]));j||a.splice(++c,0,h)}}};diff_match_patch.prototype.patch_toText=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=a[c];return b.join("")}; | |
| 46 | +diff_match_patch.prototype.patch_fromText=function(a){var b=[];if(!a)return b;a=a.split("\n");for(var c=0,d=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;c<a.length;){var e=a[c].match(d);if(!e)throw Error("Invalid patch string: "+a[c]);var f=new diff_match_patch.patch_obj;b.push(f);f.start1=parseInt(e[1],10);""===e[2]?(f.start1--,f.length1=1):"0"==e[2]?f.length1=0:(f.start1--,f.length1=parseInt(e[2],10));f.start2=parseInt(e[3],10);""===e[4]?(f.start2--,f.length2=1):"0"==e[4]?f.length2=0:(f.start2--,f.length2= | |
| 47 | +parseInt(e[4],10));for(c++;c<a.length;){e=a[c].charAt(0);try{var g=decodeURI(a[c].substring(1))}catch(h){throw Error("Illegal escape in patch_fromText: "+g);}if("-"==e)f.diffs.push([-1,g]);else if("+"==e)f.diffs.push([1,g]);else if(" "==e)f.diffs.push([0,g]);else if("@"==e)break;else if(""!==e)throw Error('Invalid patch mode "'+e+'" in: '+g);c++}}return b};diff_match_patch.patch_obj=function(){this.diffs=[];this.start2=this.start1=null;this.length2=this.length1=0}; | |
| 48 | +diff_match_patch.patch_obj.prototype.toString=function(){var a,b;a=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1;b=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;a=["@@ -"+a+" +"+b+" @@\n"];var c;for(b=0;b<this.diffs.length;b++){switch(this.diffs[b][0]){case 1:c="+";break;case -1:c="-";break;case 0:c=" "}a[b+1]=c+encodeURI(this.diffs[b][1])+"\n"}return a.join("").replace(/%20/g," ")}; | |
| 49 | +this.diff_match_patch=diff_match_patch;this.DIFF_DELETE=-1;this.DIFF_INSERT=1;this.DIFF_EQUAL=0;})() | ... | ... |
| ... | ... | @@ -0,0 +1,28 @@ |
| 1 | +/*! | |
| 2 | + | |
| 3 | + handlebars v2.0.0 | |
| 4 | + | |
| 5 | +Copyright (C) 2011-2014 by Yehuda Katz | |
| 6 | + | |
| 7 | +Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 8 | +of this software and associated documentation files (the "Software"), to deal | |
| 9 | +in the Software without restriction, including without limitation the rights | |
| 10 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 11 | +copies of the Software, and to permit persons to whom the Software is | |
| 12 | +furnished to do so, subject to the following conditions: | |
| 13 | + | |
| 14 | +The above copyright notice and this permission notice shall be included in | |
| 15 | +all copies or substantial portions of the Software. | |
| 16 | + | |
| 17 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 18 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 19 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 20 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 21 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 22 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
| 23 | +THE SOFTWARE. | |
| 24 | + | |
| 25 | +@license | |
| 26 | +*/ | |
| 27 | +!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={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},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++; | |
| 28 | +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}); | |
| 0 | 29 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,4 @@ |
| 1 | +/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ | |
| 2 | +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; | |
| 3 | +if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"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 null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.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]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.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=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,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||(m.cssNumber[c]?"":"px") | |
| 4 | +},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.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){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m}); | ... | ... |
| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | +/** | |
| 2 | + * @license | |
| 3 | + * Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE | |
| 4 | + * Build: `lodash -o ./dist/lodash.compat.js` | |
| 5 | + */ | |
| 6 | +;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:b+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=true;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=true | |
| 7 | +}}function r(n){return n.charCodeAt(0)}function u(n,t){for(var e=n.m,r=t.m,u=-1,o=e.length;++u<o;){var a=e[u],i=r[u];if(a!==i){if(a>i||typeof a=="undefined")return 1;if(a<i||typeof i=="undefined")return-1}}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return false;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=l(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+Y[n] | |
| 8 | +}function i(){return v.pop()||[]}function l(){return y.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(n){n.length=0,v.length<w&&v.push(n)}function p(n){var t=n.l;t&&p(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,y.length<w&&y.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r]; | |
| 9 | +return u}function g(e){function v(n){return n&&typeof n=="object"&&!qe(n)&&we.call(n,"__wrapped__")?n:new y(n)}function y(n,t){this.__chain__=!!t,this.__wrapped__=n}function w(n){function t(){if(r){var n=s(r);je.apply(n,arguments)}if(this instanceof t){var o=nt(e.prototype),n=e.apply(o,n||arguments);return xt(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return ze(t,n),t}function Y(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!xt(n))return n;var a=he.call(n);if(!V[a]||!Le.nodeClass&&f(n))return n; | |
| 10 | +var l=Te[a];switch(a){case L:case z:return new l(+n);case W:case M:return new l(n);case J:return o=l(n.source,S.exec(n)),o.lastIndex=n.lastIndex,o}if(a=qe(n),t){var p=!r;r||(r=i()),u||(u=i());for(var g=r.length;g--;)if(r[g]==n)return u[g];o=a?l(n.length):{}}else o=a?s(n):Ye({},n);return a&&(we.call(n,"index")&&(o.index=n.index),we.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(a?Xe:tr)(n,function(n,a){o[a]=Y(n,t,e,r,u)}),p&&(c(r),c(u)),o):o}function nt(n){return xt(n)?Se(n):{}}function tt(n,t,e){if(typeof n!="function")return Ht; | |
| 11 | +if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(Le.funcNames&&(r=!n.name),r=r||!Le.funcDecomp,!r)){var u=be.call(n);Le.funcNames||(r=!A.test(u)),r||(r=B.test(u),ze(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)}}return Mt(n,t)}function et(n){function t(){var n=l?a:this; | |
| 12 | +if(u){var h=s(u);je.apply(h,arguments)}return(o||c)&&(h||(h=s(arguments)),o&&je.apply(h,o),c&&h.length<i)?(r|=16,et([e,p?r:-4&r,h,null,a,i])):(h||(h=arguments),f&&(e=n[g]),this instanceof t?(n=nt(e.prototype),h=e.apply(n,h),xt(h)?h:n):e.apply(n,h))}var e=n[0],r=n[1],u=n[2],o=n[3],a=n[4],i=n[5],l=1&r,f=2&r,c=4&r,p=8&r,g=e;return ze(t,n),t}function rt(e,r){var u=-1,a=ht(),i=e?e.length:0,l=i>=_&&a===n,f=[];if(l){var c=o(r);c?(a=t,r=c):l=false}for(;++u<i;)c=e[u],0>a(r,c)&&f.push(c);return l&&p(r),f}function ot(n,t,e,r){r=(r||0)-1; | |
| 13 | +for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(qe(a)||dt(a))){t||(a=ot(a,t,e));var i=-1,l=a.length,f=o.length;for(o.length+=l;++i<l;)o[f++]=a[i]}else e||o.push(a)}return o}function at(n,t,e,r,u,o){if(e){var a=e(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&X[typeof n]||t&&X[typeof t]))return false;if(null==n||null==t)return n===t;var l=he.call(n),p=he.call(t);if(l==T&&(l=G),p==T&&(p=G),l!=p)return false;switch(l){case L:case z:return+n==+t; | |
| 14 | +case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case J:case M:return n==ie(t)}if(p=l==$,!p){var s=we.call(n,"__wrapped__"),g=we.call(t,"__wrapped__");if(s||g)return at(s?n.__wrapped__:n,g?t.__wrapped__:t,e,r,u,o);if(l!=G||!Le.nodeClass&&(f(n)||f(t)))return false;if(l=!Le.argsObject&&dt(n)?oe:n.constructor,s=!Le.argsObject&&dt(t)?oe:t.constructor,l!=s&&!(jt(l)&&l instanceof l&&jt(s)&&s instanceof s)&&"constructor"in n&&"constructor"in t)return false}for(l=!u,u||(u=i()),o||(o=i()),s=u.length;s--;)if(u[s]==n)return o[s]==t; | |
| 15 | +var h=0,a=true;if(u.push(n),o.push(t),p){if(s=n.length,h=t.length,(a=h==s)||r)for(;h--;)if(p=s,g=t[h],r)for(;p--&&!(a=at(n[p],g,e,r,u,o)););else if(!(a=at(n[h],g,e,r,u,o)))break}else nr(t,function(t,i,l){return we.call(l,i)?(h++,a=we.call(n,i)&&at(n[i],t,e,r,u,o)):void 0}),a&&!r&&nr(n,function(n,t,e){return we.call(e,t)?a=-1<--h:void 0});return u.pop(),o.pop(),l&&(c(u),c(o)),a}function it(n,t,e,r,u){(qe(t)?Dt:tr)(t,function(t,o){var a,i,l=t,f=n[o];if(t&&((i=qe(t))||er(t))){for(l=r.length;l--;)if(a=r[l]==t){f=u[l]; | |
| 16 | +break}if(!a){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?qe(f)?f:[]:er(f)?f:{}),r.push(t),u.push(f),c||it(f,t,e,r,u)}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);n[o]=f})}function lt(n,t){return n+de(Fe()*(t-n+1))}function ft(e,r,u){var a=-1,l=ht(),f=e?e.length:0,s=[],g=!r&&f>=_&&l===n,h=u||g?i():s;for(g&&(h=o(h),l=t);++a<f;){var v=e[a],y=u?u(v,a,e):v;(r?!a||h[h.length-1]!==y:0>l(h,y))&&((u||g)&&h.push(y),s.push(v))}return g?(c(h.k),p(h)):u&&c(h),s}function ct(n){return function(t,e,r){var u={}; | |
| 17 | +if(e=v.createCallback(e,r,3),qe(t)){r=-1;for(var o=t.length;++r<o;){var a=t[r];n(u,a,e(a,r,t),t)}}else Xe(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function pt(n,t,e,r,u,o){var a=1&t,i=4&t,l=16&t,f=32&t;if(!(2&t||jt(n)))throw new le;l&&!e.length&&(t&=-17,l=e=false),f&&!r.length&&(t&=-33,f=r=false);var c=n&&n.__bindData__;return c&&true!==c?(c=s(c),c[2]&&(c[2]=s(c[2])),c[3]&&(c[3]=s(c[3])),!a||1&c[1]||(c[4]=u),!a&&1&c[1]&&(t|=8),!i||4&c[1]||(c[5]=o),l&&je.apply(c[2]||(c[2]=[]),e),f&&Ee.apply(c[3]||(c[3]=[]),r),c[1]|=t,pt.apply(null,c)):(1==t||17===t?w:et)([n,t,e,r,u,o]) | |
| 18 | +}function st(){Q.h=F,Q.b=Q.c=Q.g=Q.i="",Q.e="t",Q.j=true;for(var n,t=0;n=arguments[t];t++)for(var e in n)Q[e]=n[e];t=Q.a,Q.d=/^[^,]+/.exec(t)[0],n=ee,t="return function("+t+"){",e=Q;var r="var n,t="+e.d+",E="+e.e+";if(!t)return E;"+e.i+";";e.b?(r+="var u=t.length;n=-1;if("+e.b+"){",Le.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+e.g+";}}else{"):Le.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+e.g+";}}else{"),Le.enumPrototypes&&(r+="var G=typeof t=='function';"),Le.enumErrorProps&&(r+="var F=t===k||t instanceof Error;"); | |
| 19 | +var u=[];if(Le.enumPrototypes&&u.push('!(G&&n=="prototype")'),Le.enumErrorProps&&u.push('!(F&&(n=="message"||n=="name"))'),e.j&&e.f)r+="var C=-1,D=B[typeof t]&&v(t),u=D?D.length:0;while(++C<u){n=D[C];",u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}";else if(r+="for(n in t){",e.j&&u.push("m.call(t, n)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}",Le.nonEnumShadows){for(r+="if(t!==A){var i=t.constructor,r=t===(i&&i.prototype),f=t===J?I:t===k?j:L.call(t),x=y[f];",k=0;7>k;k++)r+="n='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}"; | |
| 20 | +r+="}"}return(e.b||Le.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(tt,q,ce,we,d,dt,qe,kt,Q.f,pe,X,$e,M,se,he)}function gt(n){return Ve[n]}function ht(){var t=(t=v.indexOf)===zt?n:t;return t}function vt(n){return typeof n=="function"&&ve.test(n)}function yt(n){var t,e;return!n||he.call(n)!=G||(t=n.constructor,jt(t)&&!(t instanceof t))||!Le.argsClass&&dt(n)||!Le.nodeClass&&f(n)?false:Le.ownLast?(nr(n,function(n,t,r){return e=we.call(r,t),false}),false!==e):(nr(n,function(n,t){e=t | |
| 21 | +}),typeof e=="undefined"||we.call(n,e))}function mt(n){return He[n]}function dt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&he.call(n)==T||false}function bt(n,t,e){var r=We(n),u=r.length;for(t=tt(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function _t(n){var t=[];return nr(n,function(n,e){jt(n)&&t.push(e)}),t.sort()}function wt(n){for(var t=-1,e=We(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function jt(n){return typeof n=="function"}function xt(n){return!(!n||!X[typeof n]) | |
| 22 | +}function Ct(n){return typeof n=="number"||n&&typeof n=="object"&&he.call(n)==W||false}function kt(n){return typeof n=="string"||n&&typeof n=="object"&&he.call(n)==M||false}function Et(n){for(var t=-1,e=We(n),r=e.length,u=Zt(r);++t<r;)u[t]=n[e[t]];return u}function Ot(n,t,e){var r=-1,u=ht(),o=n?n.length:0,a=false;return e=(0>e?Be(0,o+e):e)||0,qe(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(kt(n)?n.indexOf(t,e):u(n,t,e)):Xe(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function St(n,t,e){var r=true;if(t=v.createCallback(t,e,3),qe(n)){e=-1; | |
| 23 | +for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Xe(n,function(n,e,u){return r=!!t(n,e,u)});return r}function At(n,t,e){var r=[];if(t=v.createCallback(t,e,3),qe(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else Xe(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function It(n,t,e){if(t=v.createCallback(t,e,3),!qe(n)){var r;return Xe(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function Dt(n,t,e){if(t&&typeof e=="undefined"&&qe(n)){e=-1; | |
| 24 | +for(var r=n.length;++e<r&&false!==t(n[e],e,n););}else Xe(n,t,e);return n}function Nt(n,t,e){var r=n,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt(t,e,3),qe(n))for(;u--&&false!==t(n[u],u,n););else{if(typeof u!="number")var o=We(n),u=o.length;else Le.unindexedChars&&kt(n)&&(r=n.split(""));Xe(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)})}return n}function Bt(n,t,e){var r=-1,u=n?n.length:0,o=Zt(typeof u=="number"?u:0);if(t=v.createCallback(t,e,3),qe(n))for(;++r<u;)o[r]=t(n[r],r,n);else Xe(n,function(n,e,u){o[++r]=t(n,e,u) | |
| 25 | +});return o}function Pt(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&qe(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=null==t&&kt(n)?r:v.createCallback(t,e,3),Xe(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Rt(n,t,e,r){var u=3>arguments.length;if(t=v.createCallback(t,r,4),qe(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Xe(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)});return e}function Ft(n,t,e,r){var u=3>arguments.length; | |
| 26 | +return t=v.createCallback(t,r,4),Nt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Tt(n){var t=-1,e=n?n.length:0,r=Zt(typeof e=="number"?e:0);return Dt(n,function(n){var e=lt(0,++t);r[t]=r[e],r[e]=n}),r}function $t(n,t,e){var r;if(t=v.createCallback(t,e,3),qe(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Xe(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function Lt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=v.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++ | |
| 27 | +}else if(r=t,null==r||e)return n?n[0]:h;return s(n,0,Pe(Be(0,r),u))}function zt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Be(0,u+r):r||0}else if(r)return r=Kt(t,e),t[r]===e?r:-1;return n(t,e,r)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=v.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Be(0,t);return s(n,r)}function Kt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?v.createCallback(e,r,1):Ht,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r; | |
| 28 | +return u}function Wt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=v.createCallback(e,r,3)),ft(n,t,e)}function Gt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Pt(ar(n,"length")):0,r=Zt(0>e?0:e);++t<e;)r[t]=ar(n,t);return r}function Jt(n,t){var e=-1,r=n?n.length:0,u={};for(t||!r||qe(n[0])||(t=[]);++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Mt(n,t){return 2<arguments.length?pt(n,17,s(arguments,2),null,t):pt(n,1,null,null,t) | |
| 29 | +}function Vt(n,t,e){var r,u,o,a,i,l,f,c=0,p=false,s=true;if(!jt(n))throw new le;if(t=Be(0,t)||0,true===e)var g=true,s=false;else xt(e)&&(g=e.leading,p="maxWait"in e&&(Be(t,e.maxWait)||0),s="trailing"in e?e.trailing:s);var v=function(){var e=t-(ir()-a);0<e?l=Ce(v,e):(u&&me(u),e=f,u=l=f=h,e&&(c=ir(),o=n.apply(i,r),l||u||(r=i=null)))},y=function(){l&&me(l),u=l=f=h,(s||p!==t)&&(c=ir(),o=n.apply(i,r),l||u||(r=i=null))};return function(){if(r=arguments,a=ir(),i=this,f=s&&(l||!g),false===p)var e=g&&!l;else{u||g||(c=a); | |
| 30 | +var h=p-(a-c),m=0>=h;m?(u&&(u=me(u)),c=a,o=n.apply(i,r)):u||(u=Ce(y,h))}return m&&l?l=me(l):l||t===p||(l=Ce(v,t)),e&&(m=true,o=n.apply(i,r)),!m||l||u||(r=i=null),o}}function Ht(n){return n}function Ut(n,t,e){var r=true,u=t&&_t(t);t&&(e||u.length)||(null==e&&(e=t),o=y,t=n,n=v,u=_t(t)),false===e?r=false:xt(e)&&"chain"in e&&(r=e.chain);var o=n,a=jt(o);Dt(u,function(e){var u=n[e]=t[e];a&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,a=[e];if(je.apply(a,arguments),a=u.apply(n,a),r||t){if(e===a&&xt(a))return this; | |
| 31 | +a=new o(a),a.__chain__=t}return a})})}function Qt(){}function Xt(n){return function(t){return t[n]}}function Yt(){return this.__wrapped__}e=e?ut.defaults(Z.Object(),e,ut.pick(Z,R)):Z;var Zt=e.Array,ne=e.Boolean,te=e.Date,ee=e.Function,re=e.Math,ue=e.Number,oe=e.Object,ae=e.RegExp,ie=e.String,le=e.TypeError,fe=[],ce=e.Error.prototype,pe=oe.prototype,se=ie.prototype,ge=e._,he=pe.toString,ve=ae("^"+ie(he).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ye=re.ceil,me=e.clearTimeout,de=re.floor,be=ee.prototype.toString,_e=vt(_e=oe.getPrototypeOf)&&_e,we=pe.hasOwnProperty,je=fe.push,xe=pe.propertyIsEnumerable,Ce=e.setTimeout,ke=fe.splice,Ee=fe.unshift,Oe=function(){try{var n={},t=vt(t=oe.defineProperty)&&t,e=t(n,n,n)&&t | |
| 32 | +}catch(r){}return e}(),Se=vt(Se=oe.create)&&Se,Ae=vt(Ae=Zt.isArray)&&Ae,Ie=e.isFinite,De=e.isNaN,Ne=vt(Ne=oe.keys)&&Ne,Be=re.max,Pe=re.min,Re=e.parseInt,Fe=re.random,Te={};Te[$]=Zt,Te[L]=ne,Te[z]=te,Te[K]=ee,Te[G]=oe,Te[W]=ue,Te[J]=ae,Te[M]=ie;var $e={};$e[$]=$e[z]=$e[W]={constructor:true,toLocaleString:true,toString:true,valueOf:true},$e[L]=$e[M]={constructor:true,toString:true,valueOf:true},$e[q]=$e[K]=$e[J]={constructor:true,toString:true},$e[G]={constructor:true},function(){for(var n=F.length;n--;){var t,e=F[n]; | |
| 33 | +for(t in $e)we.call($e,t)&&!we.call($e[t],e)&&($e[t][e]=false)}}(),y.prototype=v.prototype;var Le=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},r=[];n.prototype={valueOf:1,y:1};for(var u in new n)r.push(u);for(u in arguments);Le.argsClass=he.call(arguments)==T,Le.argsObject=arguments.constructor==oe&&!(arguments instanceof Zt),Le.enumErrorProps=xe.call(ce,"message")||xe.call(ce,"name"),Le.enumPrototypes=xe.call(n,"prototype"),Le.funcDecomp=!vt(e.WinRTError)&&B.test(g),Le.funcNames=typeof ee.name=="string",Le.nonEnumArgs=0!=u,Le.nonEnumShadows=!/valueOf/.test(r),Le.ownLast="x"!=r[0],Le.spliceObjects=(fe.splice.call(t,0,1),!t[0]),Le.unindexedChars="xx"!="x"[0]+oe("x")[0]; | |
| 34 | +try{Le.nodeClass=!(he.call(document)==G&&!({toString:0}+""))}catch(o){Le.nodeClass=true}}(1),v.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:v}},Se||(nt=function(){function n(){}return function(t){if(xt(t)){n.prototype=t;var r=new n;n.prototype=null}return r||e.Object()}}());var ze=Oe?function(n,t){U.value=t,Oe(n,"__bindData__",U)}:Qt;Le.argsClass||(dt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&we.call(n,"callee")&&!xe.call(n,"callee")||false | |
| 35 | +});var qe=Ae||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&he.call(n)==$||false},Ke=st({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),We=Ne?function(n){return xt(n)?Le.enumPrototypes&&typeof n=="function"||Le.nonEnumArgs&&n.length&&dt(n)?Ke(n):Ne(n):[]}:Ke,Ge={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:We,g:"if(e(t[n],n,g)===false)return E"},Je={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b<c){t=a[b];if(t&&B[typeof t]){",v:We,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Me={i:"if(!B[typeof t])return E;"+Ge.i,b:false},Ve={"&":"&","<":"<",">":">",'"':""","'":"'"},He=wt(Ve),Ue=ae("("+We(He).join("|")+")","g"),Qe=ae("["+We(Ve).join("")+"]","g"),Xe=st(Ge),Ye=st(Je,{i:Je.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),Ze=st(Je),nr=st(Ge,Me,{j:false}),tr=st(Ge,Me); | |
| 36 | +jt(/x/)&&(jt=function(n){return typeof n=="function"&&he.call(n)==K});var er=_e?function(n){if(!n||he.call(n)!=G||!Le.argsClass&&dt(n))return false;var t=n.valueOf,e=vt(t)&&(e=_e(t))&&_e(e);return e?n==e||_e(n)==e:yt(n)}:yt,rr=ct(function(n,t,e){we.call(n,e)?n[e]++:n[e]=1}),ur=ct(function(n,t,e){(we.call(n,e)?n[e]:n[e]=[]).push(t)}),or=ct(function(n,t,e){n[e]=t}),ar=Bt,ir=vt(ir=te.now)&&ir||function(){return(new te).getTime()},lr=8==Re(j+"08")?Re:function(n,t){return Re(kt(n)?n.replace(D,""):n,t||0)}; | |
| 37 | +return v.after=function(n,t){if(!jt(t))throw new le;return function(){return 1>--n?t.apply(this,arguments):void 0}},v.assign=Ye,v.at=function(n){var t=arguments,e=-1,r=ot(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Zt(t);for(Le.unindexedChars&&kt(n)&&(n=n.split(""));++e<t;)u[e]=n[r[e]];return u},v.bind=Mt,v.bindAll=function(n){for(var t=1<arguments.length?ot(arguments,true,false,1):_t(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=pt(n[u],1,null,null,n)}return n},v.bindKey=function(n,t){return 2<arguments.length?pt(t,19,s(arguments,2),null,n):pt(t,3,null,null,n) | |
| 38 | +},v.chain=function(n){return n=new y(n),n.__chain__=true,n},v.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},v.compose=function(){for(var n=arguments,t=n.length;t--;)if(!jt(n[t]))throw new le;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},v.constant=function(n){return function(){return n}},v.countBy=rr,v.create=function(n,t){var e=nt(n);return t?Ye(e,t):e},v.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return tt(n,t,e); | |
| 39 | +if("object"!=r)return Xt(n);var u=We(n),o=u[0],a=n[o];return 1!=u.length||a!==a||xt(a)?function(t){for(var e=u.length,r=false;e--&&(r=at(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},v.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,pt(n,4,null,null,null,t)},v.debounce=Vt,v.defaults=Ze,v.defer=function(n){if(!jt(n))throw new le;var t=s(arguments,1);return Ce(function(){n.apply(h,t)},1)},v.delay=function(n,t){if(!jt(n))throw new le;var e=s(arguments,2); | |
| 40 | +return Ce(function(){n.apply(h,e)},t)},v.difference=function(n){return rt(n,ot(arguments,true,true,1))},v.filter=At,v.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Bt(n,e,r)),ot(n,t)},v.forEach=Dt,v.forEachRight=Nt,v.forIn=nr,v.forInRight=function(n,t,e){var r=[];nr(n,function(n,t){r.push(t,n)});var u=r.length;for(t=tt(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},v.forOwn=tr,v.forOwnRight=bt,v.functions=_t,v.groupBy=ur,v.indexBy=or,v.initial=function(n,t,e){var r=0,u=n?n.length:0; | |
| 41 | +if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return s(n,0,Pe(Be(0,u-r),u))},v.intersection=function(){for(var e=[],r=-1,u=arguments.length,a=i(),l=ht(),f=l===n,s=i();++r<u;){var g=arguments[r];(qe(g)||dt(g))&&(e.push(g),a.push(f&&g.length>=_&&o(r?e[r]:s)))}var f=e[0],h=-1,v=f?f.length:0,y=[];n:for(;++h<v;){var m=a[0],g=f[h];if(0>(m?t(m,g):l(s,g))){for(r=u,(m||s).push(g);--r;)if(m=a[r],0>(m?t(m,g):l(e[r],g)))continue n;y.push(g) | |
| 42 | +}}for(;u--;)(m=a[u])&&p(m);return c(a),c(s),y},v.invert=wt,v.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Zt(typeof o=="number"?o:0);return Dt(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},v.keys=We,v.map=Bt,v.mapValues=function(n,t,e){var r={};return t=v.createCallback(t,e,3),tr(n,function(n,e,u){r[e]=t(n,e,u)}),r},v.max=Pt,v.memoize=function(n,t){if(!jt(n))throw new le;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];return we.call(r,u)?r[u]:r[u]=n.apply(this,arguments) | |
| 43 | +};return e.cache={},e},v.merge=function(n){var t=arguments,e=2;if(!xt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=tt(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=s(arguments,1,e),u=-1,o=i(),a=i();++u<e;)it(n,t[u],r,o,a);return c(o),c(a),n},v.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&qe(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i<o&&(o=i)}}else t=null==t&&kt(n)?r:v.createCallback(t,e,3),Xe(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n) | |
| 44 | +});return o},v.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];nr(n,function(n,t){u.push(t)});for(var u=rt(u,ot(arguments,true,false,1)),o=-1,a=u.length;++o<a;){var i=u[o];r[i]=n[i]}}else t=v.createCallback(t,e,3),nr(n,function(n,e,u){t(n,e,u)||(r[e]=n)});return r},v.once=function(n){var t,e;if(!jt(n))throw new le;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)}},v.pairs=function(n){for(var t=-1,e=We(n),r=e.length,u=Zt(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u | |
| 45 | +},v.partial=function(n){return pt(n,16,s(arguments,1))},v.partialRight=function(n){return pt(n,32,null,s(arguments,1))},v.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=ot(arguments,true,false,1),a=xt(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=v.createCallback(t,e,3),nr(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},v.pluck=ar,v.property=Xt,v.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,a=t[e];++o<u;)n[o]===a&&(ke.call(n,o--,1),u--); | |
| 46 | +return n},v.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Be(0,ye((t-n)/(e||1)));for(var u=Zt(t);++r<t;)u[r]=n,n+=e;return u},v.reject=function(n,t,e){return t=v.createCallback(t,e,3),At(n,function(n,e,r){return!t(n,e,r)})},v.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=v.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),ke.call(n,r--,1),u--);return o},v.rest=qt,v.shuffle=Tt,v.sortBy=function(n,t,e){var r=-1,o=qe(t),a=n?n.length:0,f=Zt(typeof a=="number"?a:0); | |
| 47 | +for(o||(t=v.createCallback(t,e,3)),Dt(n,function(n,e,u){var a=f[++r]=l();o?a.m=Bt(t,function(t){return n[t]}):(a.m=i())[0]=t(n,e,u),a.n=r,a.o=n}),a=f.length,f.sort(u);a--;)n=f[a],f[a]=n.o,o||c(n.m),p(n);return f},v.tap=function(n,t){return t(n),n},v.throttle=function(n,t,e){var r=true,u=true;if(!jt(n))throw new le;return false===e?r=false:xt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),H.leading=r,H.maxWait=t,H.trailing=u,Vt(n,t,H)},v.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Zt(n); | |
| 48 | +for(t=tt(t,e,1);++r<n;)u[r]=t(r);return u},v.toArray=function(n){return n&&typeof n.length=="number"?Le.unindexedChars&&kt(n)?n.split(""):s(n):Et(n)},v.transform=function(n,t,e,r){var u=qe(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=nt(o&&o.prototype)}return t&&(t=v.createCallback(t,r,4),(u?Xe:tr)(n,function(n,r,u){return t(e,n,r,u)})),e},v.union=function(){return ft(ot(arguments,true,true))},v.uniq=Wt,v.values=Et,v.where=At,v.without=function(n){return rt(n,s(arguments,1))},v.wrap=function(n,t){return pt(t,16,[n]) | |
| 49 | +},v.xor=function(){for(var n=-1,t=arguments.length;++n<t;){var e=arguments[n];if(qe(e)||dt(e))var r=r?ft(rt(r,e).concat(rt(e,r))):e}return r||[]},v.zip=Gt,v.zipObject=Jt,v.collect=Bt,v.drop=qt,v.each=Dt,v.eachRight=Nt,v.extend=Ye,v.methods=_t,v.object=Jt,v.select=At,v.tail=qt,v.unique=Wt,v.unzip=Gt,Ut(v),v.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),Y(n,t,typeof e=="function"&&tt(e,r,1))},v.cloneDeep=function(n,t,e){return Y(n,true,typeof t=="function"&&tt(t,e,1))},v.contains=Ot,v.escape=function(n){return null==n?"":ie(n).replace(Qe,gt) | |
| 50 | +},v.every=St,v.find=It,v.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=v.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},v.findKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),tr(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.findLast=function(n,t,e){var r;return t=v.createCallback(t,e,3),Nt(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r},v.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=v.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r; | |
| 51 | +return-1},v.findLastKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),bt(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.has=function(n,t){return n?we.call(n,t):false},v.identity=Ht,v.indexOf=zt,v.isArguments=dt,v.isArray=qe,v.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&he.call(n)==L||false},v.isDate=function(n){return n&&typeof n=="object"&&he.call(n)==z||false},v.isElement=function(n){return n&&1===n.nodeType||false},v.isEmpty=function(n){var t=true;if(!n)return t;var e=he.call(n),r=n.length; | |
| 52 | +return e==$||e==M||(Le.argsClass?e==T:dt(n))||e==G&&typeof r=="number"&&jt(n.splice)?!r:(tr(n,function(){return t=false}),t)},v.isEqual=function(n,t,e,r){return at(n,t,typeof e=="function"&&tt(e,r,2))},v.isFinite=function(n){return Ie(n)&&!De(parseFloat(n))},v.isFunction=jt,v.isNaN=function(n){return Ct(n)&&n!=+n},v.isNull=function(n){return null===n},v.isNumber=Ct,v.isObject=xt,v.isPlainObject=er,v.isRegExp=function(n){return n&&X[typeof n]&&he.call(n)==J||false},v.isString=kt,v.isUndefined=function(n){return typeof n=="undefined" | |
| 53 | +},v.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Be(0,r+e):Pe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},v.mixin=Ut,v.noConflict=function(){return e._=ge,this},v.noop=Qt,v.now=ir,v.parseInt=lr,v.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Fe(),Pe(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):lt(n,t)},v.reduce=Rt,v.reduceRight=Ft,v.result=function(n,t){if(n){var e=n[t]; | |
| 54 | +return jt(e)?n[t]():e}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:We(n).length},v.some=$t,v.sortedIndex=Kt,v.template=function(n,t,e){var r=v.templateSettings;n=ie(n||""),e=Ze({},e,r);var u,o=Ze({},e.imports,r.imports),r=We(o),o=Et(o),i=0,l=e.interpolate||N,f="__p+='",l=ae((e.escape||N).source+"|"+l.source+"|"+(l===I?O:N).source+"|"+(e.evaluate||N).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(P,a),e&&(f+="'+__e("+e+")+'"),l&&(u=true,f+="';"+l+";\n__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t | |
| 55 | +}),f+="';",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(x,""):f).replace(C,"$1").replace(E,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=ee(r,"return "+f).apply(h,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},v.unescape=function(n){return null==n?"":ie(n).replace(Ue,mt)},v.uniqueId=function(n){var t=++m;return ie(null==n?"":n)+t | |
| 56 | +},v.all=St,v.any=$t,v.detect=It,v.findWhere=It,v.foldl=Rt,v.foldr=Ft,v.include=Ot,v.inject=Rt,Ut(function(){var n={};return tr(v,function(t,e){v.prototype[e]||(n[e]=t)}),n}(),false),v.first=Lt,v.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Be(0,u-r))},v.sample=function(n,t,e){return n&&typeof n.length!="number"?n=Et(n):Le.unindexedChars&&kt(n)&&(n=n.split("")),null==t||e?n?n[lt(0,n.length-1)]:h:(n=Tt(n),n.length=Pe(Be(0,t),n.length),n) | |
| 57 | +},v.take=Lt,v.head=Lt,tr(v,function(n,t){var e="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.4.1",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return ie(this.__wrapped__)},v.prototype.value=Yt,v.prototype.valueOf=Yt,Xe(["join","pop","shift"],function(n){var t=fe[n];v.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments); | |
| 58 | +return n?new y(e,n):e}}),Xe(["push","reverse","sort","unshift"],function(n){var t=fe[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Xe(["concat","slice","splice"],function(n){var t=fe[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Le.spliceObjects||Xe(["pop","shift","splice"],function(n){var t=fe[n],e="splice"==n;v.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new y(u,n):u | |
| 59 | +}}),v}var h,v=[],y=[],m=0,d={},b=+new Date+"",_=75,w=40,j=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",x=/\b__p\+='';/g,C=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,O=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,A=/^\s*function[ \n\r\t]+\w/,I=/<%=([\s\S]+?)%>/g,D=RegExp("^["+j+"]*0+(?=.$)"),N=/($^)/,B=/\bthis\b/,P=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setTimeout".split(" "),F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),T="[object Arguments]",$="[object Array]",L="[object Boolean]",z="[object Date]",q="[object Error]",K="[object Function]",W="[object Number]",G="[object Object]",J="[object RegExp]",M="[object String]",V={}; | |
| 60 | +V[K]=false,V[T]=V[$]=V[L]=V[z]=V[W]=V[G]=V[J]=V[M]=true;var H={leading:false,maxWait:0,trailing:false},U={configurable:false,enumerable:false,value:null,writable:false},Q={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:false},X={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&window||this,nt=X[typeof exports]&&exports&&!exports.nodeType&&exports,tt=X[typeof module]&&module&&!module.nodeType&&module,et=tt&&tt.exports===nt&&nt,rt=X[typeof global]&&global; | |
| 61 | +!rt||rt.global!==rt&&rt.window!==rt||(Z=rt);var ut=g();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Z._=ut, define(function(){return ut})):nt&&tt?et?(tt.exports=ut)._=ut:nt._=ut:Z._=ut}).call(this); | |
| 0 | 62 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | +The MIT License (MIT) | |
| 2 | + | |
| 3 | +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) | |
| 4 | + | |
| 5 | +Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 6 | +of this software and associated documentation files (the "Software"), to deal | |
| 7 | +in the Software without restriction, including without limitation the rights | |
| 8 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 9 | +copies of the Software, and to permit persons to whom the Software is | |
| 10 | +furnished to do so, subject to the following conditions: | |
| 11 | + | |
| 12 | +The above copyright notice and this permission notice shall be included in | |
| 13 | +all copies or substantial portions of the Software. | |
| 14 | + | |
| 15 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 16 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 17 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 18 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 19 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 20 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
| 21 | +THE SOFTWARE. | ... | ... |
| ... | ... | @@ -0,0 +1,204 @@ |
| 1 | +var isArray = Array.isArray || function (arr) { | |
| 2 | + return Object.prototype.toString.call(arr) == '[object Array]'; | |
| 3 | +}; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * Expose `pathToRegexp`. | |
| 7 | + */ | |
| 8 | +// module.exports = pathToRegexp | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * The main path matching regexp utility. | |
| 12 | + * | |
| 13 | + * @type {RegExp} | |
| 14 | + */ | |
| 15 | +var PATH_REGEXP = new RegExp([ | |
| 16 | + // Match escaped characters that would otherwise appear in future matches. | |
| 17 | + // This allows the user to escape special characters that won't transform. | |
| 18 | + '(\\\\.)', | |
| 19 | + // Match Express-style parameters and un-named parameters with a prefix | |
| 20 | + // and optional suffixes. Matches appear as: | |
| 21 | + // | |
| 22 | + // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?"] | |
| 23 | + // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined] | |
| 24 | + '([\\/.])?(?:\\:(\\w+)(?:\\(((?:\\\\.|[^)])*)\\))?|\\(((?:\\\\.|[^)])*)\\))([+*?])?', | |
| 25 | + // Match regexp special characters that are always escaped. | |
| 26 | + '([.+*?=^!:${}()[\\]|\\/])' | |
| 27 | +].join('|'), 'g'); | |
| 28 | + | |
| 29 | +/** | |
| 30 | + * Escape the capturing group by escaping special characters and meaning. | |
| 31 | + * | |
| 32 | + * @param {String} group | |
| 33 | + * @return {String} | |
| 34 | + */ | |
| 35 | +function escapeGroup (group) { | |
| 36 | + return group.replace(/([=!:$\/()])/g, '\\$1'); | |
| 37 | +} | |
| 38 | + | |
| 39 | +/** | |
| 40 | + * Attach the keys as a property of the regexp. | |
| 41 | + * | |
| 42 | + * @param {RegExp} re | |
| 43 | + * @param {Array} keys | |
| 44 | + * @return {RegExp} | |
| 45 | + */ | |
| 46 | +function attachKeys (re, keys) { | |
| 47 | + re.keys = keys; | |
| 48 | + return re; | |
| 49 | +} | |
| 50 | + | |
| 51 | +/** | |
| 52 | + * Get the flags for a regexp from the options. | |
| 53 | + * | |
| 54 | + * @param {Object} options | |
| 55 | + * @return {String} | |
| 56 | + */ | |
| 57 | +function flags (options) { | |
| 58 | + return options.sensitive ? '' : 'i'; | |
| 59 | +} | |
| 60 | + | |
| 61 | +/** | |
| 62 | + * Pull out keys from a regexp. | |
| 63 | + * | |
| 64 | + * @param {RegExp} path | |
| 65 | + * @param {Array} keys | |
| 66 | + * @return {RegExp} | |
| 67 | + */ | |
| 68 | +function regexpToRegexp (path, keys) { | |
| 69 | + // Use a negative lookahead to match only capturing groups. | |
| 70 | + var groups = path.source.match(/\((?!\?)/g); | |
| 71 | + | |
| 72 | + if (groups) { | |
| 73 | + for (var i = 0; i < groups.length; i++) { | |
| 74 | + keys.push({ | |
| 75 | + name: i, | |
| 76 | + delimiter: null, | |
| 77 | + optional: false, | |
| 78 | + repeat: false | |
| 79 | + }); | |
| 80 | + } | |
| 81 | + } | |
| 82 | + | |
| 83 | + return attachKeys(path, keys); | |
| 84 | +} | |
| 85 | + | |
| 86 | +/** | |
| 87 | + * Transform an array into a regexp. | |
| 88 | + * | |
| 89 | + * @param {Array} path | |
| 90 | + * @param {Array} keys | |
| 91 | + * @param {Object} options | |
| 92 | + * @return {RegExp} | |
| 93 | + */ | |
| 94 | +function arrayToRegexp (path, keys, options) { | |
| 95 | + var parts = []; | |
| 96 | + | |
| 97 | + for (var i = 0; i < path.length; i++) { | |
| 98 | + parts.push(pathToRegexp(path[i], keys, options).source); | |
| 99 | + } | |
| 100 | + | |
| 101 | + var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)); | |
| 102 | + return attachKeys(regexp, keys); | |
| 103 | +} | |
| 104 | + | |
| 105 | +/** | |
| 106 | + * Replace the specific tags with regexp strings. | |
| 107 | + * | |
| 108 | + * @param {String} path | |
| 109 | + * @param {Array} keys | |
| 110 | + * @return {String} | |
| 111 | + */ | |
| 112 | +function replacePath (path, keys) { | |
| 113 | + var index = 0; | |
| 114 | + | |
| 115 | + function replace (_, escaped, prefix, key, capture, group, suffix, escape) { | |
| 116 | + if (escaped) { | |
| 117 | + return escaped; | |
| 118 | + } | |
| 119 | + | |
| 120 | + if (escape) { | |
| 121 | + return '\\' + escape; | |
| 122 | + } | |
| 123 | + | |
| 124 | + var repeat = suffix === '+' || suffix === '*'; | |
| 125 | + var optional = suffix === '?' || suffix === '*'; | |
| 126 | + | |
| 127 | + keys.push({ | |
| 128 | + name: key || index++, | |
| 129 | + delimiter: prefix || '/', | |
| 130 | + optional: optional, | |
| 131 | + repeat: repeat | |
| 132 | + }); | |
| 133 | + | |
| 134 | + prefix = prefix ? ('\\' + prefix) : ''; | |
| 135 | + capture = escapeGroup(capture || group || '[^' + (prefix || '\\/') + ']+?'); | |
| 136 | + | |
| 137 | + if (repeat) { | |
| 138 | + capture = capture + '(?:' + prefix + capture + ')*'; | |
| 139 | + } | |
| 140 | + | |
| 141 | + if (optional) { | |
| 142 | + return '(?:' + prefix + '(' + capture + '))?'; | |
| 143 | + } | |
| 144 | + | |
| 145 | + // Basic parameter support. | |
| 146 | + return prefix + '(' + capture + ')'; | |
| 147 | + } | |
| 148 | + | |
| 149 | + return path.replace(PATH_REGEXP, replace); | |
| 150 | +} | |
| 151 | + | |
| 152 | +/** | |
| 153 | + * Normalize the given path string, returning a regular expression. | |
| 154 | + * | |
| 155 | + * An empty array can be passed in for the keys, which will hold the | |
| 156 | + * placeholder key descriptions. For example, using `/user/:id`, `keys` will | |
| 157 | + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. | |
| 158 | + * | |
| 159 | + * @param {(String|RegExp|Array)} path | |
| 160 | + * @param {Array} [keys] | |
| 161 | + * @param {Object} [options] | |
| 162 | + * @return {RegExp} | |
| 163 | + */ | |
| 164 | +function pathToRegexp (path, keys, options) { | |
| 165 | + keys = keys || []; | |
| 166 | + | |
| 167 | + if (!isArray(keys)) { | |
| 168 | + options = keys; | |
| 169 | + keys = []; | |
| 170 | + } else if (!options) { | |
| 171 | + options = {}; | |
| 172 | + } | |
| 173 | + | |
| 174 | + if (path instanceof RegExp) { | |
| 175 | + return regexpToRegexp(path, keys, options); | |
| 176 | + } | |
| 177 | + | |
| 178 | + if (isArray(path)) { | |
| 179 | + return arrayToRegexp(path, keys, options); | |
| 180 | + } | |
| 181 | + | |
| 182 | + var strict = options.strict; | |
| 183 | + var end = options.end !== false; | |
| 184 | + var route = replacePath(path, keys); | |
| 185 | + var endsWithSlash = path.charAt(path.length - 1) === '/'; | |
| 186 | + | |
| 187 | + // In non-strict mode we allow a slash at the end of match. If the path to | |
| 188 | + // match already ends with a slash, we remove it for consistency. The slash | |
| 189 | + // is valid at the end of a path match, not in the middle. This is important | |
| 190 | + // in non-ending mode, where "/test/" shouldn't match "/test//route". | |
| 191 | + if (!strict) { | |
| 192 | + route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\/(?=$))?'; | |
| 193 | + } | |
| 194 | + | |
| 195 | + if (end) { | |
| 196 | + route += '$'; | |
| 197 | + } else { | |
| 198 | + // In non-ending mode, we need the capturing groups to match as much as | |
| 199 | + // possible by using a positive lookahead to the end or next path segment. | |
| 200 | + route += strict && endsWithSlash ? '' : '(?=\\/|$)'; | |
| 201 | + } | |
| 202 | + | |
| 203 | + return attachKeys(new RegExp('^' + route, flags(options)), keys); | |
| 204 | +} | ... | ... |