diff --git a/headless-services/commons/commons-boot-app-cli/src/main/java/org/springframework/ide/vscode/commons/boot/app/cli/livebean/LiveBean.java b/headless-services/commons/commons-boot-app-cli/src/main/java/org/springframework/ide/vscode/commons/boot/app/cli/livebean/LiveBean.java index b710eb156..3ea0fd638 100644 --- a/headless-services/commons/commons-boot-app-cli/src/main/java/org/springframework/ide/vscode/commons/boot/app/cli/livebean/LiveBean.java +++ b/headless-services/commons/commons-boot-app-cli/src/main/java/org/springframework/ide/vscode/commons/boot/app/cli/livebean/LiveBean.java @@ -120,6 +120,14 @@ public class LiveBean { public String[] getDependencies() { return dependencies; } + + public String getShortName() { + int idx = id.lastIndexOf('.'); + if (idx >= 0) { + return id.substring(idx + 1); + } + return id; + } @Override public String toString() { diff --git a/headless-services/commons/commons-sprotty/pom.xml b/headless-services/commons/commons-sprotty/pom.xml new file mode 100644 index 000000000..669175c08 --- /dev/null +++ b/headless-services/commons/commons-sprotty/pom.xml @@ -0,0 +1,40 @@ + + 4.0.0 + + org.springframework.ide.vscode + commons-parent + 1.11.0-SNAPSHOT + ../pom.xml + + commons-sprotty + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-websocket + + + org.eclipse.sprotty + org.eclipse.sprotty.server + ${sprotty-version} + + + + org.eclipse.elk + org.eclipse.elk.core + ${elk-version} + + + org.eclipse.elk + org.eclipse.elk.alg.layered + ${elk-version} + + + \ No newline at end of file diff --git a/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/autoconf/SprottyAutoConf.java b/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/autoconf/SprottyAutoConf.java new file mode 100644 index 000000000..1b395c9fb --- /dev/null +++ b/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/autoconf/SprottyAutoConf.java @@ -0,0 +1,20 @@ +package org.springframework.ide.vscode.commons.sprotty.autoconf; + +import org.eclipse.sprotty.IPopupModelFactory; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.ide.vscode.commons.sprotty.scan.DiagramWebsocketServer; + +@Configuration +@ComponentScan(basePackageClasses = DiagramWebsocketServer.class) +public class SprottyAutoConf { + + @Bean + @ConditionalOnMissingBean(IPopupModelFactory.class) + public IPopupModelFactory popupModelFactory() { + return new IPopupModelFactory.NullImpl(); + } + +} diff --git a/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/elk/ElkLayoutEngine.java b/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/elk/ElkLayoutEngine.java new file mode 100644 index 000000000..c14c8fc49 --- /dev/null +++ b/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/elk/ElkLayoutEngine.java @@ -0,0 +1,19 @@ +package org.springframework.ide.vscode.commons.sprotty.elk; + +import org.eclipse.elk.core.RecursiveGraphLayoutEngine; +import org.eclipse.elk.core.util.BasicProgressMonitor; +import org.eclipse.elk.graph.ElkNode; +import org.eclipse.sprotty.ILayoutEngine; +import org.eclipse.sprotty.SModelRoot; + +public class ElkLayoutEngine implements ILayoutEngine { + + @Override + public void layout(SModelRoot root) { + ElkUtils utils = new ElkUtils(root); + ElkNode graph = utils.graph; + new RecursiveGraphLayoutEngine().layout(graph, new BasicProgressMonitor()); + utils.applyLayout(); + } + +} diff --git a/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/elk/ElkUtils.java b/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/elk/ElkUtils.java new file mode 100644 index 000000000..1ff3b0a76 --- /dev/null +++ b/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/elk/ElkUtils.java @@ -0,0 +1,114 @@ +package org.springframework.ide.vscode.commons.sprotty.elk; + +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.eclipse.elk.alg.layered.options.ContentAlignment; +import org.eclipse.elk.alg.layered.options.FixedAlignment; +import org.eclipse.elk.alg.layered.options.LayeredOptions; +import org.eclipse.elk.alg.layered.options.NodePlacementStrategy; +import org.eclipse.elk.core.options.Alignment; +import org.eclipse.elk.core.options.Direction; +import org.eclipse.elk.graph.ElkBendPoint; +import org.eclipse.elk.graph.ElkEdge; +import org.eclipse.elk.graph.ElkEdgeSection; +import org.eclipse.elk.graph.ElkNode; +import org.eclipse.elk.graph.properties.IProperty; +import org.eclipse.elk.graph.properties.Property; +import org.eclipse.elk.graph.util.ElkGraphUtil; +import org.eclipse.sprotty.Point; +import org.eclipse.sprotty.SEdge; +import org.eclipse.sprotty.SModelElement; +import org.eclipse.sprotty.SModelRoot; +import org.eclipse.sprotty.SNode; +import org.eclipse.sprotty.SShapeElement; +import org.springframework.util.Assert; + +public class ElkUtils { + + private static final IProperty SPROTTY_ELEMENT = new Property<>("sprotty-element"); + public final ElkNode graph; + private Map nodes = new HashMap<>();; + + public ElkUtils(SModelRoot root) { + graph = ElkGraphUtil.createGraph(); + +// graph.setProperty(LayeredOptions.DIRECTION, Direction.DOWN); +// graph.setProperty(LayeredOptions.CONTENT_ALIGNMENT, EnumSet.of(ContentAlignment.H_CENTER)); +// graph.setProperty(LayeredOptions.ALIGNMENT, Alignment.RIGHT); + +// graph.setProperty(LayeredOptions.NODE_PLACEMENT_STRATEGY, NodePlacementStrategy.SIMPLE); + graph.setProperty(LayeredOptions.NODE_PLACEMENT_BK_FIXED_ALIGNMENT, FixedAlignment.BALANCED); + + List edges = new ArrayList<>(); + for (SModelElement child : root.getChildren()) { + System.out.println(child.getClass()); + if (child instanceof SNode) { + nodes.put(child.getId(), toElk((SNode)child, graph)); + } else if (child instanceof SEdge) { + edges.add((SEdge)child); + } else { + throw new IllegalArgumentException("Unsupported graph layout element"); + } + } + + for (SEdge edge : edges) { + toElk(edge); + } + } + + private ElkEdge toElk(SEdge child) { + ElkNode source = nodes.get(child.getSourceId()); + ElkNode target = nodes.get(child.getTargetId()); + Assert.isTrue(source != null); + Assert.isTrue(target != null); + ElkEdge edge = ElkGraphUtil.createSimpleEdge(source, target); + edge.setProperty(SPROTTY_ELEMENT, child); + return edge; + } + + private ElkNode toElk(SNode child, ElkNode parent) { + ElkNode node = ElkGraphUtil.createNode(parent); + node.setX(child.getPosition().getX()); + node.setY(child.getPosition().getY()); + node.setWidth(child.getSize().getWidth()); + node.setHeight(child.getSize().getHeight()); + node.setIdentifier(child.getId()); + node.setProperty(SPROTTY_ELEMENT, child); +// node.setProperty(LayeredOptions.ALIGNMENT, Alignment.CENTER); + return node; + } + + public void applyLayout() { + for (Entry entry : nodes.entrySet()) { + ElkNode elkNode = entry.getValue(); + SModelElement element = elkNode.getProperty(SPROTTY_ELEMENT); + if (element instanceof SShapeElement) { + SShapeElement shape = (SShapeElement) element; + shape.setPosition(new Point(elkNode.getX(), elkNode.getY())); + } + } + + for (ElkEdge elkEdge : graph.getContainedEdges()) { + SModelElement element = elkEdge.getProperty(SPROTTY_ELEMENT); + if (element instanceof SEdge) { + SEdge edge = (SEdge) element; + List bendpoints = new ArrayList<>(); + for (ElkEdgeSection section : elkEdge.getSections()) { + bendpoints.add(new Point(section.getStartX(), section.getStartY())); + for (ElkBendPoint elkBend : section.getBendPoints()) { + Point bendpoint = new Point(elkBend.getX(), elkBend.getY()); + bendpoints.add(bendpoint); + } + bendpoints.add(new Point(section.getEndX(), section.getEndY())); + } + edge.setRoutingPoints(bendpoints); + } + } + } + +} diff --git a/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/scan/DiagramServerConfiguration.java b/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/scan/DiagramServerConfiguration.java new file mode 100644 index 000000000..76f0538d4 --- /dev/null +++ b/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/scan/DiagramServerConfiguration.java @@ -0,0 +1,55 @@ +package org.springframework.ide.vscode.commons.sprotty.scan; + +import org.eclipse.elk.alg.layered.options.LayeredMetaDataProvider; +import org.eclipse.elk.alg.layered.options.LayeredOptions; +import org.eclipse.elk.core.data.LayoutMetaDataService; +import org.eclipse.sprotty.DefaultDiagramServer; +import org.eclipse.sprotty.IDiagramExpansionListener; +import org.eclipse.sprotty.IDiagramOpenListener; +import org.eclipse.sprotty.IDiagramSelectionListener; +import org.eclipse.sprotty.IDiagramServer; +import org.eclipse.sprotty.ILayoutEngine; +import org.eclipse.sprotty.IModelUpdateListener; +import org.eclipse.sprotty.IPopupModelFactory; +import org.eclipse.sprotty.SModelCloner; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.ide.vscode.commons.sprotty.elk.ElkLayoutEngine; + +@Configuration +public class DiagramServerConfiguration { + + @Bean + public IDiagramServer diagramServer() { + DefaultDiagramServer diagramServer = new DefaultDiagramServer("spring-boot"); + return diagramServer; + } + + @Bean public IModelUpdateListener modelUpdateListener() { + return new IModelUpdateListener.NullImpl(); + } + + @Bean + public ILayoutEngine layoutEngine() { + LayoutMetaDataService.getInstance().registerLayoutMetaDataProviders(new LayeredMetaDataProvider()); + return new ElkLayoutEngine(); + } + + @Bean public IDiagramSelectionListener diagramSelectionListener() { + return new IDiagramSelectionListener.NullImpl(); + } + + @Bean public IDiagramExpansionListener diagramExpansionListener() { + return new IDiagramExpansionListener.NullImpl(); + } + + @Bean public IDiagramOpenListener diagramOpenListener() { + return new IDiagramOpenListener.NullImpl(); + } + + @Bean public SModelCloner modelCloner() { + return new SModelCloner(); + } + + +} diff --git a/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/scan/DiagramServerWebsocketConfiguration.java b/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/scan/DiagramServerWebsocketConfiguration.java new file mode 100644 index 000000000..0cbc73777 --- /dev/null +++ b/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/scan/DiagramServerWebsocketConfiguration.java @@ -0,0 +1,10 @@ +package org.springframework.ide.vscode.commons.sprotty.scan; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.config.annotation.EnableWebSocket; + +@Configuration +@EnableWebSocket +public class DiagramServerWebsocketConfiguration { + +} diff --git a/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/scan/DiagramWebsocketServer.java b/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/scan/DiagramWebsocketServer.java new file mode 100644 index 000000000..12b02d010 --- /dev/null +++ b/headless-services/commons/commons-sprotty/src/main/java/org/springframework/ide/vscode/commons/sprotty/scan/DiagramWebsocketServer.java @@ -0,0 +1,134 @@ +package org.springframework.ide.vscode.commons.sprotty.scan; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.sprotty.ActionMessage; +import org.eclipse.sprotty.IDiagramServer; +import org.eclipse.sprotty.server.json.ActionTypeAdapter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Controller; +import org.springframework.web.socket.CloseStatus; +import org.springframework.web.socket.TextMessage; +import org.springframework.web.socket.WebSocketHandler; +import org.springframework.web.socket.WebSocketSession; +import org.springframework.web.socket.config.annotation.WebSocketConfigurer; +import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; +import org.springframework.web.socket.handler.TextWebSocketHandler; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +@Controller +public class DiagramWebsocketServer implements WebSocketConfigurer, InitializingBean { + + private static final Logger log = LoggerFactory.getLogger(DiagramWebsocketServer.class); + + private Set ws_sessions = new HashSet<>(); + + private Gson gson; + + @Autowired + private IDiagramServer diagramServer; + + private void initializeGson() { + if (gson == null) { + GsonBuilder builder = new GsonBuilder(); + ActionTypeAdapter.configureGson(builder); + gson = builder.create(); + } + } + + @Override + public void afterPropertiesSet() throws Exception { + initializeGson(); + } + + @Override + public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { + registry.addHandler(WsMessageHandler(), "/websocket") + .setAllowedOrigins("*") + .withSockJS(); + } + + private final String END_MESSAGE = "@end"; + /** + * WebSocketHandler which receives messages from a websocket and forwards them to a + * spring-cloud-stream. + */ + @Bean + public WebSocketHandler WsMessageHandler() { + return new TextWebSocketHandler() { + + private StringBuilder buff = new StringBuilder(); + + @Override + public void afterConnectionEstablished(WebSocketSession session) throws Exception { + synchronized (ws_sessions) { + ws_sessions.add(session); + } + log.info("Websocket connection OPENED in: "+this); + log.info("Number of active sessions = {}", ws_sessions.size()); + diagramServer.setRemoteEndpoint(message -> { + sendMessage(gson.toJson(message, ActionMessage.class)); + }); + } + + @Override + protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception { + String payload = message.getPayload(); + log.info(payload); + try { + if (END_MESSAGE.equals(payload)) { + ActionMessage actionMessage = gson.fromJson(buff.toString(), ActionMessage.class); + buff = new StringBuilder(); + diagramServer.accept(actionMessage); + } else { + buff.append(payload); + } + } catch (Exception e) { + log.error("", e); + } + } + + @Override + public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception { + log.info("Websocket connection CLOSED in: "+this); + synchronized (ws_sessions) { + ws_sessions.remove(session); + } + log.info("Number of active sessions = {}", ws_sessions.size()); + } + + @Override + public void handleTransportError(WebSocketSession session, Throwable exception) throws Exception { + log.error("Websocket trasnport error: ", exception); + synchronized (ws_sessions) { + ws_sessions.remove(session); + } + } + + + }; + } + + private void sendMessage(String msg) { + synchronized (ws_sessions) { + for (WebSocketSession ws : ws_sessions) { + try { + if (ws.isOpen()) { + log.info("Sent: {}", msg); + ws.sendMessage(new TextMessage(msg)); + } + } catch (Exception e) { + log.error("Error forwarding message to ws session", e); + } + } + } + } + +} diff --git a/headless-services/commons/commons-sprotty/src/main/resources/META-INF/spring.factories b/headless-services/commons/commons-sprotty/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..7f76045a2 --- /dev/null +++ b/headless-services/commons/commons-sprotty/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.springframework.ide.vscode.commons.sprotty.autoconf.SprottyAutoConf diff --git a/headless-services/commons/pom.xml b/headless-services/commons/pom.xml index 0ee50f03a..b4bb32e41 100644 --- a/headless-services/commons/pom.xml +++ b/headless-services/commons/pom.xml @@ -13,8 +13,7 @@ org.springframework.boot spring-boot-starter-parent - 2.2.0.M2 - + 2.2.0.M5 @@ -119,6 +118,8 @@ 0.7.5.RELEASE 2.4 1.11 + 0.7.0-SNAPSHOT + 0.6.0-SNAPSHOT diff --git a/headless-services/spring-boot-language-server/pom.xml b/headless-services/spring-boot-language-server/pom.xml index e219670e1..6cb01be5a 100644 --- a/headless-services/spring-boot-language-server/pom.xml +++ b/headless-services/spring-boot-language-server/pom.xml @@ -106,6 +106,19 @@ org.eclipse.lsp4j.jsonrpc + + + + + io.typefox.sprotty + diagram-api + 0.4.0 + + + + io.typefox.sprotty + diagram-server + 0.4.0 @@ -133,6 +146,11 @@ ${mockito-version} test + + org.springframework.ide.vscode + commons-sprotty + ${dependencies.version} + diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/BootLanguagServerBootApp.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/BootLanguagServerBootApp.java index 26a11c66f..d024c8f37 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/BootLanguagServerBootApp.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/BootLanguagServerBootApp.java @@ -14,10 +14,8 @@ import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringBootConfiguration; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; -import org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration; -import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @@ -58,19 +56,22 @@ import org.springframework.ide.vscode.commons.yaml.completion.YamlAssistContext; import org.springframework.ide.vscode.commons.yaml.completion.YamlAssistContextProvider; import org.springframework.ide.vscode.commons.yaml.structure.YamlDocument; import org.springframework.ide.vscode.commons.yaml.structure.YamlStructureProvider; -import org.springframework.ide.vscode.languageserver.starter.LanguageServerAutoConf; -import org.springframework.ide.vscode.languageserver.starter.LanguageServerRunnerAutoConf; +import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.yaml.snakeyaml.Yaml; @SpringBootConfiguration(proxyBeanMethods = false) -@ImportAutoConfiguration({ - // During development you can uncomment the below so that boot dash can detect started state properly: - // SpringApplicationAdminJmxAutoConfiguration.class, - LanguageServerAutoConf.class, - LanguageServerRunnerAutoConf.class, - ConfigurationPropertiesAutoConfiguration.class, - PropertyPlaceholderAutoConfiguration.class -}) +//@ImportAutoConfiguration({ +// // During development you can uncomment the below so that boot dash can detect started state properly: +// // SpringApplicationAdminJmxAutoConfiguration.class, +// LanguageServerAutoConf.class, +// LanguageServerRunnerAutoConf.class, +// ConfigurationPropertiesAutoConfiguration.class, +// PropertyPlaceholderAutoConfiguration.class, +// SprottyAutoConf.class, +// WebSocketServletAutoConfiguration.class, +// WebMvcAutoConfiguration.class +//}) +@EnableAutoConfiguration @EnableConfigurationProperties(BootLsConfigProperties.class) @ComponentScan public class BootLanguagServerBootApp { @@ -112,6 +113,12 @@ public class BootLanguagServerBootApp { @Bean ValueProviderRegistry valueProviders() { return new ValueProviderRegistry(); } + + @Bean ThreadPoolTaskScheduler taskScheduler() { + ThreadPoolTaskScheduler t = new ThreadPoolTaskScheduler(); + t.initialize(); + return t; + } @Bean InitializingBean initializeValueProviders(ValueProviderRegistry r, @Qualifier("adHocProperties") ProjectBasedPropertyIndexProvider adHocProperties, SourceLinks sourceLinks) { return () -> { diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/diagram/LiveBeanDiagramModel.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/diagram/LiveBeanDiagramModel.java new file mode 100644 index 000000000..73a0e69af --- /dev/null +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/diagram/LiveBeanDiagramModel.java @@ -0,0 +1,120 @@ +package org.springframework.ide.vscode.boot.app.diagram; + +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.eclipse.sprotty.Dimension; +import org.eclipse.sprotty.IDiagramServer; +import org.eclipse.sprotty.Point; +import org.eclipse.sprotty.SCompartment; +import org.eclipse.sprotty.SEdge; +import org.eclipse.sprotty.SGraph; +import org.eclipse.sprotty.SLabel; +import org.eclipse.sprotty.SModelElement; +import org.eclipse.sprotty.SModelRoot; +import org.eclipse.sprotty.SNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.ide.vscode.boot.java.handlers.RunningAppProvider; +import org.springframework.ide.vscode.commons.boot.app.cli.SpringBootApp; +import org.springframework.ide.vscode.commons.boot.app.cli.livebean.LiveBean; +import org.springframework.ide.vscode.commons.boot.app.cli.livebean.LiveBeansModel; +import org.springframework.scheduling.TaskScheduler; +import org.springframework.stereotype.Component; + +@Component +public class LiveBeanDiagramModel implements InitializingBean { + + private static final Logger log = LoggerFactory.getLogger(LiveBeanDiagramModel.class); + + @Autowired + private IDiagramServer diagramServer; + + @Autowired + private RunningAppProvider runningAppProvider; + + @Autowired + @Qualifier("taskScheduler") + private TaskScheduler taskScheduler; + + + @Override + public void afterPropertiesSet() throws Exception { + taskScheduler.scheduleAtFixedRate(() -> diagramServer.setModel(generateModel()), Duration.ofSeconds(15)); + } + + private SModelRoot generateModel() { + try { + Collection apps = runningAppProvider.getAllRunningSpringApps(); + if (!apps.isEmpty()) { + return toSprottyGraph(apps.iterator().next()); + } + } catch (Exception e) { + log.error("{}", e); + } + return SGraph.EMPTY_ROOT; + } + + private SModelRoot toSprottyGraph(SpringBootApp app) throws Exception { + SModelRoot graph = new SModelRoot(); + graph.setId(app.getProcessName()); + graph.setType("graph"); + + graph.setChildren(new ArrayList<>()); + List graphChildren = graph.getChildren(); + + LiveBeansModel beansModel = app.getBeans(); + for (String targetBeanId : beansModel.getBeanNames()) { + for (LiveBean bean : beansModel.getBeansOfName(targetBeanId)) { + graphChildren.add(createBean(bean.getId(), bean.getShortName(), new Point(), new Dimension())); + } + for (LiveBean sourceBean : beansModel.getBeansDependingOn(targetBeanId)) { + graphChildren.add(createEdge(sourceBean.getId() + " " + targetBeanId, sourceBean.getId(), targetBeanId)); + } + } + + return graph; + } + + private static SNode createBean(String id, String labelText, Point location, Dimension size) { + SNode node = new SNode(); + node.setId(id); + node.setType("node:bean"); + node.setLayout("vbox"); + node.setPosition(new Point(Math.random() * 1024, Math.random() * 768)); + node.setSize(new Dimension(80, 80)); + node.setChildren(new ArrayList<>()); + + SCompartment compartment = new SCompartment(); + compartment.setId(id + "-comp"); + compartment.setType("compartment"); + compartment.setLayout("hbox"); + compartment.setChildren(new ArrayList<>()); + + SLabel label = new SLabel(); + label.setId(id + "-lanbel"); + label.setType("node:label"); + label.setText(labelText); + + compartment.getChildren().add(label); + node.getChildren().add(compartment); + + return node; + } + + private static SEdge createEdge(String id, String sourceId, String targetId) { + SEdge edge = new SEdge(); + edge.setId(id); + edge.setType("edge:straight"); + edge.setSourceId(sourceId); + edge.setTargetId(targetId); + return edge; + } + + +} diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/diagram/MockDiagramServerModel.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/diagram/MockDiagramServerModel.java new file mode 100644 index 000000000..0919e191f --- /dev/null +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/diagram/MockDiagramServerModel.java @@ -0,0 +1,94 @@ +package org.springframework.ide.vscode.boot.app.diagram; + +import java.util.ArrayList; + +import org.eclipse.sprotty.Dimension; +import org.eclipse.sprotty.IDiagramServer; +import org.eclipse.sprotty.Point; +import org.eclipse.sprotty.SCompartment; +import org.eclipse.sprotty.SEdge; +import org.eclipse.sprotty.SLabel; +import org.eclipse.sprotty.SModelRoot; +import org.eclipse.sprotty.SNode; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.scheduling.TaskScheduler; +import org.springframework.stereotype.Component; + +import net.bytebuddy.utility.RandomString; + + +@Component +public class MockDiagramServerModel implements InitializingBean { + + @Autowired + IDiagramServer diagramServer; + + @Autowired + @Qualifier("taskScheduler") + private TaskScheduler taskScheduler; + + @Override + public void afterPropertiesSet() throws Exception { +// taskScheduler.scheduleAtFixedRate(() -> diagramServer.setModel(generateModel()), Duration.ofSeconds(5)); + diagramServer.setModel(generateModel(10)); + } + + public static SModelRoot generateModel(int nodesNum) { + SModelRoot graph = new SModelRoot(); + graph.setId("graph"); + graph.setType("graph"); + + SNode node0 = createBean("node0", "main", new Point(100, 100), new Dimension(120, 40)); + + graph.setChildren(new ArrayList<>()); + graph.getChildren().add(node0); + + for (int i = 1; i < nodesNum; i++) { + SNode node = createBean("node" + i, RandomString.make(((int) Math.round(Math.random()* 10 + 1))), new Point(Math.random() * 1024, Math.random() * 768), new Dimension(120, 40)); + SEdge edge = createEdge("edge-" + i, node0.getId(), node.getId()); + graph.getChildren().add(edge); + graph.getChildren().add(node); + + } + + return graph; + } + + private static SNode createBean(String id, String labelText, Point location, Dimension size) { + SNode node = new SNode(); + node.setId(id); + node.setType("node:bean"); + node.setLayout("vbox"); + node.setPosition(new Point(Math.random() * 1024, Math.random() * 768)); + node.setSize(new Dimension(80, 80)); + node.setChildren(new ArrayList<>()); + + SCompartment compartment = new SCompartment(); + compartment.setId(id + "-comp"); + compartment.setType("compartment"); + compartment.setLayout("hbox"); + compartment.setChildren(new ArrayList<>()); + + SLabel label = new SLabel(); + label.setId(id + "-lanbel"); + label.setType("node:label"); + label.setText(labelText); + + compartment.getChildren().add(label); + node.getChildren().add(compartment); + + return node; + } + + private static SEdge createEdge(String id, String sourceId, String targetId) { + SEdge edge = new SEdge(); + edge.setId(id); + edge.setType("edge:straight"); + edge.setSourceId(sourceId); + edge.setTargetId(targetId); + return edge; + } + +} diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/diagram/PopupModelFactory.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/diagram/PopupModelFactory.java new file mode 100644 index 000000000..6608b0118 --- /dev/null +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/diagram/PopupModelFactory.java @@ -0,0 +1,35 @@ +package org.springframework.ide.vscode.boot.app.diagram; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.sprotty.IDiagramServer; +import org.eclipse.sprotty.IPopupModelFactory; +import org.eclipse.sprotty.RequestPopupModelAction; +import org.eclipse.sprotty.SGraph; +import org.eclipse.sprotty.SLabel; +import org.eclipse.sprotty.SModelElement; +import org.eclipse.sprotty.SModelRoot; +import org.springframework.stereotype.Component; + +@Component +public class PopupModelFactory implements IPopupModelFactory { + + @Override + public SModelRoot createPopupModel(SModelElement element, RequestPopupModelAction request, IDiagramServer server) { + + SGraph graph = new SGraph(); + graph.setId("popup"); + List children = new ArrayList<>(); + + SLabel label = new SLabel(); + label.setType("node:label"); + label.setText("I'm a tooltip!"); + children.add(label); + + graph.setChildren(children); + + return graph; + } + +} diff --git a/headless-services/spring-boot-language-server/src/main/resources/application.properties b/headless-services/spring-boot-language-server/src/main/resources/application.properties index 72b03c5d1..4721c1aa4 100644 --- a/headless-services/spring-boot-language-server/src/main/resources/application.properties +++ b/headless-services/spring-boot-language-server/src/main/resources/application.properties @@ -8,4 +8,4 @@ spring.main.banner-mode: off #logging.level.org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer=debug #logging.level.org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava=debug #logging.level.org.springframework.ide.vscode.boot.app.SpringSymbolIndex=debug -#logging.level.org.springframework.ide.vscode.commons.boot.app.cli.SpringBootApp=off \ No newline at end of file +logging.level.org.springframework.ide.vscode.commons.boot.app.cli.SpringBootApp=off \ No newline at end of file diff --git a/headless-services/spring-boot-language-server/src/main/resources/static/bundle.js b/headless-services/spring-boot-language-server/src/main/resources/static/bundle.js new file mode 100644 index 000000000..1abc2cf5c --- /dev/null +++ b/headless-services/spring-boot-language-server/src/main/resources/static/bundle.js @@ -0,0 +1,33547 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./css/diagram.css": +/*!*************************!*\ + !*** ./css/diagram.css ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +var content = __webpack_require__(/*! !../node_modules/css-loader/dist/cjs.js!./diagram.css */ "./node_modules/css-loader/dist/cjs.js!./css/diagram.css"); + +if(typeof content === 'string') content = [[module.i, content, '']]; + +var transform; +var insertInto; + + + +var options = {"hmr":true} + +options.transform = transform +options.insertInto = undefined; + +var update = __webpack_require__(/*! ../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); + +if(content.locals) module.exports = content.locals; + +if(false) {} + +/***/ }), + +/***/ "./node_modules/core-js/es6/map.js": +/*!*****************************************!*\ + !*** ./node_modules/core-js/es6/map.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../modules/es6.object.to-string */ "./node_modules/core-js/modules/es6.object.to-string.js"); +__webpack_require__(/*! ../modules/es6.string.iterator */ "./node_modules/core-js/modules/es6.string.iterator.js"); +__webpack_require__(/*! ../modules/web.dom.iterable */ "./node_modules/core-js/modules/web.dom.iterable.js"); +__webpack_require__(/*! ../modules/es6.map */ "./node_modules/core-js/modules/es6.map.js"); +module.exports = __webpack_require__(/*! ../modules/_core */ "./node_modules/core-js/modules/_core.js").Map; + + +/***/ }), + +/***/ "./node_modules/core-js/es6/promise.js": +/*!*********************************************!*\ + !*** ./node_modules/core-js/es6/promise.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../modules/es6.object.to-string */ "./node_modules/core-js/modules/es6.object.to-string.js"); +__webpack_require__(/*! ../modules/es6.string.iterator */ "./node_modules/core-js/modules/es6.string.iterator.js"); +__webpack_require__(/*! ../modules/web.dom.iterable */ "./node_modules/core-js/modules/web.dom.iterable.js"); +__webpack_require__(/*! ../modules/es6.promise */ "./node_modules/core-js/modules/es6.promise.js"); +module.exports = __webpack_require__(/*! ../modules/_core */ "./node_modules/core-js/modules/_core.js").Promise; + + +/***/ }), + +/***/ "./node_modules/core-js/es6/string.js": +/*!********************************************!*\ + !*** ./node_modules/core-js/es6/string.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../modules/es6.string.from-code-point */ "./node_modules/core-js/modules/es6.string.from-code-point.js"); +__webpack_require__(/*! ../modules/es6.string.raw */ "./node_modules/core-js/modules/es6.string.raw.js"); +__webpack_require__(/*! ../modules/es6.string.trim */ "./node_modules/core-js/modules/es6.string.trim.js"); +__webpack_require__(/*! ../modules/es6.string.iterator */ "./node_modules/core-js/modules/es6.string.iterator.js"); +__webpack_require__(/*! ../modules/es6.string.code-point-at */ "./node_modules/core-js/modules/es6.string.code-point-at.js"); +__webpack_require__(/*! ../modules/es6.string.ends-with */ "./node_modules/core-js/modules/es6.string.ends-with.js"); +__webpack_require__(/*! ../modules/es6.string.includes */ "./node_modules/core-js/modules/es6.string.includes.js"); +__webpack_require__(/*! ../modules/es6.string.repeat */ "./node_modules/core-js/modules/es6.string.repeat.js"); +__webpack_require__(/*! ../modules/es6.string.starts-with */ "./node_modules/core-js/modules/es6.string.starts-with.js"); +__webpack_require__(/*! ../modules/es6.string.anchor */ "./node_modules/core-js/modules/es6.string.anchor.js"); +__webpack_require__(/*! ../modules/es6.string.big */ "./node_modules/core-js/modules/es6.string.big.js"); +__webpack_require__(/*! ../modules/es6.string.blink */ "./node_modules/core-js/modules/es6.string.blink.js"); +__webpack_require__(/*! ../modules/es6.string.bold */ "./node_modules/core-js/modules/es6.string.bold.js"); +__webpack_require__(/*! ../modules/es6.string.fixed */ "./node_modules/core-js/modules/es6.string.fixed.js"); +__webpack_require__(/*! ../modules/es6.string.fontcolor */ "./node_modules/core-js/modules/es6.string.fontcolor.js"); +__webpack_require__(/*! ../modules/es6.string.fontsize */ "./node_modules/core-js/modules/es6.string.fontsize.js"); +__webpack_require__(/*! ../modules/es6.string.italics */ "./node_modules/core-js/modules/es6.string.italics.js"); +__webpack_require__(/*! ../modules/es6.string.link */ "./node_modules/core-js/modules/es6.string.link.js"); +__webpack_require__(/*! ../modules/es6.string.small */ "./node_modules/core-js/modules/es6.string.small.js"); +__webpack_require__(/*! ../modules/es6.string.strike */ "./node_modules/core-js/modules/es6.string.strike.js"); +__webpack_require__(/*! ../modules/es6.string.sub */ "./node_modules/core-js/modules/es6.string.sub.js"); +__webpack_require__(/*! ../modules/es6.string.sup */ "./node_modules/core-js/modules/es6.string.sup.js"); +__webpack_require__(/*! ../modules/es6.regexp.match */ "./node_modules/core-js/modules/es6.regexp.match.js"); +__webpack_require__(/*! ../modules/es6.regexp.replace */ "./node_modules/core-js/modules/es6.regexp.replace.js"); +__webpack_require__(/*! ../modules/es6.regexp.search */ "./node_modules/core-js/modules/es6.regexp.search.js"); +__webpack_require__(/*! ../modules/es6.regexp.split */ "./node_modules/core-js/modules/es6.regexp.split.js"); +module.exports = __webpack_require__(/*! ../modules/_core */ "./node_modules/core-js/modules/_core.js").String; + + +/***/ }), + +/***/ "./node_modules/core-js/es6/symbol.js": +/*!********************************************!*\ + !*** ./node_modules/core-js/es6/symbol.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../modules/es6.symbol */ "./node_modules/core-js/modules/es6.symbol.js"); +__webpack_require__(/*! ../modules/es6.object.to-string */ "./node_modules/core-js/modules/es6.object.to-string.js"); +module.exports = __webpack_require__(/*! ../modules/_core */ "./node_modules/core-js/modules/_core.js").Symbol; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_a-function.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_a-function.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_add-to-unscopables.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/_add-to-unscopables.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.31 Array.prototype[@@unscopables] +var UNSCOPABLES = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('unscopables'); +var ArrayProto = Array.prototype; +if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")(ArrayProto, UNSCOPABLES, {}); +module.exports = function (key) { + ArrayProto[UNSCOPABLES][key] = true; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_advance-string-index.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/_advance-string-index.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var at = __webpack_require__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(true); + + // `AdvanceStringIndex` abstract operation +// https://tc39.github.io/ecma262/#sec-advancestringindex +module.exports = function (S, index, unicode) { + return index + (unicode ? at(S, index).length : 1); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_an-instance.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_an-instance.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it, Constructor, name, forbiddenField) { + if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { + throw TypeError(name + ': incorrect invocation!'); + } return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_an-object.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_an-object.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_array-includes.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/_array-includes.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var toAbsoluteIndex = __webpack_require__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +module.exports = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_classof.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_classof.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +var TAG = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toStringTag'); +// ES3 wrong here +var ARG = cof(function () { return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function (it, key) { + try { + return it[key]; + } catch (e) { /* empty */ } +}; + +module.exports = function (it) { + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_cof.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_cof.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_collection-strong.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_collection-strong.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var create = __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); +var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var $iterDefine = __webpack_require__(/*! ./_iter-define */ "./node_modules/core-js/modules/_iter-define.js"); +var step = __webpack_require__(/*! ./_iter-step */ "./node_modules/core-js/modules/_iter-step.js"); +var setSpecies = __webpack_require__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js"); +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var fastKey = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").fastKey; +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var SIZE = DESCRIPTORS ? '_s' : 'size'; + +var getEntry = function (that, key) { + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return that._i[index]; + // frozen object case + for (entry = that._f; entry; entry = entry.n) { + if (entry.k == key) return entry; + } +}; + +module.exports = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { + entry.r = true; + if (entry.p) entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = validate(this, NAME); + var entry = getEntry(that, key); + if (entry) { + var next = entry.n; + var prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if (prev) prev.n = next; + if (next) next.p = prev; + if (that._f == entry) that._f = next; + if (that._l == entry) that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /* , that = undefined */) { + validate(this, NAME); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + while (entry = entry ? entry.n : this._f) { + f(entry.v, entry.k, this); + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(validate(this, NAME), key); + } + }); + if (DESCRIPTORS) dP(C.prototype, 'size', { + get: function () { + return validate(this, NAME)[SIZE]; + } + }); + return C; + }, + def: function (that, key, value) { + var entry = getEntry(that, key); + var prev, index; + // change existing entry + if (entry) { + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if (!that._f) that._f = entry; + if (prev) prev.n = entry; + that[SIZE]++; + // add to index + if (index !== 'F') that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function (C, NAME, IS_MAP) { + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function (iterated, kind) { + this._t = validate(iterated, NAME); // target + this._k = kind; // kind + this._l = undefined; // previous + }, function () { + var that = this; + var kind = that._k; + var entry = that._l; + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + // get next entry + if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if (kind == 'keys') return step(0, entry.k); + if (kind == 'values') return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_collection.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_collection.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); +var meta = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js"); +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var $iterDetect = __webpack_require__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js"); +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var inheritIfRequired = __webpack_require__(/*! ./_inherit-if-required */ "./node_modules/core-js/modules/_inherit-if-required.js"); + +module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { + var Base = global[NAME]; + var C = Base; + var ADDER = IS_MAP ? 'set' : 'add'; + var proto = C && C.prototype; + var O = {}; + var fixMethod = function (KEY) { + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function (a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a) { + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { + new C().entries().next(); + }))) { + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + var instance = new C(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = !IS_WEAK && fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has(-0); + }); + if (!ACCEPT_ITERABLES) { + C = wrapper(function (target, iterable) { + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base(), target, C); + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + // weak collections should not contains .clear method + if (IS_WEAK && proto.clear) delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); + + return C; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_core.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_core.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var core = module.exports = { version: '2.6.9' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_ctx.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_ctx.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_defined.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_defined.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_descriptors.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_descriptors.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_dom-create.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_dom-create.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var document = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").document; +// typeof document.createElement is 'object' in old IE +var is = isObject(document) && isObject(document.createElement); +module.exports = function (it) { + return is ? document.createElement(it) : {}; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_enum-bug-keys.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_enum-bug-keys.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_enum-keys.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_enum-keys.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// all enumerable object keys, includes symbols +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var gOPS = __webpack_require__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); +var pIE = __webpack_require__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js"); +module.exports = function (it) { + var result = getKeys(it); + var getSymbols = gOPS.f; + if (getSymbols) { + var symbols = getSymbols(it); + var isEnum = pIE.f; + var i = 0; + var key; + while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); + } return result; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_export.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_export.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); + var key, own, out, exp; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if (target) redefine(target, key, out, type & $export.U); + // export + if (exports[key] != out) hide(exports, key, exp); + if (IS_PROTO && expProto[key] != out) expProto[key] = out; + } +}; +global.core = core; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_fails-is-regexp.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_fails-is-regexp.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var MATCH = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('match'); +module.exports = function (KEY) { + var re = /./; + try { + '/./'[KEY](re); + } catch (e) { + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch (f) { /* empty */ } + } return true; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_fails.js": +/*!************************************************!*\ + !*** ./node_modules/core-js/modules/_fails.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_fix-re-wks.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_fix-re-wks.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +__webpack_require__(/*! ./es6.regexp.exec */ "./node_modules/core-js/modules/es6.regexp.exec.js"); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +var wks = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); +var regexpExec = __webpack_require__(/*! ./_regexp-exec */ "./node_modules/core-js/modules/_regexp-exec.js"); + +var SPECIES = wks('species'); + +var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { + // #replace needs built-in support for named groups. + // #match works fine because it just return the exec results, even if it has + // a "grops" property. + var re = /./; + re.exec = function () { + var result = []; + result.groups = { a: '7' }; + return result; + }; + return ''.replace(re, '$') !== '7'; +}); + +var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () { + // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec + var re = /(?:)/; + var originalExec = re.exec; + re.exec = function () { return originalExec.apply(this, arguments); }; + var result = 'ab'.split(re); + return result.length === 2 && result[0] === 'a' && result[1] === 'b'; +})(); + +module.exports = function (KEY, length, exec) { + var SYMBOL = wks(KEY); + + var DELEGATES_TO_SYMBOL = !fails(function () { + // String methods call symbol-named RegEp methods + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + }); + + var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () { + // Symbol-named RegExp methods call .exec + var execCalled = false; + var re = /a/; + re.exec = function () { execCalled = true; return null; }; + if (KEY === 'split') { + // RegExp[@@split] doesn't call the regex's exec method, but first creates + // a new one. We need to return the patched regex when creating the new one. + re.constructor = {}; + re.constructor[SPECIES] = function () { return re; }; + } + re[SYMBOL](''); + return !execCalled; + }) : undefined; + + if ( + !DELEGATES_TO_SYMBOL || + !DELEGATES_TO_EXEC || + (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || + (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) + ) { + var nativeRegExpMethod = /./[SYMBOL]; + var fns = exec( + defined, + SYMBOL, + ''[KEY], + function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) { + if (regexp.exec === regexpExec) { + if (DELEGATES_TO_SYMBOL && !forceStringMethod) { + // The native String method already delegates to @@method (this + // polyfilled function), leasing to infinite recursion. + // We avoid it by directly calling the native @@method method. + return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; + } + return { done: true, value: nativeMethod.call(str, regexp, arg2) }; + } + return { done: false }; + } + ); + var strfn = fns[0]; + var rxfn = fns[1]; + + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return rxfn.call(string, this); } + ); + } +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_flags.js": +/*!************************************************!*\ + !*** ./node_modules/core-js/modules/_flags.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 21.2.5.3 get RegExp.prototype.flags +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_for-of.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_for-of.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var call = __webpack_require__(/*! ./_iter-call */ "./node_modules/core-js/modules/_iter-call.js"); +var isArrayIter = __webpack_require__(/*! ./_is-array-iter */ "./node_modules/core-js/modules/_is-array-iter.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ "./node_modules/core-js/modules/core.get-iterator-method.js"); +var BREAK = {}; +var RETURN = {}; +var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { + var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); + var f = ctx(fn, that, entries ? 2 : 1); + var index = 0; + var length, step, iterator, result; + if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if (result === BREAK || result === RETURN) return result; + } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { + result = call(iterator, f, step.value, entries); + if (result === BREAK || result === RETURN) return result; + } +}; +exports.BREAK = BREAK; +exports.RETURN = RETURN; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_function-to-string.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/_function-to-string.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('native-function-to-string', Function.toString); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_global.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_global.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_has.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_has.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_hide.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_hide.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +module.exports = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_html.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_html.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var document = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").document; +module.exports = document && document.documentElement; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_ie8-dom-define.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/_ie8-dom-define.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = !__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && !__webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return Object.defineProperty(__webpack_require__(/*! ./_dom-create */ "./node_modules/core-js/modules/_dom-create.js")('div'), 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_inherit-if-required.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_inherit-if-required.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var setPrototypeOf = __webpack_require__(/*! ./_set-proto */ "./node_modules/core-js/modules/_set-proto.js").set; +module.exports = function (that, target, C) { + var S = target.constructor; + var P; + if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { + setPrototypeOf(that, P); + } return that; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_invoke.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_invoke.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iobject.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_iobject.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_is-array-iter.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_is-array-iter.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// check on default Array iterator +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); +var ArrayProto = Array.prototype; + +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_is-array.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_is-array.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.2 IsArray(argument) +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +module.exports = Array.isArray || function isArray(arg) { + return cof(arg) == 'Array'; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_is-object.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_is-object.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_is-regexp.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_is-regexp.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.8 IsRegExp(argument) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +var MATCH = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('match'); +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iter-call.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-call.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// call something on iterator step with safe closing on error +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +module.exports = function (iterator, fn, value, entries) { + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (e) { + var ret = iterator['return']; + if (ret !== undefined) anObject(ret.call(iterator)); + throw e; + } +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iter-create.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-create.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var create = __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); +var descriptor = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +__webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")(IteratorPrototype, __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'), function () { return this; }); + +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); + setToStringTag(Constructor, NAME + ' Iterator'); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iter-define.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-define.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +var $iterCreate = __webpack_require__(/*! ./_iter-create */ "./node_modules/core-js/modules/_iter-create.js"); +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); +var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` +var FF_ITERATOR = '@@iterator'; +var KEYS = 'keys'; +var VALUES = 'values'; + +var returnThis = function () { return this; }; + +module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + $iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; + } + // Define iterator + if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iter-detect.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-detect.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); +var SAFE_CLOSING = false; + +try { + var riter = [7][ITERATOR](); + riter['return'] = function () { SAFE_CLOSING = true; }; + // eslint-disable-next-line no-throw-literal + Array.from(riter, function () { throw 2; }); +} catch (e) { /* empty */ } + +module.exports = function (exec, skipClosing) { + if (!skipClosing && !SAFE_CLOSING) return false; + var safe = false; + try { + var arr = [7]; + var iter = arr[ITERATOR](); + iter.next = function () { return { done: safe = true }; }; + arr[ITERATOR] = function () { return iter; }; + exec(arr); + } catch (e) { /* empty */ } + return safe; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iter-step.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-step.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (done, value) { + return { value: value, done: !!done }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iterators.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_iterators.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_library.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_library.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = false; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_meta.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_meta.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var META = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js")('meta'); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var setDesc = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var id = 0; +var isExtensible = Object.isExtensible || function () { + return true; +}; +var FREEZE = !__webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function (it) { + setDesc(it, META, { value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + } }); +}; +var fastKey = function (it, create) { + // return primitive with prefix + if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function (it, create) { + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function (it) { + if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_microtask.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_microtask.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var macrotask = __webpack_require__(/*! ./_task */ "./node_modules/core-js/modules/_task.js").set; +var Observer = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var isNode = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js")(process) == 'process'; + +module.exports = function () { + var head, last, notify; + + var flush = function () { + var parent, fn; + if (isNode && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (isNode) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 + } else if (Observer && !(global.navigator && global.navigator.standalone)) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + var promise = Promise.resolve(undefined); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_new-promise-capability.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/modules/_new-promise-capability.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 25.4.1.5 NewPromiseCapability(C) +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); + +function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +} + +module.exports.f = function (C) { + return new PromiseCapability(C); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-create.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_object-create.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var dPs = __webpack_require__(/*! ./_object-dps */ "./node_modules/core-js/modules/_object-dps.js"); +var enumBugKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/core-js/modules/_enum-bug-keys.js"); +var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/core-js/modules/_shared-key.js")('IE_PROTO'); +var Empty = function () { /* empty */ }; +var PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(/*! ./_dom-create */ "./node_modules/core-js/modules/_dom-create.js")('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(/*! ./_html */ "./node_modules/core-js/modules/_html.js").appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE] = anObject(O); + result = new Empty(); + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-dp.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-dp.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var IE8_DOM_DEFINE = __webpack_require__(/*! ./_ie8-dom-define */ "./node_modules/core-js/modules/_ie8-dom-define.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-dps.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-dps.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); + +module.exports = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = getKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) dP.f(O, P = keys[i++], Properties[P]); + return O; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-gopd.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gopd.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var pIE = __webpack_require__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js"); +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var IE8_DOM_DEFINE = __webpack_require__(/*! ./_ie8-dom-define */ "./node_modules/core-js/modules/_ie8-dom-define.js"); +var gOPD = Object.getOwnPropertyDescriptor; + +exports.f = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? gOPD : function getOwnPropertyDescriptor(O, P) { + O = toIObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return gOPD(O, P); + } catch (e) { /* empty */ } + if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-gopn-ext.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gopn-ext.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var gOPN = __webpack_require__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; +var toString = {}.toString; + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function (it) { + try { + return gOPN(it); + } catch (e) { + return windowNames.slice(); + } +}; + +module.exports.f = function getOwnPropertyNames(it) { + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-gopn.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gopn.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(/*! ./_object-keys-internal */ "./node_modules/core-js/modules/_object-keys-internal.js"); +var hiddenKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/core-js/modules/_enum-bug-keys.js").concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-gops.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gops.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-gpo.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gpo.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/core-js/modules/_shared-key.js")('IE_PROTO'); +var ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function (O) { + O = toObject(O); + if (has(O, IE_PROTO)) return O[IE_PROTO]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-keys-internal.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/_object-keys-internal.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var arrayIndexOf = __webpack_require__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js")(false); +var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/core-js/modules/_shared-key.js")('IE_PROTO'); + +module.exports = function (object, names) { + var O = toIObject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-keys.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_object-keys.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(/*! ./_object-keys-internal */ "./node_modules/core-js/modules/_object-keys-internal.js"); +var enumBugKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/core-js/modules/_enum-bug-keys.js"); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-pie.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-pie.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_perform.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_perform.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_promise-resolve.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_promise-resolve.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var newPromiseCapability = __webpack_require__(/*! ./_new-promise-capability */ "./node_modules/core-js/modules/_new-promise-capability.js"); + +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_property-desc.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_property-desc.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_redefine-all.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/_redefine-all.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +module.exports = function (target, src, safe) { + for (var key in src) redefine(target, key, src[key], safe); + return target; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_redefine.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_redefine.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var SRC = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js")('src'); +var $toString = __webpack_require__(/*! ./_function-to-string */ "./node_modules/core-js/modules/_function-to-string.js"); +var TO_STRING = 'toString'; +var TPL = ('' + $toString).split(TO_STRING); + +__webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js").inspectSource = function (it) { + return $toString.call(it); +}; + +(module.exports = function (O, key, val, safe) { + var isFunction = typeof val == 'function'; + if (isFunction) has(val, 'name') || hide(val, 'name', key); + if (O[key] === val) return; + if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if (O === global) { + O[key] = val; + } else if (!safe) { + delete O[key]; + hide(O, key, val); + } else if (O[key]) { + O[key] = val; + } else { + hide(O, key, val); + } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, TO_STRING, function toString() { + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_regexp-exec-abstract.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/_regexp-exec-abstract.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var classof = __webpack_require__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var builtinExec = RegExp.prototype.exec; + + // `RegExpExec` abstract operation +// https://tc39.github.io/ecma262/#sec-regexpexec +module.exports = function (R, S) { + var exec = R.exec; + if (typeof exec === 'function') { + var result = exec.call(R, S); + if (typeof result !== 'object') { + throw new TypeError('RegExp exec method returned something other than an Object or null'); + } + return result; + } + if (classof(R) !== 'RegExp') { + throw new TypeError('RegExp#exec called on incompatible receiver'); + } + return builtinExec.call(R, S); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_regexp-exec.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_regexp-exec.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var regexpFlags = __webpack_require__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js"); + +var nativeExec = RegExp.prototype.exec; +// This always refers to the native implementation, because the +// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, +// which loads this file before patching the method. +var nativeReplace = String.prototype.replace; + +var patchedExec = nativeExec; + +var LAST_INDEX = 'lastIndex'; + +var UPDATES_LAST_INDEX_WRONG = (function () { + var re1 = /a/, + re2 = /b*/g; + nativeExec.call(re1, 'a'); + nativeExec.call(re2, 'a'); + return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0; +})(); + +// nonparticipating capturing group, copied from es5-shim's String#split patch. +var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; + +var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; + +if (PATCH) { + patchedExec = function exec(str) { + var re = this; + var lastIndex, reCopy, match, i; + + if (NPCG_INCLUDED) { + reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); + } + if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX]; + + match = nativeExec.call(re, str); + + if (UPDATES_LAST_INDEX_WRONG && match) { + re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex; + } + if (NPCG_INCLUDED && match && match.length > 1) { + // Fix browsers whose `exec` methods don't consistently return `undefined` + // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ + // eslint-disable-next-line no-loop-func + nativeReplace.call(match[0], reCopy, function () { + for (i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) match[i] = undefined; + } + }); + } + + return match; + }; +} + +module.exports = patchedExec; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_same-value.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_same-value.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_set-proto.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_set-proto.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var check = function (O, proto) { + anObject(O); + if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); +}; +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function (test, buggy, set) { + try { + set = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js")(Function.call, __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch (e) { buggy = true; } + return function setPrototypeOf(O, proto) { + check(O, proto); + if (buggy) O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_set-species.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_set-species.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var SPECIES = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species'); + +module.exports = function (KEY) { + var C = global[KEY]; + if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { + configurable: true, + get: function () { return this; } + }); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_set-to-string-tag.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_set-to-string-tag.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var def = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var TAG = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_shared-key.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_shared-key.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('keys'); +var uid = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_shared.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_shared.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || (global[SHARED] = {}); + +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: core.version, + mode: __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js") ? 'pure' : 'global', + copyright: '© 2019 Denis Pushkarev (zloirock.ru)' +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_species-constructor.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_species-constructor.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var SPECIES = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species'); +module.exports = function (O, D) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-at.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_string-at.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +// true -> String#at +// false -> String#codePointAt +module.exports = function (TO_STRING) { + return function (that, pos) { + var s = String(defined(that)); + var i = toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-context.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/_string-context.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// helper for String#{startsWith, endsWith, includes} +var isRegExp = __webpack_require__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); + +module.exports = function (that, searchString, NAME) { + if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-html.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_string-html.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +var quot = /"/g; +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +var createHTML = function (string, tag, attribute, value) { + var S = String(defined(string)); + var p1 = '<' + tag; + if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + '' + tag + '>'; +}; +module.exports = function (NAME, exec) { + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function () { + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-repeat.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_string-repeat.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); + +module.exports = function repeat(count) { + var str = String(defined(this)); + var res = ''; + var n = toInteger(count); + if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); + for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; + return res; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-trim.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_string-trim.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var spaces = __webpack_require__(/*! ./_string-ws */ "./node_modules/core-js/modules/_string-ws.js"); +var space = '[' + spaces + ']'; +var non = '\u200b\u0085'; +var ltrim = RegExp('^' + space + space + '*'); +var rtrim = RegExp(space + space + '*$'); + +var exporter = function (KEY, exec, ALIAS) { + var exp = {}; + var FORCE = fails(function () { + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if (ALIAS) exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); +}; + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function (string, TYPE) { + string = String(defined(string)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; +}; + +module.exports = exporter; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-ws.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_string-ws.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_task.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_task.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var invoke = __webpack_require__(/*! ./_invoke */ "./node_modules/core-js/modules/_invoke.js"); +var html = __webpack_require__(/*! ./_html */ "./node_modules/core-js/modules/_html.js"); +var cel = __webpack_require__(/*! ./_dom-create */ "./node_modules/core-js/modules/_dom-create.js"); +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var process = global.process; +var setTask = global.setImmediate; +var clearTask = global.clearImmediate; +var MessageChannel = global.MessageChannel; +var Dispatch = global.Dispatch; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var defer, channel, port; +var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function (event) { + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (__webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js")(process) == 'process') { + defer = function (id) { + process.nextTick(ctx(run, id, 1)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { + defer = function (id) { + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in cel('script')) { + defer = function (id) { + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-absolute-index.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_to-absolute-index.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var max = Math.max; +var min = Math.min; +module.exports = function (index, length) { + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-integer.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_to-integer.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; +module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-iobject.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_to-iobject.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +module.exports = function (it) { + return IObject(defined(it)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-length.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_to-length.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-object.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_to-object.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +module.exports = function (it) { + return Object(defined(it)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-primitive.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/_to-primitive.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function (it, S) { + if (!isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_uid.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_uid.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_user-agent.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_user-agent.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var navigator = global.navigator; + +module.exports = navigator && navigator.userAgent || ''; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_validate-collection.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_validate-collection.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_wks-define.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_wks-define.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var LIBRARY = __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); +var wksExt = __webpack_require__(/*! ./_wks-ext */ "./node_modules/core-js/modules/_wks-ext.js"); +var defineProperty = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +module.exports = function (name) { + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_wks-ext.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_wks-ext.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports.f = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_wks.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_wks.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('wks'); +var uid = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); +var Symbol = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Symbol; +var USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/core.get-iterator-method.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/core.get-iterator-method.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +module.exports = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js").getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.iterator.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.iterator.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var addToUnscopables = __webpack_require__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js"); +var step = __webpack_require__(/*! ./_iter-step */ "./node_modules/core-js/modules/_iter-step.js"); +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); + +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +module.exports = __webpack_require__(/*! ./_iter-define */ "./node_modules/core-js/modules/_iter-define.js")(Array, 'Array', function (iterated, kind) { + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function () { + var O = this._t; + var kind = this._k; + var index = this._i++; + if (!O || index >= O.length) { + this._t = undefined; + return step(1); + } + if (kind == 'keys') return step(0, index); + if (kind == 'values') return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +Iterators.Arguments = Iterators.Array; + +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.map.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/es6.map.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var strong = __webpack_require__(/*! ./_collection-strong */ "./node_modules/core-js/modules/_collection-strong.js"); +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var MAP = 'Map'; + +// 23.1 Map Objects +module.exports = __webpack_require__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(MAP, function (get) { + return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key) { + var entry = strong.getEntry(validate(this, MAP), key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value) { + return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); + } +}, strong, true); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.to-string.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.to-string.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 19.1.3.6 Object.prototype.toString() +var classof = __webpack_require__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var test = {}; +test[__webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toStringTag')] = 'z'; +if (test + '' != '[object z]') { + __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(Object.prototype, 'toString', function toString() { + return '[object ' + classof(this) + ']'; + }, true); +} + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.promise.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/es6.promise.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var classof = __webpack_require__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var speciesConstructor = __webpack_require__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); +var task = __webpack_require__(/*! ./_task */ "./node_modules/core-js/modules/_task.js").set; +var microtask = __webpack_require__(/*! ./_microtask */ "./node_modules/core-js/modules/_microtask.js")(); +var newPromiseCapabilityModule = __webpack_require__(/*! ./_new-promise-capability */ "./node_modules/core-js/modules/_new-promise-capability.js"); +var perform = __webpack_require__(/*! ./_perform */ "./node_modules/core-js/modules/_perform.js"); +var userAgent = __webpack_require__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); +var promiseResolve = __webpack_require__(/*! ./_promise-resolve */ "./node_modules/core-js/modules/_promise-resolve.js"); +var PROMISE = 'Promise'; +var TypeError = global.TypeError; +var process = global.process; +var versions = process && process.versions; +var v8 = versions && versions.v8 || ''; +var $Promise = global[PROMISE]; +var isNode = classof(process) == 'process'; +var empty = function () { /* empty */ }; +var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; +var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; + +var USE_NATIVE = !!function () { + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[__webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species')] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') + && promise.then(empty) instanceof FakePromise + // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // we can't detect it synchronously, so just check versions + && v8.indexOf('6.6') !== 0 + && userAgent.indexOf('Chrome/66') === -1; + } catch (e) { /* empty */ } +}(); + +// helpers +var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var notify = function (promise, isReject) { + if (promise._n) return; + promise._n = true; + var chain = promise._c; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; + try { + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); + promise._h = 1; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // may throw + if (domain) { + domain.exit(); + exited = true; + } + } + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (e) { + if (domain && !exited) domain.exit(); + reject(e); + } + }; + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if (isReject && !promise._h) onUnhandled(promise); + }); +}; +var onUnhandled = function (promise) { + task.call(global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = perform(function () { + if (isNode) { + process.emit('unhandledRejection', value, promise); + } else if (handler = global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = global.console) && console.error) { + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if (unhandled && result.e) throw result.v; + }); +}; +var isUnhandled = function (promise) { + return promise._h !== 1 && (promise._a || promise._c).length === 0; +}; +var onHandleUnhandled = function (promise) { + task.call(global, function () { + var handler; + if (isNode) { + process.emit('rejectionHandled', promise); + } else if (handler = global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); + } + }); +}; +var $reject = function (value) { + var promise = this; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if (!promise._a) promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if (promise === value) throw TypeError("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch (e) { + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap + } +}; + +// constructor polyfill +if (!USE_NATIVE) { + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor) { + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch (err) { + $reject.call(this, err); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = __webpack_require__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js")($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === $Promise || C === Wrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); +__webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js")($Promise, PROMISE); +__webpack_require__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")(PROMISE); +Wrapper = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js")[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x) { + return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); + } +}); +$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js")(function (iter) { + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var values = []; + var index = 0; + var remaining = 1; + forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.e) reject(result.v); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + forOf(iterable, false, function (promise) { + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if (result.e) reject(result.v); + return capability.promise; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.exec.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.exec.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var regexpExec = __webpack_require__(/*! ./_regexp-exec */ "./node_modules/core-js/modules/_regexp-exec.js"); +__webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js")({ + target: 'RegExp', + proto: true, + forced: regexpExec !== /./.exec +}, { + exec: regexpExec +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.match.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.match.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var advanceStringIndex = __webpack_require__(/*! ./_advance-string-index */ "./node_modules/core-js/modules/_advance-string-index.js"); +var regExpExec = __webpack_require__(/*! ./_regexp-exec-abstract */ "./node_modules/core-js/modules/_regexp-exec-abstract.js"); + +// @@match logic +__webpack_require__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('match', 1, function (defined, MATCH, $match, maybeCallNative) { + return [ + // `String.prototype.match` method + // https://tc39.github.io/ecma262/#sec-string.prototype.match + function match(regexp) { + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, + // `RegExp.prototype[@@match]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match + function (regexp) { + var res = maybeCallNative($match, regexp, this); + if (res.done) return res.value; + var rx = anObject(regexp); + var S = String(this); + if (!rx.global) return regExpExec(rx, S); + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + var A = []; + var n = 0; + var result; + while ((result = regExpExec(rx, S)) !== null) { + var matchStr = String(result[0]); + A[n] = matchStr; + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + n++; + } + return n === 0 ? null : A; + } + ]; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.replace.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.replace.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var advanceStringIndex = __webpack_require__(/*! ./_advance-string-index */ "./node_modules/core-js/modules/_advance-string-index.js"); +var regExpExec = __webpack_require__(/*! ./_regexp-exec-abstract */ "./node_modules/core-js/modules/_regexp-exec-abstract.js"); +var max = Math.max; +var min = Math.min; +var floor = Math.floor; +var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g; +var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g; + +var maybeToString = function (it) { + return it === undefined ? it : String(it); +}; + +// @@replace logic +__webpack_require__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) { + return [ + // `String.prototype.replace` method + // https://tc39.github.io/ecma262/#sec-string.prototype.replace + function replace(searchValue, replaceValue) { + var O = defined(this); + var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }, + // `RegExp.prototype[@@replace]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace + function (regexp, replaceValue) { + var res = maybeCallNative($replace, regexp, this, replaceValue); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + var functionalReplace = typeof replaceValue === 'function'; + if (!functionalReplace) replaceValue = String(replaceValue); + var global = rx.global; + if (global) { + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + } + var results = []; + while (true) { + var result = regExpExec(rx, S); + if (result === null) break; + results.push(result); + if (!global) break; + var matchStr = String(result[0]); + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + } + var accumulatedResult = ''; + var nextSourcePosition = 0; + for (var i = 0; i < results.length; i++) { + result = results[i]; + var matched = String(result[0]); + var position = max(min(toInteger(result.index), S.length), 0); + var captures = []; + // NOTE: This is equivalent to + // captures = result.slice(1).map(maybeToString) + // but for some reason `nativeSlice.call(result, 1, result.length)` (called in + // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and + // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. + for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); + var namedCaptures = result.groups; + if (functionalReplace) { + var replacerArgs = [matched].concat(captures, position, S); + if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); + var replacement = String(replaceValue.apply(undefined, replacerArgs)); + } else { + replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); + } + if (position >= nextSourcePosition) { + accumulatedResult += S.slice(nextSourcePosition, position) + replacement; + nextSourcePosition = position + matched.length; + } + } + return accumulatedResult + S.slice(nextSourcePosition); + } + ]; + + // https://tc39.github.io/ecma262/#sec-getsubstitution + function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { + var tailPos = position + matched.length; + var m = captures.length; + var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; + if (namedCaptures !== undefined) { + namedCaptures = toObject(namedCaptures); + symbols = SUBSTITUTION_SYMBOLS; + } + return $replace.call(replacement, symbols, function (match, ch) { + var capture; + switch (ch.charAt(0)) { + case '$': return '$'; + case '&': return matched; + case '`': return str.slice(0, position); + case "'": return str.slice(tailPos); + case '<': + capture = namedCaptures[ch.slice(1, -1)]; + break; + default: // \d\d? + var n = +ch; + if (n === 0) return match; + if (n > m) { + var f = floor(n / 10); + if (f === 0) return match; + if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); + return match; + } + capture = captures[n - 1]; + } + return capture === undefined ? '' : capture; + }); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.search.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.search.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var sameValue = __webpack_require__(/*! ./_same-value */ "./node_modules/core-js/modules/_same-value.js"); +var regExpExec = __webpack_require__(/*! ./_regexp-exec-abstract */ "./node_modules/core-js/modules/_regexp-exec-abstract.js"); + +// @@search logic +__webpack_require__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('search', 1, function (defined, SEARCH, $search, maybeCallNative) { + return [ + // `String.prototype.search` method + // https://tc39.github.io/ecma262/#sec-string.prototype.search + function search(regexp) { + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[SEARCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, + // `RegExp.prototype[@@search]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search + function (regexp) { + var res = maybeCallNative($search, regexp, this); + if (res.done) return res.value; + var rx = anObject(regexp); + var S = String(this); + var previousLastIndex = rx.lastIndex; + if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; + var result = regExpExec(rx, S); + if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; + return result === null ? -1 : result.index; + } + ]; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.split.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.split.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isRegExp = __webpack_require__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var speciesConstructor = __webpack_require__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); +var advanceStringIndex = __webpack_require__(/*! ./_advance-string-index */ "./node_modules/core-js/modules/_advance-string-index.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var callRegExpExec = __webpack_require__(/*! ./_regexp-exec-abstract */ "./node_modules/core-js/modules/_regexp-exec-abstract.js"); +var regexpExec = __webpack_require__(/*! ./_regexp-exec */ "./node_modules/core-js/modules/_regexp-exec.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var $min = Math.min; +var $push = [].push; +var $SPLIT = 'split'; +var LENGTH = 'length'; +var LAST_INDEX = 'lastIndex'; +var MAX_UINT32 = 0xffffffff; + +// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError +var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); }); + +// @@split logic +__webpack_require__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('split', 2, function (defined, SPLIT, $split, maybeCallNative) { + var internalSplit; + if ( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ) { + // based on es5-shim implementation, need to rework it + internalSplit = function (separator, limit) { + var string = String(this); + if (separator === undefined && limit === 0) return []; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) return $split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var match, lastIndex, lastLength; + while (match = regexpExec.call(separatorCopy, string)) { + lastIndex = separatorCopy[LAST_INDEX]; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if (output[LENGTH] >= splitLimit) break; + } + if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop + } + if (lastLastIndex === string[LENGTH]) { + if (lastLength || !separatorCopy.test('')) output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { + internalSplit = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit); + }; + } else { + internalSplit = $split; + } + + return [ + // `String.prototype.split` method + // https://tc39.github.io/ecma262/#sec-string.prototype.split + function split(separator, limit) { + var O = defined(this); + var splitter = separator == undefined ? undefined : separator[SPLIT]; + return splitter !== undefined + ? splitter.call(separator, O, limit) + : internalSplit.call(String(O), separator, limit); + }, + // `RegExp.prototype[@@split]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split + // + // NOTE: This cannot be properly polyfilled in engines that don't support + // the 'y' flag. + function (regexp, limit) { + var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + var C = speciesConstructor(rx, RegExp); + + var unicodeMatching = rx.unicode; + var flags = (rx.ignoreCase ? 'i' : '') + + (rx.multiline ? 'm' : '') + + (rx.unicode ? 'u' : '') + + (SUPPORTS_Y ? 'y' : 'g'); + + // ^(? + rx + ) is needed, in combination with some S slicing, to + // simulate the 'y' flag. + var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; + var p = 0; + var q = 0; + var A = []; + while (q < S.length) { + splitter.lastIndex = SUPPORTS_Y ? q : 0; + var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); + var e; + if ( + z === null || + (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p + ) { + q = advanceStringIndex(S, q, unicodeMatching); + } else { + A.push(S.slice(p, q)); + if (A.length === lim) return A; + for (var i = 1; i <= z.length - 1; i++) { + A.push(z[i]); + if (A.length === lim) return A; + } + q = p = e; + } + } + A.push(S.slice(p)); + return A; + } + ]; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.anchor.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.anchor.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.2 String.prototype.anchor(name) +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('anchor', function (createHTML) { + return function anchor(name) { + return createHTML(this, 'a', 'name', name); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.big.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.big.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.3 String.prototype.big() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('big', function (createHTML) { + return function big() { + return createHTML(this, 'big', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.blink.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.blink.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.4 String.prototype.blink() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('blink', function (createHTML) { + return function blink() { + return createHTML(this, 'blink', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.bold.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.bold.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.5 String.prototype.bold() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('bold', function (createHTML) { + return function bold() { + return createHTML(this, 'b', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.code-point-at.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.code-point-at.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $at = __webpack_require__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(false); +$export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos) { + return $at(this, pos); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.ends-with.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.ends-with.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var context = __webpack_require__(/*! ./_string-context */ "./node_modules/core-js/modules/_string-context.js"); +var ENDS_WITH = 'endsWith'; +var $endsWith = ''[ENDS_WITH]; + +$export($export.P + $export.F * __webpack_require__(/*! ./_fails-is-regexp */ "./node_modules/core-js/modules/_fails-is-regexp.js")(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /* , endPosition = @length */) { + var that = context(this, searchString, ENDS_WITH); + var endPosition = arguments.length > 1 ? arguments[1] : undefined; + var len = toLength(that.length); + var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); + var search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.fixed.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.fixed.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.6 String.prototype.fixed() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('fixed', function (createHTML) { + return function fixed() { + return createHTML(this, 'tt', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.fontcolor.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.fontcolor.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.7 String.prototype.fontcolor(color) +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('fontcolor', function (createHTML) { + return function fontcolor(color) { + return createHTML(this, 'font', 'color', color); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.fontsize.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.fontsize.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.8 String.prototype.fontsize(size) +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('fontsize', function (createHTML) { + return function fontsize(size) { + return createHTML(this, 'font', 'size', size); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.from-code-point.js": +/*!********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.from-code-point.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toAbsoluteIndex = __webpack_require__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +var fromCharCode = String.fromCharCode; +var $fromCodePoint = String.fromCodePoint; + +// length should be 1, old FF problem +$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars + var res = []; + var aLen = arguments.length; + var i = 0; + var code; + while (aLen > i) { + code = +arguments[i++]; + if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.includes.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.includes.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.7 String.prototype.includes(searchString, position = 0) + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var context = __webpack_require__(/*! ./_string-context */ "./node_modules/core-js/modules/_string-context.js"); +var INCLUDES = 'includes'; + +$export($export.P + $export.F * __webpack_require__(/*! ./_fails-is-regexp */ "./node_modules/core-js/modules/_fails-is-regexp.js")(INCLUDES), 'String', { + includes: function includes(searchString /* , position = 0 */) { + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.italics.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.italics.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.9 String.prototype.italics() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('italics', function (createHTML) { + return function italics() { + return createHTML(this, 'i', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.iterator.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.iterator.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $at = __webpack_require__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(true); + +// 21.1.3.27 String.prototype[@@iterator]() +__webpack_require__(/*! ./_iter-define */ "./node_modules/core-js/modules/_iter-define.js")(String, 'String', function (iterated) { + this._t = String(iterated); // target + this._i = 0; // next index +// 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function () { + var O = this._t; + var index = this._i; + var point; + if (index >= O.length) return { value: undefined, done: true }; + point = $at(O, index); + this._i += point.length; + return { value: point, done: false }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.link.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.link.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.10 String.prototype.link(url) +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('link', function (createHTML) { + return function link(url) { + return createHTML(this, 'a', 'href', url); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.raw.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.raw.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); + +$export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite) { + var tpl = toIObject(callSite.raw); + var len = toLength(tpl.length); + var aLen = arguments.length; + var res = []; + var i = 0; + while (len > i) { + res.push(String(tpl[i++])); + if (i < aLen) res.push(String(arguments[i])); + } return res.join(''); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.repeat.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.repeat.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: __webpack_require__(/*! ./_string-repeat */ "./node_modules/core-js/modules/_string-repeat.js") +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.small.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.small.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.11 String.prototype.small() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('small', function (createHTML) { + return function small() { + return createHTML(this, 'small', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.starts-with.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.starts-with.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var context = __webpack_require__(/*! ./_string-context */ "./node_modules/core-js/modules/_string-context.js"); +var STARTS_WITH = 'startsWith'; +var $startsWith = ''[STARTS_WITH]; + +$export($export.P + $export.F * __webpack_require__(/*! ./_fails-is-regexp */ "./node_modules/core-js/modules/_fails-is-regexp.js")(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /* , position = 0 */) { + var that = context(this, searchString, STARTS_WITH); + var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.strike.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.strike.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.12 String.prototype.strike() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('strike', function (createHTML) { + return function strike() { + return createHTML(this, 'strike', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.sub.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.sub.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.13 String.prototype.sub() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('sub', function (createHTML) { + return function sub() { + return createHTML(this, 'sub', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.sup.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.sup.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.14 String.prototype.sup() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('sup', function (createHTML) { + return function sup() { + return createHTML(this, 'sup', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.trim.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.trim.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 21.1.3.25 String.prototype.trim() +__webpack_require__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js")('trim', function ($trim) { + return function trim() { + return $trim(this, 3); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.symbol.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/es6.symbol.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// ECMAScript 6 symbols shim +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var META = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").KEY; +var $fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var shared = __webpack_require__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js"); +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var uid = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); +var wks = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); +var wksExt = __webpack_require__(/*! ./_wks-ext */ "./node_modules/core-js/modules/_wks-ext.js"); +var wksDefine = __webpack_require__(/*! ./_wks-define */ "./node_modules/core-js/modules/_wks-define.js"); +var enumKeys = __webpack_require__(/*! ./_enum-keys */ "./node_modules/core-js/modules/_enum-keys.js"); +var isArray = __webpack_require__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +var _create = __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); +var gOPNExt = __webpack_require__(/*! ./_object-gopn-ext */ "./node_modules/core-js/modules/_object-gopn-ext.js"); +var $GOPD = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); +var $GOPS = __webpack_require__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); +var $DP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var $keys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var gOPD = $GOPD.f; +var dP = $DP.f; +var gOPN = gOPNExt.f; +var $Symbol = global.Symbol; +var $JSON = global.JSON; +var _stringify = $JSON && $JSON.stringify; +var PROTOTYPE = 'prototype'; +var HIDDEN = wks('_hidden'); +var TO_PRIMITIVE = wks('toPrimitive'); +var isEnum = {}.propertyIsEnumerable; +var SymbolRegistry = shared('symbol-registry'); +var AllSymbols = shared('symbols'); +var OPSymbols = shared('op-symbols'); +var ObjectProto = Object[PROTOTYPE]; +var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f; +var QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDesc = DESCRIPTORS && $fails(function () { + return _create(dP({}, 'a', { + get: function () { return dP(this, 'a', { value: 7 }).a; } + })).a != 7; +}) ? function (it, key, D) { + var protoDesc = gOPD(ObjectProto, key); + if (protoDesc) delete ObjectProto[key]; + dP(it, key, D); + if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); +} : dP; + +var wrap = function (tag) { + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; +}; + +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { + return typeof it == 'symbol'; +} : function (it) { + return it instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(it, key, D) { + if (it === ObjectProto) $defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if (has(AllSymbols, key)) { + if (!D.enumerable) { + if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; + D = _create(D, { enumerable: createDesc(0, false) }); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); +}; +var $defineProperties = function defineProperties(it, P) { + anObject(it); + var keys = enumKeys(P = toIObject(P)); + var i = 0; + var l = keys.length; + var key; + while (l > i) $defineProperty(it, key = keys[i++], P[key]); + return it; +}; +var $create = function create(it, P) { + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; +var $propertyIsEnumerable = function propertyIsEnumerable(key) { + var E = isEnum.call(this, key = toPrimitive(key, true)); + if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { + it = toIObject(it); + key = toPrimitive(key, true); + if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; + var D = gOPD(it, key); + if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; + return D; +}; +var $getOwnPropertyNames = function getOwnPropertyNames(it) { + var names = gOPN(toIObject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); + } return result; +}; +var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { + var IS_OP = it === ObjectProto; + var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); + } return result; +}; + +// 19.4.1.1 Symbol([description]) +if (!USE_NATIVE) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function (value) { + if (this === ObjectProto) $set.call(OPSymbols, value); + if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString() { + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + __webpack_require__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js").f = $propertyIsEnumerable; + $GOPS.f = $getOwnPropertySymbols; + + if (DESCRIPTORS && !__webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js")) { + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function (name) { + return wrap(wks(name)); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); + +for (var es6Symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' +).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); + +for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); + +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function (key) { + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); + for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; + }, + useSetter: function () { setter = true; }, + useSimple: function () { setter = false; } +}); + +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); + +// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives +// https://bugs.chromium.org/p/v8/issues/detail?id=3443 +var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); }); + +$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', { + getOwnPropertySymbols: function getOwnPropertySymbols(it) { + return $GOPS.f(toObject(it)); + } +}); + +// 24.3.2 JSON.stringify(value [, replacer [, space]]) +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it) { + var args = [it]; + var i = 1; + var replacer, $replacer; + while (arguments.length > i) args.push(arguments[i++]); + $replacer = replacer = args[1]; + if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + if (!isArray(replacer)) replacer = function (key, value) { + if (typeof $replacer == 'function') value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); + +// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) +$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// 19.4.3.5 Symbol.prototype[@@toStringTag] +setToStringTag($Symbol, 'Symbol'); +// 20.2.1.9 Math[@@toStringTag] +setToStringTag(Math, 'Math', true); +// 24.3.3 JSON[@@toStringTag] +setToStringTag(global.JSON, 'JSON', true); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/web.dom.iterable.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/web.dom.iterable.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $iterators = __webpack_require__(/*! ./es6.array.iterator */ "./node_modules/core-js/modules/es6.array.iterator.js"); +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +var wks = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); +var ITERATOR = wks('iterator'); +var TO_STRING_TAG = wks('toStringTag'); +var ArrayValues = Iterators.Array; + +var DOMIterables = { + CSSRuleList: true, // TODO: Not spec compliant, should be false. + CSSStyleDeclaration: false, + CSSValueList: false, + ClientRectList: false, + DOMRectList: false, + DOMStringList: false, + DOMTokenList: true, + DataTransferItemList: false, + FileList: false, + HTMLAllCollection: false, + HTMLCollection: false, + HTMLFormElement: false, + HTMLSelectElement: false, + MediaList: true, // TODO: Not spec compliant, should be false. + MimeTypeArray: false, + NamedNodeMap: false, + NodeList: true, + PaintRequestList: false, + Plugin: false, + PluginArray: false, + SVGLengthList: false, + SVGNumberList: false, + SVGPathSegList: false, + SVGPointList: false, + SVGStringList: false, + SVGTransformList: false, + SourceBufferList: false, + StyleSheetList: true, // TODO: Not spec compliant, should be false. + TextTrackCueList: false, + TextTrackList: false, + TouchList: false +}; + +for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { + var NAME = collections[i]; + var explicit = DOMIterables[NAME]; + var Collection = global[NAME]; + var proto = Collection && Collection.prototype; + var key; + if (proto) { + if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); + if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = ArrayValues; + if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); + } +} + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./css/diagram.css": +/*!***************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./css/diagram.css ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false); +// Module +exports.push([module.i, "/********************************************************************************\n * Copyright (c) 2017-2018 TypeFox and others.\n *\n * This program and the accompanying materials are made available under the\n * terms of the Eclipse Public License v. 2.0 which is available at\n * http://www.eclipse.org/legal/epl-2.0.\n *\n * This Source Code may also be made available under the following Secondary\n * Licenses when the conditions for such availability set forth in the Eclipse\n * Public License v. 2.0 are satisfied: GNU General Public License, version 2\n * with the GNU Classpath Exception which is available at\n * https://www.gnu.org/software/classpath/license.html.\n *\n * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0\n ********************************************************************************/\n\n.sprotty-node {\n fill: #aae;\n stroke: #66b;\n stroke-width: 3;\n}\n\n.sprotty-text {\n font-size: 16pt;\n text-anchor: middle;\n}\n\n.sprotty-edge {\n fill: none;\n stroke: #488;\n stroke-width: 2;\n}\n\n.sprotty-node.selected {\n stroke: #dd8;\n stroke-width: 6;\n}\n\n.sprotty-missing {\n stroke-width: 1;\n stroke: #f00;\n fill: #f00;\n font-family: SansSerif;\n font-size: 14pt;\n text-anchor: middle;\n}", ""]); + + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sprotty/css/sprotty.css": +/*!************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sprotty/css/sprotty.css ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false); +// Module +exports.push([module.i, "/********************************************************************************\n * Copyright (c) 2017-2018 TypeFox and others.\n *\n * This program and the accompanying materials are made available under the\n * terms of the Eclipse Public License v. 2.0 which is available at\n * http://www.eclipse.org/legal/epl-2.0.\n *\n * This Source Code may also be made available under the following Secondary\n * Licenses when the conditions for such availability set forth in the Eclipse\n * Public License v. 2.0 are satisfied: GNU General Public License, version 2\n * with the GNU Classpath Exception which is available at\n * https://www.gnu.org/software/classpath/license.html.\n *\n * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0\n ********************************************************************************/\n\n.sprotty {\n padding: 0px;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n}\n\n.sprotty-hidden {\n display: block;\n position: absolute;\n width: 0px;\n height: 0px;\n}\n\n.sprotty-popup {\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n position: absolute;\n background: white;\n border-radius: 5px;\n border: 1px solid;\n max-width: 400px;\n min-width: 100px;\n}\n\n.sprotty-popup > div {\n margin: 10px;\n}\n\n.sprotty-popup-closed {\n display: none;\n}\n", ""]); + + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/runtime/api.js": +/*!*****************************************************!*\ + !*** ./node_modules/css-loader/dist/runtime/api.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +module.exports = function (useSourceMap) { + var list = []; // return the list of modules as css string + + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item, useSourceMap); + + if (item[2]) { + return '@media ' + item[2] + '{' + content + '}'; + } else { + return content; + } + }).join(''); + }; // import a list of modules into the list + + + list.i = function (modules, mediaQuery) { + if (typeof modules === 'string') { + modules = [[null, modules, '']]; + } + + var alreadyImportedModules = {}; + + for (var i = 0; i < this.length; i++) { + var id = this[i][0]; + + if (id != null) { + alreadyImportedModules[id] = true; + } + } + + for (i = 0; i < modules.length; i++) { + var item = modules[i]; // skip already imported module + // this implementation is not 100% perfect for weird media query combinations + // when a module is imported multiple times with different media queries. + // I hope this will never occur (Hey this way we have smaller bundles) + + if (item[0] == null || !alreadyImportedModules[item[0]]) { + if (mediaQuery && !item[2]) { + item[2] = mediaQuery; + } else if (mediaQuery) { + item[2] = '(' + item[2] + ') and (' + mediaQuery + ')'; + } + + list.push(item); + } + } + }; + + return list; +}; + +function cssWithMappingToString(item, useSourceMap) { + var content = item[1] || ''; + var cssMapping = item[3]; + + if (!cssMapping) { + return content; + } + + if (useSourceMap && typeof btoa === 'function') { + var sourceMapping = toComment(cssMapping); + var sourceURLs = cssMapping.sources.map(function (source) { + return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'; + }); + return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); + } + + return [content].join('\n'); +} // Adapted from convert-source-map (MIT) + + +function toComment(sourceMap) { + // eslint-disable-next-line no-undef + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); + var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; + return '/*# ' + data + ' */'; +} + +/***/ }), + +/***/ "./node_modules/file-saver/FileSaver.js": +/*!**********************************************!*\ + !*** ./node_modules/file-saver/FileSaver.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_RESULT__;/* FileSaver.js + * A saveAs() FileSaver implementation. + * 1.3.2 + * 2016-06-16 18:25:19 + * + * By Eli Grey, http://eligrey.com + * License: MIT + * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md + */ + +/*global self */ +/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */ + +/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ + +var saveAs = saveAs || (function(view) { + "use strict"; + // IE <10 is explicitly unsupported + if (typeof view === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) { + return; + } + var + doc = view.document + // only get URL when necessary in case Blob.js hasn't overridden it yet + , get_URL = function() { + return view.URL || view.webkitURL || view; + } + , save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a") + , can_use_save_link = "download" in save_link + , click = function(node) { + var event = new MouseEvent("click"); + node.dispatchEvent(event); + } + , is_safari = /constructor/i.test(view.HTMLElement) || view.safari + , is_chrome_ios =/CriOS\/[\d]+/.test(navigator.userAgent) + , throw_outside = function(ex) { + (view.setImmediate || view.setTimeout)(function() { + throw ex; + }, 0); + } + , force_saveable_type = "application/octet-stream" + // the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to + , arbitrary_revoke_timeout = 1000 * 40 // in ms + , revoke = function(file) { + var revoker = function() { + if (typeof file === "string") { // file is an object URL + get_URL().revokeObjectURL(file); + } else { // file is a File + file.remove(); + } + }; + setTimeout(revoker, arbitrary_revoke_timeout); + } + , dispatch = function(filesaver, event_types, event) { + event_types = [].concat(event_types); + var i = event_types.length; + while (i--) { + var listener = filesaver["on" + event_types[i]]; + if (typeof listener === "function") { + try { + listener.call(filesaver, event || filesaver); + } catch (ex) { + throw_outside(ex); + } + } + } + } + , auto_bom = function(blob) { + // prepend BOM for UTF-8 XML and text/* types (including HTML) + // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF + if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { + return new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type}); + } + return blob; + } + , FileSaver = function(blob, name, no_auto_bom) { + if (!no_auto_bom) { + blob = auto_bom(blob); + } + // First try a.download, then web filesystem, then object URLs + var + filesaver = this + , type = blob.type + , force = type === force_saveable_type + , object_url + , dispatch_all = function() { + dispatch(filesaver, "writestart progress write writeend".split(" ")); + } + // on any filesys errors revert to saving with object URLs + , fs_error = function() { + if ((is_chrome_ios || (force && is_safari)) && view.FileReader) { + // Safari doesn't allow downloading of blob urls + var reader = new FileReader(); + reader.onloadend = function() { + var url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;'); + var popup = view.open(url, '_blank'); + if(!popup) view.location.href = url; + url=undefined; // release reference before dispatching + filesaver.readyState = filesaver.DONE; + dispatch_all(); + }; + reader.readAsDataURL(blob); + filesaver.readyState = filesaver.INIT; + return; + } + // don't create more object URLs than needed + if (!object_url) { + object_url = get_URL().createObjectURL(blob); + } + if (force) { + view.location.href = object_url; + } else { + var opened = view.open(object_url, "_blank"); + if (!opened) { + // Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html + view.location.href = object_url; + } + } + filesaver.readyState = filesaver.DONE; + dispatch_all(); + revoke(object_url); + } + ; + filesaver.readyState = filesaver.INIT; + + if (can_use_save_link) { + object_url = get_URL().createObjectURL(blob); + setTimeout(function() { + save_link.href = object_url; + save_link.download = name; + click(save_link); + dispatch_all(); + revoke(object_url); + filesaver.readyState = filesaver.DONE; + }); + return; + } + + fs_error(); + } + , FS_proto = FileSaver.prototype + , saveAs = function(blob, name, no_auto_bom) { + return new FileSaver(blob, name || blob.name || "download", no_auto_bom); + } + ; + // IE 10+ (native saveAs) + if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) { + return function(blob, name, no_auto_bom) { + name = name || blob.name || "download"; + + if (!no_auto_bom) { + blob = auto_bom(blob); + } + return navigator.msSaveOrOpenBlob(blob, name); + }; + } + + FS_proto.abort = function(){}; + FS_proto.readyState = FS_proto.INIT = 0; + FS_proto.WRITING = 1; + FS_proto.DONE = 2; + + FS_proto.error = + FS_proto.onwritestart = + FS_proto.onprogress = + FS_proto.onwrite = + FS_proto.onabort = + FS_proto.onerror = + FS_proto.onwriteend = + null; + + return saveAs; +}( + typeof self !== "undefined" && self + || typeof window !== "undefined" && window + || this.content +)); +// `self` is undefined in Firefox for Android content script context +// while `this` is nsIContentFrameMessageManager +// with an attribute `content` that corresponds to the window + +if ( true && module.exports) { + module.exports.saveAs = saveAs; +} else if (( true && __webpack_require__(/*! !webpack amd define */ "./node_modules/webpack/buildin/amd-define.js") !== null) && (__webpack_require__(/*! !webpack amd options */ "./node_modules/webpack/buildin/amd-options.js") !== null)) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { + return saveAs; + }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); +} + + +/***/ }), + +/***/ "./node_modules/html-parse-stringify2/lib/parse-tag.js": +/*!*************************************************************!*\ + !*** ./node_modules/html-parse-stringify2/lib/parse-tag.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var attrRE = /([\w-]+)|=|(['"])([.\s\S]*?)\2/g; +var voidElements = __webpack_require__(/*! void-elements */ "./node_modules/void-elements/index.js"); + +module.exports = function (tag) { + var i = 0; + var key; + var expectingValueAfterEquals = true; + var res = { + type: 'tag', + name: '', + voidElement: false, + attrs: {}, + children: [] + }; + + tag.replace(attrRE, function (match) { + if (match === '=') { + expectingValueAfterEquals = true; + i++; + return; + } + + if (!expectingValueAfterEquals) { + if (key) { + res.attrs[key] = key; // boolean attribute + } + key=match; + } else { + if (i === 0) { + if (voidElements[match] || tag.charAt(tag.length - 2) === '/') { + res.voidElement = true; + } + res.name = match; + } else { + res.attrs[key] = match.replace(/^['"]|['"]$/g, ''); + key=undefined; + } + } + i++; + expectingValueAfterEquals = false; + }); + + return res; +}; + + +/***/ }), + +/***/ "./node_modules/html-parse-stringify2/lib/parse.js": +/*!*********************************************************!*\ + !*** ./node_modules/html-parse-stringify2/lib/parse.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/*jshint -W030 */ +var tagRE = /(?:|<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>)/g; +var parseTag = __webpack_require__(/*! ./parse-tag */ "./node_modules/html-parse-stringify2/lib/parse-tag.js"); +// re-used obj for quick lookups of components +var empty = Object.create ? Object.create(null) : {}; +// common logic for pushing a child node onto a list +function pushTextNode(list, html, level, start, ignoreWhitespace) { + // calculate correct end of the content slice in case there's + // no tag after the text node. + var end = html.indexOf('<', start); + var content = html.slice(start, end === -1 ? undefined : end); + // if a node is nothing but whitespace, collapse it as the spec states: + // https://www.w3.org/TR/html4/struct/text.html#h-9.1 + if (/^\s*$/.test(content)) { + content = ' '; + } + // don't add whitespace-only text nodes if they would be trailing text nodes + // or if they would be leading whitespace-only text nodes: + // * end > -1 indicates this is not a trailing text node + // * leading node is when level is -1 and list has length 0 + if ((!ignoreWhitespace && end > -1 && level + list.length >= 0) || content !== ' ') { + list.push({ + type: 'text', + content: content + }); + } +} + +module.exports = function parse(html, options) { + options || (options = {}); + options.components || (options.components = empty); + var result = []; + var current; + var level = -1; + var arr = []; + var byTag = {}; + var inComponent = false; + + html.replace(tagRE, function (tag, index) { + if (inComponent) { + if (tag !== ('' + current.name + '>')) { + return; + } else { + inComponent = false; + } + } + + var isOpen = tag.charAt(1) !== '/'; + var isComment = tag.indexOf(' "); +} +function circularDependencyToException(request) { + request.childRequests.forEach(function (childRequest) { + if (alreadyDependencyChain(childRequest, childRequest.serviceIdentifier)) { + var services = dependencyChainToString(childRequest); + throw new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY + " " + services); + } + else { + circularDependencyToException(childRequest); + } + }); +} +exports.circularDependencyToException = circularDependencyToException; +function listMetadataForTarget(serviceIdentifierString, target) { + if (target.isTagged() || target.isNamed()) { + var m_1 = ""; + var namedTag = target.getNamedTag(); + var otherTags = target.getCustomTags(); + if (namedTag !== null) { + m_1 += namedTag.toString() + "\n"; + } + if (otherTags !== null) { + otherTags.forEach(function (tag) { + m_1 += tag.toString() + "\n"; + }); + } + return " " + serviceIdentifierString + "\n " + serviceIdentifierString + " - " + m_1; + } + else { + return " " + serviceIdentifierString; + } +} +exports.listMetadataForTarget = listMetadataForTarget; +function getFunctionName(v) { + if (v.name) { + return v.name; + } + else { + var name_1 = v.toString(); + var match = name_1.match(/^function\s*([^\s(]+)/); + return match ? match[1] : "Anonymous function: " + name_1; + } +} +exports.getFunctionName = getFunctionName; + + +/***/ }), + +/***/ "./node_modules/json3/lib/json3.js": +/*!*****************************************!*\ + !*** ./node_modules/json3/lib/json3.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! JSON v3.3.2 | https://bestiejs.github.io/json3 | Copyright 2012-2015, Kit Cambridge, Benjamin Tan | http://kit.mit-license.org */ +;(function () { + // Detect the `define` function exposed by asynchronous module loaders. The + // strict `define` check is necessary for compatibility with `r.js`. + var isLoader = true && __webpack_require__(/*! !webpack amd options */ "./node_modules/webpack/buildin/amd-options.js"); + + // A set of types used to distinguish objects from primitives. + var objectTypes = { + "function": true, + "object": true + }; + + // Detect the `exports` object exposed by CommonJS implementations. + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + + // Use the `global` object exposed by Node (including Browserify via + // `insert-module-globals`), Narwhal, and Ringo as the default context, + // and the `window` object in browsers. Rhino exports a `global` function + // instead. + var root = objectTypes[typeof window] && window || this, + freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == "object" && global; + + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) { + root = freeGlobal; + } + + // Public: Initializes JSON 3 using the given `context` object, attaching the + // `stringify` and `parse` functions to the specified `exports` object. + function runInContext(context, exports) { + context || (context = root.Object()); + exports || (exports = root.Object()); + + // Native constructor aliases. + var Number = context.Number || root.Number, + String = context.String || root.String, + Object = context.Object || root.Object, + Date = context.Date || root.Date, + SyntaxError = context.SyntaxError || root.SyntaxError, + TypeError = context.TypeError || root.TypeError, + Math = context.Math || root.Math, + nativeJSON = context.JSON || root.JSON; + + // Delegate to the native `stringify` and `parse` implementations. + if (typeof nativeJSON == "object" && nativeJSON) { + exports.stringify = nativeJSON.stringify; + exports.parse = nativeJSON.parse; + } + + // Convenience aliases. + var objectProto = Object.prototype, + getClass = objectProto.toString, + isProperty = objectProto.hasOwnProperty, + undefined; + + // Internal: Contains `try...catch` logic used by other functions. + // This prevents other functions from being deoptimized. + function attempt(func, errorFunc) { + try { + func(); + } catch (exception) { + if (errorFunc) { + errorFunc(); + } + } + } + + // Test the `Date#getUTC*` methods. Based on work by @Yaffle. + var isExtended = new Date(-3509827334573292); + attempt(function () { + // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical + // results for certain dates in Opera >= 10.53. + isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 && + isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708; + }); + + // Internal: Determines whether the native `JSON.stringify` and `parse` + // implementations are spec-compliant. Based on work by Ken Snyder. + function has(name) { + if (has[name] != null) { + // Return cached feature test result. + return has[name]; + } + var isSupported; + if (name == "bug-string-char-index") { + // IE <= 7 doesn't support accessing string characters using square + // bracket notation. IE 8 only supports this for primitives. + isSupported = "a"[0] != "a"; + } else if (name == "json") { + // Indicates whether both `JSON.stringify` and `JSON.parse` are + // supported. + isSupported = has("json-stringify") && has("date-serialization") && has("json-parse"); + } else if (name == "date-serialization") { + // Indicates whether `Date`s can be serialized accurately by `JSON.stringify`. + isSupported = has("json-stringify") && isExtended; + if (isSupported) { + var stringify = exports.stringify; + attempt(function () { + isSupported = + // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly + // serialize extended years. + stringify(new Date(-8.64e15)) == '"-271821-04-20T00:00:00.000Z"' && + // The milliseconds are optional in ES 5, but required in 5.1. + stringify(new Date(8.64e15)) == '"+275760-09-13T00:00:00.000Z"' && + // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative + // four-digit years instead of six-digit years. Credits: @Yaffle. + stringify(new Date(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"' && + // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond + // values less than 1000. Credits: @Yaffle. + stringify(new Date(-1)) == '"1969-12-31T23:59:59.999Z"'; + }); + } + } else { + var value, serialized = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'; + // Test `JSON.stringify`. + if (name == "json-stringify") { + var stringify = exports.stringify, stringifySupported = typeof stringify == "function"; + if (stringifySupported) { + // A test function object with a custom `toJSON` method. + (value = function () { + return 1; + }).toJSON = value; + attempt(function () { + stringifySupported = + // Firefox 3.1b1 and b2 serialize string, number, and boolean + // primitives as object literals. + stringify(0) === "0" && + // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object + // literals. + stringify(new Number()) === "0" && + stringify(new String()) == '""' && + // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or + // does not define a canonical JSON representation (this applies to + // objects with `toJSON` properties as well, *unless* they are nested + // within an object or array). + stringify(getClass) === undefined && + // IE 8 serializes `undefined` as `"undefined"`. Safari <= 5.1.7 and + // FF 3.1b3 pass this test. + stringify(undefined) === undefined && + // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s, + // respectively, if the value is omitted entirely. + stringify() === undefined && + // FF 3.1b1, 2 throw an error if the given value is not a number, + // string, array, object, Boolean, or `null` literal. This applies to + // objects with custom `toJSON` methods as well, unless they are nested + // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON` + // methods entirely. + stringify(value) === "1" && + stringify([value]) == "[1]" && + // Prototype <= 1.6.1 serializes `[undefined]` as `"[]"` instead of + // `"[null]"`. + stringify([undefined]) == "[null]" && + // YUI 3.0.0b1 fails to serialize `null` literals. + stringify(null) == "null" && + // FF 3.1b1, 2 halts serialization if an array contains a function: + // `[1, true, getClass, 1]` serializes as "[1,true,],". FF 3.1b3 + // elides non-JSON values from objects and arrays, unless they + // define custom `toJSON` methods. + stringify([undefined, getClass, null]) == "[null,null,null]" && + // Simple serialization test. FF 3.1b1 uses Unicode escape sequences + // where character escape codes are expected (e.g., `\b` => `\u0008`). + stringify({ "a": [value, true, false, null, "\x00\b\n\f\r\t"] }) == serialized && + // FF 3.1b1 and b2 ignore the `filter` and `width` arguments. + stringify(null, value) === "1" && + stringify([1, 2], null, 1) == "[\n 1,\n 2\n]"; + }, function () { + stringifySupported = false; + }); + } + isSupported = stringifySupported; + } + // Test `JSON.parse`. + if (name == "json-parse") { + var parse = exports.parse, parseSupported; + if (typeof parse == "function") { + attempt(function () { + // FF 3.1b1, b2 will throw an exception if a bare literal is provided. + // Conforming implementations should also coerce the initial argument to + // a string prior to parsing. + if (parse("0") === 0 && !parse(false)) { + // Simple parsing test. + value = parse(serialized); + parseSupported = value["a"].length == 5 && value["a"][0] === 1; + if (parseSupported) { + attempt(function () { + // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings. + parseSupported = !parse('"\t"'); + }); + if (parseSupported) { + attempt(function () { + // FF 4.0 and 4.0.1 allow leading `+` signs and leading + // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow + // certain octal literals. + parseSupported = parse("01") !== 1; + }); + } + if (parseSupported) { + attempt(function () { + // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal + // points. These environments, along with FF 3.1b1 and 2, + // also allow trailing commas in JSON objects and arrays. + parseSupported = parse("1.") !== 1; + }); + } + } + } + }, function () { + parseSupported = false; + }); + } + isSupported = parseSupported; + } + } + return has[name] = !!isSupported; + } + has["bug-string-char-index"] = has["date-serialization"] = has["json"] = has["json-stringify"] = has["json-parse"] = null; + + if (!has("json")) { + // Common `[[Class]]` name aliases. + var functionClass = "[object Function]", + dateClass = "[object Date]", + numberClass = "[object Number]", + stringClass = "[object String]", + arrayClass = "[object Array]", + booleanClass = "[object Boolean]"; + + // Detect incomplete support for accessing string characters by index. + var charIndexBuggy = has("bug-string-char-index"); + + // Internal: Normalizes the `for...in` iteration algorithm across + // environments. Each enumerated key is yielded to a `callback` function. + var forOwn = function (object, callback) { + var size = 0, Properties, dontEnums, property; + + // Tests for bugs in the current environment's `for...in` algorithm. The + // `valueOf` property inherits the non-enumerable flag from + // `Object.prototype` in older versions of IE, Netscape, and Mozilla. + (Properties = function () { + this.valueOf = 0; + }).prototype.valueOf = 0; + + // Iterate over a new instance of the `Properties` class. + dontEnums = new Properties(); + for (property in dontEnums) { + // Ignore all properties inherited from `Object.prototype`. + if (isProperty.call(dontEnums, property)) { + size++; + } + } + Properties = dontEnums = null; + + // Normalize the iteration algorithm. + if (!size) { + // A list of non-enumerable properties inherited from `Object.prototype`. + dontEnums = ["valueOf", "toString", "toLocaleString", "propertyIsEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"]; + // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable + // properties. + forOwn = function (object, callback) { + var isFunction = getClass.call(object) == functionClass, property, length; + var hasProperty = !isFunction && typeof object.constructor != "function" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty; + for (property in object) { + // Gecko <= 1.0 enumerates the `prototype` property of functions under + // certain conditions; IE does not. + if (!(isFunction && property == "prototype") && hasProperty.call(object, property)) { + callback(property); + } + } + // Manually invoke the callback for each non-enumerable property. + for (length = dontEnums.length; property = dontEnums[--length];) { + if (hasProperty.call(object, property)) { + callback(property); + } + } + }; + } else { + // No bugs detected; use the standard `for...in` algorithm. + forOwn = function (object, callback) { + var isFunction = getClass.call(object) == functionClass, property, isConstructor; + for (property in object) { + if (!(isFunction && property == "prototype") && isProperty.call(object, property) && !(isConstructor = property === "constructor")) { + callback(property); + } + } + // Manually invoke the callback for the `constructor` property due to + // cross-environment inconsistencies. + if (isConstructor || isProperty.call(object, (property = "constructor"))) { + callback(property); + } + }; + } + return forOwn(object, callback); + }; + + // Public: Serializes a JavaScript `value` as a JSON string. The optional + // `filter` argument may specify either a function that alters how object and + // array members are serialized, or an array of strings and numbers that + // indicates which properties should be serialized. The optional `width` + // argument may be either a string or number that specifies the indentation + // level of the output. + if (!has("json-stringify") && !has("date-serialization")) { + // Internal: A map of control characters and their escaped equivalents. + var Escapes = { + 92: "\\\\", + 34: '\\"', + 8: "\\b", + 12: "\\f", + 10: "\\n", + 13: "\\r", + 9: "\\t" + }; + + // Internal: Converts `value` into a zero-padded string such that its + // length is at least equal to `width`. The `width` must be <= 6. + var leadingZeroes = "000000"; + var toPaddedString = function (width, value) { + // The `|| 0` expression is necessary to work around a bug in + // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== "0"`. + return (leadingZeroes + (value || 0)).slice(-width); + }; + + // Internal: Serializes a date object. + var serializeDate = function (value) { + var getData, year, month, date, time, hours, minutes, seconds, milliseconds; + // Define additional utility methods if the `Date` methods are buggy. + if (!isExtended) { + var floor = Math.floor; + // A mapping between the months of the year and the number of days between + // January 1st and the first of the respective month. + var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334]; + // Internal: Calculates the number of days between the Unix epoch and the + // first day of the given month. + var getDay = function (year, month) { + return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400); + }; + getData = function (value) { + // Manually compute the year, month, date, hours, minutes, + // seconds, and milliseconds if the `getUTC*` methods are + // buggy. Adapted from @Yaffle's `date-shim` project. + date = floor(value / 864e5); + for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++); + for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++); + date = 1 + date - getDay(year, month); + // The `time` value specifies the time within the day (see ES + // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used + // to compute `A modulo B`, as the `%` operator does not + // correspond to the `modulo` operation for negative numbers. + time = (value % 864e5 + 864e5) % 864e5; + // The hours, minutes, seconds, and milliseconds are obtained by + // decomposing the time within the day. See section 15.9.1.10. + hours = floor(time / 36e5) % 24; + minutes = floor(time / 6e4) % 60; + seconds = floor(time / 1e3) % 60; + milliseconds = time % 1e3; + }; + } else { + getData = function (value) { + year = value.getUTCFullYear(); + month = value.getUTCMonth(); + date = value.getUTCDate(); + hours = value.getUTCHours(); + minutes = value.getUTCMinutes(); + seconds = value.getUTCSeconds(); + milliseconds = value.getUTCMilliseconds(); + }; + } + serializeDate = function (value) { + if (value > -1 / 0 && value < 1 / 0) { + // Dates are serialized according to the `Date#toJSON` method + // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15 + // for the ISO 8601 date time string format. + getData(value); + // Serialize extended years correctly. + value = (year <= 0 || year >= 1e4 ? (year < 0 ? "-" : "+") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) + + "-" + toPaddedString(2, month + 1) + "-" + toPaddedString(2, date) + + // Months, dates, hours, minutes, and seconds should have two + // digits; milliseconds should have three. + "T" + toPaddedString(2, hours) + ":" + toPaddedString(2, minutes) + ":" + toPaddedString(2, seconds) + + // Milliseconds are optional in ES 5.0, but required in 5.1. + "." + toPaddedString(3, milliseconds) + "Z"; + year = month = date = hours = minutes = seconds = milliseconds = null; + } else { + value = null; + } + return value; + }; + return serializeDate(value); + }; + + // For environments with `JSON.stringify` but buggy date serialization, + // we override the native `Date#toJSON` implementation with a + // spec-compliant one. + if (has("json-stringify") && !has("date-serialization")) { + // Internal: the `Date#toJSON` implementation used to override the native one. + function dateToJSON (key) { + return serializeDate(this); + } + + // Public: `JSON.stringify`. See ES 5.1 section 15.12.3. + var nativeStringify = exports.stringify; + exports.stringify = function (source, filter, width) { + var nativeToJSON = Date.prototype.toJSON; + Date.prototype.toJSON = dateToJSON; + var result = nativeStringify(source, filter, width); + Date.prototype.toJSON = nativeToJSON; + return result; + } + } else { + // Internal: Double-quotes a string `value`, replacing all ASCII control + // characters (characters with code unit values between 0 and 31) with + // their escaped equivalents. This is an implementation of the + // `Quote(value)` operation defined in ES 5.1 section 15.12.3. + var unicodePrefix = "\\u00"; + var escapeChar = function (character) { + var charCode = character.charCodeAt(0), escaped = Escapes[charCode]; + if (escaped) { + return escaped; + } + return unicodePrefix + toPaddedString(2, charCode.toString(16)); + }; + var reEscape = /[\x00-\x1f\x22\x5c]/g; + var quote = function (value) { + reEscape.lastIndex = 0; + return '"' + + ( + reEscape.test(value) + ? value.replace(reEscape, escapeChar) + : value + ) + + '"'; + }; + + // Internal: Recursively serializes an object. Implements the + // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations. + var serialize = function (property, object, callback, properties, whitespace, indentation, stack) { + var value, type, className, results, element, index, length, prefix, result; + attempt(function () { + // Necessary for host object support. + value = object[property]; + }); + if (typeof value == "object" && value) { + if (value.getUTCFullYear && getClass.call(value) == dateClass && value.toJSON === Date.prototype.toJSON) { + value = serializeDate(value); + } else if (typeof value.toJSON == "function") { + value = value.toJSON(property); + } + } + if (callback) { + // If a replacement function was provided, call it to obtain the value + // for serialization. + value = callback.call(object, property, value); + } + // Exit early if value is `undefined` or `null`. + if (value == undefined) { + return value === undefined ? value : "null"; + } + type = typeof value; + // Only call `getClass` if the value is an object. + if (type == "object") { + className = getClass.call(value); + } + switch (className || type) { + case "boolean": + case booleanClass: + // Booleans are represented literally. + return "" + value; + case "number": + case numberClass: + // JSON numbers must be finite. `Infinity` and `NaN` are serialized as + // `"null"`. + return value > -1 / 0 && value < 1 / 0 ? "" + value : "null"; + case "string": + case stringClass: + // Strings are double-quoted and escaped. + return quote("" + value); + } + // Recursively serialize objects and arrays. + if (typeof value == "object") { + // Check for cyclic structures. This is a linear search; performance + // is inversely proportional to the number of unique nested objects. + for (length = stack.length; length--;) { + if (stack[length] === value) { + // Cyclic structures cannot be serialized by `JSON.stringify`. + throw TypeError(); + } + } + // Add the object to the stack of traversed objects. + stack.push(value); + results = []; + // Save the current indentation level and indent one additional level. + prefix = indentation; + indentation += whitespace; + if (className == arrayClass) { + // Recursively serialize array elements. + for (index = 0, length = value.length; index < length; index++) { + element = serialize(index, value, callback, properties, whitespace, indentation, stack); + results.push(element === undefined ? "null" : element); + } + result = results.length ? (whitespace ? "[\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "]" : ("[" + results.join(",") + "]")) : "[]"; + } else { + // Recursively serialize object members. Members are selected from + // either a user-specified list of property names, or the object + // itself. + forOwn(properties || value, function (property) { + var element = serialize(property, value, callback, properties, whitespace, indentation, stack); + if (element !== undefined) { + // According to ES 5.1 section 15.12.3: "If `gap` {whitespace} + // is not the empty string, let `member` {quote(property) + ":"} + // be the concatenation of `member` and the `space` character." + // The "`space` character" refers to the literal space + // character, not the `space` {width} argument provided to + // `JSON.stringify`. + results.push(quote(property) + ":" + (whitespace ? " " : "") + element); + } + }); + result = results.length ? (whitespace ? "{\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "}" : ("{" + results.join(",") + "}")) : "{}"; + } + // Remove the object from the traversed object stack. + stack.pop(); + return result; + } + }; + + // Public: `JSON.stringify`. See ES 5.1 section 15.12.3. + exports.stringify = function (source, filter, width) { + var whitespace, callback, properties, className; + if (objectTypes[typeof filter] && filter) { + className = getClass.call(filter); + if (className == functionClass) { + callback = filter; + } else if (className == arrayClass) { + // Convert the property names array into a makeshift set. + properties = {}; + for (var index = 0, length = filter.length, value; index < length;) { + value = filter[index++]; + className = getClass.call(value); + if (className == "[object String]" || className == "[object Number]") { + properties[value] = 1; + } + } + } + } + if (width) { + className = getClass.call(width); + if (className == numberClass) { + // Convert the `width` to an integer and create a string containing + // `width` number of space characters. + if ((width -= width % 1) > 0) { + if (width > 10) { + width = 10; + } + for (whitespace = ""; whitespace.length < width;) { + whitespace += " "; + } + } + } else if (className == stringClass) { + whitespace = width.length <= 10 ? width : width.slice(0, 10); + } + } + // Opera <= 7.54u2 discards the values associated with empty string keys + // (`""`) only if they are used directly within an object member list + // (e.g., `!("" in { "": 1})`). + return serialize("", (value = {}, value[""] = source, value), callback, properties, whitespace, "", []); + }; + } + } + + // Public: Parses a JSON source string. + if (!has("json-parse")) { + var fromCharCode = String.fromCharCode; + + // Internal: A map of escaped control characters and their unescaped + // equivalents. + var Unescapes = { + 92: "\\", + 34: '"', + 47: "/", + 98: "\b", + 116: "\t", + 110: "\n", + 102: "\f", + 114: "\r" + }; + + // Internal: Stores the parser state. + var Index, Source; + + // Internal: Resets the parser state and throws a `SyntaxError`. + var abort = function () { + Index = Source = null; + throw SyntaxError(); + }; + + // Internal: Returns the next token, or `"$"` if the parser has reached + // the end of the source string. A token may be a string, number, `null` + // literal, or Boolean literal. + var lex = function () { + var source = Source, length = source.length, value, begin, position, isSigned, charCode; + while (Index < length) { + charCode = source.charCodeAt(Index); + switch (charCode) { + case 9: case 10: case 13: case 32: + // Skip whitespace tokens, including tabs, carriage returns, line + // feeds, and space characters. + Index++; + break; + case 123: case 125: case 91: case 93: case 58: case 44: + // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at + // the current position. + value = charIndexBuggy ? source.charAt(Index) : source[Index]; + Index++; + return value; + case 34: + // `"` delimits a JSON string; advance to the next character and + // begin parsing the string. String tokens are prefixed with the + // sentinel `@` character to distinguish them from punctuators and + // end-of-string tokens. + for (value = "@", Index++; Index < length;) { + charCode = source.charCodeAt(Index); + if (charCode < 32) { + // Unescaped ASCII control characters (those with a code unit + // less than the space character) are not permitted. + abort(); + } else if (charCode == 92) { + // A reverse solidus (`\`) marks the beginning of an escaped + // control character (including `"`, `\`, and `/`) or Unicode + // escape sequence. + charCode = source.charCodeAt(++Index); + switch (charCode) { + case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114: + // Revive escaped control characters. + value += Unescapes[charCode]; + Index++; + break; + case 117: + // `\u` marks the beginning of a Unicode escape sequence. + // Advance to the first character and validate the + // four-digit code point. + begin = ++Index; + for (position = Index + 4; Index < position; Index++) { + charCode = source.charCodeAt(Index); + // A valid sequence comprises four hexdigits (case- + // insensitive) that form a single hexadecimal value. + if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) { + // Invalid Unicode escape sequence. + abort(); + } + } + // Revive the escaped character. + value += fromCharCode("0x" + source.slice(begin, Index)); + break; + default: + // Invalid escape sequence. + abort(); + } + } else { + if (charCode == 34) { + // An unescaped double-quote character marks the end of the + // string. + break; + } + charCode = source.charCodeAt(Index); + begin = Index; + // Optimize for the common case where a string is valid. + while (charCode >= 32 && charCode != 92 && charCode != 34) { + charCode = source.charCodeAt(++Index); + } + // Append the string as-is. + value += source.slice(begin, Index); + } + } + if (source.charCodeAt(Index) == 34) { + // Advance to the next character and return the revived string. + Index++; + return value; + } + // Unterminated string. + abort(); + default: + // Parse numbers and literals. + begin = Index; + // Advance past the negative sign, if one is specified. + if (charCode == 45) { + isSigned = true; + charCode = source.charCodeAt(++Index); + } + // Parse an integer or floating-point value. + if (charCode >= 48 && charCode <= 57) { + // Leading zeroes are interpreted as octal literals. + if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) { + // Illegal octal literal. + abort(); + } + isSigned = false; + // Parse the integer component. + for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++); + // Floats cannot contain a leading decimal point; however, this + // case is already accounted for by the parser. + if (source.charCodeAt(Index) == 46) { + position = ++Index; + // Parse the decimal component. + for (; position < length; position++) { + charCode = source.charCodeAt(position); + if (charCode < 48 || charCode > 57) { + break; + } + } + if (position == Index) { + // Illegal trailing decimal. + abort(); + } + Index = position; + } + // Parse exponents. The `e` denoting the exponent is + // case-insensitive. + charCode = source.charCodeAt(Index); + if (charCode == 101 || charCode == 69) { + charCode = source.charCodeAt(++Index); + // Skip past the sign following the exponent, if one is + // specified. + if (charCode == 43 || charCode == 45) { + Index++; + } + // Parse the exponential component. + for (position = Index; position < length; position++) { + charCode = source.charCodeAt(position); + if (charCode < 48 || charCode > 57) { + break; + } + } + if (position == Index) { + // Illegal empty exponent. + abort(); + } + Index = position; + } + // Coerce the parsed value to a JavaScript number. + return +source.slice(begin, Index); + } + // A negative sign may only precede numbers. + if (isSigned) { + abort(); + } + // `true`, `false`, and `null` literals. + var temp = source.slice(Index, Index + 4); + if (temp == "true") { + Index += 4; + return true; + } else if (temp == "fals" && source.charCodeAt(Index + 4 ) == 101) { + Index += 5; + return false; + } else if (temp == "null") { + Index += 4; + return null; + } + // Unrecognized token. + abort(); + } + } + // Return the sentinel `$` character if the parser has reached the end + // of the source string. + return "$"; + }; + + // Internal: Parses a JSON `value` token. + var get = function (value) { + var results, hasMembers; + if (value == "$") { + // Unexpected end of input. + abort(); + } + if (typeof value == "string") { + if ((charIndexBuggy ? value.charAt(0) : value[0]) == "@") { + // Remove the sentinel `@` character. + return value.slice(1); + } + // Parse object and array literals. + if (value == "[") { + // Parses a JSON array, returning a new JavaScript array. + results = []; + for (;;) { + value = lex(); + // A closing square bracket marks the end of the array literal. + if (value == "]") { + break; + } + // If the array literal contains elements, the current token + // should be a comma separating the previous element from the + // next. + if (hasMembers) { + if (value == ",") { + value = lex(); + if (value == "]") { + // Unexpected trailing `,` in array literal. + abort(); + } + } else { + // A `,` must separate each array element. + abort(); + } + } else { + hasMembers = true; + } + // Elisions and leading commas are not permitted. + if (value == ",") { + abort(); + } + results.push(get(value)); + } + return results; + } else if (value == "{") { + // Parses a JSON object, returning a new JavaScript object. + results = {}; + for (;;) { + value = lex(); + // A closing curly brace marks the end of the object literal. + if (value == "}") { + break; + } + // If the object literal contains members, the current token + // should be a comma separator. + if (hasMembers) { + if (value == ",") { + value = lex(); + if (value == "}") { + // Unexpected trailing `,` in object literal. + abort(); + } + } else { + // A `,` must separate each object member. + abort(); + } + } else { + hasMembers = true; + } + // Leading commas are not permitted, object property names must be + // double-quoted strings, and a `:` must separate each property + // name and value. + if (value == "," || typeof value != "string" || (charIndexBuggy ? value.charAt(0) : value[0]) != "@" || lex() != ":") { + abort(); + } + results[value.slice(1)] = get(lex()); + } + return results; + } + // Unexpected token encountered. + abort(); + } + return value; + }; + + // Internal: Updates a traversed object member. + var update = function (source, property, callback) { + var element = walk(source, property, callback); + if (element === undefined) { + delete source[property]; + } else { + source[property] = element; + } + }; + + // Internal: Recursively traverses a parsed JSON object, invoking the + // `callback` function for each value. This is an implementation of the + // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2. + var walk = function (source, property, callback) { + var value = source[property], length; + if (typeof value == "object" && value) { + // `forOwn` can't be used to traverse an array in Opera <= 8.54 + // because its `Object#hasOwnProperty` implementation returns `false` + // for array indices (e.g., `![1, 2, 3].hasOwnProperty("0")`). + if (getClass.call(value) == arrayClass) { + for (length = value.length; length--;) { + update(getClass, forOwn, value, length, callback); + } + } else { + forOwn(value, function (property) { + update(value, property, callback); + }); + } + } + return callback.call(source, property, value); + }; + + // Public: `JSON.parse`. See ES 5.1 section 15.12.2. + exports.parse = function (source, callback) { + var result, value; + Index = 0; + Source = "" + source; + result = get(lex()); + // If a JSON string contains multiple tokens, it is invalid. + if (lex() != "$") { + abort(); + } + // Reset the parser state. + Index = Source = null; + return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[""] = result, value), "", callback) : result; + }; + } + } + + exports.runInContext = runInContext; + return exports; + } + + if (freeExports && !isLoader) { + // Export for CommonJS environments. + runInContext(root, freeExports); + } else { + // Export for web browsers and JavaScript engines. + var nativeJSON = root.JSON, + previousJSON = root.JSON3, + isRestored = false; + + var JSON3 = runInContext(root, (root.JSON3 = { + // Public: Restores the original value of the global `JSON` object and + // returns a reference to the `JSON3` object. + "noConflict": function () { + if (!isRestored) { + isRestored = true; + root.JSON = nativeJSON; + root.JSON3 = previousJSON; + nativeJSON = previousJSON = null; + } + return JSON3; + } + })); + + root.JSON = { + "parse": JSON3.parse, + "stringify": JSON3.stringify + }; + } + + // Export for asynchronous module loaders. + if (isLoader) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { + return JSON3; + }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } +}).call(this); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module), __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/process/browser.js": +/*!*****************************************!*\ + !*** ./node_modules/process/browser.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), + +/***/ "./node_modules/querystringify/index.js": +/*!**********************************************!*\ + !*** ./node_modules/querystringify/index.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty + , undef; + +/** + * Decode a URI encoded string. + * + * @param {String} input The URI encoded string. + * @returns {String|Null} The decoded string. + * @api private + */ +function decode(input) { + try { + return decodeURIComponent(input.replace(/\+/g, ' ')); + } catch (e) { + return null; + } +} + +/** + * Attempts to encode a given input. + * + * @param {String} input The string that needs to be encoded. + * @returns {String|Null} The encoded string. + * @api private + */ +function encode(input) { + try { + return encodeURIComponent(input); + } catch (e) { + return null; + } +} + +/** + * Simple query string parser. + * + * @param {String} query The query string that needs to be parsed. + * @returns {Object} + * @api public + */ +function querystring(query) { + var parser = /([^=?&]+)=?([^&]*)/g + , result = {} + , part; + + while (part = parser.exec(query)) { + var key = decode(part[1]) + , value = decode(part[2]); + + // + // Prevent overriding of existing properties. This ensures that build-in + // methods like `toString` or __proto__ are not overriden by malicious + // querystrings. + // + // In the case if failed decoding, we want to omit the key/value pairs + // from the result. + // + if (key === null || value === null || key in result) continue; + result[key] = value; + } + + return result; +} + +/** + * Transform a query string to an object. + * + * @param {Object} obj Object that should be transformed. + * @param {String} prefix Optional prefix. + * @returns {String} + * @api public + */ +function querystringify(obj, prefix) { + prefix = prefix || ''; + + var pairs = [] + , value + , key; + + // + // Optionally prefix with a '?' if needed + // + if ('string' !== typeof prefix) prefix = '?'; + + for (key in obj) { + if (has.call(obj, key)) { + value = obj[key]; + + // + // Edge cases where we actually want to encode the value to an empty + // string instead of the stringified value. + // + if (!value && (value === null || value === undef || isNaN(value))) { + value = ''; + } + + key = encodeURIComponent(key); + value = encodeURIComponent(value); + + // + // If we failed to encode the strings, we should bail out as we don't + // want to add invalid strings to the query. + // + if (key === null || value === null) continue; + pairs.push(key +'='+ value); + } + } + + return pairs.length ? prefix + pairs.join('&') : ''; +} + +// +// Expose the module. +// +exports.stringify = querystringify; +exports.parse = querystring; + + +/***/ }), + +/***/ "./node_modules/reflect-metadata/Reflect.js": +/*!**************************************************!*\ + !*** ./node_modules/reflect-metadata/Reflect.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process, global) {/*! ***************************************************************************** +Copyright (C) Microsoft. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +var Reflect; +(function (Reflect) { + // Metadata Proposal + // https://rbuckton.github.io/reflect-metadata/ + (function (factory) { + var root = typeof global === "object" ? global : + typeof self === "object" ? self : + typeof this === "object" ? this : + Function("return this;")(); + var exporter = makeExporter(Reflect); + if (typeof root.Reflect === "undefined") { + root.Reflect = Reflect; + } + else { + exporter = makeExporter(root.Reflect, exporter); + } + factory(exporter); + function makeExporter(target, previous) { + return function (key, value) { + if (typeof target[key] !== "function") { + Object.defineProperty(target, key, { configurable: true, writable: true, value: value }); + } + if (previous) + previous(key, value); + }; + } + })(function (exporter) { + var hasOwn = Object.prototype.hasOwnProperty; + // feature test for Symbol support + var supportsSymbol = typeof Symbol === "function"; + var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive"; + var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator"; + var supportsCreate = typeof Object.create === "function"; // feature test for Object.create support + var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support + var downLevel = !supportsCreate && !supportsProto; + var HashMap = { + // create an object in dictionary mode (a.k.a. "slow" mode in v8) + create: supportsCreate + ? function () { return MakeDictionary(Object.create(null)); } + : supportsProto + ? function () { return MakeDictionary({ __proto__: null }); } + : function () { return MakeDictionary({}); }, + has: downLevel + ? function (map, key) { return hasOwn.call(map, key); } + : function (map, key) { return key in map; }, + get: downLevel + ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; } + : function (map, key) { return map[key]; }, + }; + // Load global or shim versions of Map, Set, and WeakMap + var functionPrototype = Object.getPrototypeOf(Function); + var usePolyfill = typeof process === "object" && process.env && process.env["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true"; + var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill(); + var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill(); + var _WeakMap = !usePolyfill && typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill(); + // [[Metadata]] internal slot + // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots + var Metadata = new _WeakMap(); + /** + * Applies a set of decorators to a property of a target object. + * @param decorators An array of decorators. + * @param target The target object. + * @param propertyKey (Optional) The property key to decorate. + * @param attributes (Optional) The property descriptor for the target key. + * @remarks Decorators are applied in reverse order. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * Example = Reflect.decorate(decoratorsArray, Example); + * + * // property (on constructor) + * Reflect.decorate(decoratorsArray, Example, "staticProperty"); + * + * // property (on prototype) + * Reflect.decorate(decoratorsArray, Example.prototype, "property"); + * + * // method (on constructor) + * Object.defineProperty(Example, "staticMethod", + * Reflect.decorate(decoratorsArray, Example, "staticMethod", + * Object.getOwnPropertyDescriptor(Example, "staticMethod"))); + * + * // method (on prototype) + * Object.defineProperty(Example.prototype, "method", + * Reflect.decorate(decoratorsArray, Example.prototype, "method", + * Object.getOwnPropertyDescriptor(Example.prototype, "method"))); + * + */ + function decorate(decorators, target, propertyKey, attributes) { + if (!IsUndefined(propertyKey)) { + if (!IsArray(decorators)) + throw new TypeError(); + if (!IsObject(target)) + throw new TypeError(); + if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes)) + throw new TypeError(); + if (IsNull(attributes)) + attributes = undefined; + propertyKey = ToPropertyKey(propertyKey); + return DecorateProperty(decorators, target, propertyKey, attributes); + } + else { + if (!IsArray(decorators)) + throw new TypeError(); + if (!IsConstructor(target)) + throw new TypeError(); + return DecorateConstructor(decorators, target); + } + } + exporter("decorate", decorate); + // 4.1.2 Reflect.metadata(metadataKey, metadataValue) + // https://rbuckton.github.io/reflect-metadata/#reflect.metadata + /** + * A default metadata decorator factory that can be used on a class, class member, or parameter. + * @param metadataKey The key for the metadata entry. + * @param metadataValue The value for the metadata entry. + * @returns A decorator function. + * @remarks + * If `metadataKey` is already defined for the target and target key, the + * metadataValue for that key will be overwritten. + * @example + * + * // constructor + * @Reflect.metadata(key, value) + * class Example { + * } + * + * // property (on constructor, TypeScript only) + * class Example { + * @Reflect.metadata(key, value) + * static staticProperty; + * } + * + * // property (on prototype, TypeScript only) + * class Example { + * @Reflect.metadata(key, value) + * property; + * } + * + * // method (on constructor) + * class Example { + * @Reflect.metadata(key, value) + * static staticMethod() { } + * } + * + * // method (on prototype) + * class Example { + * @Reflect.metadata(key, value) + * method() { } + * } + * + */ + function metadata(metadataKey, metadataValue) { + function decorator(target, propertyKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey)) + throw new TypeError(); + OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey); + } + return decorator; + } + exporter("metadata", metadata); + /** + * Define a unique metadata entry on the target. + * @param metadataKey A key used to store and retrieve metadata. + * @param metadataValue A value that contains attached metadata. + * @param target The target object on which to define metadata. + * @param propertyKey (Optional) The property key for the target. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * Reflect.defineMetadata("custom:annotation", options, Example); + * + * // property (on constructor) + * Reflect.defineMetadata("custom:annotation", options, Example, "staticProperty"); + * + * // property (on prototype) + * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "property"); + * + * // method (on constructor) + * Reflect.defineMetadata("custom:annotation", options, Example, "staticMethod"); + * + * // method (on prototype) + * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "method"); + * + * // decorator factory as metadata-producing annotation. + * function MyAnnotation(options): Decorator { + * return (target, key?) => Reflect.defineMetadata("custom:annotation", options, target, key); + * } + * + */ + function defineMetadata(metadataKey, metadataValue, target, propertyKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(propertyKey)) + propertyKey = ToPropertyKey(propertyKey); + return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey); + } + exporter("defineMetadata", defineMetadata); + /** + * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function hasMetadata(metadataKey, target, propertyKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(propertyKey)) + propertyKey = ToPropertyKey(propertyKey); + return OrdinaryHasMetadata(metadataKey, target, propertyKey); + } + exporter("hasMetadata", hasMetadata); + /** + * Gets a value indicating whether the target object has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasOwnMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function hasOwnMetadata(metadataKey, target, propertyKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(propertyKey)) + propertyKey = ToPropertyKey(propertyKey); + return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey); + } + exporter("hasOwnMetadata", hasOwnMetadata); + /** + * Gets the metadata value for the provided metadata key on the target object or its prototype chain. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.getMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function getMetadata(metadataKey, target, propertyKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(propertyKey)) + propertyKey = ToPropertyKey(propertyKey); + return OrdinaryGetMetadata(metadataKey, target, propertyKey); + } + exporter("getMetadata", getMetadata); + /** + * Gets the metadata value for the provided metadata key on the target object. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function getOwnMetadata(metadataKey, target, propertyKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(propertyKey)) + propertyKey = ToPropertyKey(propertyKey); + return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey); + } + exporter("getOwnMetadata", getOwnMetadata); + /** + * Gets the metadata keys defined on the target object or its prototype chain. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadataKeys(Example); + * + * // property (on constructor) + * result = Reflect.getMetadataKeys(Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadataKeys(Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadataKeys(Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadataKeys(Example.prototype, "method"); + * + */ + function getMetadataKeys(target, propertyKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(propertyKey)) + propertyKey = ToPropertyKey(propertyKey); + return OrdinaryMetadataKeys(target, propertyKey); + } + exporter("getMetadataKeys", getMetadataKeys); + /** + * Gets the unique metadata keys defined on the target object. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadataKeys(Example); + * + * // property (on constructor) + * result = Reflect.getOwnMetadataKeys(Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadataKeys(Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadataKeys(Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadataKeys(Example.prototype, "method"); + * + */ + function getOwnMetadataKeys(target, propertyKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(propertyKey)) + propertyKey = ToPropertyKey(propertyKey); + return OrdinaryOwnMetadataKeys(target, propertyKey); + } + exporter("getOwnMetadataKeys", getOwnMetadataKeys); + /** + * Deletes the metadata entry from the target object with the provided key. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns `true` if the metadata entry was found and deleted; otherwise, false. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.deleteMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function deleteMetadata(metadataKey, target, propertyKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(propertyKey)) + propertyKey = ToPropertyKey(propertyKey); + var metadataMap = GetOrCreateMetadataMap(target, propertyKey, /*Create*/ false); + if (IsUndefined(metadataMap)) + return false; + if (!metadataMap.delete(metadataKey)) + return false; + if (metadataMap.size > 0) + return true; + var targetMetadata = Metadata.get(target); + targetMetadata.delete(propertyKey); + if (targetMetadata.size > 0) + return true; + Metadata.delete(target); + return true; + } + exporter("deleteMetadata", deleteMetadata); + function DecorateConstructor(decorators, target) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target); + if (!IsUndefined(decorated) && !IsNull(decorated)) { + if (!IsConstructor(decorated)) + throw new TypeError(); + target = decorated; + } + } + return target; + } + function DecorateProperty(decorators, target, propertyKey, descriptor) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target, propertyKey, descriptor); + if (!IsUndefined(decorated) && !IsNull(decorated)) { + if (!IsObject(decorated)) + throw new TypeError(); + descriptor = decorated; + } + } + return descriptor; + } + function GetOrCreateMetadataMap(O, P, Create) { + var targetMetadata = Metadata.get(O); + if (IsUndefined(targetMetadata)) { + if (!Create) + return undefined; + targetMetadata = new _Map(); + Metadata.set(O, targetMetadata); + } + var metadataMap = targetMetadata.get(P); + if (IsUndefined(metadataMap)) { + if (!Create) + return undefined; + metadataMap = new _Map(); + targetMetadata.set(P, metadataMap); + } + return metadataMap; + } + // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P) + // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata + function OrdinaryHasMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) + return true; + var parent = OrdinaryGetPrototypeOf(O); + if (!IsNull(parent)) + return OrdinaryHasMetadata(MetadataKey, parent, P); + return false; + } + // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P) + // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata + function OrdinaryHasOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false); + if (IsUndefined(metadataMap)) + return false; + return ToBoolean(metadataMap.has(MetadataKey)); + } + // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P) + // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata + function OrdinaryGetMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) + return OrdinaryGetOwnMetadata(MetadataKey, O, P); + var parent = OrdinaryGetPrototypeOf(O); + if (!IsNull(parent)) + return OrdinaryGetMetadata(MetadataKey, parent, P); + return undefined; + } + // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P) + // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata + function OrdinaryGetOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false); + if (IsUndefined(metadataMap)) + return undefined; + return metadataMap.get(MetadataKey); + } + // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) + // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata + function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true); + metadataMap.set(MetadataKey, MetadataValue); + } + // 3.1.6.1 OrdinaryMetadataKeys(O, P) + // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys + function OrdinaryMetadataKeys(O, P) { + var ownKeys = OrdinaryOwnMetadataKeys(O, P); + var parent = OrdinaryGetPrototypeOf(O); + if (parent === null) + return ownKeys; + var parentKeys = OrdinaryMetadataKeys(parent, P); + if (parentKeys.length <= 0) + return ownKeys; + if (ownKeys.length <= 0) + return parentKeys; + var set = new _Set(); + var keys = []; + for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) { + var key = ownKeys_1[_i]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) { + var key = parentKeys_1[_a]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + return keys; + } + // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P) + // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys + function OrdinaryOwnMetadataKeys(O, P) { + var keys = []; + var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false); + if (IsUndefined(metadataMap)) + return keys; + var keysObj = metadataMap.keys(); + var iterator = GetIterator(keysObj); + var k = 0; + while (true) { + var next = IteratorStep(iterator); + if (!next) { + keys.length = k; + return keys; + } + var nextValue = IteratorValue(next); + try { + keys[k] = nextValue; + } + catch (e) { + try { + IteratorClose(iterator); + } + finally { + throw e; + } + } + k++; + } + } + // 6 ECMAScript Data Typ0es and Values + // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values + function Type(x) { + if (x === null) + return 1 /* Null */; + switch (typeof x) { + case "undefined": return 0 /* Undefined */; + case "boolean": return 2 /* Boolean */; + case "string": return 3 /* String */; + case "symbol": return 4 /* Symbol */; + case "number": return 5 /* Number */; + case "object": return x === null ? 1 /* Null */ : 6 /* Object */; + default: return 6 /* Object */; + } + } + // 6.1.1 The Undefined Type + // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type + function IsUndefined(x) { + return x === undefined; + } + // 6.1.2 The Null Type + // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type + function IsNull(x) { + return x === null; + } + // 6.1.5 The Symbol Type + // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type + function IsSymbol(x) { + return typeof x === "symbol"; + } + // 6.1.7 The Object Type + // https://tc39.github.io/ecma262/#sec-object-type + function IsObject(x) { + return typeof x === "object" ? x !== null : typeof x === "function"; + } + // 7.1 Type Conversion + // https://tc39.github.io/ecma262/#sec-type-conversion + // 7.1.1 ToPrimitive(input [, PreferredType]) + // https://tc39.github.io/ecma262/#sec-toprimitive + function ToPrimitive(input, PreferredType) { + switch (Type(input)) { + case 0 /* Undefined */: return input; + case 1 /* Null */: return input; + case 2 /* Boolean */: return input; + case 3 /* String */: return input; + case 4 /* Symbol */: return input; + case 5 /* Number */: return input; + } + var hint = PreferredType === 3 /* String */ ? "string" : PreferredType === 5 /* Number */ ? "number" : "default"; + var exoticToPrim = GetMethod(input, toPrimitiveSymbol); + if (exoticToPrim !== undefined) { + var result = exoticToPrim.call(input, hint); + if (IsObject(result)) + throw new TypeError(); + return result; + } + return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint); + } + // 7.1.1.1 OrdinaryToPrimitive(O, hint) + // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive + function OrdinaryToPrimitive(O, hint) { + if (hint === "string") { + var toString_1 = O.toString; + if (IsCallable(toString_1)) { + var result = toString_1.call(O); + if (!IsObject(result)) + return result; + } + var valueOf = O.valueOf; + if (IsCallable(valueOf)) { + var result = valueOf.call(O); + if (!IsObject(result)) + return result; + } + } + else { + var valueOf = O.valueOf; + if (IsCallable(valueOf)) { + var result = valueOf.call(O); + if (!IsObject(result)) + return result; + } + var toString_2 = O.toString; + if (IsCallable(toString_2)) { + var result = toString_2.call(O); + if (!IsObject(result)) + return result; + } + } + throw new TypeError(); + } + // 7.1.2 ToBoolean(argument) + // https://tc39.github.io/ecma262/2016/#sec-toboolean + function ToBoolean(argument) { + return !!argument; + } + // 7.1.12 ToString(argument) + // https://tc39.github.io/ecma262/#sec-tostring + function ToString(argument) { + return "" + argument; + } + // 7.1.14 ToPropertyKey(argument) + // https://tc39.github.io/ecma262/#sec-topropertykey + function ToPropertyKey(argument) { + var key = ToPrimitive(argument, 3 /* String */); + if (IsSymbol(key)) + return key; + return ToString(key); + } + // 7.2 Testing and Comparison Operations + // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations + // 7.2.2 IsArray(argument) + // https://tc39.github.io/ecma262/#sec-isarray + function IsArray(argument) { + return Array.isArray + ? Array.isArray(argument) + : argument instanceof Object + ? argument instanceof Array + : Object.prototype.toString.call(argument) === "[object Array]"; + } + // 7.2.3 IsCallable(argument) + // https://tc39.github.io/ecma262/#sec-iscallable + function IsCallable(argument) { + // NOTE: This is an approximation as we cannot check for [[Call]] internal method. + return typeof argument === "function"; + } + // 7.2.4 IsConstructor(argument) + // https://tc39.github.io/ecma262/#sec-isconstructor + function IsConstructor(argument) { + // NOTE: This is an approximation as we cannot check for [[Construct]] internal method. + return typeof argument === "function"; + } + // 7.2.7 IsPropertyKey(argument) + // https://tc39.github.io/ecma262/#sec-ispropertykey + function IsPropertyKey(argument) { + switch (Type(argument)) { + case 3 /* String */: return true; + case 4 /* Symbol */: return true; + default: return false; + } + } + // 7.3 Operations on Objects + // https://tc39.github.io/ecma262/#sec-operations-on-objects + // 7.3.9 GetMethod(V, P) + // https://tc39.github.io/ecma262/#sec-getmethod + function GetMethod(V, P) { + var func = V[P]; + if (func === undefined || func === null) + return undefined; + if (!IsCallable(func)) + throw new TypeError(); + return func; + } + // 7.4 Operations on Iterator Objects + // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects + function GetIterator(obj) { + var method = GetMethod(obj, iteratorSymbol); + if (!IsCallable(method)) + throw new TypeError(); // from Call + var iterator = method.call(obj); + if (!IsObject(iterator)) + throw new TypeError(); + return iterator; + } + // 7.4.4 IteratorValue(iterResult) + // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue + function IteratorValue(iterResult) { + return iterResult.value; + } + // 7.4.5 IteratorStep(iterator) + // https://tc39.github.io/ecma262/#sec-iteratorstep + function IteratorStep(iterator) { + var result = iterator.next(); + return result.done ? false : result; + } + // 7.4.6 IteratorClose(iterator, completion) + // https://tc39.github.io/ecma262/#sec-iteratorclose + function IteratorClose(iterator) { + var f = iterator["return"]; + if (f) + f.call(iterator); + } + // 9.1 Ordinary Object Internal Methods and Internal Slots + // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots + // 9.1.1.1 OrdinaryGetPrototypeOf(O) + // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof + function OrdinaryGetPrototypeOf(O) { + var proto = Object.getPrototypeOf(O); + if (typeof O !== "function" || O === functionPrototype) + return proto; + // TypeScript doesn't set __proto__ in ES5, as it's non-standard. + // Try to determine the superclass constructor. Compatible implementations + // must either set __proto__ on a subclass constructor to the superclass constructor, + // or ensure each class has a valid `constructor` property on its prototype that + // points back to the constructor. + // If this is not the same as Function.[[Prototype]], then this is definately inherited. + // This is the case when in ES6 or when using __proto__ in a compatible browser. + if (proto !== functionPrototype) + return proto; + // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage. + var prototype = O.prototype; + var prototypeProto = prototype && Object.getPrototypeOf(prototype); + if (prototypeProto == null || prototypeProto === Object.prototype) + return proto; + // If the constructor was not a function, then we cannot determine the heritage. + var constructor = prototypeProto.constructor; + if (typeof constructor !== "function") + return proto; + // If we have some kind of self-reference, then we cannot determine the heritage. + if (constructor === O) + return proto; + // we have a pretty good guess at the heritage. + return constructor; + } + // naive Map shim + function CreateMapPolyfill() { + var cacheSentinel = {}; + var arraySentinel = []; + var MapIterator = /** @class */ (function () { + function MapIterator(keys, values, selector) { + this._index = 0; + this._keys = keys; + this._values = values; + this._selector = selector; + } + MapIterator.prototype["@@iterator"] = function () { return this; }; + MapIterator.prototype[iteratorSymbol] = function () { return this; }; + MapIterator.prototype.next = function () { + var index = this._index; + if (index >= 0 && index < this._keys.length) { + var result = this._selector(this._keys[index], this._values[index]); + if (index + 1 >= this._keys.length) { + this._index = -1; + this._keys = arraySentinel; + this._values = arraySentinel; + } + else { + this._index++; + } + return { value: result, done: false }; + } + return { value: undefined, done: true }; + }; + MapIterator.prototype.throw = function (error) { + if (this._index >= 0) { + this._index = -1; + this._keys = arraySentinel; + this._values = arraySentinel; + } + throw error; + }; + MapIterator.prototype.return = function (value) { + if (this._index >= 0) { + this._index = -1; + this._keys = arraySentinel; + this._values = arraySentinel; + } + return { value: value, done: true }; + }; + return MapIterator; + }()); + return /** @class */ (function () { + function Map() { + this._keys = []; + this._values = []; + this._cacheKey = cacheSentinel; + this._cacheIndex = -2; + } + Object.defineProperty(Map.prototype, "size", { + get: function () { return this._keys.length; }, + enumerable: true, + configurable: true + }); + Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; }; + Map.prototype.get = function (key) { + var index = this._find(key, /*insert*/ false); + return index >= 0 ? this._values[index] : undefined; + }; + Map.prototype.set = function (key, value) { + var index = this._find(key, /*insert*/ true); + this._values[index] = value; + return this; + }; + Map.prototype.delete = function (key) { + var index = this._find(key, /*insert*/ false); + if (index >= 0) { + var size = this._keys.length; + for (var i = index + 1; i < size; i++) { + this._keys[i - 1] = this._keys[i]; + this._values[i - 1] = this._values[i]; + } + this._keys.length--; + this._values.length--; + if (key === this._cacheKey) { + this._cacheKey = cacheSentinel; + this._cacheIndex = -2; + } + return true; + } + return false; + }; + Map.prototype.clear = function () { + this._keys.length = 0; + this._values.length = 0; + this._cacheKey = cacheSentinel; + this._cacheIndex = -2; + }; + Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); }; + Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); }; + Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); }; + Map.prototype["@@iterator"] = function () { return this.entries(); }; + Map.prototype[iteratorSymbol] = function () { return this.entries(); }; + Map.prototype._find = function (key, insert) { + if (this._cacheKey !== key) { + this._cacheIndex = this._keys.indexOf(this._cacheKey = key); + } + if (this._cacheIndex < 0 && insert) { + this._cacheIndex = this._keys.length; + this._keys.push(key); + this._values.push(undefined); + } + return this._cacheIndex; + }; + return Map; + }()); + function getKey(key, _) { + return key; + } + function getValue(_, value) { + return value; + } + function getEntry(key, value) { + return [key, value]; + } + } + // naive Set shim + function CreateSetPolyfill() { + return /** @class */ (function () { + function Set() { + this._map = new _Map(); + } + Object.defineProperty(Set.prototype, "size", { + get: function () { return this._map.size; }, + enumerable: true, + configurable: true + }); + Set.prototype.has = function (value) { return this._map.has(value); }; + Set.prototype.add = function (value) { return this._map.set(value, value), this; }; + Set.prototype.delete = function (value) { return this._map.delete(value); }; + Set.prototype.clear = function () { this._map.clear(); }; + Set.prototype.keys = function () { return this._map.keys(); }; + Set.prototype.values = function () { return this._map.values(); }; + Set.prototype.entries = function () { return this._map.entries(); }; + Set.prototype["@@iterator"] = function () { return this.keys(); }; + Set.prototype[iteratorSymbol] = function () { return this.keys(); }; + return Set; + }()); + } + // naive WeakMap shim + function CreateWeakMapPolyfill() { + var UUID_SIZE = 16; + var keys = HashMap.create(); + var rootKey = CreateUniqueKey(); + return /** @class */ (function () { + function WeakMap() { + this._key = CreateUniqueKey(); + } + WeakMap.prototype.has = function (target) { + var table = GetOrCreateWeakMapTable(target, /*create*/ false); + return table !== undefined ? HashMap.has(table, this._key) : false; + }; + WeakMap.prototype.get = function (target) { + var table = GetOrCreateWeakMapTable(target, /*create*/ false); + return table !== undefined ? HashMap.get(table, this._key) : undefined; + }; + WeakMap.prototype.set = function (target, value) { + var table = GetOrCreateWeakMapTable(target, /*create*/ true); + table[this._key] = value; + return this; + }; + WeakMap.prototype.delete = function (target) { + var table = GetOrCreateWeakMapTable(target, /*create*/ false); + return table !== undefined ? delete table[this._key] : false; + }; + WeakMap.prototype.clear = function () { + // NOTE: not a real clear, just makes the previous data unreachable + this._key = CreateUniqueKey(); + }; + return WeakMap; + }()); + function CreateUniqueKey() { + var key; + do + key = "@@WeakMap@@" + CreateUUID(); + while (HashMap.has(keys, key)); + keys[key] = true; + return key; + } + function GetOrCreateWeakMapTable(target, create) { + if (!hasOwn.call(target, rootKey)) { + if (!create) + return undefined; + Object.defineProperty(target, rootKey, { value: HashMap.create() }); + } + return target[rootKey]; + } + function FillRandomBytes(buffer, size) { + for (var i = 0; i < size; ++i) + buffer[i] = Math.random() * 0xff | 0; + return buffer; + } + function GenRandomBytes(size) { + if (typeof Uint8Array === "function") { + if (typeof crypto !== "undefined") + return crypto.getRandomValues(new Uint8Array(size)); + if (typeof msCrypto !== "undefined") + return msCrypto.getRandomValues(new Uint8Array(size)); + return FillRandomBytes(new Uint8Array(size), size); + } + return FillRandomBytes(new Array(size), size); + } + function CreateUUID() { + var data = GenRandomBytes(UUID_SIZE); + // mark as random - RFC 4122 § 4.4 + data[6] = data[6] & 0x4f | 0x40; + data[8] = data[8] & 0xbf | 0x80; + var result = ""; + for (var offset = 0; offset < UUID_SIZE; ++offset) { + var byte = data[offset]; + if (offset === 4 || offset === 6 || offset === 8) + result += "-"; + if (byte < 16) + result += "0"; + result += byte.toString(16).toLowerCase(); + } + return result; + } + } + // uses a heuristic used by v8 and chakra to force an object into dictionary mode. + function MakeDictionary(obj) { + obj.__ = undefined; + delete obj.__; + return obj; + } + }); +})(Reflect || (Reflect = {})); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/requires-port/index.js": +/*!*********************************************!*\ + !*** ./node_modules/requires-port/index.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Check if we're required to add a port number. + * + * @see https://url.spec.whatwg.org/#default-port + * @param {Number|String} port Port number we need to check + * @param {String} protocol Protocol we need to check against. + * @returns {Boolean} Is it a default port for the given protocol + * @api private + */ +module.exports = function required(port, protocol) { + protocol = protocol.split(':')[0]; + port = +port; + + if (!port) return false; + + switch (protocol) { + case 'http': + case 'ws': + return port !== 80; + + case 'https': + case 'wss': + return port !== 443; + + case 'ftp': + return port !== 21; + + case 'gopher': + return port !== 70; + + case 'file': + return false; + } + + return port !== 0; +}; + + +/***/ }), + +/***/ "./node_modules/snabbdom-jsx/snabbdom-jsx.js": +/*!***************************************************!*\ + !*** ./node_modules/snabbdom-jsx/snabbdom-jsx.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var SVGNS = 'http://www.w3.org/2000/svg'; +var modulesNS = ['hook', 'on', 'style', 'class', 'props', 'attrs', 'dataset']; +var slice = Array.prototype.slice; + +function isPrimitive(val) { + return typeof val === 'string' || + typeof val === 'number' || + typeof val === 'boolean' || + typeof val === 'symbol' || + val === null || + val === undefined; +} + +function normalizeAttrs(attrs, nsURI, defNS, modules) { + var map = { ns: nsURI }; + for (var i = 0, len = modules.length; i < len; i++) { + var mod = modules[i]; + if(attrs[mod]) + map[mod] = attrs[mod]; + } + for(var key in attrs) { + if(key !== 'key' && key !== 'classNames' && key !== 'selector') { + var idx = key.indexOf('-'); + if(idx > 0) + addAttr(key.slice(0, idx), key.slice(idx+1), attrs[key]); + else if(!map[key]) + addAttr(defNS, key, attrs[key]); + } + } + return map; + + function addAttr(namespace, key, val) { + var ns = map[namespace] || (map[namespace] = {}); + ns[key] = val; + } +} + +function buildFromStringTag(nsURI, defNS, modules, tag, attrs, children) { + + if(attrs.selector) { + tag = tag + attrs.selector; + } + if(attrs.classNames) { + var cns = attrs.classNames; + tag = tag + '.' + ( + Array.isArray(cns) ? cns.join('.') : cns.replace(/\s+/g, '.') + ); + } + + return { + sel : tag, + data : normalizeAttrs(attrs, nsURI, defNS, modules), + children : children.map( function(c) { + return isPrimitive(c) ? {text: c} : c; + }), + key: attrs.key + }; +} + +function buildFromComponent(nsURI, defNS, modules, tag, attrs, children) { + var res; + if(typeof tag === 'function') + res = tag(attrs, children); + else if(tag && typeof tag.view === 'function') + res = tag.view(attrs, children); + else if(tag && typeof tag.render === 'function') + res = tag.render(attrs, children); + else + throw "JSX tag must be either a string, a function or an object with 'view' or 'render' methods"; + res.key = attrs.key; + return res; +} + +function flatten(nested, start, flat) { + for (var i = start, len = nested.length; i < len; i++) { + var item = nested[i]; + if (Array.isArray(item)) { + flatten(item, 0, flat); + } else { + flat.push(item); + } + } +} + +function maybeFlatten(array) { + if (array) { + for (var i = 0, len = array.length; i < len; i++) { + if (Array.isArray(array[i])) { + var flat = array.slice(0, i); + flatten(array, i, flat); + array = flat; + break; + } + } + } + return array; +} + +function buildVnode(nsURI, defNS, modules, tag, attrs, children) { + attrs = attrs || {}; + children = maybeFlatten(children); + if(typeof tag === 'string') { + return buildFromStringTag(nsURI, defNS, modules, tag, attrs, children) + } else { + return buildFromComponent(nsURI, defNS, modules, tag, attrs, children) + } +} + +function JSX(nsURI, defNS, modules) { + return function jsxWithCustomNS(tag, attrs, children) { + if(arguments.length > 3 || !Array.isArray(children)) + children = slice.call(arguments, 2); + return buildVnode(nsURI, defNS || 'props', modules || modulesNS, tag, attrs, children); + }; +} + +module.exports = { + html: JSX(undefined), + svg: JSX(SVGNS, 'attrs'), + JSX: JSX +}; + + +/***/ }), + +/***/ "./node_modules/snabbdom-virtualize/lib/strings.js": +/*!*********************************************************!*\ + !*** ./node_modules/snabbdom-virtualize/lib/strings.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (html) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + + var context = options.context || document; + + // If there's nothing here, return null; + if (!html) { + return null; + } + + // Maintain a list of created vnodes so we can call the create hook. + var createdVNodes = []; + + // Parse the string into the AST and convert to VNodes. + var vnodes = convertNodes((0, _parse2.default)(html), createdVNodes, context); + + var res = void 0; + if (!vnodes) { + // If there are no vnodes but there is string content, then the string + // must be just text or at least invalid HTML that we should treat as + // text (since the AST parser didn't find any well-formed HTML). + res = toVNode({ type: 'text', content: html }, createdVNodes, context); + } else if (vnodes.length === 1) { + // If there's only one root node, just return it as opposed to an array. + res = vnodes[0]; + } else { + // Otherwise we have an array of VNodes, which we should return. + res = vnodes; + } + + // Call the 'create' hook for each created node. + options.hooks && options.hooks.create && createdVNodes.forEach(function (node) { + options.hooks.create(node); + }); + return res; +}; + +var _parse = __webpack_require__(/*! html-parse-stringify2/lib/parse */ "./node_modules/html-parse-stringify2/lib/parse.js"); + +var _parse2 = _interopRequireDefault(_parse); + +var _h = __webpack_require__(/*! snabbdom/h */ "./node_modules/snabbdom/h.js"); + +var _h2 = _interopRequireDefault(_h); + +var _utils = __webpack_require__(/*! ./utils */ "./node_modules/snabbdom-virtualize/lib/utils.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function convertNodes(nodes, createdVNodes, context) { + if (nodes instanceof Array && nodes.length > 0) { + return nodes.map(function (node) { + return toVNode(node, createdVNodes, context); + }); + } else { + return undefined; + } +} + +function toVNode(node, createdVNodes, context) { + var newNode = void 0; + if (node.type === 'text') { + newNode = (0, _utils.createTextVNode)(node.content, context); + } else { + newNode = (0, _h2.default)(node.name, buildVNodeData(node, context), convertNodes(node.children, createdVNodes, context)); + } + createdVNodes.push(newNode); + return newNode; +} + +function buildVNodeData(node, context) { + var data = {}; + if (!node.attrs) { + return data; + } + + var attrs = Object.keys(node.attrs).reduce(function (memo, name) { + if (name !== 'style' && name !== 'class') { + var val = (0, _utils.unescapeEntities)(node.attrs[name], context); + memo ? memo[name] = val : memo = _defineProperty({}, name, val); + } + return memo; + }, null); + if (attrs) { + data.attrs = attrs; + } + + var style = parseStyle(node); + if (style) { + data.style = style; + } + + var classes = parseClass(node); + if (classes) { + data.class = classes; + } + + return data; +} + +function parseStyle(node) { + try { + return node.attrs.style.split(';').reduce(function (memo, styleProp) { + var res = styleProp.split(':'); + var name = (0, _utils.transformName)(res[0].trim()); + if (name) { + var val = res[1].replace('!important', '').trim(); + memo ? memo[name] = val : memo = _defineProperty({}, name, val); + } + return memo; + }, null); + } catch (e) { + return null; + } +} + +function parseClass(node) { + try { + return node.attrs.class.split(' ').reduce(function (memo, className) { + className = className.trim(); + if (className) { + memo ? memo[className] = true : memo = _defineProperty({}, className, true); + } + return memo; + }, null); + } catch (e) { + return null; + } +} + +/***/ }), + +/***/ "./node_modules/snabbdom-virtualize/lib/utils.js": +/*!*******************************************************!*\ + !*** ./node_modules/snabbdom-virtualize/lib/utils.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createTextVNode = createTextVNode; +exports.transformName = transformName; +exports.unescapeEntities = unescapeEntities; + +var _vnode = __webpack_require__(/*! snabbdom/vnode */ "./node_modules/snabbdom/vnode.js"); + +var _vnode2 = _interopRequireDefault(_vnode); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function createTextVNode(text, context) { + return (0, _vnode2.default)(undefined, undefined, undefined, unescapeEntities(text, context)); +} + +function transformName(name) { + // Replace -a with A to help camel case style property names. + name = name.replace(/-(\w)/g, function _replace($1, $2) { + return $2.toUpperCase(); + }); + // Handle properties that start with a -. + var firstChar = name.charAt(0).toLowerCase(); + return '' + firstChar + name.substring(1); +} + +// Regex for matching HTML entities. +var entityRegex = new RegExp('&[a-z0-9#]+;', 'gi'); +// Element for setting innerHTML for transforming entities. +var el = null; + +function unescapeEntities(text, context) { + // Create the element using the context if it doesn't exist. + if (!el) { + el = context.createElement('div'); + } + return text.replace(entityRegex, function (entity) { + el.innerHTML = entity; + return el.textContent; + }); +} + +/***/ }), + +/***/ "./node_modules/snabbdom-virtualize/strings.js": +/*!*****************************************************!*\ + !*** ./node_modules/snabbdom-virtualize/strings.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./lib/strings */ "./node_modules/snabbdom-virtualize/lib/strings.js"); + + +/***/ }), + +/***/ "./node_modules/snabbdom/es/h.js": +/*!***************************************!*\ + !*** ./node_modules/snabbdom/es/h.js ***! + \***************************************/ +/*! exports provided: h, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return h; }); +/* harmony import */ var _vnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vnode */ "./node_modules/snabbdom/es/vnode.js"); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is */ "./node_modules/snabbdom/es/is.js"); + + +function addNS(data, children, sel) { + data.ns = 'http://www.w3.org/2000/svg'; + if (sel !== 'foreignObject' && children !== undefined) { + for (var i = 0; i < children.length; ++i) { + var childData = children[i].data; + if (childData !== undefined) { + addNS(childData, children[i].children, children[i].sel); + } + } + } +} +function h(sel, b, c) { + var data = {}, children, text, i; + if (c !== undefined) { + data = b; + if (_is__WEBPACK_IMPORTED_MODULE_1__["array"](c)) { + children = c; + } + else if (_is__WEBPACK_IMPORTED_MODULE_1__["primitive"](c)) { + text = c; + } + else if (c && c.sel) { + children = [c]; + } + } + else if (b !== undefined) { + if (_is__WEBPACK_IMPORTED_MODULE_1__["array"](b)) { + children = b; + } + else if (_is__WEBPACK_IMPORTED_MODULE_1__["primitive"](b)) { + text = b; + } + else if (b && b.sel) { + children = [b]; + } + else { + data = b; + } + } + if (children !== undefined) { + for (i = 0; i < children.length; ++i) { + if (_is__WEBPACK_IMPORTED_MODULE_1__["primitive"](children[i])) + children[i] = Object(_vnode__WEBPACK_IMPORTED_MODULE_0__["vnode"])(undefined, undefined, undefined, children[i], undefined); + } + } + if (sel[0] === 's' && sel[1] === 'v' && sel[2] === 'g' && + (sel.length === 3 || sel[3] === '.' || sel[3] === '#')) { + addNS(data, children, sel); + } + return Object(_vnode__WEBPACK_IMPORTED_MODULE_0__["vnode"])(sel, data, children, text, undefined); +} +; +/* harmony default export */ __webpack_exports__["default"] = (h); +//# sourceMappingURL=h.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/es/htmldomapi.js": +/*!************************************************!*\ + !*** ./node_modules/snabbdom/es/htmldomapi.js ***! + \************************************************/ +/*! exports provided: htmlDomApi, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "htmlDomApi", function() { return htmlDomApi; }); +function createElement(tagName) { + return document.createElement(tagName); +} +function createElementNS(namespaceURI, qualifiedName) { + return document.createElementNS(namespaceURI, qualifiedName); +} +function createTextNode(text) { + return document.createTextNode(text); +} +function createComment(text) { + return document.createComment(text); +} +function insertBefore(parentNode, newNode, referenceNode) { + parentNode.insertBefore(newNode, referenceNode); +} +function removeChild(node, child) { + node.removeChild(child); +} +function appendChild(node, child) { + node.appendChild(child); +} +function parentNode(node) { + return node.parentNode; +} +function nextSibling(node) { + return node.nextSibling; +} +function tagName(elm) { + return elm.tagName; +} +function setTextContent(node, text) { + node.textContent = text; +} +function getTextContent(node) { + return node.textContent; +} +function isElement(node) { + return node.nodeType === 1; +} +function isText(node) { + return node.nodeType === 3; +} +function isComment(node) { + return node.nodeType === 8; +} +var htmlDomApi = { + createElement: createElement, + createElementNS: createElementNS, + createTextNode: createTextNode, + createComment: createComment, + insertBefore: insertBefore, + removeChild: removeChild, + appendChild: appendChild, + parentNode: parentNode, + nextSibling: nextSibling, + tagName: tagName, + setTextContent: setTextContent, + getTextContent: getTextContent, + isElement: isElement, + isText: isText, + isComment: isComment, +}; +/* harmony default export */ __webpack_exports__["default"] = (htmlDomApi); +//# sourceMappingURL=htmldomapi.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/es/is.js": +/*!****************************************!*\ + !*** ./node_modules/snabbdom/es/is.js ***! + \****************************************/ +/*! exports provided: array, primitive */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "array", function() { return array; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "primitive", function() { return primitive; }); +var array = Array.isArray; +function primitive(s) { + return typeof s === 'string' || typeof s === 'number'; +} +//# sourceMappingURL=is.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/es/snabbdom.js": +/*!**********************************************!*\ + !*** ./node_modules/snabbdom/es/snabbdom.js ***! + \**********************************************/ +/*! exports provided: h, thunk, init */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "init", function() { return init; }); +/* harmony import */ var _vnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vnode */ "./node_modules/snabbdom/es/vnode.js"); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is */ "./node_modules/snabbdom/es/is.js"); +/* harmony import */ var _htmldomapi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./htmldomapi */ "./node_modules/snabbdom/es/htmldomapi.js"); +/* harmony import */ var _h__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./h */ "./node_modules/snabbdom/es/h.js"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "h", function() { return _h__WEBPACK_IMPORTED_MODULE_3__["h"]; }); + +/* harmony import */ var _thunk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./thunk */ "./node_modules/snabbdom/es/thunk.js"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thunk", function() { return _thunk__WEBPACK_IMPORTED_MODULE_4__["thunk"]; }); + + + + +function isUndef(s) { return s === undefined; } +function isDef(s) { return s !== undefined; } +var emptyNode = Object(_vnode__WEBPACK_IMPORTED_MODULE_0__["default"])('', {}, [], undefined, undefined); +function sameVnode(vnode1, vnode2) { + return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel; +} +function isVnode(vnode) { + return vnode.sel !== undefined; +} +function createKeyToOldIdx(children, beginIdx, endIdx) { + var i, map = {}, key, ch; + for (i = beginIdx; i <= endIdx; ++i) { + ch = children[i]; + if (ch != null) { + key = ch.key; + if (key !== undefined) + map[key] = i; + } + } + return map; +} +var hooks = ['create', 'update', 'remove', 'destroy', 'pre', 'post']; + + +function init(modules, domApi) { + var i, j, cbs = {}; + var api = domApi !== undefined ? domApi : _htmldomapi__WEBPACK_IMPORTED_MODULE_2__["default"]; + for (i = 0; i < hooks.length; ++i) { + cbs[hooks[i]] = []; + for (j = 0; j < modules.length; ++j) { + var hook = modules[j][hooks[i]]; + if (hook !== undefined) { + cbs[hooks[i]].push(hook); + } + } + } + function emptyNodeAt(elm) { + var id = elm.id ? '#' + elm.id : ''; + var c = elm.className ? '.' + elm.className.split(' ').join('.') : ''; + return Object(_vnode__WEBPACK_IMPORTED_MODULE_0__["default"])(api.tagName(elm).toLowerCase() + id + c, {}, [], undefined, elm); + } + function createRmCb(childElm, listeners) { + return function rmCb() { + if (--listeners === 0) { + var parent_1 = api.parentNode(childElm); + api.removeChild(parent_1, childElm); + } + }; + } + function createElm(vnode, insertedVnodeQueue) { + var i, data = vnode.data; + if (data !== undefined) { + if (isDef(i = data.hook) && isDef(i = i.init)) { + i(vnode); + data = vnode.data; + } + } + var children = vnode.children, sel = vnode.sel; + if (sel === '!') { + if (isUndef(vnode.text)) { + vnode.text = ''; + } + vnode.elm = api.createComment(vnode.text); + } + else if (sel !== undefined) { + // Parse selector + var hashIdx = sel.indexOf('#'); + var dotIdx = sel.indexOf('.', hashIdx); + var hash = hashIdx > 0 ? hashIdx : sel.length; + var dot = dotIdx > 0 ? dotIdx : sel.length; + var tag = hashIdx !== -1 || dotIdx !== -1 ? sel.slice(0, Math.min(hash, dot)) : sel; + var elm = vnode.elm = isDef(data) && isDef(i = data.ns) ? api.createElementNS(i, tag) + : api.createElement(tag); + if (hash < dot) + elm.setAttribute('id', sel.slice(hash + 1, dot)); + if (dotIdx > 0) + elm.setAttribute('class', sel.slice(dot + 1).replace(/\./g, ' ')); + for (i = 0; i < cbs.create.length; ++i) + cbs.create[i](emptyNode, vnode); + if (_is__WEBPACK_IMPORTED_MODULE_1__["array"](children)) { + for (i = 0; i < children.length; ++i) { + var ch = children[i]; + if (ch != null) { + api.appendChild(elm, createElm(ch, insertedVnodeQueue)); + } + } + } + else if (_is__WEBPACK_IMPORTED_MODULE_1__["primitive"](vnode.text)) { + api.appendChild(elm, api.createTextNode(vnode.text)); + } + i = vnode.data.hook; // Reuse variable + if (isDef(i)) { + if (i.create) + i.create(emptyNode, vnode); + if (i.insert) + insertedVnodeQueue.push(vnode); + } + } + else { + vnode.elm = api.createTextNode(vnode.text); + } + return vnode.elm; + } + function addVnodes(parentElm, before, vnodes, startIdx, endIdx, insertedVnodeQueue) { + for (; startIdx <= endIdx; ++startIdx) { + var ch = vnodes[startIdx]; + if (ch != null) { + api.insertBefore(parentElm, createElm(ch, insertedVnodeQueue), before); + } + } + } + function invokeDestroyHook(vnode) { + var i, j, data = vnode.data; + if (data !== undefined) { + if (isDef(i = data.hook) && isDef(i = i.destroy)) + i(vnode); + for (i = 0; i < cbs.destroy.length; ++i) + cbs.destroy[i](vnode); + if (vnode.children !== undefined) { + for (j = 0; j < vnode.children.length; ++j) { + i = vnode.children[j]; + if (i != null && typeof i !== "string") { + invokeDestroyHook(i); + } + } + } + } + } + function removeVnodes(parentElm, vnodes, startIdx, endIdx) { + for (; startIdx <= endIdx; ++startIdx) { + var i_1 = void 0, listeners = void 0, rm = void 0, ch = vnodes[startIdx]; + if (ch != null) { + if (isDef(ch.sel)) { + invokeDestroyHook(ch); + listeners = cbs.remove.length + 1; + rm = createRmCb(ch.elm, listeners); + for (i_1 = 0; i_1 < cbs.remove.length; ++i_1) + cbs.remove[i_1](ch, rm); + if (isDef(i_1 = ch.data) && isDef(i_1 = i_1.hook) && isDef(i_1 = i_1.remove)) { + i_1(ch, rm); + } + else { + rm(); + } + } + else { + api.removeChild(parentElm, ch.elm); + } + } + } + } + function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue) { + var oldStartIdx = 0, newStartIdx = 0; + var oldEndIdx = oldCh.length - 1; + var oldStartVnode = oldCh[0]; + var oldEndVnode = oldCh[oldEndIdx]; + var newEndIdx = newCh.length - 1; + var newStartVnode = newCh[0]; + var newEndVnode = newCh[newEndIdx]; + var oldKeyToIdx; + var idxInOld; + var elmToMove; + var before; + while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { + if (oldStartVnode == null) { + oldStartVnode = oldCh[++oldStartIdx]; // Vnode might have been moved left + } + else if (oldEndVnode == null) { + oldEndVnode = oldCh[--oldEndIdx]; + } + else if (newStartVnode == null) { + newStartVnode = newCh[++newStartIdx]; + } + else if (newEndVnode == null) { + newEndVnode = newCh[--newEndIdx]; + } + else if (sameVnode(oldStartVnode, newStartVnode)) { + patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue); + oldStartVnode = oldCh[++oldStartIdx]; + newStartVnode = newCh[++newStartIdx]; + } + else if (sameVnode(oldEndVnode, newEndVnode)) { + patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue); + oldEndVnode = oldCh[--oldEndIdx]; + newEndVnode = newCh[--newEndIdx]; + } + else if (sameVnode(oldStartVnode, newEndVnode)) { + patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue); + api.insertBefore(parentElm, oldStartVnode.elm, api.nextSibling(oldEndVnode.elm)); + oldStartVnode = oldCh[++oldStartIdx]; + newEndVnode = newCh[--newEndIdx]; + } + else if (sameVnode(oldEndVnode, newStartVnode)) { + patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue); + api.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); + oldEndVnode = oldCh[--oldEndIdx]; + newStartVnode = newCh[++newStartIdx]; + } + else { + if (oldKeyToIdx === undefined) { + oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); + } + idxInOld = oldKeyToIdx[newStartVnode.key]; + if (isUndef(idxInOld)) { + api.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm); + newStartVnode = newCh[++newStartIdx]; + } + else { + elmToMove = oldCh[idxInOld]; + if (elmToMove.sel !== newStartVnode.sel) { + api.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm); + } + else { + patchVnode(elmToMove, newStartVnode, insertedVnodeQueue); + oldCh[idxInOld] = undefined; + api.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm); + } + newStartVnode = newCh[++newStartIdx]; + } + } + } + if (oldStartIdx <= oldEndIdx || newStartIdx <= newEndIdx) { + if (oldStartIdx > oldEndIdx) { + before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm; + addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); + } + else { + removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); + } + } + } + function patchVnode(oldVnode, vnode, insertedVnodeQueue) { + var i, hook; + if (isDef(i = vnode.data) && isDef(hook = i.hook) && isDef(i = hook.prepatch)) { + i(oldVnode, vnode); + } + var elm = vnode.elm = oldVnode.elm; + var oldCh = oldVnode.children; + var ch = vnode.children; + if (oldVnode === vnode) + return; + if (vnode.data !== undefined) { + for (i = 0; i < cbs.update.length; ++i) + cbs.update[i](oldVnode, vnode); + i = vnode.data.hook; + if (isDef(i) && isDef(i = i.update)) + i(oldVnode, vnode); + } + if (isUndef(vnode.text)) { + if (isDef(oldCh) && isDef(ch)) { + if (oldCh !== ch) + updateChildren(elm, oldCh, ch, insertedVnodeQueue); + } + else if (isDef(ch)) { + if (isDef(oldVnode.text)) + api.setTextContent(elm, ''); + addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); + } + else if (isDef(oldCh)) { + removeVnodes(elm, oldCh, 0, oldCh.length - 1); + } + else if (isDef(oldVnode.text)) { + api.setTextContent(elm, ''); + } + } + else if (oldVnode.text !== vnode.text) { + if (isDef(oldCh)) { + removeVnodes(elm, oldCh, 0, oldCh.length - 1); + } + api.setTextContent(elm, vnode.text); + } + if (isDef(hook) && isDef(i = hook.postpatch)) { + i(oldVnode, vnode); + } + } + return function patch(oldVnode, vnode) { + var i, elm, parent; + var insertedVnodeQueue = []; + for (i = 0; i < cbs.pre.length; ++i) + cbs.pre[i](); + if (!isVnode(oldVnode)) { + oldVnode = emptyNodeAt(oldVnode); + } + if (sameVnode(oldVnode, vnode)) { + patchVnode(oldVnode, vnode, insertedVnodeQueue); + } + else { + elm = oldVnode.elm; + parent = api.parentNode(elm); + createElm(vnode, insertedVnodeQueue); + if (parent !== null) { + api.insertBefore(parent, vnode.elm, api.nextSibling(elm)); + removeVnodes(parent, [oldVnode], 0, 0); + } + } + for (i = 0; i < insertedVnodeQueue.length; ++i) { + insertedVnodeQueue[i].data.hook.insert(insertedVnodeQueue[i]); + } + for (i = 0; i < cbs.post.length; ++i) + cbs.post[i](); + return vnode; + }; +} +//# sourceMappingURL=snabbdom.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/es/thunk.js": +/*!*******************************************!*\ + !*** ./node_modules/snabbdom/es/thunk.js ***! + \*******************************************/ +/*! exports provided: thunk, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "thunk", function() { return thunk; }); +/* harmony import */ var _h__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./h */ "./node_modules/snabbdom/es/h.js"); + +function copyToThunk(vnode, thunk) { + thunk.elm = vnode.elm; + vnode.data.fn = thunk.data.fn; + vnode.data.args = thunk.data.args; + thunk.data = vnode.data; + thunk.children = vnode.children; + thunk.text = vnode.text; + thunk.elm = vnode.elm; +} +function init(thunk) { + var cur = thunk.data; + var vnode = cur.fn.apply(undefined, cur.args); + copyToThunk(vnode, thunk); +} +function prepatch(oldVnode, thunk) { + var i, old = oldVnode.data, cur = thunk.data; + var oldArgs = old.args, args = cur.args; + if (old.fn !== cur.fn || oldArgs.length !== args.length) { + copyToThunk(cur.fn.apply(undefined, args), thunk); + return; + } + for (i = 0; i < args.length; ++i) { + if (oldArgs[i] !== args[i]) { + copyToThunk(cur.fn.apply(undefined, args), thunk); + return; + } + } + copyToThunk(oldVnode, thunk); +} +var thunk = function thunk(sel, key, fn, args) { + if (args === undefined) { + args = fn; + fn = key; + key = undefined; + } + return Object(_h__WEBPACK_IMPORTED_MODULE_0__["h"])(sel, { + key: key, + hook: { init: init, prepatch: prepatch }, + fn: fn, + args: args + }); +}; +/* harmony default export */ __webpack_exports__["default"] = (thunk); +//# sourceMappingURL=thunk.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/es/vnode.js": +/*!*******************************************!*\ + !*** ./node_modules/snabbdom/es/vnode.js ***! + \*******************************************/ +/*! exports provided: vnode, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vnode", function() { return vnode; }); +function vnode(sel, data, children, text, elm) { + var key = data === undefined ? undefined : data.key; + return { sel: sel, data: data, children: children, + text: text, elm: elm, key: key }; +} +/* harmony default export */ __webpack_exports__["default"] = (vnode); +//# sourceMappingURL=vnode.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/h.js": +/*!************************************!*\ + !*** ./node_modules/snabbdom/h.js ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var vnode_1 = __webpack_require__(/*! ./vnode */ "./node_modules/snabbdom/vnode.js"); +var is = __webpack_require__(/*! ./is */ "./node_modules/snabbdom/is.js"); +function addNS(data, children, sel) { + data.ns = 'http://www.w3.org/2000/svg'; + if (sel !== 'foreignObject' && children !== undefined) { + for (var i = 0; i < children.length; ++i) { + var childData = children[i].data; + if (childData !== undefined) { + addNS(childData, children[i].children, children[i].sel); + } + } + } +} +function h(sel, b, c) { + var data = {}, children, text, i; + if (c !== undefined) { + data = b; + if (is.array(c)) { + children = c; + } + else if (is.primitive(c)) { + text = c; + } + else if (c && c.sel) { + children = [c]; + } + } + else if (b !== undefined) { + if (is.array(b)) { + children = b; + } + else if (is.primitive(b)) { + text = b; + } + else if (b && b.sel) { + children = [b]; + } + else { + data = b; + } + } + if (children !== undefined) { + for (i = 0; i < children.length; ++i) { + if (is.primitive(children[i])) + children[i] = vnode_1.vnode(undefined, undefined, undefined, children[i], undefined); + } + } + if (sel[0] === 's' && sel[1] === 'v' && sel[2] === 'g' && + (sel.length === 3 || sel[3] === '.' || sel[3] === '#')) { + addNS(data, children, sel); + } + return vnode_1.vnode(sel, data, children, text, undefined); +} +exports.h = h; +; +exports.default = h; +//# sourceMappingURL=h.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/is.js": +/*!*************************************!*\ + !*** ./node_modules/snabbdom/is.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.array = Array.isArray; +function primitive(s) { + return typeof s === 'string' || typeof s === 'number'; +} +exports.primitive = primitive; +//# sourceMappingURL=is.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/modules/attributes.js": +/*!*****************************************************!*\ + !*** ./node_modules/snabbdom/modules/attributes.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var xlinkNS = 'http://www.w3.org/1999/xlink'; +var xmlNS = 'http://www.w3.org/XML/1998/namespace'; +var colonChar = 58; +var xChar = 120; +function updateAttrs(oldVnode, vnode) { + var key, elm = vnode.elm, oldAttrs = oldVnode.data.attrs, attrs = vnode.data.attrs; + if (!oldAttrs && !attrs) + return; + if (oldAttrs === attrs) + return; + oldAttrs = oldAttrs || {}; + attrs = attrs || {}; + // update modified attributes, add new attributes + for (key in attrs) { + var cur = attrs[key]; + var old = oldAttrs[key]; + if (old !== cur) { + if (cur === true) { + elm.setAttribute(key, ""); + } + else if (cur === false) { + elm.removeAttribute(key); + } + else { + if (key.charCodeAt(0) !== xChar) { + elm.setAttribute(key, cur); + } + else if (key.charCodeAt(3) === colonChar) { + // Assume xml namespace + elm.setAttributeNS(xmlNS, key, cur); + } + else if (key.charCodeAt(5) === colonChar) { + // Assume xlink namespace + elm.setAttributeNS(xlinkNS, key, cur); + } + else { + elm.setAttribute(key, cur); + } + } + } + } + // remove removed attributes + // use `in` operator since the previous `for` iteration uses it (.i.e. add even attributes with undefined value) + // the other option is to remove all attributes with value == undefined + for (key in oldAttrs) { + if (!(key in attrs)) { + elm.removeAttribute(key); + } + } +} +exports.attributesModule = { create: updateAttrs, update: updateAttrs }; +exports.default = exports.attributesModule; +//# sourceMappingURL=attributes.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/modules/class.js": +/*!************************************************!*\ + !*** ./node_modules/snabbdom/modules/class.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function updateClass(oldVnode, vnode) { + var cur, name, elm = vnode.elm, oldClass = oldVnode.data.class, klass = vnode.data.class; + if (!oldClass && !klass) + return; + if (oldClass === klass) + return; + oldClass = oldClass || {}; + klass = klass || {}; + for (name in oldClass) { + if (!klass[name]) { + elm.classList.remove(name); + } + } + for (name in klass) { + cur = klass[name]; + if (cur !== oldClass[name]) { + elm.classList[cur ? 'add' : 'remove'](name); + } + } +} +exports.classModule = { create: updateClass, update: updateClass }; +exports.default = exports.classModule; +//# sourceMappingURL=class.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/modules/eventlisteners.js": +/*!*********************************************************!*\ + !*** ./node_modules/snabbdom/modules/eventlisteners.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function invokeHandler(handler, vnode, event) { + if (typeof handler === "function") { + // call function handler + handler.call(vnode, event, vnode); + } + else if (typeof handler === "object") { + // call handler with arguments + if (typeof handler[0] === "function") { + // special case for single argument for performance + if (handler.length === 2) { + handler[0].call(vnode, handler[1], event, vnode); + } + else { + var args = handler.slice(1); + args.push(event); + args.push(vnode); + handler[0].apply(vnode, args); + } + } + else { + // call multiple handlers + for (var i = 0; i < handler.length; i++) { + invokeHandler(handler[i], vnode, event); + } + } + } +} +function handleEvent(event, vnode) { + var name = event.type, on = vnode.data.on; + // call event handler(s) if exists + if (on && on[name]) { + invokeHandler(on[name], vnode, event); + } +} +function createListener() { + return function handler(event) { + handleEvent(event, handler.vnode); + }; +} +function updateEventListeners(oldVnode, vnode) { + var oldOn = oldVnode.data.on, oldListener = oldVnode.listener, oldElm = oldVnode.elm, on = vnode && vnode.data.on, elm = (vnode && vnode.elm), name; + // optimization for reused immutable handlers + if (oldOn === on) { + return; + } + // remove existing listeners which no longer used + if (oldOn && oldListener) { + // if element changed or deleted we remove all existing listeners unconditionally + if (!on) { + for (name in oldOn) { + // remove listener if element was changed or existing listeners removed + oldElm.removeEventListener(name, oldListener, false); + } + } + else { + for (name in oldOn) { + // remove listener if existing listener removed + if (!on[name]) { + oldElm.removeEventListener(name, oldListener, false); + } + } + } + } + // add new listeners which has not already attached + if (on) { + // reuse existing listener or create new + var listener = vnode.listener = oldVnode.listener || createListener(); + // update vnode for listener + listener.vnode = vnode; + // if element changed or added we add all needed listeners unconditionally + if (!oldOn) { + for (name in on) { + // add listener if element was changed or new listeners added + elm.addEventListener(name, listener, false); + } + } + else { + for (name in on) { + // add listener if new listener added + if (!oldOn[name]) { + elm.addEventListener(name, listener, false); + } + } + } + } +} +exports.eventListenersModule = { + create: updateEventListeners, + update: updateEventListeners, + destroy: updateEventListeners +}; +exports.default = exports.eventListenersModule; +//# sourceMappingURL=eventlisteners.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/modules/props.js": +/*!************************************************!*\ + !*** ./node_modules/snabbdom/modules/props.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function updateProps(oldVnode, vnode) { + var key, cur, old, elm = vnode.elm, oldProps = oldVnode.data.props, props = vnode.data.props; + if (!oldProps && !props) + return; + if (oldProps === props) + return; + oldProps = oldProps || {}; + props = props || {}; + for (key in oldProps) { + if (!props[key]) { + delete elm[key]; + } + } + for (key in props) { + cur = props[key]; + old = oldProps[key]; + if (old !== cur && (key !== 'value' || elm[key] !== cur)) { + elm[key] = cur; + } + } +} +exports.propsModule = { create: updateProps, update: updateProps }; +exports.default = exports.propsModule; +//# sourceMappingURL=props.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/modules/style.js": +/*!************************************************!*\ + !*** ./node_modules/snabbdom/modules/style.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +// Bindig `requestAnimationFrame` like this fixes a bug in IE/Edge. See #360 and #409. +var raf = (typeof window !== 'undefined' && (window.requestAnimationFrame).bind(window)) || setTimeout; +var nextFrame = function (fn) { raf(function () { raf(fn); }); }; +var reflowForced = false; +function setNextFrame(obj, prop, val) { + nextFrame(function () { obj[prop] = val; }); +} +function updateStyle(oldVnode, vnode) { + var cur, name, elm = vnode.elm, oldStyle = oldVnode.data.style, style = vnode.data.style; + if (!oldStyle && !style) + return; + if (oldStyle === style) + return; + oldStyle = oldStyle || {}; + style = style || {}; + var oldHasDel = 'delayed' in oldStyle; + for (name in oldStyle) { + if (!style[name]) { + if (name[0] === '-' && name[1] === '-') { + elm.style.removeProperty(name); + } + else { + elm.style[name] = ''; + } + } + } + for (name in style) { + cur = style[name]; + if (name === 'delayed' && style.delayed) { + for (var name2 in style.delayed) { + cur = style.delayed[name2]; + if (!oldHasDel || cur !== oldStyle.delayed[name2]) { + setNextFrame(elm.style, name2, cur); + } + } + } + else if (name !== 'remove' && cur !== oldStyle[name]) { + if (name[0] === '-' && name[1] === '-') { + elm.style.setProperty(name, cur); + } + else { + elm.style[name] = cur; + } + } + } +} +function applyDestroyStyle(vnode) { + var style, name, elm = vnode.elm, s = vnode.data.style; + if (!s || !(style = s.destroy)) + return; + for (name in style) { + elm.style[name] = style[name]; + } +} +function applyRemoveStyle(vnode, rm) { + var s = vnode.data.style; + if (!s || !s.remove) { + rm(); + return; + } + if (!reflowForced) { + getComputedStyle(document.body).transform; + reflowForced = true; + } + var name, elm = vnode.elm, i = 0, compStyle, style = s.remove, amount = 0, applied = []; + for (name in style) { + applied.push(name); + elm.style[name] = style[name]; + } + compStyle = getComputedStyle(elm); + var props = compStyle['transition-property'].split(', '); + for (; i < props.length; ++i) { + if (applied.indexOf(props[i]) !== -1) + amount++; + } + elm.addEventListener('transitionend', function (ev) { + if (ev.target === elm) + --amount; + if (amount === 0) + rm(); + }); +} +function forceReflow() { + reflowForced = false; +} +exports.styleModule = { + pre: forceReflow, + create: updateStyle, + update: updateStyle, + destroy: applyDestroyStyle, + remove: applyRemoveStyle +}; +exports.default = exports.styleModule; +//# sourceMappingURL=style.js.map + +/***/ }), + +/***/ "./node_modules/snabbdom/vnode.js": +/*!****************************************!*\ + !*** ./node_modules/snabbdom/vnode.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function vnode(sel, data, children, text, elm) { + var key = data === undefined ? undefined : data.key; + return { sel: sel, data: data, children: children, + text: text, elm: elm, key: key }; +} +exports.vnode = vnode; +exports.default = vnode; +//# sourceMappingURL=vnode.js.map + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/entry.js": +/*!*************************************************!*\ + !*** ./node_modules/sockjs-client/lib/entry.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var transportList = __webpack_require__(/*! ./transport-list */ "./node_modules/sockjs-client/lib/transport-list.js"); + +module.exports = __webpack_require__(/*! ./main */ "./node_modules/sockjs-client/lib/main.js")(transportList); + +// TODO can't get rid of this until all servers do +if ('_sockjs_onload' in global) { + setTimeout(global._sockjs_onload, 1); +} + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/event/close.js": +/*!*******************************************************!*\ + !*** ./node_modules/sockjs-client/lib/event/close.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , Event = __webpack_require__(/*! ./event */ "./node_modules/sockjs-client/lib/event/event.js") + ; + +function CloseEvent() { + Event.call(this); + this.initEvent('close', false, false); + this.wasClean = false; + this.code = 0; + this.reason = ''; +} + +inherits(CloseEvent, Event); + +module.exports = CloseEvent; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/event/emitter.js": +/*!*********************************************************!*\ + !*** ./node_modules/sockjs-client/lib/event/emitter.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , EventTarget = __webpack_require__(/*! ./eventtarget */ "./node_modules/sockjs-client/lib/event/eventtarget.js") + ; + +function EventEmitter() { + EventTarget.call(this); +} + +inherits(EventEmitter, EventTarget); + +EventEmitter.prototype.removeAllListeners = function(type) { + if (type) { + delete this._listeners[type]; + } else { + this._listeners = {}; + } +}; + +EventEmitter.prototype.once = function(type, listener) { + var self = this + , fired = false; + + function g() { + self.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); + } + } + + this.on(type, g); +}; + +EventEmitter.prototype.emit = function() { + var type = arguments[0]; + var listeners = this._listeners[type]; + if (!listeners) { + return; + } + // equivalent of Array.prototype.slice.call(arguments, 1); + var l = arguments.length; + var args = new Array(l - 1); + for (var ai = 1; ai < l; ai++) { + args[ai - 1] = arguments[ai]; + } + for (var i = 0; i < listeners.length; i++) { + listeners[i].apply(this, args); + } +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener = EventTarget.prototype.addEventListener; +EventEmitter.prototype.removeListener = EventTarget.prototype.removeEventListener; + +module.exports.EventEmitter = EventEmitter; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/event/event.js": +/*!*******************************************************!*\ + !*** ./node_modules/sockjs-client/lib/event/event.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function Event(eventType) { + this.type = eventType; +} + +Event.prototype.initEvent = function(eventType, canBubble, cancelable) { + this.type = eventType; + this.bubbles = canBubble; + this.cancelable = cancelable; + this.timeStamp = +new Date(); + return this; +}; + +Event.prototype.stopPropagation = function() {}; +Event.prototype.preventDefault = function() {}; + +Event.CAPTURING_PHASE = 1; +Event.AT_TARGET = 2; +Event.BUBBLING_PHASE = 3; + +module.exports = Event; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/event/eventtarget.js": +/*!*************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/event/eventtarget.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* Simplified implementation of DOM2 EventTarget. + * http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget + */ + +function EventTarget() { + this._listeners = {}; +} + +EventTarget.prototype.addEventListener = function(eventType, listener) { + if (!(eventType in this._listeners)) { + this._listeners[eventType] = []; + } + var arr = this._listeners[eventType]; + // #4 + if (arr.indexOf(listener) === -1) { + // Make a copy so as not to interfere with a current dispatchEvent. + arr = arr.concat([listener]); + } + this._listeners[eventType] = arr; +}; + +EventTarget.prototype.removeEventListener = function(eventType, listener) { + var arr = this._listeners[eventType]; + if (!arr) { + return; + } + var idx = arr.indexOf(listener); + if (idx !== -1) { + if (arr.length > 1) { + // Make a copy so as not to interfere with a current dispatchEvent. + this._listeners[eventType] = arr.slice(0, idx).concat(arr.slice(idx + 1)); + } else { + delete this._listeners[eventType]; + } + return; + } +}; + +EventTarget.prototype.dispatchEvent = function() { + var event = arguments[0]; + var t = event.type; + // equivalent of Array.prototype.slice.call(arguments, 0); + var args = arguments.length === 1 ? [event] : Array.apply(null, arguments); + // TODO: This doesn't match the real behavior; per spec, onfoo get + // their place in line from the /first/ time they're set from + // non-null. Although WebKit bumps it to the end every time it's + // set. + if (this['on' + t]) { + this['on' + t].apply(this, args); + } + if (t in this._listeners) { + // Grab a reference to the listeners list. removeEventListener may alter the list. + var listeners = this._listeners[t]; + for (var i = 0; i < listeners.length; i++) { + listeners[i].apply(this, args); + } + } +}; + +module.exports = EventTarget; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/event/trans-message.js": +/*!***************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/event/trans-message.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , Event = __webpack_require__(/*! ./event */ "./node_modules/sockjs-client/lib/event/event.js") + ; + +function TransportMessageEvent(data) { + Event.call(this); + this.initEvent('message', false, false); + this.data = data; +} + +inherits(TransportMessageEvent, Event); + +module.exports = TransportMessageEvent; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/facade.js": +/*!**************************************************!*\ + !*** ./node_modules/sockjs-client/lib/facade.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var JSON3 = __webpack_require__(/*! json3 */ "./node_modules/json3/lib/json3.js") + , iframeUtils = __webpack_require__(/*! ./utils/iframe */ "./node_modules/sockjs-client/lib/utils/iframe.js") + ; + +function FacadeJS(transport) { + this._transport = transport; + transport.on('message', this._transportMessage.bind(this)); + transport.on('close', this._transportClose.bind(this)); +} + +FacadeJS.prototype._transportClose = function(code, reason) { + iframeUtils.postMessage('c', JSON3.stringify([code, reason])); +}; +FacadeJS.prototype._transportMessage = function(frame) { + iframeUtils.postMessage('t', frame); +}; +FacadeJS.prototype._send = function(data) { + this._transport.send(data); +}; +FacadeJS.prototype._close = function() { + this._transport.close(); + this._transport.removeAllListeners(); +}; + +module.exports = FacadeJS; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/iframe-bootstrap.js": +/*!************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/iframe-bootstrap.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var urlUtils = __webpack_require__(/*! ./utils/url */ "./node_modules/sockjs-client/lib/utils/url.js") + , eventUtils = __webpack_require__(/*! ./utils/event */ "./node_modules/sockjs-client/lib/utils/event.js") + , JSON3 = __webpack_require__(/*! json3 */ "./node_modules/json3/lib/json3.js") + , FacadeJS = __webpack_require__(/*! ./facade */ "./node_modules/sockjs-client/lib/facade.js") + , InfoIframeReceiver = __webpack_require__(/*! ./info-iframe-receiver */ "./node_modules/sockjs-client/lib/info-iframe-receiver.js") + , iframeUtils = __webpack_require__(/*! ./utils/iframe */ "./node_modules/sockjs-client/lib/utils/iframe.js") + , loc = __webpack_require__(/*! ./location */ "./node_modules/sockjs-client/lib/location.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:iframe-bootstrap'); +} + +module.exports = function(SockJS, availableTransports) { + var transportMap = {}; + availableTransports.forEach(function(at) { + if (at.facadeTransport) { + transportMap[at.facadeTransport.transportName] = at.facadeTransport; + } + }); + + // hard-coded for the info iframe + // TODO see if we can make this more dynamic + transportMap[InfoIframeReceiver.transportName] = InfoIframeReceiver; + var parentOrigin; + + /* eslint-disable camelcase */ + SockJS.bootstrap_iframe = function() { + /* eslint-enable camelcase */ + var facade; + iframeUtils.currentWindowId = loc.hash.slice(1); + var onMessage = function(e) { + if (e.source !== parent) { + return; + } + if (typeof parentOrigin === 'undefined') { + parentOrigin = e.origin; + } + if (e.origin !== parentOrigin) { + return; + } + + var iframeMessage; + try { + iframeMessage = JSON3.parse(e.data); + } catch (ignored) { + debug('bad json', e.data); + return; + } + + if (iframeMessage.windowId !== iframeUtils.currentWindowId) { + return; + } + switch (iframeMessage.type) { + case 's': + var p; + try { + p = JSON3.parse(iframeMessage.data); + } catch (ignored) { + debug('bad json', iframeMessage.data); + break; + } + var version = p[0]; + var transport = p[1]; + var transUrl = p[2]; + var baseUrl = p[3]; + debug(version, transport, transUrl, baseUrl); + // change this to semver logic + if (version !== SockJS.version) { + throw new Error('Incompatible SockJS! Main site uses:' + + ' "' + version + '", the iframe:' + + ' "' + SockJS.version + '".'); + } + + if (!urlUtils.isOriginEqual(transUrl, loc.href) || + !urlUtils.isOriginEqual(baseUrl, loc.href)) { + throw new Error('Can\'t connect to different domain from within an ' + + 'iframe. (' + loc.href + ', ' + transUrl + ', ' + baseUrl + ')'); + } + facade = new FacadeJS(new transportMap[transport](transUrl, baseUrl)); + break; + case 'm': + facade._send(iframeMessage.data); + break; + case 'c': + if (facade) { + facade._close(); + } + facade = null; + break; + } + }; + + eventUtils.attachEvent('message', onMessage); + + // Start + iframeUtils.postMessage('s'); + }; +}; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/info-ajax.js": +/*!*****************************************************!*\ + !*** ./node_modules/sockjs-client/lib/info-ajax.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + , inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , JSON3 = __webpack_require__(/*! json3 */ "./node_modules/json3/lib/json3.js") + , objectUtils = __webpack_require__(/*! ./utils/object */ "./node_modules/sockjs-client/lib/utils/object.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:info-ajax'); +} + +function InfoAjax(url, AjaxObject) { + EventEmitter.call(this); + + var self = this; + var t0 = +new Date(); + this.xo = new AjaxObject('GET', url); + + this.xo.once('finish', function(status, text) { + var info, rtt; + if (status === 200) { + rtt = (+new Date()) - t0; + if (text) { + try { + info = JSON3.parse(text); + } catch (e) { + debug('bad json', text); + } + } + + if (!objectUtils.isObject(info)) { + info = {}; + } + } + self.emit('finish', info, rtt); + self.removeAllListeners(); + }); +} + +inherits(InfoAjax, EventEmitter); + +InfoAjax.prototype.close = function() { + this.removeAllListeners(); + this.xo.close(); +}; + +module.exports = InfoAjax; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/info-iframe-receiver.js": +/*!****************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/info-iframe-receiver.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + , JSON3 = __webpack_require__(/*! json3 */ "./node_modules/json3/lib/json3.js") + , XHRLocalObject = __webpack_require__(/*! ./transport/sender/xhr-local */ "./node_modules/sockjs-client/lib/transport/sender/xhr-local.js") + , InfoAjax = __webpack_require__(/*! ./info-ajax */ "./node_modules/sockjs-client/lib/info-ajax.js") + ; + +function InfoReceiverIframe(transUrl) { + var self = this; + EventEmitter.call(this); + + this.ir = new InfoAjax(transUrl, XHRLocalObject); + this.ir.once('finish', function(info, rtt) { + self.ir = null; + self.emit('message', JSON3.stringify([info, rtt])); + }); +} + +inherits(InfoReceiverIframe, EventEmitter); + +InfoReceiverIframe.transportName = 'iframe-info-receiver'; + +InfoReceiverIframe.prototype.close = function() { + if (this.ir) { + this.ir.close(); + this.ir = null; + } + this.removeAllListeners(); +}; + +module.exports = InfoReceiverIframe; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/info-iframe.js": +/*!*******************************************************!*\ + !*** ./node_modules/sockjs-client/lib/info-iframe.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + , inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , JSON3 = __webpack_require__(/*! json3 */ "./node_modules/json3/lib/json3.js") + , utils = __webpack_require__(/*! ./utils/event */ "./node_modules/sockjs-client/lib/utils/event.js") + , IframeTransport = __webpack_require__(/*! ./transport/iframe */ "./node_modules/sockjs-client/lib/transport/iframe.js") + , InfoReceiverIframe = __webpack_require__(/*! ./info-iframe-receiver */ "./node_modules/sockjs-client/lib/info-iframe-receiver.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:info-iframe'); +} + +function InfoIframe(baseUrl, url) { + var self = this; + EventEmitter.call(this); + + var go = function() { + var ifr = self.ifr = new IframeTransport(InfoReceiverIframe.transportName, url, baseUrl); + + ifr.once('message', function(msg) { + if (msg) { + var d; + try { + d = JSON3.parse(msg); + } catch (e) { + debug('bad json', msg); + self.emit('finish'); + self.close(); + return; + } + + var info = d[0], rtt = d[1]; + self.emit('finish', info, rtt); + } + self.close(); + }); + + ifr.once('close', function() { + self.emit('finish'); + self.close(); + }); + }; + + // TODO this seems the same as the 'needBody' from transports + if (!global.document.body) { + utils.attachEvent('load', go); + } else { + go(); + } +} + +inherits(InfoIframe, EventEmitter); + +InfoIframe.enabled = function() { + return IframeTransport.enabled(); +}; + +InfoIframe.prototype.close = function() { + if (this.ifr) { + this.ifr.close(); + } + this.removeAllListeners(); + this.ifr = null; +}; + +module.exports = InfoIframe; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/info-receiver.js": +/*!*********************************************************!*\ + !*** ./node_modules/sockjs-client/lib/info-receiver.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + , inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , urlUtils = __webpack_require__(/*! ./utils/url */ "./node_modules/sockjs-client/lib/utils/url.js") + , XDR = __webpack_require__(/*! ./transport/sender/xdr */ "./node_modules/sockjs-client/lib/transport/sender/xdr.js") + , XHRCors = __webpack_require__(/*! ./transport/sender/xhr-cors */ "./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js") + , XHRLocal = __webpack_require__(/*! ./transport/sender/xhr-local */ "./node_modules/sockjs-client/lib/transport/sender/xhr-local.js") + , XHRFake = __webpack_require__(/*! ./transport/sender/xhr-fake */ "./node_modules/sockjs-client/lib/transport/sender/xhr-fake.js") + , InfoIframe = __webpack_require__(/*! ./info-iframe */ "./node_modules/sockjs-client/lib/info-iframe.js") + , InfoAjax = __webpack_require__(/*! ./info-ajax */ "./node_modules/sockjs-client/lib/info-ajax.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:info-receiver'); +} + +function InfoReceiver(baseUrl, urlInfo) { + debug(baseUrl); + var self = this; + EventEmitter.call(this); + + setTimeout(function() { + self.doXhr(baseUrl, urlInfo); + }, 0); +} + +inherits(InfoReceiver, EventEmitter); + +// TODO this is currently ignoring the list of available transports and the whitelist + +InfoReceiver._getReceiver = function(baseUrl, url, urlInfo) { + // determine method of CORS support (if needed) + if (urlInfo.sameOrigin) { + return new InfoAjax(url, XHRLocal); + } + if (XHRCors.enabled) { + return new InfoAjax(url, XHRCors); + } + if (XDR.enabled && urlInfo.sameScheme) { + return new InfoAjax(url, XDR); + } + if (InfoIframe.enabled()) { + return new InfoIframe(baseUrl, url); + } + return new InfoAjax(url, XHRFake); +}; + +InfoReceiver.prototype.doXhr = function(baseUrl, urlInfo) { + var self = this + , url = urlUtils.addPath(baseUrl, '/info') + ; + debug('doXhr', url); + + this.xo = InfoReceiver._getReceiver(baseUrl, url, urlInfo); + + this.timeoutRef = setTimeout(function() { + debug('timeout'); + self._cleanup(false); + self.emit('finish'); + }, InfoReceiver.timeout); + + this.xo.once('finish', function(info, rtt) { + debug('finish', info, rtt); + self._cleanup(true); + self.emit('finish', info, rtt); + }); +}; + +InfoReceiver.prototype._cleanup = function(wasClean) { + debug('_cleanup'); + clearTimeout(this.timeoutRef); + this.timeoutRef = null; + if (!wasClean && this.xo) { + this.xo.close(); + } + this.xo = null; +}; + +InfoReceiver.prototype.close = function() { + debug('close'); + this.removeAllListeners(); + this._cleanup(false); +}; + +InfoReceiver.timeout = 8000; + +module.exports = InfoReceiver; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/location.js": +/*!****************************************************!*\ + !*** ./node_modules/sockjs-client/lib/location.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +module.exports = global.location || { + origin: 'http://localhost:80' +, protocol: 'http:' +, host: 'localhost' +, port: 80 +, href: 'http://localhost/' +, hash: '' +}; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/main.js": +/*!************************************************!*\ + !*** ./node_modules/sockjs-client/lib/main.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +__webpack_require__(/*! ./shims */ "./node_modules/sockjs-client/lib/shims.js"); + +var URL = __webpack_require__(/*! url-parse */ "./node_modules/url-parse/index.js") + , inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , JSON3 = __webpack_require__(/*! json3 */ "./node_modules/json3/lib/json3.js") + , random = __webpack_require__(/*! ./utils/random */ "./node_modules/sockjs-client/lib/utils/random.js") + , escape = __webpack_require__(/*! ./utils/escape */ "./node_modules/sockjs-client/lib/utils/escape.js") + , urlUtils = __webpack_require__(/*! ./utils/url */ "./node_modules/sockjs-client/lib/utils/url.js") + , eventUtils = __webpack_require__(/*! ./utils/event */ "./node_modules/sockjs-client/lib/utils/event.js") + , transport = __webpack_require__(/*! ./utils/transport */ "./node_modules/sockjs-client/lib/utils/transport.js") + , objectUtils = __webpack_require__(/*! ./utils/object */ "./node_modules/sockjs-client/lib/utils/object.js") + , browser = __webpack_require__(/*! ./utils/browser */ "./node_modules/sockjs-client/lib/utils/browser.js") + , log = __webpack_require__(/*! ./utils/log */ "./node_modules/sockjs-client/lib/utils/log.js") + , Event = __webpack_require__(/*! ./event/event */ "./node_modules/sockjs-client/lib/event/event.js") + , EventTarget = __webpack_require__(/*! ./event/eventtarget */ "./node_modules/sockjs-client/lib/event/eventtarget.js") + , loc = __webpack_require__(/*! ./location */ "./node_modules/sockjs-client/lib/location.js") + , CloseEvent = __webpack_require__(/*! ./event/close */ "./node_modules/sockjs-client/lib/event/close.js") + , TransportMessageEvent = __webpack_require__(/*! ./event/trans-message */ "./node_modules/sockjs-client/lib/event/trans-message.js") + , InfoReceiver = __webpack_require__(/*! ./info-receiver */ "./node_modules/sockjs-client/lib/info-receiver.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:main'); +} + +var transports; + +// follow constructor steps defined at http://dev.w3.org/html5/websockets/#the-websocket-interface +function SockJS(url, protocols, options) { + if (!(this instanceof SockJS)) { + return new SockJS(url, protocols, options); + } + if (arguments.length < 1) { + throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present"); + } + EventTarget.call(this); + + this.readyState = SockJS.CONNECTING; + this.extensions = ''; + this.protocol = ''; + + // non-standard extension + options = options || {}; + if (options.protocols_whitelist) { + log.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."); + } + this._transportsWhitelist = options.transports; + this._transportOptions = options.transportOptions || {}; + + var sessionId = options.sessionId || 8; + if (typeof sessionId === 'function') { + this._generateSessionId = sessionId; + } else if (typeof sessionId === 'number') { + this._generateSessionId = function() { + return random.string(sessionId); + }; + } else { + throw new TypeError('If sessionId is used in the options, it needs to be a number or a function.'); + } + + this._server = options.server || random.numberString(1000); + + // Step 1 of WS spec - parse and validate the url. Issue #8 + var parsedUrl = new URL(url); + if (!parsedUrl.host || !parsedUrl.protocol) { + throw new SyntaxError("The URL '" + url + "' is invalid"); + } else if (parsedUrl.hash) { + throw new SyntaxError('The URL must not contain a fragment'); + } else if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') { + throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '" + parsedUrl.protocol + "' is not allowed."); + } + + var secure = parsedUrl.protocol === 'https:'; + // Step 2 - don't allow secure origin with an insecure protocol + if (loc.protocol === 'https:' && !secure) { + throw new Error('SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS'); + } + + // Step 3 - check port access - no need here + // Step 4 - parse protocols argument + if (!protocols) { + protocols = []; + } else if (!Array.isArray(protocols)) { + protocols = [protocols]; + } + + // Step 5 - check protocols argument + var sortedProtocols = protocols.sort(); + sortedProtocols.forEach(function(proto, i) { + if (!proto) { + throw new SyntaxError("The protocols entry '" + proto + "' is invalid."); + } + if (i < (sortedProtocols.length - 1) && proto === sortedProtocols[i + 1]) { + throw new SyntaxError("The protocols entry '" + proto + "' is duplicated."); + } + }); + + // Step 6 - convert origin + var o = urlUtils.getOrigin(loc.href); + this._origin = o ? o.toLowerCase() : null; + + // remove the trailing slash + parsedUrl.set('pathname', parsedUrl.pathname.replace(/\/+$/, '')); + + // store the sanitized url + this.url = parsedUrl.href; + debug('using url', this.url); + + // Step 7 - start connection in background + // obtain server info + // http://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html#section-26 + this._urlInfo = { + nullOrigin: !browser.hasDomain() + , sameOrigin: urlUtils.isOriginEqual(this.url, loc.href) + , sameScheme: urlUtils.isSchemeEqual(this.url, loc.href) + }; + + this._ir = new InfoReceiver(this.url, this._urlInfo); + this._ir.once('finish', this._receiveInfo.bind(this)); +} + +inherits(SockJS, EventTarget); + +function userSetCode(code) { + return code === 1000 || (code >= 3000 && code <= 4999); +} + +SockJS.prototype.close = function(code, reason) { + // Step 1 + if (code && !userSetCode(code)) { + throw new Error('InvalidAccessError: Invalid code'); + } + // Step 2.4 states the max is 123 bytes, but we are just checking length + if (reason && reason.length > 123) { + throw new SyntaxError('reason argument has an invalid length'); + } + + // Step 3.1 + if (this.readyState === SockJS.CLOSING || this.readyState === SockJS.CLOSED) { + return; + } + + // TODO look at docs to determine how to set this + var wasClean = true; + this._close(code || 1000, reason || 'Normal closure', wasClean); +}; + +SockJS.prototype.send = function(data) { + // #13 - convert anything non-string to string + // TODO this currently turns objects into [object Object] + if (typeof data !== 'string') { + data = '' + data; + } + if (this.readyState === SockJS.CONNECTING) { + throw new Error('InvalidStateError: The connection has not been established yet'); + } + if (this.readyState !== SockJS.OPEN) { + return; + } + this._transport.send(escape.quote(data)); +}; + +SockJS.version = __webpack_require__(/*! ./version */ "./node_modules/sockjs-client/lib/version.js"); + +SockJS.CONNECTING = 0; +SockJS.OPEN = 1; +SockJS.CLOSING = 2; +SockJS.CLOSED = 3; + +SockJS.prototype._receiveInfo = function(info, rtt) { + debug('_receiveInfo', rtt); + this._ir = null; + if (!info) { + this._close(1002, 'Cannot connect to server'); + return; + } + + // establish a round-trip timeout (RTO) based on the + // round-trip time (RTT) + this._rto = this.countRTO(rtt); + // allow server to override url used for the actual transport + this._transUrl = info.base_url ? info.base_url : this.url; + info = objectUtils.extend(info, this._urlInfo); + debug('info', info); + // determine list of desired and supported transports + var enabledTransports = transports.filterToEnabled(this._transportsWhitelist, info); + this._transports = enabledTransports.main; + debug(this._transports.length + ' enabled transports'); + + this._connect(); +}; + +SockJS.prototype._connect = function() { + for (var Transport = this._transports.shift(); Transport; Transport = this._transports.shift()) { + debug('attempt', Transport.transportName); + if (Transport.needBody) { + if (!global.document.body || + (typeof global.document.readyState !== 'undefined' && + global.document.readyState !== 'complete' && + global.document.readyState !== 'interactive')) { + debug('waiting for body'); + this._transports.unshift(Transport); + eventUtils.attachEvent('load', this._connect.bind(this)); + return; + } + } + + // calculate timeout based on RTO and round trips. Default to 5s + var timeoutMs = (this._rto * Transport.roundTrips) || 5000; + this._transportTimeoutId = setTimeout(this._transportTimeout.bind(this), timeoutMs); + debug('using timeout', timeoutMs); + + var transportUrl = urlUtils.addPath(this._transUrl, '/' + this._server + '/' + this._generateSessionId()); + var options = this._transportOptions[Transport.transportName]; + debug('transport url', transportUrl); + var transportObj = new Transport(transportUrl, this._transUrl, options); + transportObj.on('message', this._transportMessage.bind(this)); + transportObj.once('close', this._transportClose.bind(this)); + transportObj.transportName = Transport.transportName; + this._transport = transportObj; + + return; + } + this._close(2000, 'All transports failed', false); +}; + +SockJS.prototype._transportTimeout = function() { + debug('_transportTimeout'); + if (this.readyState === SockJS.CONNECTING) { + if (this._transport) { + this._transport.close(); + } + + this._transportClose(2007, 'Transport timed out'); + } +}; + +SockJS.prototype._transportMessage = function(msg) { + debug('_transportMessage', msg); + var self = this + , type = msg.slice(0, 1) + , content = msg.slice(1) + , payload + ; + + // first check for messages that don't need a payload + switch (type) { + case 'o': + this._open(); + return; + case 'h': + this.dispatchEvent(new Event('heartbeat')); + debug('heartbeat', this.transport); + return; + } + + if (content) { + try { + payload = JSON3.parse(content); + } catch (e) { + debug('bad json', content); + } + } + + if (typeof payload === 'undefined') { + debug('empty payload', content); + return; + } + + switch (type) { + case 'a': + if (Array.isArray(payload)) { + payload.forEach(function(p) { + debug('message', self.transport, p); + self.dispatchEvent(new TransportMessageEvent(p)); + }); + } + break; + case 'm': + debug('message', this.transport, payload); + this.dispatchEvent(new TransportMessageEvent(payload)); + break; + case 'c': + if (Array.isArray(payload) && payload.length === 2) { + this._close(payload[0], payload[1], true); + } + break; + } +}; + +SockJS.prototype._transportClose = function(code, reason) { + debug('_transportClose', this.transport, code, reason); + if (this._transport) { + this._transport.removeAllListeners(); + this._transport = null; + this.transport = null; + } + + if (!userSetCode(code) && code !== 2000 && this.readyState === SockJS.CONNECTING) { + this._connect(); + return; + } + + this._close(code, reason); +}; + +SockJS.prototype._open = function() { + debug('_open', this._transport.transportName, this.readyState); + if (this.readyState === SockJS.CONNECTING) { + if (this._transportTimeoutId) { + clearTimeout(this._transportTimeoutId); + this._transportTimeoutId = null; + } + this.readyState = SockJS.OPEN; + this.transport = this._transport.transportName; + this.dispatchEvent(new Event('open')); + debug('connected', this.transport); + } else { + // The server might have been restarted, and lost track of our + // connection. + this._close(1006, 'Server lost session'); + } +}; + +SockJS.prototype._close = function(code, reason, wasClean) { + debug('_close', this.transport, code, reason, wasClean, this.readyState); + var forceFail = false; + + if (this._ir) { + forceFail = true; + this._ir.close(); + this._ir = null; + } + if (this._transport) { + this._transport.close(); + this._transport = null; + this.transport = null; + } + + if (this.readyState === SockJS.CLOSED) { + throw new Error('InvalidStateError: SockJS has already been closed'); + } + + this.readyState = SockJS.CLOSING; + setTimeout(function() { + this.readyState = SockJS.CLOSED; + + if (forceFail) { + this.dispatchEvent(new Event('error')); + } + + var e = new CloseEvent('close'); + e.wasClean = wasClean || false; + e.code = code || 1000; + e.reason = reason; + + this.dispatchEvent(e); + this.onmessage = this.onclose = this.onerror = null; + debug('disconnected'); + }.bind(this), 0); +}; + +// See: http://www.erg.abdn.ac.uk/~gerrit/dccp/notes/ccid2/rto_estimator/ +// and RFC 2988. +SockJS.prototype.countRTO = function(rtt) { + // In a local environment, when using IE8/9 and the `jsonp-polling` + // transport the time needed to establish a connection (the time that pass + // from the opening of the transport to the call of `_dispatchOpen`) is + // around 200msec (the lower bound used in the article above) and this + // causes spurious timeouts. For this reason we calculate a value slightly + // larger than that used in the article. + if (rtt > 100) { + return 4 * rtt; // rto > 400msec + } + return 300 + rtt; // 300msec < rto <= 400msec +}; + +module.exports = function(availableTransports) { + transports = transport(availableTransports); + __webpack_require__(/*! ./iframe-bootstrap */ "./node_modules/sockjs-client/lib/iframe-bootstrap.js")(SockJS, availableTransports); + return SockJS; +}; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/shims.js": +/*!*************************************************!*\ + !*** ./node_modules/sockjs-client/lib/shims.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* eslint-disable */ +/* jscs: disable */ + + +// pulled specific shims from https://github.com/es-shims/es5-shim + +var ArrayPrototype = Array.prototype; +var ObjectPrototype = Object.prototype; +var FunctionPrototype = Function.prototype; +var StringPrototype = String.prototype; +var array_slice = ArrayPrototype.slice; + +var _toString = ObjectPrototype.toString; +var isFunction = function (val) { + return ObjectPrototype.toString.call(val) === '[object Function]'; +}; +var isArray = function isArray(obj) { + return _toString.call(obj) === '[object Array]'; +}; +var isString = function isString(obj) { + return _toString.call(obj) === '[object String]'; +}; + +var supportsDescriptors = Object.defineProperty && (function () { + try { + Object.defineProperty({}, 'x', {}); + return true; + } catch (e) { /* this is ES3 */ + return false; + } +}()); + +// Define configurable, writable and non-enumerable props +// if they don't exist. +var defineProperty; +if (supportsDescriptors) { + defineProperty = function (object, name, method, forceAssign) { + if (!forceAssign && (name in object)) { return; } + Object.defineProperty(object, name, { + configurable: true, + enumerable: false, + writable: true, + value: method + }); + }; +} else { + defineProperty = function (object, name, method, forceAssign) { + if (!forceAssign && (name in object)) { return; } + object[name] = method; + }; +} +var defineProperties = function (object, map, forceAssign) { + for (var name in map) { + if (ObjectPrototype.hasOwnProperty.call(map, name)) { + defineProperty(object, name, map[name], forceAssign); + } + } +}; + +var toObject = function (o) { + if (o == null) { // this matches both null and undefined + throw new TypeError("can't convert " + o + ' to object'); + } + return Object(o); +}; + +// +// Util +// ====== +// + +// ES5 9.4 +// http://es5.github.com/#x9.4 +// http://jsperf.com/to-integer + +function toInteger(num) { + var n = +num; + if (n !== n) { // isNaN + n = 0; + } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) { + n = (n > 0 || -1) * Math.floor(Math.abs(n)); + } + return n; +} + +function ToUint32(x) { + return x >>> 0; +} + +// +// Function +// ======== +// + +// ES-5 15.3.4.5 +// http://es5.github.com/#x15.3.4.5 + +function Empty() {} + +defineProperties(FunctionPrototype, { + bind: function bind(that) { // .length is 1 + // 1. Let Target be the this value. + var target = this; + // 2. If IsCallable(Target) is false, throw a TypeError exception. + if (!isFunction(target)) { + throw new TypeError('Function.prototype.bind called on incompatible ' + target); + } + // 3. Let A be a new (possibly empty) internal list of all of the + // argument values provided after thisArg (arg1, arg2 etc), in order. + // XXX slicedArgs will stand in for "A" if used + var args = array_slice.call(arguments, 1); // for normal call + // 4. Let F be a new native ECMAScript object. + // 11. Set the [[Prototype]] internal property of F to the standard + // built-in Function prototype object as specified in 15.3.3.1. + // 12. Set the [[Call]] internal property of F as described in + // 15.3.4.5.1. + // 13. Set the [[Construct]] internal property of F as described in + // 15.3.4.5.2. + // 14. Set the [[HasInstance]] internal property of F as described in + // 15.3.4.5.3. + var binder = function () { + + if (this instanceof bound) { + // 15.3.4.5.2 [[Construct]] + // When the [[Construct]] internal method of a function object, + // F that was created using the bind function is called with a + // list of arguments ExtraArgs, the following steps are taken: + // 1. Let target be the value of F's [[TargetFunction]] + // internal property. + // 2. If target has no [[Construct]] internal method, a + // TypeError exception is thrown. + // 3. Let boundArgs be the value of F's [[BoundArgs]] internal + // property. + // 4. Let args be a new list containing the same values as the + // list boundArgs in the same order followed by the same + // values as the list ExtraArgs in the same order. + // 5. Return the result of calling the [[Construct]] internal + // method of target providing args as the arguments. + + var result = target.apply( + this, + args.concat(array_slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + + } else { + // 15.3.4.5.1 [[Call]] + // When the [[Call]] internal method of a function object, F, + // which was created using the bind function is called with a + // this value and a list of arguments ExtraArgs, the following + // steps are taken: + // 1. Let boundArgs be the value of F's [[BoundArgs]] internal + // property. + // 2. Let boundThis be the value of F's [[BoundThis]] internal + // property. + // 3. Let target be the value of F's [[TargetFunction]] internal + // property. + // 4. Let args be a new list containing the same values as the + // list boundArgs in the same order followed by the same + // values as the list ExtraArgs in the same order. + // 5. Return the result of calling the [[Call]] internal method + // of target providing boundThis as the this value and + // providing args as the arguments. + + // equiv: target.call(this, ...boundArgs, ...args) + return target.apply( + that, + args.concat(array_slice.call(arguments)) + ); + + } + + }; + + // 15. If the [[Class]] internal property of Target is "Function", then + // a. Let L be the length property of Target minus the length of A. + // b. Set the length own property of F to either 0 or L, whichever is + // larger. + // 16. Else set the length own property of F to 0. + + var boundLength = Math.max(0, target.length - args.length); + + // 17. Set the attributes of the length own property of F to the values + // specified in 15.3.5.1. + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + // XXX Build a dynamic function with desired amount of arguments is the only + // way to set the length property of a function. + // In environments where Content Security Policies enabled (Chrome extensions, + // for ex.) all use of eval or Function costructor throws an exception. + // However in all of these environments Function.prototype.bind exists + // and so this code will never be executed. + var bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this, arguments); }')(binder); + + if (target.prototype) { + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + // Clean up dangling references. + Empty.prototype = null; + } + + // TODO + // 18. Set the [[Extensible]] internal property of F to true. + + // TODO + // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3). + // 20. Call the [[DefineOwnProperty]] internal method of F with + // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]: + // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and + // false. + // 21. Call the [[DefineOwnProperty]] internal method of F with + // arguments "arguments", PropertyDescriptor {[[Get]]: thrower, + // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false}, + // and false. + + // TODO + // NOTE Function objects created using Function.prototype.bind do not + // have a prototype property or the [[Code]], [[FormalParameters]], and + // [[Scope]] internal properties. + // XXX can't delete prototype in pure-js. + + // 22. Return F. + return bound; + } +}); + +// +// Array +// ===== +// + +// ES5 15.4.3.2 +// http://es5.github.com/#x15.4.3.2 +// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray +defineProperties(Array, { isArray: isArray }); + + +var boxedString = Object('a'); +var splitString = boxedString[0] !== 'a' || !(0 in boxedString); + +var properlyBoxesContext = function properlyBoxed(method) { + // Check node 0.6.21 bug where third parameter is not boxed + var properlyBoxesNonStrict = true; + var properlyBoxesStrict = true; + if (method) { + method.call('foo', function (_, __, context) { + if (typeof context !== 'object') { properlyBoxesNonStrict = false; } + }); + + method.call([1], function () { + 'use strict'; + properlyBoxesStrict = typeof this === 'string'; + }, 'x'); + } + return !!method && properlyBoxesNonStrict && properlyBoxesStrict; +}; + +defineProperties(ArrayPrototype, { + forEach: function forEach(fun /*, thisp*/) { + var object = toObject(this), + self = splitString && isString(this) ? this.split('') : object, + thisp = arguments[1], + i = -1, + length = self.length >>> 0; + + // If no callback function or if callback is not a callable function + if (!isFunction(fun)) { + throw new TypeError(); // TODO message + } + + while (++i < length) { + if (i in self) { + // Invoke the callback function with call, passing arguments: + // context, property value, property key, thisArg object + // context + fun.call(thisp, self[i], i, object); + } + } + } +}, !properlyBoxesContext(ArrayPrototype.forEach)); + +// ES5 15.4.4.14 +// http://es5.github.com/#x15.4.4.14 +// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf +var hasFirefox2IndexOfBug = Array.prototype.indexOf && [0, 1].indexOf(1, 2) !== -1; +defineProperties(ArrayPrototype, { + indexOf: function indexOf(sought /*, fromIndex */ ) { + var self = splitString && isString(this) ? this.split('') : toObject(this), + length = self.length >>> 0; + + if (!length) { + return -1; + } + + var i = 0; + if (arguments.length > 1) { + i = toInteger(arguments[1]); + } + + // handle negative indices + i = i >= 0 ? i : Math.max(0, length + i); + for (; i < length; i++) { + if (i in self && self[i] === sought) { + return i; + } + } + return -1; + } +}, hasFirefox2IndexOfBug); + +// +// String +// ====== +// + +// ES5 15.5.4.14 +// http://es5.github.com/#x15.5.4.14 + +// [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers] +// Many browsers do not split properly with regular expressions or they +// do not perform the split correctly under obscure conditions. +// See http://blog.stevenlevithan.com/archives/cross-browser-split +// I've tested in many browsers and this seems to cover the deviant ones: +// 'ab'.split(/(?:ab)*/) should be ["", ""], not [""] +// '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""] +// 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not +// [undefined, "t", undefined, "e", ...] +// ''.split(/.?/) should be [], not [""] +// '.'.split(/()()/) should be ["."], not ["", "", "."] + +var string_split = StringPrototype.split; +if ( + 'ab'.split(/(?:ab)*/).length !== 2 || + '.'.split(/(.?)(.?)/).length !== 4 || + 'tesst'.split(/(s)*/)[1] === 't' || + 'test'.split(/(?:)/, -1).length !== 4 || + ''.split(/.?/).length || + '.'.split(/()()/).length > 1 +) { + (function () { + var compliantExecNpcg = /()??/.exec('')[1] === void 0; // NPCG: nonparticipating capturing group + + StringPrototype.split = function (separator, limit) { + var string = this; + if (separator === void 0 && limit === 0) { + return []; + } + + // If `separator` is not a regex, use native split + if (_toString.call(separator) !== '[object RegExp]') { + return string_split.call(this, separator, limit); + } + + var output = [], + flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.extended ? 'x' : '') + // Proposed for ES6 + (separator.sticky ? 'y' : ''), // Firefox 3+ + lastLastIndex = 0, + // Make `global` and avoid `lastIndex` issues by working with a copy + separator2, match, lastIndex, lastLength; + separator = new RegExp(separator.source, flags + 'g'); + string += ''; // Type-convert + if (!compliantExecNpcg) { + // Doesn't need flags gy, but they don't hurt + separator2 = new RegExp('^' + separator.source + '$(?!\\s)', flags); + } + /* Values for `limit`, per the spec: + * If undefined: 4294967295 // Math.pow(2, 32) - 1 + * If 0, Infinity, or NaN: 0 + * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296; + * If negative number: 4294967296 - Math.floor(Math.abs(limit)) + * If other: Type-convert, then use the above rules + */ + limit = limit === void 0 ? + -1 >>> 0 : // Math.pow(2, 32) - 1 + ToUint32(limit); + while (match = separator.exec(string)) { + // `separator.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0].length; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for + // nonparticipating capturing groups + if (!compliantExecNpcg && match.length > 1) { + match[0].replace(separator2, function () { + for (var i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === void 0) { + match[i] = void 0; + } + } + }); + } + if (match.length > 1 && match.index < string.length) { + ArrayPrototype.push.apply(output, match.slice(1)); + } + lastLength = match[0].length; + lastLastIndex = lastIndex; + if (output.length >= limit) { + break; + } + } + if (separator.lastIndex === match.index) { + separator.lastIndex++; // Avoid an infinite loop + } + } + if (lastLastIndex === string.length) { + if (lastLength || !separator.test('')) { + output.push(''); + } + } else { + output.push(string.slice(lastLastIndex)); + } + return output.length > limit ? output.slice(0, limit) : output; + }; + }()); + +// [bugfix, chrome] +// If separator is undefined, then the result array contains just one String, +// which is the this value (converted to a String). If limit is not undefined, +// then the output array is truncated so that it contains no more than limit +// elements. +// "0".split(undefined, 0) -> [] +} else if ('0'.split(void 0, 0).length) { + StringPrototype.split = function split(separator, limit) { + if (separator === void 0 && limit === 0) { return []; } + return string_split.call(this, separator, limit); + }; +} + +// ECMA-262, 3rd B.2.3 +// Not an ECMAScript standard, although ECMAScript 3rd Edition has a +// non-normative section suggesting uniform semantics and it should be +// normalized across all browsers +// [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE +var string_substr = StringPrototype.substr; +var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b'; +defineProperties(StringPrototype, { + substr: function substr(start, length) { + return string_substr.call( + this, + start < 0 ? ((start = this.length + start) < 0 ? 0 : start) : start, + length + ); + } +}, hasNegativeSubstrBug); + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport-list.js": +/*!**********************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport-list.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = [ + // streaming transports + __webpack_require__(/*! ./transport/websocket */ "./node_modules/sockjs-client/lib/transport/websocket.js") +, __webpack_require__(/*! ./transport/xhr-streaming */ "./node_modules/sockjs-client/lib/transport/xhr-streaming.js") +, __webpack_require__(/*! ./transport/xdr-streaming */ "./node_modules/sockjs-client/lib/transport/xdr-streaming.js") +, __webpack_require__(/*! ./transport/eventsource */ "./node_modules/sockjs-client/lib/transport/eventsource.js") +, __webpack_require__(/*! ./transport/lib/iframe-wrap */ "./node_modules/sockjs-client/lib/transport/lib/iframe-wrap.js")(__webpack_require__(/*! ./transport/eventsource */ "./node_modules/sockjs-client/lib/transport/eventsource.js")) + + // polling transports +, __webpack_require__(/*! ./transport/htmlfile */ "./node_modules/sockjs-client/lib/transport/htmlfile.js") +, __webpack_require__(/*! ./transport/lib/iframe-wrap */ "./node_modules/sockjs-client/lib/transport/lib/iframe-wrap.js")(__webpack_require__(/*! ./transport/htmlfile */ "./node_modules/sockjs-client/lib/transport/htmlfile.js")) +, __webpack_require__(/*! ./transport/xhr-polling */ "./node_modules/sockjs-client/lib/transport/xhr-polling.js") +, __webpack_require__(/*! ./transport/xdr-polling */ "./node_modules/sockjs-client/lib/transport/xdr-polling.js") +, __webpack_require__(/*! ./transport/lib/iframe-wrap */ "./node_modules/sockjs-client/lib/transport/lib/iframe-wrap.js")(__webpack_require__(/*! ./transport/xhr-polling */ "./node_modules/sockjs-client/lib/transport/xhr-polling.js")) +, __webpack_require__(/*! ./transport/jsonp-polling */ "./node_modules/sockjs-client/lib/transport/jsonp-polling.js") +]; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/browser/abstract-xhr.js": +/*!**************************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/browser/abstract-xhr.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + , inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , utils = __webpack_require__(/*! ../../utils/event */ "./node_modules/sockjs-client/lib/utils/event.js") + , urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js") + , XHR = global.XMLHttpRequest + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:browser:xhr'); +} + +function AbstractXHRObject(method, url, payload, opts) { + debug(method, url); + var self = this; + EventEmitter.call(this); + + setTimeout(function () { + self._start(method, url, payload, opts); + }, 0); +} + +inherits(AbstractXHRObject, EventEmitter); + +AbstractXHRObject.prototype._start = function(method, url, payload, opts) { + var self = this; + + try { + this.xhr = new XHR(); + } catch (x) { + // intentionally empty + } + + if (!this.xhr) { + debug('no xhr'); + this.emit('finish', 0, 'no xhr support'); + this._cleanup(); + return; + } + + // several browsers cache POSTs + url = urlUtils.addQuery(url, 't=' + (+new Date())); + + // Explorer tends to keep connection open, even after the + // tab gets closed: http://bugs.jquery.com/ticket/5280 + this.unloadRef = utils.unloadAdd(function() { + debug('unload cleanup'); + self._cleanup(true); + }); + try { + this.xhr.open(method, url, true); + if (this.timeout && 'timeout' in this.xhr) { + this.xhr.timeout = this.timeout; + this.xhr.ontimeout = function() { + debug('xhr timeout'); + self.emit('finish', 0, ''); + self._cleanup(false); + }; + } + } catch (e) { + debug('exception', e); + // IE raises an exception on wrong port. + this.emit('finish', 0, ''); + this._cleanup(false); + return; + } + + if ((!opts || !opts.noCredentials) && AbstractXHRObject.supportsCORS) { + debug('withCredentials'); + // Mozilla docs says https://developer.mozilla.org/en/XMLHttpRequest : + // "This never affects same-site requests." + + this.xhr.withCredentials = true; + } + if (opts && opts.headers) { + for (var key in opts.headers) { + this.xhr.setRequestHeader(key, opts.headers[key]); + } + } + + this.xhr.onreadystatechange = function() { + if (self.xhr) { + var x = self.xhr; + var text, status; + debug('readyState', x.readyState); + switch (x.readyState) { + case 3: + // IE doesn't like peeking into responseText or status + // on Microsoft.XMLHTTP and readystate=3 + try { + status = x.status; + text = x.responseText; + } catch (e) { + // intentionally empty + } + debug('status', status); + // IE returns 1223 for 204: http://bugs.jquery.com/ticket/1450 + if (status === 1223) { + status = 204; + } + + // IE does return readystate == 3 for 404 answers. + if (status === 200 && text && text.length > 0) { + debug('chunk'); + self.emit('chunk', status, text); + } + break; + case 4: + status = x.status; + debug('status', status); + // IE returns 1223 for 204: http://bugs.jquery.com/ticket/1450 + if (status === 1223) { + status = 204; + } + // IE returns this for a bad port + // http://msdn.microsoft.com/en-us/library/windows/desktop/aa383770(v=vs.85).aspx + if (status === 12005 || status === 12029) { + status = 0; + } + + debug('finish', status, x.responseText); + self.emit('finish', status, x.responseText); + self._cleanup(false); + break; + } + } + }; + + try { + self.xhr.send(payload); + } catch (e) { + self.emit('finish', 0, ''); + self._cleanup(false); + } +}; + +AbstractXHRObject.prototype._cleanup = function(abort) { + debug('cleanup'); + if (!this.xhr) { + return; + } + this.removeAllListeners(); + utils.unloadDel(this.unloadRef); + + // IE needs this field to be a function + this.xhr.onreadystatechange = function() {}; + if (this.xhr.ontimeout) { + this.xhr.ontimeout = null; + } + + if (abort) { + try { + this.xhr.abort(); + } catch (x) { + // intentionally empty + } + } + this.unloadRef = this.xhr = null; +}; + +AbstractXHRObject.prototype.close = function() { + debug('close'); + this._cleanup(true); +}; + +AbstractXHRObject.enabled = !!XHR; +// override XMLHttpRequest for IE6/7 +// obfuscate to avoid firewalls +var axo = ['Active'].concat('Object').join('X'); +if (!AbstractXHRObject.enabled && (axo in global)) { + debug('overriding xmlhttprequest'); + XHR = function() { + try { + return new global[axo]('Microsoft.XMLHTTP'); + } catch (e) { + return null; + } + }; + AbstractXHRObject.enabled = !!new XHR(); +} + +var cors = false; +try { + cors = 'withCredentials' in new XHR(); +} catch (ignored) { + // intentionally empty +} + +AbstractXHRObject.supportsCORS = cors; + +module.exports = AbstractXHRObject; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/browser/eventsource.js": +/*!*************************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/browser/eventsource.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {module.exports = global.EventSource; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/browser/websocket.js": +/*!***********************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/browser/websocket.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var Driver = global.WebSocket || global.MozWebSocket; +if (Driver) { + module.exports = function WebSocketBrowserDriver(url) { + return new Driver(url); + }; +} else { + module.exports = undefined; +} + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/eventsource.js": +/*!*****************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/eventsource.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , AjaxBasedTransport = __webpack_require__(/*! ./lib/ajax-based */ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js") + , EventSourceReceiver = __webpack_require__(/*! ./receiver/eventsource */ "./node_modules/sockjs-client/lib/transport/receiver/eventsource.js") + , XHRCorsObject = __webpack_require__(/*! ./sender/xhr-cors */ "./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js") + , EventSourceDriver = __webpack_require__(/*! eventsource */ "./node_modules/sockjs-client/lib/transport/browser/eventsource.js") + ; + +function EventSourceTransport(transUrl) { + if (!EventSourceTransport.enabled()) { + throw new Error('Transport created when disabled'); + } + + AjaxBasedTransport.call(this, transUrl, '/eventsource', EventSourceReceiver, XHRCorsObject); +} + +inherits(EventSourceTransport, AjaxBasedTransport); + +EventSourceTransport.enabled = function() { + return !!EventSourceDriver; +}; + +EventSourceTransport.transportName = 'eventsource'; +EventSourceTransport.roundTrips = 2; + +module.exports = EventSourceTransport; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/htmlfile.js": +/*!**************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/htmlfile.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , HtmlfileReceiver = __webpack_require__(/*! ./receiver/htmlfile */ "./node_modules/sockjs-client/lib/transport/receiver/htmlfile.js") + , XHRLocalObject = __webpack_require__(/*! ./sender/xhr-local */ "./node_modules/sockjs-client/lib/transport/sender/xhr-local.js") + , AjaxBasedTransport = __webpack_require__(/*! ./lib/ajax-based */ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js") + ; + +function HtmlFileTransport(transUrl) { + if (!HtmlfileReceiver.enabled) { + throw new Error('Transport created when disabled'); + } + AjaxBasedTransport.call(this, transUrl, '/htmlfile', HtmlfileReceiver, XHRLocalObject); +} + +inherits(HtmlFileTransport, AjaxBasedTransport); + +HtmlFileTransport.enabled = function(info) { + return HtmlfileReceiver.enabled && info.sameOrigin; +}; + +HtmlFileTransport.transportName = 'htmlfile'; +HtmlFileTransport.roundTrips = 2; + +module.exports = HtmlFileTransport; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/iframe.js": +/*!************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/iframe.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Few cool transports do work only for same-origin. In order to make +// them work cross-domain we shall use iframe, served from the +// remote domain. New browsers have capabilities to communicate with +// cross domain iframe using postMessage(). In IE it was implemented +// from IE 8+, but of course, IE got some details wrong: +// http://msdn.microsoft.com/en-us/library/cc197015(v=VS.85).aspx +// http://stevesouders.com/misc/test-postmessage.php + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , JSON3 = __webpack_require__(/*! json3 */ "./node_modules/json3/lib/json3.js") + , EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + , version = __webpack_require__(/*! ../version */ "./node_modules/sockjs-client/lib/version.js") + , urlUtils = __webpack_require__(/*! ../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js") + , iframeUtils = __webpack_require__(/*! ../utils/iframe */ "./node_modules/sockjs-client/lib/utils/iframe.js") + , eventUtils = __webpack_require__(/*! ../utils/event */ "./node_modules/sockjs-client/lib/utils/event.js") + , random = __webpack_require__(/*! ../utils/random */ "./node_modules/sockjs-client/lib/utils/random.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:transport:iframe'); +} + +function IframeTransport(transport, transUrl, baseUrl) { + if (!IframeTransport.enabled()) { + throw new Error('Transport created when disabled'); + } + EventEmitter.call(this); + + var self = this; + this.origin = urlUtils.getOrigin(baseUrl); + this.baseUrl = baseUrl; + this.transUrl = transUrl; + this.transport = transport; + this.windowId = random.string(8); + + var iframeUrl = urlUtils.addPath(baseUrl, '/iframe.html') + '#' + this.windowId; + debug(transport, transUrl, iframeUrl); + + this.iframeObj = iframeUtils.createIframe(iframeUrl, function(r) { + debug('err callback'); + self.emit('close', 1006, 'Unable to load an iframe (' + r + ')'); + self.close(); + }); + + this.onmessageCallback = this._message.bind(this); + eventUtils.attachEvent('message', this.onmessageCallback); +} + +inherits(IframeTransport, EventEmitter); + +IframeTransport.prototype.close = function() { + debug('close'); + this.removeAllListeners(); + if (this.iframeObj) { + eventUtils.detachEvent('message', this.onmessageCallback); + try { + // When the iframe is not loaded, IE raises an exception + // on 'contentWindow'. + this.postMessage('c'); + } catch (x) { + // intentionally empty + } + this.iframeObj.cleanup(); + this.iframeObj = null; + this.onmessageCallback = this.iframeObj = null; + } +}; + +IframeTransport.prototype._message = function(e) { + debug('message', e.data); + if (!urlUtils.isOriginEqual(e.origin, this.origin)) { + debug('not same origin', e.origin, this.origin); + return; + } + + var iframeMessage; + try { + iframeMessage = JSON3.parse(e.data); + } catch (ignored) { + debug('bad json', e.data); + return; + } + + if (iframeMessage.windowId !== this.windowId) { + debug('mismatched window id', iframeMessage.windowId, this.windowId); + return; + } + + switch (iframeMessage.type) { + case 's': + this.iframeObj.loaded(); + // window global dependency + this.postMessage('s', JSON3.stringify([ + version + , this.transport + , this.transUrl + , this.baseUrl + ])); + break; + case 't': + this.emit('message', iframeMessage.data); + break; + case 'c': + var cdata; + try { + cdata = JSON3.parse(iframeMessage.data); + } catch (ignored) { + debug('bad json', iframeMessage.data); + return; + } + this.emit('close', cdata[0], cdata[1]); + this.close(); + break; + } +}; + +IframeTransport.prototype.postMessage = function(type, data) { + debug('postMessage', type, data); + this.iframeObj.post(JSON3.stringify({ + windowId: this.windowId + , type: type + , data: data || '' + }), this.origin); +}; + +IframeTransport.prototype.send = function(message) { + debug('send', message); + this.postMessage('m', message); +}; + +IframeTransport.enabled = function() { + return iframeUtils.iframeEnabled; +}; + +IframeTransport.transportName = 'iframe'; +IframeTransport.roundTrips = 2; + +module.exports = IframeTransport; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/jsonp-polling.js": +/*!*******************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/jsonp-polling.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +// The simplest and most robust transport, using the well-know cross +// domain hack - JSONP. This transport is quite inefficient - one +// message could use up to one http request. But at least it works almost +// everywhere. +// Known limitations: +// o you will get a spinning cursor +// o for Konqueror a dumb timer is needed to detect errors + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , SenderReceiver = __webpack_require__(/*! ./lib/sender-receiver */ "./node_modules/sockjs-client/lib/transport/lib/sender-receiver.js") + , JsonpReceiver = __webpack_require__(/*! ./receiver/jsonp */ "./node_modules/sockjs-client/lib/transport/receiver/jsonp.js") + , jsonpSender = __webpack_require__(/*! ./sender/jsonp */ "./node_modules/sockjs-client/lib/transport/sender/jsonp.js") + ; + +function JsonPTransport(transUrl) { + if (!JsonPTransport.enabled()) { + throw new Error('Transport created when disabled'); + } + SenderReceiver.call(this, transUrl, '/jsonp', jsonpSender, JsonpReceiver); +} + +inherits(JsonPTransport, SenderReceiver); + +JsonPTransport.enabled = function() { + return !!global.document; +}; + +JsonPTransport.transportName = 'jsonp-polling'; +JsonPTransport.roundTrips = 1; +JsonPTransport.needBody = true; + +module.exports = JsonPTransport; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js": +/*!********************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/lib/ajax-based.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js") + , SenderReceiver = __webpack_require__(/*! ./sender-receiver */ "./node_modules/sockjs-client/lib/transport/lib/sender-receiver.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:ajax-based'); +} + +function createAjaxSender(AjaxObject) { + return function(url, payload, callback) { + debug('create ajax sender', url, payload); + var opt = {}; + if (typeof payload === 'string') { + opt.headers = {'Content-type': 'text/plain'}; + } + var ajaxUrl = urlUtils.addPath(url, '/xhr_send'); + var xo = new AjaxObject('POST', ajaxUrl, payload, opt); + xo.once('finish', function(status) { + debug('finish', status); + xo = null; + + if (status !== 200 && status !== 204) { + return callback(new Error('http status ' + status)); + } + callback(); + }); + return function() { + debug('abort'); + xo.close(); + xo = null; + + var err = new Error('Aborted'); + err.code = 1000; + callback(err); + }; + }; +} + +function AjaxBasedTransport(transUrl, urlSuffix, Receiver, AjaxObject) { + SenderReceiver.call(this, transUrl, urlSuffix, createAjaxSender(AjaxObject), Receiver, AjaxObject); +} + +inherits(AjaxBasedTransport, SenderReceiver); + +module.exports = AjaxBasedTransport; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/lib/buffered-sender.js": +/*!*************************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/lib/buffered-sender.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:buffered-sender'); +} + +function BufferedSender(url, sender) { + debug(url); + EventEmitter.call(this); + this.sendBuffer = []; + this.sender = sender; + this.url = url; +} + +inherits(BufferedSender, EventEmitter); + +BufferedSender.prototype.send = function(message) { + debug('send', message); + this.sendBuffer.push(message); + if (!this.sendStop) { + this.sendSchedule(); + } +}; + +// For polling transports in a situation when in the message callback, +// new message is being send. If the sending connection was started +// before receiving one, it is possible to saturate the network and +// timeout due to the lack of receiving socket. To avoid that we delay +// sending messages by some small time, in order to let receiving +// connection be started beforehand. This is only a halfmeasure and +// does not fix the big problem, but it does make the tests go more +// stable on slow networks. +BufferedSender.prototype.sendScheduleWait = function() { + debug('sendScheduleWait'); + var self = this; + var tref; + this.sendStop = function() { + debug('sendStop'); + self.sendStop = null; + clearTimeout(tref); + }; + tref = setTimeout(function() { + debug('timeout'); + self.sendStop = null; + self.sendSchedule(); + }, 25); +}; + +BufferedSender.prototype.sendSchedule = function() { + debug('sendSchedule', this.sendBuffer.length); + var self = this; + if (this.sendBuffer.length > 0) { + var payload = '[' + this.sendBuffer.join(',') + ']'; + this.sendStop = this.sender(this.url, payload, function(err) { + self.sendStop = null; + if (err) { + debug('error', err); + self.emit('close', err.code || 1006, 'Sending error: ' + err); + self.close(); + } else { + self.sendScheduleWait(); + } + }); + this.sendBuffer = []; + } +}; + +BufferedSender.prototype._cleanup = function() { + debug('_cleanup'); + this.removeAllListeners(); +}; + +BufferedSender.prototype.close = function() { + debug('close'); + this._cleanup(); + if (this.sendStop) { + this.sendStop(); + this.sendStop = null; + } +}; + +module.exports = BufferedSender; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/lib/iframe-wrap.js": +/*!*********************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/lib/iframe-wrap.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , IframeTransport = __webpack_require__(/*! ../iframe */ "./node_modules/sockjs-client/lib/transport/iframe.js") + , objectUtils = __webpack_require__(/*! ../../utils/object */ "./node_modules/sockjs-client/lib/utils/object.js") + ; + +module.exports = function(transport) { + + function IframeWrapTransport(transUrl, baseUrl) { + IframeTransport.call(this, transport.transportName, transUrl, baseUrl); + } + + inherits(IframeWrapTransport, IframeTransport); + + IframeWrapTransport.enabled = function(url, info) { + if (!global.document) { + return false; + } + + var iframeInfo = objectUtils.extend({}, info); + iframeInfo.sameOrigin = true; + return transport.enabled(iframeInfo) && IframeTransport.enabled(); + }; + + IframeWrapTransport.transportName = 'iframe-' + transport.transportName; + IframeWrapTransport.needBody = true; + IframeWrapTransport.roundTrips = IframeTransport.roundTrips + transport.roundTrips - 1; // html, javascript (2) + transport - no CORS (1) + + IframeWrapTransport.facadeTransport = transport; + + return IframeWrapTransport; +}; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/lib/polling.js": +/*!*****************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/lib/polling.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:polling'); +} + +function Polling(Receiver, receiveUrl, AjaxObject) { + debug(receiveUrl); + EventEmitter.call(this); + this.Receiver = Receiver; + this.receiveUrl = receiveUrl; + this.AjaxObject = AjaxObject; + this._scheduleReceiver(); +} + +inherits(Polling, EventEmitter); + +Polling.prototype._scheduleReceiver = function() { + debug('_scheduleReceiver'); + var self = this; + var poll = this.poll = new this.Receiver(this.receiveUrl, this.AjaxObject); + + poll.on('message', function(msg) { + debug('message', msg); + self.emit('message', msg); + }); + + poll.once('close', function(code, reason) { + debug('close', code, reason, self.pollIsClosing); + self.poll = poll = null; + + if (!self.pollIsClosing) { + if (reason === 'network') { + self._scheduleReceiver(); + } else { + self.emit('close', code || 1006, reason); + self.removeAllListeners(); + } + } + }); +}; + +Polling.prototype.abort = function() { + debug('abort'); + this.removeAllListeners(); + this.pollIsClosing = true; + if (this.poll) { + this.poll.abort(); + } +}; + +module.exports = Polling; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/lib/sender-receiver.js": +/*!*************************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/lib/sender-receiver.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js") + , BufferedSender = __webpack_require__(/*! ./buffered-sender */ "./node_modules/sockjs-client/lib/transport/lib/buffered-sender.js") + , Polling = __webpack_require__(/*! ./polling */ "./node_modules/sockjs-client/lib/transport/lib/polling.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:sender-receiver'); +} + +function SenderReceiver(transUrl, urlSuffix, senderFunc, Receiver, AjaxObject) { + var pollUrl = urlUtils.addPath(transUrl, urlSuffix); + debug(pollUrl); + var self = this; + BufferedSender.call(this, transUrl, senderFunc); + + this.poll = new Polling(Receiver, pollUrl, AjaxObject); + this.poll.on('message', function(msg) { + debug('poll message', msg); + self.emit('message', msg); + }); + this.poll.once('close', function(code, reason) { + debug('poll close', code, reason); + self.poll = null; + self.emit('close', code, reason); + self.close(); + }); +} + +inherits(SenderReceiver, BufferedSender); + +SenderReceiver.prototype.close = function() { + BufferedSender.prototype.close.call(this); + debug('close'); + this.removeAllListeners(); + if (this.poll) { + this.poll.abort(); + this.poll = null; + } +}; + +module.exports = SenderReceiver; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/receiver/eventsource.js": +/*!**************************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/receiver/eventsource.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + , EventSourceDriver = __webpack_require__(/*! eventsource */ "./node_modules/sockjs-client/lib/transport/browser/eventsource.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:receiver:eventsource'); +} + +function EventSourceReceiver(url) { + debug(url); + EventEmitter.call(this); + + var self = this; + var es = this.es = new EventSourceDriver(url); + es.onmessage = function(e) { + debug('message', e.data); + self.emit('message', decodeURI(e.data)); + }; + es.onerror = function(e) { + debug('error', es.readyState, e); + // ES on reconnection has readyState = 0 or 1. + // on network error it's CLOSED = 2 + var reason = (es.readyState !== 2 ? 'network' : 'permanent'); + self._cleanup(); + self._close(reason); + }; +} + +inherits(EventSourceReceiver, EventEmitter); + +EventSourceReceiver.prototype.abort = function() { + debug('abort'); + this._cleanup(); + this._close('user'); +}; + +EventSourceReceiver.prototype._cleanup = function() { + debug('cleanup'); + var es = this.es; + if (es) { + es.onmessage = es.onerror = null; + es.close(); + this.es = null; + } +}; + +EventSourceReceiver.prototype._close = function(reason) { + debug('close', reason); + var self = this; + // Safari and chrome < 15 crash if we close window before + // waiting for ES cleanup. See: + // https://code.google.com/p/chromium/issues/detail?id=89155 + setTimeout(function() { + self.emit('close', null, reason); + self.removeAllListeners(); + }, 200); +}; + +module.exports = EventSourceReceiver; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/receiver/htmlfile.js": +/*!***********************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/receiver/htmlfile.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , iframeUtils = __webpack_require__(/*! ../../utils/iframe */ "./node_modules/sockjs-client/lib/utils/iframe.js") + , urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js") + , EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + , random = __webpack_require__(/*! ../../utils/random */ "./node_modules/sockjs-client/lib/utils/random.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:receiver:htmlfile'); +} + +function HtmlfileReceiver(url) { + debug(url); + EventEmitter.call(this); + var self = this; + iframeUtils.polluteGlobalNamespace(); + + this.id = 'a' + random.string(6); + url = urlUtils.addQuery(url, 'c=' + decodeURIComponent(iframeUtils.WPrefix + '.' + this.id)); + + debug('using htmlfile', HtmlfileReceiver.htmlfileEnabled); + var constructFunc = HtmlfileReceiver.htmlfileEnabled ? + iframeUtils.createHtmlfile : iframeUtils.createIframe; + + global[iframeUtils.WPrefix][this.id] = { + start: function() { + debug('start'); + self.iframeObj.loaded(); + } + , message: function(data) { + debug('message', data); + self.emit('message', data); + } + , stop: function() { + debug('stop'); + self._cleanup(); + self._close('network'); + } + }; + this.iframeObj = constructFunc(url, function() { + debug('callback'); + self._cleanup(); + self._close('permanent'); + }); +} + +inherits(HtmlfileReceiver, EventEmitter); + +HtmlfileReceiver.prototype.abort = function() { + debug('abort'); + this._cleanup(); + this._close('user'); +}; + +HtmlfileReceiver.prototype._cleanup = function() { + debug('_cleanup'); + if (this.iframeObj) { + this.iframeObj.cleanup(); + this.iframeObj = null; + } + delete global[iframeUtils.WPrefix][this.id]; +}; + +HtmlfileReceiver.prototype._close = function(reason) { + debug('_close', reason); + this.emit('close', null, reason); + this.removeAllListeners(); +}; + +HtmlfileReceiver.htmlfileEnabled = false; + +// obfuscate to avoid firewalls +var axo = ['Active'].concat('Object').join('X'); +if (axo in global) { + try { + HtmlfileReceiver.htmlfileEnabled = !!new global[axo]('htmlfile'); + } catch (x) { + // intentionally empty + } +} + +HtmlfileReceiver.enabled = HtmlfileReceiver.htmlfileEnabled || iframeUtils.iframeEnabled; + +module.exports = HtmlfileReceiver; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/receiver/jsonp.js": +/*!********************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/receiver/jsonp.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var utils = __webpack_require__(/*! ../../utils/iframe */ "./node_modules/sockjs-client/lib/utils/iframe.js") + , random = __webpack_require__(/*! ../../utils/random */ "./node_modules/sockjs-client/lib/utils/random.js") + , browser = __webpack_require__(/*! ../../utils/browser */ "./node_modules/sockjs-client/lib/utils/browser.js") + , urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js") + , inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:receiver:jsonp'); +} + +function JsonpReceiver(url) { + debug(url); + var self = this; + EventEmitter.call(this); + + utils.polluteGlobalNamespace(); + + this.id = 'a' + random.string(6); + var urlWithId = urlUtils.addQuery(url, 'c=' + encodeURIComponent(utils.WPrefix + '.' + this.id)); + + global[utils.WPrefix][this.id] = this._callback.bind(this); + this._createScript(urlWithId); + + // Fallback mostly for Konqueror - stupid timer, 35 seconds shall be plenty. + this.timeoutId = setTimeout(function() { + debug('timeout'); + self._abort(new Error('JSONP script loaded abnormally (timeout)')); + }, JsonpReceiver.timeout); +} + +inherits(JsonpReceiver, EventEmitter); + +JsonpReceiver.prototype.abort = function() { + debug('abort'); + if (global[utils.WPrefix][this.id]) { + var err = new Error('JSONP user aborted read'); + err.code = 1000; + this._abort(err); + } +}; + +JsonpReceiver.timeout = 35000; +JsonpReceiver.scriptErrorTimeout = 1000; + +JsonpReceiver.prototype._callback = function(data) { + debug('_callback', data); + this._cleanup(); + + if (this.aborting) { + return; + } + + if (data) { + debug('message', data); + this.emit('message', data); + } + this.emit('close', null, 'network'); + this.removeAllListeners(); +}; + +JsonpReceiver.prototype._abort = function(err) { + debug('_abort', err); + this._cleanup(); + this.aborting = true; + this.emit('close', err.code, err.message); + this.removeAllListeners(); +}; + +JsonpReceiver.prototype._cleanup = function() { + debug('_cleanup'); + clearTimeout(this.timeoutId); + if (this.script2) { + this.script2.parentNode.removeChild(this.script2); + this.script2 = null; + } + if (this.script) { + var script = this.script; + // Unfortunately, you can't really abort script loading of + // the script. + script.parentNode.removeChild(script); + script.onreadystatechange = script.onerror = + script.onload = script.onclick = null; + this.script = null; + } + delete global[utils.WPrefix][this.id]; +}; + +JsonpReceiver.prototype._scriptError = function() { + debug('_scriptError'); + var self = this; + if (this.errorTimer) { + return; + } + + this.errorTimer = setTimeout(function() { + if (!self.loadedOkay) { + self._abort(new Error('JSONP script loaded abnormally (onerror)')); + } + }, JsonpReceiver.scriptErrorTimeout); +}; + +JsonpReceiver.prototype._createScript = function(url) { + debug('_createScript', url); + var self = this; + var script = this.script = global.document.createElement('script'); + var script2; // Opera synchronous load trick. + + script.id = 'a' + random.string(8); + script.src = url; + script.type = 'text/javascript'; + script.charset = 'UTF-8'; + script.onerror = this._scriptError.bind(this); + script.onload = function() { + debug('onload'); + self._abort(new Error('JSONP script loaded abnormally (onload)')); + }; + + // IE9 fires 'error' event after onreadystatechange or before, in random order. + // Use loadedOkay to determine if actually errored + script.onreadystatechange = function() { + debug('onreadystatechange', script.readyState); + if (/loaded|closed/.test(script.readyState)) { + if (script && script.htmlFor && script.onclick) { + self.loadedOkay = true; + try { + // In IE, actually execute the script. + script.onclick(); + } catch (x) { + // intentionally empty + } + } + if (script) { + self._abort(new Error('JSONP script loaded abnormally (onreadystatechange)')); + } + } + }; + // IE: event/htmlFor/onclick trick. + // One can't rely on proper order for onreadystatechange. In order to + // make sure, set a 'htmlFor' and 'event' properties, so that + // script code will be installed as 'onclick' handler for the + // script object. Later, onreadystatechange, manually execute this + // code. FF and Chrome doesn't work with 'event' and 'htmlFor' + // set. For reference see: + // http://jaubourg.net/2010/07/loading-script-as-onclick-handler-of.html + // Also, read on that about script ordering: + // http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order + if (typeof script.async === 'undefined' && global.document.attachEvent) { + // According to mozilla docs, in recent browsers script.async defaults + // to 'true', so we may use it to detect a good browser: + // https://developer.mozilla.org/en/HTML/Element/script + if (!browser.isOpera()) { + // Naively assume we're in IE + try { + script.htmlFor = script.id; + script.event = 'onclick'; + } catch (x) { + // intentionally empty + } + script.async = true; + } else { + // Opera, second sync script hack + script2 = this.script2 = global.document.createElement('script'); + script2.text = "try{var a = document.getElementById('" + script.id + "'); if(a)a.onerror();}catch(x){};"; + script.async = script2.async = false; + } + } + if (typeof script.async !== 'undefined') { + script.async = true; + } + + var head = global.document.getElementsByTagName('head')[0]; + head.insertBefore(script, head.firstChild); + if (script2) { + head.insertBefore(script2, head.firstChild); + } +}; + +module.exports = JsonpReceiver; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/receiver/xhr.js": +/*!******************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/receiver/xhr.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:receiver:xhr'); +} + +function XhrReceiver(url, AjaxObject) { + debug(url); + EventEmitter.call(this); + var self = this; + + this.bufferPosition = 0; + + this.xo = new AjaxObject('POST', url, null); + this.xo.on('chunk', this._chunkHandler.bind(this)); + this.xo.once('finish', function(status, text) { + debug('finish', status, text); + self._chunkHandler(status, text); + self.xo = null; + var reason = status === 200 ? 'network' : 'permanent'; + debug('close', reason); + self.emit('close', null, reason); + self._cleanup(); + }); +} + +inherits(XhrReceiver, EventEmitter); + +XhrReceiver.prototype._chunkHandler = function(status, text) { + debug('_chunkHandler', status); + if (status !== 200 || !text) { + return; + } + + for (var idx = -1; ; this.bufferPosition += idx + 1) { + var buf = text.slice(this.bufferPosition); + idx = buf.indexOf('\n'); + if (idx === -1) { + break; + } + var msg = buf.slice(0, idx); + if (msg) { + debug('message', msg); + this.emit('message', msg); + } + } +}; + +XhrReceiver.prototype._cleanup = function() { + debug('_cleanup'); + this.removeAllListeners(); +}; + +XhrReceiver.prototype.abort = function() { + debug('abort'); + if (this.xo) { + this.xo.close(); + debug('close'); + this.emit('close', null, 'user'); + this.xo = null; + } + this._cleanup(); +}; + +module.exports = XhrReceiver; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/sender/jsonp.js": +/*!******************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/sender/jsonp.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var random = __webpack_require__(/*! ../../utils/random */ "./node_modules/sockjs-client/lib/utils/random.js") + , urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:sender:jsonp'); +} + +var form, area; + +function createIframe(id) { + debug('createIframe', id); + try { + // ie6 dynamic iframes with target="" support (thanks Chris Lambacher) + return global.document.createElement(''); + } catch (x) { + var iframe = global.document.createElement('iframe'); + iframe.name = id; + return iframe; + } +} + +function createForm() { + debug('createForm'); + form = global.document.createElement('form'); + form.style.display = 'none'; + form.style.position = 'absolute'; + form.method = 'POST'; + form.enctype = 'application/x-www-form-urlencoded'; + form.acceptCharset = 'UTF-8'; + + area = global.document.createElement('textarea'); + area.name = 'd'; + form.appendChild(area); + + global.document.body.appendChild(form); +} + +module.exports = function(url, payload, callback) { + debug(url, payload); + if (!form) { + createForm(); + } + var id = 'a' + random.string(8); + form.target = id; + form.action = urlUtils.addQuery(urlUtils.addPath(url, '/jsonp_send'), 'i=' + id); + + var iframe = createIframe(id); + iframe.id = id; + iframe.style.display = 'none'; + form.appendChild(iframe); + + try { + area.value = payload; + } catch (e) { + // seriously broken browsers get here + } + form.submit(); + + var completed = function(err) { + debug('completed', id, err); + if (!iframe.onerror) { + return; + } + iframe.onreadystatechange = iframe.onerror = iframe.onload = null; + // Opera mini doesn't like if we GC iframe + // immediately, thus this timeout. + setTimeout(function() { + debug('cleaning up', id); + iframe.parentNode.removeChild(iframe); + iframe = null; + }, 500); + area.value = ''; + // It is not possible to detect if the iframe succeeded or + // failed to submit our form. + callback(err); + }; + iframe.onerror = function() { + debug('onerror', id); + completed(); + }; + iframe.onload = function() { + debug('onload', id); + completed(); + }; + iframe.onreadystatechange = function(e) { + debug('onreadystatechange', id, iframe.readyState, e); + if (iframe.readyState === 'complete') { + completed(); + } + }; + return function() { + debug('aborted', id); + completed(new Error('Aborted')); + }; +}; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/sender/xdr.js": +/*!****************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/sender/xdr.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + , inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , eventUtils = __webpack_require__(/*! ../../utils/event */ "./node_modules/sockjs-client/lib/utils/event.js") + , browser = __webpack_require__(/*! ../../utils/browser */ "./node_modules/sockjs-client/lib/utils/browser.js") + , urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:sender:xdr'); +} + +// References: +// http://ajaxian.com/archives/100-line-ajax-wrapper +// http://msdn.microsoft.com/en-us/library/cc288060(v=VS.85).aspx + +function XDRObject(method, url, payload) { + debug(method, url); + var self = this; + EventEmitter.call(this); + + setTimeout(function() { + self._start(method, url, payload); + }, 0); +} + +inherits(XDRObject, EventEmitter); + +XDRObject.prototype._start = function(method, url, payload) { + debug('_start'); + var self = this; + var xdr = new global.XDomainRequest(); + // IE caches even POSTs + url = urlUtils.addQuery(url, 't=' + (+new Date())); + + xdr.onerror = function() { + debug('onerror'); + self._error(); + }; + xdr.ontimeout = function() { + debug('ontimeout'); + self._error(); + }; + xdr.onprogress = function() { + debug('progress', xdr.responseText); + self.emit('chunk', 200, xdr.responseText); + }; + xdr.onload = function() { + debug('load'); + self.emit('finish', 200, xdr.responseText); + self._cleanup(false); + }; + this.xdr = xdr; + this.unloadRef = eventUtils.unloadAdd(function() { + self._cleanup(true); + }); + try { + // Fails with AccessDenied if port number is bogus + this.xdr.open(method, url); + if (this.timeout) { + this.xdr.timeout = this.timeout; + } + this.xdr.send(payload); + } catch (x) { + this._error(); + } +}; + +XDRObject.prototype._error = function() { + this.emit('finish', 0, ''); + this._cleanup(false); +}; + +XDRObject.prototype._cleanup = function(abort) { + debug('cleanup', abort); + if (!this.xdr) { + return; + } + this.removeAllListeners(); + eventUtils.unloadDel(this.unloadRef); + + this.xdr.ontimeout = this.xdr.onerror = this.xdr.onprogress = this.xdr.onload = null; + if (abort) { + try { + this.xdr.abort(); + } catch (x) { + // intentionally empty + } + } + this.unloadRef = this.xdr = null; +}; + +XDRObject.prototype.close = function() { + debug('close'); + this._cleanup(true); +}; + +// IE 8/9 if the request target uses the same scheme - #79 +XDRObject.enabled = !!(global.XDomainRequest && browser.hasDomain()); + +module.exports = XDRObject; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js": +/*!*********************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , XhrDriver = __webpack_require__(/*! ../driver/xhr */ "./node_modules/sockjs-client/lib/transport/browser/abstract-xhr.js") + ; + +function XHRCorsObject(method, url, payload, opts) { + XhrDriver.call(this, method, url, payload, opts); +} + +inherits(XHRCorsObject, XhrDriver); + +XHRCorsObject.enabled = XhrDriver.enabled && XhrDriver.supportsCORS; + +module.exports = XHRCorsObject; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/sender/xhr-fake.js": +/*!*********************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/sender/xhr-fake.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + , inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + ; + +function XHRFake(/* method, url, payload, opts */) { + var self = this; + EventEmitter.call(this); + + this.to = setTimeout(function() { + self.emit('finish', 200, '{}'); + }, XHRFake.timeout); +} + +inherits(XHRFake, EventEmitter); + +XHRFake.prototype.close = function() { + clearTimeout(this.to); +}; + +XHRFake.timeout = 2000; + +module.exports = XHRFake; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/sender/xhr-local.js": +/*!**********************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/sender/xhr-local.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , XhrDriver = __webpack_require__(/*! ../driver/xhr */ "./node_modules/sockjs-client/lib/transport/browser/abstract-xhr.js") + ; + +function XHRLocalObject(method, url, payload /*, opts */) { + XhrDriver.call(this, method, url, payload, { + noCredentials: true + }); +} + +inherits(XHRLocalObject, XhrDriver); + +XHRLocalObject.enabled = XhrDriver.enabled; + +module.exports = XHRLocalObject; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/websocket.js": +/*!***************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/websocket.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils/event */ "./node_modules/sockjs-client/lib/utils/event.js") + , urlUtils = __webpack_require__(/*! ../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js") + , inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , EventEmitter = __webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter + , WebsocketDriver = __webpack_require__(/*! ./driver/websocket */ "./node_modules/sockjs-client/lib/transport/browser/websocket.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:websocket'); +} + +function WebSocketTransport(transUrl, ignore, options) { + if (!WebSocketTransport.enabled()) { + throw new Error('Transport created when disabled'); + } + + EventEmitter.call(this); + debug('constructor', transUrl); + + var self = this; + var url = urlUtils.addPath(transUrl, '/websocket'); + if (url.slice(0, 5) === 'https') { + url = 'wss' + url.slice(5); + } else { + url = 'ws' + url.slice(4); + } + this.url = url; + + this.ws = new WebsocketDriver(this.url, [], options); + this.ws.onmessage = function(e) { + debug('message event', e.data); + self.emit('message', e.data); + }; + // Firefox has an interesting bug. If a websocket connection is + // created after onunload, it stays alive even when user + // navigates away from the page. In such situation let's lie - + // let's not open the ws connection at all. See: + // https://github.com/sockjs/sockjs-client/issues/28 + // https://bugzilla.mozilla.org/show_bug.cgi?id=696085 + this.unloadRef = utils.unloadAdd(function() { + debug('unload'); + self.ws.close(); + }); + this.ws.onclose = function(e) { + debug('close event', e.code, e.reason); + self.emit('close', e.code, e.reason); + self._cleanup(); + }; + this.ws.onerror = function(e) { + debug('error event', e); + self.emit('close', 1006, 'WebSocket connection broken'); + self._cleanup(); + }; +} + +inherits(WebSocketTransport, EventEmitter); + +WebSocketTransport.prototype.send = function(data) { + var msg = '[' + data + ']'; + debug('send', msg); + this.ws.send(msg); +}; + +WebSocketTransport.prototype.close = function() { + debug('close'); + var ws = this.ws; + this._cleanup(); + if (ws) { + ws.close(); + } +}; + +WebSocketTransport.prototype._cleanup = function() { + debug('_cleanup'); + var ws = this.ws; + if (ws) { + ws.onmessage = ws.onclose = ws.onerror = null; + } + utils.unloadDel(this.unloadRef); + this.unloadRef = this.ws = null; + this.removeAllListeners(); +}; + +WebSocketTransport.enabled = function() { + debug('enabled'); + return !!WebsocketDriver; +}; +WebSocketTransport.transportName = 'websocket'; + +// In theory, ws should require 1 round trip. But in chrome, this is +// not very stable over SSL. Most likely a ws connection requires a +// separate SSL connection, in which case 2 round trips are an +// absolute minumum. +WebSocketTransport.roundTrips = 2; + +module.exports = WebSocketTransport; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/xdr-polling.js": +/*!*****************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/xdr-polling.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , AjaxBasedTransport = __webpack_require__(/*! ./lib/ajax-based */ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js") + , XdrStreamingTransport = __webpack_require__(/*! ./xdr-streaming */ "./node_modules/sockjs-client/lib/transport/xdr-streaming.js") + , XhrReceiver = __webpack_require__(/*! ./receiver/xhr */ "./node_modules/sockjs-client/lib/transport/receiver/xhr.js") + , XDRObject = __webpack_require__(/*! ./sender/xdr */ "./node_modules/sockjs-client/lib/transport/sender/xdr.js") + ; + +function XdrPollingTransport(transUrl) { + if (!XDRObject.enabled) { + throw new Error('Transport created when disabled'); + } + AjaxBasedTransport.call(this, transUrl, '/xhr', XhrReceiver, XDRObject); +} + +inherits(XdrPollingTransport, AjaxBasedTransport); + +XdrPollingTransport.enabled = XdrStreamingTransport.enabled; +XdrPollingTransport.transportName = 'xdr-polling'; +XdrPollingTransport.roundTrips = 2; // preflight, ajax + +module.exports = XdrPollingTransport; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/xdr-streaming.js": +/*!*******************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/xdr-streaming.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , AjaxBasedTransport = __webpack_require__(/*! ./lib/ajax-based */ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js") + , XhrReceiver = __webpack_require__(/*! ./receiver/xhr */ "./node_modules/sockjs-client/lib/transport/receiver/xhr.js") + , XDRObject = __webpack_require__(/*! ./sender/xdr */ "./node_modules/sockjs-client/lib/transport/sender/xdr.js") + ; + +// According to: +// http://stackoverflow.com/questions/1641507/detect-browser-support-for-cross-domain-xmlhttprequests +// http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ + +function XdrStreamingTransport(transUrl) { + if (!XDRObject.enabled) { + throw new Error('Transport created when disabled'); + } + AjaxBasedTransport.call(this, transUrl, '/xhr_streaming', XhrReceiver, XDRObject); +} + +inherits(XdrStreamingTransport, AjaxBasedTransport); + +XdrStreamingTransport.enabled = function(info) { + if (info.cookie_needed || info.nullOrigin) { + return false; + } + return XDRObject.enabled && info.sameScheme; +}; + +XdrStreamingTransport.transportName = 'xdr-streaming'; +XdrStreamingTransport.roundTrips = 2; // preflight, ajax + +module.exports = XdrStreamingTransport; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/xhr-polling.js": +/*!*****************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/xhr-polling.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , AjaxBasedTransport = __webpack_require__(/*! ./lib/ajax-based */ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js") + , XhrReceiver = __webpack_require__(/*! ./receiver/xhr */ "./node_modules/sockjs-client/lib/transport/receiver/xhr.js") + , XHRCorsObject = __webpack_require__(/*! ./sender/xhr-cors */ "./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js") + , XHRLocalObject = __webpack_require__(/*! ./sender/xhr-local */ "./node_modules/sockjs-client/lib/transport/sender/xhr-local.js") + ; + +function XhrPollingTransport(transUrl) { + if (!XHRLocalObject.enabled && !XHRCorsObject.enabled) { + throw new Error('Transport created when disabled'); + } + AjaxBasedTransport.call(this, transUrl, '/xhr', XhrReceiver, XHRCorsObject); +} + +inherits(XhrPollingTransport, AjaxBasedTransport); + +XhrPollingTransport.enabled = function(info) { + if (info.nullOrigin) { + return false; + } + + if (XHRLocalObject.enabled && info.sameOrigin) { + return true; + } + return XHRCorsObject.enabled; +}; + +XhrPollingTransport.transportName = 'xhr-polling'; +XhrPollingTransport.roundTrips = 2; // preflight, ajax + +module.exports = XhrPollingTransport; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/transport/xhr-streaming.js": +/*!*******************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/transport/xhr-streaming.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") + , AjaxBasedTransport = __webpack_require__(/*! ./lib/ajax-based */ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js") + , XhrReceiver = __webpack_require__(/*! ./receiver/xhr */ "./node_modules/sockjs-client/lib/transport/receiver/xhr.js") + , XHRCorsObject = __webpack_require__(/*! ./sender/xhr-cors */ "./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js") + , XHRLocalObject = __webpack_require__(/*! ./sender/xhr-local */ "./node_modules/sockjs-client/lib/transport/sender/xhr-local.js") + , browser = __webpack_require__(/*! ../utils/browser */ "./node_modules/sockjs-client/lib/utils/browser.js") + ; + +function XhrStreamingTransport(transUrl) { + if (!XHRLocalObject.enabled && !XHRCorsObject.enabled) { + throw new Error('Transport created when disabled'); + } + AjaxBasedTransport.call(this, transUrl, '/xhr_streaming', XhrReceiver, XHRCorsObject); +} + +inherits(XhrStreamingTransport, AjaxBasedTransport); + +XhrStreamingTransport.enabled = function(info) { + if (info.nullOrigin) { + return false; + } + // Opera doesn't support xhr-streaming #60 + // But it might be able to #92 + if (browser.isOpera()) { + return false; + } + + return XHRCorsObject.enabled; +}; + +XhrStreamingTransport.transportName = 'xhr-streaming'; +XhrStreamingTransport.roundTrips = 2; // preflight, ajax + +// Safari gets confused when a streaming ajax request is started +// before onload. This causes the load indicator to spin indefinetely. +// Only require body when used in a browser +XhrStreamingTransport.needBody = !!global.document; + +module.exports = XhrStreamingTransport; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/utils/browser-crypto.js": +/*!****************************************************************!*\ + !*** ./node_modules/sockjs-client/lib/utils/browser-crypto.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +if (global.crypto && global.crypto.getRandomValues) { + module.exports.randomBytes = function(length) { + var bytes = new Uint8Array(length); + global.crypto.getRandomValues(bytes); + return bytes; + }; +} else { + module.exports.randomBytes = function(length) { + var bytes = new Array(length); + for (var i = 0; i < length; i++) { + bytes[i] = Math.floor(Math.random() * 256); + } + return bytes; + }; +} + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/utils/browser.js": +/*!*********************************************************!*\ + !*** ./node_modules/sockjs-client/lib/utils/browser.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +module.exports = { + isOpera: function() { + return global.navigator && + /opera/i.test(global.navigator.userAgent); + } + +, isKonqueror: function() { + return global.navigator && + /konqueror/i.test(global.navigator.userAgent); + } + + // #187 wrap document.domain in try/catch because of WP8 from file:/// +, hasDomain: function () { + // non-browser client always has a domain + if (!global.document) { + return true; + } + + try { + return !!global.document.domain; + } catch (e) { + return false; + } + } +}; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/utils/escape.js": +/*!********************************************************!*\ + !*** ./node_modules/sockjs-client/lib/utils/escape.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var JSON3 = __webpack_require__(/*! json3 */ "./node_modules/json3/lib/json3.js"); + +// Some extra characters that Chrome gets wrong, and substitutes with +// something else on the wire. +// eslint-disable-next-line no-control-regex +var extraEscapable = /[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g + , extraLookup; + +// This may be quite slow, so let's delay until user actually uses bad +// characters. +var unrollLookup = function(escapable) { + var i; + var unrolled = {}; + var c = []; + for (i = 0; i < 65536; i++) { + c.push( String.fromCharCode(i) ); + } + escapable.lastIndex = 0; + c.join('').replace(escapable, function(a) { + unrolled[ a ] = '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + return ''; + }); + escapable.lastIndex = 0; + return unrolled; +}; + +// Quote string, also taking care of unicode characters that browsers +// often break. Especially, take care of unicode surrogates: +// http://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Surrogates +module.exports = { + quote: function(string) { + var quoted = JSON3.stringify(string); + + // In most cases this should be very fast and good enough. + extraEscapable.lastIndex = 0; + if (!extraEscapable.test(quoted)) { + return quoted; + } + + if (!extraLookup) { + extraLookup = unrollLookup(extraEscapable); + } + + return quoted.replace(extraEscapable, function(a) { + return extraLookup[a]; + }); + } +}; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/utils/event.js": +/*!*******************************************************!*\ + !*** ./node_modules/sockjs-client/lib/utils/event.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var random = __webpack_require__(/*! ./random */ "./node_modules/sockjs-client/lib/utils/random.js"); + +var onUnload = {} + , afterUnload = false + // detect google chrome packaged apps because they don't allow the 'unload' event + , isChromePackagedApp = global.chrome && global.chrome.app && global.chrome.app.runtime + ; + +module.exports = { + attachEvent: function(event, listener) { + if (typeof global.addEventListener !== 'undefined') { + global.addEventListener(event, listener, false); + } else if (global.document && global.attachEvent) { + // IE quirks. + // According to: http://stevesouders.com/misc/test-postmessage.php + // the message gets delivered only to 'document', not 'window'. + global.document.attachEvent('on' + event, listener); + // I get 'window' for ie8. + global.attachEvent('on' + event, listener); + } + } + +, detachEvent: function(event, listener) { + if (typeof global.addEventListener !== 'undefined') { + global.removeEventListener(event, listener, false); + } else if (global.document && global.detachEvent) { + global.document.detachEvent('on' + event, listener); + global.detachEvent('on' + event, listener); + } + } + +, unloadAdd: function(listener) { + if (isChromePackagedApp) { + return null; + } + + var ref = random.string(8); + onUnload[ref] = listener; + if (afterUnload) { + setTimeout(this.triggerUnloadCallbacks, 0); + } + return ref; + } + +, unloadDel: function(ref) { + if (ref in onUnload) { + delete onUnload[ref]; + } + } + +, triggerUnloadCallbacks: function() { + for (var ref in onUnload) { + onUnload[ref](); + delete onUnload[ref]; + } + } +}; + +var unloadTriggered = function() { + if (afterUnload) { + return; + } + afterUnload = true; + module.exports.triggerUnloadCallbacks(); +}; + +// 'unload' alone is not reliable in opera within an iframe, but we +// can't use `beforeunload` as IE fires it on javascript: links. +if (!isChromePackagedApp) { + module.exports.attachEvent('unload', unloadTriggered); +} + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/utils/iframe.js": +/*!********************************************************!*\ + !*** ./node_modules/sockjs-client/lib/utils/iframe.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var eventUtils = __webpack_require__(/*! ./event */ "./node_modules/sockjs-client/lib/utils/event.js") + , JSON3 = __webpack_require__(/*! json3 */ "./node_modules/json3/lib/json3.js") + , browser = __webpack_require__(/*! ./browser */ "./node_modules/sockjs-client/lib/utils/browser.js") + ; + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:utils:iframe'); +} + +module.exports = { + WPrefix: '_jp' +, currentWindowId: null + +, polluteGlobalNamespace: function() { + if (!(module.exports.WPrefix in global)) { + global[module.exports.WPrefix] = {}; + } + } + +, postMessage: function(type, data) { + if (global.parent !== global) { + global.parent.postMessage(JSON3.stringify({ + windowId: module.exports.currentWindowId + , type: type + , data: data || '' + }), '*'); + } else { + debug('Cannot postMessage, no parent window.', type, data); + } + } + +, createIframe: function(iframeUrl, errorCallback) { + var iframe = global.document.createElement('iframe'); + var tref, unloadRef; + var unattach = function() { + debug('unattach'); + clearTimeout(tref); + // Explorer had problems with that. + try { + iframe.onload = null; + } catch (x) { + // intentionally empty + } + iframe.onerror = null; + }; + var cleanup = function() { + debug('cleanup'); + if (iframe) { + unattach(); + // This timeout makes chrome fire onbeforeunload event + // within iframe. Without the timeout it goes straight to + // onunload. + setTimeout(function() { + if (iframe) { + iframe.parentNode.removeChild(iframe); + } + iframe = null; + }, 0); + eventUtils.unloadDel(unloadRef); + } + }; + var onerror = function(err) { + debug('onerror', err); + if (iframe) { + cleanup(); + errorCallback(err); + } + }; + var post = function(msg, origin) { + debug('post', msg, origin); + setTimeout(function() { + try { + // When the iframe is not loaded, IE raises an exception + // on 'contentWindow'. + if (iframe && iframe.contentWindow) { + iframe.contentWindow.postMessage(msg, origin); + } + } catch (x) { + // intentionally empty + } + }, 0); + }; + + iframe.src = iframeUrl; + iframe.style.display = 'none'; + iframe.style.position = 'absolute'; + iframe.onerror = function() { + onerror('onerror'); + }; + iframe.onload = function() { + debug('onload'); + // `onload` is triggered before scripts on the iframe are + // executed. Give it few seconds to actually load stuff. + clearTimeout(tref); + tref = setTimeout(function() { + onerror('onload timeout'); + }, 2000); + }; + global.document.body.appendChild(iframe); + tref = setTimeout(function() { + onerror('timeout'); + }, 15000); + unloadRef = eventUtils.unloadAdd(cleanup); + return { + post: post + , cleanup: cleanup + , loaded: unattach + }; + } + +/* eslint no-undef: "off", new-cap: "off" */ +, createHtmlfile: function(iframeUrl, errorCallback) { + var axo = ['Active'].concat('Object').join('X'); + var doc = new global[axo]('htmlfile'); + var tref, unloadRef; + var iframe; + var unattach = function() { + clearTimeout(tref); + iframe.onerror = null; + }; + var cleanup = function() { + if (doc) { + unattach(); + eventUtils.unloadDel(unloadRef); + iframe.parentNode.removeChild(iframe); + iframe = doc = null; + CollectGarbage(); + } + }; + var onerror = function(r) { + debug('onerror', r); + if (doc) { + cleanup(); + errorCallback(r); + } + }; + var post = function(msg, origin) { + try { + // When the iframe is not loaded, IE raises an exception + // on 'contentWindow'. + setTimeout(function() { + if (iframe && iframe.contentWindow) { + iframe.contentWindow.postMessage(msg, origin); + } + }, 0); + } catch (x) { + // intentionally empty + } + }; + + doc.open(); + doc.write('' + + 'document.domain="' + global.document.domain + '";' + + ''); + doc.close(); + doc.parentWindow[module.exports.WPrefix] = global[module.exports.WPrefix]; + var c = doc.createElement('div'); + doc.body.appendChild(c); + iframe = doc.createElement('iframe'); + c.appendChild(iframe); + iframe.src = iframeUrl; + iframe.onerror = function() { + onerror('onerror'); + }; + tref = setTimeout(function() { + onerror('timeout'); + }, 15000); + unloadRef = eventUtils.unloadAdd(cleanup); + return { + post: post + , cleanup: cleanup + , loaded: unattach + }; + } +}; + +module.exports.iframeEnabled = false; +if (global.document) { + // postMessage misbehaves in konqueror 4.6.5 - the messages are delivered with + // huge delay, or not at all. + module.exports.iframeEnabled = (typeof global.postMessage === 'function' || + typeof global.postMessage === 'object') && (!browser.isKonqueror()); +} + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/utils/log.js": +/*!*****************************************************!*\ + !*** ./node_modules/sockjs-client/lib/utils/log.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var logObject = {}; +['log', 'debug', 'warn'].forEach(function (level) { + var levelExists; + + try { + levelExists = global.console && global.console[level] && global.console[level].apply; + } catch(e) { + // do nothing + } + + logObject[level] = levelExists ? function () { + return global.console[level].apply(global.console, arguments); + } : (level === 'log' ? function () {} : logObject.log); +}); + +module.exports = logObject; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/utils/object.js": +/*!********************************************************!*\ + !*** ./node_modules/sockjs-client/lib/utils/object.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + isObject: function(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; + } + +, extend: function(obj) { + if (!this.isObject(obj)) { + return obj; + } + var source, prop; + for (var i = 1, length = arguments.length; i < length; i++) { + source = arguments[i]; + for (prop in source) { + if (Object.prototype.hasOwnProperty.call(source, prop)) { + obj[prop] = source[prop]; + } + } + } + return obj; + } +}; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/utils/random.js": +/*!********************************************************!*\ + !*** ./node_modules/sockjs-client/lib/utils/random.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* global crypto:true */ +var crypto = __webpack_require__(/*! crypto */ "./node_modules/sockjs-client/lib/utils/browser-crypto.js"); + +// This string has length 32, a power of 2, so the modulus doesn't introduce a +// bias. +var _randomStringChars = 'abcdefghijklmnopqrstuvwxyz012345'; +module.exports = { + string: function(length) { + var max = _randomStringChars.length; + var bytes = crypto.randomBytes(length); + var ret = []; + for (var i = 0; i < length; i++) { + ret.push(_randomStringChars.substr(bytes[i] % max, 1)); + } + return ret.join(''); + } + +, number: function(max) { + return Math.floor(Math.random() * max); + } + +, numberString: function(max) { + var t = ('' + (max - 1)).length; + var p = new Array(t + 1).join('0'); + return (p + this.number(max)).slice(-t); + } +}; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/utils/transport.js": +/*!***********************************************************!*\ + !*** ./node_modules/sockjs-client/lib/utils/transport.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:utils:transport'); +} + +module.exports = function(availableTransports) { + return { + filterToEnabled: function(transportsWhitelist, info) { + var transports = { + main: [] + , facade: [] + }; + if (!transportsWhitelist) { + transportsWhitelist = []; + } else if (typeof transportsWhitelist === 'string') { + transportsWhitelist = [transportsWhitelist]; + } + + availableTransports.forEach(function(trans) { + if (!trans) { + return; + } + + if (trans.transportName === 'websocket' && info.websocket === false) { + debug('disabled from server', 'websocket'); + return; + } + + if (transportsWhitelist.length && + transportsWhitelist.indexOf(trans.transportName) === -1) { + debug('not in whitelist', trans.transportName); + return; + } + + if (trans.enabled(info)) { + debug('enabled', trans.transportName); + transports.main.push(trans); + if (trans.facadeTransport) { + transports.facade.push(trans.facadeTransport); + } + } else { + debug('disabled', trans.transportName); + } + }); + return transports; + } + }; +}; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/utils/url.js": +/*!*****************************************************!*\ + !*** ./node_modules/sockjs-client/lib/utils/url.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var URL = __webpack_require__(/*! url-parse */ "./node_modules/url-parse/index.js"); + +var debug = function() {}; +if (true) { + debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:utils:url'); +} + +module.exports = { + getOrigin: function(url) { + if (!url) { + return null; + } + + var p = new URL(url); + if (p.protocol === 'file:') { + return null; + } + + var port = p.port; + if (!port) { + port = (p.protocol === 'https:') ? '443' : '80'; + } + + return p.protocol + '//' + p.hostname + ':' + port; + } + +, isOriginEqual: function(a, b) { + var res = this.getOrigin(a) === this.getOrigin(b); + debug('same', a, b, res); + return res; + } + +, isSchemeEqual: function(a, b) { + return (a.split(':')[0] === b.split(':')[0]); + } + +, addPath: function (url, path) { + var qs = url.split('?'); + return qs[0] + path + (qs[1] ? '?' + qs[1] : ''); + } + +, addQuery: function (url, q) { + return url + (url.indexOf('?') === -1 ? ('?' + q) : ('&' + q)); + } +}; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/lib/version.js": +/*!***************************************************!*\ + !*** ./node_modules/sockjs-client/lib/version.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = '1.3.0'; + + +/***/ }), + +/***/ "./node_modules/sockjs-client/node_modules/debug/src/browser.js": +/*!**********************************************************************!*\ + !*** ./node_modules/sockjs-client/node_modules/debug/src/browser.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +/** + * Colors. + */ + +exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ +// eslint-disable-next-line complexity + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } // Internet Explorer and Edge do not support colors. + + + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + + + return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); +} +/** + * Colorize log arguments if enabled. + * + * @api public + */ + + +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function (match) { + if (match === '%%') { + return; + } + + index++; + + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + args.splice(lastC, 0, c); +} +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + + +function log() { + var _console; + + // This hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); +} +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? + } +} +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + +function load() { + var r; + + try { + r = exports.storage.getItem('debug'); + } catch (error) {} // Swallow + // XXX (@Qix-) should we be logging these? + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + + + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? + } +} + +module.exports = __webpack_require__(/*! ./common */ "./node_modules/sockjs-client/node_modules/debug/src/common.js")(exports); +var formatters = module.exports.formatters; +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; + + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/sockjs-client/node_modules/debug/src/common.js": +/*!*********************************************************************!*\ + !*** ./node_modules/sockjs-client/node_modules/debug/src/common.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/sockjs-client/node_modules/ms/index.js"); + Object.keys(env).forEach(function (key) { + createDebug[key] = env[key]; + }); + /** + * Active `debug` instances. + */ + + createDebug.instances = []; + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + + createDebug.formatters = {}; + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + + function selectColor(namespace) { + var hash = 0; + + for (var i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + + createDebug.selectColor = selectColor; + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + + function createDebug(namespace) { + var prevTime; + + function debug() { + // Disabled? + if (!debug.enabled) { + return; + } + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var self = debug; // Set `diff` timestamp + + var curr = Number(new Date()); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } // Apply any `formatters` transformations + + + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return match; + } + + index++; + var formatter = createDebug.formatters[format]; + + if (typeof formatter === 'function') { + var val = args[index]; + match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` + + args.splice(index, 1); + index--; + } + + return match; + }); // Apply env-specific formatting (colors, etc.) + + createDebug.formatArgs.call(self, args); + var logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = createDebug.enabled(namespace); + debug.useColors = createDebug.useColors(); + debug.color = selectColor(namespace); + debug.destroy = destroy; + debug.extend = extend; // Debug.formatArgs = formatArgs; + // debug.rawLog = rawLog; + // env-specific initialization logic for debug instances + + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + createDebug.instances.push(debug); + return debug; + } + + function destroy() { + var index = createDebug.instances.indexOf(this); + + if (index !== -1) { + createDebug.instances.splice(index, 1); + return true; + } + + return false; + } + + function extend(namespace, delimiter) { + return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + } + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + + + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.names = []; + createDebug.skips = []; + var i; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + + for (i = 0; i < createDebug.instances.length; i++) { + var instance = createDebug.instances[i]; + instance.enabled = createDebug.enabled(instance.namespace); + } + } + /** + * Disable debug output. + * + * @api public + */ + + + function disable() { + createDebug.enable(''); + } + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + + + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + var i; + var len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + + + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + + return val; + } + + createDebug.enable(createDebug.load()); + return createDebug; +} + +module.exports = setup; + + + +/***/ }), + +/***/ "./node_modules/sockjs-client/node_modules/ms/index.js": +/*!*************************************************************!*\ + !*** ./node_modules/sockjs-client/node_modules/ms/index.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} + + +/***/ }), + +/***/ "./node_modules/sprotty/css/sprotty.css": +/*!**********************************************!*\ + !*** ./node_modules/sprotty/css/sprotty.css ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +var content = __webpack_require__(/*! !../../css-loader/dist/cjs.js!./sprotty.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sprotty/css/sprotty.css"); + +if(typeof content === 'string') content = [[module.i, content, '']]; + +var transform; +var insertInto; + + + +var options = {"hmr":true} + +options.transform = transform +options.insertInto = undefined; + +var update = __webpack_require__(/*! ../../style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); + +if(content.locals) module.exports = content.locals; + +if(false) {} + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/actions/action-dispatcher.js": +/*!********************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/actions/action-dispatcher.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var smodel_factory_1 = __webpack_require__(/*! ../model/smodel-factory */ "./node_modules/sprotty/lib/base/model/smodel-factory.js"); +var animation_frame_syncer_1 = __webpack_require__(/*! ../animations/animation-frame-syncer */ "./node_modules/sprotty/lib/base/animations/animation-frame-syncer.js"); +var set_model_1 = __webpack_require__(/*! ../features/set-model */ "./node_modules/sprotty/lib/base/features/set-model.js"); +var undo_redo_1 = __webpack_require__(/*! ../../features/undo-redo/undo-redo */ "./node_modules/sprotty/lib/features/undo-redo/undo-redo.js"); +var action_1 = __webpack_require__(/*! ./action */ "./node_modules/sprotty/lib/base/actions/action.js"); +/** + * Collects actions, converts them to commands and dispatches them. + * Also acts as the proxy to model sources such as diagram servers. + */ +var ActionDispatcher = /** @class */ (function () { + function ActionDispatcher() { + this.postponedActions = []; + } + ActionDispatcher.prototype.initialize = function () { + var _this = this; + if (!this.initialized) { + this.initialized = this.actionHandlerRegistryProvider().then(function (registry) { + _this.actionHandlerRegistry = registry; + _this.handleAction(new set_model_1.SetModelAction(smodel_factory_1.EMPTY_ROOT)); + }); + } + return this.initialized; + }; + ActionDispatcher.prototype.dispatchAll = function (actions) { + var _this = this; + return Promise.all(actions.map(function (action) { return _this.dispatch(action); })); + }; + ActionDispatcher.prototype.dispatch = function (action) { + var _this = this; + return this.initialize().then(function () { + if (_this.blockUntil !== undefined) { + return _this.handleBlocked(action, _this.blockUntil); + } + else if (action.kind === undo_redo_1.UndoAction.KIND) { + return _this.commandStack.undo().then(function () { }); + } + else if (action.kind === undo_redo_1.RedoAction.KIND) { + return _this.commandStack.redo().then(function () { }); + } + else { + return _this.handleAction(action); + } + }); + }; + ActionDispatcher.prototype.handleAction = function (action) { + this.logger.log(this, 'handle', action); + var handlers = this.actionHandlerRegistry.get(action.kind); + if (handlers.length > 0) { + var promises = []; + for (var _i = 0, handlers_1 = handlers; _i < handlers_1.length; _i++) { + var handler = handlers_1[_i]; + var result = handler.handle(action); + if (action_1.isAction(result)) { + promises.push(this.dispatch(result)); + } + else if (result !== undefined) { + promises.push(this.commandStack.execute(result)); + this.blockUntil = result.blockUntil; + } + } + return Promise.all(promises); + } + else { + this.logger.warn(this, 'Missing handler for action', action); + return Promise.reject("Missing handler for action '" + action.kind + "'"); + } + }; + ActionDispatcher.prototype.handleBlocked = function (action, predicate) { + var _this = this; + if (predicate(action)) { + this.blockUntil = undefined; + var result = this.handleAction(action); + var actions = this.postponedActions; + this.postponedActions = []; + for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) { + var a = actions_1[_i]; + this.dispatch(a.action).then(a.resolve, a.reject); + } + return result; + } + else { + this.logger.log(this, 'Action is postponed due to block condition', action); + return new Promise(function (resolve, reject) { + _this.postponedActions.push({ action: action, resolve: resolve, reject: reject }); + }); + } + }; + __decorate([ + inversify_1.inject(types_1.TYPES.ActionHandlerRegistryProvider), + __metadata("design:type", Function) + ], ActionDispatcher.prototype, "actionHandlerRegistryProvider", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.ICommandStack), + __metadata("design:type", Object) + ], ActionDispatcher.prototype, "commandStack", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.ILogger), + __metadata("design:type", Object) + ], ActionDispatcher.prototype, "logger", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.AnimationFrameSyncer), + __metadata("design:type", animation_frame_syncer_1.AnimationFrameSyncer) + ], ActionDispatcher.prototype, "syncer", void 0); + ActionDispatcher = __decorate([ + inversify_1.injectable() + ], ActionDispatcher); + return ActionDispatcher; +}()); +exports.ActionDispatcher = ActionDispatcher; +//# sourceMappingURL=action-dispatcher.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/actions/action-handler.js": +/*!*****************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/actions/action-handler.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var registry_1 = __webpack_require__(/*! ../../utils/registry */ "./node_modules/sprotty/lib/utils/registry.js"); +/** + * The action handler registry maps actions to their handlers using the Action.kind property. + */ +var ActionHandlerRegistry = /** @class */ (function (_super) { + __extends(ActionHandlerRegistry, _super); + function ActionHandlerRegistry(initializers) { + var _this = _super.call(this) || this; + initializers.forEach(function (initializer) { return _this.initializeActionHandler(initializer); }); + return _this; + } + ActionHandlerRegistry.prototype.initializeActionHandler = function (initializer) { + initializer.initialize(this); + }; + ActionHandlerRegistry = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.multiInject(types_1.TYPES.IActionHandlerInitializer)), __param(0, inversify_1.optional()), + __metadata("design:paramtypes", [Array]) + ], ActionHandlerRegistry); + return ActionHandlerRegistry; +}(registry_1.MultiInstanceRegistry)); +exports.ActionHandlerRegistry = ActionHandlerRegistry; +//# sourceMappingURL=action-handler.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/actions/action.js": +/*!*********************************************************!*\ + !*** ./node_modules/sprotty/lib/base/actions/action.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +function isAction(object) { + return object !== undefined && object.hasOwnProperty('kind') && typeof (object['kind']) === 'string'; +} +exports.isAction = isAction; +//# sourceMappingURL=action.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/animations/animation-frame-syncer.js": +/*!****************************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/animations/animation-frame-syncer.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var AnimationFrameSyncer = /** @class */ (function () { + function AnimationFrameSyncer() { + this.tasks = []; + this.endTasks = []; + this.triggered = false; + } + AnimationFrameSyncer.prototype.isAvailable = function () { + return typeof requestAnimationFrame === "function"; + }; + AnimationFrameSyncer.prototype.onNextFrame = function (task) { + this.tasks.push(task); + this.trigger(); + }; + AnimationFrameSyncer.prototype.onEndOfNextFrame = function (task) { + this.endTasks.push(task); + this.trigger(); + }; + AnimationFrameSyncer.prototype.trigger = function () { + var _this = this; + if (!this.triggered) { + this.triggered = true; + if (this.isAvailable()) + requestAnimationFrame(function (time) { return _this.run(time); }); + else + setTimeout(function (time) { return _this.run(time); }); + } + }; + AnimationFrameSyncer.prototype.run = function (time) { + var tasks = this.tasks; + var endTasks = this.endTasks; + this.triggered = false; + this.tasks = []; + this.endTasks = []; + tasks.forEach(function (task) { return task.call(undefined, time); }); + endTasks.forEach(function (task) { return task.call(undefined, time); }); + }; + AnimationFrameSyncer = __decorate([ + inversify_1.injectable() + ], AnimationFrameSyncer); + return AnimationFrameSyncer; +}()); +exports.AnimationFrameSyncer = AnimationFrameSyncer; +//# sourceMappingURL=animation-frame-syncer.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/animations/animation.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/animations/animation.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var easing_1 = __webpack_require__(/*! ./easing */ "./node_modules/sprotty/lib/base/animations/easing.js"); +/** + * An animation uses the rendering loop of the browser to smoothly + * calculate a transition between two states of a model element. + */ +var Animation = /** @class */ (function () { + function Animation(context, ease) { + if (ease === void 0) { ease = easing_1.easeInOut; } + this.context = context; + this.ease = ease; + } + Animation.prototype.start = function () { + var _this = this; + return new Promise(function (resolve, reject) { + var start = undefined; + var frames = 0; + var lambda = function (time) { + frames++; + var dtime; + if (start === undefined) { + start = time; + dtime = 0; + } + else { + dtime = time - start; + } + var t = Math.min(1, dtime / _this.context.duration); + var current = _this.tween(_this.ease(t), _this.context); + _this.context.modelChanged.update(current); + if (t === 1) { + _this.context.logger.log(_this, (frames * 1000 / _this.context.duration) + ' fps'); + resolve(current); + } + else { + _this.context.syncer.onNextFrame(lambda); + } + }; + if (_this.context.syncer.isAvailable()) { + _this.context.syncer.onNextFrame(lambda); + } + else { + var finalModel = _this.tween(1, _this.context); + resolve(finalModel); + } + }); + }; + return Animation; +}()); +exports.Animation = Animation; +var CompoundAnimation = /** @class */ (function (_super) { + __extends(CompoundAnimation, _super); + function CompoundAnimation(model, context, components, ease) { + if (components === void 0) { components = []; } + if (ease === void 0) { ease = easing_1.easeInOut; } + var _this = _super.call(this, context, ease) || this; + _this.model = model; + _this.context = context; + _this.components = components; + _this.ease = ease; + return _this; + } + CompoundAnimation.prototype.include = function (animation) { + this.components.push(animation); + return this; + }; + CompoundAnimation.prototype.tween = function (t, context) { + for (var _i = 0, _a = this.components; _i < _a.length; _i++) { + var a = _a[_i]; + a.tween(t, context); + } + return this.model; + }; + return CompoundAnimation; +}(Animation)); +exports.CompoundAnimation = CompoundAnimation; +//# sourceMappingURL=animation.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/animations/easing.js": +/*!************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/animations/easing.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Slows down animations towards the begin and the end. + * + * @param x the value between 0 (start of animation) and 1 (end of + * animation) linearly interpolated in time. + * @returns {number} the eased value between 0 and 1 + */ +function easeInOut(x) { + if (x < 0.5) + return x * x * 2; + else + return 1 - (1 - x) * (1 - x) * 2; +} +exports.easeInOut = easeInOut; +//# sourceMappingURL=easing.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/commands/command-registration.js": +/*!************************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/commands/command-registration.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2019 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var inversify_2 = __webpack_require__(/*! ../../utils/inversify */ "./node_modules/sprotty/lib/utils/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var CommandActionHandler = /** @class */ (function () { + function CommandActionHandler(commandRegistration) { + this.commandRegistration = commandRegistration; + } + CommandActionHandler.prototype.handle = function (action) { + return this.commandRegistration.factory(action); + }; + return CommandActionHandler; +}()); +exports.CommandActionHandler = CommandActionHandler; +var CommandActionHandlerInitializer = /** @class */ (function () { + function CommandActionHandlerInitializer(registrations) { + this.registrations = registrations; + } + CommandActionHandlerInitializer.prototype.initialize = function (registry) { + this.registrations.forEach(function (registration) { + return registry.register(registration.kind, new CommandActionHandler(registration)); + }); + }; + CommandActionHandlerInitializer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.multiInject(types_1.TYPES.CommandRegistration)), __param(0, inversify_1.optional()), + __metadata("design:paramtypes", [Array]) + ], CommandActionHandlerInitializer); + return CommandActionHandlerInitializer; +}()); +exports.CommandActionHandlerInitializer = CommandActionHandlerInitializer; +/** + * Use this method in your DI configuration to register a new command to the diagram. + */ +function configureCommand(context, constr) { + if (inversify_2.isInjectable(constr)) { + if (!context.isBound(constr)) + context.bind(constr).toSelf(); + context.bind(types_1.TYPES.CommandRegistration).toDynamicValue(function (ctx) { + return { + factory: function (action) { + var childContainer = new inversify_1.Container(); + childContainer.parent = ctx.container; + childContainer.bind(types_1.TYPES.Action).toConstantValue(action); + return childContainer.get(constr); + }, + kind: constr.KIND + }; + }); + } + else { + throw Error("Commands should be @injectable " + constr.name); + } +} +exports.configureCommand = configureCommand; +//# sourceMappingURL=command-registration.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/commands/command-stack-options.js": +/*!*************************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/commands/command-stack-options.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +function overrideCommandStackOptions(container, options) { + var defaultOptions = container.get(types_1.TYPES.CommandStackOptions); + for (var p in options) { + if (options.hasOwnProperty(p)) + defaultOptions[p] = options[p]; + } + return defaultOptions; +} +exports.overrideCommandStackOptions = overrideCommandStackOptions; +//# sourceMappingURL=command-stack-options.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/commands/command-stack.js": +/*!*****************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/commands/command-stack.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var smodel_factory_1 = __webpack_require__(/*! ../model/smodel-factory */ "./node_modules/sprotty/lib/base/model/smodel-factory.js"); +var animation_frame_syncer_1 = __webpack_require__(/*! ../animations/animation-frame-syncer */ "./node_modules/sprotty/lib/base/animations/animation-frame-syncer.js"); +var command_1 = __webpack_require__(/*! ./command */ "./node_modules/sprotty/lib/base/commands/command.js"); +/** + * The implementation of the ICommandStack. Clients should not use this + * class directly. + * + * The command stack holds the current model as the result of the current + * promise. When a new command is executed/undone/redone, its execution is + * chained using Promise#then() to the current Promise. This + * way we can handle long running commands without blocking the current + * thread. + * + * The command stack also does the special handling for special commands: + * + * System commands should be transparent to the user and as such be + * automatically undone/redone with the next plain command. Additional care + * must be taken that system commands that are executed after undo don't + * break the correspondence between the topmost commands on the undo and + * redo stacks. + * + * Hidden commands only tell the viewer to render a hidden model such that + * its bounds can be extracted from the DOM and forwarded as separate actions. + * Hidden commands should not leave any trace on the undo/redo/off stacks. + * + * Mergeable commands should be merged with their predecessor if possible, + * such that e.g. multiple subsequent moves of the smae element can be undone + * in one single step. + */ +var CommandStack = /** @class */ (function () { + function CommandStack() { + this.undoStack = []; + this.redoStack = []; + /** + * System commands should be transparent to the user in undo/redo + * operations. When a system command is executed when the redo + * stack is not empty, it is pushed to offStack instead. + * + * On redo, all commands form this stack are undone such that the + * redo operation gets the exact same model as when it was executed + * first. + * + * On undo, all commands form this stack are undone as well as + * system ommands should be transparent to the user. + */ + this.offStack = []; + } + CommandStack.prototype.initialize = function () { + this.currentPromise = Promise.resolve({ + root: this.modelFactory.createRoot(smodel_factory_1.EMPTY_ROOT), + hiddenRoot: undefined, + popupRoot: undefined, + rootChanged: false, + hiddenRootChanged: false, + popupChanged: false + }); + }; + Object.defineProperty(CommandStack.prototype, "currentModel", { + get: function () { + return this.currentPromise.then(function (state) { return state.root; }); + }, + enumerable: true, + configurable: true + }); + CommandStack.prototype.executeAll = function (commands) { + var _this = this; + commands.forEach(function (command) { + _this.logger.log(_this, 'Executing', command); + _this.handleCommand(command, command.execute, _this.mergeOrPush); + }); + return this.thenUpdate(); + }; + CommandStack.prototype.execute = function (command) { + this.logger.log(this, 'Executing', command); + this.handleCommand(command, command.execute, this.mergeOrPush); + return this.thenUpdate(); + }; + CommandStack.prototype.undo = function () { + var _this = this; + this.undoOffStackSystemCommands(); + this.undoPreceedingSystemCommands(); + var command = this.undoStack[this.undoStack.length - 1]; + if (command !== undefined && !this.isBlockUndo(command)) { + this.undoStack.pop(); + this.logger.log(this, 'Undoing', command); + this.handleCommand(command, command.undo, function (c, context) { + _this.redoStack.push(c); + }); + } + return this.thenUpdate(); + }; + CommandStack.prototype.redo = function () { + var _this = this; + this.undoOffStackSystemCommands(); + var command = this.redoStack.pop(); + if (command !== undefined) { + this.logger.log(this, 'Redoing', command); + this.handleCommand(command, command.redo, function (c, context) { + _this.pushToUndoStack(c); + }); + } + this.redoFollowingSystemCommands(); + return this.thenUpdate(); + }; + /** + * Chains the current promise with another Promise that performs the + * given operation on the given command. + * + * @param beforeResolve a function that is called directly before + * resolving the Promise to return the new model. Usually puts the + * command on the appropriate stack. + */ + CommandStack.prototype.handleCommand = function (command, operation, beforeResolve) { + var _this = this; + this.currentPromise = this.currentPromise.then(function (state) { + return new Promise(function (resolve, reject) { + var context = _this.createContext(state.root); + var newResult; + try { + newResult = operation.call(command, context); + } + catch (error) { + _this.logger.error(_this, "Failed to execute command:", error); + newResult = state.root; + } + if (command instanceof command_1.HiddenCommand) { + resolve(__assign({}, state, { + hiddenRoot: newResult, + hiddenRootChanged: true + })); + } + else if (command instanceof command_1.PopupCommand) { + resolve(__assign({}, state, { + popupRoot: newResult, + popupChanged: true + })); + } + else if (newResult instanceof Promise) { + newResult.then(function (newModel) { + beforeResolve.call(_this, command, context); + resolve(__assign({}, state, { + root: newModel, + rootChanged: true + })); + }); + } + else { + beforeResolve.call(_this, command, context); + resolve(__assign({}, state, { + root: newResult, + rootChanged: true + })); + } + }); + }); + }; + CommandStack.prototype.pushToUndoStack = function (command) { + this.undoStack.push(command); + if (this.options.undoHistoryLimit >= 0 && this.undoStack.length > this.options.undoHistoryLimit) + this.undoStack.splice(0, this.undoStack.length - this.options.undoHistoryLimit); + }; + /** + * Notifies the Viewer to render the new model and/or the new hidden model + * and returns a Promise for the new model. + */ + CommandStack.prototype.thenUpdate = function () { + var _this = this; + this.currentPromise = this.currentPromise.then(function (state) { return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(state.hiddenRootChanged && state.hiddenRoot !== undefined)) return [3 /*break*/, 2]; + return [4 /*yield*/, this.updateHidden(state.hiddenRoot)]; + case 1: + _a.sent(); + _a.label = 2; + case 2: + if (!state.rootChanged) return [3 /*break*/, 4]; + return [4 /*yield*/, this.update(state.root)]; + case 3: + _a.sent(); + _a.label = 4; + case 4: + if (!(state.popupChanged && state.popupRoot !== undefined)) return [3 /*break*/, 6]; + return [4 /*yield*/, this.updatePopup(state.popupRoot)]; + case 5: + _a.sent(); + _a.label = 6; + case 6: return [2 /*return*/, { + root: state.root, + hiddenRoot: undefined, + popupRoot: undefined, + rootChanged: false, + hiddenRootChanged: false, + popupChanged: false + }]; + } + }); + }); }); + return this.currentModel; + }; + /** + * Notify the Viewer that the model has changed. + */ + CommandStack.prototype.update = function (model) { + return __awaiter(this, void 0, void 0, function () { + var _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!(this.viewer === undefined)) return [3 /*break*/, 2]; + _a = this; + return [4 /*yield*/, this.viewerProvider()]; + case 1: + _a.viewer = _b.sent(); + _b.label = 2; + case 2: + this.viewer.update(model); + return [2 /*return*/]; + } + }); + }); + }; + /** + * Notify the Viewer that the hidden model has changed. + */ + CommandStack.prototype.updateHidden = function (model) { + return __awaiter(this, void 0, void 0, function () { + var _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!(this.viewer === undefined)) return [3 /*break*/, 2]; + _a = this; + return [4 /*yield*/, this.viewerProvider()]; + case 1: + _a.viewer = _b.sent(); + _b.label = 2; + case 2: + this.viewer.updateHidden(model); + return [2 /*return*/]; + } + }); + }); + }; + /** + * Notify the Viewer that the model has changed. + */ + CommandStack.prototype.updatePopup = function (model) { + return __awaiter(this, void 0, void 0, function () { + var _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!(this.viewer === undefined)) return [3 /*break*/, 2]; + _a = this; + return [4 /*yield*/, this.viewerProvider()]; + case 1: + _a.viewer = _b.sent(); + _b.label = 2; + case 2: + this.viewer.updatePopup(model); + return [2 /*return*/]; + } + }); + }); + }; + /** + * Handling of commands after their execution. + * + * Hidden commands are not pushed to any stack. + * + * System commands are pushed to the offStack when the redo + * stack is not empty, allowing to undo the before a redo to keep the chain + * of commands consistent. + * + * Mergable commands are merged if possible. + */ + CommandStack.prototype.mergeOrPush = function (command, context) { + var _this = this; + if (this.isBlockUndo(command)) { + this.undoStack = []; + this.redoStack = []; + this.offStack = []; + this.pushToUndoStack(command); + return; + } + if (this.isPushToOffStack(command) && this.redoStack.length > 0) { + if (this.offStack.length > 0) { + var lastCommand = this.offStack[this.offStack.length - 1]; + if (lastCommand instanceof command_1.MergeableCommand && lastCommand.merge(command, context)) + return; + } + this.offStack.push(command); + return; + } + if (this.isPushToUndoStack(command)) { + this.offStack.forEach(function (c) { return _this.undoStack.push(c); }); + this.offStack = []; + this.redoStack = []; + if (this.undoStack.length > 0) { + var lastCommand = this.undoStack[this.undoStack.length - 1]; + if (lastCommand instanceof command_1.MergeableCommand && lastCommand.merge(command, context)) + return; + } + this.pushToUndoStack(command); + } + }; + /** + * Reverts all system commands on the offStack. + */ + CommandStack.prototype.undoOffStackSystemCommands = function () { + var command = this.offStack.pop(); + while (command !== undefined) { + this.logger.log(this, 'Undoing off-stack', command); + this.handleCommand(command, command.undo, function () { }); + command = this.offStack.pop(); + } + }; + /** + * System commands should be transparent to the user, so this method + * is called from undo() to revert all system commands + * at the top of the undoStack. + */ + CommandStack.prototype.undoPreceedingSystemCommands = function () { + var _this = this; + var command = this.undoStack[this.undoStack.length - 1]; + while (command !== undefined && this.isPushToOffStack(command)) { + this.undoStack.pop(); + this.logger.log(this, 'Undoing', command); + this.handleCommand(command, command.undo, function (c, context) { + _this.redoStack.push(c); + }); + command = this.undoStack[this.undoStack.length - 1]; + } + }; + /** + * System commands should be transparent to the user, so this method + * is called from redo() to re-execute all system commands + * at the top of the redoStack. + */ + CommandStack.prototype.redoFollowingSystemCommands = function () { + var _this = this; + var command = this.redoStack[this.redoStack.length - 1]; + while (command !== undefined && this.isPushToOffStack(command)) { + this.redoStack.pop(); + this.logger.log(this, 'Redoing ', command); + this.handleCommand(command, command.redo, function (c, context) { + _this.pushToUndoStack(c); + }); + command = this.redoStack[this.redoStack.length - 1]; + } + }; + /** + * Assembles the context object that is passed to the commands execution method. + */ + CommandStack.prototype.createContext = function (currentModel) { + return { + root: currentModel, + modelChanged: this, + modelFactory: this.modelFactory, + duration: this.options.defaultDuration, + logger: this.logger, + syncer: this.syncer + }; + }; + CommandStack.prototype.isPushToOffStack = function (command) { + return command instanceof command_1.SystemCommand; + }; + CommandStack.prototype.isPushToUndoStack = function (command) { + return !(command instanceof command_1.HiddenCommand); + }; + CommandStack.prototype.isBlockUndo = function (command) { + return command instanceof command_1.ResetCommand; + }; + __decorate([ + inversify_1.inject(types_1.TYPES.IModelFactory), + __metadata("design:type", Object) + ], CommandStack.prototype, "modelFactory", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.IViewerProvider), + __metadata("design:type", Function) + ], CommandStack.prototype, "viewerProvider", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.ILogger), + __metadata("design:type", Object) + ], CommandStack.prototype, "logger", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.AnimationFrameSyncer), + __metadata("design:type", animation_frame_syncer_1.AnimationFrameSyncer) + ], CommandStack.prototype, "syncer", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.CommandStackOptions), + __metadata("design:type", Object) + ], CommandStack.prototype, "options", void 0); + __decorate([ + inversify_1.postConstruct(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", void 0) + ], CommandStack.prototype, "initialize", null); + CommandStack = __decorate([ + inversify_1.injectable() + ], CommandStack); + return CommandStack; +}()); +exports.CommandStack = CommandStack; +//# sourceMappingURL=command-stack.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/commands/command.js": +/*!***********************************************************!*\ + !*** ./node_modules/sprotty/lib/base/commands/command.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +/** + * Base class for all commands. + * + * Command instances are created via dependency injection and should take + * the respective action as an injected constructor parameter. They must + * also define a static KIND which is used to map an + * Action#kind. + * + * + * export class MyCommand extends Command { + * static KIND = 'MyCommand' + * constructor(@inject(TYPES.Action) action: MyAction) { + * ... + * } + * @inject(TYPES.Action) + * + */ +var Command = /** @class */ (function () { + function Command() { + } + Command = __decorate([ + inversify_1.injectable() + ], Command); + return Command; +}()); +exports.Command = Command; +/** + * A mergeable command can accumulate subsequent commands of the same kind. + * + * For example, multiple subsequent move commands can be merged to yield a + * single command, such that undo will roll them back altogether. Otherwise + * the user would have to push CTRL-Z for each mouse move element that + * resuted in a command. + */ +var MergeableCommand = /** @class */ (function (_super) { + __extends(MergeableCommand, _super); + function MergeableCommand() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Tries to merge the given command with this. + * + * @param command + * @param context + */ + MergeableCommand.prototype.merge = function (command, context) { + return false; + }; + MergeableCommand = __decorate([ + inversify_1.injectable() + ], MergeableCommand); + return MergeableCommand; +}(Command)); +exports.MergeableCommand = MergeableCommand; +/** + * A hidden command is used to trigger the rendering of a model on a + * hidden canvas. + * + * Some graphical elements are styled using CSS, others have bounds that + * require to layout their children before being computed. In such cases + * we cannot tell about the size of elements without acutally rendering + * the DOM. We render them to an invisible canvas. This can be achieved + * using hidden commands. + * + * Hidden commands do not change the model directly, and are as such + * neither undoable nor redoable. The command stack does not push them on + * any stack and forwards the resulting model to the invisible viewer. + */ +var HiddenCommand = /** @class */ (function (_super) { + __extends(HiddenCommand, _super); + function HiddenCommand() { + return _super !== null && _super.apply(this, arguments) || this; + } + HiddenCommand.prototype.undo = function (context) { + context.logger.error(this, 'Cannot undo a hidden command'); + return context.root; + }; + HiddenCommand.prototype.redo = function (context) { + context.logger.error(this, 'Cannot redo a hidden command'); + return context.root; + }; + HiddenCommand = __decorate([ + inversify_1.injectable() + ], HiddenCommand); + return HiddenCommand; +}(Command)); +exports.HiddenCommand = HiddenCommand; +var PopupCommand = /** @class */ (function (_super) { + __extends(PopupCommand, _super); + function PopupCommand() { + return _super !== null && _super.apply(this, arguments) || this; + } + PopupCommand = __decorate([ + inversify_1.injectable() + ], PopupCommand); + return PopupCommand; +}(Command)); +exports.PopupCommand = PopupCommand; +/** + * A system command is triggered by the system, e.g. in order to update bounds + * in the model with data fetched from the DOM. + * + * As it is automatically triggered it should not count as a single command in + * undo/redo operations. Into the bargain, such an automatic command could occur + * after an undo and as such make the next redo command invalid because it is + * based on a model state that has changed. The command stack handles system + * commands in a special way to overcome these issues. + */ +var SystemCommand = /** @class */ (function (_super) { + __extends(SystemCommand, _super); + function SystemCommand() { + return _super !== null && _super.apply(this, arguments) || this; + } + SystemCommand = __decorate([ + inversify_1.injectable() + ], SystemCommand); + return SystemCommand; +}(Command)); +exports.SystemCommand = SystemCommand; +/** + * A reset command deletes all undo/redo stacks and cannot be undone. + * + * It marks a point of no return. + */ +var ResetCommand = /** @class */ (function (_super) { + __extends(ResetCommand, _super); + function ResetCommand() { + return _super !== null && _super.apply(this, arguments) || this; + } + ResetCommand = __decorate([ + inversify_1.injectable() + ], ResetCommand); + return ResetCommand; +}(Command)); +exports.ResetCommand = ResetCommand; +//# sourceMappingURL=command.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/di.config.js": +/*!****************************************************!*\ + !*** ./node_modules/sprotty/lib/base/di.config.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ./types */ "./node_modules/sprotty/lib/base/types.js"); +var initialize_canvas_1 = __webpack_require__(/*! ./features/initialize-canvas */ "./node_modules/sprotty/lib/base/features/initialize-canvas.js"); +var logging_1 = __webpack_require__(/*! ../utils/logging */ "./node_modules/sprotty/lib/utils/logging.js"); +var action_dispatcher_1 = __webpack_require__(/*! ./actions/action-dispatcher */ "./node_modules/sprotty/lib/base/actions/action-dispatcher.js"); +var action_handler_1 = __webpack_require__(/*! ./actions/action-handler */ "./node_modules/sprotty/lib/base/actions/action-handler.js"); +var command_stack_1 = __webpack_require__(/*! ./commands/command-stack */ "./node_modules/sprotty/lib/base/commands/command-stack.js"); +var smodel_factory_1 = __webpack_require__(/*! ./model/smodel-factory */ "./node_modules/sprotty/lib/base/model/smodel-factory.js"); +var animation_frame_syncer_1 = __webpack_require__(/*! ./animations/animation-frame-syncer */ "./node_modules/sprotty/lib/base/animations/animation-frame-syncer.js"); +var viewer_1 = __webpack_require__(/*! ./views/viewer */ "./node_modules/sprotty/lib/base/views/viewer.js"); +var viewer_options_1 = __webpack_require__(/*! ./views/viewer-options */ "./node_modules/sprotty/lib/base/views/viewer-options.js"); +var mouse_tool_1 = __webpack_require__(/*! ./views/mouse-tool */ "./node_modules/sprotty/lib/base/views/mouse-tool.js"); +var key_tool_1 = __webpack_require__(/*! ./views/key-tool */ "./node_modules/sprotty/lib/base/views/key-tool.js"); +var vnode_decorators_1 = __webpack_require__(/*! ./views/vnode-decorators */ "./node_modules/sprotty/lib/base/views/vnode-decorators.js"); +var view_1 = __webpack_require__(/*! ./views/view */ "./node_modules/sprotty/lib/base/views/view.js"); +var viewer_cache_1 = __webpack_require__(/*! ./views/viewer-cache */ "./node_modules/sprotty/lib/base/views/viewer-cache.js"); +var dom_helper_1 = __webpack_require__(/*! ./views/dom-helper */ "./node_modules/sprotty/lib/base/views/dom-helper.js"); +var id_decorator_1 = __webpack_require__(/*! ./views/id-decorator */ "./node_modules/sprotty/lib/base/views/id-decorator.js"); +var command_registration_1 = __webpack_require__(/*! ./commands/command-registration */ "./node_modules/sprotty/lib/base/commands/command-registration.js"); +var css_class_decorator_1 = __webpack_require__(/*! ./views/css-class-decorator */ "./node_modules/sprotty/lib/base/views/css-class-decorator.js"); +var tool_manager_1 = __webpack_require__(/*! ./tool-manager/tool-manager */ "./node_modules/sprotty/lib/base/tool-manager/tool-manager.js"); +var set_model_1 = __webpack_require__(/*! ./features/set-model */ "./node_modules/sprotty/lib/base/features/set-model.js"); +var defaultContainerModule = new inversify_1.ContainerModule(function (bind, _unbind, isBound) { + // Logging --------------------------------------------- + bind(types_1.TYPES.ILogger).to(logging_1.NullLogger).inSingletonScope(); + bind(types_1.TYPES.LogLevel).toConstantValue(logging_1.LogLevel.warn); + // Registries --------------------------------------------- + bind(types_1.TYPES.SModelRegistry).to(smodel_factory_1.SModelRegistry).inSingletonScope(); + bind(action_handler_1.ActionHandlerRegistry).toSelf().inSingletonScope(); + bind(types_1.TYPES.ActionHandlerRegistryProvider).toProvider(function (context) { + return function () { + return new Promise(function (resolve) { + resolve(context.container.get(action_handler_1.ActionHandlerRegistry)); + }); + }; + }); + bind(types_1.TYPES.ViewRegistry).to(view_1.ViewRegistry).inSingletonScope(); + // Model Creation --------------------------------------------- + bind(types_1.TYPES.IModelFactory).to(smodel_factory_1.SModelFactory).inSingletonScope(); + // Action Dispatcher --------------------------------------------- + bind(types_1.TYPES.IActionDispatcher).to(action_dispatcher_1.ActionDispatcher).inSingletonScope(); + bind(types_1.TYPES.IActionDispatcherProvider).toProvider(function (context) { + return function () { + return new Promise(function (resolve) { + resolve(context.container.get(types_1.TYPES.IActionDispatcher)); + }); + }; + }); + // Action handler + bind(types_1.TYPES.IActionHandlerInitializer).to(command_registration_1.CommandActionHandlerInitializer); + // Command Stack --------------------------------------------- + bind(types_1.TYPES.ICommandStack).to(command_stack_1.CommandStack).inSingletonScope(); + bind(types_1.TYPES.ICommandStackProvider).toProvider(function (context) { + return function () { + return new Promise(function (resolve) { + resolve(context.container.get(types_1.TYPES.ICommandStack)); + }); + }; + }); + bind(types_1.TYPES.CommandStackOptions).toConstantValue({ + defaultDuration: 250, + undoHistoryLimit: 50 + }); + // Viewer --------------------------------------------- + bind(viewer_1.Viewer).toSelf().inSingletonScope(); + bind(types_1.TYPES.IViewer).toDynamicValue(function (context) { + return context.container.get(viewer_1.Viewer); + }).inSingletonScope().whenTargetNamed('delegate'); + bind(viewer_cache_1.ViewerCache).toSelf().inSingletonScope(); + bind(types_1.TYPES.IViewer).toDynamicValue(function (context) { + return context.container.get(viewer_cache_1.ViewerCache); + }).inSingletonScope().whenTargetIsDefault(); + bind(types_1.TYPES.IViewerProvider).toProvider(function (context) { + return function () { + return new Promise(function (resolve) { + resolve(context.container.get(types_1.TYPES.IViewer)); + }); + }; + }); + bind(types_1.TYPES.ViewerOptions).toConstantValue(viewer_options_1.defaultViewerOptions()); + bind(types_1.TYPES.DOMHelper).to(dom_helper_1.DOMHelper).inSingletonScope(); + bind(types_1.TYPES.ModelRendererFactory).toFactory(function (context) { + return function (decorators) { + var viewRegistry = context.container.get(types_1.TYPES.ViewRegistry); + return new viewer_1.ModelRenderer(viewRegistry, decorators); + }; + }); + // Tools & Decorators -------------------------------------- + bind(id_decorator_1.IdDecorator).toSelf().inSingletonScope(); + bind(types_1.TYPES.IVNodeDecorator).toService(id_decorator_1.IdDecorator); + bind(types_1.TYPES.HiddenVNodeDecorator).toService(id_decorator_1.IdDecorator); + bind(css_class_decorator_1.CssClassDecorator).toSelf().inSingletonScope(); + bind(types_1.TYPES.IVNodeDecorator).toService(css_class_decorator_1.CssClassDecorator); + bind(types_1.TYPES.HiddenVNodeDecorator).toService(css_class_decorator_1.CssClassDecorator); + bind(mouse_tool_1.MouseTool).toSelf().inSingletonScope(); + bind(types_1.TYPES.IVNodeDecorator).toService(mouse_tool_1.MouseTool); + bind(key_tool_1.KeyTool).toSelf().inSingletonScope(); + bind(types_1.TYPES.IVNodeDecorator).toService(key_tool_1.KeyTool); + bind(vnode_decorators_1.FocusFixDecorator).toSelf().inSingletonScope(); + bind(types_1.TYPES.IVNodeDecorator).toService(vnode_decorators_1.FocusFixDecorator); + bind(types_1.TYPES.PopupVNodeDecorator).toService(id_decorator_1.IdDecorator); + bind(mouse_tool_1.PopupMouseTool).toSelf().inSingletonScope(); + bind(types_1.TYPES.PopupVNodeDecorator).toService(mouse_tool_1.PopupMouseTool); + // Animation Frame Sync ------------------------------------------ + bind(types_1.TYPES.AnimationFrameSyncer).to(animation_frame_syncer_1.AnimationFrameSyncer).inSingletonScope(); + // Canvas Initialization --------------------------------------------- + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, initialize_canvas_1.InitializeCanvasBoundsCommand); + bind(initialize_canvas_1.CanvasBoundsInitializer).toSelf().inSingletonScope(); + bind(types_1.TYPES.IVNodeDecorator).toService(initialize_canvas_1.CanvasBoundsInitializer); + // Model commands --------------------------------------------- + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, set_model_1.SetModelCommand); + // Tool manager initialization ------------------------------------ + bind(types_1.TYPES.IToolManager).to(tool_manager_1.ToolManager).inSingletonScope(); + bind(types_1.TYPES.KeyListener).to(tool_manager_1.DefaultToolsEnablingKeyListener); + bind(types_1.TYPES.IActionHandlerInitializer).to(tool_manager_1.ToolManagerActionHandlerInitializer); +}); +exports.default = defaultContainerModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/features/initialize-canvas.js": +/*!*********************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/features/initialize-canvas.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var smodel_1 = __webpack_require__(/*! ../model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var command_1 = __webpack_require__(/*! ../commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +/** + * Grabs the bounds from the root element in page coordinates and fires a + * InitializeCanvasBoundsAction. This size is needed for other actions such + * as FitToScreenAction. + */ +var CanvasBoundsInitializer = /** @class */ (function () { + function CanvasBoundsInitializer() { + } + CanvasBoundsInitializer.prototype.decorate = function (vnode, element) { + if (element instanceof smodel_1.SModelRoot && !geometry_1.isValidDimension(element.canvasBounds)) { + this.rootAndVnode = [element, vnode]; + } + return vnode; + }; + CanvasBoundsInitializer.prototype.postUpdate = function () { + if (this.rootAndVnode !== undefined) { + var domElement = this.rootAndVnode[1].elm; + var oldBounds = this.rootAndVnode[0].canvasBounds; + if (domElement !== undefined) { + var newBounds = this.getBoundsInPage(domElement); + if (!(geometry_1.almostEquals(newBounds.x, oldBounds.x) + && geometry_1.almostEquals(newBounds.y, oldBounds.y) + && geometry_1.almostEquals(newBounds.width, oldBounds.width) + && geometry_1.almostEquals(newBounds.height, oldBounds.width))) + this.actionDispatcher.dispatch(new InitializeCanvasBoundsAction(newBounds)); + } + this.rootAndVnode = undefined; + } + }; + CanvasBoundsInitializer.prototype.getBoundsInPage = function (element) { + var bounds = element.getBoundingClientRect(); + var scroll = typeof window !== 'undefined' ? { x: window.scrollX, y: window.scrollY } : geometry_1.ORIGIN_POINT; + return { + x: bounds.left + scroll.x, + y: bounds.top + scroll.y, + width: bounds.width, + height: bounds.height + }; + }; + __decorate([ + inversify_1.inject(types_1.TYPES.IActionDispatcher), + __metadata("design:type", Object) + ], CanvasBoundsInitializer.prototype, "actionDispatcher", void 0); + CanvasBoundsInitializer = __decorate([ + inversify_1.injectable() + ], CanvasBoundsInitializer); + return CanvasBoundsInitializer; +}()); +exports.CanvasBoundsInitializer = CanvasBoundsInitializer; +var InitializeCanvasBoundsAction = /** @class */ (function () { + function InitializeCanvasBoundsAction(newCanvasBounds) { + this.newCanvasBounds = newCanvasBounds; + this.kind = InitializeCanvasBoundsCommand.KIND; + } + return InitializeCanvasBoundsAction; +}()); +exports.InitializeCanvasBoundsAction = InitializeCanvasBoundsAction; +var InitializeCanvasBoundsCommand = /** @class */ (function (_super) { + __extends(InitializeCanvasBoundsCommand, _super); + function InitializeCanvasBoundsCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + return _this; + } + InitializeCanvasBoundsCommand.prototype.execute = function (context) { + this.newCanvasBounds = this.action.newCanvasBounds; + context.root.canvasBounds = this.newCanvasBounds; + return context.root; + }; + InitializeCanvasBoundsCommand.prototype.undo = function (context) { + return context.root; + }; + InitializeCanvasBoundsCommand.prototype.redo = function (context) { + return context.root; + }; + InitializeCanvasBoundsCommand.KIND = 'initializeCanvasBounds'; + InitializeCanvasBoundsCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [InitializeCanvasBoundsAction]) + ], InitializeCanvasBoundsCommand); + return InitializeCanvasBoundsCommand; +}(command_1.SystemCommand)); +exports.InitializeCanvasBoundsCommand = InitializeCanvasBoundsCommand; +//# sourceMappingURL=initialize-canvas.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/features/set-model.js": +/*!*************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/features/set-model.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var command_1 = __webpack_require__(/*! ../commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var initialize_canvas_1 = __webpack_require__(/*! ./initialize-canvas */ "./node_modules/sprotty/lib/base/features/initialize-canvas.js"); +/** + * Sent from the client to the model source (e.g. a DiagramServer) in order to request a model. Usually this + * is the first message that is sent to the source, so it is also used to initiate the communication. + * The response is a SetModelAction or an UpdateModelAction. + */ +var RequestModelAction = /** @class */ (function () { + function RequestModelAction(options) { + this.options = options; + this.kind = RequestModelAction.KIND; + } + RequestModelAction.KIND = 'requestModel'; + return RequestModelAction; +}()); +exports.RequestModelAction = RequestModelAction; +/** + * Sent from the model source to the client in order to set the model. If a model is already present, it is replaced. + */ +var SetModelAction = /** @class */ (function () { + function SetModelAction(newRoot) { + this.newRoot = newRoot; + this.kind = SetModelCommand.KIND; + } + return SetModelAction; +}()); +exports.SetModelAction = SetModelAction; +var SetModelCommand = /** @class */ (function (_super) { + __extends(SetModelCommand, _super); + function SetModelCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + return _this; + } + SetModelCommand.prototype.execute = function (context) { + this.oldRoot = context.modelFactory.createRoot(context.root); + this.newRoot = context.modelFactory.createRoot(this.action.newRoot); + return this.newRoot; + }; + SetModelCommand.prototype.undo = function (context) { + return this.oldRoot; + }; + SetModelCommand.prototype.redo = function (context) { + return this.newRoot; + }; + Object.defineProperty(SetModelCommand.prototype, "blockUntil", { + get: function () { + return function (action) { return action.kind === initialize_canvas_1.InitializeCanvasBoundsCommand.KIND; }; + }, + enumerable: true, + configurable: true + }); + SetModelCommand.KIND = 'setModel'; + SetModelCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [SetModelAction]) + ], SetModelCommand); + return SetModelCommand; +}(command_1.ResetCommand)); +exports.SetModelCommand = SetModelCommand; +//# sourceMappingURL=set-model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/model/smodel-factory.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/model/smodel-factory.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var registry_1 = __webpack_require__(/*! ../../utils/registry */ "./node_modules/sprotty/lib/utils/registry.js"); +var smodel_1 = __webpack_require__(/*! ./smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +/** + * The default model factory creates SModelRoot for the root element and SChildElement for all other + * model elements. + */ +var SModelFactory = /** @class */ (function () { + function SModelFactory() { + } + SModelFactory.prototype.createElement = function (schema, parent) { + var child; + if (this.registry.hasKey(schema.type)) { + var regElement = this.registry.get(schema.type, undefined); + if (!(regElement instanceof smodel_1.SChildElement)) + throw new Error("Element with type " + schema.type + " was expected to be an SChildElement."); + child = regElement; + } + else { + child = new smodel_1.SChildElement(); + } + return this.initializeChild(child, schema, parent); + }; + SModelFactory.prototype.createRoot = function (schema) { + var root; + if (this.registry.hasKey(schema.type)) { + var regElement = this.registry.get(schema.type, undefined); + if (!(regElement instanceof smodel_1.SModelRoot)) + throw new Error("Element with type " + schema.type + " was expected to be an SModelRoot."); + root = regElement; + } + else { + root = new smodel_1.SModelRoot(); + } + return this.initializeRoot(root, schema); + }; + SModelFactory.prototype.createSchema = function (element) { + var _this = this; + var schema = {}; + for (var key in element) { + if (!this.isReserved(element, key)) { + var value = element[key]; + if (typeof value !== 'function') + schema[key] = value; + } + } + if (element instanceof smodel_1.SParentElement) + schema['children'] = element.children.map(function (child) { return _this.createSchema(child); }); + return schema; + }; + SModelFactory.prototype.initializeElement = function (element, schema) { + for (var key in schema) { + if (!this.isReserved(element, key)) { + var value = schema[key]; + if (typeof value !== 'function') + element[key] = value; + } + } + return element; + }; + SModelFactory.prototype.isReserved = function (element, propertyName) { + if (['children', 'parent', 'index'].indexOf(propertyName) >= 0) + return true; + var obj = element; + do { + var descriptor = Object.getOwnPropertyDescriptor(obj, propertyName); + if (descriptor !== undefined) + return descriptor.get !== undefined; + obj = Object.getPrototypeOf(obj); + } while (obj); + return false; + }; + SModelFactory.prototype.initializeParent = function (parent, schema) { + var _this = this; + this.initializeElement(parent, schema); + if (smodel_1.isParent(schema)) { + parent.children = schema.children.map(function (childSchema) { return _this.createElement(childSchema, parent); }); + } + return parent; + }; + SModelFactory.prototype.initializeChild = function (child, schema, parent) { + this.initializeParent(child, schema); + if (parent !== undefined) { + child.parent = parent; + } + return child; + }; + SModelFactory.prototype.initializeRoot = function (root, schema) { + this.initializeParent(root, schema); + root.index.add(root); + return root; + }; + __decorate([ + inversify_1.inject(types_1.TYPES.SModelRegistry), + __metadata("design:type", SModelRegistry) + ], SModelFactory.prototype, "registry", void 0); + SModelFactory = __decorate([ + inversify_1.injectable() + ], SModelFactory); + return SModelFactory; +}()); +exports.SModelFactory = SModelFactory; +exports.EMPTY_ROOT = Object.freeze({ + type: 'NONE', + id: 'EMPTY' +}); +/** + * Model element classes registered here are considered automatically when constructring a model from its schema. + */ +var SModelRegistry = /** @class */ (function (_super) { + __extends(SModelRegistry, _super); + function SModelRegistry(registrations) { + var _this = _super.call(this) || this; + registrations.forEach(function (registration) { return _this.register(registration.type, registration.constr); }); + return _this; + } + SModelRegistry = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.multiInject(types_1.TYPES.SModelElementRegistration)), __param(0, inversify_1.optional()), + __metadata("design:paramtypes", [Array]) + ], SModelRegistry); + return SModelRegistry; +}(registry_1.ProviderRegistry)); +exports.SModelRegistry = SModelRegistry; +//# sourceMappingURL=smodel-factory.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/model/smodel-utils.js": +/*!*************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/model/smodel-utils.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var smodel_1 = __webpack_require__(/*! ./smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +/** + * Model element types can include a colon to separate the basic type and a sub-type. This function + * extracts the basic type of a model element. + */ +function getBasicType(schema) { + if (!schema.type) + return ''; + var colonIndex = schema.type.indexOf(':'); + if (colonIndex >= 0) + return schema.type.substring(0, colonIndex); + else + return schema.type; +} +exports.getBasicType = getBasicType; +/** + * Model element types can include a colon to separate the basic type and a sub-type. This function + * extracts the sub-type of a model element. + */ +function getSubType(schema) { + if (!schema.type) + return ''; + var colonIndex = schema.type.indexOf(':'); + if (colonIndex >= 0) + return schema.type.substring(colonIndex + 1); + else + return schema.type; +} +exports.getSubType = getSubType; +/** + * Find the element with the given identifier. If you need to find multiple elements, using an + * SModelIndex might be more effective. + */ +function findElement(parent, elementId) { + if (parent.id === elementId) + return parent; + if (parent.children !== undefined) { + for (var _i = 0, _a = parent.children; _i < _a.length; _i++) { + var child = _a[_i]; + var result = findElement(child, elementId); + if (result !== undefined) + return result; + } + } + return undefined; +} +exports.findElement = findElement; +/** + * Find a parent element that satisfies the given predicate. + */ +function findParent(element, predicate) { + var current = element; + while (current !== undefined) { + if (predicate(current)) + return current; + else if (current instanceof smodel_1.SChildElement) + current = current.parent; + else + current = undefined; + } + return current; +} +exports.findParent = findParent; +/** + * Find a parent element that implements the feature identified with the given predicate. + */ +function findParentByFeature(element, predicate) { + var current = element; + while (current !== undefined) { + if (predicate(current)) + return current; + else if (current instanceof smodel_1.SChildElement) + current = current.parent; + else + current = undefined; + } + return current; +} +exports.findParentByFeature = findParentByFeature; +/** + * Translate a point from the coordinate system of the source element to the coordinate system + * of the target element. + */ +function translatePoint(point, source, target) { + if (source !== target) { + // Translate from the source to the root element + while (source instanceof smodel_1.SChildElement) { + point = source.localToParent(point); + source = source.parent; + if (source === target) + return point; + } + // Translate from the root to the target element + var targetTrace = []; + while (target instanceof smodel_1.SChildElement) { + targetTrace.push(target); + target = target.parent; + } + if (source !== target) + throw new Error("Incompatible source and target: " + source.id + ", " + target.id); + for (var i = targetTrace.length - 1; i >= 0; i--) { + point = targetTrace[i].parentToLocal(point); + } + } + return point; +} +exports.translatePoint = translatePoint; +/** + * Translate some bounds from the coordinate system of the source element to the coordinate system + * of the target element. + */ +function translateBounds(bounds, source, target) { + var upperLeft = translatePoint(bounds, source, target); + var lowerRight = translatePoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, source, target); + return { + x: upperLeft.x, + y: upperLeft.y, + width: lowerRight.x - upperLeft.x, + height: lowerRight.y - upperLeft.y + }; +} +exports.translateBounds = translateBounds; +//# sourceMappingURL=smodel-utils.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/model/smodel.js": +/*!*******************************************************!*\ + !*** ./node_modules/sprotty/lib/base/model/smodel.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var iterable_1 = __webpack_require__(/*! ../../utils/iterable */ "./node_modules/sprotty/lib/utils/iterable.js"); +/** + * Base class for all elements of the diagram model. + * Each model element must have a unique ID and a type that is used to look up its view. + */ +var SModelElement = /** @class */ (function () { + function SModelElement() { + } + Object.defineProperty(SModelElement.prototype, "root", { + get: function () { + var current = this; + while (current) { + if (current instanceof SModelRoot) + return current; + else if (current instanceof SChildElement) + current = current.parent; + else + current = undefined; + } + throw new Error("Element has no root"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SModelElement.prototype, "index", { + get: function () { + return this.root.index; + }, + enumerable: true, + configurable: true + }); + /** + * A feature is a symbol identifying some functionality that can be enabled or disabled for + * a model element. The base implementation always returns false, so it disables all features. + */ + SModelElement.prototype.hasFeature = function (feature) { + return false; + }; + return SModelElement; +}()); +exports.SModelElement = SModelElement; +function isParent(element) { + var children = element.children; + return children !== undefined && children.constructor === Array; +} +exports.isParent = isParent; +/** + * A parent element may contain child elements, thus the diagram model forms a tree. + */ +var SParentElement = /** @class */ (function (_super) { + __extends(SParentElement, _super); + function SParentElement() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.children = []; + return _this; + } + SParentElement.prototype.add = function (child, i) { + var children = this.children; + if (i === undefined) { + children.push(child); + } + else { + if (i < 0 || i > this.children.length) { + throw new Error("Child index " + i + " out of bounds (0.." + children.length + ")"); + } + children.splice(i, 0, child); + } + child.parent = this; + this.index.add(child); + }; + SParentElement.prototype.remove = function (child) { + var children = this.children; + var i = children.indexOf(child); + if (i < 0) { + throw new Error("No such child " + child.id); + } + children.splice(i, 1); + delete child.parent; + this.index.remove(child); + }; + SParentElement.prototype.removeAll = function (filter) { + var _this = this; + var children = this.children; + if (filter !== undefined) { + for (var i = children.length - 1; i >= 0; i--) { + if (filter(children[i])) { + var child = children.splice(i, 1)[0]; + delete child.parent; + this.index.remove(child); + } + } + } + else { + children.forEach(function (child) { + delete child.parent; + _this.index.remove(child); + }); + children.splice(0, children.length); + } + }; + SParentElement.prototype.move = function (child, newIndex) { + var children = this.children; + var i = children.indexOf(child); + if (i === -1) { + throw new Error("No such child " + child.id); + } + else { + if (newIndex < 0 || newIndex > children.length - 1) { + throw new Error("Child index " + newIndex + " out of bounds (0.." + children.length + ")"); + } + children.splice(i, 1); + children.splice(newIndex, 0, child); + } + }; + /** + * Transform the given bounds from the local coordinate system of this element to the coordinate + * system of its parent. This function should consider any transformation that is applied to the + * view of this element and its contents. + * The base implementation assumes that this element does not define a local coordinate system, + * so it leaves the bounds unchanged. + */ + SParentElement.prototype.localToParent = function (point) { + return geometry_1.isBounds(point) ? point : { x: point.x, y: point.y, width: -1, height: -1 }; + }; + /** + * Transform the given bounds from the coordinate system of this element's parent to its local + * coordinate system. This function should consider any transformation that is applied to the + * view of this element and its contents. + * The base implementation assumes that this element does not define a local coordinate system, + * so it leaves the bounds unchanged. + */ + SParentElement.prototype.parentToLocal = function (point) { + return geometry_1.isBounds(point) ? point : { x: point.x, y: point.y, width: -1, height: -1 }; + }; + return SParentElement; +}(SModelElement)); +exports.SParentElement = SParentElement; +/** + * A child element is contained in a parent element. All elements except the model root are child + * elements. In order to keep the model class hierarchy simple, every child element is also a + * parent element, although for many elements the array of children is empty (i.e. they are + * leafs in the model element tree). + */ +var SChildElement = /** @class */ (function (_super) { + __extends(SChildElement, _super); + function SChildElement() { + return _super !== null && _super.apply(this, arguments) || this; + } + return SChildElement; +}(SParentElement)); +exports.SChildElement = SChildElement; +/** + * Base class for the root element of the diagram model tree. + */ +var SModelRoot = /** @class */ (function (_super) { + __extends(SModelRoot, _super); + function SModelRoot(index) { + if (index === void 0) { index = new SModelIndex(); } + var _this = _super.call(this) || this; + _this.canvasBounds = geometry_1.EMPTY_BOUNDS; + // Override the index property from SModelElement, which has a getter, with a data property + Object.defineProperty(_this, 'index', { + value: index, + writable: false + }); + return _this; + } + return SModelRoot; +}(SParentElement)); +exports.SModelRoot = SModelRoot; +var ID_CHARS = "0123456789abcdefghijklmnopqrstuvwxyz"; +function createRandomId(length) { + if (length === void 0) { length = 8; } + var id = ""; + for (var i = 0; i < length; i++) { + id += ID_CHARS.charAt(Math.floor(Math.random() * ID_CHARS.length)); + } + return id; +} +exports.createRandomId = createRandomId; +/** + * Used to speed up model element lookup by id. + */ +var SModelIndex = /** @class */ (function () { + function SModelIndex() { + this.id2element = new Map; + } + SModelIndex.prototype.add = function (element) { + if (!element.id) { + do { + element.id = createRandomId(); + } while (this.contains(element)); + } + else if (this.contains(element)) { + throw new Error("Duplicate ID in model: " + element.id); + } + this.id2element.set(element.id, element); + if (element.children !== undefined && element.children.constructor === Array) { + for (var _i = 0, _a = element.children; _i < _a.length; _i++) { + var child = _a[_i]; + this.add(child); + } + } + }; + SModelIndex.prototype.remove = function (element) { + this.id2element.delete(element.id); + if (element.children !== undefined && element.children.constructor === Array) { + for (var _i = 0, _a = element.children; _i < _a.length; _i++) { + var child = _a[_i]; + this.remove(child); + } + } + }; + SModelIndex.prototype.contains = function (element) { + return this.id2element.has(element.id); + }; + SModelIndex.prototype.getById = function (id) { + return this.id2element.get(id); + }; + SModelIndex.prototype.getAttachedElements = function (element) { + return []; + }; + SModelIndex.prototype.all = function () { + return iterable_1.mapIterable(this.id2element, function (_a) { + var key = _a[0], value = _a[1]; + return value; + }); + }; + return SModelIndex; +}()); +exports.SModelIndex = SModelIndex; +//# sourceMappingURL=smodel.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/tool-manager/tool-manager.js": +/*!********************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/tool-manager/tool-manager.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +/******************************************************************************** + * Copyright (c) 2019 EclipseSource and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var tool_1 = __webpack_require__(/*! ./tool */ "./node_modules/sprotty/lib/base/tool-manager/tool.js"); +var key_tool_1 = __webpack_require__(/*! ../views/key-tool */ "./node_modules/sprotty/lib/base/views/key-tool.js"); +var keyboard_1 = __webpack_require__(/*! ../../utils/keyboard */ "./node_modules/sprotty/lib/utils/keyboard.js"); +var ToolManager = /** @class */ (function () { + function ToolManager() { + this.tools = []; + this.defaultTools = []; + this.actives = []; + } + Object.defineProperty(ToolManager.prototype, "managedTools", { + get: function () { + return this.defaultTools.concat(this.tools); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ToolManager.prototype, "activeTools", { + get: function () { + return this.actives; + }, + enumerable: true, + configurable: true + }); + ToolManager.prototype.disableActiveTools = function () { + this.actives.forEach(function (tool) { return tool.disable(); }); + this.actives.splice(0, this.actives.length); + }; + ToolManager.prototype.enableDefaultTools = function () { + this.enable(this.defaultTools.map(function (tool) { return tool.id; })); + }; + ToolManager.prototype.enable = function (toolIds) { + var _this = this; + this.disableActiveTools(); + var tools = toolIds.map(function (id) { return _this.tool(id); }); + tools.forEach(function (tool) { + if (tool !== undefined) { + tool.enable(); + _this.actives.push(tool); + } + }); + }; + ToolManager.prototype.tool = function (toolId) { + return this.managedTools.find(function (tool) { return tool.id === toolId; }); + }; + ToolManager.prototype.registerDefaultTools = function () { + var tools = []; + for (var _i = 0; _i < arguments.length; _i++) { + tools[_i] = arguments[_i]; + } + for (var _a = 0, tools_1 = tools; _a < tools_1.length; _a++) { + var tool = tools_1[_a]; + this.defaultTools.push(tool); + } + }; + ToolManager.prototype.registerTools = function () { + var tools = []; + for (var _i = 0; _i < arguments.length; _i++) { + tools[_i] = arguments[_i]; + } + for (var _a = 0, tools_2 = tools; _a < tools_2.length; _a++) { + var tool = tools_2[_a]; + this.tools.push(tool); + } + }; + ToolManager = __decorate([ + inversify_1.injectable() + ], ToolManager); + return ToolManager; +}()); +exports.ToolManager = ToolManager; +var ToolManagerActionHandlerInitializer = /** @class */ (function () { + function ToolManagerActionHandlerInitializer() { + } + ToolManagerActionHandlerInitializer.prototype.initialize = function (registry) { + registry.register(tool_1.EnableDefaultToolsAction.KIND, this); + registry.register(tool_1.EnableToolsAction.KIND, this); + }; + ToolManagerActionHandlerInitializer.prototype.handle = function (action) { + if (action instanceof tool_1.EnableDefaultToolsAction) { + this.toolManager.enableDefaultTools(); + } + else if (action instanceof tool_1.EnableToolsAction) { + this.toolManager.enable(action.toolIds); + } + }; + __decorate([ + inversify_1.inject(types_1.TYPES.IToolManager), + __metadata("design:type", Object) + ], ToolManagerActionHandlerInitializer.prototype, "toolManager", void 0); + ToolManagerActionHandlerInitializer = __decorate([ + inversify_1.injectable() + ], ToolManagerActionHandlerInitializer); + return ToolManagerActionHandlerInitializer; +}()); +exports.ToolManagerActionHandlerInitializer = ToolManagerActionHandlerInitializer; +var DefaultToolsEnablingKeyListener = /** @class */ (function (_super) { + __extends(DefaultToolsEnablingKeyListener, _super); + function DefaultToolsEnablingKeyListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + DefaultToolsEnablingKeyListener.prototype.keyDown = function (element, event) { + if (keyboard_1.matchesKeystroke(event, 'Escape')) { + return [new tool_1.EnableDefaultToolsAction()]; + } + return []; + }; + DefaultToolsEnablingKeyListener = __decorate([ + inversify_1.injectable() + ], DefaultToolsEnablingKeyListener); + return DefaultToolsEnablingKeyListener; +}(key_tool_1.KeyListener)); +exports.DefaultToolsEnablingKeyListener = DefaultToolsEnablingKeyListener; +//# sourceMappingURL=tool-manager.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/tool-manager/tool.js": +/*!************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/tool-manager/tool.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Action to enable the tools of the specified `toolIds`. + */ +var EnableToolsAction = /** @class */ (function () { + function EnableToolsAction(toolIds) { + this.toolIds = toolIds; + this.kind = EnableToolsAction.KIND; + } + EnableToolsAction.KIND = "enable-tools"; + return EnableToolsAction; +}()); +exports.EnableToolsAction = EnableToolsAction; +/** + * Action to disable the currently active tools and enable the default tools instead. + */ +var EnableDefaultToolsAction = /** @class */ (function () { + function EnableDefaultToolsAction() { + this.kind = EnableDefaultToolsAction.KIND; + } + EnableDefaultToolsAction.KIND = "enable-default-tools"; + return EnableDefaultToolsAction; +}()); +exports.EnableDefaultToolsAction = EnableDefaultToolsAction; +//# sourceMappingURL=tool.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/types.js": +/*!************************************************!*\ + !*** ./node_modules/sprotty/lib/base/types.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TYPES = { + Action: Symbol('Action'), + IActionDispatcher: Symbol('IActionDispatcher'), + IActionDispatcherProvider: Symbol('IActionDispatcherProvider'), + IActionHandlerInitializer: Symbol('IActionHandlerInitializer'), + ActionHandlerRegistryProvider: Symbol('ActionHandlerRegistryProvider'), + IAnchorComputer: Symbol('IAnchor'), + AnimationFrameSyncer: Symbol('AnimationFrameSyncer'), + CommandStackOptions: Symbol('CommandStackOptions'), + IButtonHandler: Symbol('IButtonHandler'), + CommandRegistration: Symbol('CommandRegistration'), + ICommandStack: Symbol('ICommandStack'), + ICommandStackProvider: Symbol('ICommandStackProvider'), + DOMHelper: Symbol('DOMHelper'), + IEdgeRouter: Symbol('IEdgeRouter'), + HiddenVNodeDecorator: Symbol('HiddenVNodeDecorator'), + HoverState: Symbol('HoverState'), + KeyListener: Symbol('KeyListener'), + Layouter: Symbol('Layouter'), + LayoutRegistry: Symbol('LayoutRegistry'), + ILogger: Symbol('ILogger'), + LogLevel: Symbol('LogLevel'), + IModelFactory: Symbol('IModelFactory'), + IModelLayoutEngine: Symbol('IModelLayoutEngine'), + ModelRendererFactory: Symbol('ModelRendererFactory'), + ModelSource: Symbol('ModelSource'), + ModelSourceProvider: Symbol('ModelSourceProvider'), + MouseListener: Symbol('MouseListener'), + IPopupModelProvider: Symbol('IPopupModelProvider'), + PopupMouseListener: Symbol('PopupMouseListener'), + PopupVNodeDecorator: Symbol('PopupVNodeDecorator'), + SModelElementRegistration: Symbol('SModelElementRegistration'), + SModelRegistry: Symbol('SModelRegistry'), + SvgExporter: Symbol('SvgExporter'), + IViewer: Symbol('IViewer'), + ViewerOptions: Symbol('ViewerOptions'), + IViewerProvider: Symbol('IViewerProvider'), + ViewRegistration: Symbol('ViewRegistration'), + ViewRegistry: Symbol('ViewRegistry'), + IVNodeDecorator: Symbol('IVNodeDecorator'), + IToolManager: Symbol('IToolManager') +}; +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/views/css-class-decorator.js": +/*!********************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/views/css-class-decorator.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var vnode_utils_1 = __webpack_require__(/*! ./vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var CssClassDecorator = /** @class */ (function () { + function CssClassDecorator() { + } + CssClassDecorator.prototype.decorate = function (vnode, element) { + if (element.cssClasses) { + for (var _i = 0, _a = element.cssClasses; _i < _a.length; _i++) { + var cssClass = _a[_i]; + vnode_utils_1.setClass(vnode, cssClass, true); + } + } + return vnode; + }; + CssClassDecorator.prototype.postUpdate = function () { + // empty + }; + CssClassDecorator = __decorate([ + inversify_1.injectable() + ], CssClassDecorator); + return CssClassDecorator; +}()); +exports.CssClassDecorator = CssClassDecorator; +//# sourceMappingURL=css-class-decorator.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/views/dom-helper.js": +/*!***********************************************************!*\ + !*** ./node_modules/sprotty/lib/base/views/dom-helper.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var DOMHelper = /** @class */ (function () { + function DOMHelper() { + } + DOMHelper.prototype.getPrefix = function () { + var prefix = this.viewerOptions !== undefined && this.viewerOptions.baseDiv !== undefined ? + this.viewerOptions.baseDiv + "_" : ""; + return prefix; + }; + DOMHelper.prototype.createUniqueDOMElementId = function (element) { + return this.getPrefix() + element.id; + }; + DOMHelper.prototype.findSModelIdByDOMElement = function (element) { + return element.id.replace(this.getPrefix(), ''); + }; + __decorate([ + inversify_1.inject(types_1.TYPES.ViewerOptions), + __metadata("design:type", Object) + ], DOMHelper.prototype, "viewerOptions", void 0); + DOMHelper = __decorate([ + inversify_1.injectable() + ], DOMHelper); + return DOMHelper; +}()); +exports.DOMHelper = DOMHelper; +//# sourceMappingURL=dom-helper.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/views/id-decorator.js": +/*!*************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/views/id-decorator.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var dom_helper_1 = __webpack_require__(/*! ./dom-helper */ "./node_modules/sprotty/lib/base/views/dom-helper.js"); +var vnode_utils_1 = __webpack_require__(/*! ./vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var IdDecorator = /** @class */ (function () { + function IdDecorator() { + } + IdDecorator.prototype.decorate = function (vnode, element) { + var attrs = vnode_utils_1.getAttrs(vnode); + if (attrs.id !== undefined) + this.logger.warn(vnode, 'Overriding id of vnode (' + attrs.id + '). Make sure not to set it manually in view.'); + attrs.id = this.domHelper.createUniqueDOMElementId(element); + if (!vnode.key) + vnode.key = element.id; + return vnode; + }; + IdDecorator.prototype.postUpdate = function () { + }; + __decorate([ + inversify_1.inject(types_1.TYPES.ILogger), + __metadata("design:type", Object) + ], IdDecorator.prototype, "logger", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.DOMHelper), + __metadata("design:type", dom_helper_1.DOMHelper) + ], IdDecorator.prototype, "domHelper", void 0); + IdDecorator = __decorate([ + inversify_1.injectable() + ], IdDecorator); + return IdDecorator; +}()); +exports.IdDecorator = IdDecorator; +//# sourceMappingURL=id-decorator.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/views/key-tool.js": +/*!*********************************************************!*\ + !*** ./node_modules/sprotty/lib/base/views/key-tool.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var smodel_1 = __webpack_require__(/*! ../model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var vnode_utils_1 = __webpack_require__(/*! ./vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var KeyTool = /** @class */ (function () { + function KeyTool(keyListeners) { + if (keyListeners === void 0) { keyListeners = []; } + this.keyListeners = keyListeners; + } + KeyTool.prototype.register = function (keyListener) { + this.keyListeners.push(keyListener); + }; + KeyTool.prototype.deregister = function (keyListener) { + var index = this.keyListeners.indexOf(keyListener); + if (index >= 0) + this.keyListeners.splice(index, 1); + }; + KeyTool.prototype.handleEvent = function (methodName, model, event) { + var actions = this.keyListeners + .map(function (listener) { return listener[methodName].apply(listener, [model, event]); }) + .reduce(function (a, b) { return a.concat(b); }); + if (actions.length > 0) { + event.preventDefault(); + this.actionDispatcher.dispatchAll(actions); + } + }; + KeyTool.prototype.keyDown = function (element, event) { + this.handleEvent('keyDown', element, event); + }; + KeyTool.prototype.keyUp = function (element, event) { + this.handleEvent('keyUp', element, event); + }; + KeyTool.prototype.focus = function () { }; + KeyTool.prototype.decorate = function (vnode, element) { + if (element instanceof smodel_1.SModelRoot) { + vnode_utils_1.on(vnode, 'focus', this.focus.bind(this), element); + vnode_utils_1.on(vnode, 'keydown', this.keyDown.bind(this), element); + vnode_utils_1.on(vnode, 'keyup', this.keyUp.bind(this), element); + } + return vnode; + }; + KeyTool.prototype.postUpdate = function () { + }; + __decorate([ + inversify_1.inject(types_1.TYPES.IActionDispatcher), + __metadata("design:type", Object) + ], KeyTool.prototype, "actionDispatcher", void 0); + KeyTool = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.multiInject(types_1.TYPES.KeyListener)), __param(0, inversify_1.optional()), + __metadata("design:paramtypes", [Array]) + ], KeyTool); + return KeyTool; +}()); +exports.KeyTool = KeyTool; +var KeyListener = /** @class */ (function () { + function KeyListener() { + } + KeyListener.prototype.keyDown = function (element, event) { + return []; + }; + KeyListener.prototype.keyUp = function (element, event) { + return []; + }; + KeyListener = __decorate([ + inversify_1.injectable() + ], KeyListener); + return KeyListener; +}()); +exports.KeyListener = KeyListener; +//# sourceMappingURL=key-tool.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/views/mouse-tool.js": +/*!***********************************************************!*\ + !*** ./node_modules/sprotty/lib/base/views/mouse-tool.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var smodel_1 = __webpack_require__(/*! ../model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var action_1 = __webpack_require__(/*! ../actions/action */ "./node_modules/sprotty/lib/base/actions/action.js"); +var vnode_utils_1 = __webpack_require__(/*! ./vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var dom_helper_1 = __webpack_require__(/*! ./dom-helper */ "./node_modules/sprotty/lib/base/views/dom-helper.js"); +var MouseTool = /** @class */ (function () { + function MouseTool(mouseListeners) { + if (mouseListeners === void 0) { mouseListeners = []; } + this.mouseListeners = mouseListeners; + } + MouseTool.prototype.register = function (mouseListener) { + this.mouseListeners.push(mouseListener); + }; + MouseTool.prototype.deregister = function (mouseListener) { + var index = this.mouseListeners.indexOf(mouseListener); + if (index >= 0) + this.mouseListeners.splice(index, 1); + }; + MouseTool.prototype.getTargetElement = function (model, event) { + var target = event.target; + var index = model.index; + while (target) { + if (target.id) { + var element = index.getById(this.domHelper.findSModelIdByDOMElement(target)); + if (element !== undefined) + return element; + } + target = target.parentNode; + } + return undefined; + }; + MouseTool.prototype.handleEvent = function (methodName, model, event) { + var _this = this; + this.focusOnMouseEvent(methodName, model); + var element = this.getTargetElement(model, event); + if (!element) + return; + var actions = this.mouseListeners + .map(function (listener) { return listener[methodName].apply(listener, [element, event]); }) + .reduce(function (a, b) { return a.concat(b); }); + if (actions.length > 0) { + event.preventDefault(); + for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) { + var actionOrPromise = actions_1[_i]; + if (action_1.isAction(actionOrPromise)) { + this.actionDispatcher.dispatch(actionOrPromise); + } + else { + actionOrPromise.then(function (action) { + _this.actionDispatcher.dispatch(action); + }); + } + } + } + }; + MouseTool.prototype.focusOnMouseEvent = function (methodName, model) { + if (document) { + var domElement = document.getElementById(this.domHelper.createUniqueDOMElementId(model)); + if (methodName === 'mouseDown' && domElement !== null && typeof domElement.focus === 'function') + domElement.focus(); + } + }; + MouseTool.prototype.mouseOver = function (model, event) { + this.handleEvent('mouseOver', model, event); + }; + MouseTool.prototype.mouseOut = function (model, event) { + this.handleEvent('mouseOut', model, event); + }; + MouseTool.prototype.mouseEnter = function (model, event) { + this.handleEvent('mouseEnter', model, event); + }; + MouseTool.prototype.mouseLeave = function (model, event) { + this.handleEvent('mouseLeave', model, event); + }; + MouseTool.prototype.mouseDown = function (model, event) { + this.handleEvent('mouseDown', model, event); + }; + MouseTool.prototype.mouseMove = function (model, event) { + this.handleEvent('mouseMove', model, event); + }; + MouseTool.prototype.mouseUp = function (model, event) { + this.handleEvent('mouseUp', model, event); + }; + MouseTool.prototype.wheel = function (model, event) { + this.handleEvent('wheel', model, event); + }; + MouseTool.prototype.doubleClick = function (model, event) { + this.handleEvent('doubleClick', model, event); + }; + MouseTool.prototype.decorate = function (vnode, element) { + if (element instanceof smodel_1.SModelRoot) { + vnode_utils_1.on(vnode, 'mouseover', this.mouseOver.bind(this), element); + vnode_utils_1.on(vnode, 'mouseout', this.mouseOut.bind(this), element); + vnode_utils_1.on(vnode, 'mouseenter', this.mouseEnter.bind(this), element); + vnode_utils_1.on(vnode, 'mouseleave', this.mouseLeave.bind(this), element); + vnode_utils_1.on(vnode, 'mousedown', this.mouseDown.bind(this), element); + vnode_utils_1.on(vnode, 'mouseup', this.mouseUp.bind(this), element); + vnode_utils_1.on(vnode, 'mousemove', this.mouseMove.bind(this), element); + vnode_utils_1.on(vnode, 'wheel', this.wheel.bind(this), element); + vnode_utils_1.on(vnode, 'contextmenu', function (target, event) { + event.preventDefault(); + }, element); + vnode_utils_1.on(vnode, 'dblclick', this.doubleClick.bind(this), element); + } + vnode = this.mouseListeners.reduce(function (n, listener) { return listener.decorate(n, element); }, vnode); + return vnode; + }; + MouseTool.prototype.postUpdate = function () { + }; + __decorate([ + inversify_1.inject(types_1.TYPES.IActionDispatcher), + __metadata("design:type", Object) + ], MouseTool.prototype, "actionDispatcher", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.DOMHelper), + __metadata("design:type", dom_helper_1.DOMHelper) + ], MouseTool.prototype, "domHelper", void 0); + MouseTool = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.multiInject(types_1.TYPES.MouseListener)), __param(0, inversify_1.optional()), + __metadata("design:paramtypes", [Array]) + ], MouseTool); + return MouseTool; +}()); +exports.MouseTool = MouseTool; +var PopupMouseTool = /** @class */ (function (_super) { + __extends(PopupMouseTool, _super); + function PopupMouseTool(mouseListeners) { + if (mouseListeners === void 0) { mouseListeners = []; } + var _this = _super.call(this, mouseListeners) || this; + _this.mouseListeners = mouseListeners; + return _this; + } + PopupMouseTool = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.multiInject(types_1.TYPES.PopupMouseListener)), __param(0, inversify_1.optional()), + __metadata("design:paramtypes", [Array]) + ], PopupMouseTool); + return PopupMouseTool; +}(MouseTool)); +exports.PopupMouseTool = PopupMouseTool; +var MouseListener = /** @class */ (function () { + function MouseListener() { + } + MouseListener.prototype.mouseOver = function (target, event) { + return []; + }; + MouseListener.prototype.mouseOut = function (target, event) { + return []; + }; + MouseListener.prototype.mouseEnter = function (target, event) { + return []; + }; + MouseListener.prototype.mouseLeave = function (target, event) { + return []; + }; + MouseListener.prototype.mouseDown = function (target, event) { + return []; + }; + MouseListener.prototype.mouseMove = function (target, event) { + return []; + }; + MouseListener.prototype.mouseUp = function (target, event) { + return []; + }; + MouseListener.prototype.wheel = function (target, event) { + return []; + }; + MouseListener.prototype.doubleClick = function (target, event) { + return []; + }; + MouseListener.prototype.decorate = function (vnode, element) { + return vnode; + }; + MouseListener = __decorate([ + inversify_1.injectable() + ], MouseListener); + return MouseListener; +}()); +exports.MouseListener = MouseListener; +//# sourceMappingURL=mouse-tool.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/views/thunk-view.js": +/*!***********************************************************!*\ + !*** ./node_modules/sprotty/lib/base/views/thunk-view.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var snabbdom_1 = __webpack_require__(/*! snabbdom */ "./node_modules/snabbdom/es/snabbdom.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +/** + * An view that avoids calculation and patching of VNodes unless some model properties have changed. + * Based on snabbdom's thunks. + */ +var ThunkView = /** @class */ (function () { + function ThunkView() { + } + ThunkView.prototype.render = function (model, context) { + var _this = this; + return snabbdom_1.h(this.selector(model), { + key: model.id, + hook: { + init: this.init.bind(this), + prepatch: this.prepatch.bind(this) + }, + fn: function () { return _this.renderAndDecorate(model, context); }, + args: this.watchedArgs(model), + thunk: true + }); + }; + ThunkView.prototype.renderAndDecorate = function (model, context) { + var vnode = this.doRender(model, context); + context.decorate(vnode, model); + return vnode; + }; + ThunkView.prototype.copyToThunk = function (vnode, thunk) { + thunk.elm = vnode.elm; + vnode.data.fn = thunk.data.fn; + vnode.data.args = thunk.data.args; + thunk.data = vnode.data; + thunk.children = vnode.children; + thunk.text = vnode.text; + thunk.elm = vnode.elm; + }; + ThunkView.prototype.init = function (thunk) { + var cur = thunk.data; + var vnode = cur.fn.apply(undefined, cur.args); + this.copyToThunk(vnode, thunk); + }; + ThunkView.prototype.prepatch = function (oldVnode, thunk) { + var old = oldVnode.data, cur = thunk.data; + if (!this.equals(old.args, cur.args)) + this.copyToThunk(cur.fn.apply(undefined, cur.args), thunk); + else + this.copyToThunk(oldVnode, thunk); + }; + ThunkView.prototype.equals = function (oldArg, newArg) { + if (Array.isArray(oldArg) && Array.isArray(newArg)) { + if (oldArg.length !== newArg.length) + return false; + for (var i = 0; i < newArg.length; ++i) { + if (!this.equals(oldArg[i], newArg[i])) + return false; + } + } + else if (typeof oldArg === 'object' && typeof newArg === 'object') { + if (Object.keys(oldArg).length !== Object.keys(newArg).length) + return false; + for (var key in oldArg) { + if (key !== 'parent' && key !== 'root' && (!(key in newArg) || !this.equals(oldArg[key], newArg[key]))) + return false; + } + } + else if (oldArg !== newArg) { + return false; + } + return true; + }; + ThunkView = __decorate([ + inversify_1.injectable() + ], ThunkView); + return ThunkView; +}()); +exports.ThunkView = ThunkView; +function isThunk(vnode) { + return 'thunk' in vnode; +} +exports.isThunk = isThunk; +//# sourceMappingURL=thunk-view.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/views/view.js": +/*!*****************************************************!*\ + !*** ./node_modules/sprotty/lib/base/views/view.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +/** @jsx svg */ +var snabbdom_jsx_1 = __webpack_require__(/*! snabbdom-jsx */ "./node_modules/snabbdom-jsx/snabbdom-jsx.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var smodel_factory_1 = __webpack_require__(/*! ../model/smodel-factory */ "./node_modules/sprotty/lib/base/model/smodel-factory.js"); +var registry_1 = __webpack_require__(/*! ../../utils/registry */ "./node_modules/sprotty/lib/utils/registry.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var inversify_2 = __webpack_require__(/*! ../../utils/inversify */ "./node_modules/sprotty/lib/utils/inversify.js"); +/** + * Allows to look up the IView for a given SModelElement based on its type. + */ +var ViewRegistry = /** @class */ (function (_super) { + __extends(ViewRegistry, _super); + function ViewRegistry(registrations) { + var _this = _super.call(this) || this; + _this.registerDefaults(); + registrations.forEach(function (registration) { + return _this.register(registration.type, registration.factory()); + }); + return _this; + } + ViewRegistry.prototype.registerDefaults = function () { + this.register(smodel_factory_1.EMPTY_ROOT.type, new EmptyView()); + }; + ViewRegistry.prototype.missing = function (key) { + return new MissingView(); + }; + ViewRegistry = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.multiInject(types_1.TYPES.ViewRegistration)), __param(0, inversify_1.optional()), + __metadata("design:paramtypes", [Array]) + ], ViewRegistry); + return ViewRegistry; +}(registry_1.InstanceRegistry)); +exports.ViewRegistry = ViewRegistry; +/** + * Utility function to register model and view constructors for a model element type. + */ +function configureModelElement(context, type, modelConstr, constr) { + context.bind(types_1.TYPES.SModelElementRegistration).toConstantValue({ + type: type, + constr: modelConstr + }); + configureView(context, type, constr); +} +exports.configureModelElement = configureModelElement; +/** + * Utility function to register a view for a model element type. + */ +function configureView(context, type, constr) { + if (inversify_2.isInjectable(constr)) { + if (!context.isBound(constr)) + context.bind(constr).toSelf(); + context.bind(types_1.TYPES.ViewRegistration).toDynamicValue(function (ctx) { + return { + factory: function () { return ctx.container.get(constr); }, + type: type + }; + }); + } + else { + throw Error("Views should be @injectable " + constr.name); + } +} +exports.configureView = configureView; +/** + * This view is used when the model is the EMPTY_ROOT. + */ +var EmptyView = /** @class */ (function () { + function EmptyView() { + } + EmptyView.prototype.render = function (model, context) { + return snabbdom_jsx_1.svg("svg", { "class-sprotty-empty": true }); + }; + EmptyView = __decorate([ + inversify_1.injectable() + ], EmptyView); + return EmptyView; +}()); +exports.EmptyView = EmptyView; +/** + * This view is used when no view has been registered for a model element type. + */ +var MissingView = /** @class */ (function () { + function MissingView() { + } + MissingView.prototype.render = function (model, context) { + var position = model.position || geometry_1.ORIGIN_POINT; + return snabbdom_jsx_1.svg("text", { "class-sprotty-missing": true, x: position.x, y: position.y }, + "?", + model.id, + "?"); + }; + MissingView = __decorate([ + inversify_1.injectable() + ], MissingView); + return MissingView; +}()); +exports.MissingView = MissingView; +//# sourceMappingURL=view.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/views/viewer-cache.js": +/*!*************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/views/viewer-cache.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var animation_frame_syncer_1 = __webpack_require__(/*! ../animations/animation-frame-syncer */ "./node_modules/sprotty/lib/base/animations/animation-frame-syncer.js"); +/** + * Updating the view is rather expensive, and it doesn't make sense to calculate + * more then one update per animation (rendering) frame. So this class batches + * all incoming model changes and only renders the last one when the next animation + * frame comes. + */ +var ViewerCache = /** @class */ (function () { + function ViewerCache() { + } + ViewerCache.prototype.isCacheEmpty = function () { + return this.cachedModelRoot === undefined && this.cachedHiddenModelRoot === undefined && + this.cachedPopup === undefined; + }; + ViewerCache.prototype.updatePopup = function (model) { + var isCacheEmpty = this.isCacheEmpty(); + this.cachedPopup = model; + if (isCacheEmpty) + this.scheduleUpdate(); + }; + ViewerCache.prototype.update = function (model) { + var isCacheEmpty = this.isCacheEmpty(); + this.cachedModelRoot = model; + if (isCacheEmpty) + this.scheduleUpdate(); + }; + ViewerCache.prototype.updateHidden = function (hiddenModel) { + var isCacheEmpty = this.isCacheEmpty(); + this.cachedHiddenModelRoot = hiddenModel; + if (isCacheEmpty) + this.scheduleUpdate(); + }; + ViewerCache.prototype.scheduleUpdate = function () { + var _this = this; + this.syncer.onEndOfNextFrame(function () { + if (_this.cachedHiddenModelRoot) { + var nextHiddenModelRoot = _this.cachedHiddenModelRoot; + _this.delegate.updateHidden(nextHiddenModelRoot); + _this.cachedHiddenModelRoot = undefined; + } + if (_this.cachedModelRoot) { + var nextModelRoot = _this.cachedModelRoot; + _this.delegate.update(nextModelRoot); + _this.cachedModelRoot = undefined; + } + if (_this.cachedPopup) { + var nextModelRoot = _this.cachedPopup; + _this.delegate.updatePopup(nextModelRoot); + _this.cachedPopup = undefined; + } + }); + }; + __decorate([ + inversify_1.inject(types_1.TYPES.IViewer), inversify_1.named('delegate'), + __metadata("design:type", Object) + ], ViewerCache.prototype, "delegate", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.AnimationFrameSyncer), + __metadata("design:type", animation_frame_syncer_1.AnimationFrameSyncer) + ], ViewerCache.prototype, "syncer", void 0); + ViewerCache = __decorate([ + inversify_1.injectable() + ], ViewerCache); + return ViewerCache; +}()); +exports.ViewerCache = ViewerCache; +//# sourceMappingURL=viewer-cache.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/views/viewer-options.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/views/viewer-options.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +exports.defaultViewerOptions = function () { return ({ + baseDiv: 'sprotty', + baseClass: 'sprotty', + hiddenDiv: 'sprotty-hidden', + hiddenClass: 'sprotty-hidden', + popupDiv: 'sprotty-popup', + popupClass: 'sprotty-popup', + popupClosedClass: 'sprotty-popup-closed', + needsClientLayout: true, + needsServerLayout: false, + popupOpenDelay: 1000, + popupCloseDelay: 300 +}); }; +/** + * Utility function to partially set viewer options. Default values (from `defaultViewerOptions`) are used for + * options that are not specified. + */ +function configureViewerOptions(context, options) { + var opt = __assign({}, exports.defaultViewerOptions(), options); + if (context.isBound(types_1.TYPES.ViewerOptions)) + context.rebind(types_1.TYPES.ViewerOptions).toConstantValue(opt); + else + context.bind(types_1.TYPES.ViewerOptions).toConstantValue(opt); +} +exports.configureViewerOptions = configureViewerOptions; +/** + * Utility function to partially override the currently configured viewer options in a DI container. + */ +function overrideViewerOptions(container, options) { + var opt = container.get(types_1.TYPES.ViewerOptions); + for (var p in options) { + if (options.hasOwnProperty(p)) + opt[p] = options[p]; + } + return opt; +} +exports.overrideViewerOptions = overrideViewerOptions; +//# sourceMappingURL=viewer-options.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/views/viewer.js": +/*!*******************************************************!*\ + !*** ./node_modules/sprotty/lib/base/views/viewer.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +/** @jsx html */ +var snabbdom_jsx_1 = __webpack_require__(/*! snabbdom-jsx */ "./node_modules/snabbdom-jsx/snabbdom-jsx.js"); // must be html here, as we're creating a div +var snabbdom_1 = __webpack_require__(/*! snabbdom */ "./node_modules/snabbdom/es/snabbdom.js"); +var props_1 = __webpack_require__(/*! snabbdom/modules/props */ "./node_modules/snabbdom/modules/props.js"); +var attributes_1 = __webpack_require__(/*! snabbdom/modules/attributes */ "./node_modules/snabbdom/modules/attributes.js"); +var style_1 = __webpack_require__(/*! snabbdom/modules/style */ "./node_modules/snabbdom/modules/style.js"); +var eventlisteners_1 = __webpack_require__(/*! snabbdom/modules/eventlisteners */ "./node_modules/snabbdom/modules/eventlisteners.js"); +var class_1 = __webpack_require__(/*! snabbdom/modules/class */ "./node_modules/snabbdom/modules/class.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../types */ "./node_modules/sprotty/lib/base/types.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var initialize_canvas_1 = __webpack_require__(/*! ../features/initialize-canvas */ "./node_modules/sprotty/lib/base/features/initialize-canvas.js"); +var vnode_utils_1 = __webpack_require__(/*! ./vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var thunk_view_1 = __webpack_require__(/*! ./thunk-view */ "./node_modules/sprotty/lib/base/views/thunk-view.js"); +var smodel_factory_1 = __webpack_require__(/*! ../model/smodel-factory */ "./node_modules/sprotty/lib/base/model/smodel-factory.js"); +var ModelRenderer = /** @class */ (function () { + function ModelRenderer(viewRegistry, decorators) { + this.viewRegistry = viewRegistry; + this.decorators = decorators; + } + ModelRenderer.prototype.decorate = function (vnode, element) { + if (thunk_view_1.isThunk(vnode)) + return vnode; + return this.decorators.reduce(function (n, decorator) { return decorator.decorate(n, element); }, vnode); + }; + ModelRenderer.prototype.renderElement = function (element, args) { + var vNode = this.viewRegistry.get(element.type).render(element, this, args); + return this.decorate(vNode, element); + }; + ModelRenderer.prototype.renderChildren = function (element, args) { + var _this = this; + return element.children.map(function (child) { return _this.renderElement(child, args); }); + }; + ModelRenderer.prototype.postUpdate = function () { + this.decorators.forEach(function (decorator) { return decorator.postUpdate(); }); + }; + return ModelRenderer; +}()); +exports.ModelRenderer = ModelRenderer; +/** + * The component that turns the model into an SVG DOM. + * Uses a VDOM based on snabbdom.js for performance. + */ +var Viewer = /** @class */ (function () { + function Viewer(modelRendererFactory, decorators, hiddenDecorators, popupDecorators) { + var _this = this; + this.modelRendererFactory = modelRendererFactory; + this.onWindowResize = function (vdom) { + var baseDiv = document.getElementById(_this.options.baseDiv); + if (baseDiv !== null) { + var newBounds = _this.getBoundsInPage(baseDiv); + _this.actiondispatcher.dispatch(new initialize_canvas_1.InitializeCanvasBoundsAction(newBounds)); + } + }; + this.patcher = this.createPatcher(); + this.renderer = this.modelRendererFactory(decorators); + this.hiddenRenderer = this.modelRendererFactory(hiddenDecorators); + this.popupRenderer = this.modelRendererFactory(popupDecorators); + } + Viewer.prototype.createModules = function () { + return [ + props_1.propsModule, + attributes_1.attributesModule, + class_1.classModule, + style_1.styleModule, + eventlisteners_1.eventListenersModule + ]; + }; + Viewer.prototype.createPatcher = function () { + return snabbdom_1.init(this.createModules()); + }; + Viewer.prototype.getBoundsInPage = function (element) { + var bounds = element.getBoundingClientRect(); + var scroll = typeof window !== 'undefined' ? { x: window.scrollX, y: window.scrollY } : geometry_1.ORIGIN_POINT; + return { + x: bounds.left + scroll.x, + y: bounds.top + scroll.y, + width: bounds.width, + height: bounds.height + }; + }; + Viewer.prototype.update = function (model) { + var _this = this; + this.logger.log(this, 'rendering', model); + var newVDOM = snabbdom_jsx_1.html("div", { id: this.options.baseDiv }, this.renderer.renderElement(model)); + if (this.lastVDOM !== undefined) { + var hadFocus = this.hasFocus(); + vnode_utils_1.copyClassesFromVNode(this.lastVDOM, newVDOM); + this.lastVDOM = this.patcher.call(this, this.lastVDOM, newVDOM); + this.restoreFocus(hadFocus); + } + else if (typeof document !== 'undefined') { + var placeholder = document.getElementById(this.options.baseDiv); + if (placeholder !== null) { + if (typeof window !== 'undefined') { + window.addEventListener('resize', function () { + _this.onWindowResize(newVDOM); + }); + } + vnode_utils_1.copyClassesFromElement(placeholder, newVDOM); + vnode_utils_1.setClass(newVDOM, this.options.baseClass, true); + this.lastVDOM = this.patcher.call(this, placeholder, newVDOM); + } + else { + this.logger.error(this, 'element not in DOM:', this.options.baseDiv); + } + } + this.renderer.postUpdate(); + }; + Viewer.prototype.hasFocus = function () { + if (typeof document !== 'undefined' && document.activeElement && this.lastVDOM.children && this.lastVDOM.children.length > 0) { + var lastRootVNode = this.lastVDOM.children[0]; + if (typeof lastRootVNode === 'object') { + var lastElement = lastRootVNode.elm; + return document.activeElement === lastElement; + } + } + return false; + }; + Viewer.prototype.restoreFocus = function (focus) { + if (focus && this.lastVDOM.children && this.lastVDOM.children.length > 0) { + var lastRootVNode = this.lastVDOM.children[0]; + if (typeof lastRootVNode === 'object') { + var lastElement = lastRootVNode.elm; + if (lastElement && typeof lastElement.focus === 'function') + lastElement.focus(); + } + } + }; + Viewer.prototype.updateHidden = function (hiddenModel) { + this.logger.log(this, 'rendering hidden'); + var newVDOM; + if (hiddenModel.type === smodel_factory_1.EMPTY_ROOT.type) { + newVDOM = snabbdom_jsx_1.html("div", { id: this.options.hiddenDiv }); + } + else { + var hiddenVNode = this.hiddenRenderer.renderElement(hiddenModel); + vnode_utils_1.setAttr(hiddenVNode, 'opacity', 0); + newVDOM = snabbdom_jsx_1.html("div", { id: this.options.hiddenDiv }, hiddenVNode); + } + if (this.lastHiddenVDOM !== undefined) { + vnode_utils_1.copyClassesFromVNode(this.lastHiddenVDOM, newVDOM); + this.lastHiddenVDOM = this.patcher.call(this, this.lastHiddenVDOM, newVDOM); + } + else { + var placeholder = document.getElementById(this.options.hiddenDiv); + if (placeholder === null) { + placeholder = document.createElement("div"); + document.body.appendChild(placeholder); + } + else { + vnode_utils_1.copyClassesFromElement(placeholder, newVDOM); + } + vnode_utils_1.setClass(newVDOM, this.options.baseClass, true); + vnode_utils_1.setClass(newVDOM, this.options.hiddenClass, true); + this.lastHiddenVDOM = this.patcher.call(this, placeholder, newVDOM); + } + this.hiddenRenderer.postUpdate(); + }; + Viewer.prototype.updatePopup = function (model) { + this.logger.log(this, 'rendering popup', model); + var popupClosed = model.type === smodel_factory_1.EMPTY_ROOT.type; + var newVDOM; + if (popupClosed) { + newVDOM = snabbdom_jsx_1.html("div", { id: this.options.popupDiv }); + } + else { + var position = model.canvasBounds; + var inlineStyle = { + top: position.y + 'px', + left: position.x + 'px' + }; + newVDOM = snabbdom_jsx_1.html("div", { id: this.options.popupDiv, style: inlineStyle }, this.popupRenderer.renderElement(model)); + } + if (this.lastPopupVDOM !== undefined) { + vnode_utils_1.copyClassesFromVNode(this.lastPopupVDOM, newVDOM); + vnode_utils_1.setClass(newVDOM, this.options.popupClosedClass, popupClosed); + this.lastPopupVDOM = this.patcher.call(this, this.lastPopupVDOM, newVDOM); + } + else if (typeof document !== 'undefined') { + var placeholder = document.getElementById(this.options.popupDiv); + if (placeholder === null) { + placeholder = document.createElement("div"); + document.body.appendChild(placeholder); + } + else { + vnode_utils_1.copyClassesFromElement(placeholder, newVDOM); + } + vnode_utils_1.setClass(newVDOM, this.options.popupClass, true); + vnode_utils_1.setClass(newVDOM, this.options.popupClosedClass, popupClosed); + this.lastPopupVDOM = this.patcher.call(this, placeholder, newVDOM); + } + this.popupRenderer.postUpdate(); + }; + __decorate([ + inversify_1.inject(types_1.TYPES.ViewerOptions), + __metadata("design:type", Object) + ], Viewer.prototype, "options", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.ILogger), + __metadata("design:type", Object) + ], Viewer.prototype, "logger", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.IActionDispatcher), + __metadata("design:type", Object) + ], Viewer.prototype, "actiondispatcher", void 0); + Viewer = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.ModelRendererFactory)), + __param(1, inversify_1.multiInject(types_1.TYPES.IVNodeDecorator)), __param(1, inversify_1.optional()), + __param(2, inversify_1.multiInject(types_1.TYPES.HiddenVNodeDecorator)), __param(2, inversify_1.optional()), + __param(3, inversify_1.multiInject(types_1.TYPES.PopupVNodeDecorator)), __param(3, inversify_1.optional()), + __metadata("design:paramtypes", [Function, Array, Array, Array]) + ], Viewer); + return Viewer; +}()); +exports.Viewer = Viewer; +//# sourceMappingURL=viewer.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/views/vnode-decorators.js": +/*!*****************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/views/vnode-decorators.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var vnode_utils_1 = __webpack_require__(/*! ./vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var FocusFixDecorator = /** @class */ (function () { + function FocusFixDecorator() { + } + FocusFixDecorator_1 = FocusFixDecorator; + FocusFixDecorator.prototype.decorate = function (vnode, element) { + if (vnode.sel && vnode.sel.startsWith('svg')) + // allows to set focus in Firefox + vnode_utils_1.setAttr(vnode, 'tabindex', ++FocusFixDecorator_1.tabIndex); + return vnode; + }; + FocusFixDecorator.prototype.postUpdate = function () { + }; + var FocusFixDecorator_1; + FocusFixDecorator.tabIndex = 1000; + FocusFixDecorator = FocusFixDecorator_1 = __decorate([ + inversify_1.injectable() + ], FocusFixDecorator); + return FocusFixDecorator; +}()); +exports.FocusFixDecorator = FocusFixDecorator; +//# sourceMappingURL=vnode-decorators.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/base/views/vnode-utils.js": +/*!************************************************************!*\ + !*** ./node_modules/sprotty/lib/base/views/vnode-utils.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +function setAttr(vnode, name, value) { + getAttrs(vnode)[name] = value; +} +exports.setAttr = setAttr; +function setClass(vnode, name, value) { + getClass(vnode)[name] = value; +} +exports.setClass = setClass; +function copyClassesFromVNode(source, target) { + var classList = getClass(source); + for (var c in classList) { + if (classList.hasOwnProperty(c)) + setClass(target, c, true); + } +} +exports.copyClassesFromVNode = copyClassesFromVNode; +function copyClassesFromElement(element, target) { + var classList = element.classList; + for (var i = 0; i < classList.length; i++) { + var item = classList.item(i); + if (item) + setClass(target, item, true); + } +} +exports.copyClassesFromElement = copyClassesFromElement; +function mergeStyle(vnode, style) { + getData(vnode).style = __assign({}, (getData(vnode).style || {}), style); +} +exports.mergeStyle = mergeStyle; +function on(vnode, event, listener, element) { + var val = getOn(vnode); + if (val[event]) { + throw new Error('EventListener for ' + event + ' already registered on VNode'); + } + val[event] = [listener, element]; +} +exports.on = on; +function getAttrs(vnode) { + var data = getData(vnode); + if (!data.attrs) + data.attrs = {}; + return data.attrs; +} +exports.getAttrs = getAttrs; +function getData(vnode) { + if (!vnode.data) + vnode.data = {}; + return vnode.data; +} +function getClass(vnode) { + var data = getData(vnode); + if (!data.class) + data.class = {}; + return data.class; +} +function getOn(vnode) { + var data = getData(vnode); + if (!data.on) + data.on = {}; + return data.on; +} +//# sourceMappingURL=vnode-utils.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/bounds/abstract-layout.js": +/*!*********************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/bounds/abstract-layout.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var AbstractLayout = /** @class */ (function () { + function AbstractLayout() { + } + AbstractLayout.prototype.layout = function (container, layouter) { + var boundsData = layouter.getBoundsData(container); + var options = this.getLayoutOptions(container); + var childrenSize = this.getChildrenSize(container, options, layouter); + var maxWidth = options.paddingFactor * (options.resizeContainer + ? childrenSize.width + : Math.max(0, this.getFixedContainerBounds(container, options, layouter).width) - options.paddingLeft - options.paddingRight); + var maxHeight = options.paddingFactor * (options.resizeContainer + ? childrenSize.height + : Math.max(0, this.getFixedContainerBounds(container, options, layouter).height) - options.paddingTop - options.paddingBottom); + if (maxWidth > 0 && maxHeight > 0) { + var offset = this.layoutChildren(container, layouter, options, maxWidth, maxHeight); + boundsData.bounds = this.getFinalContainerBounds(container, offset, options, maxWidth, maxHeight); + boundsData.boundsChanged = true; + } + }; + AbstractLayout.prototype.getFinalContainerBounds = function (container, lastOffset, options, maxWidth, maxHeight) { + return { + x: container.bounds.x, + y: container.bounds.y, + width: Math.max(options.minWidth, maxWidth + options.paddingLeft + options.paddingRight), + height: Math.max(options.minHeight, maxHeight + options.paddingTop + options.paddingBottom) + }; + }; + AbstractLayout.prototype.getFixedContainerBounds = function (container, layoutOptions, layouter) { + var currentContainer = container; + while (true) { + if (model_1.isBoundsAware(currentContainer)) { + var bounds = currentContainer.bounds; + if (model_1.isLayoutContainer(currentContainer) && layoutOptions.resizeContainer) + layouter.log.error(currentContainer, 'Resizable container found while detecting fixed bounds'); + if (geometry_1.isValidDimension(bounds)) + return bounds; + } + if (currentContainer instanceof smodel_1.SChildElement) { + currentContainer = currentContainer.parent; + } + else { + layouter.log.error(currentContainer, 'Cannot detect fixed bounds'); + return geometry_1.EMPTY_BOUNDS; + } + } + }; + AbstractLayout.prototype.layoutChildren = function (container, layouter, containerOptions, maxWidth, maxHeight) { + var _this = this; + var currentOffset = { + x: containerOptions.paddingLeft + 0.5 * (maxWidth - (maxWidth / containerOptions.paddingFactor)), + y: containerOptions.paddingTop + 0.5 * (maxHeight - (maxHeight / containerOptions.paddingFactor)) + }; + container.children.forEach(function (child) { + if (model_1.isLayoutableChild(child)) { + var boundsData = layouter.getBoundsData(child); + var bounds = boundsData.bounds; + var childOptions = _this.getChildLayoutOptions(child, containerOptions); + if (bounds !== undefined && geometry_1.isValidDimension(bounds)) { + currentOffset = _this.layoutChild(child, boundsData, bounds, childOptions, containerOptions, currentOffset, maxWidth, maxHeight); + } + } + }); + return currentOffset; + }; + AbstractLayout.prototype.getDx = function (hAlign, bounds, maxWidth) { + switch (hAlign) { + case 'left': + return 0; + case 'center': + return 0.5 * (maxWidth - bounds.width); + case 'right': + return maxWidth - bounds.width; + } + }; + AbstractLayout.prototype.getDy = function (vAlign, bounds, maxHeight) { + switch (vAlign) { + case 'top': + return 0; + case 'center': + return 0.5 * (maxHeight - bounds.height); + case 'bottom': + return maxHeight - bounds.height; + } + }; + AbstractLayout.prototype.getChildLayoutOptions = function (child, containerOptions) { + var layoutOptions = child.layoutOptions; + if (layoutOptions === undefined) + return containerOptions; + else + return this.spread(containerOptions, layoutOptions); + }; + AbstractLayout.prototype.getLayoutOptions = function (element) { + var _this = this; + var current = element; + var allOptions = []; + while (current !== undefined) { + var layoutOptions = current.layoutOptions; + if (layoutOptions !== undefined) + allOptions.push(layoutOptions); + if (current instanceof smodel_1.SChildElement) + current = current.parent; + else + break; + } + return allOptions.reverse().reduce(function (a, b) { return _this.spread(a, b); }, this.getDefaultLayoutOptions()); + }; + return AbstractLayout; +}()); +exports.AbstractLayout = AbstractLayout; +//# sourceMappingURL=abstract-layout.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/bounds/bounds-manipulation.js": +/*!*************************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/bounds/bounds-manipulation.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var command_1 = __webpack_require__(/*! ../../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +/** + * Sent from the model source (e.g. a DiagramServer) to the client to update the bounds of some + * (or all) model elements. + */ +var SetBoundsAction = /** @class */ (function () { + function SetBoundsAction(bounds) { + this.bounds = bounds; + this.kind = SetBoundsCommand.KIND; + } + return SetBoundsAction; +}()); +exports.SetBoundsAction = SetBoundsAction; +/** + * Sent from the model source to the client to request bounds for the given model. The model is + * rendered invisibly so the bounds can derived from the DOM. The response is a ComputedBoundsAction. + * This hidden rendering round-trip is necessary if the client is responsible for parts of the layout + * (see `needsClientLayout` viewer option). + */ +var RequestBoundsAction = /** @class */ (function () { + function RequestBoundsAction(newRoot) { + this.newRoot = newRoot; + this.kind = RequestBoundsCommand.KIND; + } + return RequestBoundsAction; +}()); +exports.RequestBoundsAction = RequestBoundsAction; +/** + * Sent from the client to the model source (e.g. a DiagramServer) to transmit the result of bounds + * computation as a response to a RequestBoundsAction. If the server is responsible for parts of + * the layout (see `needsServerLayout` viewer option), it can do so after applying the computed bounds + * received with this action. Otherwise there is no need to send the computed bounds to the server, + * so they can be processed locally by the client. + */ +var ComputedBoundsAction = /** @class */ (function () { + function ComputedBoundsAction(bounds, revision, alignments) { + this.bounds = bounds; + this.revision = revision; + this.alignments = alignments; + this.kind = ComputedBoundsAction.KIND; + } + ComputedBoundsAction.KIND = 'computedBounds'; + return ComputedBoundsAction; +}()); +exports.ComputedBoundsAction = ComputedBoundsAction; +/** + * Request a layout of the diagram or the selected elements only. + */ +var LayoutAction = /** @class */ (function () { + function LayoutAction() { + this.kind = LayoutAction.KIND; + } + LayoutAction.KIND = 'layout'; + return LayoutAction; +}()); +exports.LayoutAction = LayoutAction; +var SetBoundsCommand = /** @class */ (function (_super) { + __extends(SetBoundsCommand, _super); + function SetBoundsCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + _this.bounds = []; + return _this; + } + SetBoundsCommand.prototype.execute = function (context) { + var _this = this; + this.action.bounds.forEach(function (b) { + var element = context.root.index.getById(b.elementId); + if (element && model_1.isBoundsAware(element)) { + _this.bounds.push({ + element: element, + oldBounds: element.bounds, + newBounds: b.newBounds, + }); + } + }); + return this.redo(context); + }; + SetBoundsCommand.prototype.undo = function (context) { + this.bounds.forEach(function (b) { return b.element.bounds = b.oldBounds; }); + return context.root; + }; + SetBoundsCommand.prototype.redo = function (context) { + this.bounds.forEach(function (b) { return b.element.bounds = b.newBounds; }); + return context.root; + }; + SetBoundsCommand.KIND = 'setBounds'; + SetBoundsCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [SetBoundsAction]) + ], SetBoundsCommand); + return SetBoundsCommand; +}(command_1.SystemCommand)); +exports.SetBoundsCommand = SetBoundsCommand; +var RequestBoundsCommand = /** @class */ (function (_super) { + __extends(RequestBoundsCommand, _super); + function RequestBoundsCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + return _this; + } + RequestBoundsCommand.prototype.execute = function (context) { + return context.modelFactory.createRoot(this.action.newRoot); + }; + Object.defineProperty(RequestBoundsCommand.prototype, "blockUntil", { + get: function () { + return function (action) { return action.kind === ComputedBoundsAction.KIND; }; + }, + enumerable: true, + configurable: true + }); + RequestBoundsCommand.KIND = 'requestBounds'; + RequestBoundsCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [RequestBoundsAction]) + ], RequestBoundsCommand); + return RequestBoundsCommand; +}(command_1.HiddenCommand)); +exports.RequestBoundsCommand = RequestBoundsCommand; +//# sourceMappingURL=bounds-manipulation.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/bounds/di.config.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/bounds/di.config.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var bounds_manipulation_1 = __webpack_require__(/*! ./bounds-manipulation */ "./node_modules/sprotty/lib/features/bounds/bounds-manipulation.js"); +var hidden_bounds_updater_1 = __webpack_require__(/*! ./hidden-bounds-updater */ "./node_modules/sprotty/lib/features/bounds/hidden-bounds-updater.js"); +var layout_1 = __webpack_require__(/*! ./layout */ "./node_modules/sprotty/lib/features/bounds/layout.js"); +var command_registration_1 = __webpack_require__(/*! ../../base/commands/command-registration */ "./node_modules/sprotty/lib/base/commands/command-registration.js"); +var boundsModule = new inversify_1.ContainerModule(function (bind, _unbind, isBound) { + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, bounds_manipulation_1.SetBoundsCommand); + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, bounds_manipulation_1.RequestBoundsCommand); + bind(types_1.TYPES.HiddenVNodeDecorator).to(hidden_bounds_updater_1.HiddenBoundsUpdater).inSingletonScope(); + bind(types_1.TYPES.Layouter).to(layout_1.Layouter).inSingletonScope(); + bind(types_1.TYPES.LayoutRegistry).to(layout_1.LayoutRegistry).inSingletonScope(); +}); +exports.default = boundsModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/bounds/hbox-layout.js": +/*!*****************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/bounds/hbox-layout.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var abstract_layout_1 = __webpack_require__(/*! ./abstract-layout */ "./node_modules/sprotty/lib/features/bounds/abstract-layout.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +/** + * Layouts children of a container in horizontal (left->right) direction. + */ +var HBoxLayouter = /** @class */ (function (_super) { + __extends(HBoxLayouter, _super); + function HBoxLayouter() { + return _super !== null && _super.apply(this, arguments) || this; + } + HBoxLayouter.prototype.getChildrenSize = function (container, containerOptions, layouter) { + var maxWidth = 0; + var maxHeight = -1; + var isFirst = true; + container.children.forEach(function (child) { + if (model_1.isLayoutableChild(child)) { + var bounds = layouter.getBoundsData(child).bounds; + if (bounds !== undefined && geometry_1.isValidDimension(bounds)) { + if (isFirst) + isFirst = false; + else + maxWidth += containerOptions.hGap; + maxWidth += bounds.width; + maxHeight = Math.max(maxHeight, bounds.height); + } + } + }); + return { + width: maxWidth, + height: maxHeight + }; + }; + HBoxLayouter.prototype.layoutChild = function (child, boundsData, bounds, childOptions, containerOptions, currentOffset, maxWidth, maxHeight) { + var dy = this.getDy(childOptions.vAlign, bounds, maxHeight); + boundsData.bounds = { + x: currentOffset.x + child.bounds.x - bounds.x, + y: containerOptions.paddingTop + child.bounds.y - bounds.y + dy, + width: bounds.width, + height: bounds.height + }; + boundsData.boundsChanged = true; + return { + x: currentOffset.x + bounds.width + containerOptions.hGap, + y: currentOffset.y + }; + }; + HBoxLayouter.prototype.getDefaultLayoutOptions = function () { + return { + resizeContainer: true, + paddingTop: 5, + paddingBottom: 5, + paddingLeft: 5, + paddingRight: 5, + paddingFactor: 1, + hGap: 1, + vAlign: 'center', + minWidth: 0, + minHeight: 0 + }; + }; + HBoxLayouter.prototype.spread = function (a, b) { + return __assign({}, a, b); + }; + HBoxLayouter.KIND = 'hbox'; + return HBoxLayouter; +}(abstract_layout_1.AbstractLayout)); +exports.HBoxLayouter = HBoxLayouter; +//# sourceMappingURL=hbox-layout.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/bounds/hidden-bounds-updater.js": +/*!***************************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/bounds/hidden-bounds-updater.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var bounds_manipulation_1 = __webpack_require__(/*! ./bounds-manipulation */ "./node_modules/sprotty/lib/features/bounds/bounds-manipulation.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var layout_1 = __webpack_require__(/*! ./layout */ "./node_modules/sprotty/lib/features/bounds/layout.js"); +var model_2 = __webpack_require__(/*! ../export/model */ "./node_modules/sprotty/lib/features/export/model.js"); +var BoundsData = /** @class */ (function () { + function BoundsData() { + } + return BoundsData; +}()); +exports.BoundsData = BoundsData; +/** + * Grabs the bounds from hidden SVG DOM elements, applies layouts and fires + * ComputedBoundsActions. + * + * The actual bounds of an element can usually not be determined from the SModel + * as they depend on the view implementation and CSS stylings. So the best way is + * to grab them from a live (but hidden) SVG using getBBox(). + * + * If an element is Alignable, and the top-left corner of its bounding box is not + * the origin, we also issue a realign with the ComputedBoundsAction. + */ +var HiddenBoundsUpdater = /** @class */ (function () { + function HiddenBoundsUpdater() { + this.element2boundsData = new Map; + } + HiddenBoundsUpdater.prototype.decorate = function (vnode, element) { + if (model_1.isSizeable(element) || model_1.isLayoutContainer(element)) { + this.element2boundsData.set(element, { + vnode: vnode, + bounds: element.bounds, + boundsChanged: false, + alignmentChanged: false + }); + } + if (element instanceof smodel_1.SModelRoot) + this.root = element; + return vnode; + }; + HiddenBoundsUpdater.prototype.postUpdate = function () { + if (this.root !== undefined && model_2.isExportable(this.root) && this.root.export) + return; + this.getBoundsFromDOM(); + this.layouter.layout(this.element2boundsData); + var resizes = []; + var realignments = []; + this.element2boundsData.forEach(function (boundsData, element) { + if (boundsData.boundsChanged && boundsData.bounds !== undefined) + resizes.push({ + elementId: element.id, + newBounds: boundsData.bounds + }); + if (boundsData.alignmentChanged && boundsData.alignment !== undefined) + realignments.push({ + elementId: element.id, + newAlignment: boundsData.alignment + }); + }); + var revision = (this.root !== undefined) ? this.root.revision : undefined; + this.actionDispatcher.dispatch(new bounds_manipulation_1.ComputedBoundsAction(resizes, revision, realignments)); + this.element2boundsData.clear(); + }; + HiddenBoundsUpdater.prototype.getBoundsFromDOM = function () { + var _this = this; + this.element2boundsData.forEach(function (boundsData, element) { + if (boundsData.bounds && model_1.isSizeable(element)) { + var vnode = boundsData.vnode; + if (vnode && vnode.elm) { + var boundingBox = _this.getBounds(vnode.elm, element); + if (model_1.isAlignable(element) && !(geometry_1.almostEquals(boundingBox.x, 0) && geometry_1.almostEquals(boundingBox.y, 0))) { + boundsData.alignment = { + x: -boundingBox.x, + y: -boundingBox.y + }; + boundsData.alignmentChanged = true; + } + var newBounds = { + x: element.bounds.x, + y: element.bounds.y, + width: boundingBox.width, + height: boundingBox.height + }; + if (!(geometry_1.almostEquals(newBounds.x, element.bounds.x) + && geometry_1.almostEquals(newBounds.y, element.bounds.y) + && geometry_1.almostEquals(newBounds.width, element.bounds.width) + && geometry_1.almostEquals(newBounds.height, element.bounds.height))) { + boundsData.bounds = newBounds; + boundsData.boundsChanged = true; + } + } + } + }); + }; + HiddenBoundsUpdater.prototype.getBounds = function (elm, element) { + var bounds = elm.getBBox(); + return { + x: bounds.x, + y: bounds.y, + width: bounds.width, + height: bounds.height + }; + }; + __decorate([ + inversify_1.inject(types_1.TYPES.IActionDispatcher), + __metadata("design:type", Object) + ], HiddenBoundsUpdater.prototype, "actionDispatcher", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.Layouter), + __metadata("design:type", layout_1.Layouter) + ], HiddenBoundsUpdater.prototype, "layouter", void 0); + HiddenBoundsUpdater = __decorate([ + inversify_1.injectable() + ], HiddenBoundsUpdater); + return HiddenBoundsUpdater; +}()); +exports.HiddenBoundsUpdater = HiddenBoundsUpdater; +//# sourceMappingURL=hidden-bounds-updater.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/bounds/layout.js": +/*!************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/bounds/layout.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var registry_1 = __webpack_require__(/*! ../../utils/registry */ "./node_modules/sprotty/lib/utils/registry.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var vbox_layout_1 = __webpack_require__(/*! ./vbox-layout */ "./node_modules/sprotty/lib/features/bounds/vbox-layout.js"); +var hbox_layout_1 = __webpack_require__(/*! ./hbox-layout */ "./node_modules/sprotty/lib/features/bounds/hbox-layout.js"); +var stack_layout_1 = __webpack_require__(/*! ./stack-layout */ "./node_modules/sprotty/lib/features/bounds/stack-layout.js"); +var LayoutRegistry = /** @class */ (function (_super) { + __extends(LayoutRegistry, _super); + function LayoutRegistry() { + var _this = _super.call(this) || this; + _this.register(vbox_layout_1.VBoxLayouter.KIND, new vbox_layout_1.VBoxLayouter()); + _this.register(hbox_layout_1.HBoxLayouter.KIND, new hbox_layout_1.HBoxLayouter()); + _this.register(stack_layout_1.StackLayouter.KIND, new stack_layout_1.StackLayouter()); + return _this; + } + return LayoutRegistry; +}(registry_1.InstanceRegistry)); +exports.LayoutRegistry = LayoutRegistry; +var Layouter = /** @class */ (function () { + function Layouter() { + } + Layouter.prototype.layout = function (element2boundsData) { + new StatefulLayouter(element2boundsData, this.layoutRegistry, this.logger).layout(); + }; + __decorate([ + inversify_1.inject(types_1.TYPES.LayoutRegistry), + __metadata("design:type", LayoutRegistry) + ], Layouter.prototype, "layoutRegistry", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.ILogger), + __metadata("design:type", Object) + ], Layouter.prototype, "logger", void 0); + Layouter = __decorate([ + inversify_1.injectable() + ], Layouter); + return Layouter; +}()); +exports.Layouter = Layouter; +var StatefulLayouter = /** @class */ (function () { + function StatefulLayouter(element2boundsData, layoutRegistry, log) { + var _this = this; + this.element2boundsData = element2boundsData; + this.layoutRegistry = layoutRegistry; + this.log = log; + this.toBeLayouted = []; + element2boundsData.forEach(function (data, element) { + if (model_1.isLayoutContainer(element)) + _this.toBeLayouted.push(element); + }); + } + StatefulLayouter.prototype.getBoundsData = function (element) { + var boundsData = this.element2boundsData.get(element); + var bounds = element.bounds; + if (model_1.isLayoutContainer(element) && this.toBeLayouted.indexOf(element) >= 0) { + bounds = this.doLayout(element); + } + if (!boundsData) { + boundsData = { + bounds: bounds, + boundsChanged: false, + alignmentChanged: false + }; + this.element2boundsData.set(element, boundsData); + } + return boundsData; + }; + StatefulLayouter.prototype.layout = function () { + while (this.toBeLayouted.length > 0) { + var element = this.toBeLayouted[0]; + this.doLayout(element); + } + }; + StatefulLayouter.prototype.doLayout = function (element) { + var index = this.toBeLayouted.indexOf(element); + if (index >= 0) + this.toBeLayouted.splice(index, 1); + var layout = this.layoutRegistry.get(element.layout); + if (layout) + layout.layout(element, this); + var boundsData = this.element2boundsData.get(element); + if (boundsData !== undefined && boundsData.bounds !== undefined) { + return boundsData.bounds; + } + else { + this.log.error(element, 'Layout failed'); + return geometry_1.EMPTY_BOUNDS; + } + }; + return StatefulLayouter; +}()); +exports.StatefulLayouter = StatefulLayouter; +//# sourceMappingURL=layout.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/bounds/model.js": +/*!***********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/bounds/model.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var smodel_utils_1 = __webpack_require__(/*! ../../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +exports.boundsFeature = Symbol('boundsFeature'); +exports.layoutContainerFeature = Symbol('layoutContainerFeature'); +exports.layoutableChildFeature = Symbol('layoutableChildFeature'); +exports.alignFeature = Symbol('alignFeature'); +function isBoundsAware(element) { + return 'bounds' in element; +} +exports.isBoundsAware = isBoundsAware; +function isLayoutContainer(element) { + return isBoundsAware(element) + && element.hasFeature(exports.layoutContainerFeature) + && 'layout' in element; +} +exports.isLayoutContainer = isLayoutContainer; +function isLayoutableChild(element) { + return isBoundsAware(element) + && element.hasFeature(exports.layoutableChildFeature); +} +exports.isLayoutableChild = isLayoutableChild; +function isSizeable(element) { + return element.hasFeature(exports.boundsFeature) && isBoundsAware(element); +} +exports.isSizeable = isSizeable; +function isAlignable(element) { + return element.hasFeature(exports.alignFeature) + && 'alignment' in element; +} +exports.isAlignable = isAlignable; +function getAbsoluteBounds(element) { + var boundsAware = smodel_utils_1.findParentByFeature(element, isBoundsAware); + if (boundsAware !== undefined) { + var bounds = boundsAware.bounds; + var current = boundsAware; + while (current instanceof smodel_1.SChildElement) { + var parent_1 = current.parent; + bounds = parent_1.localToParent(bounds); + current = parent_1; + } + return bounds; + } + else if (element instanceof smodel_1.SModelRoot) { + var canvasBounds = element.canvasBounds; + return { x: 0, y: 0, width: canvasBounds.width, height: canvasBounds.height }; + } + else { + return geometry_1.EMPTY_BOUNDS; + } +} +exports.getAbsoluteBounds = getAbsoluteBounds; +function findChildrenAtPosition(parent, point) { + var matches = []; + doFindChildrenAtPosition(parent, point, matches); + return matches; +} +exports.findChildrenAtPosition = findChildrenAtPosition; +function doFindChildrenAtPosition(parent, point, matches) { + parent.children.forEach(function (child) { + if (isBoundsAware(child) && geometry_1.includes(child.bounds, point)) + matches.push(child); + if (child instanceof smodel_1.SParentElement) { + var newPoint = child.parentToLocal(point); + doFindChildrenAtPosition(child, newPoint, matches); + } + }); +} +/** + * Abstract class for elements with a position and a size. + */ +var SShapeElement = /** @class */ (function (_super) { + __extends(SShapeElement, _super); + function SShapeElement() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.position = geometry_1.ORIGIN_POINT; + _this.size = geometry_1.EMPTY_DIMENSION; + return _this; + } + Object.defineProperty(SShapeElement.prototype, "bounds", { + get: function () { + return { + x: this.position.x, + y: this.position.y, + width: this.size.width, + height: this.size.height + }; + }, + set: function (newBounds) { + this.position = { + x: newBounds.x, + y: newBounds.y + }; + this.size = { + width: newBounds.width, + height: newBounds.height + }; + }, + enumerable: true, + configurable: true + }); + SShapeElement.prototype.localToParent = function (point) { + var result = { + x: point.x + this.position.x, + y: point.y + this.position.y, + width: -1, + height: -1 + }; + if (geometry_1.isBounds(point)) { + result.width = point.width; + result.height = point.height; + } + return result; + }; + SShapeElement.prototype.parentToLocal = function (point) { + var result = { + x: point.x - this.position.x, + y: point.y - this.position.y, + width: -1, + height: -1 + }; + if (geometry_1.isBounds(point)) { + result.width = point.width; + result.height = point.height; + } + return result; + }; + return SShapeElement; +}(smodel_1.SChildElement)); +exports.SShapeElement = SShapeElement; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/bounds/resize.js": +/*!************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/bounds/resize.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var animation_1 = __webpack_require__(/*! ../../base/animations/animation */ "./node_modules/sprotty/lib/base/animations/animation.js"); +var ResizeAnimation = /** @class */ (function (_super) { + __extends(ResizeAnimation, _super); + function ResizeAnimation(model, elementResizes, context, reverse) { + if (reverse === void 0) { reverse = false; } + var _this = _super.call(this, context) || this; + _this.model = model; + _this.elementResizes = elementResizes; + _this.reverse = reverse; + return _this; + } + ResizeAnimation.prototype.tween = function (t) { + var _this = this; + this.elementResizes.forEach(function (elementResize) { + var element = elementResize.element; + var newDimension = (_this.reverse) ? { + width: (1 - t) * elementResize.toDimension.width + t * elementResize.fromDimension.width, + height: (1 - t) * elementResize.toDimension.height + t * elementResize.fromDimension.height + } : { + width: (1 - t) * elementResize.fromDimension.width + t * elementResize.toDimension.width, + height: (1 - t) * elementResize.fromDimension.height + t * elementResize.toDimension.height + }; + element.bounds = { + x: element.bounds.x, + y: element.bounds.y, + width: newDimension.width, + height: newDimension.height + }; + }); + return this.model; + }; + return ResizeAnimation; +}(animation_1.Animation)); +exports.ResizeAnimation = ResizeAnimation; +//# sourceMappingURL=resize.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/bounds/stack-layout.js": +/*!******************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/bounds/stack-layout.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var abstract_layout_1 = __webpack_require__(/*! ./abstract-layout */ "./node_modules/sprotty/lib/features/bounds/abstract-layout.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var StackLayouter = /** @class */ (function (_super) { + __extends(StackLayouter, _super); + function StackLayouter() { + return _super !== null && _super.apply(this, arguments) || this; + } + StackLayouter.prototype.getChildrenSize = function (container, options, layouter) { + var maxWidth = -1; + var maxHeight = -1; + container.children.forEach(function (child) { + if (model_1.isLayoutableChild(child)) { + var bounds = layouter.getBoundsData(child).bounds; + if (bounds !== undefined && geometry_1.isValidDimension(bounds)) { + maxWidth = Math.max(maxWidth, bounds.width); + maxHeight = Math.max(maxHeight, bounds.height); + } + } + }); + return { + width: maxWidth, + height: maxHeight + }; + }; + StackLayouter.prototype.layoutChild = function (child, boundsData, bounds, childOptions, containerOptions, currentOffset, maxWidth, maxHeight) { + var dx = this.getDx(childOptions.hAlign, bounds, maxWidth); + var dy = this.getDy(childOptions.vAlign, bounds, maxHeight); + boundsData.bounds = { + x: containerOptions.paddingLeft + child.bounds.x - bounds.x + dx, + y: containerOptions.paddingTop + child.bounds.y - bounds.y + dy, + width: bounds.width, + height: bounds.height + }; + boundsData.boundsChanged = true; + return currentOffset; + }; + StackLayouter.prototype.getDefaultLayoutOptions = function () { + return { + resizeContainer: true, + paddingTop: 5, + paddingBottom: 5, + paddingLeft: 5, + paddingRight: 5, + paddingFactor: 1, + hAlign: 'center', + vAlign: 'center', + minWidth: 0, + minHeight: 0 + }; + }; + StackLayouter.prototype.spread = function (a, b) { + return __assign({}, a, b); + }; + StackLayouter.KIND = 'stack'; + return StackLayouter; +}(abstract_layout_1.AbstractLayout)); +exports.StackLayouter = StackLayouter; +//# sourceMappingURL=stack-layout.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/bounds/vbox-layout.js": +/*!*****************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/bounds/vbox-layout.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var abstract_layout_1 = __webpack_require__(/*! ./abstract-layout */ "./node_modules/sprotty/lib/features/bounds/abstract-layout.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +/** + * Layouts children of a container in vertical (top->bottom) direction. + */ +var VBoxLayouter = /** @class */ (function (_super) { + __extends(VBoxLayouter, _super); + function VBoxLayouter() { + return _super !== null && _super.apply(this, arguments) || this; + } + VBoxLayouter.prototype.getChildrenSize = function (container, containerOptions, layouter) { + var maxWidth = -1; + var maxHeight = 0; + var isFirst = true; + container.children.forEach(function (child) { + if (model_1.isLayoutableChild(child)) { + var bounds = layouter.getBoundsData(child).bounds; + if (bounds !== undefined && geometry_1.isValidDimension(bounds)) { + maxHeight += bounds.height; + if (isFirst) + isFirst = false; + else + maxHeight += containerOptions.vGap; + maxWidth = Math.max(maxWidth, bounds.width); + } + } + }); + return { + width: maxWidth, + height: maxHeight + }; + }; + VBoxLayouter.prototype.layoutChild = function (child, boundsData, bounds, childOptions, containerOptions, currentOffset, maxWidth, maxHeight) { + var dx = this.getDx(childOptions.hAlign, bounds, maxWidth); + boundsData.bounds = { + x: containerOptions.paddingLeft + child.bounds.x - bounds.x + dx, + y: currentOffset.y + child.bounds.y - bounds.y, + width: bounds.width, + height: bounds.height + }; + boundsData.boundsChanged = true; + return { + x: currentOffset.x, + y: currentOffset.y + bounds.height + containerOptions.vGap + }; + }; + VBoxLayouter.prototype.getDefaultLayoutOptions = function () { + return { + resizeContainer: true, + paddingTop: 5, + paddingBottom: 5, + paddingLeft: 5, + paddingRight: 5, + paddingFactor: 1, + vGap: 1, + hAlign: 'center', + minWidth: 0, + minHeight: 0 + }; + }; + VBoxLayouter.prototype.spread = function (a, b) { + return __assign({}, a, b); + }; + VBoxLayouter.KIND = 'vbox'; + return VBoxLayouter; +}(abstract_layout_1.AbstractLayout)); +exports.VBoxLayouter = VBoxLayouter; +//# sourceMappingURL=vbox-layout.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/button/button-handler.js": +/*!********************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/button/button-handler.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var registry_1 = __webpack_require__(/*! ../../utils/registry */ "./node_modules/sprotty/lib/utils/registry.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var ButtonHandlerRegistry = /** @class */ (function (_super) { + __extends(ButtonHandlerRegistry, _super); + function ButtonHandlerRegistry(buttonHandlerFactories) { + var _this = _super.call(this) || this; + buttonHandlerFactories.forEach(function (factory) { return _this.register(factory.TYPE, new factory()); }); + return _this; + } + ButtonHandlerRegistry = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.multiInject(types_1.TYPES.IButtonHandler)), __param(0, inversify_1.optional()), + __metadata("design:paramtypes", [Array]) + ], ButtonHandlerRegistry); + return ButtonHandlerRegistry; +}(registry_1.InstanceRegistry)); +exports.ButtonHandlerRegistry = ButtonHandlerRegistry; +//# sourceMappingURL=button-handler.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/button/di.config.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/button/di.config.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var button_handler_1 = __webpack_require__(/*! ./button-handler */ "./node_modules/sprotty/lib/features/button/button-handler.js"); +var buttonModule = new inversify_1.ContainerModule(function (bind) { + bind(button_handler_1.ButtonHandlerRegistry).toSelf().inSingletonScope(); +}); +exports.default = buttonModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/button/model.js": +/*!***********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/button/model.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var model_1 = __webpack_require__(/*! ../bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var model_2 = __webpack_require__(/*! ../fade/model */ "./node_modules/sprotty/lib/features/fade/model.js"); +var SButton = /** @class */ (function (_super) { + __extends(SButton, _super); + function SButton() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.enabled = true; + return _this; + } + SButton.prototype.hasFeature = function (feature) { + return feature === model_1.boundsFeature || feature === model_2.fadeFeature || feature === model_1.layoutableChildFeature; + }; + return SButton; +}(model_1.SShapeElement)); +exports.SButton = SButton; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/decoration/decoration-placer.js": +/*!***************************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/decoration/decoration-placer.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/decoration/model.js"); +var vnode_utils_1 = __webpack_require__(/*! ../../base/views/vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var model_2 = __webpack_require__(/*! ../bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var model_3 = __webpack_require__(/*! ../routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var routing_1 = __webpack_require__(/*! ../routing/routing */ "./node_modules/sprotty/lib/features/routing/routing.js"); +var DecorationPlacer = /** @class */ (function () { + function DecorationPlacer() { + } + DecorationPlacer.prototype.decorate = function (vnode, element) { + if (model_1.isDecoration(element)) { + var position = this.getPosition(element); + var translate = 'translate(' + position.x + ', ' + position.y + ')'; + vnode_utils_1.setAttr(vnode, 'transform', translate); + } + return vnode; + }; + DecorationPlacer.prototype.getPosition = function (element) { + if (element instanceof smodel_1.SChildElement && element.parent instanceof model_3.SRoutableElement) { + var router = this.edgeRouterRegistry.get(element.parent.routerKind); + var route = router.route(element.parent); + if (route.length > 1) { + var index = Math.floor(0.5 * (route.length - 1)); + var offset = model_2.isSizeable(element) + ? { + x: -0.5 * element.bounds.width, + y: -0.5 * element.bounds.width + } + : geometry_1.ORIGIN_POINT; + return { + x: 0.5 * (route[index].x + route[index + 1].x) + offset.x, + y: 0.5 * (route[index].y + route[index + 1].y) + offset.y + }; + } + } + if (model_2.isSizeable(element)) + return { + x: -0.666 * element.bounds.width, + y: -0.666 * element.bounds.height + }; + return geometry_1.ORIGIN_POINT; + }; + DecorationPlacer.prototype.postUpdate = function () { + }; + __decorate([ + inversify_1.inject(routing_1.EdgeRouterRegistry), + __metadata("design:type", routing_1.EdgeRouterRegistry) + ], DecorationPlacer.prototype, "edgeRouterRegistry", void 0); + DecorationPlacer = __decorate([ + inversify_1.injectable() + ], DecorationPlacer); + return DecorationPlacer; +}()); +exports.DecorationPlacer = DecorationPlacer; +//# sourceMappingURL=decoration-placer.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/decoration/di.config.js": +/*!*******************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/decoration/di.config.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var view_1 = __webpack_require__(/*! ../../base/views/view */ "./node_modules/sprotty/lib/base/views/view.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/decoration/model.js"); +var views_1 = __webpack_require__(/*! ./views */ "./node_modules/sprotty/lib/features/decoration/views.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var decoration_placer_1 = __webpack_require__(/*! ./decoration-placer */ "./node_modules/sprotty/lib/features/decoration/decoration-placer.js"); +var decorationModule = new inversify_1.ContainerModule(function (bind, _unbind, isBound) { + view_1.configureModelElement({ bind: bind, isBound: isBound }, 'marker', model_1.SIssueMarker, views_1.IssueMarkerView); + bind(decoration_placer_1.DecorationPlacer).toSelf().inSingletonScope(); + bind(types_1.TYPES.IVNodeDecorator).toService(decoration_placer_1.DecorationPlacer); +}); +exports.default = decorationModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/decoration/model.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/decoration/model.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var model_1 = __webpack_require__(/*! ../hover/model */ "./node_modules/sprotty/lib/features/hover/model.js"); +var model_2 = __webpack_require__(/*! ../bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +exports.decorationFeature = Symbol('decorationFeature'); +function isDecoration(e) { + return e.hasFeature(exports.decorationFeature); +} +exports.isDecoration = isDecoration; +var SDecoration = /** @class */ (function (_super) { + __extends(SDecoration, _super); + function SDecoration() { + return _super !== null && _super.apply(this, arguments) || this; + } + SDecoration.prototype.hasFeature = function (feature) { + return feature === exports.decorationFeature + || feature === model_2.boundsFeature + || feature === model_1.hoverFeedbackFeature + || feature === model_1.popupFeature + || _super.prototype.hasFeature.call(this, feature); + }; + return SDecoration; +}(model_2.SShapeElement)); +exports.SDecoration = SDecoration; +var SIssueMarker = /** @class */ (function (_super) { + __extends(SIssueMarker, _super); + function SIssueMarker() { + return _super !== null && _super.apply(this, arguments) || this; + } + return SIssueMarker; +}(SDecoration)); +exports.SIssueMarker = SIssueMarker; +var SIssue = /** @class */ (function () { + function SIssue() { + } + return SIssue; +}()); +exports.SIssue = SIssue; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/decoration/views.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/decoration/views.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +/** @jsx svg */ +var snabbdom_jsx_1 = __webpack_require__(/*! snabbdom-jsx */ "./node_modules/snabbdom-jsx/snabbdom-jsx.js"); +var vnode_utils_1 = __webpack_require__(/*! ../../base/views/vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var IssueMarkerView = /** @class */ (function () { + function IssueMarkerView() { + } + IssueMarkerView.prototype.render = function (marker, context) { + var scale = 16 / 1792; + var trafo = "scale(" + scale + ", " + scale + ")"; + var maxSeverity = this.getMaxSeverity(marker); + var group = snabbdom_jsx_1.svg("g", { "class-sprotty-issue": true }, + snabbdom_jsx_1.svg("g", { transform: trafo }, + snabbdom_jsx_1.svg("path", { d: this.getPath(maxSeverity) }))); + vnode_utils_1.setClass(group, 'sprotty-' + maxSeverity, true); + return group; + }; + IssueMarkerView.prototype.getMaxSeverity = function (marker) { + var currentSeverity = 'info'; + for (var _i = 0, _a = marker.issues.map(function (s) { return s.severity; }); _i < _a.length; _i++) { + var severity = _a[_i]; + if (severity === 'error' || (severity === 'warning' && currentSeverity === 'info')) + currentSeverity = severity; + } + return currentSeverity; + }; + IssueMarkerView.prototype.getPath = function (severity) { + switch (severity) { + case 'error': + case 'warning': + // tslint:disable-next-line:max-line-length + return "M768 128q209 0 385.5 103t279.5 279.5 103 385.5-103 385.5-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103zm128 1247v-190q0-14-9-23.5t-22-9.5h-192q-13 0-23 10t-10 23v190q0 13 10 23t23 10h192q13 0 22-9.5t9-23.5zm-2-344l18-621q0-12-10-18-10-8-24-8h-220q-14 0-24 8-10 6-10 18l17 621q0 10 10 17.5t24 7.5h185q14 0 23.5-7.5t10.5-17.5z"; + case 'info': + // tslint:disable-next-line:max-line-length + return "M1024 1376v-160q0-14-9-23t-23-9h-96v-512q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v160q0 14 9 23t23 9h96v320h-96q-14 0-23 9t-9 23v160q0 14 9 23t23 9h448q14 0 23-9t9-23zm-128-896v-160q0-14-9-23t-23-9h-192q-14 0-23 9t-9 23v160q0 14 9 23t23 9h192q14 0 23-9t9-23zm640 416q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"; + } + }; + IssueMarkerView = __decorate([ + inversify_1.injectable() + ], IssueMarkerView); + return IssueMarkerView; +}()); +exports.IssueMarkerView = IssueMarkerView; +//# sourceMappingURL=views.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/edge-layout/di.config.js": +/*!********************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/edge-layout/di.config.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var edge_layout_1 = __webpack_require__(/*! ./edge-layout */ "./node_modules/sprotty/lib/features/edge-layout/edge-layout.js"); +var edgeLayoutModule = new inversify_1.ContainerModule(function (bind) { + bind(types_1.TYPES.IVNodeDecorator).to(edge_layout_1.EdgeLayoutDecorator).inSingletonScope(); +}); +exports.default = edgeLayoutModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/edge-layout/edge-layout.js": +/*!**********************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/edge-layout/edge-layout.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var vnode_utils_1 = __webpack_require__(/*! ../../base/views/vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var sgraph_1 = __webpack_require__(/*! ../../graph/sgraph */ "./node_modules/sprotty/lib/graph/sgraph.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var model_1 = __webpack_require__(/*! ../bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var model_2 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/edge-layout/model.js"); +var routing_1 = __webpack_require__(/*! ../routing/routing */ "./node_modules/sprotty/lib/features/routing/routing.js"); +var EdgeLayoutDecorator = /** @class */ (function () { + function EdgeLayoutDecorator() { + } + EdgeLayoutDecorator.prototype.decorate = function (vnode, element) { + if (model_2.isEdgeLayoutable(element) && element.parent instanceof sgraph_1.SEdge) { + if (element.bounds !== geometry_1.EMPTY_BOUNDS) { + var placement = this.getEdgePlacement(element); + var edge = element.parent; + var position = Math.min(1, Math.max(0, placement.position)); + var router = this.edgeRouterRegistry.get(edge.routerKind); + var pointOnEdge = router.pointAt(edge, position); + var derivativeOnEdge = router.derivativeAt(edge, position); + var transform = ''; + if (pointOnEdge && derivativeOnEdge) { + transform += "translate(" + pointOnEdge.x + ", " + pointOnEdge.y + ")"; + var angle = geometry_1.toDegrees(Math.atan2(derivativeOnEdge.y, derivativeOnEdge.x)); + if (placement.rotate) { + var flippedAngle = angle; + if (Math.abs(angle) > 90) { + if (angle < 0) + flippedAngle += 180; + else if (angle > 0) + flippedAngle -= 180; + } + transform += " rotate(" + flippedAngle + ")"; + var alignment = this.getRotatedAlignment(element, placement, flippedAngle !== angle); + transform += " translate(" + alignment.x + ", " + alignment.y + ")"; + } + else { + var alignment = this.getAlignment(element, placement, angle); + transform += " translate(" + alignment.x + ", " + alignment.y + ")"; + } + vnode_utils_1.setAttr(vnode, 'transform', transform); + } + } + } + return vnode; + }; + EdgeLayoutDecorator.prototype.getRotatedAlignment = function (element, placement, flip) { + var x = model_1.isAlignable(element) ? element.alignment.x : 0; + var y = model_1.isAlignable(element) ? element.alignment.y : 0; + var bounds = element.bounds; + if (placement.side === 'on') + return { x: x - 0.5 * bounds.height, y: y - 0.5 * bounds.height }; + if (flip) { + if (placement.position < 0.3333333) + x -= bounds.width + placement.offset; + else if (placement.position < 0.6666666) + x -= 0.5 * bounds.width; + else + x += placement.offset; + switch (placement.side) { + case 'left': + case 'bottom': + y -= placement.offset + bounds.height; + break; + case 'right': + case 'top': + y += placement.offset; + } + } + else { + if (placement.position < 0.3333333) + x += placement.offset; + else if (placement.position < 0.6666666) + x -= 0.5 * bounds.width; + else + x -= bounds.width + placement.offset; + switch (placement.side) { + case 'right': + case 'bottom': + y += -placement.offset - bounds.height; + break; + case 'left': + case 'top': + y += placement.offset; + } + } + return { x: x, y: y }; + }; + EdgeLayoutDecorator.prototype.getEdgePlacement = function (element) { + var current = element; + var allPlacements = []; + while (current !== undefined) { + var placement = current.edgePlacement; + if (placement !== undefined) + allPlacements.push(placement); + if (current instanceof smodel_1.SChildElement) + current = current.parent; + else + break; + } + return allPlacements.reverse().reduce(function (a, b) { return __assign({}, a, b); }, model_2.DEFAULT_EDGE_PLACEMENT); + }; + EdgeLayoutDecorator.prototype.getAlignment = function (label, placement, angle) { + var bounds = label.bounds; + var x = model_1.isAlignable(label) ? label.alignment.x - bounds.width : 0; + var y = model_1.isAlignable(label) ? label.alignment.y - bounds.height : 0; + if (placement.side === 'on') + return { x: x + 0.5 * bounds.height, y: y + 0.5 * bounds.height }; + var quadrant = this.getQuadrant(angle); + var midLeft = { x: placement.offset, y: y + 0.5 * bounds.height }; + var topLeft = { x: placement.offset, y: y + bounds.height + placement.offset }; + var topRight = { x: -bounds.width - placement.offset, y: y + bounds.height + placement.offset }; + var midRight = { x: -bounds.width - placement.offset, y: y + 0.5 * bounds.height }; + var bottomRight = { x: -bounds.width - placement.offset, y: y - placement.offset }; + var bottomLeft = { x: placement.offset, y: y - placement.offset }; + switch (placement.side) { + case 'left': + switch (quadrant.orientation) { + case 'west': + return geometry_1.linear(topLeft, topRight, quadrant.position); + case 'north': + return geometry_1.linear(topRight, bottomRight, quadrant.position); + case 'east': + return geometry_1.linear(bottomRight, bottomLeft, quadrant.position); + case 'south': + return geometry_1.linear(bottomLeft, topLeft, quadrant.position); + } + break; + case 'right': + switch (quadrant.orientation) { + case 'west': + return geometry_1.linear(bottomRight, bottomLeft, quadrant.position); + case 'north': + return geometry_1.linear(bottomLeft, topLeft, quadrant.position); + case 'east': + return geometry_1.linear(topLeft, topRight, quadrant.position); + case 'south': + return geometry_1.linear(topRight, bottomRight, quadrant.position); + } + break; + case 'top': + switch (quadrant.orientation) { + case 'west': + return geometry_1.linear(bottomRight, bottomLeft, quadrant.position); + case 'north': + return this.linearFlip(bottomLeft, midLeft, midRight, bottomRight, quadrant.position); + case 'east': + return geometry_1.linear(bottomRight, bottomLeft, quadrant.position); + case 'south': + return this.linearFlip(bottomLeft, midLeft, midRight, bottomRight, quadrant.position); + } + break; + case 'bottom': + switch (quadrant.orientation) { + case 'west': + return geometry_1.linear(topLeft, topRight, quadrant.position); + case 'north': + return this.linearFlip(topRight, midRight, midLeft, topLeft, quadrant.position); + case 'east': + return geometry_1.linear(topLeft, topRight, quadrant.position); + case 'south': + return this.linearFlip(topRight, midRight, midLeft, topLeft, quadrant.position); + } + break; + } + return { x: 0, y: 0 }; + }; + EdgeLayoutDecorator.prototype.getQuadrant = function (angle) { + if (Math.abs(angle) > 135) + return { orientation: 'west', position: (angle > 0 ? angle - 135 : angle + 225) / 90 }; + else if (angle < -45) + return { orientation: 'north', position: (angle + 135) / 90 }; + else if (angle < 45) + return { orientation: 'east', position: (angle + 45) / 90 }; + else + return { orientation: 'south', position: (angle - 45) / 90 }; + }; + EdgeLayoutDecorator.prototype.linearFlip = function (p0, p1, p2, p3, position) { + return position < 0.5 ? geometry_1.linear(p0, p1, 2 * position) : geometry_1.linear(p2, p3, 2 * position - 1); + }; + EdgeLayoutDecorator.prototype.postUpdate = function () { }; + __decorate([ + inversify_1.inject(routing_1.EdgeRouterRegistry), + __metadata("design:type", routing_1.EdgeRouterRegistry) + ], EdgeLayoutDecorator.prototype, "edgeRouterRegistry", void 0); + EdgeLayoutDecorator = __decorate([ + inversify_1.injectable() + ], EdgeLayoutDecorator); + return EdgeLayoutDecorator; +}()); +exports.EdgeLayoutDecorator = EdgeLayoutDecorator; +//# sourceMappingURL=edge-layout.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/edge-layout/model.js": +/*!****************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/edge-layout/model.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var model_1 = __webpack_require__(/*! ../bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var model_2 = __webpack_require__(/*! ../routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +exports.edgeLayoutFeature = Symbol('edgeLayout'); +function isEdgeLayoutable(element) { + return element instanceof smodel_1.SChildElement + && element.parent instanceof model_2.SRoutableElement + && 'edgePlacement' in element + && model_1.isBoundsAware(element) + && element.hasFeature(exports.edgeLayoutFeature); +} +exports.isEdgeLayoutable = isEdgeLayoutable; +var EdgePlacement = /** @class */ (function (_super) { + __extends(EdgePlacement, _super); + function EdgePlacement() { + return _super !== null && _super.apply(this, arguments) || this; + } + return EdgePlacement; +}(Object)); +exports.EdgePlacement = EdgePlacement; +exports.DEFAULT_EDGE_PLACEMENT = { + rotate: true, + side: 'top', + position: 0.5, + offset: 7 +}; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/edit/create-on-drag.js": +/*!******************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/edit/create-on-drag.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.creatingOnDragFeature = Symbol('creatingOnDragFeature'); +function isCreatingOnDrag(element) { + return element.hasFeature(exports.creatingOnDragFeature) && element.createAction !== undefined; +} +exports.isCreatingOnDrag = isCreatingOnDrag; +//# sourceMappingURL=create-on-drag.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/edit/create.js": +/*!**********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/edit/create.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var command_1 = __webpack_require__(/*! ../../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var CreateElementAction = /** @class */ (function () { + function CreateElementAction(containerId, elementSchema) { + this.containerId = containerId; + this.elementSchema = elementSchema; + this.kind = CreateElementCommand.KIND; + } + return CreateElementAction; +}()); +exports.CreateElementAction = CreateElementAction; +var CreateElementCommand = /** @class */ (function (_super) { + __extends(CreateElementCommand, _super); + function CreateElementCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + return _this; + } + CreateElementCommand.prototype.execute = function (context) { + var container = context.root.index.getById(this.action.containerId); + if (container instanceof smodel_1.SParentElement) { + this.container = container; + this.newElement = context.modelFactory.createElement(this.action.elementSchema); + this.container.add(this.newElement); + } + return context.root; + }; + CreateElementCommand.prototype.undo = function (context) { + this.container.remove(this.newElement); + return context.root; + }; + CreateElementCommand.prototype.redo = function (context) { + this.container.add(this.newElement); + return context.root; + }; + CreateElementCommand.KIND = "createElement"; + CreateElementCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [CreateElementAction]) + ], CreateElementCommand); + return CreateElementCommand; +}(command_1.Command)); +exports.CreateElementCommand = CreateElementCommand; +//# sourceMappingURL=create.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/edit/delete.js": +/*!**********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/edit/delete.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var command_1 = __webpack_require__(/*! ../../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +exports.deletableFeature = Symbol('deletableFeature'); +function isDeletable(element) { + return element instanceof smodel_1.SChildElement && element.hasFeature(exports.deletableFeature); +} +exports.isDeletable = isDeletable; +var DeleteElementAction = /** @class */ (function () { + function DeleteElementAction(elementIds) { + this.elementIds = elementIds; + this.kind = DeleteElementCommand.KIND; + } + return DeleteElementAction; +}()); +exports.DeleteElementAction = DeleteElementAction; +var ResolvedDelete = /** @class */ (function () { + function ResolvedDelete() { + } + return ResolvedDelete; +}()); +exports.ResolvedDelete = ResolvedDelete; +var DeleteElementCommand = /** @class */ (function (_super) { + __extends(DeleteElementCommand, _super); + function DeleteElementCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + _this.resolvedDeletes = []; + return _this; + } + DeleteElementCommand.prototype.execute = function (context) { + var index = context.root.index; + for (var _i = 0, _a = this.action.elementIds; _i < _a.length; _i++) { + var id = _a[_i]; + var element = index.getById(id); + if (element && isDeletable(element)) { + this.resolvedDeletes.push({ child: element, parent: element.parent }); + element.parent.remove(element); + } + } + return context.root; + }; + DeleteElementCommand.prototype.undo = function (context) { + for (var _i = 0, _a = this.resolvedDeletes; _i < _a.length; _i++) { + var resolvedDelete = _a[_i]; + resolvedDelete.parent.add(resolvedDelete.child); + } + return context.root; + }; + DeleteElementCommand.prototype.redo = function (context) { + for (var _i = 0, _a = this.resolvedDeletes; _i < _a.length; _i++) { + var resolvedDelete = _a[_i]; + resolvedDelete.parent.remove(resolvedDelete.child); + } + return context.root; + }; + DeleteElementCommand.KIND = 'delete'; + DeleteElementCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [DeleteElementAction]) + ], DeleteElementCommand); + return DeleteElementCommand; +}(command_1.Command)); +exports.DeleteElementCommand = DeleteElementCommand; +//# sourceMappingURL=delete.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/edit/di.config.js": +/*!*************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/edit/di.config.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var edit_routing_1 = __webpack_require__(/*! ./edit-routing */ "./node_modules/sprotty/lib/features/edit/edit-routing.js"); +var reconnect_1 = __webpack_require__(/*! ./reconnect */ "./node_modules/sprotty/lib/features/edit/reconnect.js"); +var view_1 = __webpack_require__(/*! ../../base/views/view */ "./node_modules/sprotty/lib/base/views/view.js"); +var model_1 = __webpack_require__(/*! ../../features/routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var svg_views_1 = __webpack_require__(/*! ../../lib/svg-views */ "./node_modules/sprotty/lib/lib/svg-views.js"); +var delete_1 = __webpack_require__(/*! ./delete */ "./node_modules/sprotty/lib/features/edit/delete.js"); +var edit_label_1 = __webpack_require__(/*! ./edit-label */ "./node_modules/sprotty/lib/features/edit/edit-label.js"); +var command_registration_1 = __webpack_require__(/*! ../../base/commands/command-registration */ "./node_modules/sprotty/lib/base/commands/command-registration.js"); +exports.edgeEditModule = new inversify_1.ContainerModule(function (bind, _unbind, isBound) { + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, edit_routing_1.SwitchEditModeCommand); + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, reconnect_1.ReconnectCommand); + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, delete_1.DeleteElementCommand); + view_1.configureModelElement({ bind: bind, isBound: isBound }, 'dangling-anchor', model_1.SDanglingAnchor, svg_views_1.EmptyGroupView); +}); +exports.labelEditModule = new inversify_1.ContainerModule(function (bind) { + bind(types_1.TYPES.MouseListener).to(edit_label_1.EditLabelMouseListener); +}); +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/edit/edit-label.js": +/*!**************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/edit/edit-label.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var mouse_tool_1 = __webpack_require__(/*! ../../base/views/mouse-tool */ "./node_modules/sprotty/lib/base/views/mouse-tool.js"); +var sgraph_1 = __webpack_require__(/*! ../../graph/sgraph */ "./node_modules/sprotty/lib/graph/sgraph.js"); +exports.editLabelFeature = Symbol('editLabelFeature'); +function isEditableLabel(element) { + return element instanceof sgraph_1.SLabel && element.hasFeature(exports.editLabelFeature); +} +exports.isEditableLabel = isEditableLabel; +var EditLabelAction = /** @class */ (function () { + function EditLabelAction(labelId) { + this.labelId = labelId; + this.kind = EditLabelAction.KIND; + } + EditLabelAction.KIND = 'EditLabel'; + return EditLabelAction; +}()); +exports.EditLabelAction = EditLabelAction; +var EditLabelMouseListener = /** @class */ (function (_super) { + __extends(EditLabelMouseListener, _super); + function EditLabelMouseListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + EditLabelMouseListener.prototype.doubleClick = function (target, event) { + if (target instanceof sgraph_1.SLabel && isEditableLabel(target)) { + return [new EditLabelAction(target.id)]; + } + return []; + }; + return EditLabelMouseListener; +}(mouse_tool_1.MouseListener)); +exports.EditLabelMouseListener = EditLabelMouseListener; +//# sourceMappingURL=edit-label.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/edit/edit-routing.js": +/*!****************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/edit/edit-routing.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var command_1 = __webpack_require__(/*! ../../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var model_1 = __webpack_require__(/*! ../routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var routing_1 = __webpack_require__(/*! ../routing/routing */ "./node_modules/sprotty/lib/features/routing/routing.js"); +var model_2 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/edit/model.js"); +var SwitchEditModeAction = /** @class */ (function () { + function SwitchEditModeAction(elementsToActivate, elementsToDeactivate) { + if (elementsToActivate === void 0) { elementsToActivate = []; } + if (elementsToDeactivate === void 0) { elementsToDeactivate = []; } + this.elementsToActivate = elementsToActivate; + this.elementsToDeactivate = elementsToDeactivate; + this.kind = SwitchEditModeCommand.KIND; + } + return SwitchEditModeAction; +}()); +exports.SwitchEditModeAction = SwitchEditModeAction; +var SwitchEditModeCommand = /** @class */ (function (_super) { + __extends(SwitchEditModeCommand, _super); + function SwitchEditModeCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + _this.elementsToActivate = []; + _this.elementsToDeactivate = []; + _this.handlesToRemove = []; + return _this; + } + SwitchEditModeCommand.prototype.execute = function (context) { + var _this = this; + var index = context.root.index; + this.action.elementsToActivate.forEach(function (id) { + var element = index.getById(id); + if (element !== undefined) + _this.elementsToActivate.push(element); + }); + this.action.elementsToDeactivate.forEach(function (id) { + var element = index.getById(id); + if (element !== undefined) + _this.elementsToDeactivate.push(element); + if (element instanceof model_1.SRoutingHandle && element.parent instanceof model_1.SRoutableElement) { + var parent_1 = element.parent; + if (_this.shouldRemoveHandle(element, parent_1)) { + _this.handlesToRemove.push({ handle: element, parent: parent_1 }); + _this.elementsToDeactivate.push(parent_1); + _this.elementsToActivate.push(parent_1); + } + } + }); + return this.doExecute(context); + }; + SwitchEditModeCommand.prototype.doExecute = function (context) { + var _this = this; + this.handlesToRemove.forEach(function (entry) { + entry.point = entry.parent.routingPoints.splice(entry.handle.pointIndex, 1)[0]; + }); + this.elementsToDeactivate.forEach(function (element) { + if (element instanceof model_1.SRoutableElement) + element.removeAll(function (child) { return child instanceof model_1.SRoutingHandle; }); + else if (element instanceof model_1.SRoutingHandle) { + element.editMode = false; + if (element.danglingAnchor) { + if (element.parent instanceof model_1.SRoutableElement && element.danglingAnchor.original) { + if (element.parent.source === element.danglingAnchor) + element.parent.sourceId = element.danglingAnchor.original.id; + else if (element.parent.target === element.danglingAnchor) + element.parent.targetId = element.danglingAnchor.original.id; + element.danglingAnchor.parent.remove(element.danglingAnchor); + element.danglingAnchor = undefined; + } + } + } + }); + this.elementsToActivate.forEach(function (element) { + if (model_2.canEditRouting(element) && element instanceof smodel_1.SParentElement) { + var router = _this.edgeRouterRegistry.get(element.routerKind); + router.createRoutingHandles(element); + } + else if (element instanceof model_1.SRoutingHandle) + element.editMode = true; + }); + return context.root; + }; + SwitchEditModeCommand.prototype.shouldRemoveHandle = function (handle, parent) { + if (handle.kind === 'junction') { + var router = this.edgeRouterRegistry.get(parent.routerKind); + var route = router.route(parent); + return route.find(function (rp) { return rp.pointIndex === handle.pointIndex; }) === undefined; + } + return false; + }; + SwitchEditModeCommand.prototype.undo = function (context) { + var _this = this; + this.handlesToRemove.forEach(function (entry) { + if (entry.point !== undefined) + entry.parent.routingPoints.splice(entry.handle.pointIndex, 0, entry.point); + }); + this.elementsToActivate.forEach(function (element) { + if (element instanceof model_1.SRoutableElement) + element.removeAll(function (child) { return child instanceof model_1.SRoutingHandle; }); + else if (element instanceof model_1.SRoutingHandle) + element.editMode = false; + }); + this.elementsToDeactivate.forEach(function (element) { + if (model_2.canEditRouting(element)) { + var router = _this.edgeRouterRegistry.get(element.routerKind); + router.createRoutingHandles(element); + } + else if (element instanceof model_1.SRoutingHandle) + element.editMode = true; + }); + return context.root; + }; + SwitchEditModeCommand.prototype.redo = function (context) { + return this.doExecute(context); + }; + SwitchEditModeCommand.KIND = "switchEditMode"; + __decorate([ + inversify_1.inject(routing_1.EdgeRouterRegistry), + __metadata("design:type", routing_1.EdgeRouterRegistry) + ], SwitchEditModeCommand.prototype, "edgeRouterRegistry", void 0); + SwitchEditModeCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [SwitchEditModeAction]) + ], SwitchEditModeCommand); + return SwitchEditModeCommand; +}(command_1.Command)); +exports.SwitchEditModeCommand = SwitchEditModeCommand; +//# sourceMappingURL=edit-routing.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/edit/model.js": +/*!*********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/edit/model.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var model_1 = __webpack_require__(/*! ../routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +exports.editFeature = Symbol('editFeature'); +function canEditRouting(element) { + return element instanceof model_1.SRoutableElement && element.hasFeature(exports.editFeature); +} +exports.canEditRouting = canEditRouting; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/edit/reconnect.js": +/*!*************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/edit/reconnect.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var command_1 = __webpack_require__(/*! ../../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var model_1 = __webpack_require__(/*! ../routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var routing_1 = __webpack_require__(/*! ../routing/routing */ "./node_modules/sprotty/lib/features/routing/routing.js"); +var ReconnectAction = /** @class */ (function () { + function ReconnectAction(routableId, newSourceId, newTargetId) { + this.routableId = routableId; + this.newSourceId = newSourceId; + this.newTargetId = newTargetId; + this.kind = ReconnectCommand.KIND; + } + return ReconnectAction; +}()); +exports.ReconnectAction = ReconnectAction; +var ReconnectCommand = /** @class */ (function (_super) { + __extends(ReconnectCommand, _super); + function ReconnectCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + return _this; + } + ReconnectCommand.prototype.execute = function (context) { + this.doExecute(context); + return context.root; + }; + ReconnectCommand.prototype.doExecute = function (context) { + var index = context.root.index; + var edge = index.getById(this.action.routableId); + if (edge instanceof model_1.SRoutableElement) { + var router = this.edgeRouterRegistry.get(edge.routerKind); + var before = router.takeSnapshot(edge); + router.applyReconnect(edge, this.action.newSourceId, this.action.newTargetId); + var after = router.takeSnapshot(edge); + this.memento = { + edge: edge, + before: before, + after: after + }; + } + }; + ReconnectCommand.prototype.undo = function (context) { + if (this.memento) { + var router = this.edgeRouterRegistry.get(this.memento.edge.routerKind); + router.applySnapshot(this.memento.edge, this.memento.before); + } + return context.root; + }; + ReconnectCommand.prototype.redo = function (context) { + if (this.memento) { + var router = this.edgeRouterRegistry.get(this.memento.edge.routerKind); + router.applySnapshot(this.memento.edge, this.memento.after); + } + return context.root; + }; + ReconnectCommand.KIND = 'reconnect'; + __decorate([ + inversify_1.inject(routing_1.EdgeRouterRegistry), + __metadata("design:type", routing_1.EdgeRouterRegistry) + ], ReconnectCommand.prototype, "edgeRouterRegistry", void 0); + ReconnectCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [ReconnectAction]) + ], ReconnectCommand); + return ReconnectCommand; +}(command_1.Command)); +exports.ReconnectCommand = ReconnectCommand; +//# sourceMappingURL=reconnect.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/expand/di.config.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/expand/di.config.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var expand_1 = __webpack_require__(/*! ./expand */ "./node_modules/sprotty/lib/features/expand/expand.js"); +var expandModule = new inversify_1.ContainerModule(function (bind) { + bind(types_1.TYPES.IButtonHandler).toConstructor(expand_1.ExpandButtonHandler); +}); +exports.default = expandModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/expand/expand.js": +/*!************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/expand/expand.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var smodel_utils_1 = __webpack_require__(/*! ../../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/expand/model.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +/** + * Sent from the client to the model source to recalculate a diagram when elements + * are collapsed/expanded by the client. + */ +var CollapseExpandAction = /** @class */ (function () { + function CollapseExpandAction(expandIds, collapseIds) { + this.expandIds = expandIds; + this.collapseIds = collapseIds; + this.kind = CollapseExpandAction.KIND; + } + CollapseExpandAction.KIND = 'collapseExpand'; + return CollapseExpandAction; +}()); +exports.CollapseExpandAction = CollapseExpandAction; +/** + * Programmatic action for expanding or collapsing all elements. + */ +var CollapseExpandAllAction = /** @class */ (function () { + /** + * If `expand` is true, all elements are expanded, othewise they are collapsed. + */ + function CollapseExpandAllAction(expand) { + if (expand === void 0) { expand = true; } + this.expand = expand; + this.kind = CollapseExpandAllAction.KIND; + } + CollapseExpandAllAction.KIND = 'collapseExpandAll'; + return CollapseExpandAllAction; +}()); +exports.CollapseExpandAllAction = CollapseExpandAllAction; +var ExpandButtonHandler = /** @class */ (function () { + function ExpandButtonHandler() { + } + ExpandButtonHandler.prototype.buttonPressed = function (button) { + var expandable = smodel_utils_1.findParentByFeature(button, model_1.isExpandable); + if (expandable !== undefined) { + return [new CollapseExpandAction(expandable.expanded ? [] : [expandable.id], expandable.expanded ? [expandable.id] : [])]; + } + else { + return []; + } + }; + ExpandButtonHandler.TYPE = 'button:expand'; + ExpandButtonHandler = __decorate([ + inversify_1.injectable() + ], ExpandButtonHandler); + return ExpandButtonHandler; +}()); +exports.ExpandButtonHandler = ExpandButtonHandler; +//# sourceMappingURL=expand.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/expand/model.js": +/*!***********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/expand/model.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.expandFeature = Symbol('expandFeature'); +function isExpandable(element) { + return element.hasFeature(exports.expandFeature) && 'expanded' in element; +} +exports.isExpandable = isExpandable; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/expand/views.js": +/*!***********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/expand/views.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +/** @jsx svg */ +var snabbdom_jsx_1 = __webpack_require__(/*! snabbdom-jsx */ "./node_modules/snabbdom-jsx/snabbdom-jsx.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/expand/model.js"); +var smodel_utils_1 = __webpack_require__(/*! ../../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var ExpandButtonView = /** @class */ (function () { + function ExpandButtonView() { + } + ExpandButtonView.prototype.render = function (button, context) { + var expandable = smodel_utils_1.findParentByFeature(button, model_1.isExpandable); + var path = (expandable !== undefined && expandable.expanded) + ? 'M 1,5 L 8,12 L 15,5 Z' + : 'M 1,8 L 8,15 L 8,1 Z'; + return snabbdom_jsx_1.svg("g", { "class-sprotty-button": "{true}", "class-enabled": "{button.enabled}" }, + snabbdom_jsx_1.svg("rect", { x: 0, y: 0, width: 16, height: 16, opacity: 0 }), + snabbdom_jsx_1.svg("path", { d: path })); + }; + ExpandButtonView = __decorate([ + inversify_1.injectable() + ], ExpandButtonView); + return ExpandButtonView; +}()); +exports.ExpandButtonView = ExpandButtonView; +//# sourceMappingURL=views.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/export/di.config.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/export/di.config.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var export_1 = __webpack_require__(/*! ./export */ "./node_modules/sprotty/lib/features/export/export.js"); +var svg_exporter_1 = __webpack_require__(/*! ./svg-exporter */ "./node_modules/sprotty/lib/features/export/svg-exporter.js"); +var command_registration_1 = __webpack_require__(/*! ../../base/commands/command-registration */ "./node_modules/sprotty/lib/base/commands/command-registration.js"); +var exportSvgModule = new inversify_1.ContainerModule(function (bind, _unbind, isBound) { + bind(types_1.TYPES.KeyListener).to(export_1.ExportSvgKeyListener).inSingletonScope(); + bind(types_1.TYPES.HiddenVNodeDecorator).to(export_1.ExportSvgDecorator).inSingletonScope(); + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, export_1.ExportSvgCommand); + bind(types_1.TYPES.SvgExporter).to(svg_exporter_1.SvgExporter).inSingletonScope(); +}); +exports.default = exportSvgModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/export/export.js": +/*!************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/export/export.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var command_1 = __webpack_require__(/*! ../../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var model_1 = __webpack_require__(/*! ../select/model */ "./node_modules/sprotty/lib/features/select/model.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var key_tool_1 = __webpack_require__(/*! ../../base/views/key-tool */ "./node_modules/sprotty/lib/base/views/key-tool.js"); +var keyboard_1 = __webpack_require__(/*! ../../utils/keyboard */ "./node_modules/sprotty/lib/utils/keyboard.js"); +var model_2 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/export/model.js"); +var svg_exporter_1 = __webpack_require__(/*! ./svg-exporter */ "./node_modules/sprotty/lib/features/export/svg-exporter.js"); +var smodel_factory_1 = __webpack_require__(/*! ../../base/model/smodel-factory */ "./node_modules/sprotty/lib/base/model/smodel-factory.js"); +var model_3 = __webpack_require__(/*! ../viewport/model */ "./node_modules/sprotty/lib/features/viewport/model.js"); +var model_4 = __webpack_require__(/*! ../hover/model */ "./node_modules/sprotty/lib/features/hover/model.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var ExportSvgKeyListener = /** @class */ (function (_super) { + __extends(ExportSvgKeyListener, _super); + function ExportSvgKeyListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + ExportSvgKeyListener.prototype.keyDown = function (element, event) { + if (keyboard_1.matchesKeystroke(event, 'KeyE', 'ctrlCmd', 'shift')) + return [new RequestExportSvgAction()]; + else + return []; + }; + ExportSvgKeyListener = __decorate([ + inversify_1.injectable() + ], ExportSvgKeyListener); + return ExportSvgKeyListener; +}(key_tool_1.KeyListener)); +exports.ExportSvgKeyListener = ExportSvgKeyListener; +var RequestExportSvgAction = /** @class */ (function () { + function RequestExportSvgAction() { + this.kind = ExportSvgCommand.KIND; + } + return RequestExportSvgAction; +}()); +exports.RequestExportSvgAction = RequestExportSvgAction; +var ExportSvgCommand = /** @class */ (function (_super) { + __extends(ExportSvgCommand, _super); + function ExportSvgCommand() { + return _super !== null && _super.apply(this, arguments) || this; + } + ExportSvgCommand.prototype.execute = function (context) { + if (model_2.isExportable(context.root)) { + var root = context.modelFactory.createRoot(context.modelFactory.createSchema(context.root)); + if (model_2.isExportable(root)) { + root.export = true; + if (model_3.isViewport(root)) { + root.zoom = 1; + root.scroll = { + x: 0, + y: 0 + }; + } + root.index.all().forEach(function (element) { + if (model_1.isSelectable(element) && element.selected) + element.selected = false; + if (model_4.isHoverable(element) && element.hoverFeedback) + element.hoverFeedback = false; + }); + return root; + } + } + return context.modelFactory.createRoot(smodel_factory_1.EMPTY_ROOT); + }; + ExportSvgCommand.KIND = 'requestExportSvg'; + return ExportSvgCommand; +}(command_1.HiddenCommand)); +exports.ExportSvgCommand = ExportSvgCommand; +var ExportSvgDecorator = /** @class */ (function () { + function ExportSvgDecorator() { + } + ExportSvgDecorator.prototype.decorate = function (vnode, element) { + if (element instanceof smodel_1.SModelRoot) + this.root = element; + return vnode; + }; + ExportSvgDecorator.prototype.postUpdate = function () { + if (this.root && model_2.isExportable(this.root) && this.root.export) + this.svgExporter.export(this.root); + }; + __decorate([ + inversify_1.inject(types_1.TYPES.SvgExporter), + __metadata("design:type", svg_exporter_1.SvgExporter) + ], ExportSvgDecorator.prototype, "svgExporter", void 0); + ExportSvgDecorator = __decorate([ + inversify_1.injectable() + ], ExportSvgDecorator); + return ExportSvgDecorator; +}()); +exports.ExportSvgDecorator = ExportSvgDecorator; +//# sourceMappingURL=export.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/export/model.js": +/*!***********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/export/model.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exportFeature = Symbol('exportFeature'); +function isExportable(element) { + return element.hasFeature(exports.exportFeature) && element['export'] !== undefined; +} +exports.isExportable = isExportable; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/export/svg-exporter.js": +/*!******************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/export/svg-exporter.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var model_1 = __webpack_require__(/*! ../bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var action_dispatcher_1 = __webpack_require__(/*! ../../base/actions/action-dispatcher */ "./node_modules/sprotty/lib/base/actions/action-dispatcher.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var ExportSvgAction = /** @class */ (function () { + function ExportSvgAction(svg) { + this.svg = svg; + this.kind = ExportSvgAction.KIND; + } + ExportSvgAction.KIND = 'exportSvg'; + return ExportSvgAction; +}()); +exports.ExportSvgAction = ExportSvgAction; +var SvgExporter = /** @class */ (function () { + function SvgExporter() { + } + SvgExporter.prototype.export = function (root) { + if (typeof document !== 'undefined') { + var div = document.getElementById(this.options.hiddenDiv); + if (div !== null && div.firstElementChild && div.firstElementChild.tagName === 'svg') { + var svgElement = div.firstElementChild; + var svg = this.createSvg(svgElement, root); + this.actionDispatcher.dispatch(new ExportSvgAction(svg)); + } + } + }; + SvgExporter.prototype.createSvg = function (svgElementOrig, root) { + var serializer = new XMLSerializer(); + var svgCopy = serializer.serializeToString(svgElementOrig); + var iframe = document.createElement('iframe'); + document.body.appendChild(iframe); + if (!iframe.contentWindow) + throw new Error('IFrame has no contentWindow'); + var docCopy = iframe.contentWindow.document; + docCopy.open(); + docCopy.write(svgCopy); + docCopy.close(); + var svgElementNew = docCopy.getElementById(svgElementOrig.id); + svgElementNew.removeAttribute('opacity'); + this.copyStyles(svgElementOrig, svgElementNew, ['width', 'height', 'opacity']); + svgElementNew.setAttribute('version', '1.1'); + var bounds = this.getBounds(root); + svgElementNew.setAttribute('viewBox', bounds.x + " " + bounds.y + " " + bounds.width + " " + bounds.height); + var svgCode = serializer.serializeToString(svgElementNew); + document.body.removeChild(iframe); + return svgCode; + }; + SvgExporter.prototype.copyStyles = function (source, target, skipedProperties) { + var sourceStyle = getComputedStyle(source); + var targetStyle = getComputedStyle(target); + var diffStyle = ''; + for (var i = 0; i < sourceStyle.length; i++) { + var key = sourceStyle[i]; + if (skipedProperties.indexOf(key) === -1) { + var value = sourceStyle.getPropertyValue(key); + if (targetStyle.getPropertyValue(key) !== value) { + diffStyle += key + ":" + value + ";"; + } + } + } + if (diffStyle !== '') + target.setAttribute('style', diffStyle); + // IE doesn't retrun anything on source.children + for (var i = 0; i < source.childNodes.length; ++i) { + var sourceChild = source.childNodes[i]; + var targetChild = target.childNodes[i]; + if (sourceChild instanceof Element) + this.copyStyles(sourceChild, targetChild, []); + } + }; + SvgExporter.prototype.getBounds = function (root) { + var allBounds = [geometry_1.EMPTY_BOUNDS]; + root.children.forEach(function (element) { + if (model_1.isBoundsAware(element)) { + allBounds.push(element.bounds); + } + }); + return allBounds.reduce(function (one, two) { return geometry_1.combine(one, two); }); + }; + __decorate([ + inversify_1.inject(types_1.TYPES.ViewerOptions), + __metadata("design:type", Object) + ], SvgExporter.prototype, "options", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.IActionDispatcher), + __metadata("design:type", action_dispatcher_1.ActionDispatcher) + ], SvgExporter.prototype, "actionDispatcher", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.ILogger), + __metadata("design:type", Object) + ], SvgExporter.prototype, "log", void 0); + SvgExporter = __decorate([ + inversify_1.injectable() + ], SvgExporter); + return SvgExporter; +}()); +exports.SvgExporter = SvgExporter; +//# sourceMappingURL=svg-exporter.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/fade/di.config.js": +/*!*************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/fade/di.config.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var fade_1 = __webpack_require__(/*! ./fade */ "./node_modules/sprotty/lib/features/fade/fade.js"); +var fadeModule = new inversify_1.ContainerModule(function (bind) { + bind(types_1.TYPES.IVNodeDecorator).to(fade_1.ElementFader).inSingletonScope(); +}); +exports.default = fadeModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/fade/fade.js": +/*!********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/fade/fade.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var animation_1 = __webpack_require__(/*! ../../base/animations/animation */ "./node_modules/sprotty/lib/base/animations/animation.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var vnode_utils_1 = __webpack_require__(/*! ../../base/views/vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/fade/model.js"); +var FadeAnimation = /** @class */ (function (_super) { + __extends(FadeAnimation, _super); + function FadeAnimation(model, elementFades, context, removeAfterFadeOut) { + if (removeAfterFadeOut === void 0) { removeAfterFadeOut = false; } + var _this = _super.call(this, context) || this; + _this.model = model; + _this.elementFades = elementFades; + _this.removeAfterFadeOut = removeAfterFadeOut; + return _this; + } + FadeAnimation.prototype.tween = function (t, context) { + for (var _i = 0, _a = this.elementFades; _i < _a.length; _i++) { + var elementFade = _a[_i]; + var element = elementFade.element; + if (elementFade.type === 'in') { + element.opacity = t; + } + else if (elementFade.type === 'out') { + element.opacity = 1 - t; + if (t === 1 && this.removeAfterFadeOut && element instanceof smodel_1.SChildElement) { + element.parent.remove(element); + } + } + } + return this.model; + }; + return FadeAnimation; +}(animation_1.Animation)); +exports.FadeAnimation = FadeAnimation; +var ElementFader = /** @class */ (function () { + function ElementFader() { + } + ElementFader.prototype.decorate = function (vnode, element) { + if (model_1.isFadeable(element)) { + vnode_utils_1.setAttr(vnode, 'opacity', element.opacity); + } + return vnode; + }; + ElementFader.prototype.postUpdate = function () { + }; + ElementFader = __decorate([ + inversify_1.injectable() + ], ElementFader); + return ElementFader; +}()); +exports.ElementFader = ElementFader; +//# sourceMappingURL=fade.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/fade/model.js": +/*!*********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/fade/model.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fadeFeature = Symbol('fadeFeature'); +function isFadeable(element) { + return element.hasFeature(exports.fadeFeature) && element['opacity'] !== undefined; +} +exports.isFadeable = isFadeable; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/hover/di.config.js": +/*!**************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/hover/di.config.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var hover_1 = __webpack_require__(/*! ./hover */ "./node_modules/sprotty/lib/features/hover/hover.js"); +var popup_position_updater_1 = __webpack_require__(/*! ./popup-position-updater */ "./node_modules/sprotty/lib/features/hover/popup-position-updater.js"); +var initializer_1 = __webpack_require__(/*! ./initializer */ "./node_modules/sprotty/lib/features/hover/initializer.js"); +var command_registration_1 = __webpack_require__(/*! ../../base/commands/command-registration */ "./node_modules/sprotty/lib/base/commands/command-registration.js"); +var hoverModule = new inversify_1.ContainerModule(function (bind, _unbind, isBound) { + bind(types_1.TYPES.PopupVNodeDecorator).to(popup_position_updater_1.PopupPositionUpdater).inSingletonScope(); + bind(types_1.TYPES.IActionHandlerInitializer).to(initializer_1.PopupActionHandlerInitializer); + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, hover_1.HoverFeedbackCommand); + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, hover_1.SetPopupModelCommand); + bind(types_1.TYPES.MouseListener).to(hover_1.HoverMouseListener); + bind(types_1.TYPES.PopupMouseListener).to(hover_1.PopupHoverMouseListener); + bind(types_1.TYPES.KeyListener).to(hover_1.HoverKeyListener); + bind(types_1.TYPES.HoverState).toConstantValue({ + mouseOverTimer: undefined, + mouseOutTimer: undefined, + popupOpen: false, + previousPopupElement: undefined + }); +}); +exports.default = hoverModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/hover/hover.js": +/*!**********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/hover/hover.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var keyboard_1 = __webpack_require__(/*! ../../utils/keyboard */ "./node_modules/sprotty/lib/utils/keyboard.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var mouse_tool_1 = __webpack_require__(/*! ../../base/views/mouse-tool */ "./node_modules/sprotty/lib/base/views/mouse-tool.js"); +var command_1 = __webpack_require__(/*! ../../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var smodel_factory_1 = __webpack_require__(/*! ../../base/model/smodel-factory */ "./node_modules/sprotty/lib/base/model/smodel-factory.js"); +var key_tool_1 = __webpack_require__(/*! ../../base/views/key-tool */ "./node_modules/sprotty/lib/base/views/key-tool.js"); +var smodel_utils_1 = __webpack_require__(/*! ../../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var model_1 = __webpack_require__(/*! ../bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var model_2 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/hover/model.js"); +/** + * Triggered when the user puts the mouse pointer over an element. + */ +var HoverFeedbackAction = /** @class */ (function () { + function HoverFeedbackAction(mouseoverElement, mouseIsOver) { + this.mouseoverElement = mouseoverElement; + this.mouseIsOver = mouseIsOver; + this.kind = HoverFeedbackCommand.KIND; + } + return HoverFeedbackAction; +}()); +exports.HoverFeedbackAction = HoverFeedbackAction; +var HoverFeedbackCommand = /** @class */ (function (_super) { + __extends(HoverFeedbackCommand, _super); + function HoverFeedbackCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + return _this; + } + HoverFeedbackCommand.prototype.execute = function (context) { + var model = context.root; + var modelElement = model.index.getById(this.action.mouseoverElement); + if (modelElement) { + if (model_2.isHoverable(modelElement)) { + modelElement.hoverFeedback = this.action.mouseIsOver; + } + } + return this.redo(context); + }; + HoverFeedbackCommand.prototype.undo = function (context) { + return context.root; + }; + HoverFeedbackCommand.prototype.redo = function (context) { + return context.root; + }; + HoverFeedbackCommand.KIND = 'hoverFeedback'; + HoverFeedbackCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [HoverFeedbackAction]) + ], HoverFeedbackCommand); + return HoverFeedbackCommand; +}(command_1.SystemCommand)); +exports.HoverFeedbackCommand = HoverFeedbackCommand; +/** + * Triggered when the user hovers the mouse pointer over an element to get a popup with details on + * that element. This action is sent from the client to the model source, e.g. a DiagramServer. + * The response is a SetPopupModelAction. + */ +var RequestPopupModelAction = /** @class */ (function () { + function RequestPopupModelAction(elementId, bounds) { + this.elementId = elementId; + this.bounds = bounds; + this.kind = RequestPopupModelAction.KIND; + } + RequestPopupModelAction.KIND = 'requestPopupModel'; + return RequestPopupModelAction; +}()); +exports.RequestPopupModelAction = RequestPopupModelAction; +/** + * Sent from the model source to the client to display a popup in response to a RequestPopupModelAction. + * This action can also be used to remove any existing popup by choosing EMPTY_ROOT as root element. + */ +var SetPopupModelAction = /** @class */ (function () { + function SetPopupModelAction(newRoot) { + this.newRoot = newRoot; + this.kind = SetPopupModelCommand.KIND; + } + return SetPopupModelAction; +}()); +exports.SetPopupModelAction = SetPopupModelAction; +var SetPopupModelCommand = /** @class */ (function (_super) { + __extends(SetPopupModelCommand, _super); + function SetPopupModelCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + return _this; + } + SetPopupModelCommand.prototype.execute = function (context) { + this.oldRoot = context.root; + this.newRoot = context.modelFactory.createRoot(this.action.newRoot); + return this.newRoot; + }; + SetPopupModelCommand.prototype.undo = function (context) { + return this.oldRoot; + }; + SetPopupModelCommand.prototype.redo = function (context) { + return this.newRoot; + }; + SetPopupModelCommand.KIND = 'setPopupModel'; + SetPopupModelCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [SetPopupModelAction]) + ], SetPopupModelCommand); + return SetPopupModelCommand; +}(command_1.PopupCommand)); +exports.SetPopupModelCommand = SetPopupModelCommand; +var AbstractHoverMouseListener = /** @class */ (function (_super) { + __extends(AbstractHoverMouseListener, _super); + function AbstractHoverMouseListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + AbstractHoverMouseListener.prototype.mouseDown = function (target, event) { + this.mouseIsDown = true; + return []; + }; + AbstractHoverMouseListener.prototype.mouseUp = function (target, event) { + this.mouseIsDown = false; + return []; + }; + AbstractHoverMouseListener.prototype.stopMouseOutTimer = function () { + if (this.state.mouseOutTimer !== undefined) { + window.clearTimeout(this.state.mouseOutTimer); + this.state.mouseOutTimer = undefined; + } + }; + AbstractHoverMouseListener.prototype.startMouseOutTimer = function () { + var _this = this; + this.stopMouseOutTimer(); + return new Promise(function (resolve) { + _this.state.mouseOutTimer = window.setTimeout(function () { + _this.state.popupOpen = false; + _this.state.previousPopupElement = undefined; + resolve(new SetPopupModelAction({ type: smodel_factory_1.EMPTY_ROOT.type, id: smodel_factory_1.EMPTY_ROOT.id })); + }, _this.options.popupCloseDelay); + }); + }; + AbstractHoverMouseListener.prototype.stopMouseOverTimer = function () { + if (this.state.mouseOverTimer !== undefined) { + window.clearTimeout(this.state.mouseOverTimer); + this.state.mouseOverTimer = undefined; + } + }; + __decorate([ + inversify_1.inject(types_1.TYPES.ViewerOptions), + __metadata("design:type", Object) + ], AbstractHoverMouseListener.prototype, "options", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.HoverState), + __metadata("design:type", Object) + ], AbstractHoverMouseListener.prototype, "state", void 0); + return AbstractHoverMouseListener; +}(mouse_tool_1.MouseListener)); +exports.AbstractHoverMouseListener = AbstractHoverMouseListener; +var HoverMouseListener = /** @class */ (function (_super) { + __extends(HoverMouseListener, _super); + function HoverMouseListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + HoverMouseListener.prototype.computePopupBounds = function (target, mousePosition) { + // Default position: below the mouse cursor + var offset = { x: -5, y: 20 }; + var targetBounds = model_1.getAbsoluteBounds(target); + var canvasBounds = target.root.canvasBounds; + var boundsInWindow = geometry_1.translate(targetBounds, canvasBounds); + var distRight = boundsInWindow.x + boundsInWindow.width - mousePosition.x; + var distBottom = boundsInWindow.y + boundsInWindow.height - mousePosition.y; + if (distBottom <= distRight && this.allowSidePosition(target, 'below', distBottom)) { + // Put the popup below the target element + offset = { x: -5, y: Math.round(distBottom + 5) }; + } + else if (distRight <= distBottom && this.allowSidePosition(target, 'right', distRight)) { + // Put the popup right of the target element + offset = { x: Math.round(distRight + 5), y: -5 }; + } + var leftPopupPosition = mousePosition.x + offset.x; + var canvasRightBorderPosition = canvasBounds.x + canvasBounds.width; + if (leftPopupPosition > canvasRightBorderPosition) { + leftPopupPosition = canvasRightBorderPosition; + } + var topPopupPosition = mousePosition.y + offset.y; + var canvasBottomBorderPosition = canvasBounds.y + canvasBounds.height; + if (topPopupPosition > canvasBottomBorderPosition) { + topPopupPosition = canvasBottomBorderPosition; + } + return { x: leftPopupPosition, y: topPopupPosition, width: -1, height: -1 }; + }; + HoverMouseListener.prototype.allowSidePosition = function (target, side, distance) { + return !(target instanceof smodel_1.SModelRoot) && distance <= 150; + }; + HoverMouseListener.prototype.startMouseOverTimer = function (target, event) { + var _this = this; + this.stopMouseOverTimer(); + return new Promise(function (resolve) { + _this.state.mouseOverTimer = window.setTimeout(function () { + var popupBounds = _this.computePopupBounds(target, { x: event.pageX, y: event.pageY }); + resolve(new RequestPopupModelAction(target.id, popupBounds)); + _this.state.popupOpen = true; + _this.state.previousPopupElement = target; + }, _this.options.popupOpenDelay); + }); + }; + HoverMouseListener.prototype.mouseOver = function (target, event) { + var result = []; + if (!this.mouseIsDown) { + var popupTarget = smodel_utils_1.findParent(target, model_2.hasPopupFeature); + if (this.state.popupOpen && (popupTarget === undefined || + this.state.previousPopupElement !== undefined && this.state.previousPopupElement.id !== popupTarget.id)) { + result.push(this.startMouseOutTimer()); + } + else { + this.stopMouseOverTimer(); + this.stopMouseOutTimer(); + } + if (popupTarget !== undefined && + (this.state.previousPopupElement === undefined || this.state.previousPopupElement.id !== popupTarget.id)) { + result.push(this.startMouseOverTimer(popupTarget, event)); + } + var hoverTarget = smodel_utils_1.findParentByFeature(target, model_2.isHoverable); + if (hoverTarget !== undefined) + result.push(new HoverFeedbackAction(hoverTarget.id, true)); + } + return result; + }; + HoverMouseListener.prototype.mouseOut = function (target, event) { + var result = []; + if (!this.mouseIsDown) { + var elementUnderMouse = document.elementFromPoint(event.x, event.y); + if (!this.isSprottyPopup(elementUnderMouse)) { + if (this.state.popupOpen) { + var popupTarget = smodel_utils_1.findParent(target, model_2.hasPopupFeature); + if (this.state.previousPopupElement !== undefined && popupTarget !== undefined + && this.state.previousPopupElement.id === popupTarget.id) + result.push(this.startMouseOutTimer()); + } + this.stopMouseOverTimer(); + var hoverTarget = smodel_utils_1.findParentByFeature(target, model_2.isHoverable); + if (hoverTarget !== undefined) + result.push(new HoverFeedbackAction(hoverTarget.id, false)); + } + } + return result; + }; + HoverMouseListener.prototype.isSprottyPopup = function (element) { + return element + ? (element.id === this.options.popupDiv + || (!!element.parentElement && this.isSprottyPopup(element.parentElement))) + : false; + }; + HoverMouseListener.prototype.mouseMove = function (target, event) { + var result = []; + if (!this.mouseIsDown) { + if (this.state.previousPopupElement !== undefined && this.closeOnMouseMove(this.state.previousPopupElement, event)) { + result.push(this.startMouseOutTimer()); + } + var popupTarget = smodel_utils_1.findParent(target, model_2.hasPopupFeature); + if (popupTarget !== undefined && (this.state.previousPopupElement === undefined + || this.state.previousPopupElement.id !== popupTarget.id)) { + result.push(this.startMouseOverTimer(popupTarget, event)); + } + } + return result; + }; + HoverMouseListener.prototype.closeOnMouseMove = function (target, event) { + return target instanceof smodel_1.SModelRoot; + }; + __decorate([ + inversify_1.inject(types_1.TYPES.ViewerOptions), + __metadata("design:type", Object) + ], HoverMouseListener.prototype, "options", void 0); + HoverMouseListener = __decorate([ + inversify_1.injectable() + ], HoverMouseListener); + return HoverMouseListener; +}(AbstractHoverMouseListener)); +exports.HoverMouseListener = HoverMouseListener; +var PopupHoverMouseListener = /** @class */ (function (_super) { + __extends(PopupHoverMouseListener, _super); + function PopupHoverMouseListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + PopupHoverMouseListener.prototype.mouseOut = function (target, event) { + return [this.startMouseOutTimer()]; + }; + PopupHoverMouseListener.prototype.mouseOver = function (target, event) { + this.stopMouseOutTimer(); + this.stopMouseOverTimer(); + return []; + }; + PopupHoverMouseListener = __decorate([ + inversify_1.injectable() + ], PopupHoverMouseListener); + return PopupHoverMouseListener; +}(AbstractHoverMouseListener)); +exports.PopupHoverMouseListener = PopupHoverMouseListener; +var HoverKeyListener = /** @class */ (function (_super) { + __extends(HoverKeyListener, _super); + function HoverKeyListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + HoverKeyListener.prototype.keyDown = function (element, event) { + if (keyboard_1.matchesKeystroke(event, 'Escape')) { + return [new SetPopupModelAction({ type: smodel_factory_1.EMPTY_ROOT.type, id: smodel_factory_1.EMPTY_ROOT.id })]; + } + return []; + }; + return HoverKeyListener; +}(key_tool_1.KeyListener)); +exports.HoverKeyListener = HoverKeyListener; +//# sourceMappingURL=hover.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/hover/initializer.js": +/*!****************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/hover/initializer.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var hover_1 = __webpack_require__(/*! ./hover */ "./node_modules/sprotty/lib/features/hover/hover.js"); +var smodel_factory_1 = __webpack_require__(/*! ../../base/model/smodel-factory */ "./node_modules/sprotty/lib/base/model/smodel-factory.js"); +var center_fit_1 = __webpack_require__(/*! ../viewport/center-fit */ "./node_modules/sprotty/lib/features/viewport/center-fit.js"); +var viewport_1 = __webpack_require__(/*! ../viewport/viewport */ "./node_modules/sprotty/lib/features/viewport/viewport.js"); +var move_1 = __webpack_require__(/*! ../move/move */ "./node_modules/sprotty/lib/features/move/move.js"); +var ClosePopupActionHandler = /** @class */ (function () { + function ClosePopupActionHandler() { + this.popupOpen = false; + } + ClosePopupActionHandler.prototype.handle = function (action) { + if (action.kind === hover_1.SetPopupModelCommand.KIND) { + this.popupOpen = action.newRoot.type !== smodel_factory_1.EMPTY_ROOT.type; + } + else if (this.popupOpen) { + return new hover_1.SetPopupModelAction({ id: smodel_factory_1.EMPTY_ROOT.id, type: smodel_factory_1.EMPTY_ROOT.type }); + } + }; + return ClosePopupActionHandler; +}()); +var PopupActionHandlerInitializer = /** @class */ (function () { + function PopupActionHandlerInitializer() { + } + PopupActionHandlerInitializer.prototype.initialize = function (registry) { + var closePopupActionHandler = new ClosePopupActionHandler(); + registry.register(center_fit_1.FitToScreenCommand.KIND, closePopupActionHandler); + registry.register(center_fit_1.CenterCommand.KIND, closePopupActionHandler); + registry.register(viewport_1.ViewportCommand.KIND, closePopupActionHandler); + registry.register(hover_1.SetPopupModelCommand.KIND, closePopupActionHandler); + registry.register(move_1.MoveCommand.KIND, closePopupActionHandler); + }; + PopupActionHandlerInitializer = __decorate([ + inversify_1.injectable() + ], PopupActionHandlerInitializer); + return PopupActionHandlerInitializer; +}()); +exports.PopupActionHandlerInitializer = PopupActionHandlerInitializer; +//# sourceMappingURL=initializer.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/hover/model.js": +/*!**********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/hover/model.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hoverFeedbackFeature = Symbol('hoverFeedbackFeature'); +function isHoverable(element) { + return element.hasFeature(exports.hoverFeedbackFeature); +} +exports.isHoverable = isHoverable; +exports.popupFeature = Symbol('popupFeature'); +function hasPopupFeature(element) { + return element.hasFeature(exports.popupFeature); +} +exports.hasPopupFeature = hasPopupFeature; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/hover/popup-position-updater.js": +/*!***************************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/hover/popup-position-updater.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var PopupPositionUpdater = /** @class */ (function () { + function PopupPositionUpdater() { + } + PopupPositionUpdater.prototype.decorate = function (vnode, element) { + return vnode; + }; + PopupPositionUpdater.prototype.postUpdate = function () { + var popupDiv = document.getElementById(this.options.popupDiv); + if (popupDiv !== null && typeof window !== 'undefined') { + var boundingClientRect = popupDiv.getBoundingClientRect(); + if (window.innerHeight < boundingClientRect.height + boundingClientRect.top) { + popupDiv.style.top = (window.scrollY + window.innerHeight - boundingClientRect.height - 5) + 'px'; + } + if (window.innerWidth < boundingClientRect.left + boundingClientRect.width) { + popupDiv.style.left = (window.scrollX + window.innerWidth - boundingClientRect.width - 5) + 'px'; + } + if (boundingClientRect.left < 0) { + popupDiv.style.left = '0px'; + } + if (boundingClientRect.top < 0) { + popupDiv.style.top = '0px'; + } + } + }; + __decorate([ + inversify_1.inject(types_1.TYPES.ViewerOptions), + __metadata("design:type", Object) + ], PopupPositionUpdater.prototype, "options", void 0); + PopupPositionUpdater = __decorate([ + inversify_1.injectable() + ], PopupPositionUpdater); + return PopupPositionUpdater; +}()); +exports.PopupPositionUpdater = PopupPositionUpdater; +//# sourceMappingURL=popup-position-updater.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/move/di.config.js": +/*!*************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/move/di.config.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var move_1 = __webpack_require__(/*! ./move */ "./node_modules/sprotty/lib/features/move/move.js"); +var command_registration_1 = __webpack_require__(/*! ../../base/commands/command-registration */ "./node_modules/sprotty/lib/base/commands/command-registration.js"); +var moveModule = new inversify_1.ContainerModule(function (bind, _unbind, isBound) { + bind(types_1.TYPES.MouseListener).to(move_1.MoveMouseListener); + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, move_1.MoveCommand); + bind(types_1.TYPES.IVNodeDecorator).to(move_1.LocationDecorator); + bind(types_1.TYPES.HiddenVNodeDecorator).to(move_1.LocationDecorator); +}); +exports.default = moveModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/move/model.js": +/*!*********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/move/model.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.moveFeature = Symbol('moveFeature'); +function isLocateable(element) { + return element['position'] !== undefined; +} +exports.isLocateable = isLocateable; +function isMoveable(element) { + return element.hasFeature(exports.moveFeature) && isLocateable(element); +} +exports.isMoveable = isMoveable; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/move/move.js": +/*!********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/move/move.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var animation_1 = __webpack_require__(/*! ../../base/animations/animation */ "./node_modules/sprotty/lib/base/animations/animation.js"); +var command_1 = __webpack_require__(/*! ../../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var smodel_utils_1 = __webpack_require__(/*! ../../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var mouse_tool_1 = __webpack_require__(/*! ../../base/views/mouse-tool */ "./node_modules/sprotty/lib/base/views/mouse-tool.js"); +var vnode_utils_1 = __webpack_require__(/*! ../../base/views/vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var model_1 = __webpack_require__(/*! ../bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var create_on_drag_1 = __webpack_require__(/*! ../edit/create-on-drag */ "./node_modules/sprotty/lib/features/edit/create-on-drag.js"); +var delete_1 = __webpack_require__(/*! ../edit/delete */ "./node_modules/sprotty/lib/features/edit/delete.js"); +var edit_routing_1 = __webpack_require__(/*! ../edit/edit-routing */ "./node_modules/sprotty/lib/features/edit/edit-routing.js"); +var reconnect_1 = __webpack_require__(/*! ../edit/reconnect */ "./node_modules/sprotty/lib/features/edit/reconnect.js"); +var model_2 = __webpack_require__(/*! ../routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var routing_1 = __webpack_require__(/*! ../routing/routing */ "./node_modules/sprotty/lib/features/routing/routing.js"); +var model_3 = __webpack_require__(/*! ../select/model */ "./node_modules/sprotty/lib/features/select/model.js"); +var select_1 = __webpack_require__(/*! ../select/select */ "./node_modules/sprotty/lib/features/select/select.js"); +var model_4 = __webpack_require__(/*! ../viewport/model */ "./node_modules/sprotty/lib/features/viewport/model.js"); +var model_5 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/move/model.js"); +var commit_model_1 = __webpack_require__(/*! ../../model-source/commit-model */ "./node_modules/sprotty/lib/model-source/commit-model.js"); +var MoveAction = /** @class */ (function () { + function MoveAction(moves, animate) { + if (animate === void 0) { animate = true; } + this.moves = moves; + this.animate = animate; + this.kind = MoveCommand.KIND; + } + return MoveAction; +}()); +exports.MoveAction = MoveAction; +var MoveCommand = /** @class */ (function (_super) { + __extends(MoveCommand, _super); + function MoveCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + _this.resolvedMoves = new Map; + _this.edgeMementi = []; + return _this; + } + MoveCommand_1 = MoveCommand; + MoveCommand.prototype.execute = function (context) { + var _this = this; + var index = context.root.index; + var edge2handleMoves = new Map(); + var attachedEdgeShifts = new Map(); + this.action.moves.forEach(function (move) { + var element = index.getById(move.elementId); + if (element instanceof model_2.SRoutingHandle && _this.edgeRouterRegistry) { + var edge = element.parent; + if (edge instanceof model_2.SRoutableElement) { + var resolvedMove = _this.resolveHandleMove(element, edge, move); + if (resolvedMove) { + var movesByEdge = edge2handleMoves.get(edge); + if (!movesByEdge) { + movesByEdge = []; + edge2handleMoves.set(edge, movesByEdge); + } + movesByEdge.push(resolvedMove); + } + } + } + else if (element && model_5.isLocateable(element)) { + var resolvedMove_1 = _this.resolveElementMove(element, move); + if (resolvedMove_1) { + _this.resolvedMoves.set(resolvedMove_1.element.id, resolvedMove_1); + if (_this.edgeRouterRegistry) { + index.getAttachedElements(element).forEach(function (edge) { + if (edge instanceof model_2.SRoutableElement) { + var existingDelta = attachedEdgeShifts.get(edge); + var newDelta = geometry_1.subtract(resolvedMove_1.toPosition, resolvedMove_1.fromPosition); + var delta = (existingDelta) + ? geometry_1.linear(existingDelta, newDelta, 0.5) + : newDelta; + attachedEdgeShifts.set(edge, delta); + } + }); + } + } + } + }); + this.doMove(edge2handleMoves, attachedEdgeShifts); + if (this.action.animate) { + this.undoMove(); + return new animation_1.CompoundAnimation(context.root, context, [ + new MoveAnimation(context.root, this.resolvedMoves, context, false), + new MorphEdgesAnimation(context.root, this.edgeMementi, context, false) + ]).start(); + } + return context.root; + }; + MoveCommand.prototype.resolveHandleMove = function (handle, edge, move) { + var fromPosition = move.fromPosition; + if (!fromPosition) { + var router = this.edgeRouterRegistry.get(edge.routerKind); + fromPosition = router.getHandlePosition(edge, router.route(edge), handle); + } + if (fromPosition) + return { + handle: handle, + fromPosition: fromPosition, + toPosition: move.toPosition + }; + return undefined; + }; + MoveCommand.prototype.resolveElementMove = function (element, move) { + var fromPosition = move.fromPosition + || { x: element.position.x, y: element.position.y }; + return { + element: element, + fromPosition: fromPosition, + toPosition: move.toPosition + }; + }; + MoveCommand.prototype.doMove = function (edge2move, attachedEdgeShifts) { + var _this = this; + this.resolvedMoves.forEach(function (res) { + res.element.position = res.toPosition; + }); + edge2move.forEach(function (moves, edge) { + var router = _this.edgeRouterRegistry.get(edge.routerKind); + var before = router.takeSnapshot(edge); + router.applyHandleMoves(edge, moves); + var after = router.takeSnapshot(edge); + _this.edgeMementi.push({ edge: edge, before: before, after: after }); + }); + attachedEdgeShifts.forEach(function (delta, edge) { + if (!edge2move.get(edge)) { + var router = _this.edgeRouterRegistry.get(edge.routerKind); + var before = router.takeSnapshot(edge); + if (edge.source + && edge.target + && _this.resolvedMoves.get(edge.source.id) + && _this.resolvedMoves.get(edge.target.id)) { + // move the entire edge when both source and target are moved + edge.routingPoints = edge.routingPoints.map(function (rp) { return geometry_1.add(rp, delta); }); + // } else { + // // add/remove RPs according to the new source/target positions + // router.cleanupRoutingPoints(edge, edge.routingPoints, false); + } + var after = router.takeSnapshot(edge); + _this.edgeMementi.push({ edge: edge, before: before, after: after }); + } + }); + }; + MoveCommand.prototype.undoMove = function () { + var _this = this; + this.resolvedMoves.forEach(function (res) { + res.element.position = res.fromPosition; + }); + this.edgeMementi.forEach(function (memento) { + var router = _this.edgeRouterRegistry.get(memento.edge.routerKind); + router.applySnapshot(memento.edge, memento.before); + }); + }; + MoveCommand.prototype.undo = function (context) { + return new animation_1.CompoundAnimation(context.root, context, [ + new MoveAnimation(context.root, this.resolvedMoves, context, true), + new MorphEdgesAnimation(context.root, this.edgeMementi, context, true) + ]).start(); + }; + MoveCommand.prototype.redo = function (context) { + return new animation_1.CompoundAnimation(context.root, context, [ + new MoveAnimation(context.root, this.resolvedMoves, context, false), + new MorphEdgesAnimation(context.root, this.edgeMementi, context, false) + ]).start(); + }; + MoveCommand.prototype.merge = function (other, context) { + var _this = this; + if (!this.action.animate && other instanceof MoveCommand_1) { + other.resolvedMoves.forEach(function (otherMove, otherElementId) { + var existingMove = _this.resolvedMoves.get(otherElementId); + if (existingMove) { + existingMove.toPosition = otherMove.toPosition; + } + else { + _this.resolvedMoves.set(otherElementId, otherMove); + } + }); + other.edgeMementi.forEach(function (otherMemento) { + var existingMemento = _this.edgeMementi.find(function (edgeMemento) { return edgeMemento.edge.id === otherMemento.edge.id; }); + if (existingMemento) { + existingMemento.after = otherMemento.after; + } + else { + _this.edgeMementi.push(otherMemento); + } + }); + return true; + } + else if (other instanceof reconnect_1.ReconnectCommand) { + var otherMemento_1 = other.memento; + if (otherMemento_1) { + var existingMemento = this.edgeMementi.find(function (edgeMemento) { return edgeMemento.edge.id === otherMemento_1.edge.id; }); + if (existingMemento) { + existingMemento.after = otherMemento_1.after; + } + else { + this.edgeMementi.push(otherMemento_1); + } + } + return true; + } + return false; + }; + var MoveCommand_1; + MoveCommand.KIND = 'move'; + __decorate([ + inversify_1.inject(routing_1.EdgeRouterRegistry), inversify_1.optional(), + __metadata("design:type", routing_1.EdgeRouterRegistry) + ], MoveCommand.prototype, "edgeRouterRegistry", void 0); + MoveCommand = MoveCommand_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [MoveAction]) + ], MoveCommand); + return MoveCommand; +}(command_1.MergeableCommand)); +exports.MoveCommand = MoveCommand; +var MoveAnimation = /** @class */ (function (_super) { + __extends(MoveAnimation, _super); + function MoveAnimation(model, elementMoves, context, reverse) { + if (reverse === void 0) { reverse = false; } + var _this = _super.call(this, context) || this; + _this.model = model; + _this.elementMoves = elementMoves; + _this.reverse = reverse; + return _this; + } + MoveAnimation.prototype.tween = function (t) { + var _this = this; + this.elementMoves.forEach(function (elementMove) { + if (_this.reverse) { + elementMove.element.position = { + x: (1 - t) * elementMove.toPosition.x + t * elementMove.fromPosition.x, + y: (1 - t) * elementMove.toPosition.y + t * elementMove.fromPosition.y + }; + } + else { + elementMove.element.position = { + x: (1 - t) * elementMove.fromPosition.x + t * elementMove.toPosition.x, + y: (1 - t) * elementMove.fromPosition.y + t * elementMove.toPosition.y + }; + } + }); + return this.model; + }; + return MoveAnimation; +}(animation_1.Animation)); +exports.MoveAnimation = MoveAnimation; +var MorphEdgesAnimation = /** @class */ (function (_super) { + __extends(MorphEdgesAnimation, _super); + function MorphEdgesAnimation(model, originalMementi, context, reverse) { + if (reverse === void 0) { reverse = false; } + var _this = _super.call(this, context) || this; + _this.model = model; + _this.originalMementi = originalMementi; + _this.reverse = reverse; + _this.expandedMementi = []; + originalMementi.forEach(function (edgeMemento) { + var start = _this.reverse ? edgeMemento.after : edgeMemento.before; + var end = _this.reverse ? edgeMemento.before : edgeMemento.after; + // duplicate RPs such that both snapshots have the same number of RPs + var startRpsExpanded = start.routingPoints.slice(); + var endRpsExpanded = end.routingPoints.slice(); + var midPoint = _this.midPoint(edgeMemento); + var diff = startRpsExpanded.length - endRpsExpanded.length; + while (diff > 0) { + endRpsExpanded.push(endRpsExpanded[endRpsExpanded.length - 1] || midPoint); + --diff; + } + while (diff < 0) { + startRpsExpanded.push(startRpsExpanded[startRpsExpanded.length - 1] || midPoint); + ++diff; + } + _this.expandedMementi.push({ + edge: edgeMemento.edge, + before: __assign({}, start, { routingPoints: startRpsExpanded }), + after: __assign({}, end, { routingPoints: endRpsExpanded }) + }); + }); + return _this; + } + MorphEdgesAnimation.prototype.midPoint = function (edgeMemento) { + var edge = edgeMemento.edge; + var source = edgeMemento.edge.source; + var target = edgeMemento.edge.target; + return geometry_1.linear(smodel_utils_1.translatePoint(geometry_1.center(source.bounds), source.parent, edge.parent), smodel_utils_1.translatePoint(geometry_1.center(target.bounds), target.parent, edge.parent), 0.5); + }; + MorphEdgesAnimation.prototype.start = function () { + this.expandedMementi.forEach(function (memento) { + memento.edge.removeAll(function (e) { return e instanceof model_2.SRoutingHandle; }); + }); + return _super.prototype.start.call(this); + }; + MorphEdgesAnimation.prototype.tween = function (t) { + var _this = this; + if (t === 1) { + this.originalMementi.forEach(function (memento) { + if (_this.reverse) + memento.after.router.applySnapshot(memento.edge, memento.before); + else + memento.after.router.applySnapshot(memento.edge, memento.after); + }); + } + else { + this.expandedMementi.forEach(function (memento) { + var newRoutingPoints = []; + for (var i = 0; i < memento.before.routingPoints.length; ++i) { + var startPoint = memento.before.routingPoints[i]; + var endPoint = memento.after.routingPoints[i]; + newRoutingPoints.push({ + x: (1 - t) * startPoint.x + t * endPoint.x, + y: (1 - t) * startPoint.y + t * endPoint.y + }); + } + var closestSnapshot = t < 0.5 ? memento.before : memento.after; + var newSnapshot = __assign({}, closestSnapshot, { routingPoints: newRoutingPoints, routingHandles: [] }); + closestSnapshot.router.applySnapshot(memento.edge, newSnapshot); + }); + } + return this.model; + }; + return MorphEdgesAnimation; +}(animation_1.Animation)); +exports.MorphEdgesAnimation = MorphEdgesAnimation; +var MoveMouseListener = /** @class */ (function (_super) { + __extends(MoveMouseListener, _super); + function MoveMouseListener() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.hasDragged = false; + return _this; + } + MoveMouseListener.prototype.mouseDown = function (target, event) { + var result = []; + if (event.button === 0) { + var moveable = smodel_utils_1.findParentByFeature(target, model_5.isMoveable); + var isRoutingHandle = target instanceof model_2.SRoutingHandle; + if (moveable !== undefined || isRoutingHandle || create_on_drag_1.isCreatingOnDrag(target)) { + this.lastDragPosition = { x: event.pageX, y: event.pageY }; + } + else { + this.lastDragPosition = undefined; + } + this.hasDragged = false; + if (create_on_drag_1.isCreatingOnDrag(target)) { + result.push(new select_1.SelectAllAction(false)); + result.push(target.createAction(model_2.edgeInProgressID)); + result.push(new select_1.SelectAction([model_2.edgeInProgressID], [])); + result.push(new edit_routing_1.SwitchEditModeAction([model_2.edgeInProgressID], [])); + result.push(new select_1.SelectAction([model_2.edgeInProgressTargetHandleID], [])); + result.push(new edit_routing_1.SwitchEditModeAction([model_2.edgeInProgressTargetHandleID], [])); + } + else if (isRoutingHandle) { + result.push(new edit_routing_1.SwitchEditModeAction([target.id], [])); + } + } + return result; + }; + MoveMouseListener.prototype.mouseMove = function (target, event) { + var _this = this; + var result = []; + if (event.buttons === 0) + this.mouseUp(target, event); + else if (this.lastDragPosition) { + var viewport = smodel_utils_1.findParentByFeature(target, model_4.isViewport); + this.hasDragged = true; + var zoom = viewport ? viewport.zoom : 1; + var dx_1 = (event.pageX - this.lastDragPosition.x) / zoom; + var dy_1 = (event.pageY - this.lastDragPosition.y) / zoom; + var elementMoves_1 = []; + target.root.index.all() + .filter(function (element) { return model_3.isSelectable(element) && element.selected; }) + .forEach(function (element) { + if (model_5.isMoveable(element)) { + elementMoves_1.push({ + elementId: element.id, + fromPosition: { + x: element.position.x, + y: element.position.y + }, + toPosition: { + x: element.position.x + dx_1, + y: element.position.y + dy_1 + } + }); + } + else if (element instanceof model_2.SRoutingHandle) { + var point = _this.getHandlePosition(element); + if (point !== undefined) { + elementMoves_1.push({ + elementId: element.id, + fromPosition: point, + toPosition: { + x: point.x + dx_1, + y: point.y + dy_1 + } + }); + } + } + }); + this.lastDragPosition = { x: event.pageX, y: event.pageY }; + if (elementMoves_1.length > 0) + result.push(new MoveAction(elementMoves_1, false)); + } + return result; + }; + MoveMouseListener.prototype.getHandlePosition = function (handle) { + if (this.edgeRouterRegistry) { + var parent_1 = handle.parent; + if (!(parent_1 instanceof model_2.SRoutableElement)) + return undefined; + var router = this.edgeRouterRegistry.get(parent_1.routerKind); + var route = router.route(parent_1); + return router.getHandlePosition(parent_1, route, handle); + } + return undefined; + }; + MoveMouseListener.prototype.mouseEnter = function (target, event) { + if (target instanceof smodel_1.SModelRoot && event.buttons === 0) + this.mouseUp(target, event); + return []; + }; + MoveMouseListener.prototype.mouseUp = function (target, event) { + var _this = this; + var result = []; + var hasReconnected = false; + if (this.lastDragPosition) { + target.root.index.all() + .forEach(function (element) { + if (element instanceof model_2.SRoutingHandle) { + var parent_2 = element.parent; + if (parent_2 instanceof model_2.SRoutableElement && element.danglingAnchor) { + var handlePos = _this.getHandlePosition(element); + if (handlePos) { + var handlePosAbs = smodel_utils_1.translatePoint(handlePos, element.parent, element.root); + var newEnd = model_1.findChildrenAtPosition(target.root, handlePosAbs) + .find(function (e) { return model_2.isConnectable(e) && e.canConnect(parent_2, element.kind); }); + if (newEnd && _this.hasDragged) { + result.push(new reconnect_1.ReconnectAction(element.parent.id, element.kind === 'source' ? newEnd.id : parent_2.sourceId, element.kind === 'target' ? newEnd.id : parent_2.targetId)); + hasReconnected = true; + } + } + } + if (element.editMode) + result.push(new edit_routing_1.SwitchEditModeAction([], [element.id])); + } + }); + } + if (!hasReconnected) { + var edgeInProgress = target.root.index.getById(model_2.edgeInProgressID); + if (edgeInProgress instanceof smodel_1.SChildElement) { + var deleteIds_1 = []; + deleteIds_1.push(model_2.edgeInProgressID); + edgeInProgress.children.forEach(function (c) { + if (c instanceof model_2.SRoutingHandle && c.danglingAnchor) + deleteIds_1.push(c.danglingAnchor.id); + }); + result.push(new delete_1.DeleteElementAction(deleteIds_1)); + } + } + if (this.hasDragged) + result.push(new commit_model_1.CommitModelAction()); + this.hasDragged = false; + this.lastDragPosition = undefined; + return result; + }; + MoveMouseListener.prototype.decorate = function (vnode, element) { + return vnode; + }; + __decorate([ + inversify_1.inject(routing_1.EdgeRouterRegistry), inversify_1.optional(), + __metadata("design:type", routing_1.EdgeRouterRegistry) + ], MoveMouseListener.prototype, "edgeRouterRegistry", void 0); + return MoveMouseListener; +}(mouse_tool_1.MouseListener)); +exports.MoveMouseListener = MoveMouseListener; +var LocationDecorator = /** @class */ (function () { + function LocationDecorator() { + } + LocationDecorator.prototype.decorate = function (vnode, element) { + var translate = ''; + if (model_5.isLocateable(element) && element instanceof smodel_1.SChildElement && element.parent !== undefined) { + translate = 'translate(' + element.position.x + ', ' + element.position.y + ')'; + } + if (model_1.isAlignable(element)) { + if (translate.length > 0) + translate += ' '; + translate += 'translate(' + element.alignment.x + ', ' + element.alignment.y + ')'; + } + if (translate.length > 0) + vnode_utils_1.setAttr(vnode, 'transform', translate); + return vnode; + }; + LocationDecorator.prototype.postUpdate = function () { + }; + LocationDecorator = __decorate([ + inversify_1.injectable() + ], LocationDecorator); + return LocationDecorator; +}()); +exports.LocationDecorator = LocationDecorator; +//# sourceMappingURL=move.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/open/di.config.js": +/*!*************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/open/di.config.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var open_1 = __webpack_require__(/*! ./open */ "./node_modules/sprotty/lib/features/open/open.js"); +var openModule = new inversify_1.ContainerModule(function (bind) { + bind(types_1.TYPES.MouseListener).to(open_1.OpenMouseListener); +}); +exports.default = openModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/open/model.js": +/*!*********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/open/model.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.openFeature = Symbol('openFeature'); +function isOpenable(element) { + return element.hasFeature(exports.openFeature); +} +exports.isOpenable = isOpenable; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/open/open.js": +/*!********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/open/open.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var mouse_tool_1 = __webpack_require__(/*! ../../base/views/mouse-tool */ "./node_modules/sprotty/lib/base/views/mouse-tool.js"); +var smodel_utils_1 = __webpack_require__(/*! ../../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/open/model.js"); +var OpenAction = /** @class */ (function () { + function OpenAction(elementId) { + this.elementId = elementId; + this.kind = OpenAction.KIND; + } + OpenAction.KIND = 'open'; + return OpenAction; +}()); +exports.OpenAction = OpenAction; +var OpenMouseListener = /** @class */ (function (_super) { + __extends(OpenMouseListener, _super); + function OpenMouseListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + OpenMouseListener.prototype.doubleClick = function (target, event) { + var openableTarget = smodel_utils_1.findParentByFeature(target, model_1.isOpenable); + if (openableTarget !== undefined) { + return [new OpenAction(openableTarget.id)]; + } + return []; + }; + return OpenMouseListener; +}(mouse_tool_1.MouseListener)); +exports.OpenMouseListener = OpenMouseListener; +//# sourceMappingURL=open.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/routing/anchor.js": +/*!*************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/routing/anchor.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2019 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var registry_1 = __webpack_require__(/*! ../../utils/registry */ "./node_modules/sprotty/lib/utils/registry.js"); +exports.DIAMOND_ANCHOR_KIND = 'diamond'; +exports.ELLIPTIC_ANCHOR_KIND = 'elliptic'; +exports.RECTANGULAR_ANCHOR_KIND = 'rectangular'; +var AnchorComputerRegistry = /** @class */ (function (_super) { + __extends(AnchorComputerRegistry, _super); + function AnchorComputerRegistry(anchors) { + var _this = _super.call(this) || this; + anchors.forEach(function (anchor) { return _this.register(anchor.kind, anchor); }); + return _this; + } + Object.defineProperty(AnchorComputerRegistry.prototype, "defaultAnchorKind", { + get: function () { + return exports.RECTANGULAR_ANCHOR_KIND; + }, + enumerable: true, + configurable: true + }); + AnchorComputerRegistry.prototype.get = function (routerKind, anchorKind) { + return _super.prototype.get.call(this, routerKind + ":" + (anchorKind || this.defaultAnchorKind)); + }; + AnchorComputerRegistry = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.multiInject(types_1.TYPES.IAnchorComputer)), + __metadata("design:paramtypes", [Array]) + ], AnchorComputerRegistry); + return AnchorComputerRegistry; +}(registry_1.InstanceRegistry)); +exports.AnchorComputerRegistry = AnchorComputerRegistry; +//# sourceMappingURL=anchor.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/routing/di.config.js": +/*!****************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/routing/di.config.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2019 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var manhattan_edge_router_1 = __webpack_require__(/*! ./manhattan-edge-router */ "./node_modules/sprotty/lib/features/routing/manhattan-edge-router.js"); +var polyline_edge_router_1 = __webpack_require__(/*! ./polyline-edge-router */ "./node_modules/sprotty/lib/features/routing/polyline-edge-router.js"); +var manhattan_anchors_1 = __webpack_require__(/*! ./manhattan-anchors */ "./node_modules/sprotty/lib/features/routing/manhattan-anchors.js"); +var polyline_anchors_1 = __webpack_require__(/*! ./polyline-anchors */ "./node_modules/sprotty/lib/features/routing/polyline-anchors.js"); +var anchor_1 = __webpack_require__(/*! ./anchor */ "./node_modules/sprotty/lib/features/routing/anchor.js"); +var routing_1 = __webpack_require__(/*! ./routing */ "./node_modules/sprotty/lib/features/routing/routing.js"); +var routingModule = new inversify_1.ContainerModule(function (bind) { + bind(routing_1.EdgeRouterRegistry).toSelf().inSingletonScope(); + bind(anchor_1.AnchorComputerRegistry).toSelf().inSingletonScope(); + bind(manhattan_edge_router_1.ManhattanEdgeRouter).toSelf().inSingletonScope(); + bind(types_1.TYPES.IEdgeRouter).toService(manhattan_edge_router_1.ManhattanEdgeRouter); + bind(types_1.TYPES.IAnchorComputer).to(manhattan_anchors_1.ManhattanEllipticAnchor).inSingletonScope(); + bind(types_1.TYPES.IAnchorComputer).to(manhattan_anchors_1.ManhattanRectangularAnchor).inSingletonScope(); + bind(types_1.TYPES.IAnchorComputer).to(manhattan_anchors_1.ManhattanDiamondAnchor).inSingletonScope(); + bind(polyline_edge_router_1.PolylineEdgeRouter).toSelf().inSingletonScope(); + bind(types_1.TYPES.IEdgeRouter).toService(polyline_edge_router_1.PolylineEdgeRouter); + bind(types_1.TYPES.IAnchorComputer).to(polyline_anchors_1.EllipseAnchor); + bind(types_1.TYPES.IAnchorComputer).to(polyline_anchors_1.RectangleAnchor); + bind(types_1.TYPES.IAnchorComputer).to(polyline_anchors_1.DiamondAnchor); +}); +exports.default = routingModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/routing/linear-edge-router.js": +/*!*************************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/routing/linear-edge-router.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2019 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var smodel_utils_1 = __webpack_require__(/*! ../../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var model_1 = __webpack_require__(/*! ../routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var anchor_1 = __webpack_require__(/*! ./anchor */ "./node_modules/sprotty/lib/features/routing/anchor.js"); +var model_2 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var Side; +(function (Side) { + Side[Side["RIGHT"] = 0] = "RIGHT"; + Side[Side["LEFT"] = 1] = "LEFT"; + Side[Side["TOP"] = 2] = "TOP"; + Side[Side["BOTTOM"] = 3] = "BOTTOM"; +})(Side = exports.Side || (exports.Side = {})); +var DefaultAnchors = /** @class */ (function () { + function DefaultAnchors(element, edgeParent, kind) { + this.element = element; + this.kind = kind; + var bounds = element.bounds; + this.bounds = smodel_utils_1.translateBounds(bounds, element.parent, edgeParent); + this.left = { x: this.bounds.x, y: this.bounds.y + 0.5 * this.bounds.height, kind: kind }; + this.right = { x: this.bounds.x + this.bounds.width, y: this.bounds.y + 0.5 * this.bounds.height, kind: kind }; + this.top = { x: this.bounds.x + 0.5 * this.bounds.width, y: this.bounds.y, kind: kind }; + this.bottom = { x: this.bounds.x + 0.5 * this.bounds.width, y: this.bounds.y + this.bounds.height, kind: kind }; + } + DefaultAnchors.prototype.get = function (side) { + return this[Side[side].toLowerCase()]; + }; + DefaultAnchors.prototype.getNearestSide = function (point) { + var leftDistance = geometry_1.euclideanDistance(point, this.left); + var rightDistance = geometry_1.euclideanDistance(point, this.right); + var topDistance = geometry_1.euclideanDistance(point, this.top); + var bottomDistance = geometry_1.euclideanDistance(point, this.bottom); + var currentNearestSide = Side.LEFT; + var currentMinDist = leftDistance; + if (rightDistance < currentMinDist) { + currentMinDist = rightDistance; + currentNearestSide = Side.RIGHT; + } + if (topDistance < currentMinDist) { + currentMinDist = topDistance; + currentNearestSide = Side.TOP; + } + if (bottomDistance < currentMinDist) { + currentMinDist = bottomDistance; + currentNearestSide = Side.BOTTOM; + } + return currentNearestSide; + }; + return DefaultAnchors; +}()); +exports.DefaultAnchors = DefaultAnchors; +var LinearEdgeRouter = /** @class */ (function () { + function LinearEdgeRouter() { + } + LinearEdgeRouter.prototype.pointAt = function (edge, t) { + var segments = this.calculateSegment(edge, t); + if (!segments) + return undefined; + var segmentStart = segments.segmentStart, segmentEnd = segments.segmentEnd, lambda = segments.lambda; + return geometry_1.linear(segmentStart, segmentEnd, lambda); + }; + LinearEdgeRouter.prototype.derivativeAt = function (edge, t) { + var segments = this.calculateSegment(edge, t); + if (!segments) + return undefined; + var segmentStart = segments.segmentStart, segmentEnd = segments.segmentEnd; + return { + x: segmentEnd.x - segmentStart.x, + y: segmentEnd.y - segmentStart.y + }; + }; + LinearEdgeRouter.prototype.calculateSegment = function (edge, t) { + if (t < 0 || t > 1) + return undefined; + var routedPoints = this.route(edge); + if (routedPoints.length < 2) + return undefined; + var segmentLengths = []; + var totalLength = 0; + for (var i = 0; i < routedPoints.length - 1; ++i) { + segmentLengths[i] = geometry_1.euclideanDistance(routedPoints[i], routedPoints[i + 1]); + totalLength += segmentLengths[i]; + } + var currentLenght = 0; + var tAsLenght = t * totalLength; + for (var i = 0; i < routedPoints.length - 1; ++i) { + var newLength = currentLenght + segmentLengths[i]; + // avoid division by (almost) zero + if (segmentLengths[i] > 1E-8) { + if (newLength >= tAsLenght) { + var lambda = Math.max(0, (tAsLenght - currentLenght)) / segmentLengths[i]; + return { + segmentStart: routedPoints[i], + segmentEnd: routedPoints[i + 1], + lambda: lambda + }; + } + } + currentLenght = newLength; + } + return { + segmentEnd: routedPoints.pop(), + segmentStart: routedPoints.pop(), + lambda: 1 + }; + }; + LinearEdgeRouter.prototype.addHandle = function (edge, kind, type, routingPointIndex) { + var handle = new model_1.SRoutingHandle(); + handle.kind = kind; + handle.pointIndex = routingPointIndex; + handle.type = type; + if (kind === 'target' && edge.id === model_1.edgeInProgressID) + handle.id = model_1.edgeInProgressTargetHandleID; + edge.add(handle); + return handle; + }; + LinearEdgeRouter.prototype.getHandlePosition = function (edge, route, handle) { + switch (handle.kind) { + case 'source': + if (edge.source instanceof model_1.SDanglingAnchor) + return edge.source.position; + else + return route[0]; + case 'target': + if (edge.target instanceof model_1.SDanglingAnchor) + return edge.target.position; + else { + return route[route.length - 1]; + } + default: + var position = this.getInnerHandlePosition(edge, route, handle); + if (position !== undefined) + return position; + if (handle.pointIndex >= 0 && handle.pointIndex < edge.routingPoints.length) + return edge.routingPoints[handle.pointIndex]; + } + return undefined; + }; + LinearEdgeRouter.prototype.findRouteSegment = function (edge, route, handleIndex) { + var getIndex = function (rp) { + if (rp.pointIndex !== undefined) + return rp.pointIndex; + else if (rp.kind === 'target') + return edge.routingPoints.length; + else + return -2; + }; + var start, end; + for (var _i = 0, route_1 = route; _i < route_1.length; _i++) { + var rp = route_1[_i]; + var i = getIndex(rp); + if (i <= handleIndex && (start === undefined || i > getIndex(start))) + start = rp; + if (i > handleIndex && (end === undefined || i < getIndex(end))) + end = rp; + } + return { start: start, end: end }; + }; + LinearEdgeRouter.prototype.getTranslatedAnchor = function (connectable, refPoint, refContainer, edge, anchorCorrection) { + if (anchorCorrection === void 0) { anchorCorrection = 0; } + var translatedRefPoint = smodel_utils_1.translatePoint(refPoint, refContainer, connectable.parent); + var anchorComputer = this.getAnchorComputer(connectable); + var strokeCorrection = 0.5 * connectable.strokeWidth; + var anchor = anchorComputer.getAnchor(connectable, translatedRefPoint, anchorCorrection + strokeCorrection); + return smodel_utils_1.translatePoint(anchor, connectable.parent, edge.parent); + }; + LinearEdgeRouter.prototype.getAnchorComputer = function (connectable) { + return this.anchorRegistry.get(this.kind, connectable.anchorKind); + }; + LinearEdgeRouter.prototype.applyHandleMoves = function (edge, moves) { + var remainingMoves = moves.slice(); + moves.forEach(function (move) { + var handle = move.handle; + if (handle.kind === 'source' && !(edge.source instanceof model_1.SDanglingAnchor)) { + // detach source + var anchor = new model_1.SDanglingAnchor(); + anchor.id = edge.id + '_dangling-source'; + anchor.original = edge.source; + anchor.position = move.toPosition; + handle.root.add(anchor); + handle.danglingAnchor = anchor; + edge.sourceId = anchor.id; + } + else if (handle.kind === 'target' && !(edge.target instanceof model_1.SDanglingAnchor)) { + // detach target + var anchor = new model_1.SDanglingAnchor(); + anchor.id = edge.id + '_dangling-target'; + anchor.original = edge.target; + anchor.position = move.toPosition; + handle.root.add(anchor); + handle.danglingAnchor = anchor; + edge.targetId = anchor.id; + } + if (handle.danglingAnchor) { + handle.danglingAnchor.position = move.toPosition; + remainingMoves.splice(remainingMoves.indexOf(move), 1); + } + }); + if (remainingMoves.length > 0) + this.applyInnerHandleMoves(edge, remainingMoves); + this.cleanupRoutingPoints(edge, edge.routingPoints, true); + }; + LinearEdgeRouter.prototype.cleanupRoutingPoints = function (edge, routingPoints, updateHandles) { + var sourceAnchors = new DefaultAnchors(edge.source, edge.parent, "source"); + var targetAnchors = new DefaultAnchors(edge.target, edge.parent, "target"); + this.resetRoutingPointsOnReconnect(edge, routingPoints, updateHandles, sourceAnchors, targetAnchors); + }; + LinearEdgeRouter.prototype.resetRoutingPointsOnReconnect = function (edge, routingPoints, updateHandles, sourceAnchors, targetAnchors) { + if (routingPoints.length === 0 || edge.source instanceof model_1.SDanglingAnchor || edge.target instanceof model_1.SDanglingAnchor) { + var options = this.getOptions(edge); + var corners = this.calculateDefaultCorners(edge, sourceAnchors, targetAnchors, options); + routingPoints.splice.apply(routingPoints, [0, routingPoints.length].concat(corners)); + if (updateHandles) { + var maxPointIndex_1 = -2; + edge.children.forEach(function (child) { + if (child instanceof model_1.SRoutingHandle) { + if (child.kind === 'target') + child.pointIndex = routingPoints.length; + else if (child.kind === 'line' && child.pointIndex >= routingPoints.length) + edge.remove(child); + else + maxPointIndex_1 = Math.max(child.pointIndex, maxPointIndex_1); + } + }); + for (var i = maxPointIndex_1; i < routingPoints.length - 1; ++i) + this.addHandle(edge, 'manhattan-50%', 'volatile-routing-point', i); + } + return true; + } + return false; + }; + LinearEdgeRouter.prototype.applyReconnect = function (edge, newSourceId, newTargetId) { + var hasChanged = false; + if (newSourceId) { + var newSource = edge.root.index.getById(newSourceId); + if (newSource instanceof model_2.SConnectableElement) { + edge.sourceId = newSource.id; + hasChanged = true; + } + } + if (newTargetId) { + var newTarget = edge.root.index.getById(newTargetId); + if (newTarget instanceof model_2.SConnectableElement) { + edge.targetId = newTarget.id; + hasChanged = true; + } + } + if (hasChanged) { + // reset attached elements in index + edge.index.remove(edge); + edge.index.add(edge); + if (this.getSelfEdgeIndex(edge) > -1) { + edge.routingPoints = []; + this.cleanupRoutingPoints(edge, edge.routingPoints, true); + } + } + }; + LinearEdgeRouter.prototype.takeSnapshot = function (edge) { + return { + routingPoints: edge.routingPoints.slice(), + routingHandles: edge.children + .filter(function (child) { return child instanceof model_1.SRoutingHandle; }) + .map(function (child) { return child; }), + router: this, + source: edge.source, + target: edge.target + }; + }; + LinearEdgeRouter.prototype.applySnapshot = function (edge, snapshot) { + edge.routingPoints = snapshot.routingPoints; + edge.removeAll(function (child) { return child instanceof model_1.SRoutingHandle; }); + edge.routerKind = snapshot.router.kind; + snapshot.routingHandles.forEach(function (handle) { return edge.add(handle); }); + if (snapshot.source) + edge.sourceId = snapshot.source.id; + if (snapshot.target) + edge.targetId = snapshot.target.id; + // update index + edge.root.index.remove(edge); + edge.root.index.add(edge); + }; + LinearEdgeRouter.prototype.calculateDefaultCorners = function (edge, sourceAnchors, targetAnchors, options) { + var selfEdgeIndex = this.getSelfEdgeIndex(edge); + if (selfEdgeIndex >= 0) { + var standardDist = options.standardDistance; + var delta = options.selfEdgeOffset * Math.min(sourceAnchors.bounds.width, sourceAnchors.bounds.height); + switch (selfEdgeIndex % 4) { + case 0: + return [ + { x: sourceAnchors.get(Side.RIGHT).x + standardDist, y: sourceAnchors.get(Side.RIGHT).y + delta }, + { x: sourceAnchors.get(Side.RIGHT).x + standardDist, y: sourceAnchors.get(Side.BOTTOM).y + standardDist }, + { x: sourceAnchors.get(Side.BOTTOM).x + delta, y: sourceAnchors.get(Side.BOTTOM).y + standardDist }, + ]; + case 1: + return [ + { x: sourceAnchors.get(Side.BOTTOM).x - delta, y: sourceAnchors.get(Side.BOTTOM).y + standardDist }, + { x: sourceAnchors.get(Side.LEFT).x - standardDist, y: sourceAnchors.get(Side.BOTTOM).y + standardDist }, + { x: sourceAnchors.get(Side.LEFT).x - standardDist, y: sourceAnchors.get(Side.LEFT).y + delta }, + ]; + case 2: + return [ + { x: sourceAnchors.get(Side.LEFT).x - standardDist, y: sourceAnchors.get(Side.LEFT).y - delta }, + { x: sourceAnchors.get(Side.LEFT).x - standardDist, y: sourceAnchors.get(Side.TOP).y - standardDist }, + { x: sourceAnchors.get(Side.TOP).x - delta, y: sourceAnchors.get(Side.TOP).y - standardDist }, + ]; + case 3: + return [ + { x: sourceAnchors.get(Side.TOP).x + delta, y: sourceAnchors.get(Side.TOP).y - standardDist }, + { x: sourceAnchors.get(Side.RIGHT).x + standardDist, y: sourceAnchors.get(Side.TOP).y - standardDist }, + { x: sourceAnchors.get(Side.RIGHT).x + standardDist, y: sourceAnchors.get(Side.RIGHT).y - delta }, + ]; + } + } + return []; + }; + LinearEdgeRouter.prototype.getSelfEdgeIndex = function (edge) { + if (!edge.source || edge.source !== edge.target) + return -1; + return edge.source.outgoingEdges + .filter(function (otherEdge) { return otherEdge.target === edge.source; }) + .indexOf(edge); + }; + __decorate([ + inversify_1.inject(anchor_1.AnchorComputerRegistry), + __metadata("design:type", anchor_1.AnchorComputerRegistry) + ], LinearEdgeRouter.prototype, "anchorRegistry", void 0); + LinearEdgeRouter = __decorate([ + inversify_1.injectable() + ], LinearEdgeRouter); + return LinearEdgeRouter; +}()); +exports.LinearEdgeRouter = LinearEdgeRouter; +//# sourceMappingURL=linear-edge-router.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/routing/manhattan-anchors.js": +/*!************************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/routing/manhattan-anchors.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2019 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var anchor_1 = __webpack_require__(/*! ./anchor */ "./node_modules/sprotty/lib/features/routing/anchor.js"); +var manhattan_edge_router_1 = __webpack_require__(/*! ./manhattan-edge-router */ "./node_modules/sprotty/lib/features/routing/manhattan-edge-router.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var ManhattanRectangularAnchor = /** @class */ (function () { + function ManhattanRectangularAnchor() { + } + ManhattanRectangularAnchor_1 = ManhattanRectangularAnchor; + Object.defineProperty(ManhattanRectangularAnchor.prototype, "kind", { + get: function () { + return ManhattanRectangularAnchor_1.KIND; + }, + enumerable: true, + configurable: true + }); + ManhattanRectangularAnchor.prototype.getAnchor = function (connectable, refPoint, offset) { + var b = connectable.bounds; + if (b.width <= 0 || b.height <= 0) { + return b; + } + var bounds = { + x: b.x - offset, + y: b.y - offset, + width: b.width + 2 * offset, + height: b.height + 2 * offset + }; + if (!refPoint) + console.log('Oh my'); + if (refPoint.x >= bounds.x && bounds.x + bounds.width >= refPoint.x) { + if (refPoint.y < bounds.y + 0.5 * bounds.height) + return { x: refPoint.x, y: bounds.y }; + else + return { x: refPoint.x, y: bounds.y + bounds.height }; + } + if (refPoint.y >= bounds.y && bounds.y + bounds.height >= refPoint.y) { + if (refPoint.x < bounds.x + 0.5 * bounds.width) + return { x: bounds.x, y: refPoint.y }; + else + return { x: bounds.x + bounds.width, y: refPoint.y }; + } + return geometry_1.center(bounds); + }; + var ManhattanRectangularAnchor_1; + ManhattanRectangularAnchor.KIND = manhattan_edge_router_1.ManhattanEdgeRouter.KIND + ':' + anchor_1.RECTANGULAR_ANCHOR_KIND; + ManhattanRectangularAnchor = ManhattanRectangularAnchor_1 = __decorate([ + inversify_1.injectable() + ], ManhattanRectangularAnchor); + return ManhattanRectangularAnchor; +}()); +exports.ManhattanRectangularAnchor = ManhattanRectangularAnchor; +var ManhattanDiamondAnchor = /** @class */ (function () { + function ManhattanDiamondAnchor() { + } + ManhattanDiamondAnchor_1 = ManhattanDiamondAnchor; + Object.defineProperty(ManhattanDiamondAnchor.prototype, "kind", { + get: function () { + return ManhattanDiamondAnchor_1.KIND; + }, + enumerable: true, + configurable: true + }); + ManhattanDiamondAnchor.prototype.getAnchor = function (connectable, refPoint, offset) { + if (offset === void 0) { offset = 0; } + var b = connectable.bounds; + if (b.width <= 0 || b.height <= 0) { + return b; + } + var bounds = { + x: b.x - offset, + y: b.y - offset, + width: b.width + 2 * offset, + height: b.height + 2 * offset + }; + var c = geometry_1.center(bounds); + var outline = undefined; + var refLine = undefined; + if (refPoint.x >= bounds.x && refPoint.x <= bounds.x + bounds.width) { + if (bounds.x + 0.5 * bounds.width >= refPoint.x) { + refLine = new geometry_1.PointToPointLine(refPoint, { x: refPoint.x, y: c.y }); + if (refPoint.y < c.y) + outline = new geometry_1.PointToPointLine({ x: bounds.x, y: c.y }, { x: c.x, y: bounds.y }); + else + outline = new geometry_1.PointToPointLine({ x: bounds.x, y: c.y }, { x: c.x, y: bounds.y + bounds.height }); + } + else { + refLine = new geometry_1.PointToPointLine(refPoint, { x: refPoint.x, y: c.y }); + if (refPoint.y < c.y) + outline = new geometry_1.PointToPointLine({ x: bounds.x + bounds.width, y: c.y }, { x: c.x, y: bounds.y }); + else + outline = new geometry_1.PointToPointLine({ x: bounds.x + bounds.width, y: c.y }, { x: c.x, y: bounds.y + bounds.height }); + } + } + else if (refPoint.y >= bounds.y && refPoint.y <= bounds.y + bounds.height) { + if (bounds.y + 0.5 * bounds.height >= refPoint.y) { + refLine = new geometry_1.PointToPointLine(refPoint, { x: c.x, y: refPoint.y }); + if (refPoint.x < c.x) + outline = new geometry_1.PointToPointLine({ x: bounds.x, y: c.y }, { x: c.x, y: bounds.y }); + else + outline = new geometry_1.PointToPointLine({ x: bounds.x + bounds.width, y: c.y }, { x: c.x, y: bounds.y }); + } + else { + refLine = new geometry_1.PointToPointLine(refPoint, { x: c.x, y: refPoint.y }); + if (refPoint.x < c.x) + outline = new geometry_1.PointToPointLine({ x: bounds.x, y: c.y }, { x: c.x, y: bounds.y + bounds.height }); + else + outline = new geometry_1.PointToPointLine({ x: bounds.x + bounds.width, y: c.y }, { x: c.x, y: bounds.y + bounds.height }); + } + } + if (!!refLine && !!outline) + return geometry_1.intersection(outline, refLine); + else + return c; + }; + var ManhattanDiamondAnchor_1; + ManhattanDiamondAnchor.KIND = manhattan_edge_router_1.ManhattanEdgeRouter.KIND + ':' + anchor_1.DIAMOND_ANCHOR_KIND; + ManhattanDiamondAnchor = ManhattanDiamondAnchor_1 = __decorate([ + inversify_1.injectable() + ], ManhattanDiamondAnchor); + return ManhattanDiamondAnchor; +}()); +exports.ManhattanDiamondAnchor = ManhattanDiamondAnchor; +var ManhattanEllipticAnchor = /** @class */ (function () { + function ManhattanEllipticAnchor() { + } + ManhattanEllipticAnchor_1 = ManhattanEllipticAnchor; + Object.defineProperty(ManhattanEllipticAnchor.prototype, "kind", { + get: function () { + return ManhattanEllipticAnchor_1.KIND; + }, + enumerable: true, + configurable: true + }); + ManhattanEllipticAnchor.prototype.getAnchor = function (connectable, refPoint, offset) { + if (offset === void 0) { offset = 0; } + var b = connectable.bounds; + if (b.width <= 0 || b.height <= 0) { + return b; + } + var bounds = { + x: b.x - offset, + y: b.y - offset, + width: b.width + 2 * offset, + height: b.height + 2 * offset + }; + var c = geometry_1.center(bounds); + var refRelative = geometry_1.subtract(refPoint, c); + var x = c.x; + var y = c.y; + if (refPoint.x >= bounds.x && bounds.x + bounds.width >= refPoint.x) { + x += refRelative.x; + var dy = 0.5 * bounds.height * Math.sqrt(1 - (refRelative.x * refRelative.x) / (0.25 * bounds.width * bounds.width)); + if (refRelative.y < 0) + y -= dy; + else + y += dy; + } + else if (refPoint.y >= bounds.y && bounds.y + bounds.height >= refPoint.y) { + y += refRelative.y; + var dx = 0.5 * bounds.width * Math.sqrt(1 - (refRelative.y * refRelative.y) / (0.25 * bounds.height * bounds.height)); + if (refRelative.x < 0) + x -= dx; + else + x += dx; + } + return { x: x, y: y }; + }; + var ManhattanEllipticAnchor_1; + ManhattanEllipticAnchor.KIND = manhattan_edge_router_1.ManhattanEdgeRouter.KIND + ':' + anchor_1.ELLIPTIC_ANCHOR_KIND; + ManhattanEllipticAnchor = ManhattanEllipticAnchor_1 = __decorate([ + inversify_1.injectable() + ], ManhattanEllipticAnchor); + return ManhattanEllipticAnchor; +}()); +exports.ManhattanEllipticAnchor = ManhattanEllipticAnchor; +//# sourceMappingURL=manhattan-anchors.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/routing/manhattan-edge-router.js": +/*!****************************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/routing/manhattan-edge-router.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2019 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var smodel_utils_1 = __webpack_require__(/*! ../../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var linear_edge_router_1 = __webpack_require__(/*! ./linear-edge-router */ "./node_modules/sprotty/lib/features/routing/linear-edge-router.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var ManhattanEdgeRouter = /** @class */ (function (_super) { + __extends(ManhattanEdgeRouter, _super); + function ManhattanEdgeRouter() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(ManhattanEdgeRouter.prototype, "kind", { + get: function () { + return ManhattanEdgeRouter.KIND; + }, + enumerable: true, + configurable: true + }); + ManhattanEdgeRouter.prototype.getOptions = function (edge) { + return { + standardDistance: 20, + minimalPointDistance: 3, + selfEdgeOffset: 0.25 + }; + }; + ManhattanEdgeRouter.prototype.route = function (edge) { + if (!edge.source || !edge.target) + return []; + var routedCorners = this.createRoutedCorners(edge); + var sourceRefPoint = routedCorners[0] + || smodel_utils_1.translatePoint(geometry_1.center(edge.target.bounds), edge.target.parent, edge.parent); + var sourceAnchor = this.getTranslatedAnchor(edge.source, sourceRefPoint, edge.parent, edge, edge.sourceAnchorCorrection); + var targetRefPoint = routedCorners[routedCorners.length - 1] + || smodel_utils_1.translatePoint(geometry_1.center(edge.source.bounds), edge.source.parent, edge.parent); + var targetAnchor = this.getTranslatedAnchor(edge.target, targetRefPoint, edge.parent, edge, edge.targetAnchorCorrection); + if (!sourceAnchor || !targetAnchor) + return []; + var routedPoints = []; + routedPoints.push(__assign({ kind: 'source' }, sourceAnchor)); + routedCorners.forEach(function (corner) { return routedPoints.push(corner); }); + routedPoints.push(__assign({ kind: 'target' }, targetAnchor)); + return routedPoints; + }; + ManhattanEdgeRouter.prototype.createRoutedCorners = function (edge) { + var sourceAnchors = new linear_edge_router_1.DefaultAnchors(edge.source, edge.parent, 'source'); + var targetAnchors = new linear_edge_router_1.DefaultAnchors(edge.target, edge.parent, 'target'); + if (edge.routingPoints.length > 0) { + var routingPointsCopy = edge.routingPoints.slice(); + this.cleanupRoutingPoints(edge, routingPointsCopy, false); + if (routingPointsCopy.length > 0) + return routingPointsCopy.map(function (routingPoint, index) { + return __assign({ kind: 'linear', pointIndex: index }, routingPoint); + }); + } + var options = this.getOptions(edge); + var corners = this.calculateDefaultCorners(edge, sourceAnchors, targetAnchors, options); + return corners.map(function (corner) { + return __assign({ kind: 'linear' }, corner); + }); + }; + ManhattanEdgeRouter.prototype.createRoutingHandles = function (edge) { + var routedPoints = this.route(edge); + this.commitRoute(edge, routedPoints); + if (routedPoints.length > 0) { + this.addHandle(edge, 'source', 'routing-point', -2); + for (var i = 0; i < routedPoints.length - 1; ++i) + this.addHandle(edge, 'manhattan-50%', 'volatile-routing-point', i - 1); + this.addHandle(edge, 'target', 'routing-point', routedPoints.length - 1); + } + }; + ManhattanEdgeRouter.prototype.getInnerHandlePosition = function (edge, route, handle) { + var fraction = this.getFraction(handle.kind); + if (fraction !== undefined) { + var _a = this.findRouteSegment(edge, route, handle.pointIndex), start = _a.start, end = _a.end; + if (start !== undefined && end !== undefined) + return geometry_1.linear(start, end, fraction); + } + return undefined; + }; + ManhattanEdgeRouter.prototype.getFraction = function (kind) { + switch (kind) { + case 'manhattan-50%': return 0.5; + default: return undefined; + } + }; + ManhattanEdgeRouter.prototype.commitRoute = function (edge, routedPoints) { + var newRoutingPoints = []; + for (var i = 1; i < routedPoints.length - 1; ++i) + newRoutingPoints.push({ x: routedPoints[i].x, y: routedPoints[i].y }); + edge.routingPoints = newRoutingPoints; + }; + ManhattanEdgeRouter.prototype.applyInnerHandleMoves = function (edge, moves) { + var _this = this; + var route = this.route(edge); + var routingPoints = edge.routingPoints; + var minimalPointDistance = this.getOptions(edge).minimalPointDistance; + moves.forEach(function (move) { + var handle = move.handle; + var index = handle.pointIndex; + var correctedX = _this.correctX(routingPoints, index, move.toPosition.x, minimalPointDistance); + var correctedY = _this.correctY(routingPoints, index, move.toPosition.y, minimalPointDistance); + switch (handle.kind) { + case 'manhattan-50%': + if (index < 0) { + if (geometry_1.almostEquals(route[0].x, route[1].x)) + _this.alignX(routingPoints, 0, correctedX); + else + _this.alignY(routingPoints, 0, correctedY); + } + else if (index < routingPoints.length - 1) { + if (geometry_1.almostEquals(routingPoints[index].x, routingPoints[index + 1].x)) { + _this.alignX(routingPoints, index, correctedX); + _this.alignX(routingPoints, index + 1, correctedX); + } + else { + _this.alignY(routingPoints, index, correctedY); + _this.alignY(routingPoints, index + 1, correctedY); + } + } + else { + if (geometry_1.almostEquals(route[route.length - 2].x, route[route.length - 1].x)) + _this.alignX(routingPoints, routingPoints.length - 1, correctedX); + else + _this.alignY(routingPoints, routingPoints.length - 1, correctedY); + } + break; + } + }); + }; + ManhattanEdgeRouter.prototype.correctX = function (routingPoints, index, x, minimalPointDistance) { + if (index > 0 && Math.abs(x - routingPoints[index - 1].x) < minimalPointDistance) + return routingPoints[index - 1].x; + else if (index < routingPoints.length - 2 && Math.abs(x - routingPoints[index + 2].x) < minimalPointDistance) + return routingPoints[index + 2].x; + else + return x; + }; + ManhattanEdgeRouter.prototype.alignX = function (routingPoints, index, x) { + routingPoints[index] = { + x: x, + y: routingPoints[index].y + }; + }; + ManhattanEdgeRouter.prototype.correctY = function (routingPoints, index, y, minimalPointDistance) { + if (index > 0 && Math.abs(y - routingPoints[index - 1].y) < minimalPointDistance) + return routingPoints[index - 1].y; + else if (index < routingPoints.length - 2 && Math.abs(y - routingPoints[index + 2].y) < minimalPointDistance) + return routingPoints[index + 2].y; + else + return y; + }; + ManhattanEdgeRouter.prototype.alignY = function (routingPoints, index, y) { + routingPoints[index] = { + x: routingPoints[index].x, + y: y + }; + }; + ManhattanEdgeRouter.prototype.cleanupRoutingPoints = function (edge, routingPoints, updateHandles) { + var sourceAnchors = new linear_edge_router_1.DefaultAnchors(edge.source, edge.parent, "source"); + var targetAnchors = new linear_edge_router_1.DefaultAnchors(edge.target, edge.parent, "target"); + if (this.resetRoutingPointsOnReconnect(edge, routingPoints, updateHandles, sourceAnchors, targetAnchors)) + return; + var _loop_1 = function (i) { + if (geometry_1.includes(sourceAnchors.bounds, routingPoints[i])) { + routingPoints.splice(0, 1); + if (updateHandles) { + edge.children.forEach(function (child) { + if (child instanceof model_1.SRoutingHandle) { + if (child.pointIndex >= i) + --child.pointIndex; + else if (child.pointIndex === i - 1) + edge.remove(child); + } + }); + } + } + else { + return "break"; + } + }; + // delete leading RPs inside the bounds of the source + for (var i = 0; i < routingPoints.length; ++i) { + var state_1 = _loop_1(i); + if (state_1 === "break") + break; + } + var _loop_2 = function (i) { + if (geometry_1.includes(targetAnchors.bounds, routingPoints[i])) { + routingPoints.splice(i, 1); + if (updateHandles) { + edge.children.forEach(function (child) { + if (child instanceof model_1.SRoutingHandle) { + if (child.pointIndex === i) + edge.remove(child); + } + }); + } + } + else { + return "break"; + } + }; + // delete trailing RPs inside the bounds of the target + for (var i = routingPoints.length - 1; i >= 0; --i) { + var state_2 = _loop_2(i); + if (state_2 === "break") + break; + } + if (!updateHandles) { + var options = this.getOptions(edge); + for (var i = routingPoints.length - 2; i >= 0; --i) { + if (geometry_1.manhattanDistance(routingPoints[i], routingPoints[i + 1]) < options.minimalPointDistance) { + routingPoints.splice(i, 2); + --i; + } + } + } + this.addAdditionalCorner(edge, routingPoints, sourceAnchors, updateHandles); + this.addAdditionalCorner(edge, routingPoints, targetAnchors, updateHandles); + }; + ManhattanEdgeRouter.prototype.addAdditionalCorner = function (edge, routingPoints, defaultAnchors, updateHandles) { + if (routingPoints.length === 0) + return; + var refPoint = defaultAnchors.kind === 'source' ? routingPoints[0] : routingPoints[routingPoints.length - 1]; + var index = defaultAnchors.kind === 'source' ? 0 : routingPoints.length; + var shiftIndex = index - (defaultAnchors.kind === 'source' ? 1 : 0); + var isHorizontal; + if (routingPoints.length > 1) { + isHorizontal = index === 0 + ? geometry_1.almostEquals(routingPoints[0].x, routingPoints[1].x) + : geometry_1.almostEquals(routingPoints[routingPoints.length - 1].x, routingPoints[routingPoints.length - 2].x); + } + else { + var nearestSide = defaultAnchors.getNearestSide(refPoint); + isHorizontal = nearestSide === linear_edge_router_1.Side.LEFT || nearestSide === linear_edge_router_1.Side.RIGHT; + } + if (isHorizontal) { + if (refPoint.y < defaultAnchors.get(linear_edge_router_1.Side.TOP).y || refPoint.y > defaultAnchors.get(linear_edge_router_1.Side.BOTTOM).y) { + var newPoint = { x: defaultAnchors.get(linear_edge_router_1.Side.TOP).x, y: refPoint.y }; + routingPoints.splice(index, 0, newPoint); + if (updateHandles) { + edge.children.forEach(function (child) { + if (child instanceof model_1.SRoutingHandle && child.pointIndex >= shiftIndex) + ++child.pointIndex; + }); + this.addHandle(edge, 'manhattan-50%', 'volatile-routing-point', shiftIndex); + } + } + } + else { + if (refPoint.x < defaultAnchors.get(linear_edge_router_1.Side.LEFT).x || refPoint.x > defaultAnchors.get(linear_edge_router_1.Side.RIGHT).x) { + var newPoint = { x: refPoint.x, y: defaultAnchors.get(linear_edge_router_1.Side.LEFT).y }; + routingPoints.splice(index, 0, newPoint); + if (updateHandles) { + edge.children.forEach(function (child) { + if (child instanceof model_1.SRoutingHandle && child.pointIndex >= shiftIndex) + ++child.pointIndex; + }); + this.addHandle(edge, 'manhattan-50%', 'volatile-routing-point', shiftIndex); + } + } + } + }; + ManhattanEdgeRouter.prototype.calculateDefaultCorners = function (edge, sourceAnchors, targetAnchors, options) { + var selfEdge = _super.prototype.calculateDefaultCorners.call(this, edge, sourceAnchors, targetAnchors, options); + if (selfEdge.length > 0) + return selfEdge; + var bestAnchors = this.getBestConnectionAnchors(edge, sourceAnchors, targetAnchors, options); + var sourceSide = bestAnchors.source; + var targetSide = bestAnchors.target; + var corners = []; + var startPoint = sourceAnchors.get(sourceSide); + var endPoint = targetAnchors.get(targetSide); + switch (sourceSide) { + case linear_edge_router_1.Side.RIGHT: + switch (targetSide) { + case linear_edge_router_1.Side.BOTTOM: + corners.push({ x: endPoint.x, y: startPoint.y }); + break; + case linear_edge_router_1.Side.TOP: + corners.push({ x: endPoint.x, y: startPoint.y }); + break; + case linear_edge_router_1.Side.RIGHT: + corners.push({ x: Math.max(startPoint.x, endPoint.x) + 1.5 * options.standardDistance, y: startPoint.y }); + corners.push({ x: Math.max(startPoint.x, endPoint.x) + 1.5 * options.standardDistance, y: endPoint.y }); + break; + case linear_edge_router_1.Side.LEFT: + if (endPoint.y !== startPoint.y) { + corners.push({ x: (startPoint.x + endPoint.x) / 2, y: startPoint.y }); + corners.push({ x: (startPoint.x + endPoint.x) / 2, y: endPoint.y }); + } + break; + } + break; + case linear_edge_router_1.Side.LEFT: + switch (targetSide) { + case linear_edge_router_1.Side.BOTTOM: + corners.push({ x: endPoint.x, y: startPoint.y }); + break; + case linear_edge_router_1.Side.TOP: + corners.push({ x: endPoint.x, y: startPoint.y }); + break; + default: + endPoint = targetAnchors.get(linear_edge_router_1.Side.RIGHT); + if (endPoint.y !== startPoint.y) { + corners.push({ x: (startPoint.x + endPoint.x) / 2, y: startPoint.y }); + corners.push({ x: (startPoint.x + endPoint.x) / 2, y: endPoint.y }); + } + break; + } + break; + case linear_edge_router_1.Side.TOP: + switch (targetSide) { + case linear_edge_router_1.Side.RIGHT: + if ((endPoint.x - startPoint.x) > 0) { + corners.push({ x: startPoint.x, y: startPoint.y - options.standardDistance }); + corners.push({ x: endPoint.x + 1.5 * options.standardDistance, y: startPoint.y - options.standardDistance }); + corners.push({ x: endPoint.x + 1.5 * options.standardDistance, y: endPoint.y }); + } + else { + corners.push({ x: startPoint.x, y: endPoint.y }); + } + break; + case linear_edge_router_1.Side.LEFT: + if ((endPoint.x - startPoint.x) < 0) { + corners.push({ x: startPoint.x, y: startPoint.y - options.standardDistance }); + corners.push({ x: endPoint.x - 1.5 * options.standardDistance, y: startPoint.y - options.standardDistance }); + corners.push({ x: endPoint.x - 1.5 * options.standardDistance, y: endPoint.y }); + } + else { + corners.push({ x: startPoint.x, y: endPoint.y }); + } + break; + case linear_edge_router_1.Side.TOP: + corners.push({ x: startPoint.x, y: Math.min(startPoint.y, endPoint.y) - 1.5 * options.standardDistance }); + corners.push({ x: endPoint.x, y: Math.min(startPoint.y, endPoint.y) - 1.5 * options.standardDistance }); + break; + case linear_edge_router_1.Side.BOTTOM: + if (endPoint.x !== startPoint.x) { + corners.push({ x: startPoint.x, y: (startPoint.y + endPoint.y) / 2 }); + corners.push({ x: endPoint.x, y: (startPoint.y + endPoint.y) / 2 }); + } + break; + } + break; + case linear_edge_router_1.Side.BOTTOM: + switch (targetSide) { + case linear_edge_router_1.Side.RIGHT: + if ((endPoint.x - startPoint.x) > 0) { + corners.push({ x: startPoint.x, y: startPoint.y + options.standardDistance }); + corners.push({ x: endPoint.x + 1.5 * options.standardDistance, y: startPoint.y + options.standardDistance }); + corners.push({ x: endPoint.x + 1.5 * options.standardDistance, y: endPoint.y }); + } + else { + corners.push({ x: startPoint.x, y: endPoint.y }); + } + break; + case linear_edge_router_1.Side.LEFT: + if ((endPoint.x - startPoint.x) < 0) { + corners.push({ x: startPoint.x, y: startPoint.y + options.standardDistance }); + corners.push({ x: endPoint.x - 1.5 * options.standardDistance, y: startPoint.y + options.standardDistance }); + corners.push({ x: endPoint.x - 1.5 * options.standardDistance, y: endPoint.y }); + } + else { + corners.push({ x: startPoint.x, y: endPoint.y }); + } + break; + default: + endPoint = targetAnchors.get(linear_edge_router_1.Side.TOP); + if (endPoint.x !== startPoint.x) { + corners.push({ x: startPoint.x, y: (startPoint.y + endPoint.y) / 2 }); + corners.push({ x: endPoint.x, y: (startPoint.y + endPoint.y) / 2 }); + } + break; + } + break; + } + return corners; + }; + ManhattanEdgeRouter.prototype.getBestConnectionAnchors = function (edge, sourceAnchors, targetAnchors, options) { + // distance is enough + var sourcePoint = sourceAnchors.get(linear_edge_router_1.Side.RIGHT); + var targetPoint = targetAnchors.get(linear_edge_router_1.Side.LEFT); + if ((targetPoint.x - sourcePoint.x) > options.standardDistance) + return { source: linear_edge_router_1.Side.RIGHT, target: linear_edge_router_1.Side.LEFT }; + sourcePoint = sourceAnchors.get(linear_edge_router_1.Side.LEFT); + targetPoint = targetAnchors.get(linear_edge_router_1.Side.RIGHT); + if ((sourcePoint.x - targetPoint.x) > options.standardDistance) + return { source: linear_edge_router_1.Side.LEFT, target: linear_edge_router_1.Side.RIGHT }; + sourcePoint = sourceAnchors.get(linear_edge_router_1.Side.TOP); + targetPoint = targetAnchors.get(linear_edge_router_1.Side.BOTTOM); + if ((sourcePoint.y - targetPoint.y) > options.standardDistance) + return { source: linear_edge_router_1.Side.TOP, target: linear_edge_router_1.Side.BOTTOM }; + sourcePoint = sourceAnchors.get(linear_edge_router_1.Side.BOTTOM); + targetPoint = targetAnchors.get(linear_edge_router_1.Side.TOP); + if ((targetPoint.y - sourcePoint.y) > options.standardDistance) + return { source: linear_edge_router_1.Side.BOTTOM, target: linear_edge_router_1.Side.TOP }; + // One additional point + sourcePoint = sourceAnchors.get(linear_edge_router_1.Side.RIGHT); + targetPoint = targetAnchors.get(linear_edge_router_1.Side.TOP); + if (((targetPoint.x - sourcePoint.x) > 0.5 * options.standardDistance) && ((targetPoint.y - sourcePoint.y) > options.standardDistance)) + return { source: linear_edge_router_1.Side.RIGHT, target: linear_edge_router_1.Side.TOP }; + targetPoint = targetAnchors.get(linear_edge_router_1.Side.BOTTOM); + if (((targetPoint.x - sourcePoint.x) > 0.5 * options.standardDistance) && ((sourcePoint.y - targetPoint.y) > options.standardDistance)) + return { source: linear_edge_router_1.Side.RIGHT, target: linear_edge_router_1.Side.BOTTOM }; + sourcePoint = sourceAnchors.get(linear_edge_router_1.Side.LEFT); + targetPoint = targetAnchors.get(linear_edge_router_1.Side.BOTTOM); + if (((sourcePoint.x - targetPoint.x) > 0.5 * options.standardDistance) && ((sourcePoint.y - targetPoint.y) > options.standardDistance)) + return { source: linear_edge_router_1.Side.LEFT, target: linear_edge_router_1.Side.BOTTOM }; + targetPoint = targetAnchors.get(linear_edge_router_1.Side.TOP); + if (((sourcePoint.x - targetPoint.x) > 0.5 * options.standardDistance) && ((targetPoint.y - sourcePoint.y) > options.standardDistance)) + return { source: linear_edge_router_1.Side.LEFT, target: linear_edge_router_1.Side.TOP }; + sourcePoint = sourceAnchors.get(linear_edge_router_1.Side.TOP); + targetPoint = targetAnchors.get(linear_edge_router_1.Side.RIGHT); + if (((sourcePoint.y - targetPoint.y) > 0.5 * options.standardDistance) && ((sourcePoint.x - targetPoint.x) > options.standardDistance)) + return { source: linear_edge_router_1.Side.TOP, target: linear_edge_router_1.Side.RIGHT }; + targetPoint = targetAnchors.get(linear_edge_router_1.Side.LEFT); + if (((sourcePoint.y - targetPoint.y) > 0.5 * options.standardDistance) && ((targetPoint.x - sourcePoint.x) > options.standardDistance)) + return { source: linear_edge_router_1.Side.TOP, target: linear_edge_router_1.Side.LEFT }; + sourcePoint = sourceAnchors.get(linear_edge_router_1.Side.BOTTOM); + targetPoint = targetAnchors.get(linear_edge_router_1.Side.RIGHT); + if (((targetPoint.y - sourcePoint.y) > 0.5 * options.standardDistance) && ((sourcePoint.x - targetPoint.x) > options.standardDistance)) + return { source: linear_edge_router_1.Side.BOTTOM, target: linear_edge_router_1.Side.RIGHT }; + targetPoint = targetAnchors.get(linear_edge_router_1.Side.LEFT); + if (((targetPoint.y - sourcePoint.y) > 0.5 * options.standardDistance) && ((targetPoint.x - sourcePoint.x) > options.standardDistance)) + return { source: linear_edge_router_1.Side.BOTTOM, target: linear_edge_router_1.Side.LEFT }; + // Two points + // priority NN >> EE >> NE >> NW >> SE >> SW + sourcePoint = sourceAnchors.get(linear_edge_router_1.Side.TOP); + targetPoint = targetAnchors.get(linear_edge_router_1.Side.TOP); + if (!geometry_1.includes(targetAnchors.bounds, sourcePoint) && !geometry_1.includes(sourceAnchors.bounds, targetPoint)) { + if ((sourcePoint.y - targetPoint.y) < 0) { + if (Math.abs(sourcePoint.x - targetPoint.x) > ((sourceAnchors.bounds.width + options.standardDistance) / 2)) + return { source: linear_edge_router_1.Side.TOP, target: linear_edge_router_1.Side.TOP }; + } + else { + if (Math.abs(sourcePoint.x - targetPoint.x) > (targetAnchors.bounds.width / 2)) + return { source: linear_edge_router_1.Side.TOP, target: linear_edge_router_1.Side.TOP }; + } + } + sourcePoint = sourceAnchors.get(linear_edge_router_1.Side.RIGHT); + targetPoint = targetAnchors.get(linear_edge_router_1.Side.RIGHT); + if (!geometry_1.includes(targetAnchors.bounds, sourcePoint) && !geometry_1.includes(sourceAnchors.bounds, targetPoint)) { + if ((sourcePoint.x - targetPoint.x) > 0) { + if (Math.abs(sourcePoint.y - targetPoint.y) > ((sourceAnchors.bounds.height + options.standardDistance) / 2)) + return { source: linear_edge_router_1.Side.RIGHT, target: linear_edge_router_1.Side.RIGHT }; + } + else if (Math.abs(sourcePoint.y - targetPoint.y) > (targetAnchors.bounds.height / 2)) + return { source: linear_edge_router_1.Side.RIGHT, target: linear_edge_router_1.Side.RIGHT }; + } + // Secondly, judge NE NW is available + sourcePoint = sourceAnchors.get(linear_edge_router_1.Side.TOP); + targetPoint = targetAnchors.get(linear_edge_router_1.Side.RIGHT); + if (!geometry_1.includes(targetAnchors.bounds, sourcePoint) && !geometry_1.includes(sourceAnchors.bounds, targetPoint)) + return { source: linear_edge_router_1.Side.TOP, target: linear_edge_router_1.Side.RIGHT }; + targetPoint = targetAnchors.get(linear_edge_router_1.Side.LEFT); + if (!geometry_1.includes(targetAnchors.bounds, sourcePoint) && !geometry_1.includes(sourceAnchors.bounds, targetPoint)) + return { source: linear_edge_router_1.Side.TOP, target: linear_edge_router_1.Side.LEFT }; + // Finally, judge SE SW is available + sourcePoint = sourceAnchors.get(linear_edge_router_1.Side.BOTTOM); + targetPoint = targetAnchors.get(linear_edge_router_1.Side.RIGHT); + if (!geometry_1.includes(targetAnchors.bounds, sourcePoint) && !geometry_1.includes(sourceAnchors.bounds, targetPoint)) + return { source: linear_edge_router_1.Side.BOTTOM, target: linear_edge_router_1.Side.RIGHT }; + targetPoint = targetAnchors.get(linear_edge_router_1.Side.LEFT); + if (!geometry_1.includes(targetAnchors.bounds, sourcePoint) && !geometry_1.includes(sourceAnchors.bounds, targetPoint)) + return { source: linear_edge_router_1.Side.BOTTOM, target: linear_edge_router_1.Side.LEFT }; + // Only to return to the + return { source: linear_edge_router_1.Side.RIGHT, target: linear_edge_router_1.Side.BOTTOM }; + }; + ManhattanEdgeRouter.KIND = 'manhattan'; + return ManhattanEdgeRouter; +}(linear_edge_router_1.LinearEdgeRouter)); +exports.ManhattanEdgeRouter = ManhattanEdgeRouter; +//# sourceMappingURL=manhattan-edge-router.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/routing/model.js": +/*!************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/routing/model.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var model_1 = __webpack_require__(/*! ../bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var delete_1 = __webpack_require__(/*! ../edit/delete */ "./node_modules/sprotty/lib/features/edit/delete.js"); +var model_2 = __webpack_require__(/*! ../select/model */ "./node_modules/sprotty/lib/features/select/model.js"); +var model_3 = __webpack_require__(/*! ../hover/model */ "./node_modules/sprotty/lib/features/hover/model.js"); +var model_4 = __webpack_require__(/*! ../move/model */ "./node_modules/sprotty/lib/features/move/model.js"); +var SRoutableElement = /** @class */ (function (_super) { + __extends(SRoutableElement, _super); + function SRoutableElement() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.routingPoints = []; + return _this; + } + Object.defineProperty(SRoutableElement.prototype, "source", { + get: function () { + return this.index.getById(this.sourceId); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SRoutableElement.prototype, "target", { + get: function () { + return this.index.getById(this.targetId); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SRoutableElement.prototype, "bounds", { + get: function () { + // this should also work for splines, which have the convex hull property + return this.routingPoints.reduce(function (bounds, routingPoint) { return geometry_1.combine(bounds, { + x: routingPoint.x, + y: routingPoint.y, + width: 0, + height: 0 + }); }, geometry_1.EMPTY_BOUNDS); + }, + enumerable: true, + configurable: true + }); + return SRoutableElement; +}(smodel_1.SChildElement)); +exports.SRoutableElement = SRoutableElement; +exports.connectableFeature = Symbol('connectableFeature'); +function isConnectable(element) { + return element.hasFeature(exports.connectableFeature) && element.canConnect; +} +exports.isConnectable = isConnectable; +/** + * A connectable element is one that can have outgoing and incoming edges, i.e. it can be the source + * or target element of an edge. There are two kinds of connectable elements: nodes (`SNode`) and + * ports (`SPort`). A node represents a main entity, while a port is a connection point inside a node. + */ +var SConnectableElement = /** @class */ (function (_super) { + __extends(SConnectableElement, _super); + function SConnectableElement() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.strokeWidth = 0; + return _this; + } + Object.defineProperty(SConnectableElement.prototype, "incomingEdges", { + /** + * The incoming edges of this connectable element. They are resolved by the index, which must + * be an `SGraphIndex`. + */ + get: function () { + return this.index.getIncomingEdges(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SConnectableElement.prototype, "outgoingEdges", { + /** + * The outgoing edges of this connectable element. They are resolved by the index, which must + * be an `SGraphIndex`. + */ + get: function () { + return this.index.getOutgoingEdges(this); + }, + enumerable: true, + configurable: true + }); + SConnectableElement.prototype.canConnect = function (routable, role) { + return true; + }; + return SConnectableElement; +}(model_1.SShapeElement)); +exports.SConnectableElement = SConnectableElement; +var SRoutingHandle = /** @class */ (function (_super) { + __extends(SRoutingHandle, _super); + function SRoutingHandle() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** Whether the routing point is being dragged. */ + _this.editMode = false; + _this.hoverFeedback = false; + _this.selected = false; + return _this; + } + SRoutingHandle.prototype.hasFeature = function (feature) { + return feature === model_2.selectFeature || feature === model_4.moveFeature || feature === model_3.hoverFeedbackFeature; + }; + return SRoutingHandle; +}(smodel_1.SChildElement)); +exports.SRoutingHandle = SRoutingHandle; +var SDanglingAnchor = /** @class */ (function (_super) { + __extends(SDanglingAnchor, _super); + function SDanglingAnchor() { + var _this = _super.call(this) || this; + _this.type = 'dangling-anchor'; + _this.size = { width: 0, height: 0 }; + return _this; + } + SDanglingAnchor.prototype.hasFeature = function (feature) { + return feature === delete_1.deletableFeature; + }; + return SDanglingAnchor; +}(SConnectableElement)); +exports.SDanglingAnchor = SDanglingAnchor; +exports.edgeInProgressID = 'edge-in-progress'; +exports.edgeInProgressTargetHandleID = exports.edgeInProgressID + '-target-anchor'; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/routing/polyline-anchors.js": +/*!***********************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/routing/polyline-anchors.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2019 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var anchor_1 = __webpack_require__(/*! ./anchor */ "./node_modules/sprotty/lib/features/routing/anchor.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var polyline_edge_router_1 = __webpack_require__(/*! ./polyline-edge-router */ "./node_modules/sprotty/lib/features/routing/polyline-edge-router.js"); +var EllipseAnchor = /** @class */ (function () { + function EllipseAnchor() { + } + Object.defineProperty(EllipseAnchor.prototype, "kind", { + get: function () { + return polyline_edge_router_1.PolylineEdgeRouter.KIND + ':' + anchor_1.ELLIPTIC_ANCHOR_KIND; + }, + enumerable: true, + configurable: true + }); + EllipseAnchor.prototype.getAnchor = function (connectable, refPoint, offset) { + if (offset === void 0) { offset = 0; } + var bounds = connectable.bounds; + var c = geometry_1.center(bounds); + var dx = c.x - refPoint.x; + var dy = c.y - refPoint.y; + var distance = Math.sqrt(dx * dx + dy * dy); + var normX = (dx / distance) || 0; + var normY = (dy / distance) || 0; + return { + x: c.x - normX * (0.5 * bounds.width + offset), + y: c.y - normY * (0.5 * bounds.height + offset) + }; + }; + EllipseAnchor = __decorate([ + inversify_1.injectable() + ], EllipseAnchor); + return EllipseAnchor; +}()); +exports.EllipseAnchor = EllipseAnchor; +var RectangleAnchor = /** @class */ (function () { + function RectangleAnchor() { + } + Object.defineProperty(RectangleAnchor.prototype, "kind", { + get: function () { + return polyline_edge_router_1.PolylineEdgeRouter.KIND + ':' + anchor_1.RECTANGULAR_ANCHOR_KIND; + }, + enumerable: true, + configurable: true + }); + RectangleAnchor.prototype.getAnchor = function (connectable, refPoint, offset) { + if (offset === void 0) { offset = 0; } + var bounds = connectable.bounds; + var c = geometry_1.center(bounds); + var finder = new NearestPointFinder(c, refPoint); + if (!geometry_1.almostEquals(c.y, refPoint.y)) { + var xTop = this.getXIntersection(bounds.y, c, refPoint); + if (xTop >= bounds.x && xTop <= bounds.x + bounds.width) + finder.addCandidate(xTop, bounds.y - offset); + var xBottom = this.getXIntersection(bounds.y + bounds.height, c, refPoint); + if (xBottom >= bounds.x && xBottom <= bounds.x + bounds.width) + finder.addCandidate(xBottom, bounds.y + bounds.height + offset); + } + if (!geometry_1.almostEquals(c.x, refPoint.x)) { + var yLeft = this.getYIntersection(bounds.x, c, refPoint); + if (yLeft >= bounds.y && yLeft <= bounds.y + bounds.height) + finder.addCandidate(bounds.x - offset, yLeft); + var yRight = this.getYIntersection(bounds.x + bounds.width, c, refPoint); + if (yRight >= bounds.y && yRight <= bounds.y + bounds.height) + finder.addCandidate(bounds.x + bounds.width + offset, yRight); + } + return finder.best; + }; + RectangleAnchor.prototype.getXIntersection = function (yIntersection, centerPoint, point) { + var t = (yIntersection - centerPoint.y) / (point.y - centerPoint.y); + return (point.x - centerPoint.x) * t + centerPoint.x; + }; + RectangleAnchor.prototype.getYIntersection = function (xIntersection, centerPoint, point) { + var t = (xIntersection - centerPoint.x) / (point.x - centerPoint.x); + return (point.y - centerPoint.y) * t + centerPoint.y; + }; + RectangleAnchor = __decorate([ + inversify_1.injectable() + ], RectangleAnchor); + return RectangleAnchor; +}()); +exports.RectangleAnchor = RectangleAnchor; +var NearestPointFinder = /** @class */ (function () { + function NearestPointFinder(centerPoint, refPoint) { + this.centerPoint = centerPoint; + this.refPoint = refPoint; + this.currentDist = -1; + } + NearestPointFinder.prototype.addCandidate = function (x, y) { + var dx = this.refPoint.x - x; + var dy = this.refPoint.y - y; + var dist = dx * dx + dy * dy; + if (this.currentDist < 0 || dist < this.currentDist) { + this.currentBest = { + x: x, + y: y + }; + this.currentDist = dist; + } + }; + Object.defineProperty(NearestPointFinder.prototype, "best", { + get: function () { + if (this.currentBest === undefined) + return this.centerPoint; + else + return this.currentBest; + }, + enumerable: true, + configurable: true + }); + return NearestPointFinder; +}()); +var DiamondAnchor = /** @class */ (function () { + function DiamondAnchor() { + } + Object.defineProperty(DiamondAnchor.prototype, "kind", { + get: function () { + return polyline_edge_router_1.PolylineEdgeRouter.KIND + ':' + anchor_1.DIAMOND_ANCHOR_KIND; + }, + enumerable: true, + configurable: true + }); + DiamondAnchor.prototype.getAnchor = function (connectable, refPoint, offset) { + var bounds = connectable.bounds; + var referenceLine = new geometry_1.PointToPointLine(geometry_1.center(bounds), refPoint); + var closestDiamondSide = new geometry_1.Diamond(bounds).closestSideLine(refPoint); + var anchorPoint = geometry_1.intersection(closestDiamondSide, referenceLine); + return geometry_1.shiftTowards(anchorPoint, refPoint, offset); + }; + DiamondAnchor = __decorate([ + inversify_1.injectable() + ], DiamondAnchor); + return DiamondAnchor; +}()); +exports.DiamondAnchor = DiamondAnchor; +//# sourceMappingURL=polyline-anchors.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/routing/polyline-edge-router.js": +/*!***************************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/routing/polyline-edge-router.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2019 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var anchor_1 = __webpack_require__(/*! ./anchor */ "./node_modules/sprotty/lib/features/routing/anchor.js"); +var linear_edge_router_1 = __webpack_require__(/*! ./linear-edge-router */ "./node_modules/sprotty/lib/features/routing/linear-edge-router.js"); +var PolylineEdgeRouter = /** @class */ (function (_super) { + __extends(PolylineEdgeRouter, _super); + function PolylineEdgeRouter() { + return _super !== null && _super.apply(this, arguments) || this; + } + PolylineEdgeRouter_1 = PolylineEdgeRouter; + Object.defineProperty(PolylineEdgeRouter.prototype, "kind", { + get: function () { + return PolylineEdgeRouter_1.KIND; + }, + enumerable: true, + configurable: true + }); + PolylineEdgeRouter.prototype.getOptions = function (edge) { + return { + minimalPointDistance: 2, + removeAngleThreshold: 0.1, + standardDistance: 20, + selfEdgeOffset: 0.25 + }; + }; + PolylineEdgeRouter.prototype.route = function (edge) { + var source = edge.source; + var target = edge.target; + if (source === undefined || target === undefined) { + return []; + } + var sourceAnchor; + var targetAnchor; + var options = this.getOptions(edge); + var routingPoints = edge.routingPoints.length > 0 + ? edge.routingPoints + : []; + this.cleanupRoutingPoints(edge, routingPoints, false); + var rpCount = routingPoints !== undefined ? routingPoints.length : 0; + if (rpCount === 0) { + // Use the target center as start anchor reference + var startRef = geometry_1.center(target.bounds); + sourceAnchor = this.getTranslatedAnchor(source, startRef, target.parent, edge, edge.sourceAnchorCorrection); + // Use the source center as end anchor reference + var endRef = geometry_1.center(source.bounds); + targetAnchor = this.getTranslatedAnchor(target, endRef, source.parent, edge, edge.targetAnchorCorrection); + } + else { + // Use the first routing point as start anchor reference + var p0 = routingPoints[0]; + sourceAnchor = this.getTranslatedAnchor(source, p0, edge.parent, edge, edge.sourceAnchorCorrection); + // Use the last routing point as end anchor reference + var pn = routingPoints[rpCount - 1]; + targetAnchor = this.getTranslatedAnchor(target, pn, edge.parent, edge, edge.targetAnchorCorrection); + } + var result = []; + result.push({ kind: 'source', x: sourceAnchor.x, y: sourceAnchor.y }); + for (var i = 0; i < rpCount; i++) { + var p = routingPoints[i]; + if (i > 0 && i < rpCount - 1 + || i === 0 && geometry_1.maxDistance(sourceAnchor, p) >= options.minimalPointDistance + (edge.sourceAnchorCorrection || 0) + || i === rpCount - 1 && geometry_1.maxDistance(p, targetAnchor) >= options.minimalPointDistance + (edge.targetAnchorCorrection || 0)) { + result.push({ kind: 'linear', x: p.x, y: p.y, pointIndex: i }); + } + } + result.push({ kind: 'target', x: targetAnchor.x, y: targetAnchor.y }); + return this.filterEditModeHandles(result, edge, options); + }; + /** + * Remove routed points that are in edit mode and for which the angle between the preceding and + * following points falls below a threshold. + */ + PolylineEdgeRouter.prototype.filterEditModeHandles = function (route, edge, options) { + if (edge.children.length === 0) + return route; + var i = 0; + var _loop_1 = function () { + var curr = route[i]; + if (curr.pointIndex !== undefined) { + var handle = edge.children.find(function (child) { + return child instanceof model_1.SRoutingHandle && child.kind === 'junction' && child.pointIndex === curr.pointIndex; + }); + if (handle !== undefined && handle.editMode && i > 0 && i < route.length - 1) { + var prev = route[i - 1], next = route[i + 1]; + var prevDiff = { x: prev.x - curr.x, y: prev.y - curr.y }; + var nextDiff = { x: next.x - curr.x, y: next.y - curr.y }; + var angle = geometry_1.angleBetweenPoints(prevDiff, nextDiff); + if (Math.abs(Math.PI - angle) < options.removeAngleThreshold) { + route.splice(i, 1); + return "continue"; + } + } + } + i++; + }; + while (i < route.length) { + _loop_1(); + } + return route; + }; + PolylineEdgeRouter.prototype.createRoutingHandles = function (edge) { + var rpCount = edge.routingPoints.length; + this.addHandle(edge, 'source', 'routing-point', -2); + this.addHandle(edge, 'line', 'volatile-routing-point', -1); + for (var i = 0; i < rpCount; i++) { + this.addHandle(edge, 'junction', 'routing-point', i); + this.addHandle(edge, 'line', 'volatile-routing-point', i); + } + this.addHandle(edge, 'target', 'routing-point', rpCount); + }; + PolylineEdgeRouter.prototype.getInnerHandlePosition = function (edge, route, handle) { + if (handle.kind === 'line') { + var _a = this.findRouteSegment(edge, route, handle.pointIndex), start = _a.start, end = _a.end; + if (start !== undefined && end !== undefined) + return geometry_1.centerOfLine(start, end); + } + return undefined; + }; + PolylineEdgeRouter.prototype.applyInnerHandleMoves = function (edge, moves) { + var _this = this; + moves.forEach(function (move) { + var handle = move.handle; + var points = edge.routingPoints; + var index = handle.pointIndex; + if (handle.kind === 'line') { + // Upgrade to a proper routing point + handle.kind = 'junction'; + handle.type = 'routing-point'; + points.splice(index + 1, 0, move.fromPosition || points[Math.max(index, 0)]); + edge.children.forEach(function (child) { + if (child instanceof model_1.SRoutingHandle && (child === handle || child.pointIndex > index)) + child.pointIndex++; + }); + _this.addHandle(edge, 'line', 'volatile-routing-point', index); + _this.addHandle(edge, 'line', 'volatile-routing-point', index + 1); + index++; + } + if (index >= 0 && index < points.length) { + points[index] = move.toPosition; + } + }); + }; + var PolylineEdgeRouter_1; + PolylineEdgeRouter.KIND = 'polyline'; + __decorate([ + inversify_1.inject(anchor_1.AnchorComputerRegistry), + __metadata("design:type", anchor_1.AnchorComputerRegistry) + ], PolylineEdgeRouter.prototype, "anchorRegistry", void 0); + PolylineEdgeRouter = PolylineEdgeRouter_1 = __decorate([ + inversify_1.injectable() + ], PolylineEdgeRouter); + return PolylineEdgeRouter; +}(linear_edge_router_1.LinearEdgeRouter)); +exports.PolylineEdgeRouter = PolylineEdgeRouter; +//# sourceMappingURL=polyline-edge-router.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/routing/routing.js": +/*!**************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/routing/routing.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var registry_1 = __webpack_require__(/*! ../../utils/registry */ "./node_modules/sprotty/lib/utils/registry.js"); +var polyline_edge_router_1 = __webpack_require__(/*! ./polyline-edge-router */ "./node_modules/sprotty/lib/features/routing/polyline-edge-router.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var EdgeRouterRegistry = /** @class */ (function (_super) { + __extends(EdgeRouterRegistry, _super); + function EdgeRouterRegistry(edgeRouters) { + var _this = _super.call(this) || this; + edgeRouters.forEach(function (router) { return _this.register(router.kind, router); }); + return _this; + } + Object.defineProperty(EdgeRouterRegistry.prototype, "defaultKind", { + get: function () { + return polyline_edge_router_1.PolylineEdgeRouter.KIND; + }, + enumerable: true, + configurable: true + }); + EdgeRouterRegistry.prototype.get = function (kind) { + return _super.prototype.get.call(this, kind || this.defaultKind); + }; + EdgeRouterRegistry = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.multiInject(types_1.TYPES.IEdgeRouter)), + __metadata("design:paramtypes", [Array]) + ], EdgeRouterRegistry); + return EdgeRouterRegistry; +}(registry_1.InstanceRegistry)); +exports.EdgeRouterRegistry = EdgeRouterRegistry; +//# sourceMappingURL=routing.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/select/di.config.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/select/di.config.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var select_1 = __webpack_require__(/*! ./select */ "./node_modules/sprotty/lib/features/select/select.js"); +var command_registration_1 = __webpack_require__(/*! ../../base/commands/command-registration */ "./node_modules/sprotty/lib/base/commands/command-registration.js"); +var selectModule = new inversify_1.ContainerModule(function (bind, _unbind, isBound) { + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, select_1.SelectCommand); + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, select_1.SelectAllCommand); + bind(types_1.TYPES.KeyListener).to(select_1.SelectKeyboardListener); + bind(types_1.TYPES.MouseListener).to(select_1.SelectMouseListener); +}); +exports.default = selectModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/select/model.js": +/*!***********************************************************!*\ + !*** ./node_modules/sprotty/lib/features/select/model.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.selectFeature = Symbol('selectFeature'); +function isSelectable(element) { + return element.hasFeature(exports.selectFeature); +} +exports.isSelectable = isSelectable; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/select/select.js": +/*!************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/select/select.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var command_1 = __webpack_require__(/*! ../../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var smodel_utils_1 = __webpack_require__(/*! ../../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var key_tool_1 = __webpack_require__(/*! ../../base/views/key-tool */ "./node_modules/sprotty/lib/base/views/key-tool.js"); +var mouse_tool_1 = __webpack_require__(/*! ../../base/views/mouse-tool */ "./node_modules/sprotty/lib/base/views/mouse-tool.js"); +var vnode_utils_1 = __webpack_require__(/*! ../../base/views/vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var browser_1 = __webpack_require__(/*! ../../utils/browser */ "./node_modules/sprotty/lib/utils/browser.js"); +var iterable_1 = __webpack_require__(/*! ../../utils/iterable */ "./node_modules/sprotty/lib/utils/iterable.js"); +var keyboard_1 = __webpack_require__(/*! ../../utils/keyboard */ "./node_modules/sprotty/lib/utils/keyboard.js"); +var button_handler_1 = __webpack_require__(/*! ../button/button-handler */ "./node_modules/sprotty/lib/features/button/button-handler.js"); +var model_1 = __webpack_require__(/*! ../button/model */ "./node_modules/sprotty/lib/features/button/model.js"); +var edit_routing_1 = __webpack_require__(/*! ../edit/edit-routing */ "./node_modules/sprotty/lib/features/edit/edit-routing.js"); +var model_2 = __webpack_require__(/*! ../routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var model_3 = __webpack_require__(/*! ../routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var model_4 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/select/model.js"); +/** + * Triggered when the user changes the selection, e.g. by clicking on a selectable element. The resulting + * SelectCommand changes the `selected` state accordingly, so the elements can be rendered differently. + * This action is also forwarded to the diagram server, if present, so it may react on the selection change. + * Furthermore, the server can send such an action to the client in order to change the selection programmatically. + */ +var SelectAction = /** @class */ (function () { + function SelectAction(selectedElementsIDs, deselectedElementsIDs) { + if (selectedElementsIDs === void 0) { selectedElementsIDs = []; } + if (deselectedElementsIDs === void 0) { deselectedElementsIDs = []; } + this.selectedElementsIDs = selectedElementsIDs; + this.deselectedElementsIDs = deselectedElementsIDs; + this.kind = SelectCommand.KIND; + } + return SelectAction; +}()); +exports.SelectAction = SelectAction; +/** + * Programmatic action for selecting or deselecting all elements. + */ +var SelectAllAction = /** @class */ (function () { + /** + * If `select` is true, all elements are selected, othewise they are deselected. + */ + function SelectAllAction(select) { + if (select === void 0) { select = true; } + this.select = select; + this.kind = SelectAllCommand.KIND; + } + return SelectAllAction; +}()); +exports.SelectAllAction = SelectAllAction; +var SelectCommand = /** @class */ (function (_super) { + __extends(SelectCommand, _super); + function SelectCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + _this.selected = []; + _this.deselected = []; + return _this; + } + SelectCommand.prototype.execute = function (context) { + var _this = this; + var model = context.root; + this.action.selectedElementsIDs.forEach(function (id) { + var element = model.index.getById(id); + if (element instanceof smodel_1.SChildElement && model_4.isSelectable(element)) { + _this.selected.push({ + element: element, + parent: element.parent, + index: element.parent.children.indexOf(element) + }); + } + }); + this.action.deselectedElementsIDs.forEach(function (id) { + var element = model.index.getById(id); + if (element instanceof smodel_1.SChildElement && model_4.isSelectable(element)) { + _this.deselected.push({ + element: element, + parent: element.parent, + index: element.parent.children.indexOf(element) + }); + } + }); + return this.redo(context); + }; + SelectCommand.prototype.undo = function (context) { + for (var i = this.selected.length - 1; i >= 0; --i) { + var selection = this.selected[i]; + var element = selection.element; + if (model_4.isSelectable(element)) + element.selected = false; + selection.parent.move(element, selection.index); + } + this.deselected.reverse().forEach(function (selection) { + if (model_4.isSelectable(selection.element)) + selection.element.selected = true; + }); + return context.root; + }; + SelectCommand.prototype.redo = function (context) { + for (var i = 0; i < this.selected.length; ++i) { + var selection = this.selected[i]; + var element = selection.element; + var childrenLength = selection.parent.children.length; + selection.parent.move(element, childrenLength - 1); + } + this.deselected.forEach(function (selection) { + if (model_4.isSelectable(selection.element)) + selection.element.selected = false; + }); + this.selected.forEach(function (selection) { + if (model_4.isSelectable(selection.element)) + selection.element.selected = true; + }); + return context.root; + }; + SelectCommand.KIND = 'elementSelected'; + SelectCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [SelectAction]) + ], SelectCommand); + return SelectCommand; +}(command_1.Command)); +exports.SelectCommand = SelectCommand; +var SelectAllCommand = /** @class */ (function (_super) { + __extends(SelectAllCommand, _super); + function SelectAllCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + _this.previousSelection = {}; + return _this; + } + SelectAllCommand.prototype.execute = function (context) { + this.selectAll(context.root, this.action.select); + return context.root; + }; + SelectAllCommand.prototype.selectAll = function (element, newState) { + if (model_4.isSelectable(element)) { + this.previousSelection[element.id] = element.selected; + element.selected = newState; + } + for (var _i = 0, _a = element.children; _i < _a.length; _i++) { + var child = _a[_i]; + this.selectAll(child, newState); + } + }; + SelectAllCommand.prototype.undo = function (context) { + var index = context.root.index; + for (var id in this.previousSelection) { + if (this.previousSelection.hasOwnProperty(id)) { + var element = index.getById(id); + if (element !== undefined && model_4.isSelectable(element)) + element.selected = this.previousSelection[id]; + } + } + return context.root; + }; + SelectAllCommand.prototype.redo = function (context) { + this.selectAll(context.root, this.action.select); + return context.root; + }; + SelectAllCommand.KIND = 'allSelected'; + SelectAllCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [SelectAllAction]) + ], SelectAllCommand); + return SelectAllCommand; +}(command_1.Command)); +exports.SelectAllCommand = SelectAllCommand; +var SelectMouseListener = /** @class */ (function (_super) { + __extends(SelectMouseListener, _super); + function SelectMouseListener() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.wasSelected = false; + _this.hasDragged = false; + return _this; + } + SelectMouseListener.prototype.mouseDown = function (target, event) { + var result = []; + if (event.button === 0) { + if (this.buttonHandlerRegistry !== undefined && target instanceof model_1.SButton && target.enabled) { + var buttonHandler = this.buttonHandlerRegistry.get(target.type); + if (buttonHandler !== undefined) + return buttonHandler.buttonPressed(target); + } + var selectableTarget_1 = smodel_utils_1.findParentByFeature(target, model_4.isSelectable); + if (selectableTarget_1 !== undefined || target instanceof smodel_1.SModelRoot) { + this.hasDragged = false; + var deselect = []; + // multi-selection? + if (!browser_1.isCtrlOrCmd(event)) { + deselect = iterable_1.toArray(target.root.index.all() + .filter(function (element) { return model_4.isSelectable(element) && element.selected + && !(selectableTarget_1 instanceof model_2.SRoutingHandle && element === selectableTarget_1.parent); })); + } + if (selectableTarget_1 !== undefined) { + if (!selectableTarget_1.selected) { + this.wasSelected = false; + result.push(new SelectAction([selectableTarget_1.id], deselect.map(function (e) { return e.id; }))); + var routableDeselect = deselect.filter(function (e) { return e instanceof model_3.SRoutableElement; }).map(function (e) { return e.id; }); + if (selectableTarget_1 instanceof model_3.SRoutableElement) + result.push(new edit_routing_1.SwitchEditModeAction([selectableTarget_1.id], routableDeselect)); + else if (routableDeselect.length > 0) + result.push(new edit_routing_1.SwitchEditModeAction([], routableDeselect)); + } + else if (browser_1.isCtrlOrCmd(event)) { + this.wasSelected = false; + result.push(new SelectAction([], [selectableTarget_1.id])); + if (selectableTarget_1 instanceof model_3.SRoutableElement) + result.push(new edit_routing_1.SwitchEditModeAction([], [selectableTarget_1.id])); + } + else { + this.wasSelected = true; + } + } + else { + result.push(new SelectAction([], deselect.map(function (e) { return e.id; }))); + var routableDeselect = deselect.filter(function (e) { return e instanceof model_3.SRoutableElement; }).map(function (e) { return e.id; }); + if (routableDeselect.length > 0) + result.push(new edit_routing_1.SwitchEditModeAction([], routableDeselect)); + } + } + } + return result; + }; + SelectMouseListener.prototype.mouseMove = function (target, event) { + this.hasDragged = true; + return []; + }; + SelectMouseListener.prototype.mouseUp = function (target, event) { + if (event.button === 0) { + if (!this.hasDragged) { + var selectableTarget = smodel_utils_1.findParentByFeature(target, model_4.isSelectable); + if (selectableTarget !== undefined && this.wasSelected) { + return [new SelectAction([selectableTarget.id], [])]; + } + } + } + this.hasDragged = false; + return []; + }; + SelectMouseListener.prototype.decorate = function (vnode, element) { + var selectableTarget = smodel_utils_1.findParentByFeature(element, model_4.isSelectable); + if (selectableTarget !== undefined) + vnode_utils_1.setClass(vnode, 'selected', selectableTarget.selected); + return vnode; + }; + __decorate([ + inversify_1.inject(button_handler_1.ButtonHandlerRegistry), inversify_1.optional(), + __metadata("design:type", button_handler_1.ButtonHandlerRegistry) + ], SelectMouseListener.prototype, "buttonHandlerRegistry", void 0); + return SelectMouseListener; +}(mouse_tool_1.MouseListener)); +exports.SelectMouseListener = SelectMouseListener; +var SelectKeyboardListener = /** @class */ (function (_super) { + __extends(SelectKeyboardListener, _super); + function SelectKeyboardListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + SelectKeyboardListener.prototype.keyDown = function (element, event) { + if (keyboard_1.matchesKeystroke(event, 'KeyA', 'ctrlCmd')) { + var selected = iterable_1.toArray(element.root.index.all().filter(function (e) { return model_4.isSelectable(e); }).map(function (e) { return e.id; })); + return [new SelectAction(selected, [])]; + } + return []; + }; + return SelectKeyboardListener; +}(key_tool_1.KeyListener)); +exports.SelectKeyboardListener = SelectKeyboardListener; +//# sourceMappingURL=select.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/undo-redo/di.config.js": +/*!******************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/undo-redo/di.config.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var undo_redo_1 = __webpack_require__(/*! ./undo-redo */ "./node_modules/sprotty/lib/features/undo-redo/undo-redo.js"); +var undoRedoModule = new inversify_1.ContainerModule(function (bind) { + bind(types_1.TYPES.KeyListener).to(undo_redo_1.UndoRedoKeyListener); +}); +exports.default = undoRedoModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/undo-redo/undo-redo.js": +/*!******************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/undo-redo/undo-redo.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var keyboard_1 = __webpack_require__(/*! ../../utils/keyboard */ "./node_modules/sprotty/lib/utils/keyboard.js"); +var key_tool_1 = __webpack_require__(/*! ../../base/views/key-tool */ "./node_modules/sprotty/lib/base/views/key-tool.js"); +var UndoAction = /** @class */ (function () { + function UndoAction() { + this.kind = UndoAction.KIND; + } + UndoAction.KIND = 'undo'; + return UndoAction; +}()); +exports.UndoAction = UndoAction; +var RedoAction = /** @class */ (function () { + function RedoAction() { + this.kind = RedoAction.KIND; + } + RedoAction.KIND = 'redo'; + return RedoAction; +}()); +exports.RedoAction = RedoAction; +var UndoRedoKeyListener = /** @class */ (function (_super) { + __extends(UndoRedoKeyListener, _super); + function UndoRedoKeyListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + UndoRedoKeyListener.prototype.keyDown = function (element, event) { + if (keyboard_1.matchesKeystroke(event, 'KeyZ', 'ctrlCmd')) + return [new UndoAction]; + if (keyboard_1.matchesKeystroke(event, 'KeyZ', 'ctrlCmd', 'shift')) + return [new RedoAction]; + return []; + }; + return UndoRedoKeyListener; +}(key_tool_1.KeyListener)); +exports.UndoRedoKeyListener = UndoRedoKeyListener; +//# sourceMappingURL=undo-redo.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/update/di.config.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/update/di.config.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2019 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var command_registration_1 = __webpack_require__(/*! ../../base/commands/command-registration */ "./node_modules/sprotty/lib/base/commands/command-registration.js"); +var update_model_1 = __webpack_require__(/*! ./update-model */ "./node_modules/sprotty/lib/features/update/update-model.js"); +var updateModule = new inversify_1.ContainerModule(function (bind, _unbind, isBound) { + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, update_model_1.UpdateModelCommand); +}); +exports.default = updateModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/update/model-matching.js": +/*!********************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/update/model-matching.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +function forEachMatch(matchResult, callback) { + for (var id in matchResult) { + if (matchResult.hasOwnProperty(id)) + callback(id, matchResult[id]); + } +} +exports.forEachMatch = forEachMatch; +var ModelMatcher = /** @class */ (function () { + function ModelMatcher() { + } + ModelMatcher.prototype.match = function (left, right) { + var result = {}; + this.matchLeft(left, result); + this.matchRight(right, result); + return result; + }; + ModelMatcher.prototype.matchLeft = function (element, result, parentId) { + var match = result[element.id]; + if (match !== undefined) { + match.left = element; + match.leftParentId = parentId; + } + else { + match = { + left: element, + leftParentId: parentId + }; + result[element.id] = match; + } + if (smodel_1.isParent(element)) { + for (var _i = 0, _a = element.children; _i < _a.length; _i++) { + var child = _a[_i]; + this.matchLeft(child, result, element.id); + } + } + }; + ModelMatcher.prototype.matchRight = function (element, result, parentId) { + var match = result[element.id]; + if (match !== undefined) { + match.right = element; + match.rightParentId = parentId; + } + else { + match = { + right: element, + rightParentId: parentId + }; + result[element.id] = match; + } + if (smodel_1.isParent(element)) { + for (var _i = 0, _a = element.children; _i < _a.length; _i++) { + var child = _a[_i]; + this.matchRight(child, result, element.id); + } + } + }; + return ModelMatcher; +}()); +exports.ModelMatcher = ModelMatcher; +function applyMatches(root, matches) { + var index; + if (root instanceof smodel_1.SModelRoot) { + index = root.index; + } + else { + index = new smodel_1.SModelIndex(); + index.add(root); + } + for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) { + var match = matches_1[_i]; + var newElementInserted = false; + if (match.left !== undefined && match.leftParentId !== undefined) { + var parent_1 = index.getById(match.leftParentId); + if (parent_1 !== undefined && parent_1.children !== undefined) { + var i = parent_1.children.indexOf(match.left); + if (i >= 0) { + if (match.right !== undefined && match.leftParentId === match.rightParentId) { + parent_1.children.splice(i, 1, match.right); + newElementInserted = true; + } + else { + parent_1.children.splice(i, 1); + } + } + index.remove(match.left); + } + } + if (!newElementInserted && match.right !== undefined && match.rightParentId !== undefined) { + var parent_2 = index.getById(match.rightParentId); + if (parent_2 !== undefined) { + if (parent_2.children === undefined) + parent_2.children = []; + parent_2.children.push(match.right); + } + } + } +} +exports.applyMatches = applyMatches; +//# sourceMappingURL=model-matching.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/update/update-model.js": +/*!******************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/update/update-model.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var animation_1 = __webpack_require__(/*! ../../base/animations/animation */ "./node_modules/sprotty/lib/base/animations/animation.js"); +var command_1 = __webpack_require__(/*! ../../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var fade_1 = __webpack_require__(/*! ../fade/fade */ "./node_modules/sprotty/lib/features/fade/fade.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var move_1 = __webpack_require__(/*! ../move/move */ "./node_modules/sprotty/lib/features/move/move.js"); +var model_1 = __webpack_require__(/*! ../fade/model */ "./node_modules/sprotty/lib/features/fade/model.js"); +var model_2 = __webpack_require__(/*! ../move/model */ "./node_modules/sprotty/lib/features/move/model.js"); +var model_3 = __webpack_require__(/*! ../bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var viewport_root_1 = __webpack_require__(/*! ../viewport/viewport-root */ "./node_modules/sprotty/lib/features/viewport/viewport-root.js"); +var model_4 = __webpack_require__(/*! ../select/model */ "./node_modules/sprotty/lib/features/select/model.js"); +var model_matching_1 = __webpack_require__(/*! ./model-matching */ "./node_modules/sprotty/lib/features/update/model-matching.js"); +var resize_1 = __webpack_require__(/*! ../bounds/resize */ "./node_modules/sprotty/lib/features/bounds/resize.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +/** + * Sent from the model source to the client in order to update the model. If no model is present yet, + * this behaves the same as a SetModelAction. The transition from the old model to the new one can be animated. + */ +var UpdateModelAction = /** @class */ (function () { + function UpdateModelAction(input, animate) { + if (animate === void 0) { animate = true; } + this.animate = animate; + this.kind = UpdateModelCommand.KIND; + if (input.id !== undefined) + this.newRoot = input; + else + this.matches = input; + } + return UpdateModelAction; +}()); +exports.UpdateModelAction = UpdateModelAction; +var UpdateModelCommand = /** @class */ (function (_super) { + __extends(UpdateModelCommand, _super); + function UpdateModelCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + return _this; + } + UpdateModelCommand.prototype.execute = function (context) { + var newRoot; + if (this.action.newRoot !== undefined) { + newRoot = context.modelFactory.createRoot(this.action.newRoot); + } + else { + newRoot = context.modelFactory.createRoot(context.root); + if (this.action.matches !== undefined) + this.applyMatches(newRoot, this.action.matches, context); + } + this.oldRoot = context.root; + this.newRoot = newRoot; + return this.performUpdate(this.oldRoot, this.newRoot, context); + }; + UpdateModelCommand.prototype.performUpdate = function (oldRoot, newRoot, context) { + if ((this.action.animate === undefined || this.action.animate) && oldRoot.id === newRoot.id) { + var matchResult = void 0; + if (this.action.matches === undefined) { + var matcher = new model_matching_1.ModelMatcher(); + matchResult = matcher.match(oldRoot, newRoot); + } + else { + matchResult = this.convertToMatchResult(this.action.matches, oldRoot, newRoot); + } + var animationOrRoot = this.computeAnimation(newRoot, matchResult, context); + if (animationOrRoot instanceof animation_1.Animation) + return animationOrRoot.start(); + else + return animationOrRoot; + } + else { + if (oldRoot.type === newRoot.type && geometry_1.isValidDimension(oldRoot.canvasBounds)) + newRoot.canvasBounds = oldRoot.canvasBounds; + return newRoot; + } + }; + UpdateModelCommand.prototype.applyMatches = function (root, matches, context) { + var index = root.index; + for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) { + var match = matches_1[_i]; + if (match.left !== undefined) { + var element = index.getById(match.left.id); + if (element instanceof smodel_1.SChildElement) + element.parent.remove(element); + } + if (match.right !== undefined) { + var element = context.modelFactory.createElement(match.right); + var parent_1 = void 0; + if (match.rightParentId !== undefined) + parent_1 = index.getById(match.rightParentId); + if (parent_1 instanceof smodel_1.SParentElement) + parent_1.add(element); + else + root.add(element); + } + } + }; + UpdateModelCommand.prototype.convertToMatchResult = function (matches, leftRoot, rightRoot) { + var result = {}; + for (var _i = 0, matches_2 = matches; _i < matches_2.length; _i++) { + var match = matches_2[_i]; + var converted = {}; + var id = undefined; + if (match.left !== undefined) { + id = match.left.id; + converted.left = leftRoot.index.getById(id); + converted.leftParentId = match.leftParentId; + } + if (match.right !== undefined) { + id = match.right.id; + converted.right = rightRoot.index.getById(id); + converted.rightParentId = match.rightParentId; + } + if (id !== undefined) + result[id] = converted; + } + return result; + }; + UpdateModelCommand.prototype.computeAnimation = function (newRoot, matchResult, context) { + var _this = this; + var animationData = { + fades: [] + }; + model_matching_1.forEachMatch(matchResult, function (id, match) { + if (match.left !== undefined && match.right !== undefined) { + // The element is still there, but may have been moved + _this.updateElement(match.left, match.right, animationData); + } + else if (match.right !== undefined) { + // An element has been added + var right = match.right; + if (model_1.isFadeable(right)) { + right.opacity = 0; + animationData.fades.push({ + element: right, + type: 'in' + }); + } + } + else if (match.left instanceof smodel_1.SChildElement) { + // An element has been removed + var left = match.left; + if (model_1.isFadeable(left) && match.leftParentId !== undefined) { + if (newRoot.index.getById(left.id) === undefined) { + var parent_2 = newRoot.index.getById(match.leftParentId); + if (parent_2 instanceof smodel_1.SParentElement) { + var leftCopy = context.modelFactory.createElement(left); + parent_2.add(leftCopy); + animationData.fades.push({ + element: leftCopy, + type: 'out' + }); + } + } + } + } + }); + var animations = this.createAnimations(animationData, newRoot, context); + if (animations.length >= 2) { + return new animation_1.CompoundAnimation(newRoot, context, animations); + } + else if (animations.length === 1) { + return animations[0]; + } + else { + return newRoot; + } + }; + UpdateModelCommand.prototype.updateElement = function (left, right, animationData) { + if (model_2.isLocateable(left) && model_2.isLocateable(right)) { + var leftPos = left.position; + var rightPos = right.position; + if (!geometry_1.almostEquals(leftPos.x, rightPos.x) || !geometry_1.almostEquals(leftPos.y, rightPos.y)) { + if (animationData.moves === undefined) + animationData.moves = []; + animationData.moves.push({ + element: right, + fromPosition: leftPos, + toPosition: rightPos + }); + right.position = leftPos; + } + } + if (model_3.isSizeable(left) && model_3.isSizeable(right)) { + if (!geometry_1.isValidDimension(right.bounds)) { + right.bounds = { + x: right.bounds.x, + y: right.bounds.y, + width: left.bounds.width, + height: left.bounds.height + }; + } + else if (!geometry_1.almostEquals(left.bounds.width, right.bounds.width) + || !geometry_1.almostEquals(left.bounds.height, right.bounds.height)) { + if (animationData.resizes === undefined) + animationData.resizes = []; + animationData.resizes.push({ + element: right, + fromDimension: { + width: left.bounds.width, + height: left.bounds.height, + }, + toDimension: { + width: right.bounds.width, + height: right.bounds.height, + } + }); + } + } + if (model_4.isSelectable(left) && model_4.isSelectable(right)) { + right.selected = left.selected; + } + if (left instanceof smodel_1.SModelRoot && right instanceof smodel_1.SModelRoot) { + right.canvasBounds = left.canvasBounds; + } + if (left instanceof viewport_root_1.ViewportRootElement && right instanceof viewport_root_1.ViewportRootElement) { + right.scroll = left.scroll; + right.zoom = left.zoom; + } + }; + UpdateModelCommand.prototype.createAnimations = function (data, root, context) { + var animations = []; + if (data.fades.length > 0) { + animations.push(new fade_1.FadeAnimation(root, data.fades, context, true)); + } + if (data.moves !== undefined && data.moves.length > 0) { + var movesMap = new Map; + for (var _i = 0, _a = data.moves; _i < _a.length; _i++) { + var move = _a[_i]; + movesMap.set(move.element.id, move); + } + animations.push(new move_1.MoveAnimation(root, movesMap, context, false)); + } + if (data.resizes !== undefined && data.resizes.length > 0) { + var resizesMap = new Map; + for (var _b = 0, _c = data.resizes; _b < _c.length; _b++) { + var resize = _c[_b]; + resizesMap.set(resize.element.id, resize); + } + animations.push(new resize_1.ResizeAnimation(root, resizesMap, context, false)); + } + return animations; + }; + UpdateModelCommand.prototype.undo = function (context) { + return this.performUpdate(this.newRoot, this.oldRoot, context); + }; + UpdateModelCommand.prototype.redo = function (context) { + return this.performUpdate(this.oldRoot, this.newRoot, context); + }; + UpdateModelCommand.KIND = 'updateModel'; + UpdateModelCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [UpdateModelAction]) + ], UpdateModelCommand); + return UpdateModelCommand; +}(command_1.Command)); +exports.UpdateModelCommand = UpdateModelCommand; +//# sourceMappingURL=update-model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/viewport/center-fit.js": +/*!******************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/viewport/center-fit.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var keyboard_1 = __webpack_require__(/*! ../../utils/keyboard */ "./node_modules/sprotty/lib/utils/keyboard.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var command_1 = __webpack_require__(/*! ../../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var key_tool_1 = __webpack_require__(/*! ../../base/views/key-tool */ "./node_modules/sprotty/lib/base/views/key-tool.js"); +var model_1 = __webpack_require__(/*! ../bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var model_2 = __webpack_require__(/*! ../select/model */ "./node_modules/sprotty/lib/features/select/model.js"); +var viewport_1 = __webpack_require__(/*! ./viewport */ "./node_modules/sprotty/lib/features/viewport/viewport.js"); +var model_3 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/viewport/model.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +/** + * Triggered when the user requests the viewer to center on the current model. The resulting + * CenterCommand changes the scroll setting of the viewport accordingly and resets the zoom to its default. + * This action can also be sent from the model source to the client in order to perform such a + * viewport change programmatically. + */ +var CenterAction = /** @class */ (function () { + function CenterAction(elementIds, animate) { + if (animate === void 0) { animate = true; } + this.elementIds = elementIds; + this.animate = animate; + this.kind = CenterCommand.KIND; + } + return CenterAction; +}()); +exports.CenterAction = CenterAction; +/** + * Triggered when the user requests the viewer to fit its content to the available drawing area. + * The resulting FitToScreenCommand changes the zoom and scroll settings of the viewport so the model + * can be shown completely. This action can also be sent from the model source to the client in order + * to perform such a viewport change programmatically. + */ +var FitToScreenAction = /** @class */ (function () { + function FitToScreenAction(elementIds, padding, maxZoom, animate) { + if (animate === void 0) { animate = true; } + this.elementIds = elementIds; + this.padding = padding; + this.maxZoom = maxZoom; + this.animate = animate; + this.kind = FitToScreenCommand.KIND; + } + return FitToScreenAction; +}()); +exports.FitToScreenAction = FitToScreenAction; +var BoundsAwareViewportCommand = /** @class */ (function (_super) { + __extends(BoundsAwareViewportCommand, _super); + function BoundsAwareViewportCommand(animate) { + var _this = _super.call(this) || this; + _this.animate = animate; + return _this; + } + BoundsAwareViewportCommand.prototype.initialize = function (model) { + var _this = this; + if (model_3.isViewport(model)) { + this.oldViewport = { + scroll: model.scroll, + zoom: model.zoom + }; + var allBounds_1 = []; + this.getElementIds().forEach(function (id) { + var element = model.index.getById(id); + if (element && model_1.isBoundsAware(element)) + allBounds_1.push(_this.boundsInViewport(element, element.bounds, model)); + }); + if (allBounds_1.length === 0) { + model.index.all().forEach(function (element) { + if (model_2.isSelectable(element) && element.selected && model_1.isBoundsAware(element)) + allBounds_1.push(_this.boundsInViewport(element, element.bounds, model)); + }); + } + if (allBounds_1.length === 0) { + model.index.all().forEach(function (element) { + if (model_1.isBoundsAware(element)) + allBounds_1.push(_this.boundsInViewport(element, element.bounds, model)); + }); + } + if (allBounds_1.length !== 0) { + var bounds = allBounds_1.reduce(function (b0, b1) { return geometry_1.combine(b0, b1); }); + if (geometry_1.isValidDimension(bounds)) + this.newViewport = this.getNewViewport(bounds, model); + } + } + }; + BoundsAwareViewportCommand.prototype.boundsInViewport = function (element, bounds, viewport) { + if (element instanceof smodel_1.SChildElement && element.parent !== viewport) + return this.boundsInViewport(element.parent, element.parent.localToParent(bounds), viewport); + else + return bounds; + }; + BoundsAwareViewportCommand.prototype.execute = function (context) { + this.initialize(context.root); + return this.redo(context); + }; + BoundsAwareViewportCommand.prototype.undo = function (context) { + var model = context.root; + if (model_3.isViewport(model) && this.newViewport !== undefined && !this.equal(this.newViewport, this.oldViewport)) { + if (this.animate) + return new viewport_1.ViewportAnimation(model, this.newViewport, this.oldViewport, context).start(); + else { + model.scroll = this.oldViewport.scroll; + model.zoom = this.oldViewport.zoom; + } + } + return model; + }; + BoundsAwareViewportCommand.prototype.redo = function (context) { + var model = context.root; + if (model_3.isViewport(model) && this.newViewport !== undefined && !this.equal(this.newViewport, this.oldViewport)) { + if (this.animate) { + return new viewport_1.ViewportAnimation(model, this.oldViewport, this.newViewport, context).start(); + } + else { + model.scroll = this.newViewport.scroll; + model.zoom = this.newViewport.zoom; + } + } + return model; + }; + BoundsAwareViewportCommand.prototype.equal = function (vp1, vp2) { + return vp1.zoom === vp2.zoom && vp1.scroll.x === vp2.scroll.x && vp1.scroll.y === vp2.scroll.y; + }; + BoundsAwareViewportCommand = __decorate([ + inversify_1.injectable(), + __metadata("design:paramtypes", [Boolean]) + ], BoundsAwareViewportCommand); + return BoundsAwareViewportCommand; +}(command_1.Command)); +exports.BoundsAwareViewportCommand = BoundsAwareViewportCommand; +var CenterCommand = /** @class */ (function (_super) { + __extends(CenterCommand, _super); + function CenterCommand(action) { + var _this = _super.call(this, action.animate) || this; + _this.action = action; + return _this; + } + CenterCommand.prototype.getElementIds = function () { + return this.action.elementIds; + }; + CenterCommand.prototype.getNewViewport = function (bounds, model) { + if (!geometry_1.isValidDimension(model.canvasBounds)) { + return undefined; + } + var c = geometry_1.center(bounds); + return { + scroll: { + x: c.x - 0.5 * model.canvasBounds.width, + y: c.y - 0.5 * model.canvasBounds.height + }, + zoom: 1 + }; + }; + CenterCommand.KIND = 'center'; + CenterCommand = __decorate([ + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [CenterAction]) + ], CenterCommand); + return CenterCommand; +}(BoundsAwareViewportCommand)); +exports.CenterCommand = CenterCommand; +var FitToScreenCommand = /** @class */ (function (_super) { + __extends(FitToScreenCommand, _super); + function FitToScreenCommand(action) { + var _this = _super.call(this, action.animate) || this; + _this.action = action; + return _this; + } + FitToScreenCommand.prototype.getElementIds = function () { + return this.action.elementIds; + }; + FitToScreenCommand.prototype.getNewViewport = function (bounds, model) { + if (!geometry_1.isValidDimension(model.canvasBounds)) { + return undefined; + } + var c = geometry_1.center(bounds); + var delta = this.action.padding === undefined + ? 0 + : 2 * this.action.padding; + var zoom = Math.min(model.canvasBounds.width / (bounds.width + delta), model.canvasBounds.height / (bounds.height + delta)); + if (this.action.maxZoom !== undefined) + zoom = Math.min(zoom, this.action.maxZoom); + return { + scroll: { + x: c.x - 0.5 * model.canvasBounds.width / zoom, + y: c.y - 0.5 * model.canvasBounds.height / zoom + }, + zoom: zoom + }; + }; + FitToScreenCommand.KIND = 'fit'; + FitToScreenCommand = __decorate([ + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [FitToScreenAction]) + ], FitToScreenCommand); + return FitToScreenCommand; +}(BoundsAwareViewportCommand)); +exports.FitToScreenCommand = FitToScreenCommand; +var CenterKeyboardListener = /** @class */ (function (_super) { + __extends(CenterKeyboardListener, _super); + function CenterKeyboardListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + CenterKeyboardListener.prototype.keyDown = function (element, event) { + if (keyboard_1.matchesKeystroke(event, 'KeyC', 'ctrlCmd', 'shift')) + return [new CenterAction([])]; + if (keyboard_1.matchesKeystroke(event, 'KeyF', 'ctrlCmd', 'shift')) + return [new FitToScreenAction([])]; + return []; + }; + return CenterKeyboardListener; +}(key_tool_1.KeyListener)); +exports.CenterKeyboardListener = CenterKeyboardListener; +//# sourceMappingURL=center-fit.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/viewport/di.config.js": +/*!*****************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/viewport/di.config.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var center_fit_1 = __webpack_require__(/*! ./center-fit */ "./node_modules/sprotty/lib/features/viewport/center-fit.js"); +var viewport_1 = __webpack_require__(/*! ./viewport */ "./node_modules/sprotty/lib/features/viewport/viewport.js"); +var scroll_1 = __webpack_require__(/*! ./scroll */ "./node_modules/sprotty/lib/features/viewport/scroll.js"); +var zoom_1 = __webpack_require__(/*! ./zoom */ "./node_modules/sprotty/lib/features/viewport/zoom.js"); +var command_registration_1 = __webpack_require__(/*! ../../base/commands/command-registration */ "./node_modules/sprotty/lib/base/commands/command-registration.js"); +var viewportModule = new inversify_1.ContainerModule(function (bind, _unbind, isBound) { + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, center_fit_1.CenterCommand); + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, center_fit_1.FitToScreenCommand); + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, viewport_1.ViewportCommand); + bind(types_1.TYPES.KeyListener).to(center_fit_1.CenterKeyboardListener); + bind(types_1.TYPES.MouseListener).to(scroll_1.ScrollMouseListener); + bind(types_1.TYPES.MouseListener).to(zoom_1.ZoomMouseListener); +}); +exports.default = viewportModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/viewport/model.js": +/*!*************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/viewport/model.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +exports.viewportFeature = Symbol('viewportFeature'); +function isViewport(element) { + return element instanceof smodel_1.SModelRoot + && element.hasFeature(exports.viewportFeature) + && 'zoom' in element + && 'scroll' in element; +} +exports.isViewport = isViewport; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/viewport/scroll.js": +/*!**************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/viewport/scroll.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var mouse_tool_1 = __webpack_require__(/*! ../../base/views/mouse-tool */ "./node_modules/sprotty/lib/base/views/mouse-tool.js"); +var smodel_utils_1 = __webpack_require__(/*! ../../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var viewport_1 = __webpack_require__(/*! ./viewport */ "./node_modules/sprotty/lib/features/viewport/viewport.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/viewport/model.js"); +var model_2 = __webpack_require__(/*! ../move/model */ "./node_modules/sprotty/lib/features/move/model.js"); +var model_3 = __webpack_require__(/*! ../routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +function isScrollable(element) { + return 'scroll' in element; +} +exports.isScrollable = isScrollable; +var ScrollMouseListener = /** @class */ (function (_super) { + __extends(ScrollMouseListener, _super); + function ScrollMouseListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + ScrollMouseListener.prototype.mouseDown = function (target, event) { + var moveable = smodel_utils_1.findParentByFeature(target, model_2.isMoveable); + if (moveable === undefined && !(target instanceof model_3.SRoutingHandle)) { + var viewport = smodel_utils_1.findParentByFeature(target, model_1.isViewport); + if (viewport) + this.lastScrollPosition = { x: event.pageX, y: event.pageY }; + else + this.lastScrollPosition = undefined; + } + return []; + }; + ScrollMouseListener.prototype.mouseMove = function (target, event) { + if (event.buttons === 0) + this.mouseUp(target, event); + else if (this.lastScrollPosition) { + var viewport = smodel_utils_1.findParentByFeature(target, model_1.isViewport); + if (viewport) { + var dx = (event.pageX - this.lastScrollPosition.x) / viewport.zoom; + var dy = (event.pageY - this.lastScrollPosition.y) / viewport.zoom; + var newViewport = { + scroll: { + x: viewport.scroll.x - dx, + y: viewport.scroll.y - dy, + }, + zoom: viewport.zoom + }; + this.lastScrollPosition = { x: event.pageX, y: event.pageY }; + return [new viewport_1.ViewportAction(viewport.id, newViewport, false)]; + } + } + return []; + }; + ScrollMouseListener.prototype.mouseEnter = function (target, event) { + if (target instanceof smodel_1.SModelRoot && event.buttons === 0) + this.mouseUp(target, event); + return []; + }; + ScrollMouseListener.prototype.mouseUp = function (target, event) { + this.lastScrollPosition = undefined; + return []; + }; + return ScrollMouseListener; +}(mouse_tool_1.MouseListener)); +exports.ScrollMouseListener = ScrollMouseListener; +//# sourceMappingURL=scroll.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/viewport/viewport-root.js": +/*!*********************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/viewport/viewport-root.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var geometry_1 = __webpack_require__(/*! ../../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var smodel_1 = __webpack_require__(/*! ../../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/viewport/model.js"); +var model_2 = __webpack_require__(/*! ../export/model */ "./node_modules/sprotty/lib/features/export/model.js"); +/** + * Model root element that defines a viewport, so it transforms the coordinate system with + * a `scroll` translation and a `zoom` scaling. + */ +var ViewportRootElement = /** @class */ (function (_super) { + __extends(ViewportRootElement, _super); + function ViewportRootElement(index) { + var _this = _super.call(this, index) || this; + _this.scroll = { x: 0, y: 0 }; + _this.zoom = 1; + _this.export = false; + return _this; + } + ViewportRootElement.prototype.hasFeature = function (feature) { + return feature === model_1.viewportFeature || feature === model_2.exportFeature; + }; + ViewportRootElement.prototype.localToParent = function (point) { + var result = { + x: (point.x - this.scroll.x) * this.zoom, + y: (point.y - this.scroll.y) * this.zoom, + width: -1, + height: -1 + }; + if (geometry_1.isBounds(point)) { + result.width = point.width * this.zoom; + result.height = point.height * this.zoom; + } + return result; + }; + ViewportRootElement.prototype.parentToLocal = function (point) { + var result = { + x: (point.x / this.zoom) + this.scroll.x, + y: (point.y / this.zoom) + this.scroll.y, + width: -1, + height: -1 + }; + if (geometry_1.isBounds(point) && geometry_1.isValidDimension(point)) { + result.width = point.width / this.zoom; + result.height = point.height / this.zoom; + } + return result; + }; + return ViewportRootElement; +}(smodel_1.SModelRoot)); +exports.ViewportRootElement = ViewportRootElement; +//# sourceMappingURL=viewport-root.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/viewport/viewport.js": +/*!****************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/viewport/viewport.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var command_1 = __webpack_require__(/*! ../../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var animation_1 = __webpack_require__(/*! ../../base/animations/animation */ "./node_modules/sprotty/lib/base/animations/animation.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/viewport/model.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var ViewportAction = /** @class */ (function () { + function ViewportAction(elementId, newViewport, animate) { + this.elementId = elementId; + this.newViewport = newViewport; + this.animate = animate; + this.kind = ViewportCommand.KIND; + } + return ViewportAction; +}()); +exports.ViewportAction = ViewportAction; +var ViewportCommand = /** @class */ (function (_super) { + __extends(ViewportCommand, _super); + function ViewportCommand(action) { + var _this = _super.call(this) || this; + _this.action = action; + _this.newViewport = action.newViewport; + return _this; + } + ViewportCommand_1 = ViewportCommand; + ViewportCommand.prototype.execute = function (context) { + var model = context.root; + var element = model.index.getById(this.action.elementId); + if (element && model_1.isViewport(element)) { + this.element = element; + this.oldViewport = { + scroll: this.element.scroll, + zoom: this.element.zoom, + }; + if (this.action.animate) + return new ViewportAnimation(this.element, this.oldViewport, this.newViewport, context).start(); + else { + this.element.scroll = this.newViewport.scroll; + this.element.zoom = this.newViewport.zoom; + } + } + return model; + }; + ViewportCommand.prototype.undo = function (context) { + return new ViewportAnimation(this.element, this.newViewport, this.oldViewport, context).start(); + }; + ViewportCommand.prototype.redo = function (context) { + return new ViewportAnimation(this.element, this.oldViewport, this.newViewport, context).start(); + }; + ViewportCommand.prototype.merge = function (command, context) { + if (!this.action.animate && command instanceof ViewportCommand_1 && this.element === command.element) { + this.newViewport = command.newViewport; + return true; + } + return false; + }; + var ViewportCommand_1; + ViewportCommand.KIND = 'viewport'; + ViewportCommand = ViewportCommand_1 = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [ViewportAction]) + ], ViewportCommand); + return ViewportCommand; +}(command_1.MergeableCommand)); +exports.ViewportCommand = ViewportCommand; +var ViewportAnimation = /** @class */ (function (_super) { + __extends(ViewportAnimation, _super); + function ViewportAnimation(element, oldViewport, newViewport, context) { + var _this = _super.call(this, context) || this; + _this.element = element; + _this.oldViewport = oldViewport; + _this.newViewport = newViewport; + _this.context = context; + _this.zoomFactor = Math.log(newViewport.zoom / oldViewport.zoom); + return _this; + } + ViewportAnimation.prototype.tween = function (t, context) { + this.element.scroll = { + x: (1 - t) * this.oldViewport.scroll.x + t * this.newViewport.scroll.x, + y: (1 - t) * this.oldViewport.scroll.y + t * this.newViewport.scroll.y + }; + this.element.zoom = this.oldViewport.zoom * Math.exp(t * this.zoomFactor); + return context.root; + }; + return ViewportAnimation; +}(animation_1.Animation)); +exports.ViewportAnimation = ViewportAnimation; +//# sourceMappingURL=viewport.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/features/viewport/zoom.js": +/*!************************************************************!*\ + !*** ./node_modules/sprotty/lib/features/viewport/zoom.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var mouse_tool_1 = __webpack_require__(/*! ../../base/views/mouse-tool */ "./node_modules/sprotty/lib/base/views/mouse-tool.js"); +var smodel_utils_1 = __webpack_require__(/*! ../../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var viewport_1 = __webpack_require__(/*! ./viewport */ "./node_modules/sprotty/lib/features/viewport/viewport.js"); +var model_1 = __webpack_require__(/*! ./model */ "./node_modules/sprotty/lib/features/viewport/model.js"); +function isZoomable(element) { + return 'zoom' in element; +} +exports.isZoomable = isZoomable; +var ZoomMouseListener = /** @class */ (function (_super) { + __extends(ZoomMouseListener, _super); + function ZoomMouseListener() { + return _super !== null && _super.apply(this, arguments) || this; + } + ZoomMouseListener.prototype.wheel = function (target, event) { + var viewport = smodel_utils_1.findParentByFeature(target, model_1.isViewport); + if (viewport) { + var newZoom = Math.exp(-event.deltaY * 0.005); + var factor = 1. / (newZoom * viewport.zoom) - 1. / viewport.zoom; + var newViewport = { + scroll: { + x: -(factor * event.offsetX - viewport.scroll.x), + y: -(factor * event.offsetY - viewport.scroll.y) + }, + zoom: viewport.zoom * newZoom + }; + return [new viewport_1.ViewportAction(viewport.id, newViewport, false)]; + } + return []; + }; + return ZoomMouseListener; +}(mouse_tool_1.MouseListener)); +exports.ZoomMouseListener = ZoomMouseListener; +//# sourceMappingURL=zoom.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/graph/di.config.js": +/*!*****************************************************!*\ + !*** ./node_modules/sprotty/lib/graph/di.config.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var sgraph_factory_1 = __webpack_require__(/*! ./sgraph-factory */ "./node_modules/sprotty/lib/graph/sgraph-factory.js"); +var graphModule = new inversify_1.ContainerModule(function (bind, unbind, isBound, rebind) { + rebind(types_1.TYPES.IModelFactory).to(sgraph_factory_1.SGraphFactory).inSingletonScope(); +}); +exports.default = graphModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/graph/sgraph-factory.js": +/*!**********************************************************!*\ + !*** ./node_modules/sprotty/lib/graph/sgraph-factory.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var smodel_factory_1 = __webpack_require__(/*! ../base/model/smodel-factory */ "./node_modules/sprotty/lib/base/model/smodel-factory.js"); +var smodel_1 = __webpack_require__(/*! ../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var smodel_utils_1 = __webpack_require__(/*! ../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var sgraph_1 = __webpack_require__(/*! ./sgraph */ "./node_modules/sprotty/lib/graph/sgraph.js"); +var model_1 = __webpack_require__(/*! ../features/button/model */ "./node_modules/sprotty/lib/features/button/model.js"); +var SGraphFactory = /** @class */ (function (_super) { + __extends(SGraphFactory, _super); + function SGraphFactory() { + return _super !== null && _super.apply(this, arguments) || this; + } + SGraphFactory.prototype.createElement = function (schema, parent) { + var child; + if (this.registry.hasKey(schema.type)) { + var regElement = this.registry.get(schema.type, undefined); + if (!(regElement instanceof smodel_1.SChildElement)) + throw new Error("Element with type " + schema.type + " was expected to be an SChildElement."); + child = regElement; + } + else if (this.isNodeSchema(schema)) { + child = new sgraph_1.SNode(); + } + else if (this.isPortSchema(schema)) { + child = new sgraph_1.SPort(); + } + else if (this.isEdgeSchema(schema)) { + child = new sgraph_1.SEdge(); + } + else if (this.isLabelSchema(schema)) { + child = new sgraph_1.SLabel(); + } + else if (this.isCompartmentSchema(schema)) { + child = new sgraph_1.SCompartment(); + } + else if (this.isButtonSchema(schema)) { + child = new model_1.SButton(); + } + else { + child = new smodel_1.SChildElement(); + } + return this.initializeChild(child, schema, parent); + }; + SGraphFactory.prototype.createRoot = function (schema) { + var root; + if (this.registry.hasKey(schema.type)) { + var regElement = this.registry.get(schema.type, undefined); + if (!(regElement instanceof smodel_1.SModelRoot)) + throw new Error("Element with type " + schema.type + " was expected to be an SModelRoot."); + root = regElement; + } + else if (this.isGraphSchema(schema)) { + root = new sgraph_1.SGraph(); + } + else { + root = new smodel_1.SModelRoot(); + } + return this.initializeRoot(root, schema); + }; + SGraphFactory.prototype.isGraphSchema = function (schema) { + return smodel_utils_1.getBasicType(schema) === 'graph'; + }; + SGraphFactory.prototype.isNodeSchema = function (schema) { + return smodel_utils_1.getBasicType(schema) === 'node'; + }; + SGraphFactory.prototype.isPortSchema = function (schema) { + return smodel_utils_1.getBasicType(schema) === 'port'; + }; + SGraphFactory.prototype.isEdgeSchema = function (schema) { + return smodel_utils_1.getBasicType(schema) === 'edge'; + }; + SGraphFactory.prototype.isLabelSchema = function (schema) { + return smodel_utils_1.getBasicType(schema) === 'label'; + }; + SGraphFactory.prototype.isCompartmentSchema = function (schema) { + return smodel_utils_1.getBasicType(schema) === 'comp'; + }; + SGraphFactory.prototype.isButtonSchema = function (schema) { + return smodel_utils_1.getBasicType(schema) === 'button'; + }; + SGraphFactory = __decorate([ + inversify_1.injectable() + ], SGraphFactory); + return SGraphFactory; +}(smodel_factory_1.SModelFactory)); +exports.SGraphFactory = SGraphFactory; +//# sourceMappingURL=sgraph-factory.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/graph/sgraph.js": +/*!**************************************************!*\ + !*** ./node_modules/sprotty/lib/graph/sgraph.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var smodel_1 = __webpack_require__(/*! ../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var model_1 = __webpack_require__(/*! ../features/bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var model_2 = __webpack_require__(/*! ../features/edge-layout/model */ "./node_modules/sprotty/lib/features/edge-layout/model.js"); +var delete_1 = __webpack_require__(/*! ../features/edit/delete */ "./node_modules/sprotty/lib/features/edit/delete.js"); +var model_3 = __webpack_require__(/*! ../features/edit/model */ "./node_modules/sprotty/lib/features/edit/model.js"); +var model_4 = __webpack_require__(/*! ../features/fade/model */ "./node_modules/sprotty/lib/features/fade/model.js"); +var model_5 = __webpack_require__(/*! ../features/hover/model */ "./node_modules/sprotty/lib/features/hover/model.js"); +var model_6 = __webpack_require__(/*! ../features/move/model */ "./node_modules/sprotty/lib/features/move/model.js"); +var model_7 = __webpack_require__(/*! ../features/routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var model_8 = __webpack_require__(/*! ../features/select/model */ "./node_modules/sprotty/lib/features/select/model.js"); +var viewport_root_1 = __webpack_require__(/*! ../features/viewport/viewport-root */ "./node_modules/sprotty/lib/features/viewport/viewport-root.js"); +var geometry_1 = __webpack_require__(/*! ../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var iterable_1 = __webpack_require__(/*! ../utils/iterable */ "./node_modules/sprotty/lib/utils/iterable.js"); +/** + * Root element for graph-like models. + */ +var SGraph = /** @class */ (function (_super) { + __extends(SGraph, _super); + function SGraph(index) { + if (index === void 0) { index = new SGraphIndex(); } + return _super.call(this, index) || this; + } + return SGraph; +}(viewport_root_1.ViewportRootElement)); +exports.SGraph = SGraph; +/** + * Model element class for nodes, which are the main entities in a graph. A node can be connected to + * another node via an SEdge. Such a connection can be direct, i.e. the node is the source or target of + * the edge, or indirect through a port, i.e. it contains an SPort which is the source or target of the edge. + */ +var SNode = /** @class */ (function (_super) { + __extends(SNode, _super); + function SNode() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.selected = false; + _this.hoverFeedback = false; + _this.opacity = 1; + return _this; + } + SNode.prototype.canConnect = function (routable, role) { + return this.children.find(function (c) { return c instanceof SPort; }) === undefined; + }; + SNode.prototype.hasFeature = function (feature) { + return feature === model_8.selectFeature || feature === model_6.moveFeature || feature === model_1.boundsFeature + || feature === model_1.layoutContainerFeature || feature === model_4.fadeFeature || feature === model_5.hoverFeedbackFeature + || feature === model_5.popupFeature || feature === model_7.connectableFeature || feature === delete_1.deletableFeature; + }; + return SNode; +}(model_7.SConnectableElement)); +exports.SNode = SNode; +/** + * A port is a connection point for edges. It should always be contained in an SNode. + */ +var SPort = /** @class */ (function (_super) { + __extends(SPort, _super); + function SPort() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.selected = false; + _this.hoverFeedback = false; + _this.opacity = 1; + return _this; + } + SPort.prototype.hasFeature = function (feature) { + return feature === model_8.selectFeature || feature === model_1.boundsFeature || feature === model_4.fadeFeature + || feature === model_5.hoverFeedbackFeature || feature === model_7.connectableFeature; + }; + return SPort; +}(model_7.SConnectableElement)); +exports.SPort = SPort; +/** + * Model element class for edges, which are the connectors in a graph. An edge has a source and a target, + * each of which can be either a node or a port. The source and target elements are referenced via their + * ids and can be resolved with the index stored in the root element. + */ +var SEdge = /** @class */ (function (_super) { + __extends(SEdge, _super); + function SEdge() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.selected = false; + _this.hoverFeedback = false; + _this.opacity = 1; + return _this; + } + SEdge.prototype.hasFeature = function (feature) { + return feature === model_4.fadeFeature || feature === model_8.selectFeature || + feature === model_3.editFeature || feature === model_5.hoverFeedbackFeature || + feature === delete_1.deletableFeature; + }; + return SEdge; +}(model_7.SRoutableElement)); +exports.SEdge = SEdge; +/** + * A label can be attached to a node, edge, or port, and contains some text to be rendered in its view. + */ +var SLabel = /** @class */ (function (_super) { + __extends(SLabel, _super); + function SLabel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.selected = false; + _this.alignment = geometry_1.ORIGIN_POINT; + _this.opacity = 1; + return _this; + } + SLabel.prototype.hasFeature = function (feature) { + return feature === model_1.boundsFeature || feature === model_1.alignFeature || feature === model_4.fadeFeature || feature === model_1.layoutableChildFeature || feature === model_2.edgeLayoutFeature; + }; + return SLabel; +}(model_1.SShapeElement)); +exports.SLabel = SLabel; +/** + * A compartment is used to group multiple child elements such as labels of a node. Usually a `vbox` + * or `hbox` layout is used to arrange these children. + */ +var SCompartment = /** @class */ (function (_super) { + __extends(SCompartment, _super); + function SCompartment() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.opacity = 1; + return _this; + } + SCompartment.prototype.hasFeature = function (feature) { + return feature === model_1.boundsFeature || feature === model_1.layoutContainerFeature || feature === model_1.layoutableChildFeature || feature === model_4.fadeFeature; + }; + return SCompartment; +}(model_1.SShapeElement)); +exports.SCompartment = SCompartment; +/** + * A specialized model index that tracks outgoing and incoming edges. + */ +var SGraphIndex = /** @class */ (function (_super) { + __extends(SGraphIndex, _super); + function SGraphIndex() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.outgoing = new Map; + _this.incoming = new Map; + return _this; + } + SGraphIndex.prototype.add = function (element) { + _super.prototype.add.call(this, element); + if (element instanceof SEdge) { + // Register the edge in the outgoing map + if (element.sourceId) { + var sourceArr = this.outgoing.get(element.sourceId); + if (sourceArr === undefined) + this.outgoing.set(element.sourceId, [element]); + else + sourceArr.push(element); + } + // Register the edge in the incoming map + if (element.targetId) { + var targetArr = this.incoming.get(element.targetId); + if (targetArr === undefined) + this.incoming.set(element.targetId, [element]); + else + targetArr.push(element); + } + } + }; + SGraphIndex.prototype.remove = function (element) { + _super.prototype.remove.call(this, element); + if (element instanceof SEdge) { + // Remove the edge from the outgoing map + var sourceArr = this.outgoing.get(element.sourceId); + if (sourceArr !== undefined) { + var index = sourceArr.indexOf(element); + if (index >= 0) { + if (sourceArr.length === 1) + this.outgoing.delete(element.sourceId); + else + sourceArr.splice(index, 1); + } + } + // Remove the edge from the incoming map + var targetArr = this.incoming.get(element.targetId); + if (targetArr !== undefined) { + var index = targetArr.indexOf(element); + if (index >= 0) { + if (targetArr.length === 1) + this.incoming.delete(element.targetId); + else + targetArr.splice(index, 1); + } + } + } + }; + SGraphIndex.prototype.getAttachedElements = function (element) { + var _this = this; + return new iterable_1.FluentIterableImpl(function () { return ({ + outgoing: _this.outgoing.get(element.id), + incoming: _this.incoming.get(element.id), + nextOutgoingIndex: 0, + nextIncomingIndex: 0 + }); }, function (state) { + var index = state.nextOutgoingIndex; + if (state.outgoing !== undefined && index < state.outgoing.length) { + state.nextOutgoingIndex = index + 1; + return { done: false, value: state.outgoing[index] }; + } + index = state.nextIncomingIndex; + if (state.incoming !== undefined) { + // Filter out self-loops: edges that are both outgoing and incoming + while (index < state.incoming.length) { + var edge = state.incoming[index]; + if (edge.sourceId !== edge.targetId) { + state.nextIncomingIndex = index + 1; + return { done: false, value: edge }; + } + index++; + } + } + return { done: true, value: undefined }; + }); + }; + SGraphIndex.prototype.getIncomingEdges = function (element) { + return this.incoming.get(element.id) || []; + }; + SGraphIndex.prototype.getOutgoingEdges = function (element) { + return this.outgoing.get(element.id) || []; + }; + return SGraphIndex; +}(smodel_1.SModelIndex)); +exports.SGraphIndex = SGraphIndex; +//# sourceMappingURL=sgraph.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/graph/views.js": +/*!*************************************************!*\ + !*** ./node_modules/sprotty/lib/graph/views.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +/** @jsx svg */ +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var snabbdom_jsx_1 = __webpack_require__(/*! snabbdom-jsx */ "./node_modules/snabbdom-jsx/snabbdom-jsx.js"); +var smodel_utils_1 = __webpack_require__(/*! ../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var vnode_utils_1 = __webpack_require__(/*! ../base/views/vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var model_1 = __webpack_require__(/*! ../features/routing/model */ "./node_modules/sprotty/lib/features/routing/model.js"); +var routing_1 = __webpack_require__(/*! ../features/routing/routing */ "./node_modules/sprotty/lib/features/routing/routing.js"); +/** + * IView component that turns an SGraph element and its children into a tree of virtual DOM elements. + */ +var SGraphView = /** @class */ (function () { + function SGraphView() { + } + SGraphView.prototype.render = function (model, context) { + var transform = "scale(" + model.zoom + ") translate(" + -model.scroll.x + "," + -model.scroll.y + ")"; + return snabbdom_jsx_1.svg("svg", { "class-sprotty-graph": true }, + snabbdom_jsx_1.svg("g", { transform: transform }, context.renderChildren(model))); + }; + SGraphView = __decorate([ + inversify_1.injectable() + ], SGraphView); + return SGraphView; +}()); +exports.SGraphView = SGraphView; +var PolylineEdgeView = /** @class */ (function () { + function PolylineEdgeView() { + } + PolylineEdgeView.prototype.render = function (edge, context) { + var router = this.edgeRouterRegistry.get(edge.routerKind); + var route = router.route(edge); + if (route.length === 0) + return this.renderDanglingEdge("Cannot compute route", edge, context); + return snabbdom_jsx_1.svg("g", { "class-sprotty-edge": true, "class-mouseover": edge.hoverFeedback }, + this.renderLine(edge, route, context), + this.renderAdditionals(edge, route, context), + context.renderChildren(edge, { route: route })); + }; + PolylineEdgeView.prototype.renderLine = function (edge, segments, context) { + var firstPoint = segments[0]; + var path = "M " + firstPoint.x + "," + firstPoint.y; + for (var i = 1; i < segments.length; i++) { + var p = segments[i]; + path += " L " + p.x + "," + p.y; + } + return snabbdom_jsx_1.svg("path", { d: path }); + }; + PolylineEdgeView.prototype.renderAdditionals = function (edge, segments, context) { + return []; + }; + PolylineEdgeView.prototype.renderDanglingEdge = function (message, edge, context) { + return snabbdom_jsx_1.svg("text", { "class-sprotty-edge-dangling": true, title: message }, "?"); + }; + __decorate([ + inversify_1.inject(routing_1.EdgeRouterRegistry), + __metadata("design:type", routing_1.EdgeRouterRegistry) + ], PolylineEdgeView.prototype, "edgeRouterRegistry", void 0); + PolylineEdgeView = __decorate([ + inversify_1.injectable() + ], PolylineEdgeView); + return PolylineEdgeView; +}()); +exports.PolylineEdgeView = PolylineEdgeView; +var SRoutingHandleView = /** @class */ (function () { + function SRoutingHandleView() { + this.minimalPointDistance = 10; + } + SRoutingHandleView.prototype.render = function (handle, context, args) { + if (args && args.route) { + if (handle.parent instanceof model_1.SRoutableElement) { + var router = this.edgeRouterRegistry.get(handle.parent.routerKind); + var theRoute = args.route === undefined ? router.route(handle.parent) : args.route; + var position = router.getHandlePosition(handle.parent, theRoute, handle); + if (position !== undefined) { + var node = snabbdom_jsx_1.svg("circle", { "class-sprotty-routing-handle": true, "class-selected": handle.selected, "class-mouseover": handle.hoverFeedback, cx: position.x, cy: position.y, r: this.getRadius() }); + vnode_utils_1.setAttr(node, 'data-kind', handle.kind); + return node; + } + } + } + // Fallback: Create an empty group + return snabbdom_jsx_1.svg("g", null); + }; + SRoutingHandleView.prototype.getRadius = function () { + return 7; + }; + __decorate([ + inversify_1.inject(routing_1.EdgeRouterRegistry), + __metadata("design:type", routing_1.EdgeRouterRegistry) + ], SRoutingHandleView.prototype, "edgeRouterRegistry", void 0); + SRoutingHandleView = __decorate([ + inversify_1.injectable() + ], SRoutingHandleView); + return SRoutingHandleView; +}()); +exports.SRoutingHandleView = SRoutingHandleView; +var SLabelView = /** @class */ (function () { + function SLabelView() { + } + SLabelView.prototype.render = function (label, context) { + var vnode = snabbdom_jsx_1.svg("text", { "class-sprotty-label": true }, label.text); + var subType = smodel_utils_1.getSubType(label); + if (subType) + vnode_utils_1.setAttr(vnode, 'class', subType); + return vnode; + }; + SLabelView = __decorate([ + inversify_1.injectable() + ], SLabelView); + return SLabelView; +}()); +exports.SLabelView = SLabelView; +var SCompartmentView = /** @class */ (function () { + function SCompartmentView() { + } + SCompartmentView.prototype.render = function (model, context) { + var translate = "translate(" + model.bounds.x + ", " + model.bounds.y + ")"; + var vnode = snabbdom_jsx_1.svg("g", { transform: translate, "class-sprotty-comp": "{true}" }, context.renderChildren(model)); + var subType = smodel_utils_1.getSubType(model); + if (subType) + vnode_utils_1.setAttr(vnode, 'class', subType); + return vnode; + }; + SCompartmentView = __decorate([ + inversify_1.injectable() + ], SCompartmentView); + return SCompartmentView; +}()); +exports.SCompartmentView = SCompartmentView; +//# sourceMappingURL=views.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/index.js": +/*!*******************************************!*\ + !*** ./node_modules/sprotty/lib/index.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +// ------------------ Base ------------------ +__export(__webpack_require__(/*! ./base/actions/action */ "./node_modules/sprotty/lib/base/actions/action.js")); +__export(__webpack_require__(/*! ./base/actions/action-dispatcher */ "./node_modules/sprotty/lib/base/actions/action-dispatcher.js")); +__export(__webpack_require__(/*! ./base/actions/action-handler */ "./node_modules/sprotty/lib/base/actions/action-handler.js")); +__export(__webpack_require__(/*! ./base/animations/animation-frame-syncer */ "./node_modules/sprotty/lib/base/animations/animation-frame-syncer.js")); +__export(__webpack_require__(/*! ./base/animations/animation */ "./node_modules/sprotty/lib/base/animations/animation.js")); +__export(__webpack_require__(/*! ./base/animations/easing */ "./node_modules/sprotty/lib/base/animations/easing.js")); +__export(__webpack_require__(/*! ./base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js")); +__export(__webpack_require__(/*! ./base/commands/command-registration */ "./node_modules/sprotty/lib/base/commands/command-registration.js")); +__export(__webpack_require__(/*! ./base/commands/command-stack-options */ "./node_modules/sprotty/lib/base/commands/command-stack-options.js")); +__export(__webpack_require__(/*! ./base/commands/command-stack */ "./node_modules/sprotty/lib/base/commands/command-stack.js")); +__export(__webpack_require__(/*! ./base/features/initialize-canvas */ "./node_modules/sprotty/lib/base/features/initialize-canvas.js")); +__export(__webpack_require__(/*! ./base/features/set-model */ "./node_modules/sprotty/lib/base/features/set-model.js")); +__export(__webpack_require__(/*! ./base/model/smodel-factory */ "./node_modules/sprotty/lib/base/model/smodel-factory.js")); +__export(__webpack_require__(/*! ./base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js")); +__export(__webpack_require__(/*! ./base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js")); +__export(__webpack_require__(/*! ./base/tool-manager/tool-manager */ "./node_modules/sprotty/lib/base/tool-manager/tool-manager.js")); +__export(__webpack_require__(/*! ./base/tool-manager/tool */ "./node_modules/sprotty/lib/base/tool-manager/tool.js")); +__export(__webpack_require__(/*! ./base/views/key-tool */ "./node_modules/sprotty/lib/base/views/key-tool.js")); +__export(__webpack_require__(/*! ./base/views/mouse-tool */ "./node_modules/sprotty/lib/base/views/mouse-tool.js")); +__export(__webpack_require__(/*! ./base/views/thunk-view */ "./node_modules/sprotty/lib/base/views/thunk-view.js")); +__export(__webpack_require__(/*! ./base/views/view */ "./node_modules/sprotty/lib/base/views/view.js")); +__export(__webpack_require__(/*! ./base/views/viewer-cache */ "./node_modules/sprotty/lib/base/views/viewer-cache.js")); +__export(__webpack_require__(/*! ./base/views/viewer-options */ "./node_modules/sprotty/lib/base/views/viewer-options.js")); +__export(__webpack_require__(/*! ./base/views/viewer */ "./node_modules/sprotty/lib/base/views/viewer.js")); +__export(__webpack_require__(/*! ./base/views/vnode-decorators */ "./node_modules/sprotty/lib/base/views/vnode-decorators.js")); +__export(__webpack_require__(/*! ./base/views/vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js")); +__export(__webpack_require__(/*! ./base/types */ "./node_modules/sprotty/lib/base/types.js")); +var di_config_1 = __webpack_require__(/*! ./base/di.config */ "./node_modules/sprotty/lib/base/di.config.js"); +exports.defaultModule = di_config_1.default; +// ------------------ Features ------------------ +__export(__webpack_require__(/*! ./features/bounds/bounds-manipulation */ "./node_modules/sprotty/lib/features/bounds/bounds-manipulation.js")); +__export(__webpack_require__(/*! ./features/bounds/layout */ "./node_modules/sprotty/lib/features/bounds/layout.js")); +__export(__webpack_require__(/*! ./features/bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js")); +__export(__webpack_require__(/*! ./features/bounds/vbox-layout */ "./node_modules/sprotty/lib/features/bounds/vbox-layout.js")); +__export(__webpack_require__(/*! ./features/bounds/hbox-layout */ "./node_modules/sprotty/lib/features/bounds/hbox-layout.js")); +__export(__webpack_require__(/*! ./features/bounds/stack-layout */ "./node_modules/sprotty/lib/features/bounds/stack-layout.js")); +__export(__webpack_require__(/*! ./features/button/button-handler */ "./node_modules/sprotty/lib/features/button/button-handler.js")); +__export(__webpack_require__(/*! ./features/button/model */ "./node_modules/sprotty/lib/features/button/model.js")); +__export(__webpack_require__(/*! ./features/edge-layout/di.config */ "./node_modules/sprotty/lib/features/edge-layout/di.config.js")); +__export(__webpack_require__(/*! ./features/edge-layout/edge-layout */ "./node_modules/sprotty/lib/features/edge-layout/edge-layout.js")); +__export(__webpack_require__(/*! ./features/edge-layout/model */ "./node_modules/sprotty/lib/features/edge-layout/model.js")); +__export(__webpack_require__(/*! ./features/edit/create */ "./node_modules/sprotty/lib/features/edit/create.js")); +__export(__webpack_require__(/*! ./features/edit/create-on-drag */ "./node_modules/sprotty/lib/features/edit/create-on-drag.js")); +__export(__webpack_require__(/*! ./features/edit/di.config */ "./node_modules/sprotty/lib/features/edit/di.config.js")); +__export(__webpack_require__(/*! ./features/edit/delete */ "./node_modules/sprotty/lib/features/edit/delete.js")); +__export(__webpack_require__(/*! ./features/edit/edit-label */ "./node_modules/sprotty/lib/features/edit/edit-label.js")); +__export(__webpack_require__(/*! ./features/edit/edit-routing */ "./node_modules/sprotty/lib/features/edit/edit-routing.js")); +__export(__webpack_require__(/*! ./features/edit/model */ "./node_modules/sprotty/lib/features/edit/model.js")); +__export(__webpack_require__(/*! ./features/edit/reconnect */ "./node_modules/sprotty/lib/features/edit/reconnect.js")); +__export(__webpack_require__(/*! ./features/expand/expand */ "./node_modules/sprotty/lib/features/expand/expand.js")); +__export(__webpack_require__(/*! ./features/expand/model */ "./node_modules/sprotty/lib/features/expand/model.js")); +__export(__webpack_require__(/*! ./features/expand/views */ "./node_modules/sprotty/lib/features/expand/views.js")); +__export(__webpack_require__(/*! ./features/export/export */ "./node_modules/sprotty/lib/features/export/export.js")); +__export(__webpack_require__(/*! ./features/export/model */ "./node_modules/sprotty/lib/features/export/model.js")); +__export(__webpack_require__(/*! ./features/export/svg-exporter */ "./node_modules/sprotty/lib/features/export/svg-exporter.js")); +__export(__webpack_require__(/*! ./features/fade/fade */ "./node_modules/sprotty/lib/features/fade/fade.js")); +__export(__webpack_require__(/*! ./features/fade/model */ "./node_modules/sprotty/lib/features/fade/model.js")); +__export(__webpack_require__(/*! ./features/hover/hover */ "./node_modules/sprotty/lib/features/hover/hover.js")); +__export(__webpack_require__(/*! ./features/hover/model */ "./node_modules/sprotty/lib/features/hover/model.js")); +__export(__webpack_require__(/*! ./features/decoration/model */ "./node_modules/sprotty/lib/features/decoration/model.js")); +__export(__webpack_require__(/*! ./features/decoration/views */ "./node_modules/sprotty/lib/features/decoration/views.js")); +__export(__webpack_require__(/*! ./features/decoration/decoration-placer */ "./node_modules/sprotty/lib/features/decoration/decoration-placer.js")); +__export(__webpack_require__(/*! ./features/move/model */ "./node_modules/sprotty/lib/features/move/model.js")); +__export(__webpack_require__(/*! ./features/move/move */ "./node_modules/sprotty/lib/features/move/move.js")); +__export(__webpack_require__(/*! ./features/open/open */ "./node_modules/sprotty/lib/features/open/open.js")); +__export(__webpack_require__(/*! ./features/open/model */ "./node_modules/sprotty/lib/features/open/model.js")); +__export(__webpack_require__(/*! ./features/routing/anchor */ "./node_modules/sprotty/lib/features/routing/anchor.js")); +__export(__webpack_require__(/*! ./features/routing/linear-edge-router */ "./node_modules/sprotty/lib/features/routing/linear-edge-router.js")); +__export(__webpack_require__(/*! ./features/routing/manhattan-anchors */ "./node_modules/sprotty/lib/features/routing/manhattan-anchors.js")); +__export(__webpack_require__(/*! ./features/routing/manhattan-edge-router */ "./node_modules/sprotty/lib/features/routing/manhattan-edge-router.js")); +__export(__webpack_require__(/*! ./features/routing/model */ "./node_modules/sprotty/lib/features/routing/model.js")); +__export(__webpack_require__(/*! ./features/routing/polyline-anchors */ "./node_modules/sprotty/lib/features/routing/polyline-anchors.js")); +__export(__webpack_require__(/*! ./features/routing/polyline-edge-router */ "./node_modules/sprotty/lib/features/routing/polyline-edge-router.js")); +__export(__webpack_require__(/*! ./features/routing/routing */ "./node_modules/sprotty/lib/features/routing/routing.js")); +__export(__webpack_require__(/*! ./features/select/model */ "./node_modules/sprotty/lib/features/select/model.js")); +__export(__webpack_require__(/*! ./features/select/select */ "./node_modules/sprotty/lib/features/select/select.js")); +__export(__webpack_require__(/*! ./features/undo-redo/undo-redo */ "./node_modules/sprotty/lib/features/undo-redo/undo-redo.js")); +__export(__webpack_require__(/*! ./features/update/model-matching */ "./node_modules/sprotty/lib/features/update/model-matching.js")); +__export(__webpack_require__(/*! ./features/update/update-model */ "./node_modules/sprotty/lib/features/update/update-model.js")); +__export(__webpack_require__(/*! ./features/viewport/center-fit */ "./node_modules/sprotty/lib/features/viewport/center-fit.js")); +__export(__webpack_require__(/*! ./features/viewport/model */ "./node_modules/sprotty/lib/features/viewport/model.js")); +__export(__webpack_require__(/*! ./features/viewport/scroll */ "./node_modules/sprotty/lib/features/viewport/scroll.js")); +__export(__webpack_require__(/*! ./features/viewport/viewport-root */ "./node_modules/sprotty/lib/features/viewport/viewport-root.js")); +__export(__webpack_require__(/*! ./features/viewport/viewport */ "./node_modules/sprotty/lib/features/viewport/viewport.js")); +__export(__webpack_require__(/*! ./features/viewport/zoom */ "./node_modules/sprotty/lib/features/viewport/zoom.js")); +var di_config_2 = __webpack_require__(/*! ./graph/di.config */ "./node_modules/sprotty/lib/graph/di.config.js"); +exports.graphModule = di_config_2.default; +var di_config_3 = __webpack_require__(/*! ./features/bounds/di.config */ "./node_modules/sprotty/lib/features/bounds/di.config.js"); +exports.boundsModule = di_config_3.default; +var di_config_4 = __webpack_require__(/*! ./features/button/di.config */ "./node_modules/sprotty/lib/features/button/di.config.js"); +exports.buttonModule = di_config_4.default; +var di_config_5 = __webpack_require__(/*! ./features/decoration/di.config */ "./node_modules/sprotty/lib/features/decoration/di.config.js"); +exports.decorationModule = di_config_5.default; +var di_config_6 = __webpack_require__(/*! ./features/edge-layout/di.config */ "./node_modules/sprotty/lib/features/edge-layout/di.config.js"); +exports.edgeLayoutModule = di_config_6.default; +var di_config_7 = __webpack_require__(/*! ./features/expand/di.config */ "./node_modules/sprotty/lib/features/expand/di.config.js"); +exports.expandModule = di_config_7.default; +var di_config_8 = __webpack_require__(/*! ./features/export/di.config */ "./node_modules/sprotty/lib/features/export/di.config.js"); +exports.exportModule = di_config_8.default; +var di_config_9 = __webpack_require__(/*! ./features/fade/di.config */ "./node_modules/sprotty/lib/features/fade/di.config.js"); +exports.fadeModule = di_config_9.default; +var di_config_10 = __webpack_require__(/*! ./features/hover/di.config */ "./node_modules/sprotty/lib/features/hover/di.config.js"); +exports.hoverModule = di_config_10.default; +var di_config_11 = __webpack_require__(/*! ./features/move/di.config */ "./node_modules/sprotty/lib/features/move/di.config.js"); +exports.moveModule = di_config_11.default; +var di_config_12 = __webpack_require__(/*! ./features/open/di.config */ "./node_modules/sprotty/lib/features/open/di.config.js"); +exports.openModule = di_config_12.default; +var di_config_13 = __webpack_require__(/*! ./features/routing/di.config */ "./node_modules/sprotty/lib/features/routing/di.config.js"); +exports.routingModule = di_config_13.default; +var di_config_14 = __webpack_require__(/*! ./features/select/di.config */ "./node_modules/sprotty/lib/features/select/di.config.js"); +exports.selectModule = di_config_14.default; +var di_config_15 = __webpack_require__(/*! ./features/undo-redo/di.config */ "./node_modules/sprotty/lib/features/undo-redo/di.config.js"); +exports.undoRedoModule = di_config_15.default; +var di_config_16 = __webpack_require__(/*! ./features/update/di.config */ "./node_modules/sprotty/lib/features/update/di.config.js"); +exports.updateModule = di_config_16.default; +var di_config_17 = __webpack_require__(/*! ./features/viewport/di.config */ "./node_modules/sprotty/lib/features/viewport/di.config.js"); +exports.viewportModule = di_config_17.default; +// ------------------ Graph ------------------ +__export(__webpack_require__(/*! ./graph/sgraph-factory */ "./node_modules/sprotty/lib/graph/sgraph-factory.js")); +__export(__webpack_require__(/*! ./graph/sgraph */ "./node_modules/sprotty/lib/graph/sgraph.js")); +__export(__webpack_require__(/*! ./graph/views */ "./node_modules/sprotty/lib/graph/views.js")); +// ------------------ Library ------------------ +__export(__webpack_require__(/*! ./lib/generic-views */ "./node_modules/sprotty/lib/lib/generic-views.js")); +__export(__webpack_require__(/*! ./lib/html-views */ "./node_modules/sprotty/lib/lib/html-views.js")); +__export(__webpack_require__(/*! ./lib/model */ "./node_modules/sprotty/lib/lib/model.js")); +__export(__webpack_require__(/*! ./lib/svg-views */ "./node_modules/sprotty/lib/lib/svg-views.js")); +// ------------------ Model Source ------------------ +__export(__webpack_require__(/*! ./model-source/commit-model */ "./node_modules/sprotty/lib/model-source/commit-model.js")); +__export(__webpack_require__(/*! ./model-source/diagram-server */ "./node_modules/sprotty/lib/model-source/diagram-server.js")); +__export(__webpack_require__(/*! ./model-source/local-model-source */ "./node_modules/sprotty/lib/model-source/local-model-source.js")); +__export(__webpack_require__(/*! ./model-source/logging */ "./node_modules/sprotty/lib/model-source/logging.js")); +__export(__webpack_require__(/*! ./model-source/model-source */ "./node_modules/sprotty/lib/model-source/model-source.js")); +__export(__webpack_require__(/*! ./model-source/websocket */ "./node_modules/sprotty/lib/model-source/websocket.js")); +var di_config_18 = __webpack_require__(/*! ./model-source/di.config */ "./node_modules/sprotty/lib/model-source/di.config.js"); +exports.modelSourceModule = di_config_18.default; +// ------------------ Utilities ------------------ +__export(__webpack_require__(/*! ./utils/browser */ "./node_modules/sprotty/lib/utils/browser.js")); +__export(__webpack_require__(/*! ./utils/color */ "./node_modules/sprotty/lib/utils/color.js")); +__export(__webpack_require__(/*! ./utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js")); +__export(__webpack_require__(/*! ./utils/inversify */ "./node_modules/sprotty/lib/utils/inversify.js")); +__export(__webpack_require__(/*! ./utils/logging */ "./node_modules/sprotty/lib/utils/logging.js")); +__export(__webpack_require__(/*! ./utils/registry */ "./node_modules/sprotty/lib/utils/registry.js")); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/lib/generic-views.js": +/*!*******************************************************!*\ + !*** ./node_modules/sprotty/lib/lib/generic-views.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var strings_1 = __webpack_require__(/*! snabbdom-virtualize/strings */ "./node_modules/snabbdom-virtualize/strings.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var PreRenderedView = /** @class */ (function () { + function PreRenderedView() { + } + PreRenderedView.prototype.render = function (model, context) { + var node = strings_1.default(model.code); + this.correctNamespace(node); + return node; + }; + PreRenderedView.prototype.correctNamespace = function (node) { + if (node.sel === 'svg' || node.sel === 'g') + this.setNamespace(node, 'http://www.w3.org/2000/svg'); + }; + PreRenderedView.prototype.setNamespace = function (node, ns) { + if (node.data === undefined) + node.data = {}; + node.data.ns = ns; + var children = node.children; + if (children !== undefined) { + for (var i = 0; i < children.length; i++) { + var child = children[i]; + if (typeof child !== 'string') + this.setNamespace(child, ns); + } + } + }; + PreRenderedView = __decorate([ + inversify_1.injectable() + ], PreRenderedView); + return PreRenderedView; +}()); +exports.PreRenderedView = PreRenderedView; +//# sourceMappingURL=generic-views.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/lib/html-views.js": +/*!****************************************************!*\ + !*** ./node_modules/sprotty/lib/lib/html-views.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +/** @jsx html */ +var snabbdom_jsx_1 = __webpack_require__(/*! snabbdom-jsx */ "./node_modules/snabbdom-jsx/snabbdom-jsx.js"); +var vnode_utils_1 = __webpack_require__(/*! ../base/views/vnode-utils */ "./node_modules/sprotty/lib/base/views/vnode-utils.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var HtmlRootView = /** @class */ (function () { + function HtmlRootView() { + } + HtmlRootView.prototype.render = function (model, context) { + var root = snabbdom_jsx_1.html("div", null, context.renderChildren(model)); + for (var _i = 0, _a = model.classes; _i < _a.length; _i++) { + var c = _a[_i]; + vnode_utils_1.setClass(root, c, true); + } + return root; + }; + HtmlRootView = __decorate([ + inversify_1.injectable() + ], HtmlRootView); + return HtmlRootView; +}()); +exports.HtmlRootView = HtmlRootView; +//# sourceMappingURL=html-views.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/lib/model.js": +/*!***********************************************!*\ + !*** ./node_modules/sprotty/lib/lib/model.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var smodel_1 = __webpack_require__(/*! ../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var geometry_1 = __webpack_require__(/*! ../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var model_1 = __webpack_require__(/*! ../features/bounds/model */ "./node_modules/sprotty/lib/features/bounds/model.js"); +var model_2 = __webpack_require__(/*! ../features/move/model */ "./node_modules/sprotty/lib/features/move/model.js"); +var model_3 = __webpack_require__(/*! ../features/select/model */ "./node_modules/sprotty/lib/features/select/model.js"); +var sgraph_1 = __webpack_require__(/*! ../graph/sgraph */ "./node_modules/sprotty/lib/graph/sgraph.js"); +var anchor_1 = __webpack_require__(/*! ../features/routing/anchor */ "./node_modules/sprotty/lib/features/routing/anchor.js"); +/** + * A node that is represented by a circle. + */ +var CircularNode = /** @class */ (function (_super) { + __extends(CircularNode, _super); + function CircularNode() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(CircularNode.prototype, "anchorKind", { + get: function () { + return anchor_1.ELLIPTIC_ANCHOR_KIND; + }, + enumerable: true, + configurable: true + }); + return CircularNode; +}(sgraph_1.SNode)); +exports.CircularNode = CircularNode; +/** + * A node that is represented by a rectangle. + */ +var RectangularNode = /** @class */ (function (_super) { + __extends(RectangularNode, _super); + function RectangularNode() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(RectangularNode.prototype, "anchorKind", { + get: function () { + return anchor_1.RECTANGULAR_ANCHOR_KIND; + }, + enumerable: true, + configurable: true + }); + return RectangularNode; +}(sgraph_1.SNode)); +exports.RectangularNode = RectangularNode; +/** + * A node that is represented by a diamond. + */ +var DiamondNode = /** @class */ (function (_super) { + __extends(DiamondNode, _super); + function DiamondNode() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(DiamondNode.prototype, "anchorKind", { + get: function () { + return anchor_1.DIAMOND_ANCHOR_KIND; + }, + enumerable: true, + configurable: true + }); + return DiamondNode; +}(sgraph_1.SNode)); +exports.DiamondNode = DiamondNode; +/** + * A port that is represented by a circle. + */ +var CircularPort = /** @class */ (function (_super) { + __extends(CircularPort, _super); + function CircularPort() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(CircularPort.prototype, "anchorKind", { + get: function () { + return anchor_1.ELLIPTIC_ANCHOR_KIND; + }, + enumerable: true, + configurable: true + }); + return CircularPort; +}(sgraph_1.SPort)); +exports.CircularPort = CircularPort; +/** + * A port that is represented by a rectangle. + */ +var RectangularPort = /** @class */ (function (_super) { + __extends(RectangularPort, _super); + function RectangularPort() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(RectangularPort.prototype, "anchorKind", { + get: function () { + return anchor_1.RECTANGULAR_ANCHOR_KIND; + }, + enumerable: true, + configurable: true + }); + return RectangularPort; +}(sgraph_1.SPort)); +exports.RectangularPort = RectangularPort; +/** + * Root model element class for HTML content. Usually this is rendered with a `div` DOM element. + */ +var HtmlRoot = /** @class */ (function (_super) { + __extends(HtmlRoot, _super); + function HtmlRoot() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.classes = []; + return _this; + } + return HtmlRoot; +}(smodel_1.SModelRoot)); +exports.HtmlRoot = HtmlRoot; +/** + * Pre-rendered elements contain HTML or SVG code to be transferred to the DOM. This can be useful to + * render complex figures or to compute the view on the server instead of the client code. + */ +var PreRenderedElement = /** @class */ (function (_super) { + __extends(PreRenderedElement, _super); + function PreRenderedElement() { + return _super !== null && _super.apply(this, arguments) || this; + } + return PreRenderedElement; +}(smodel_1.SChildElement)); +exports.PreRenderedElement = PreRenderedElement; +/** + * Same as PreRenderedElement, but with a position and a size. + */ +var ShapedPreRenderedElement = /** @class */ (function (_super) { + __extends(ShapedPreRenderedElement, _super); + function ShapedPreRenderedElement() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.position = geometry_1.ORIGIN_POINT; + _this.size = geometry_1.EMPTY_DIMENSION; + _this.selected = false; + _this.alignment = geometry_1.ORIGIN_POINT; + return _this; + } + Object.defineProperty(ShapedPreRenderedElement.prototype, "bounds", { + get: function () { + return { + x: this.position.x, + y: this.position.y, + width: this.size.width, + height: this.size.height + }; + }, + set: function (newBounds) { + this.position = { + x: newBounds.x, + y: newBounds.y + }; + this.size = { + width: newBounds.width, + height: newBounds.height + }; + }, + enumerable: true, + configurable: true + }); + ShapedPreRenderedElement.prototype.hasFeature = function (feature) { + return feature === model_2.moveFeature || feature === model_1.boundsFeature || feature === model_3.selectFeature || feature === model_1.alignFeature; + }; + return ShapedPreRenderedElement; +}(PreRenderedElement)); +exports.ShapedPreRenderedElement = ShapedPreRenderedElement; +//# sourceMappingURL=model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/lib/svg-views.js": +/*!***************************************************!*\ + !*** ./node_modules/sprotty/lib/lib/svg-views.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +/** @jsx svg */ +var snabbdom_jsx_1 = __webpack_require__(/*! snabbdom-jsx */ "./node_modules/snabbdom-jsx/snabbdom-jsx.js"); +var sgraph_1 = __webpack_require__(/*! ../graph/sgraph */ "./node_modules/sprotty/lib/graph/sgraph.js"); +var geometry_1 = __webpack_require__(/*! ../utils/geometry */ "./node_modules/sprotty/lib/utils/geometry.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var SvgViewportView = /** @class */ (function () { + function SvgViewportView() { + } + SvgViewportView.prototype.render = function (model, context) { + var transform = "scale(" + model.zoom + ") translate(" + -model.scroll.x + "," + -model.scroll.y + ")"; + return snabbdom_jsx_1.svg("svg", null, + snabbdom_jsx_1.svg("g", { transform: transform }, context.renderChildren(model))); + }; + SvgViewportView = __decorate([ + inversify_1.injectable() + ], SvgViewportView); + return SvgViewportView; +}()); +exports.SvgViewportView = SvgViewportView; +var CircularNodeView = /** @class */ (function () { + function CircularNodeView() { + } + CircularNodeView.prototype.render = function (node, context) { + var radius = this.getRadius(node); + return snabbdom_jsx_1.svg("g", null, + snabbdom_jsx_1.svg("circle", { "class-sprotty-node": node instanceof sgraph_1.SNode, "class-sprotty-port": node instanceof sgraph_1.SPort, "class-mouseover": node.hoverFeedback, "class-selected": node.selected, r: radius, cx: radius, cy: radius }), + context.renderChildren(node)); + }; + CircularNodeView.prototype.getRadius = function (node) { + var d = Math.min(node.size.width, node.size.height); + return d > 0 ? d / 2 : 0; + }; + CircularNodeView = __decorate([ + inversify_1.injectable() + ], CircularNodeView); + return CircularNodeView; +}()); +exports.CircularNodeView = CircularNodeView; +var RectangularNodeView = /** @class */ (function () { + function RectangularNodeView() { + } + RectangularNodeView.prototype.render = function (node, context) { + return snabbdom_jsx_1.svg("g", null, + snabbdom_jsx_1.svg("rect", { "class-sprotty-node": node instanceof sgraph_1.SNode, "class-sprotty-port": node instanceof sgraph_1.SPort, "class-mouseover": node.hoverFeedback, "class-selected": node.selected, x: "0", y: "0", width: Math.max(node.size.width, 0), height: Math.max(node.size.height, 0) }), + context.renderChildren(node)); + }; + RectangularNodeView = __decorate([ + inversify_1.injectable() + ], RectangularNodeView); + return RectangularNodeView; +}()); +exports.RectangularNodeView = RectangularNodeView; +var DiamondNodeView = /** @class */ (function () { + function DiamondNodeView() { + } + DiamondNodeView.prototype.render = function (node, context) { + var diamond = new geometry_1.Diamond({ height: Math.max(node.size.height, 0), width: Math.max(node.size.width, 0), x: 0, y: 0 }); + var points = svgStr(diamond.topPoint) + " " + svgStr(diamond.rightPoint) + " " + svgStr(diamond.bottomPoint) + " " + svgStr(diamond.leftPoint); + return snabbdom_jsx_1.svg("g", null, + snabbdom_jsx_1.svg("polygon", { "class-sprotty-node": node instanceof sgraph_1.SNode, "class-sprotty-port": node instanceof sgraph_1.SPort, "class-mouseover": node.hoverFeedback, "class-selected": node.selected, points: points }), + context.renderChildren(node)); + }; + DiamondNodeView = __decorate([ + inversify_1.injectable() + ], DiamondNodeView); + return DiamondNodeView; +}()); +exports.DiamondNodeView = DiamondNodeView; +function svgStr(point) { + return point.x + "," + point.y; +} +var EmptyGroupView = /** @class */ (function () { + function EmptyGroupView() { + } + EmptyGroupView.prototype.render = function (node, context) { + return snabbdom_jsx_1.svg("g", null); + }; + EmptyGroupView = __decorate([ + inversify_1.injectable() + ], EmptyGroupView); + return EmptyGroupView; +}()); +exports.EmptyGroupView = EmptyGroupView; +//# sourceMappingURL=svg-views.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/model-source/commit-model.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/model-source/commit-model.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2019 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var command_1 = __webpack_require__(/*! ../base/commands/command */ "./node_modules/sprotty/lib/base/commands/command.js"); +var types_1 = __webpack_require__(/*! ../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var model_source_1 = __webpack_require__(/*! ./model-source */ "./node_modules/sprotty/lib/model-source/model-source.js"); +/** + * Commit the current SModel back to the model source. + * + * The SModel (AKA internal model) contains a lot of dirty/transitional state, such + * as intermediate move postions or handles. When a user interaction that spans multiple + * commands finishes, it fires a CommitModelAction to write the final changes back to + * the model source. + */ +var CommitModelAction = /** @class */ (function () { + function CommitModelAction() { + this.kind = CommitModelCommand.KIND; + } + return CommitModelAction; +}()); +exports.CommitModelAction = CommitModelAction; +var CommitModelCommand = /** @class */ (function (_super) { + __extends(CommitModelCommand, _super); + function CommitModelCommand(action) { + return _super.call(this) || this; + } + CommitModelCommand.prototype.execute = function (context) { + this.newModel = context.modelFactory.createSchema(context.root); + return this.doCommit(this.newModel, context.root, true); + }; + CommitModelCommand.prototype.doCommit = function (model, result, doSetOriginal) { + var _this = this; + var commitResult = this.modelSource.commitModel(model); + if (commitResult instanceof Promise) { + return commitResult.then(function (originalModel) { + if (doSetOriginal) + _this.originalModel = originalModel; + return result; + }); + } + else { + if (doSetOriginal) + this.originalModel = commitResult; + return result; + } + }; + CommitModelCommand.prototype.undo = function (context) { + return this.doCommit(this.originalModel, context.root, false); + }; + CommitModelCommand.prototype.redo = function (context) { + return this.doCommit(this.newModel, context.root, false); + }; + CommitModelCommand.KIND = 'commitModel'; + __decorate([ + inversify_1.inject(types_1.TYPES.ModelSource), + __metadata("design:type", model_source_1.ModelSource) + ], CommitModelCommand.prototype, "modelSource", void 0); + CommitModelCommand = __decorate([ + inversify_1.injectable(), + __param(0, inversify_1.inject(types_1.TYPES.Action)), + __metadata("design:paramtypes", [CommitModelAction]) + ], CommitModelCommand); + return CommitModelCommand; +}(command_1.SystemCommand)); +exports.CommitModelCommand = CommitModelCommand; +//# sourceMappingURL=commit-model.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/model-source/di.config.js": +/*!************************************************************!*\ + !*** ./node_modules/sprotty/lib/model-source/di.config.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var command_registration_1 = __webpack_require__(/*! ../base/commands/command-registration */ "./node_modules/sprotty/lib/base/commands/command-registration.js"); +var commit_model_1 = __webpack_require__(/*! ./commit-model */ "./node_modules/sprotty/lib/model-source/commit-model.js"); +/** + * This container module does NOT provide any binding for TYPES.ModelSource because that needs to be + * done according to the needs of the application. You can choose between a local (LocalModelSource) + * and a remote (e.g. WebSocketDiagramServer) implementation. + */ +var modelSourceModule = new inversify_1.ContainerModule(function (bind, _unbind, isBound) { + bind(types_1.TYPES.ModelSourceProvider).toProvider(function (context) { + return function () { + return new Promise(function (resolve) { + resolve(context.container.get(types_1.TYPES.ModelSource)); + }); + }; + }); + command_registration_1.configureCommand({ bind: bind, isBound: isBound }, commit_model_1.CommitModelCommand); + bind(types_1.TYPES.IActionHandlerInitializer).toService(types_1.TYPES.ModelSource); +}); +exports.default = modelSourceModule; +//# sourceMappingURL=di.config.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/model-source/diagram-server.js": +/*!*****************************************************************!*\ + !*** ./node_modules/sprotty/lib/model-source/diagram-server.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var file_saver_1 = __webpack_require__(/*! file-saver */ "./node_modules/file-saver/FileSaver.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var set_model_1 = __webpack_require__(/*! ../base/features/set-model */ "./node_modules/sprotty/lib/base/features/set-model.js"); +var smodel_1 = __webpack_require__(/*! ../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var types_1 = __webpack_require__(/*! ../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var bounds_manipulation_1 = __webpack_require__(/*! ../features/bounds/bounds-manipulation */ "./node_modules/sprotty/lib/features/bounds/bounds-manipulation.js"); +var expand_1 = __webpack_require__(/*! ../features/expand/expand */ "./node_modules/sprotty/lib/features/expand/expand.js"); +var svg_exporter_1 = __webpack_require__(/*! ../features/export/svg-exporter */ "./node_modules/sprotty/lib/features/export/svg-exporter.js"); +var hover_1 = __webpack_require__(/*! ../features/hover/hover */ "./node_modules/sprotty/lib/features/hover/hover.js"); +var open_1 = __webpack_require__(/*! ../features/open/open */ "./node_modules/sprotty/lib/features/open/open.js"); +var update_model_1 = __webpack_require__(/*! ../features/update/update-model */ "./node_modules/sprotty/lib/features/update/update-model.js"); +var model_source_1 = __webpack_require__(/*! ./model-source */ "./node_modules/sprotty/lib/model-source/model-source.js"); +function isActionMessage(object) { + return object !== undefined && object.hasOwnProperty('clientId') && object.hasOwnProperty('action'); +} +exports.isActionMessage = isActionMessage; +/** + * Sent by the external server when to signal a state change. + */ +var ServerStatusAction = /** @class */ (function () { + function ServerStatusAction() { + this.kind = ServerStatusAction.KIND; + } + ServerStatusAction.KIND = 'serverStatus'; + return ServerStatusAction; +}()); +exports.ServerStatusAction = ServerStatusAction; +var receivedFromServerProperty = '__receivedFromServer'; +/** + * A ModelSource that communicates with an external model provider, e.g. + * a model editor. + * + * This class defines which actions are sent to and received from the + * external model source. + */ +var DiagramServer = /** @class */ (function (_super) { + __extends(DiagramServer, _super); + function DiagramServer() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.currentRoot = { + type: 'NONE', + id: 'ROOT' + }; + return _this; + } + DiagramServer.prototype.initialize = function (registry) { + _super.prototype.initialize.call(this, registry); + // Register this model source + registry.register(bounds_manipulation_1.ComputedBoundsAction.KIND, this); + registry.register(bounds_manipulation_1.RequestBoundsCommand.KIND, this); + registry.register(hover_1.RequestPopupModelAction.KIND, this); + registry.register(expand_1.CollapseExpandAction.KIND, this); + registry.register(expand_1.CollapseExpandAllAction.KIND, this); + registry.register(open_1.OpenAction.KIND, this); + registry.register(ServerStatusAction.KIND, this); + this.clientId = this.viewerOptions.baseDiv; + }; + DiagramServer.prototype.handle = function (action) { + var forwardToServer = this.handleLocally(action); + if (forwardToServer) { + var message = { + clientId: this.clientId, + action: action + }; + this.logger.log(this, 'sending', message); + this.sendMessage(message); + } + }; + DiagramServer.prototype.messageReceived = function (data) { + var _this = this; + var object = typeof (data) === 'string' ? JSON.parse(data) : data; + if (isActionMessage(object) && object.action) { + if (!object.clientId || object.clientId === this.clientId) { + object.action[receivedFromServerProperty] = true; + this.logger.log(this, 'receiving', object); + this.actionDispatcher.dispatch(object.action).then(function () { + _this.storeNewModel(object.action); + }); + } + } + else { + this.logger.error(this, 'received data is not an action message', object); + } + }; + /** + * Check whether the given action should be handled locally. Returns true if the action should + * still be sent to the server, and false if it's only handled locally. + */ + DiagramServer.prototype.handleLocally = function (action) { + this.storeNewModel(action); + switch (action.kind) { + case bounds_manipulation_1.ComputedBoundsAction.KIND: + return this.handleComputedBounds(action); + case bounds_manipulation_1.RequestBoundsCommand.KIND: + return false; + case svg_exporter_1.ExportSvgAction.KIND: + return this.handleExportSvgAction(action); + case ServerStatusAction.KIND: + return this.handleServerStateAction(action); + } + return !action[receivedFromServerProperty]; + }; + /** + * Put the new model contained in the given action into the model storage, if there is any. + */ + DiagramServer.prototype.storeNewModel = function (action) { + if (action.kind === set_model_1.SetModelCommand.KIND + || action.kind === update_model_1.UpdateModelCommand.KIND + || action.kind === bounds_manipulation_1.RequestBoundsCommand.KIND) { + var newRoot = action.newRoot; + if (newRoot) { + this.currentRoot = newRoot; + if (action.kind === set_model_1.SetModelCommand.KIND || action.kind === update_model_1.UpdateModelCommand.KIND) { + this.lastSubmittedModelType = newRoot.type; + } + } + } + }; + /** + * If the server requires to compute a layout, the computed bounds are forwarded. Otherwise they + * are applied to the current model locally and a model update is triggered. + */ + DiagramServer.prototype.handleComputedBounds = function (action) { + if (this.viewerOptions.needsServerLayout) { + return true; + } + else { + var index = new smodel_1.SModelIndex(); + var root = this.currentRoot; + index.add(root); + for (var _i = 0, _a = action.bounds; _i < _a.length; _i++) { + var b = _a[_i]; + var element = index.getById(b.elementId); + if (element !== undefined) + this.applyBounds(element, b.newBounds); + } + if (action.alignments !== undefined) { + for (var _b = 0, _c = action.alignments; _b < _c.length; _b++) { + var a = _c[_b]; + var element = index.getById(a.elementId); + if (element !== undefined) + this.applyAlignment(element, a.newAlignment); + } + } + if (root.type === this.lastSubmittedModelType) { + this.actionDispatcher.dispatch(new update_model_1.UpdateModelAction(root)); + } + else { + this.actionDispatcher.dispatch(new set_model_1.SetModelAction(root)); + } + this.lastSubmittedModelType = root.type; + return false; + } + }; + DiagramServer.prototype.applyBounds = function (element, newBounds) { + var e = element; + e.position = { x: newBounds.x, y: newBounds.y }; + e.size = { width: newBounds.width, height: newBounds.height }; + }; + DiagramServer.prototype.applyAlignment = function (element, newAlignment) { + var e = element; + e.alignment = { x: newAlignment.x, y: newAlignment.y }; + }; + DiagramServer.prototype.handleExportSvgAction = function (action) { + var blob = new Blob([action.svg], { type: "text/plain;charset=utf-8" }); + file_saver_1.saveAs(blob, "diagram.svg"); + return false; + }; + DiagramServer.prototype.handleServerStateAction = function (action) { + return false; + }; + DiagramServer.prototype.commitModel = function (newRoot) { + var previousRoot = this.currentRoot; + this.currentRoot = newRoot; + return previousRoot; + }; + __decorate([ + inversify_1.inject(types_1.TYPES.ILogger), + __metadata("design:type", Object) + ], DiagramServer.prototype, "logger", void 0); + DiagramServer = __decorate([ + inversify_1.injectable() + ], DiagramServer); + return DiagramServer; +}(model_source_1.ModelSource)); +exports.DiagramServer = DiagramServer; +//# sourceMappingURL=diagram-server.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/model-source/local-model-source.js": +/*!*********************************************************************!*\ + !*** ./node_modules/sprotty/lib/model-source/local-model-source.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var file_saver_1 = __webpack_require__(/*! file-saver */ "./node_modules/file-saver/FileSaver.js"); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var set_model_1 = __webpack_require__(/*! ../base/features/set-model */ "./node_modules/sprotty/lib/base/features/set-model.js"); +var smodel_1 = __webpack_require__(/*! ../base/model/smodel */ "./node_modules/sprotty/lib/base/model/smodel.js"); +var smodel_utils_1 = __webpack_require__(/*! ../base/model/smodel-utils */ "./node_modules/sprotty/lib/base/model/smodel-utils.js"); +var types_1 = __webpack_require__(/*! ../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var bounds_manipulation_1 = __webpack_require__(/*! ../features/bounds/bounds-manipulation */ "./node_modules/sprotty/lib/features/bounds/bounds-manipulation.js"); +var svg_exporter_1 = __webpack_require__(/*! ../features/export/svg-exporter */ "./node_modules/sprotty/lib/features/export/svg-exporter.js"); +var hover_1 = __webpack_require__(/*! ../features/hover/hover */ "./node_modules/sprotty/lib/features/hover/hover.js"); +var model_matching_1 = __webpack_require__(/*! ../features/update/model-matching */ "./node_modules/sprotty/lib/features/update/model-matching.js"); +var update_model_1 = __webpack_require__(/*! ../features/update/update-model */ "./node_modules/sprotty/lib/features/update/update-model.js"); +var async_1 = __webpack_require__(/*! ../utils/async */ "./node_modules/sprotty/lib/utils/async.js"); +var model_source_1 = __webpack_require__(/*! ./model-source */ "./node_modules/sprotty/lib/model-source/model-source.js"); +var smodel_factory_1 = __webpack_require__(/*! ../base/model/smodel-factory */ "./node_modules/sprotty/lib/base/model/smodel-factory.js"); +/** + * A model source that allows to set and modify the model through function calls. + * This class can be used as a facade over the action-based API of sprotty. It handles + * actions for bounds calculation and model updates. + */ +var LocalModelSource = /** @class */ (function (_super) { + __extends(LocalModelSource, _super); + function LocalModelSource() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.currentRoot = smodel_factory_1.EMPTY_ROOT; + /** + * When client layout is active, model updates are not applied immediately. Instead the + * model is rendered on a hidden canvas first to derive actual bounds. The promises listed + * here are resolved after the new bounds have been applied and the new model state has + * been actually applied to the visible canvas. + */ + _this.pendingUpdates = []; + return _this; + } + Object.defineProperty(LocalModelSource.prototype, "model", { + get: function () { + return this.currentRoot; + }, + set: function (root) { + this.setModel(root); + }, + enumerable: true, + configurable: true + }); + LocalModelSource.prototype.initialize = function (registry) { + _super.prototype.initialize.call(this, registry); + // Register this model source + registry.register(bounds_manipulation_1.ComputedBoundsAction.KIND, this); + registry.register(hover_1.RequestPopupModelAction.KIND, this); + }; + /** + * Set the model without incremental update. + */ + LocalModelSource.prototype.setModel = function (newRoot) { + this.currentRoot = newRoot; + return this.submitModel(newRoot, false); + }; + LocalModelSource.prototype.commitModel = function (newRoot) { + var previousRoot = this.currentRoot; + this.currentRoot = newRoot; + return previousRoot; + }; + /** + * Apply an incremental update to the model with an animation showing the transition to + * the new state. If `newRoot` is undefined, the current root is submitted; in that case + * it is assumed that it has been modified before. + */ + LocalModelSource.prototype.updateModel = function (newRoot) { + if (newRoot === undefined) { + return this.submitModel(this.currentRoot, true); + } + else { + this.currentRoot = newRoot; + return this.submitModel(newRoot, true); + } + }; + /** + * If client layout is active, run a `RequestBoundsAction` and wait for the resulting + * `ComputedBoundsAction`, otherwise call `doSubmitModel(…)` directly. + */ + LocalModelSource.prototype.submitModel = function (newRoot, update) { + if (this.viewerOptions.needsClientLayout) { + var deferred = new async_1.Deferred(); + this.pendingUpdates.push(deferred); + this.actionDispatcher.dispatch(new bounds_manipulation_1.RequestBoundsAction(newRoot)); + return deferred.promise; + } + else { + return this.doSubmitModel(newRoot, update); + } + }; + /** + * Submit the given model with an `UpdateModelAction` or a `SetModelAction` depending on the + * `update` argument. If available, the model layout engine is invoked first. + */ + LocalModelSource.prototype.doSubmitModel = function (newRoot, update, index) { + return __awaiter(this, void 0, void 0, function () { + var layoutResult, error_1, lastSubmittedModelType, updates, input; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.layoutEngine !== undefined)) return [3 /*break*/, 6]; + _a.label = 1; + case 1: + _a.trys.push([1, 5, , 6]); + layoutResult = this.layoutEngine.layout(newRoot, index); + if (!(layoutResult instanceof Promise)) return [3 /*break*/, 3]; + return [4 /*yield*/, layoutResult]; + case 2: + newRoot = _a.sent(); + return [3 /*break*/, 4]; + case 3: + if (layoutResult !== undefined) + newRoot = layoutResult; + _a.label = 4; + case 4: return [3 /*break*/, 6]; + case 5: + error_1 = _a.sent(); + this.logger.error(this, error_1.toString(), error_1.stack); + return [3 /*break*/, 6]; + case 6: + lastSubmittedModelType = this.lastSubmittedModelType; + this.lastSubmittedModelType = newRoot.type; + updates = this.pendingUpdates; + this.pendingUpdates = []; + if (!(update && newRoot.type === lastSubmittedModelType)) return [3 /*break*/, 8]; + input = Array.isArray(update) ? update : newRoot; + return [4 /*yield*/, this.actionDispatcher.dispatch(new update_model_1.UpdateModelAction(input))]; + case 7: + _a.sent(); + return [3 /*break*/, 10]; + case 8: return [4 /*yield*/, this.actionDispatcher.dispatch(new set_model_1.SetModelAction(newRoot))]; + case 9: + _a.sent(); + _a.label = 10; + case 10: + updates.forEach(function (d) { return d.resolve(); }); + return [2 /*return*/]; + } + }); + }); + }; + /** + * Modify the current model with an array of matches. + */ + LocalModelSource.prototype.applyMatches = function (matches) { + var root = this.currentRoot; + model_matching_1.applyMatches(root, matches); + return this.submitModel(root, matches); + }; + /** + * Modify the current model by adding new elements. + */ + LocalModelSource.prototype.addElements = function (elements) { + var matches = []; + for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { + var e = elements_1[_i]; + var anye = e; + if (anye.element !== undefined && anye.parentId !== undefined) { + matches.push({ + right: anye.element, + rightParentId: anye.parentId + }); + } + else if (anye.id !== undefined) { + matches.push({ + right: anye, + rightParentId: this.currentRoot.id + }); + } + } + return this.applyMatches(matches); + }; + /** + * Modify the current model by removing elements. + */ + LocalModelSource.prototype.removeElements = function (elements) { + var matches = []; + var index = new smodel_1.SModelIndex(); + index.add(this.currentRoot); + for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { + var e = elements_2[_i]; + var anye = e; + if (anye.elementId !== undefined && anye.parentId !== undefined) { + var element = index.getById(anye.elementId); + if (element !== undefined) { + matches.push({ + left: element, + leftParentId: anye.parentId + }); + } + } + else { + var element = index.getById(anye); + if (element !== undefined) { + matches.push({ + left: element, + leftParentId: this.currentRoot.id + }); + } + } + } + return this.applyMatches(matches); + }; + // ----- Methods for handling incoming actions ---------------------------- + LocalModelSource.prototype.handle = function (action) { + switch (action.kind) { + case set_model_1.RequestModelAction.KIND: + this.handleRequestModel(action); + break; + case bounds_manipulation_1.ComputedBoundsAction.KIND: + this.handleComputedBounds(action); + break; + case hover_1.RequestPopupModelAction.KIND: + this.handleRequestPopupModel(action); + break; + case svg_exporter_1.ExportSvgAction.KIND: + this.handleExportSvgAction(action); + break; + } + }; + LocalModelSource.prototype.handleRequestModel = function (action) { + this.submitModel(this.currentRoot, false); + }; + LocalModelSource.prototype.handleComputedBounds = function (action) { + var root = this.currentRoot; + var index = new smodel_1.SModelIndex(); + index.add(root); + for (var _i = 0, _a = action.bounds; _i < _a.length; _i++) { + var b = _a[_i]; + var element = index.getById(b.elementId); + if (element !== undefined) + this.applyBounds(element, b.newBounds); + } + if (action.alignments !== undefined) { + for (var _b = 0, _c = action.alignments; _b < _c.length; _b++) { + var a = _c[_b]; + var element = index.getById(a.elementId); + if (element !== undefined) + this.applyAlignment(element, a.newAlignment); + } + } + this.doSubmitModel(root, true, index); + }; + LocalModelSource.prototype.applyBounds = function (element, newBounds) { + var e = element; + e.position = { x: newBounds.x, y: newBounds.y }; + e.size = { width: newBounds.width, height: newBounds.height }; + }; + LocalModelSource.prototype.applyAlignment = function (element, newAlignment) { + var e = element; + e.alignment = { x: newAlignment.x, y: newAlignment.y }; + }; + LocalModelSource.prototype.handleRequestPopupModel = function (action) { + if (this.popupModelProvider !== undefined) { + var element = smodel_utils_1.findElement(this.currentRoot, action.elementId); + var popupRoot = this.popupModelProvider.getPopupModel(action, element); + if (popupRoot !== undefined) { + popupRoot.canvasBounds = action.bounds; + this.actionDispatcher.dispatch(new hover_1.SetPopupModelAction(popupRoot)); + } + } + }; + LocalModelSource.prototype.handleExportSvgAction = function (action) { + var blob = new Blob([action.svg], { type: "text/plain;charset=utf-8" }); + file_saver_1.saveAs(blob, "diagram.svg"); + }; + __decorate([ + inversify_1.inject(types_1.TYPES.ILogger), + __metadata("design:type", Object) + ], LocalModelSource.prototype, "logger", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.IPopupModelProvider), inversify_1.optional(), + __metadata("design:type", Object) + ], LocalModelSource.prototype, "popupModelProvider", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.IModelLayoutEngine), inversify_1.optional(), + __metadata("design:type", Object) + ], LocalModelSource.prototype, "layoutEngine", void 0); + LocalModelSource = __decorate([ + inversify_1.injectable() + ], LocalModelSource); + return LocalModelSource; +}(model_source_1.ModelSource)); +exports.LocalModelSource = LocalModelSource; +//# sourceMappingURL=local-model-source.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/model-source/logging.js": +/*!**********************************************************!*\ + !*** ./node_modules/sprotty/lib/model-source/logging.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var logging_1 = __webpack_require__(/*! ../utils/logging */ "./node_modules/sprotty/lib/utils/logging.js"); +var types_1 = __webpack_require__(/*! ../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var LoggingAction = /** @class */ (function () { + function LoggingAction(severity, time, caller, message, params) { + this.severity = severity; + this.time = time; + this.caller = caller; + this.message = message; + this.params = params; + this.kind = LoggingAction.KIND; + } + LoggingAction.KIND = 'logging'; + return LoggingAction; +}()); +exports.LoggingAction = LoggingAction; +/** + * A logger that forwards messages of type 'error', 'warn', and 'info' to the model source. + */ +var ForwardingLogger = /** @class */ (function () { + function ForwardingLogger() { + } + ForwardingLogger.prototype.error = function (thisArg, message) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + if (this.logLevel >= logging_1.LogLevel.error) + this.forward(thisArg, message, logging_1.LogLevel.error, params); + }; + ForwardingLogger.prototype.warn = function (thisArg, message) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + if (this.logLevel >= logging_1.LogLevel.warn) + this.forward(thisArg, message, logging_1.LogLevel.warn, params); + }; + ForwardingLogger.prototype.info = function (thisArg, message) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + if (this.logLevel >= logging_1.LogLevel.info) + this.forward(thisArg, message, logging_1.LogLevel.info, params); + }; + ForwardingLogger.prototype.log = function (thisArg, message) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + if (this.logLevel >= logging_1.LogLevel.log) { + // We cannot forward 'log' level messages since that would lead to endless loops + try { + var caller = typeof thisArg === 'object' ? thisArg.constructor.name : String(thisArg); + console.log.apply(thisArg, [caller + ': ' + message].concat(params)); + } + catch (error) { } + } + }; + ForwardingLogger.prototype.forward = function (thisArg, message, logLevel, params) { + var date = new Date(); + var action = new LoggingAction(logging_1.LogLevel[logLevel], date.toLocaleTimeString(), typeof thisArg === 'object' ? thisArg.constructor.name : String(thisArg), message, params.map(function (p) { return JSON.stringify(p); })); + this.modelSourceProvider().then(function (modelSource) { + try { + modelSource.handle(action); + } + catch (error) { + try { + console.log.apply(thisArg, [message, action, error]); + } + catch (error) { } + } + }); + }; + __decorate([ + inversify_1.inject(types_1.TYPES.ModelSourceProvider), + __metadata("design:type", Function) + ], ForwardingLogger.prototype, "modelSourceProvider", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.LogLevel), + __metadata("design:type", Number) + ], ForwardingLogger.prototype, "logLevel", void 0); + ForwardingLogger = __decorate([ + inversify_1.injectable() + ], ForwardingLogger); + return ForwardingLogger; +}()); +exports.ForwardingLogger = ForwardingLogger; +//# sourceMappingURL=logging.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/model-source/model-source.js": +/*!***************************************************************!*\ + !*** ./node_modules/sprotty/lib/model-source/model-source.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var set_model_1 = __webpack_require__(/*! ../base/features/set-model */ "./node_modules/sprotty/lib/base/features/set-model.js"); +var types_1 = __webpack_require__(/*! ../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var svg_exporter_1 = __webpack_require__(/*! ../features/export/svg-exporter */ "./node_modules/sprotty/lib/features/export/svg-exporter.js"); +/** + * A model source is serving the model to the event cycle. It represents + * the entry point to the client for external sources, such as model + * editors. + * + * As an IActionHandler it listens to actions in and reacts to them with + * commands or actions if necessary. This way, you can implement action + * protocols between the client and the outside world. + * + * There are two default implementations for a ModelSource: + * + * the LocalModelSource handles the actions to calculate bounds and + * set/update the model + * the DiagramServer connects via websocket to a remote source. It + * can be used to connect to a model editor that provides the model, + * layouts diagrams, transfers selection and answers model queries from + * the client. + */ +var ModelSource = /** @class */ (function () { + function ModelSource() { + } + ModelSource.prototype.initialize = function (registry) { + // Register this model source + registry.register(set_model_1.RequestModelAction.KIND, this); + registry.register(svg_exporter_1.ExportSvgAction.KIND, this); + }; + __decorate([ + inversify_1.inject(types_1.TYPES.IActionDispatcher), + __metadata("design:type", Object) + ], ModelSource.prototype, "actionDispatcher", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.ViewerOptions), + __metadata("design:type", Object) + ], ModelSource.prototype, "viewerOptions", void 0); + ModelSource = __decorate([ + inversify_1.injectable() + ], ModelSource); + return ModelSource; +}()); +exports.ModelSource = ModelSource; +//# sourceMappingURL=model-source.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/model-source/websocket.js": +/*!************************************************************!*\ + !*** ./node_modules/sprotty/lib/model-source/websocket.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var diagram_server_1 = __webpack_require__(/*! ./diagram-server */ "./node_modules/sprotty/lib/model-source/diagram-server.js"); +/** + * An external ModelSource that connects to the model provider using a + * websocket. + */ +var WebSocketDiagramServer = /** @class */ (function (_super) { + __extends(WebSocketDiagramServer, _super); + function WebSocketDiagramServer() { + return _super !== null && _super.apply(this, arguments) || this; + } + WebSocketDiagramServer.prototype.listen = function (webSocket) { + var _this = this; + webSocket.addEventListener('message', function (event) { + _this.messageReceived(event.data); + }); + webSocket.addEventListener('error', function (event) { + _this.logger.error(_this, 'error event received', event); + }); + this.webSocket = webSocket; + }; + WebSocketDiagramServer.prototype.disconnect = function () { + if (this.webSocket) { + this.webSocket.close(); + this.webSocket = undefined; + } + }; + WebSocketDiagramServer.prototype.sendMessage = function (message) { + if (this.webSocket) { + this.webSocket.send(JSON.stringify(message)); + } + else { + throw new Error('WebSocket is not connected'); + } + }; + WebSocketDiagramServer = __decorate([ + inversify_1.injectable() + ], WebSocketDiagramServer); + return WebSocketDiagramServer; +}(diagram_server_1.DiagramServer)); +exports.WebSocketDiagramServer = WebSocketDiagramServer; +//# sourceMappingURL=websocket.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/utils/async.js": +/*!*************************************************!*\ + !*** ./node_modules/sprotty/lib/utils/async.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Simple implementation of the deferred pattern. + * An object that exposes a promise and functions to resolve and reject it. + */ +var Deferred = /** @class */ (function () { + function Deferred() { + var _this = this; + this.promise = new Promise(function (resolve, reject) { + _this.resolve = resolve; + _this.reject = reject; + }); + } + return Deferred; +}()); +exports.Deferred = Deferred; +//# sourceMappingURL=async.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/utils/browser.js": +/*!***************************************************!*\ + !*** ./node_modules/sprotty/lib/utils/browser.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Returns whether the mouse or keyboard event includes the CMD key + * on Mac or CTRL key on Linux / others. + */ +function isCtrlOrCmd(event) { + if (isMac()) + return event.metaKey; + else + return event.ctrlKey; +} +exports.isCtrlOrCmd = isCtrlOrCmd; +function isMac() { + return window.navigator.userAgent.indexOf("Mac") !== -1; +} +exports.isMac = isMac; +function isCrossSite(url) { + if (url && typeof window !== 'undefined' && window.location) { + var baseURL = ''; + if (window.location.protocol) + baseURL += window.location.protocol + '//'; + if (window.location.host) + baseURL += window.location.host; + return baseURL.length > 0 && !url.startsWith(baseURL); + } + return false; +} +exports.isCrossSite = isCrossSite; +//# sourceMappingURL=browser.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/utils/color.js": +/*!*************************************************!*\ + !*** ./node_modules/sprotty/lib/utils/color.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +function rgb(red, green, blue) { + return { + red: red, + green: green, + blue: blue + }; +} +exports.rgb = rgb; +function toSVG(c) { + return 'rgb(' + c.red + ',' + c.green + ',' + c.blue + ')'; +} +exports.toSVG = toSVG; +var ColorMap = /** @class */ (function () { + function ColorMap(stops) { + this.stops = stops; + } + ColorMap.prototype.getColor = function (t) { + t = Math.max(0, Math.min(0.99999999, t)); + var i = Math.floor(t * this.stops.length); + return this.stops[i]; + }; + return ColorMap; +}()); +exports.ColorMap = ColorMap; +//# sourceMappingURL=color.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/utils/geometry.js": +/*!****************************************************!*\ + !*** ./node_modules/sprotty/lib/utils/geometry.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * (x,y) coordinates of the origin. + */ +exports.ORIGIN_POINT = Object.freeze({ + x: 0, + y: 0 +}); +/** + * Adds two points. + * @param {Point} p1 - First point + * @param {Point} p2 - Second point + * @returns {Point} The sum of the two points + */ +function add(p1, p2) { + return { + x: p1.x + p2.x, + y: p1.y + p2.y + }; +} +exports.add = add; +/** + * Subtracts two points. + * @param {Point} p1 - First point + * @param {Point} p2 - Second point + * @returns {Point} The difference of the two points + */ +function subtract(p1, p2) { + return { + x: p1.x - p2.x, + y: p1.y - p2.y + }; +} +exports.subtract = subtract; +/** + * A dimension with both width and height set to a negative value, which is considered as undefined. + */ +exports.EMPTY_DIMENSION = Object.freeze({ + width: -1, + height: -1 +}); +/** + * Checks whether the given dimention is valid, i.e. the width and height are non-zero. + * @param {Dimension} b - Dimension object + * @returns {boolean} + */ +function isValidDimension(d) { + return d.width >= 0 && d.height >= 0; +} +exports.isValidDimension = isValidDimension; +exports.EMPTY_BOUNDS = Object.freeze({ + x: 0, + y: 0, + width: -1, + height: -1 +}); +function isBounds(element) { + return 'x' in element + && 'y' in element + && 'width' in element + && 'height' in element; +} +exports.isBounds = isBounds; +/** + * Combines the bounds of two objects into one, so that the new bounds + * are the minimum bounds that covers both of the original bounds. + * @param {Bounds} b0 - First bounds object + * @param {Bounds} b1 - Second bounds object + * @returns {Bounds} The combined bounds + */ +function combine(b0, b1) { + if (!isValidDimension(b0)) + return isValidDimension(b1) ? b1 : exports.EMPTY_BOUNDS; + if (!isValidDimension(b1)) + return b0; + var minX = Math.min(b0.x, b1.x); + var minY = Math.min(b0.y, b1.y); + var maxX = Math.max(b0.x + (b0.width >= 0 ? b0.width : 0), b1.x + (b1.width >= 0 ? b1.width : 0)); + var maxY = Math.max(b0.y + (b0.height >= 0 ? b0.height : 0), b1.y + (b1.height >= 0 ? b1.height : 0)); + return { + x: minX, y: minY, width: maxX - minX, height: maxY - minY + }; +} +exports.combine = combine; +/** + * Translates the given bounds. + * @param {Bounds} b - Bounds object + * @param {Point} p - Vector by which to translate the bounds + * @returns {Bounds} The translated bounds + */ +function translate(b, p) { + return { + x: b.x + p.x, + y: b.y + p.y, + width: b.width, + height: b.height + }; +} +exports.translate = translate; +/** + * Returns the center point of the bounds of an object + * @param {Bounds} b - Bounds object + * @returns {Point} the center point + */ +function center(b) { + return { + x: b.x + (b.width >= 0 ? 0.5 * b.width : 0), + y: b.y + (b.height >= 0 ? 0.5 * b.height : 0) + }; +} +exports.center = center; +function centerOfLine(s, e) { + var b = { + x: s.x > e.x ? e.x : s.x, + y: s.y > e.y ? e.y : s.y, + width: Math.abs(e.x - s.x), + height: Math.abs(e.y - s.y) + }; + return center(b); +} +exports.centerOfLine = centerOfLine; +/** + * Checks whether the point p is included in the bounds b. + */ +function includes(b, p) { + return p.x >= b.x && p.x <= b.x + b.width && p.y >= b.y && p.y <= b.y + b.height; +} +exports.includes = includes; +/** + * Enumeration of possible directions (left, right, up, down) + * @deprecated do we use this? We should rather use a string type + */ +var Direction; +(function (Direction) { + Direction[Direction["left"] = 0] = "left"; + Direction[Direction["right"] = 1] = "right"; + Direction[Direction["up"] = 2] = "up"; + Direction[Direction["down"] = 3] = "down"; +})(Direction = exports.Direction || (exports.Direction = {})); +/** + * Returns the "straight line" distance between two points. + * @param {Point} a - First point + * @param {Point} b - Second point + * @returns {number} The Eucledian distance + */ +function euclideanDistance(a, b) { + var dx = b.x - a.x; + var dy = b.y - a.y; + return Math.sqrt(dx * dx + dy * dy); +} +exports.euclideanDistance = euclideanDistance; +/** + * Returns the distance between two points in a grid, using a + * strictly vertical and/or horizontal path (versus straight line). + * @param {Point} a - First point + * @param {Point} b - Second point + * @returns {number} The Manhattan distance + */ +function manhattanDistance(a, b) { + return Math.abs(b.x - a.x) + Math.abs(b.y - a.y); +} +exports.manhattanDistance = manhattanDistance; +/** + * Returns the maximum of the horizontal and the vertical distance. + * @param {Point} a - First point + * @param {Point} b - Second point + * @returns {number} The maximum distance + */ +function maxDistance(a, b) { + return Math.max(Math.abs(b.x - a.x), Math.abs(b.y - a.y)); +} +exports.maxDistance = maxDistance; +/** + * Computes the angle in radians of the given point to the x-axis of the coordinate system. + * The result is in the range [-pi, pi]. + * @param {Point} p - A point in the Eucledian plane + */ +function angleOfPoint(p) { + return Math.atan2(p.y, p.x); +} +exports.angleOfPoint = angleOfPoint; +/** + * Computes the angle in radians between the two given points (relative to the origin of the coordinate system). + * The result is in the range [0, pi]. Returns NaN if the points are equal. + * @param {Point} a - First point + * @param {Point} b - Second point + */ +function angleBetweenPoints(a, b) { + var lengthProduct = Math.sqrt((a.x * a.x + a.y * a.y) * (b.x * b.x + b.y * b.y)); + if (isNaN(lengthProduct) || lengthProduct === 0) + return NaN; + var dotProduct = a.x * b.x + a.y * b.y; + return Math.acos(dotProduct / lengthProduct); +} +exports.angleBetweenPoints = angleBetweenPoints; +/** + * Computes a point that is the original `point` shifted towards `refPoint` by the given `distance`. + * @param {Point} point - Point to shift + * @param {Point} refPoint - Point to shift towards + * @param {Point} distance - Distance to shift + */ +function shiftTowards(point, refPoint, distance) { + var diff = subtract(refPoint, point); + var normalized = normalize(diff); + var shift = { x: normalized.x * distance, y: normalized.y * distance }; + return add(point, shift); +} +exports.shiftTowards = shiftTowards; +/** + * Computes the normalized vector from the vector given in `point`; that is, computing its unit vector. + * @param {Point} point - Point representing the vector to be normalized + * @returns {Point} The normalized point + */ +function normalize(point) { + var mag = magnitude(point); + if (mag === 0 || mag === 1) { + return exports.ORIGIN_POINT; + } + return { + x: point.x / mag, + y: point.y / mag + }; +} +exports.normalize = normalize; +/** + * Computes the magnitude of the vector given in `point`. + * @param {Point} point - Point representing the vector to compute the magnitude for + * @returns {number} The magnitude or also known as length of the `point` + */ +function magnitude(point) { + return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2)); +} +exports.magnitude = magnitude; +/** + * Converts from radians to degrees + * @param {number} a - A value in radians + * @returns {number} The converted value + */ +function toDegrees(a) { + return a * 180 / Math.PI; +} +exports.toDegrees = toDegrees; +/** + * Converts from degrees to radians + * @param {number} a - A value in degrees + * @returns {number} The converted value + */ +function toRadians(a) { + return a * Math.PI / 180; +} +exports.toRadians = toRadians; +/** + * Returns whether two numbers are almost equal, within a small margin (0.001) + * @param {number} a - First number + * @param {number} b - Second number + * @returns {boolean} True if the two numbers are almost equal + */ +function almostEquals(a, b) { + return Math.abs(a - b) < 1e-3; +} +exports.almostEquals = almostEquals; +/** + * Calculates a linear combination of p0 and p1 using lambda, i.e. + * (1-lambda) * p0 + lambda * p1 + * @param p0 + * @param p1 + * @param lambda + */ +function linear(p0, p1, lambda) { + return { + x: (1 - lambda) * p0.x + lambda * p1.x, + y: (1 - lambda) * p0.y + lambda * p1.y + }; +} +exports.linear = linear; +/** + * A diamond or rhombus is a quadrilateral whose four sides all have the same length. + * It consinsts of four points, a `topPoint`, `rightPoint`, `bottomPoint`, and a `leftPoint`, + * which are connected by four lines -- the `topRightSideLight`, `topLeftSideLine`, `bottomRightSideLine`, + * and the `bottomLeftSideLine`. + */ +var Diamond = /** @class */ (function () { + function Diamond(bounds) { + this.bounds = bounds; + } + Object.defineProperty(Diamond.prototype, "topPoint", { + get: function () { + return { + x: this.bounds.x + this.bounds.width / 2, + y: this.bounds.y + }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Diamond.prototype, "rightPoint", { + get: function () { + return { + x: this.bounds.x + this.bounds.width, + y: this.bounds.y + this.bounds.height / 2 + }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Diamond.prototype, "bottomPoint", { + get: function () { + return { + x: this.bounds.x + this.bounds.width / 2, + y: this.bounds.y + this.bounds.height + }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Diamond.prototype, "leftPoint", { + get: function () { + return { + x: this.bounds.x, + y: this.bounds.y + this.bounds.height / 2 + }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Diamond.prototype, "topRightSideLine", { + get: function () { + return new PointToPointLine(this.topPoint, this.rightPoint); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Diamond.prototype, "topLeftSideLine", { + get: function () { + return new PointToPointLine(this.topPoint, this.leftPoint); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Diamond.prototype, "bottomRightSideLine", { + get: function () { + return new PointToPointLine(this.bottomPoint, this.rightPoint); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Diamond.prototype, "bottomLeftSideLine", { + get: function () { + return new PointToPointLine(this.bottomPoint, this.leftPoint); + }, + enumerable: true, + configurable: true + }); + /** + * Return the closest side of this diamond to the specified `refPoint`. + * @param {Point} refPoint a reference point + * @returns {Line} a line representing the closest side + */ + Diamond.prototype.closestSideLine = function (refPoint) { + var c = center(this.bounds); + if (refPoint.x > c.x) { + if (refPoint.y > c.y) { + return this.bottomRightSideLine; + } + else { + return this.topRightSideLine; + } + } + else { + if (refPoint.y > c.y) { + return this.bottomLeftSideLine; + } + else { + return this.topLeftSideLine; + } + } + }; + return Diamond; +}()); +exports.Diamond = Diamond; +/** + * A line made up from two points. + */ +var PointToPointLine = /** @class */ (function () { + function PointToPointLine(p1, p2) { + this.p1 = p1; + this.p2 = p2; + } + Object.defineProperty(PointToPointLine.prototype, "a", { + get: function () { + return this.p1.y - this.p2.y; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PointToPointLine.prototype, "b", { + get: function () { + return this.p2.x - this.p1.x; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PointToPointLine.prototype, "c", { + get: function () { + return this.p2.x * this.p1.y - this.p1.x * this.p2.y; + }, + enumerable: true, + configurable: true + }); + return PointToPointLine; +}()); +exports.PointToPointLine = PointToPointLine; +/** + * Returns the intersection of two lines `l1` and `l2` + * @param {Line} l1 - A line + * @param {Line} l2 - Another line + * @returns {Point} The intersection point of `l1` and `l2` + */ +function intersection(l1, l2) { + return { + x: (l1.c * l2.b - l2.c * l1.b) / (l1.a * l2.b - l2.a * l1.b), + y: (l1.a * l2.c - l2.a * l1.c) / (l1.a * l2.b - l2.a * l1.b) + }; +} +exports.intersection = intersection; +//# sourceMappingURL=geometry.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/utils/inversify.js": +/*!*****************************************************!*\ + !*** ./node_modules/sprotty/lib/utils/inversify.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2019 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +function isInjectable(constr) { + return Reflect.getMetadata('inversify:paramtypes', constr) !== undefined; +} +exports.isInjectable = isInjectable; +//# sourceMappingURL=inversify.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/utils/iterable.js": +/*!****************************************************!*\ + !*** ./node_modules/sprotty/lib/utils/iterable.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * A helper class that allows to easily create fluent iterables. + */ +var FluentIterableImpl = /** @class */ (function () { + function FluentIterableImpl(startFn, nextFn) { + this.startFn = startFn; + this.nextFn = nextFn; + } + FluentIterableImpl.prototype[Symbol.iterator] = function () { + var _a; + var _this = this; + var iterator = (_a = { + state: this.startFn(), + next: function () { return _this.nextFn(iterator.state); } + }, + _a[Symbol.iterator] = function () { return iterator; }, + _a); + return iterator; + }; + FluentIterableImpl.prototype.filter = function (callback) { + return filterIterable(this, callback); + }; + FluentIterableImpl.prototype.map = function (callback) { + return mapIterable(this, callback); + }; + FluentIterableImpl.prototype.forEach = function (callback) { + var iterator = this[Symbol.iterator](); + var index = 0; + var result; + do { + result = iterator.next(); + if (result.value !== undefined) + callback(result.value, index); + index++; + } while (!result.done); + }; + FluentIterableImpl.prototype.indexOf = function (element) { + var iterator = this[Symbol.iterator](); + var index = 0; + var result; + do { + result = iterator.next(); + if (result.value === element) + return index; + index++; + } while (!result.done); + return -1; + }; + return FluentIterableImpl; +}()); +exports.FluentIterableImpl = FluentIterableImpl; +/** + * Converts a FluentIterable into an array. If the input is an array, it is returned unchanged. + */ +function toArray(input) { + if (input.constructor === Array) { + return input; + } + var result = []; + input.forEach(function (element) { return result.push(element); }); + return result; +} +exports.toArray = toArray; +exports.DONE_RESULT = Object.freeze({ done: true, value: undefined }); +/** + * Create a fluent iterable that filters the content of the given iterable or array. + */ +function filterIterable(input, callback) { + return new FluentIterableImpl(function () { return createIterator(input); }, function (iterator) { + var result; + do { + result = iterator.next(); + } while (!result.done && !callback(result.value)); + return result; + }); +} +exports.filterIterable = filterIterable; +/** + * Create a fluent iterable that maps the content of the given iterable or array. + */ +function mapIterable(input, callback) { + return new FluentIterableImpl(function () { return createIterator(input); }, function (iterator) { + var _a = iterator.next(), done = _a.done, value = _a.value; + if (done) + return exports.DONE_RESULT; + else + return { done: false, value: callback(value) }; + }); +} +exports.mapIterable = mapIterable; +/** + * Create an iterator for the given iterable or array. + */ +function createIterator(collection) { + var method = collection[Symbol.iterator]; + if (typeof method === 'function') { + return method.call(collection); + } + var length = collection.length; + if (typeof length === 'number' && length >= 0) { + return new ArrayIterator(collection); + } + return { next: function () { return exports.DONE_RESULT; } }; +} +/** + * Iterator implementation for arrays. + */ +var ArrayIterator = /** @class */ (function () { + function ArrayIterator(array) { + this.array = array; + this.index = 0; + } + ArrayIterator.prototype.next = function () { + if (this.index < this.array.length) + return { done: false, value: this.array[this.index++] }; + else + return exports.DONE_RESULT; + }; + ArrayIterator.prototype[Symbol.iterator] = function () { + return this; + }; + return ArrayIterator; +}()); +//# sourceMappingURL=iterable.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/utils/keyboard.js": +/*!****************************************************!*\ + !*** ./node_modules/sprotty/lib/utils/keyboard.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +var browser_1 = __webpack_require__(/*! ./browser */ "./node_modules/sprotty/lib/utils/browser.js"); +/** + * Returns whether the keyboard event matches the keystroke described by the given + * code and modifiers. The code must comply to the format of the `code` property + * of KeyboardEvent, but in contrast to that property, the actual keyboard layout is + * considered by this function if possible. + */ +function matchesKeystroke(event, code) { + var modifiers = []; + for (var _i = 2; _i < arguments.length; _i++) { + modifiers[_i - 2] = arguments[_i]; + } + if (getActualCode(event) !== code) + return false; + if (browser_1.isMac()) { + if (event.ctrlKey !== (modifiers.findIndex(function (m) { return m === 'ctrl'; }) >= 0)) + return false; + if (event.metaKey !== (modifiers.findIndex(function (m) { return m === 'meta' || m === 'ctrlCmd'; }) >= 0)) + return false; + } + else { + if (event.ctrlKey !== (modifiers.findIndex(function (m) { return m === 'ctrl' || m === 'ctrlCmd'; }) >= 0)) + return false; + if (event.metaKey !== (modifiers.findIndex(function (m) { return m === 'meta'; }) >= 0)) + return false; + } + if (event.altKey !== (modifiers.findIndex(function (m) { return m === 'alt'; }) >= 0)) + return false; + if (event.shiftKey !== (modifiers.findIndex(function (m) { return m === 'shift'; }) >= 0)) + return false; + return true; +} +exports.matchesKeystroke = matchesKeystroke; +/** + * Determines a key code from the given event. This is necessary because the `code` property of + * a KeyboardEvent does not consider keyboard layouts. + */ +function getActualCode(event) { + if (event.keyCode) { + var result = STRING_CODE[event.keyCode]; + if (result !== undefined) + return result; + } + return event.code; +} +exports.getActualCode = getActualCode; +var STRING_CODE = new Array(256); +(function () { + function addKeyCode(stringCode, numericCode) { + if (STRING_CODE[numericCode] === undefined) + STRING_CODE[numericCode] = stringCode; + } + addKeyCode('Pause', 3); + addKeyCode('Backspace', 8); + addKeyCode('Tab', 9); + addKeyCode('Enter', 13); + addKeyCode('ShiftLeft', 16); + addKeyCode('ShiftRight', 16); + addKeyCode('ControlLeft', 17); + addKeyCode('ControlRight', 17); + addKeyCode('AltLeft', 18); + addKeyCode('AltRight', 18); + addKeyCode('CapsLock', 20); + addKeyCode('Escape', 27); + addKeyCode('Space', 32); + addKeyCode('PageUp', 33); + addKeyCode('PageDown', 34); + addKeyCode('End', 35); + addKeyCode('Home', 36); + addKeyCode('ArrowLeft', 37); + addKeyCode('ArrowUp', 38); + addKeyCode('ArrowRight', 39); + addKeyCode('ArrowDown', 40); + addKeyCode('Insert', 45); + addKeyCode('Delete', 46); + addKeyCode('Digit1', 49); + addKeyCode('Digit2', 50); + addKeyCode('Digit3', 51); + addKeyCode('Digit4', 52); + addKeyCode('Digit5', 53); + addKeyCode('Digit6', 54); + addKeyCode('Digit7', 55); + addKeyCode('Digit8', 56); + addKeyCode('Digit9', 57); + addKeyCode('Digit0', 48); + addKeyCode('KeyA', 65); + addKeyCode('KeyB', 66); + addKeyCode('KeyC', 67); + addKeyCode('KeyD', 68); + addKeyCode('KeyE', 69); + addKeyCode('KeyF', 70); + addKeyCode('KeyG', 71); + addKeyCode('KeyH', 72); + addKeyCode('KeyI', 73); + addKeyCode('KeyJ', 74); + addKeyCode('KeyK', 75); + addKeyCode('KeyL', 76); + addKeyCode('KeyM', 77); + addKeyCode('KeyN', 78); + addKeyCode('KeyO', 79); + addKeyCode('KeyP', 80); + addKeyCode('KeyQ', 81); + addKeyCode('KeyR', 82); + addKeyCode('KeyS', 83); + addKeyCode('KeyT', 84); + addKeyCode('KeyU', 85); + addKeyCode('KeyV', 86); + addKeyCode('KeyW', 87); + addKeyCode('KeyX', 88); + addKeyCode('KeyY', 89); + addKeyCode('KeyZ', 90); + addKeyCode('OSLeft', 91); + addKeyCode('MetaLeft', 91); + addKeyCode('OSRight', 92); + addKeyCode('MetaRight', 92); + addKeyCode('ContextMenu', 93); + addKeyCode('Numpad0', 96); + addKeyCode('Numpad1', 97); + addKeyCode('Numpad2', 98); + addKeyCode('Numpad3', 99); + addKeyCode('Numpad4', 100); + addKeyCode('Numpad5', 101); + addKeyCode('Numpad6', 102); + addKeyCode('Numpad7', 103); + addKeyCode('Numpad8', 104); + addKeyCode('Numpad9', 105); + addKeyCode('NumpadMultiply', 106); + addKeyCode('NumpadAdd', 107); + addKeyCode('NumpadSeparator', 108); + addKeyCode('NumpadSubtract', 109); + addKeyCode('NumpadDecimal', 110); + addKeyCode('NumpadDivide', 111); + addKeyCode('F1', 112); + addKeyCode('F2', 113); + addKeyCode('F3', 114); + addKeyCode('F4', 115); + addKeyCode('F5', 116); + addKeyCode('F6', 117); + addKeyCode('F7', 118); + addKeyCode('F8', 119); + addKeyCode('F9', 120); + addKeyCode('F10', 121); + addKeyCode('F11', 122); + addKeyCode('F12', 123); + addKeyCode('F13', 124); + addKeyCode('F14', 125); + addKeyCode('F15', 126); + addKeyCode('F16', 127); + addKeyCode('F17', 128); + addKeyCode('F18', 129); + addKeyCode('F19', 130); + addKeyCode('F20', 131); + addKeyCode('F21', 132); + addKeyCode('F22', 133); + addKeyCode('F23', 134); + addKeyCode('F24', 135); + addKeyCode('NumLock', 144); + addKeyCode('ScrollLock', 145); + addKeyCode('Semicolon', 186); + addKeyCode('Equal', 187); + addKeyCode('Comma', 188); + addKeyCode('Minus', 189); + addKeyCode('Period', 190); + addKeyCode('Slash', 191); + addKeyCode('Backquote', 192); + addKeyCode('IntlRo', 193); + addKeyCode('BracketLeft', 219); + addKeyCode('Backslash', 220); + addKeyCode('BracketRight', 221); + addKeyCode('Quote', 222); + addKeyCode('IntlYen', 255); +})(); +//# sourceMappingURL=keyboard.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/utils/logging.js": +/*!***************************************************!*\ + !*** ./node_modules/sprotty/lib/utils/logging.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var types_1 = __webpack_require__(/*! ../base/types */ "./node_modules/sprotty/lib/base/types.js"); +var LogLevel; +(function (LogLevel) { + LogLevel[LogLevel["none"] = 0] = "none"; + LogLevel[LogLevel["error"] = 1] = "error"; + LogLevel[LogLevel["warn"] = 2] = "warn"; + LogLevel[LogLevel["info"] = 3] = "info"; + LogLevel[LogLevel["log"] = 4] = "log"; +})(LogLevel = exports.LogLevel || (exports.LogLevel = {})); +var NullLogger = /** @class */ (function () { + function NullLogger() { + this.logLevel = LogLevel.none; + } + NullLogger.prototype.error = function (thisArg, message) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + }; + NullLogger.prototype.warn = function (thisArg, message) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + }; + NullLogger.prototype.info = function (thisArg, message) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + }; + NullLogger.prototype.log = function (thisArg, message) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + }; + NullLogger = __decorate([ + inversify_1.injectable() + ], NullLogger); + return NullLogger; +}()); +exports.NullLogger = NullLogger; +var ConsoleLogger = /** @class */ (function () { + function ConsoleLogger() { + this.logLevel = LogLevel.log; + this.viewOptions = { baseDiv: '' }; + } + ConsoleLogger.prototype.error = function (thisArg, message) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + if (this.logLevel >= LogLevel.error) + try { + console.error.apply(thisArg, this.consoleArguments(thisArg, message, params)); + } + catch (error) { } + }; + ConsoleLogger.prototype.warn = function (thisArg, message) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + if (this.logLevel >= LogLevel.warn) + try { + console.warn.apply(thisArg, this.consoleArguments(thisArg, message, params)); + } + catch (error) { } + }; + ConsoleLogger.prototype.info = function (thisArg, message) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + if (this.logLevel >= LogLevel.info) + try { + console.info.apply(thisArg, this.consoleArguments(thisArg, message, params)); + } + catch (error) { } + }; + ConsoleLogger.prototype.log = function (thisArg, message) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + if (this.logLevel >= LogLevel.log) + try { + console.log.apply(thisArg, this.consoleArguments(thisArg, message, params)); + } + catch (error) { } + }; + ConsoleLogger.prototype.consoleArguments = function (thisArg, message, params) { + var caller; + if (typeof thisArg === 'object') + caller = thisArg.constructor.name; + else + caller = thisArg; + var date = new Date(); + return [date.toLocaleTimeString() + ' ' + this.viewOptions.baseDiv + ' ' + caller + ': ' + message].concat(params); + }; + __decorate([ + inversify_1.inject(types_1.TYPES.LogLevel), + __metadata("design:type", Number) + ], ConsoleLogger.prototype, "logLevel", void 0); + __decorate([ + inversify_1.inject(types_1.TYPES.ViewerOptions), + __metadata("design:type", Object) + ], ConsoleLogger.prototype, "viewOptions", void 0); + ConsoleLogger = __decorate([ + inversify_1.injectable() + ], ConsoleLogger); + return ConsoleLogger; +}()); +exports.ConsoleLogger = ConsoleLogger; +//# sourceMappingURL=logging.js.map + +/***/ }), + +/***/ "./node_modules/sprotty/lib/utils/registry.js": +/*!****************************************************!*\ + !*** ./node_modules/sprotty/lib/utils/registry.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/******************************************************************************** + * Copyright (c) 2017-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var inversify_1 = __webpack_require__(/*! inversify */ "./node_modules/inversify/lib/inversify.js"); +var ProviderRegistry = /** @class */ (function () { + function ProviderRegistry() { + this.elements = new Map; + } + ProviderRegistry.prototype.register = function (key, cstr) { + if (key === undefined) + throw new Error('Key is undefined'); + if (this.hasKey(key)) + throw new Error('Key is already registered: ' + key); + this.elements.set(key, cstr); + }; + ProviderRegistry.prototype.deregister = function (key) { + if (key === undefined) + throw new Error('Key is undefined'); + this.elements.delete(key); + }; + ProviderRegistry.prototype.hasKey = function (key) { + return this.elements.has(key); + }; + ProviderRegistry.prototype.get = function (key, arg) { + var existingCstr = this.elements.get(key); + if (existingCstr) + return new existingCstr(arg); + else + return this.missing(key, arg); + }; + ProviderRegistry.prototype.missing = function (key, arg) { + throw new Error('Unknown registry key: ' + key); + }; + ProviderRegistry = __decorate([ + inversify_1.injectable() + ], ProviderRegistry); + return ProviderRegistry; +}()); +exports.ProviderRegistry = ProviderRegistry; +var FactoryRegistry = /** @class */ (function () { + function FactoryRegistry() { + this.elements = new Map; + } + FactoryRegistry.prototype.register = function (key, factory) { + if (key === undefined) + throw new Error('Key is undefined'); + if (this.hasKey(key)) + throw new Error('Key is already registered: ' + key); + this.elements.set(key, factory); + }; + FactoryRegistry.prototype.deregister = function (key) { + if (key === undefined) + throw new Error('Key is undefined'); + this.elements.delete(key); + }; + FactoryRegistry.prototype.hasKey = function (key) { + return this.elements.has(key); + }; + FactoryRegistry.prototype.get = function (key, arg) { + var existingFactory = this.elements.get(key); + if (existingFactory) + return existingFactory(arg); + else + return this.missing(key, arg); + }; + FactoryRegistry.prototype.missing = function (key, arg) { + throw new Error('Unknown registry key: ' + key); + }; + FactoryRegistry = __decorate([ + inversify_1.injectable() + ], FactoryRegistry); + return FactoryRegistry; +}()); +exports.FactoryRegistry = FactoryRegistry; +var InstanceRegistry = /** @class */ (function () { + function InstanceRegistry() { + this.elements = new Map; + } + InstanceRegistry.prototype.register = function (key, instance) { + if (key === undefined) + throw new Error('Key is undefined'); + if (this.hasKey(key)) + throw new Error('Key is already registered: ' + key); + this.elements.set(key, instance); + }; + InstanceRegistry.prototype.deregister = function (key) { + if (key === undefined) + throw new Error('Key is undefined'); + this.elements.delete(key); + }; + InstanceRegistry.prototype.hasKey = function (key) { + return this.elements.has(key); + }; + InstanceRegistry.prototype.get = function (key) { + var existingInstance = this.elements.get(key); + if (existingInstance) + return existingInstance; + else + return this.missing(key); + }; + InstanceRegistry.prototype.missing = function (key) { + throw new Error('Unknown registry key: ' + key); + }; + InstanceRegistry = __decorate([ + inversify_1.injectable() + ], InstanceRegistry); + return InstanceRegistry; +}()); +exports.InstanceRegistry = InstanceRegistry; +var MultiInstanceRegistry = /** @class */ (function () { + function MultiInstanceRegistry() { + this.elements = new Map; + } + MultiInstanceRegistry.prototype.register = function (key, instance) { + if (key === undefined) + throw new Error('Key is undefined'); + var instances = this.elements.get(key); + if (instances !== undefined) + instances.push(instance); + else + this.elements.set(key, [instance]); + }; + MultiInstanceRegistry.prototype.deregisterAll = function (key) { + if (key === undefined) + throw new Error('Key is undefined'); + this.elements.delete(key); + }; + MultiInstanceRegistry.prototype.get = function (key) { + var existingInstances = this.elements.get(key); + if (existingInstances !== undefined) + return existingInstances; + else + return []; + }; + MultiInstanceRegistry = __decorate([ + inversify_1.injectable() + ], MultiInstanceRegistry); + return MultiInstanceRegistry; +}()); +exports.MultiInstanceRegistry = MultiInstanceRegistry; +//# sourceMappingURL=registry.js.map + +/***/ }), + +/***/ "./node_modules/style-loader/lib/addStyles.js": +/*!****************************************************!*\ + !*** ./node_modules/style-loader/lib/addStyles.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +var stylesInDom = {}; + +var memoize = function (fn) { + var memo; + + return function () { + if (typeof memo === "undefined") memo = fn.apply(this, arguments); + return memo; + }; +}; + +var isOldIE = memoize(function () { + // Test for IE <= 9 as proposed by Browserhacks + // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 + // Tests for existence of standard globals is to allow style-loader + // to operate correctly into non-standard environments + // @see https://github.com/webpack-contrib/style-loader/issues/177 + return window && document && document.all && !window.atob; +}); + +var getTarget = function (target, parent) { + if (parent){ + return parent.querySelector(target); + } + return document.querySelector(target); +}; + +var getElement = (function (fn) { + var memo = {}; + + return function(target, parent) { + // If passing function in options, then use it for resolve "head" element. + // Useful for Shadow Root style i.e + // { + // insertInto: function () { return document.querySelector("#foo").shadowRoot } + // } + if (typeof target === 'function') { + return target(); + } + if (typeof memo[target] === "undefined") { + var styleTarget = getTarget.call(this, target, parent); + // Special case to return head of iframe instead of iframe itself + if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { + try { + // This will throw an exception if access to iframe is blocked + // due to cross-origin restrictions + styleTarget = styleTarget.contentDocument.head; + } catch(e) { + styleTarget = null; + } + } + memo[target] = styleTarget; + } + return memo[target] + }; +})(); + +var singleton = null; +var singletonCounter = 0; +var stylesInsertedAtTop = []; + +var fixUrls = __webpack_require__(/*! ./urls */ "./node_modules/style-loader/lib/urls.js"); + +module.exports = function(list, options) { + if (typeof DEBUG !== "undefined" && DEBUG) { + if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); + } + + options = options || {}; + + options.attrs = typeof options.attrs === "object" ? options.attrs : {}; + + // Force single-tag solution on IE6-9, which has a hard limit on the # of
Promise#then()
Viewer
offStack
undo()
redo()
KIND
Action#kind
+ * export class MyCommand extends Command { + * static KIND = 'MyCommand' + * constructor(@inject(TYPES.Action) action: MyAction) { + * ... + * } + * @inject(TYPES.Action) + *