From 03db6c0d9182b22c43e6d44182a11e6b7510a15e Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 22 Sep 2021 12:41:24 -0400 Subject: [PATCH 1/2] LegacySplitCloneWorker is no longer used in any code paths Keeping things tidy... Signed-off-by: Matt Lord --- go/vt/worker/legacy_split_clone.go | 707 ------------------------ go/vt/worker/legacy_split_clone_cmd.go | 199 ------- go/vt/worker/legacy_split_clone_test.go | 491 ---------------- 3 files changed, 1397 deletions(-) delete mode 100644 go/vt/worker/legacy_split_clone.go delete mode 100644 go/vt/worker/legacy_split_clone_cmd.go delete mode 100644 go/vt/worker/legacy_split_clone_test.go diff --git a/go/vt/worker/legacy_split_clone.go b/go/vt/worker/legacy_split_clone.go deleted file mode 100644 index f51828f05c2..00000000000 --- a/go/vt/worker/legacy_split_clone.go +++ /dev/null @@ -1,707 +0,0 @@ -/* -Copyright 2019 The Vitess Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package worker - -// TODO(mberlin): Remove this file when SplitClone supports merge-sorting -// primary key columns based on the MySQL collation. - -import ( - "fmt" - "html/template" - "io" - "strings" - "sync" - "time" - - "vitess.io/vitess/go/vt/vterrors" - - "context" - - "vitess.io/vitess/go/event" - "vitess.io/vitess/go/sqlescape" - "vitess.io/vitess/go/sync2" - "vitess.io/vitess/go/vt/binlog/binlogplayer" - "vitess.io/vitess/go/vt/discovery" - "vitess.io/vitess/go/vt/throttler" - "vitess.io/vitess/go/vt/topo" - "vitess.io/vitess/go/vt/topo/topoproto" - "vitess.io/vitess/go/vt/topotools" - "vitess.io/vitess/go/vt/vtgate/vindexes" - "vitess.io/vitess/go/vt/worker/events" - "vitess.io/vitess/go/vt/wrangler" - - binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" - tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" - topodatapb "vitess.io/vitess/go/vt/proto/topodata" -) - -// LegacySplitCloneWorker will clone the data within a keyspace from a -// source set of shards to a destination set of shards. -type LegacySplitCloneWorker struct { - StatusWorker - - wr *wrangler.Wrangler - cell string - keyspace string - shard string - excludeTables []string - sourceReaderCount int - destinationPackCount int - destinationWriterCount int - minHealthyRdonlyTablets int - maxTPS int64 - cleaner *wrangler.Cleaner - - // populated during WorkerStateInit, read-only after that - keyspaceInfo *topo.KeyspaceInfo - sourceShards []*topo.ShardInfo - destinationShards []*topo.ShardInfo - - // populated during WorkerStateFindTargets, read-only after that - sourceAliases []*topodatapb.TabletAlias - sourceTablets []*topodatapb.Tablet - // healthCheck tracks the health of all PRIMARY and REPLICA tablets. - // It must be closed at the end of the command. - healthCheck discovery.LegacyHealthCheck - tsc *discovery.LegacyTabletStatsCache - // destinationShardWatchers contains a LegacyTopologyWatcher for each destination - // shard. It updates the list of tablets in the healthcheck if replicas are - // added/removed. - // Each watcher must be stopped at the end of the command. - destinationShardWatchers []*discovery.LegacyTopologyWatcher - // destinationDbNames stores for each destination keyspace/shard the MySQL - // database name. - // Example Map Entry: test_keyspace/-80 => vt_test_keyspace - destinationDbNames map[string]string - // destionThrottlers stores for each destination keyspace/shard the - // Throttler instance which will limit the write throughput. - destinationThrottlers map[string]*throttler.Throttler - - // populated during WorkerStateCopy - // tableStatusList holds the status for each table. - tableStatusList tableStatusList - - ev *events.SplitClone -} - -// NewLegacySplitCloneWorker returns a new LegacySplitCloneWorker object. -func NewLegacySplitCloneWorker(wr *wrangler.Wrangler, cell, keyspace, shard string, excludeTables []string, sourceReaderCount, destinationPackCount, destinationWriterCount, minHealthyRdonlyTablets int, maxTPS int64) (Worker, error) { - if maxTPS != throttler.MaxRateModuleDisabled { - wr.Logger().Infof("throttling enabled and set to a max of %v transactions/second", maxTPS) - } - if maxTPS != throttler.MaxRateModuleDisabled && maxTPS < int64(destinationWriterCount) { - return nil, fmt.Errorf("-max_tps must be >= -destination_writer_count: %v >= %v", maxTPS, destinationWriterCount) - } - return &LegacySplitCloneWorker{ - StatusWorker: NewStatusWorker(), - wr: wr, - cell: cell, - keyspace: keyspace, - shard: shard, - excludeTables: excludeTables, - sourceReaderCount: sourceReaderCount, - destinationPackCount: destinationPackCount, - destinationWriterCount: destinationWriterCount, - minHealthyRdonlyTablets: minHealthyRdonlyTablets, - maxTPS: maxTPS, - cleaner: &wrangler.Cleaner{}, - - destinationDbNames: make(map[string]string), - destinationThrottlers: make(map[string]*throttler.Throttler), - - ev: &events.SplitClone{ - Cell: cell, - Keyspace: keyspace, - Shard: shard, - ExcludeTables: excludeTables, - }, - }, nil -} - -func (scw *LegacySplitCloneWorker) setState(state StatusWorkerState) { - scw.SetState(state) - event.DispatchUpdate(scw.ev, state.String()) -} - -func (scw *LegacySplitCloneWorker) setErrorState(err error) { - scw.SetState(WorkerStateError) - event.DispatchUpdate(scw.ev, "error: "+err.Error()) -} - -func (scw *LegacySplitCloneWorker) formatSources() string { - result := "" - for _, alias := range scw.sourceAliases { - result += " " + topoproto.TabletAliasString(alias) - } - return result -} - -// StatusAsHTML implements the Worker interface -func (scw *LegacySplitCloneWorker) StatusAsHTML() template.HTML { - state := scw.State() - - result := "Working on: " + scw.keyspace + "/" + scw.shard + "
\n" - result += "State: " + state.String() + "
\n" - switch state { - case WorkerStateCloneOnline: - result += "Running:
\n" - result += "Copying from: " + scw.formatSources() + "
\n" - statuses, eta := scw.tableStatusList.format() - result += "ETA: " + eta.String() + "
\n" - result += strings.Join(statuses, "
\n") - case WorkerStateDone: - result += "Success:
\n" - statuses, _ := scw.tableStatusList.format() - result += strings.Join(statuses, "
\n") - } - - return template.HTML(result) -} - -// StatusAsText implements the Worker interface -func (scw *LegacySplitCloneWorker) StatusAsText() string { - state := scw.State() - - result := "Working on: " + scw.keyspace + "/" + scw.shard + "\n" - result += "State: " + state.String() + "\n" - switch state { - case WorkerStateCloneOnline: - result += "Running:\n" - result += "Copying from: " + scw.formatSources() + "\n" - statuses, eta := scw.tableStatusList.format() - result += "ETA: " + eta.String() + "\n" - result += strings.Join(statuses, "\n") - case WorkerStateDone: - result += "Success:\n" - statuses, _ := scw.tableStatusList.format() - result += strings.Join(statuses, "\n") - } - return result -} - -// Run implements the Worker interface -func (scw *LegacySplitCloneWorker) Run(ctx context.Context) error { - resetVars() - - // Run the command. - err := scw.run(ctx) - - // Cleanup. - scw.setState(WorkerStateCleanUp) - // Reverse any changes e.g. setting the tablet type of a source RDONLY tablet. - cerr := scw.cleaner.CleanUp(scw.wr) - if cerr != nil { - if err != nil { - scw.wr.Logger().Errorf2(cerr, "CleanUp failed in addition to job error") - } else { - err = cerr - } - } - - // Stop Throttlers. - for _, throttler := range scw.destinationThrottlers { - throttler.Close() - } - // Stop healthcheck. - for _, watcher := range scw.destinationShardWatchers { - watcher.Stop() - } - if scw.healthCheck != nil { - if err := scw.healthCheck.Close(); err != nil { - scw.wr.Logger().Errorf2(err, "LegacyHealthCheck.Close() failed") - } - } - - if err != nil { - scw.setErrorState(err) - return err - } - scw.setState(WorkerStateDone) - return nil -} - -func (scw *LegacySplitCloneWorker) run(ctx context.Context) error { - // first state: read what we need to do - if err := scw.init(ctx); err != nil { - return vterrors.Wrap(err, "init() failed") - } - if err := checkDone(ctx); err != nil { - return err - } - - // second state: find targets - if err := scw.findTargets(ctx); err != nil { - return vterrors.Wrap(err, "findTargets() failed") - } - if err := checkDone(ctx); err != nil { - return err - } - - // third state: copy data - if err := scw.copy(ctx); err != nil { - return vterrors.Wrap(err, "copy() failed") - } - - return nil -} - -// init phase: -// - read the destination keyspace, make sure it has 'servedFrom' values -func (scw *LegacySplitCloneWorker) init(ctx context.Context) error { - scw.setState(WorkerStateInit) - var err error - - // read the keyspace and validate it - shortCtx, cancel := context.WithTimeout(ctx, *remoteActionsTimeout) - scw.keyspaceInfo, err = scw.wr.TopoServer().GetKeyspace(shortCtx, scw.keyspace) - cancel() - if err != nil { - return vterrors.Wrapf(err, "cannot read keyspace %v", scw.keyspace) - } - - // find the OverlappingShards in the keyspace - shortCtx, cancel = context.WithTimeout(ctx, *remoteActionsTimeout) - osList, err := topotools.FindOverlappingShards(shortCtx, scw.wr.TopoServer(), scw.keyspace) - cancel() - if err != nil { - return vterrors.Wrapf(err, "cannot FindOverlappingShards in %v", scw.keyspace) - } - - // find the shard we mentioned in there, if any - os := topotools.OverlappingShardsForShard(osList, scw.shard) - if os == nil { - return fmt.Errorf("the specified shard %v/%v is not in any overlapping shard", scw.keyspace, scw.shard) - } - scw.wr.Logger().Infof("Found overlapping shards: %+v\n", os) - - // one side should have served types, the other one none, - // figure out which is which, then double check them all - - leftServingTypes, err := scw.wr.TopoServer().GetShardServingTypes(ctx, os.Left[0]) - if err != nil { - return fmt.Errorf("cannot get shard serving cells for: %v", os.Left[0]) - } - if len(leftServingTypes) > 0 { - scw.sourceShards = os.Left - scw.destinationShards = os.Right - } else { - scw.sourceShards = os.Right - scw.destinationShards = os.Left - } - - // Verify that filtered replication is not already enabled. - for _, si := range scw.destinationShards { - if len(si.SourceShards) > 0 { - return fmt.Errorf("destination shard %v/%v has filtered replication already enabled from a previous resharding (ShardInfo is set)."+ - " This requires manual intervention e.g. use vtctl SourceShardDelete to remove it", - si.Keyspace(), si.ShardName()) - } - } - - // validate all serving types - servingTypes := []topodatapb.TabletType{topodatapb.TabletType_PRIMARY, topodatapb.TabletType_REPLICA, topodatapb.TabletType_RDONLY} - for _, st := range servingTypes { - for _, si := range scw.sourceShards { - shardServingTypes, err := scw.wr.TopoServer().GetShardServingTypes(ctx, si) - if err != nil { - return fmt.Errorf("failed to get ServingTypes for source shard %v/%v", si.Keyspace(), si.ShardName()) - - } - found := false - for _, shardServingType := range shardServingTypes { - if shardServingType == st { - found = true - } - } - if !found { - return fmt.Errorf("source shard %v/%v is not serving type %v", si.Keyspace(), si.ShardName(), st) - } - } - } - for _, si := range scw.destinationShards { - shardServingTypes, err := scw.wr.TopoServer().GetShardServingTypes(ctx, si) - if err != nil { - return fmt.Errorf("failed to get ServingTypes for destination shard %v/%v", si.Keyspace(), si.ShardName()) - - } - if len(shardServingTypes) > 0 { - return fmt.Errorf("destination shard %v/%v is serving some types", si.Keyspace(), si.ShardName()) - } - } - - return nil -} - -// findTargets phase: -// - find one rdonly in the source shard -// - mark it as 'worker' pointing back to us -// - get the aliases of all the targets -func (scw *LegacySplitCloneWorker) findTargets(ctx context.Context) error { - scw.setState(WorkerStateFindTargets) - var err error - - // find an appropriate tablet in the source shards - scw.sourceAliases = make([]*topodatapb.TabletAlias, len(scw.sourceShards)) - for i, si := range scw.sourceShards { - scw.sourceAliases[i], err = FindWorkerTablet(ctx, scw.wr, scw.cleaner, scw.tsc, scw.cell, si.Keyspace(), si.ShardName(), scw.minHealthyRdonlyTablets, topodatapb.TabletType_RDONLY) - if err != nil { - return vterrors.Wrapf(err, "FindWorkerTablet() failed for %v/%v/%v", scw.cell, si.Keyspace(), si.ShardName()) - } - scw.wr.Logger().Infof("Using tablet %v as source for %v/%v", topoproto.TabletAliasString(scw.sourceAliases[i]), si.Keyspace(), si.ShardName()) - } - - // get the tablet info for them, and stop their replication - scw.sourceTablets = make([]*topodatapb.Tablet, len(scw.sourceAliases)) - for i, alias := range scw.sourceAliases { - shortCtx, cancel := context.WithTimeout(ctx, *remoteActionsTimeout) - ti, err := scw.wr.TopoServer().GetTablet(shortCtx, alias) - cancel() - if err != nil { - return vterrors.Wrapf(err, "cannot read tablet %v", topoproto.TabletAliasString(alias)) - } - scw.sourceTablets[i] = ti.Tablet - - shortCtx, cancel = context.WithTimeout(ctx, *remoteActionsTimeout) - err = scw.wr.TabletManagerClient().StopReplication(shortCtx, scw.sourceTablets[i]) - cancel() - if err != nil { - return fmt.Errorf("cannot stop replication on tablet %v", topoproto.TabletAliasString(alias)) - } - - wrangler.RecordStartReplicationAction(scw.cleaner, scw.sourceTablets[i]) - } - - // Initialize healthcheck and add destination shards to it. - scw.healthCheck = discovery.NewLegacyHealthCheck(*healthcheckRetryDelay, *healthCheckTimeout) - scw.tsc = discovery.NewLegacyTabletStatsCache(scw.healthCheck, scw.wr.TopoServer(), scw.cell) - for _, si := range scw.destinationShards { - watcher := discovery.NewLegacyShardReplicationWatcher(ctx, scw.wr.TopoServer(), scw.healthCheck, - scw.cell, si.Keyspace(), si.ShardName(), - *healthCheckTopologyRefresh, discovery.DefaultTopoReadConcurrency) - scw.destinationShardWatchers = append(scw.destinationShardWatchers, watcher) - } - - // Make sure we find a primary for each destination shard and log it. - scw.wr.Logger().Infof("Finding a PRIMARY tablet for each destination shard...") - for _, si := range scw.destinationShards { - waitCtx, waitCancel := context.WithTimeout(ctx, 10*time.Second) - defer waitCancel() - if err := scw.tsc.WaitForTablets(waitCtx, si.Keyspace(), si.ShardName(), topodatapb.TabletType_PRIMARY); err != nil { - return vterrors.Wrapf(err, "cannot find PRIMARY tablet for destination shard for %v/%v", si.Keyspace(), si.ShardName()) - } - primarys := scw.tsc.GetHealthyTabletStats(si.Keyspace(), si.ShardName(), topodatapb.TabletType_PRIMARY) - if len(primarys) == 0 { - return fmt.Errorf("cannot find PRIMARY tablet for destination shard for %v/%v in LegacyHealthCheck: empty LegacyTabletStats list", si.Keyspace(), si.ShardName()) - } - primary := primarys[0] - - // Get the MySQL database name of the tablet. - shortCtx, cancel := context.WithTimeout(ctx, *remoteActionsTimeout) - ti, err := scw.wr.TopoServer().GetTablet(shortCtx, primary.Tablet.Alias) - cancel() - if err != nil { - return vterrors.Wrapf(err, "cannot get the TabletInfo for destination primary (%v) to find out its db name", topoproto.TabletAliasString(primary.Tablet.Alias)) - } - keyspaceAndShard := topoproto.KeyspaceShardString(si.Keyspace(), si.ShardName()) - scw.destinationDbNames[keyspaceAndShard] = ti.DbName() - - scw.wr.Logger().Infof("Using tablet %v as destination primary for %v/%v", topoproto.TabletAliasString(primary.Tablet.Alias), si.Keyspace(), si.ShardName()) - } - scw.wr.Logger().Infof("NOTE: The used primary of a destination shard might change over the course of the copy e.g. due to a reparent. The LegacyHealthCheck module will track and log primary changes and any error message will always refer the actually used primary address.") - - // Set up the throttler for each destination shard. - for _, si := range scw.destinationShards { - keyspaceAndShard := topoproto.KeyspaceShardString(si.Keyspace(), si.ShardName()) - t, err := throttler.NewThrottler( - keyspaceAndShard, "transactions", scw.destinationWriterCount, scw.maxTPS, throttler.ReplicationLagModuleDisabled) - if err != nil { - return vterrors.Wrap(err, "cannot instantiate throttler") - } - scw.destinationThrottlers[keyspaceAndShard] = t - } - - return nil -} - -// copy phase: -// - copy the data from source tablets to destination primaries (with replication on) -// Assumes that the schema has already been created on each destination tablet -// (probably from vtctl's CopySchemaShard) -func (scw *LegacySplitCloneWorker) copy(ctx context.Context) error { - scw.setState(WorkerStateCloneOffline) - start := time.Now() - defer func() { - statsStateDurationsNs.Set(string(WorkerStateCloneOffline), time.Since(start).Nanoseconds()) - }() - - // get source schema from the first shard - // TODO(alainjobart): for now, we assume the schema is compatible - // on all source shards. Furthermore, we estimate the number of rows - // in each source shard for each table to be about the same - // (rowCount is used to estimate an ETA) - shortCtx, cancel := context.WithTimeout(ctx, *remoteActionsTimeout) - sourceSchemaDefinition, err := scw.wr.GetSchema(shortCtx, scw.sourceAliases[0], nil, scw.excludeTables, false /* includeViews */) - cancel() - if err != nil { - return vterrors.Wrapf(err, "cannot get schema from source %v", topoproto.TabletAliasString(scw.sourceAliases[0])) - } - if len(sourceSchemaDefinition.TableDefinitions) == 0 { - return fmt.Errorf("no tables matching the table filter in tablet %v", topoproto.TabletAliasString(scw.sourceAliases[0])) - } - for _, td := range sourceSchemaDefinition.TableDefinitions { - if len(td.Columns) == 0 { - return fmt.Errorf("schema for table %v has no columns", td.Name) - } - } - scw.wr.Logger().Infof("Source tablet 0 has %v tables to copy", len(sourceSchemaDefinition.TableDefinitions)) - scw.tableStatusList.initialize(sourceSchemaDefinition) - - // In parallel, setup the channels to send SQL data chunks to for each destination tablet: - // - // mu protects the context for cancelation, and firstError - mu := sync.Mutex{} - var firstError error - - ctx, cancelCopy := context.WithCancel(ctx) - processError := func(format string, args ...interface{}) { - scw.wr.Logger().Errorf(format, args...) - mu.Lock() - if firstError == nil { - firstError = fmt.Errorf(format, args...) - cancelCopy() - } - mu.Unlock() - } - - insertChannels := make([]chan string, len(scw.destinationShards)) - destinationWaitGroup := sync.WaitGroup{} - for shardIndex, si := range scw.destinationShards { - // we create one channel per destination tablet. It - // is sized to have a buffer of a maximum of - // destinationWriterCount * 2 items, to hopefully - // always have data. We then have - // destinationWriterCount go routines reading from it. - insertChannels[shardIndex] = make(chan string, scw.destinationWriterCount*2) - - go func(keyspace, shard string, insertChannel chan string) { - for j := 0; j < scw.destinationWriterCount; j++ { - destinationWaitGroup.Add(1) - go func(threadID int) { - defer destinationWaitGroup.Done() - - keyspaceAndShard := topoproto.KeyspaceShardString(keyspace, shard) - throttler := scw.destinationThrottlers[keyspaceAndShard] - defer throttler.ThreadFinished(threadID) - - executor := newExecutor(scw.wr, scw.tsc, throttler, keyspace, shard, threadID) - if err := executor.fetchLoop(ctx, insertChannel); err != nil { - processError("executer.FetchLoop failed: %v", err) - } - }(j) - } - }(si.Keyspace(), si.ShardName(), insertChannels[shardIndex]) - } - - // read the vschema if needed - var keyspaceSchema *vindexes.KeyspaceSchema - if *useV3ReshardingMode { - kschema, err := scw.wr.TopoServer().GetVSchema(ctx, scw.keyspace) - if err != nil { - return vterrors.Wrapf(err, "cannot load VSchema for keyspace %v", scw.keyspace) - } - if kschema == nil { - return fmt.Errorf("no VSchema for keyspace %v", scw.keyspace) - } - - keyspaceSchema, err = vindexes.BuildKeyspaceSchema(kschema, scw.keyspace) - if err != nil { - return vterrors.Wrapf(err, "cannot build vschema for keyspace %v", scw.keyspace) - } - } - - // Now for each table, read data chunks and send them to all - // insertChannels - sourceWaitGroup := sync.WaitGroup{} - for shardIndex := range scw.sourceShards { - sema := sync2.NewSemaphore(scw.sourceReaderCount, 0) - for tableIndex, td := range sourceSchemaDefinition.TableDefinitions { - var keyResolver keyspaceIDResolver - if *useV3ReshardingMode { - keyResolver, err = newV3ResolverFromTableDefinition(keyspaceSchema, td) - if err != nil { - return vterrors.Wrapf(err, "cannot resolve v3 sharding keys for keyspace %v", scw.keyspace) - } - } else { - keyResolver, err = newV2Resolver(scw.keyspaceInfo, td) - if err != nil { - return vterrors.Wrapf(err, "cannot resolve sharding keys for keyspace %v", scw.keyspace) - } - } - rowSplitter := NewRowSplitter(scw.destinationShards, keyResolver) - - chunks, err := generateChunks(ctx, scw.wr, scw.sourceTablets[shardIndex], td, scw.sourceReaderCount, defaultMinRowsPerChunk) - if err != nil { - return err - } - scw.tableStatusList.setThreadCount(tableIndex, len(chunks)-1) - - for _, c := range chunks { - sourceWaitGroup.Add(1) - go func(td *tabletmanagerdatapb.TableDefinition, shardIndex, tableIndex int, chunk chunk) { - defer sourceWaitGroup.Done() - - sema.Acquire() - defer sema.Release() - - scw.tableStatusList.threadStarted(tableIndex) - defer scw.tableStatusList.threadDone(tableIndex) - - // Start streaming from the source tablets. - tp := newSingleTabletProvider(ctx, scw.wr.TopoServer(), scw.sourceAliases[shardIndex]) - rr, err := NewRestartableResultReader(ctx, scw.wr.Logger(), tp, td, chunk, false /* allowMultipleRetries */) - if err != nil { - processError("NewRestartableResultReader failed: %v", err) - return - } - defer rr.Close(ctx) - - // process the data - dbNames := make([]string, len(scw.destinationShards)) - for i, si := range scw.destinationShards { - keyspaceAndShard := topoproto.KeyspaceShardString(si.Keyspace(), si.ShardName()) - dbNames[i] = scw.destinationDbNames[keyspaceAndShard] - } - if err := scw.processData(ctx, dbNames, td, tableIndex, rr, rowSplitter, insertChannels, scw.destinationPackCount); err != nil { - processError("processData failed: %v", err) - } - }(td, shardIndex, tableIndex, c) - } - } - } - sourceWaitGroup.Wait() - - for shardIndex := range scw.destinationShards { - close(insertChannels[shardIndex]) - } - destinationWaitGroup.Wait() - if firstError != nil { - return firstError - } - - sourcePositions := make([]string, len(scw.sourceShards)) - // get the current position from the sources - for shardIndex := range scw.sourceShards { - shortCtx, cancel := context.WithTimeout(ctx, *remoteActionsTimeout) - status, err := scw.wr.TabletManagerClient().ReplicationStatus(shortCtx, scw.sourceTablets[shardIndex]) - cancel() - if err != nil { - return err - } - sourcePositions[shardIndex] = status.Position - } - - for _, si := range scw.destinationShards { - keyspaceAndShard := topoproto.KeyspaceShardString(si.Keyspace(), si.ShardName()) - dbName := scw.destinationDbNames[keyspaceAndShard] - - destinationWaitGroup.Add(1) - go func(keyspace, shard string, kr *topodatapb.KeyRange) { - defer destinationWaitGroup.Done() - scw.wr.Logger().Infof("Making and populating vreplication table for %v/%v", keyspace, shard) - - exc := newExecutor(scw.wr, scw.tsc, nil, keyspace, shard, 0) - for shardIndex, src := range scw.sourceShards { - bls := &binlogdatapb.BinlogSource{ - Keyspace: src.Keyspace(), - Shard: src.ShardName(), - KeyRange: kr, - } - qr, err := exc.vreplicationExec(ctx, binlogplayer.CreateVReplication("LegacySplitClone", bls, sourcePositions[shardIndex], scw.maxTPS, throttler.ReplicationLagModuleDisabled, time.Now().Unix(), dbName)) - if err != nil { - processError("vreplication queries failed: %v", err) - break - } else { - scw.wr.Logger().Infof("Created replication for tablet %v/%v: %v, db: %v, pos: %v, uid: %v", keyspace, shard, bls, dbName, sourcePositions[shardIndex], uint32(qr.InsertID)) - } - if err := scw.wr.SourceShardAdd(ctx, keyspace, shard, uint32(qr.InsertID), src.Keyspace(), src.ShardName(), src.Shard.KeyRange, nil); err != nil { - processError("could not add source shard: %v", err) - break - } - } - // refreshState will cause the destination to become non-serving because - // it's now participating in the resharding workflow. - if err := exc.refreshState(ctx); err != nil { - processError("RefreshState failed on tablet %v/%v: %v", keyspace, shard, err) - } - }(si.Keyspace(), si.ShardName(), si.KeyRange) - } - destinationWaitGroup.Wait() - return firstError -} - -// processData pumps the data out of the provided QueryResultReader. -// It returns any error the source encounters. -func (scw *LegacySplitCloneWorker) processData(ctx context.Context, dbNames []string, td *tabletmanagerdatapb.TableDefinition, tableIndex int, rr ResultReader, rowSplitter *RowSplitter, insertChannels []chan string, destinationPackCount int) error { - // Store the baseCmd per destination shard because each tablet may have a - // different dbName. - baseCmds := make([]string, len(dbNames)) - for i, dbName := range dbNames { - baseCmds[i] = "INSERT INTO " + sqlescape.EscapeID(dbName) + "." + sqlescape.EscapeID(td.Name) + " (" + strings.Join(escapeAll(td.Columns), ", ") + ") VALUES " - } - sr := rowSplitter.StartSplit() - packCount := 0 - - fields := rr.Fields() - for { - r, err := rr.Next() - if err != nil { - // we are done, see if there was an error - if err != io.EOF { - return err - } - - // send the remainder if any (ignoring - // the return value, we don't care - // here if we're aborted) - if packCount > 0 { - rowSplitter.Send(fields, sr, baseCmds, insertChannels, ctx.Done()) - } - return nil - } - - // Split the rows by keyspace ID, and insert each chunk into each destination - if err := rowSplitter.Split(sr, r.Rows); err != nil { - return vterrors.Wrapf(err, "RowSplitter failed for table %v", td.Name) - } - scw.tableStatusList.addCopiedRows(tableIndex, len(r.Rows)) - - // see if we reach the destination pack count - packCount++ - if packCount < destinationPackCount { - continue - } - - // send the rows to be inserted - if aborted := rowSplitter.Send(fields, sr, baseCmds, insertChannels, ctx.Done()); aborted { - return nil - } - - // and reset our row buffer - sr = rowSplitter.StartSplit() - packCount = 0 - } -} diff --git a/go/vt/worker/legacy_split_clone_cmd.go b/go/vt/worker/legacy_split_clone_cmd.go deleted file mode 100644 index c4ff6b33daf..00000000000 --- a/go/vt/worker/legacy_split_clone_cmd.go +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright 2019 The Vitess Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package worker - -// TODO(mberlin): Remove this file when SplitClone supports merge-sorting -// primary key columns based on the MySQL collation. - -import ( - "flag" - "fmt" - "html/template" - "net/http" - "strconv" - "strings" - - "vitess.io/vitess/go/vt/vterrors" - - "context" - - "vitess.io/vitess/go/vt/topo/topoproto" - "vitess.io/vitess/go/vt/wrangler" -) - -const legacySplitCloneHTML = ` - - - Legacy Split Clone Action - - -

Legacy Split Clone Action

-

Use this command only when the 'SplitClone' command told you so. Otherwise use the 'SplitClone' command.

- - {{if .Error}} - Error: {{.Error}}
- {{else}} -

Choose the destination keyspace for this action.

- - {{end}} - -` - -const legacySplitCloneHTML2 = ` - - - Legacy Split Clone Action - - -

Shard involved: {{.Keyspace}}/{{.Shard}}

-

Split Clone Action

-
- -
- -
- -
- -
- -
- -
- - - -
- -` - -var legacySplitCloneTemplate = mustParseTemplate("splitClone", legacySplitCloneHTML) -var legacySplitCloneTemplate2 = mustParseTemplate("splitClone2", legacySplitCloneHTML2) - -func commandLegacySplitClone(wi *Instance, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) (Worker, error) { - excludeTables := subFlags.String("exclude_tables", "", "comma separated list of tables to exclude. Each is either an exact match, or a regular expression of the form /regexp/") - sourceReaderCount := subFlags.Int("source_reader_count", defaultSourceReaderCount, "number of concurrent streaming queries to use on the source") - destinationPackCount := subFlags.Int("destination_pack_count", defaultDestinationPackCount, "number of packets to pack in one destination insert") - destinationWriterCount := subFlags.Int("destination_writer_count", defaultDestinationWriterCount, "number of concurrent RPCs to execute on the destination") - minHealthyRdonlyTablets := subFlags.Int("min_healthy_rdonly_tablets", defaultMinHealthyTablets, "minimum number of healthy RDONLY tablets before taking out one") - maxTPS := subFlags.Int64("max_tps", defaultMaxTPS, "if non-zero, limit copy to maximum number of (write) transactions/second on the destination (unlimited by default)") - if err := subFlags.Parse(args); err != nil { - return nil, err - } - if subFlags.NArg() != 1 { - subFlags.Usage() - return nil, fmt.Errorf("command LegacySplitClone requires ") - } - - keyspace, shard, err := topoproto.ParseKeyspaceShard(subFlags.Arg(0)) - if err != nil { - return nil, err - } - var excludeTableArray []string - if *excludeTables != "" { - excludeTableArray = strings.Split(*excludeTables, ",") - } - worker, err := NewLegacySplitCloneWorker(wr, wi.cell, keyspace, shard, excludeTableArray, *sourceReaderCount, *destinationPackCount, *destinationWriterCount, *minHealthyRdonlyTablets, *maxTPS) - if err != nil { - return nil, vterrors.Wrap(err, "cannot create split clone worker") - } - return worker, nil -} - -func interactiveLegacySplitClone(ctx context.Context, wi *Instance, wr *wrangler.Wrangler, w http.ResponseWriter, r *http.Request) (Worker, *template.Template, map[string]interface{}, error) { - if err := r.ParseForm(); err != nil { - return nil, nil, nil, vterrors.Wrap(err, "cannot parse form") - } - - keyspace := r.FormValue("keyspace") - shard := r.FormValue("shard") - if keyspace == "" || shard == "" { - // display the list of possible splits to choose from - // (just find all the overlapping guys) - result := make(map[string]interface{}) - choices, err := keyspacesWithOverlappingShards(ctx, wr) - if err != nil { - result["Error"] = err.Error() - } else { - result["Choices"] = choices - } - return nil, legacySplitCloneTemplate, result, nil - } - - sourceReaderCountStr := r.FormValue("sourceReaderCount") - if sourceReaderCountStr == "" { - // display the input form - result := make(map[string]interface{}) - result["Keyspace"] = keyspace - result["Shard"] = shard - result["DefaultSourceReaderCount"] = fmt.Sprintf("%v", defaultSourceReaderCount) - result["DefaultDestinationPackCount"] = fmt.Sprintf("%v", defaultDestinationPackCount) - result["DefaultDestinationWriterCount"] = fmt.Sprintf("%v", defaultDestinationWriterCount) - result["DefaultMinHealthyRdonlyTablets"] = fmt.Sprintf("%v", defaultMinHealthyTablets) - result["DefaultMaxTPS"] = fmt.Sprintf("%v", defaultMaxTPS) - return nil, legacySplitCloneTemplate2, result, nil - } - - // get other parameters - destinationPackCountStr := r.FormValue("destinationPackCount") - excludeTables := r.FormValue("excludeTables") - var excludeTableArray []string - if excludeTables != "" { - excludeTableArray = strings.Split(excludeTables, ",") - } - sourceReaderCount, err := strconv.ParseInt(sourceReaderCountStr, 0, 64) - if err != nil { - return nil, nil, nil, vterrors.Wrap(err, "cannot parse sourceReaderCount") - } - destinationPackCount, err := strconv.ParseInt(destinationPackCountStr, 0, 64) - if err != nil { - return nil, nil, nil, vterrors.Wrap(err, "cannot parse destinationPackCount") - } - destinationWriterCountStr := r.FormValue("destinationWriterCount") - destinationWriterCount, err := strconv.ParseInt(destinationWriterCountStr, 0, 64) - if err != nil { - return nil, nil, nil, vterrors.Wrap(err, "cannot parse destinationWriterCount") - } - minHealthyRdonlyTabletsStr := r.FormValue("minHealthyRdonlyTablets") - minHealthyRdonlyTablets, err := strconv.ParseInt(minHealthyRdonlyTabletsStr, 0, 64) - if err != nil { - return nil, nil, nil, vterrors.Wrap(err, "cannot parse minHealthyRdonlyTablets") - } - maxTPSStr := r.FormValue("maxTPS") - maxTPS, err := strconv.ParseInt(maxTPSStr, 0, 64) - if err != nil { - return nil, nil, nil, vterrors.Wrap(err, "cannot parse maxTPS") - } - - // start the clone job - wrk, err := NewLegacySplitCloneWorker(wr, wi.cell, keyspace, shard, excludeTableArray, int(sourceReaderCount), int(destinationPackCount), int(destinationWriterCount), int(minHealthyRdonlyTablets), maxTPS) - if err != nil { - return nil, nil, nil, vterrors.Wrap(err, "cannot create worker") - } - return wrk, nil, nil, nil -} - -func init() { - AddCommand("Clones", Command{"LegacySplitClone", - commandLegacySplitClone, interactiveLegacySplitClone, - "[--exclude_tables=''] ", - "Old SplitClone code which supports VARCHAR primary key columns. Use this ONLY if SplitClone failed for you."}) -} diff --git a/go/vt/worker/legacy_split_clone_test.go b/go/vt/worker/legacy_split_clone_test.go deleted file mode 100644 index 368bf30e1a4..00000000000 --- a/go/vt/worker/legacy_split_clone_test.go +++ /dev/null @@ -1,491 +0,0 @@ -/* -Copyright 2019 The Vitess Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package worker - -// TODO(mberlin): Remove this file when SplitClone supports merge-sorting -// primary key columns based on the MySQL collation. - -import ( - "fmt" - "strconv" - "strings" - "testing" - "time" - - "vitess.io/vitess/go/vt/discovery" - - "context" - - "vitess.io/vitess/go/mysql" - "vitess.io/vitess/go/mysql/fakesqldb" - "vitess.io/vitess/go/sqltypes" - "vitess.io/vitess/go/vt/mysqlctl/tmutils" - "vitess.io/vitess/go/vt/topo" - "vitess.io/vitess/go/vt/topo/memorytopo" - "vitess.io/vitess/go/vt/vttablet/grpcqueryservice" - "vitess.io/vitess/go/vt/vttablet/queryservice/fakes" - "vitess.io/vitess/go/vt/wrangler/testlib" - - querypb "vitess.io/vitess/go/vt/proto/query" - tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" - topodatapb "vitess.io/vitess/go/vt/proto/topodata" - vschemapb "vitess.io/vitess/go/vt/proto/vschema" -) - -const ( - // legacySplitCloneTestMin is the minimum value of the primary key. - legacySplitCloneTestMin int = 100 - // legacySplitCloneTestMax is the maximum value of the primary key. - legacySplitCloneTestMax int = 200 -) - -type legacySplitCloneTestCase struct { - t *testing.T - - ts *topo.Server - wi *Instance - tablets []*testlib.FakeTablet - - leftPrimaryFakeDb *fakesqldb.DB - leftPrimaryQs *fakes.StreamHealthQueryService - rightPrimaryFakeDb *fakesqldb.DB - rightPrimaryQs *fakes.StreamHealthQueryService - - // leftReplica is used by the reparent test. - leftReplica *testlib.FakeTablet - leftReplicaFakeDb *fakesqldb.DB - leftReplicaQs *fakes.StreamHealthQueryService - - // defaultWorkerArgs are the full default arguments to run LegacySplitClone. - defaultWorkerArgs []string -} - -func (tc *legacySplitCloneTestCase) setUp(v3 bool) { - *useV3ReshardingMode = v3 - tc.ts = memorytopo.NewServer("cell1", "cell2") - ctx := context.Background() - tc.wi = NewInstance(tc.ts, "cell1", time.Second) - - if v3 { - if err := tc.ts.CreateKeyspace(ctx, "ks", &topodatapb.Keyspace{}); err != nil { - tc.t.Fatalf("CreateKeyspace v3 failed: %v", err) - } - - vs := &vschemapb.Keyspace{ - Sharded: true, - Vindexes: map[string]*vschemapb.Vindex{ - "table1_index": { - Type: "numeric", - }, - }, - Tables: map[string]*vschemapb.Table{ - "table1": { - ColumnVindexes: []*vschemapb.ColumnVindex{ - { - Column: "keyspace_id", - Name: "table1_index", - }, - }, - }, - }, - } - if err := tc.ts.SaveVSchema(ctx, "ks", vs); err != nil { - tc.t.Fatalf("SaveVSchema v3 failed: %v", err) - } - } else { - if err := tc.ts.CreateKeyspace(ctx, "ks", &topodatapb.Keyspace{ - ShardingColumnName: "keyspace_id", - ShardingColumnType: topodatapb.KeyspaceIdType_UINT64, - }); err != nil { - tc.t.Fatalf("CreateKeyspace v2 failed: %v", err) - } - } - - // Create the fakesql databases. - sourceRdonlyFakeDB := sourceRdonlyFakeDB(tc.t, "vt_ks", "table1", legacySplitCloneTestMin, legacySplitCloneTestMax) - tc.leftPrimaryFakeDb = fakesqldb.New(tc.t).SetName("leftPrimary").OrderMatters() - tc.leftReplicaFakeDb = fakesqldb.New(tc.t).SetName("leftReplica").OrderMatters() - tc.rightPrimaryFakeDb = fakesqldb.New(tc.t).SetName("rightPrimary").OrderMatters() - - sourcePrimary := testlib.NewFakeTablet(tc.t, tc.wi.wr, "cell1", 0, - topodatapb.TabletType_PRIMARY, nil, testlib.TabletKeyspaceShard(tc.t, "ks", "-80")) - sourceRdonly1 := testlib.NewFakeTablet(tc.t, tc.wi.wr, "cell1", 1, - topodatapb.TabletType_RDONLY, sourceRdonlyFakeDB, testlib.TabletKeyspaceShard(tc.t, "ks", "-80")) - sourceRdonly2 := testlib.NewFakeTablet(tc.t, tc.wi.wr, "cell1", 2, - topodatapb.TabletType_RDONLY, sourceRdonlyFakeDB, testlib.TabletKeyspaceShard(tc.t, "ks", "-80")) - - leftPrimary := testlib.NewFakeTablet(tc.t, tc.wi.wr, "cell1", 10, - topodatapb.TabletType_PRIMARY, tc.leftPrimaryFakeDb, testlib.TabletKeyspaceShard(tc.t, "ks", "-40")) - leftRdonly := testlib.NewFakeTablet(tc.t, tc.wi.wr, "cell1", 11, - topodatapb.TabletType_RDONLY, nil, testlib.TabletKeyspaceShard(tc.t, "ks", "-40")) - // leftReplica is used by the reparent test. - leftReplica := testlib.NewFakeTablet(tc.t, tc.wi.wr, "cell1", 12, - topodatapb.TabletType_REPLICA, tc.leftReplicaFakeDb, testlib.TabletKeyspaceShard(tc.t, "ks", "-40")) - tc.leftReplica = leftReplica - - rightPrimary := testlib.NewFakeTablet(tc.t, tc.wi.wr, "cell1", 20, - topodatapb.TabletType_PRIMARY, tc.rightPrimaryFakeDb, testlib.TabletKeyspaceShard(tc.t, "ks", "40-80")) - rightRdonly := testlib.NewFakeTablet(tc.t, tc.wi.wr, "cell1", 21, - topodatapb.TabletType_RDONLY, nil, testlib.TabletKeyspaceShard(tc.t, "ks", "40-80")) - - tc.tablets = []*testlib.FakeTablet{sourcePrimary, sourceRdonly1, sourceRdonly2, leftPrimary, leftRdonly, tc.leftReplica, rightPrimary, rightRdonly} - - // add the topo and schema data we'll need - if err := tc.ts.CreateShard(ctx, "ks", "80-"); err != nil { - tc.t.Fatalf("CreateShard(\"-80\") failed: %v", err) - } - if err := tc.wi.wr.SetKeyspaceShardingInfo(ctx, "ks", "keyspace_id", topodatapb.KeyspaceIdType_UINT64, false); err != nil { - tc.t.Fatalf("SetKeyspaceShardingInfo failed: %v", err) - } - if err := tc.wi.wr.RebuildKeyspaceGraph(ctx, "ks", nil, false); err != nil { - tc.t.Fatalf("RebuildKeyspaceGraph failed: %v", err) - } - - for _, sourceRdonly := range []*testlib.FakeTablet{sourceRdonly1, sourceRdonly2} { - sourceRdonly.FakeMysqlDaemon.Schema = &tabletmanagerdatapb.SchemaDefinition{ - DatabaseSchema: "", - TableDefinitions: []*tabletmanagerdatapb.TableDefinition{ - { - Name: "table1", - Columns: []string{"id", "msg", "keyspace_id"}, - PrimaryKeyColumns: []string{"id"}, - Type: tmutils.TableBaseTable, - // Note that LegacySplitClone does not support the flag --min_rows_per_chunk. - // Therefore, we use the default value in our calculation. - // * 10 because --source_reader_count is set to 10 i.e. there are 10 chunks. - RowCount: defaultMinRowsPerChunk * 10, - }, - }, - } - sourceRdonly.FakeMysqlDaemon.CurrentPrimaryPosition = mysql.Position{ - GTIDSet: mysql.MariadbGTIDSet{12: mysql.MariadbGTID{Domain: 12, Server: 34, Sequence: 5678}}, - } - sourceRdonly.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{ - "STOP SLAVE", - "START SLAVE", - } - qs := fakes.NewStreamHealthQueryService(sourceRdonly.Target()) - qs.AddDefaultHealthResponse() - grpcqueryservice.Register(sourceRdonly.RPCServer, &legacyTestQueryService{ - t: tc.t, - - StreamHealthQueryService: qs, - }) - } - - // We read 100 source rows. sourceReaderCount is set to 10, so - // we'll have 100/10=10 rows per table chunk. - // destinationPackCount is set to 4, so we take 4 source rows - // at once. So we'll process 4 + 4 + 2 rows to get to 10. - // That means 3 insert statements on each target (each - // containing half of the rows, i.e. 2 + 2 + 1 rows). So 3 * 10 - // = 30 insert statements on each destination. - for i := 1; i <= 30; i++ { - tc.leftPrimaryFakeDb.AddExpectedQuery("INSERT INTO `vt_ks`.`table1` (`id`, `msg`, `keyspace_id`) VALUES (*", nil) - // leftReplica is unused by default. - tc.rightPrimaryFakeDb.AddExpectedQuery("INSERT INTO `vt_ks`.`table1` (`id`, `msg`, `keyspace_id`) VALUES (*", nil) - } - - // Fake stream health responses because vtworker needs them to find the primary. - tc.leftPrimaryQs = fakes.NewStreamHealthQueryService(leftPrimary.Target()) - tc.leftPrimaryQs.AddDefaultHealthResponse() - tc.leftReplicaQs = fakes.NewStreamHealthQueryService(leftReplica.Target()) - tc.leftReplicaQs.AddDefaultHealthResponse() - tc.rightPrimaryQs = fakes.NewStreamHealthQueryService(rightPrimary.Target()) - tc.rightPrimaryQs.AddDefaultHealthResponse() - grpcqueryservice.Register(leftPrimary.RPCServer, tc.leftPrimaryQs) - grpcqueryservice.Register(leftReplica.RPCServer, tc.leftReplicaQs) - grpcqueryservice.Register(rightPrimary.RPCServer, tc.rightPrimaryQs) - - tc.defaultWorkerArgs = []string{ - "LegacySplitClone", - "-source_reader_count", "10", - "-destination_pack_count", "4", - "-destination_writer_count", "10", - "ks/-80"} - - // Start action loop after having registered all RPC services. - for _, ft := range tc.tablets { - ft.StartActionLoop(tc.t, tc.wi.wr) - } -} - -func (tc *legacySplitCloneTestCase) tearDown() { - for _, ft := range tc.tablets { - ft.StopActionLoop(tc.t) - } - tc.leftPrimaryFakeDb.VerifyAllExecutedOrFail() - tc.leftReplicaFakeDb.VerifyAllExecutedOrFail() - tc.rightPrimaryFakeDb.VerifyAllExecutedOrFail() -} - -// legacyTestQueryService is a local QueryService implementation to support the tests. -type legacyTestQueryService struct { - t *testing.T - - *fakes.StreamHealthQueryService -} - -func (sq *legacyTestQueryService) StreamExecute(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]*querypb.BindVariable, transactionID int64, options *querypb.ExecuteOptions, callback func(reply *sqltypes.Result) error) error { - // Custom parsing of the query we expect. - min := legacySplitCloneTestMin - max := legacySplitCloneTestMax - var err error - parts := strings.Split(sql, " ") - for _, part := range parts { - if strings.HasPrefix(part, "`id`>=") { - min, err = strconv.Atoi(part[6:]) - if err != nil { - return err - } - } else if strings.HasPrefix(part, "`id`<") { - max, _ = strconv.Atoi(part[5:]) - } - } - sq.t.Logf("legacyTestQueryService: got query: %v with min %v max %v", sql, min, max) - - // Send the headers - if err := callback(&sqltypes.Result{ - Fields: []*querypb.Field{ - { - Name: "id", - Type: sqltypes.Int64, - }, - { - Name: "msg", - Type: sqltypes.VarChar, - }, - { - Name: "keyspace_id", - Type: sqltypes.Int64, - }, - }, - }); err != nil { - return err - } - - // Send the values - ksids := []uint64{0x2000000000000000, 0x6000000000000000} - for i := min; i < max; i++ { - if err := callback(&sqltypes.Result{ - Rows: [][]sqltypes.Value{ - { - sqltypes.NewVarBinary(fmt.Sprintf("%v", i)), - sqltypes.NewVarBinary(fmt.Sprintf("Text for %v", i)), - sqltypes.NewVarBinary(fmt.Sprintf("%v", ksids[i%2])), - }, - }, - }); err != nil { - return err - } - } - // SELECT id, msg, keyspace_id FROM table1 WHERE id>=180 AND id<190 ORDER BY id - return nil -} - -func TestLegacySplitCloneV2(t *testing.T) { - delay := discovery.GetTabletPickerRetryDelay() - defer func() { - discovery.SetTabletPickerRetryDelay(delay) - }() - discovery.SetTabletPickerRetryDelay(5 * time.Millisecond) - - tc := &legacySplitCloneTestCase{t: t} - tc.setUp(false /* v3 */) - defer tc.tearDown() - - // Run the vtworker command. - if err := runCommand(t, tc.wi, tc.wi.wr, tc.defaultWorkerArgs); err != nil { - t.Fatal(err) - } -} - -func TestLegacySplitCloneV2_Throttled(t *testing.T) { - delay := discovery.GetTabletPickerRetryDelay() - defer func() { - discovery.SetTabletPickerRetryDelay(delay) - }() - discovery.SetTabletPickerRetryDelay(5 * time.Millisecond) - - tc := &legacySplitCloneTestCase{t: t} - tc.setUp(false /* v3 */) - defer tc.tearDown() - - // Run LegacySplitClone throttled and verify that it took longer than usual (~25ms). - - // Modify args to set -max_tps to 300. - args := []string{"LegacySplitClone", "-max_tps", "300"} - args = append(args, tc.defaultWorkerArgs[1:]...) - - // Run the vtworker command. - if err := runCommand(t, tc.wi, tc.wi.wr, args); err != nil { - t.Fatal(err) - } - - // 30 transactions (tx) at a rate of 300 TPS should take at least 33 ms since: - // 300 TPS across 10 writer threads: 30 tx/second/thread - // => minimum request interval between two tx: 1 s / 30 tx/s = 33 ms - // 3 transactions are throttled for 33 ms at least because: - // - 1st tx: goes through immediately - // - 2nd tx: may not be throttled when 1st tx happened at the end of its - // throttle request interval (negligible backoff) - // - 3rd tx: throttled for 33 ms at least since 2nd tx happened - want := 33 * time.Millisecond - copyDuration := time.Duration(statsStateDurationsNs.Counts()[string(WorkerStateCloneOffline)]) * time.Nanosecond - if copyDuration < want { - t.Errorf("throttled copy was too fast: %v < %v", copyDuration, want) - } - t.Logf("throttled copy took: %v", copyDuration) - // At least one thread should have been throttled. - if counts := statsThrottledCounters.Counts(); len(counts) == 0 { - t.Error("worker should have had one throttled thread at least") - } -} - -// TestLegacySplitCloneV2_RetryDueToReadonly is identical to the regular test -// TestLegacySplitCloneV2 with the additional twist that the destination primaries -// fail the first write because they are read-only and succeed after that. -func TestLegacySplitCloneV2_RetryDueToReadonly(t *testing.T) { - delay := discovery.GetTabletPickerRetryDelay() - defer func() { - discovery.SetTabletPickerRetryDelay(delay) - }() - discovery.SetTabletPickerRetryDelay(5 * time.Millisecond) - - tc := &legacySplitCloneTestCase{t: t} - tc.setUp(false /* v3 */) - defer tc.tearDown() - - // Provoke a retry to test the error handling. - tc.leftPrimaryFakeDb.AddExpectedQueryAtIndex(0, "INSERT INTO `vt_ks`.`table1` (`id`, `msg`, `keyspace_id`) VALUES (*", errReadOnly) - tc.rightPrimaryFakeDb.AddExpectedQueryAtIndex(0, "INSERT INTO `vt_ks`.`table1` (`id`, `msg`, `keyspace_id`) VALUES (*", errReadOnly) - // Only wait 1 ms between retries, so that the test passes faster. - *executeFetchRetryTime = 1 * time.Millisecond - - // Run the vtworker command. - if err := runCommand(t, tc.wi, tc.wi.wr, tc.defaultWorkerArgs); err != nil { - t.Fatal(err) - } - - wantRetryCount := int64(2) - if got := statsRetryCount.Get(); got != wantRetryCount { - t.Errorf("Wrong statsRetryCounter: got %v, wanted %v", got, wantRetryCount) - } - wantRetryReadOnlyCount := int64(2) - if got := statsRetryCounters.Counts()[retryCategoryReadOnly]; got != wantRetryReadOnlyCount { - t.Errorf("Wrong statsRetryCounters: got %v, wanted %v", got, wantRetryReadOnlyCount) - } -} - -// TestLegacySplitCloneV2_NoPrimaryAvailable tests that vtworker correctly retries -// even in a period where no PRIMARY tablet is available according to the -// HealthCheck instance. -func TestLegacySplitCloneV2_NoPrimaryAvailable(t *testing.T) { - delay := discovery.GetTabletPickerRetryDelay() - defer func() { - discovery.SetTabletPickerRetryDelay(delay) - }() - discovery.SetTabletPickerRetryDelay(5 * time.Millisecond) - - tc := &legacySplitCloneTestCase{t: t} - tc.setUp(false /* v3 */) - defer tc.tearDown() - - // leftReplica will take over for the last, 30th, insert and the vreplication checkpoint. - tc.leftReplicaFakeDb.AddExpectedQuery("INSERT INTO `vt_ks`.`table1` (`id`, `msg`, `keyspace_id`) VALUES (*", nil) - - // During the 29th write, let the PRIMARY disappear. - tc.leftPrimaryFakeDb.GetEntry(28).AfterFunc = func() { - tc.leftPrimaryQs.UpdateType(topodatapb.TabletType_REPLICA) - tc.leftPrimaryQs.AddDefaultHealthResponse() - } - - // If the HealthCheck didn't pick up the change yet, the 30th write would - // succeed. To prevent this from happening, replace it with an error. - tc.leftPrimaryFakeDb.DeleteAllEntriesAfterIndex(28) - tc.leftPrimaryFakeDb.AddExpectedQuery("INSERT INTO `vt_ks`.`table1` (`id`, `msg`, `keyspace_id`) VALUES (*", errReadOnly) - tc.leftPrimaryFakeDb.EnableInfinite() - // vtworker may not retry on leftPrimary again if HealthCheck picks up the - // change very fast. In that case, the error was never encountered. - // Delete it or verifyAllExecutedOrFail() will fail because it was not - // processed. - defer tc.leftPrimaryFakeDb.DeleteAllEntriesAfterIndex(28) - - // Wait for a retry due to NoPrimaryAvailable to happen, expect the 30th write - // on leftReplica and change leftReplica from REPLICA to PRIMARY. - // - // Reset the retry stats now. It also happens when the worker starts but that - // is too late because this Go routine potentially reads it before the worker - // resets the old value. - statsRetryCounters.ResetAll() - errs := make(chan error, 1) - go func() { - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) - defer cancel() - - for { - if statsRetryCounters.Counts()[retryCategoryNoPrimaryAvailable] >= 1 { - break - } - - select { - case <-ctx.Done(): - errs <- ctx.Err() - close(errs) - return - case <-time.After(10 * time.Millisecond): - // Poll constantly. - } - } - - // Make leftReplica the new PRIMARY. - tc.leftReplica.TM.ChangeType(ctx, topodatapb.TabletType_PRIMARY) - tc.leftReplicaQs.UpdateType(topodatapb.TabletType_PRIMARY) - tc.leftReplicaQs.AddDefaultHealthResponse() - errs <- nil - close(errs) - }() - - // Only wait 1 ms between retries, so that the test passes faster. - *executeFetchRetryTime = 1 * time.Millisecond - - // Run the vtworker command. - if err := runCommand(t, tc.wi, tc.wi.wr, tc.defaultWorkerArgs); err != nil { - t.Fatal(err) - } - err := <-errs - if err != nil { - t.Fatalf("timed out waiting for vtworker to retry due to NoPrimaryAvailable: %v", err) - } -} - -func TestLegacySplitCloneV3(t *testing.T) { - delay := discovery.GetTabletPickerRetryDelay() - defer func() { - discovery.SetTabletPickerRetryDelay(delay) - }() - discovery.SetTabletPickerRetryDelay(5 * time.Millisecond) - - tc := &legacySplitCloneTestCase{t: t} - tc.setUp(true /* v3 */) - defer tc.tearDown() - - // Run the vtworker command. - if err := runCommand(t, tc.wi, tc.wi.wr, tc.defaultWorkerArgs); err != nil { - t.Fatal(err) - } -} From bfcfcb9e53f2ecd3a77fc6f23cbfc3638af06568 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 22 Sep 2021 14:18:37 -0400 Subject: [PATCH 2/2] Remove remaining mentions/references Signed-off-by: Matt Lord --- go/vt/vtctld/rice-box.go | 2 +- go/vt/worker/defaults.go | 2 +- go/vt/worker/result_merger.go | 2 +- go/vt/workflow/resharding/workflow.go | 2 +- go/vt/workflow/reshardingworkflowgen/workflow.go | 2 +- web/vtctld2/app/main.28aaf6796e51c187f55b.bundle.js | 4 ++-- web/vtctld2/src/app/shared/flags/workflow.flags.ts | 4 ---- 7 files changed, 7 insertions(+), 11 deletions(-) diff --git a/go/vt/vtctld/rice-box.go b/go/vt/vtctld/rice-box.go index 00a8d6af542..cb32e71940d 100644 --- a/go/vt/vtctld/rice-box.go +++ b/go/vt/vtctld/rice-box.go @@ -103,7 +103,7 @@ func init() { Filename: "main.28aaf6796e51c187f55b.bundle.js", FileModTime: time.Unix(1597960153, 0), - Content: string("webpackJsonp([0,2],[function(e,t,n){\"use strict\";function __export(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}__export(n(386)),__export(n(585)),__export(n(46));var r=n(248);t.createPlatform=r.createPlatform,t.assertPlatform=r.assertPlatform,t.disposePlatform=r.disposePlatform,t.getPlatform=r.getPlatform,t.coreBootstrap=r.coreBootstrap,t.coreLoadAndBootstrap=r.coreLoadAndBootstrap,t.PlatformRef=r.PlatformRef,t.ApplicationRef=r.ApplicationRef,t.enableProdMode=r.enableProdMode,t.lockRunMode=r.lockRunMode,t.isDevMode=r.isDevMode,t.createPlatformFactory=r.createPlatformFactory;var i=n(157);t.APP_ID=i.APP_ID,t.PACKAGE_ROOT_URL=i.PACKAGE_ROOT_URL,t.PLATFORM_INITIALIZER=i.PLATFORM_INITIALIZER,t.APP_BOOTSTRAP_LISTENER=i.APP_BOOTSTRAP_LISTENER;var o=n(247);t.APP_INITIALIZER=o.APP_INITIALIZER,t.ApplicationInitStatus=o.ApplicationInitStatus,__export(n(586)),__export(n(584)),__export(n(573));var s=n(373);t.DebugElement=s.DebugElement,t.DebugNode=s.DebugNode,t.asNativeElements=s.asNativeElements,t.getDebugNode=s.getDebugNode,__export(n(261)),__export(n(568)),__export(n(581)),__export(n(580));var a=n(567);t.APPLICATION_COMMON_PROVIDERS=a.APPLICATION_COMMON_PROVIDERS,t.ApplicationModule=a.ApplicationModule;var l=n(167);t.wtfCreateScope=l.wtfCreateScope,t.wtfLeave=l.wtfLeave,t.wtfStartTimeRange=l.wtfStartTimeRange,t.wtfEndTimeRange=l.wtfEndTimeRange;var c=n(4);t.Type=c.Type;var u=n(254);t.EventEmitter=u.EventEmitter;var p=n(14);t.ExceptionHandler=p.ExceptionHandler,t.WrappedException=p.WrappedException,t.BaseException=p.BaseException,__export(n(561)),__export(n(369));var d=n(246);t.AnimationPlayer=d.AnimationPlayer;var h=n(394);t.SanitizationService=h.SanitizationService,t.SecurityContext=h.SecurityContext},function(e,t,n){\"use strict\";var r=n(51),i=n(214),o=n(1089),s=function(){function Observable(e){this._isScalar=!1,e&&(this._subscribe=e)}return Observable.prototype.lift=function(e){var t=new Observable;return t.source=this,t.operator=e,t},Observable.prototype.subscribe=function(e,t,n){var r=this.operator,i=o.toSubscriber(e,t,n);if(i.add(r?r.call(i,this):this._subscribe(i)),i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},Observable.prototype.forEach=function(e,t){var n=this;if(t||(r.root.Rx&&r.root.Rx.config&&r.root.Rx.config.Promise?t=r.root.Rx.config.Promise:r.root.Promise&&(t=r.root.Promise)),!t)throw new Error(\"no Promise impl found\");return new t(function(t,r){var i=n.subscribe(function(t){if(i)try{e(t)}catch(n){r(n),i.unsubscribe()}else e(t)},r,t)})},Observable.prototype._subscribe=function(e){return this.source.subscribe(e)},Observable.prototype[i.$$observable]=function(){return this},Observable.create=function(e){return new Observable(e)},Observable}();t.Observable=s},function(e,t,n){var r=n(26),i=n(24),o=n(65),s=n(39),a=n(106),l=\"prototype\",c=function(e,t,n){var u,p,d,h,f=e&c.F,m=e&c.G,g=e&c.S,y=e&c.P,v=e&c.B,b=m?r:g?r[t]||(r[t]={}):(r[t]||{})[l],_=m?i:i[t]||(i[t]={}),w=_[l]||(_[l]={});m&&(n=t);for(u in n)p=!f&&b&&void 0!==b[u],d=(p?b:n)[u],h=v&&p?a(d,r):y&&\"function\"==typeof d?a(Function.call,d):d,b&&s(b,u,d,e&c.U),_[u]!=d&&o(_,u,h),y&&w[u]!=d&&(w[u]=d)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){\"use strict\";function __export(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}var r=n(0),i=n(321),o=n(334);__export(n(334)),__export(n(322)),__export(n(525)),__export(n(321)),__export(n(527));var s=n(230);t.NgLocalization=s.NgLocalization;var a=function(){function CommonModule(){}return CommonModule.decorators=[{type:r.NgModule,args:[{declarations:[i.COMMON_DIRECTIVES,o.COMMON_PIPES],exports:[i.COMMON_DIRECTIVES,o.COMMON_PIPES]}]}],CommonModule}();t.CommonModule=a},function(e,t,n){\"use strict\";(function(e){function scheduleMicroTask(e){Zone.current.scheduleMicroTask(\"scheduleMicrotask\",e)}function getTypeNameForDebugging(e){return e.name?e.name:typeof e}function isPresent(e){return void 0!==e&&null!==e}function isBlank(e){return void 0===e||null===e}function isBoolean(e){return\"boolean\"==typeof e}function isNumber(e){return\"number\"==typeof e}function isString(e){return\"string\"==typeof e}function isFunction(e){return\"function\"==typeof e}function isType(e){return isFunction(e)}function isStringMap(e){return\"object\"==typeof e&&null!==e}function isStrictStringMap(e){return isStringMap(e)&&Object.getPrototypeOf(e)===o}function isPromise(e){return isPresent(e)&&isFunction(e.then)}function isArray(e){return Array.isArray(e)}function isDate(e){return e instanceof t.Date&&!isNaN(e.valueOf())}function noop(){}function stringify(e){if(\"string\"==typeof e)return e;if(void 0===e||null===e)return\"\"+e;if(e.overriddenName)return e.overriddenName;if(e.name)return e.name;var t=e.toString(),n=t.indexOf(\"\\n\");return n===-1?t:t.substring(0,n)}function serializeEnum(e){return e}function deserializeEnum(e,t){return e}function resolveEnumToken(e,t){return e[t]}function looseIdentical(e,t){return e===t||\"number\"==typeof e&&\"number\"==typeof t&&isNaN(e)&&isNaN(t)}function getMapKey(e){return e}function normalizeBlank(e){return isBlank(e)?null:e}function normalizeBool(e){return!isBlank(e)&&e}function isJsObject(e){return null!==e&&(\"function\"==typeof e||\"object\"==typeof e)}function print(e){console.log(e)}function warn(e){console.warn(e)}function setValueOnPath(e,t,n){for(var r=t.split(\".\"),i=e;r.length>1;){var o=r.shift();i=i.hasOwnProperty(o)&&isPresent(i[o])?i[o]:i[o]={}}void 0!==i&&null!==i||(i={}),i[r.shift()]=n}function getSymbolIterator(){if(isBlank(h))if(isPresent(n.Symbol)&&isPresent(Symbol.iterator))h=Symbol.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),t=0;t=0&&e[r]==t;r--)n--;e=e.substring(0,n)}return e},StringWrapper.replace=function(e,t,n){return e.replace(t,n)},StringWrapper.replaceAll=function(e,t,n){return e.replace(t,n)},StringWrapper.slice=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=null),e.slice(t,null===n?void 0:n)},StringWrapper.replaceAllMapped=function(e,t,n){return e.replace(t,function(){for(var e=[],t=0;tt?1:0},StringWrapper}();t.StringWrapper=s;var a=function(){function StringJoiner(e){void 0===e&&(e=[]),this.parts=e}return StringJoiner.prototype.add=function(e){this.parts.push(e)},StringJoiner.prototype.toString=function(){return this.parts.join(\"\")},StringJoiner}();t.StringJoiner=a;var l=function(e){function NumberParseError(t){e.call(this),this.message=t}return r(NumberParseError,e),NumberParseError.prototype.toString=function(){return this.message},NumberParseError}(Error);t.NumberParseError=l;var c=function(){function NumberWrapper(){}return NumberWrapper.toFixed=function(e,t){return e.toFixed(t)},NumberWrapper.equal=function(e,t){return e===t},NumberWrapper.parseIntAutoRadix=function(e){var t=parseInt(e);if(isNaN(t))throw new l(\"Invalid integer literal when parsing \"+e);return t},NumberWrapper.parseInt=function(e,t){if(10==t){if(/^(\\-|\\+)?[0-9]+$/.test(e))return parseInt(e,t)}else if(16==t){if(/^(\\-|\\+)?[0-9ABCDEFabcdef]+$/.test(e))return parseInt(e,t)}else{var n=parseInt(e,t);if(!isNaN(n))return n}throw new l(\"Invalid integer literal when parsing \"+e+\" in base \"+t)},NumberWrapper.parseFloat=function(e){return parseFloat(e)},Object.defineProperty(NumberWrapper,\"NaN\",{get:function(){return NaN},enumerable:!0,configurable:!0}),NumberWrapper.isNumeric=function(e){return!isNaN(e-parseFloat(e))},NumberWrapper.isNaN=function(e){return isNaN(e)},NumberWrapper.isInteger=function(e){return Number.isInteger(e)},NumberWrapper}();t.NumberWrapper=c,t.RegExp=i.RegExp;var u=function(){function FunctionWrapper(){}return FunctionWrapper.apply=function(e,t){return e.apply(null,t)},FunctionWrapper.bind=function(e,t){return e.bind(t)},FunctionWrapper}();t.FunctionWrapper=u,t.looseIdentical=looseIdentical,t.getMapKey=getMapKey,t.normalizeBlank=normalizeBlank,t.normalizeBool=normalizeBool,t.isJsObject=isJsObject,t.print=print,t.warn=warn;var p=function(){function Json(){}return Json.parse=function(e){return i.JSON.parse(e)},Json.stringify=function(e){return i.JSON.stringify(e,null,2)},Json}();t.Json=p;var d=function(){function DateWrapper(){}return DateWrapper.create=function(e,n,r,i,o,s,a){return void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),new t.Date(e,n-1,r,i,o,s,a)},DateWrapper.fromISOString=function(e){return new t.Date(e)},DateWrapper.fromMillis=function(e){return new t.Date(e)},DateWrapper.toMillis=function(e){return e.getTime()},DateWrapper.now=function(){return new t.Date},DateWrapper.toJson=function(e){return e.toJSON()},DateWrapper}();t.DateWrapper=d,t.setValueOnPath=setValueOnPath;var h=null;t.getSymbolIterator=getSymbolIterator,t.evalExpression=evalExpression,t.isPrimitive=isPrimitive,t.hasConstructor=hasConstructor,t.escape=escape,t.escapeRegExp=escapeRegExp}).call(t,n(82))},4,function(e,t,n){\"use strict\";var r=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=n(217),o=n(41),s=n(215),a=n(897),l=function(e){function Subscriber(t,n,r){switch(e.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=a.empty;break;case 1:if(!t){this.destination=a.empty;break}if(\"object\"==typeof t){t instanceof Subscriber?(this.destination=t,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new c(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new c(this,t,n,r)}}return r(Subscriber,e),Subscriber.create=function(e,t,n){var r=new Subscriber(e,t,n);return r.syncErrorThrowable=!1,r},Subscriber.prototype.next=function(e){this.isStopped||this._next(e)},Subscriber.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},Subscriber.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Subscriber.prototype.unsubscribe=function(){this.isUnsubscribed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},Subscriber.prototype._next=function(e){this.destination.next(e)},Subscriber.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},Subscriber.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},Subscriber.prototype[s.$$rxSubscriber]=function(){return this},Subscriber}(o.Subscription);t.Subscriber=l;var c=function(e){function SafeSubscriber(t,n,r,o){e.call(this),this._parent=t;var s,a=this;i.isFunction(n)?s=n:n&&(a=n,s=n.next,r=n.error,o=n.complete,i.isFunction(a.unsubscribe)&&this.add(a.unsubscribe.bind(a)),a.unsubscribe=this.unsubscribe.bind(this)),this._context=a,this._next=s,this._error=r,this._complete=o}return r(SafeSubscriber,e),SafeSubscriber.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parent;t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},SafeSubscriber.prototype.error=function(e){if(!this.isStopped){var t=this._parent;if(this._error)t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else{if(!t.syncErrorThrowable)throw this.unsubscribe(),e;t.syncErrorValue=e,t.syncErrorThrown=!0,this.unsubscribe()}}},SafeSubscriber.prototype.complete=function(){if(!this.isStopped){var e=this._parent;this._complete?e.syncErrorThrowable?(this.__tryOrSetError(e,this._complete),this.unsubscribe()):(this.__tryOrUnsub(this._complete),this.unsubscribe()):this.unsubscribe()}},SafeSubscriber.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(n){throw this.unsubscribe(),n}},SafeSubscriber.prototype.__tryOrSetError=function(e,t,n){try{t.call(this._context,n)}catch(r){return e.syncErrorValue=r,e.syncErrorThrown=!0,!0}return!1},SafeSubscriber.prototype._unsubscribe=function(){var e=this._parent;this._context=null,this._parent=null,e.unsubscribe()},SafeSubscriber}(l)},4,function(e,t,n){var r=n(15);e.exports=function(e){if(!r(e))throw TypeError(e+\" is not an object!\");return e}},function(e,t,n){\"use strict\";var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=n(0),s=function(){function DomHandler(){}return DomHandler.prototype.addClass=function(e,t){e.classList?e.classList.add(t):e.className+=\" \"+t},DomHandler.prototype.addMultipleClasses=function(e,t){if(e.classList)for(var n=t.split(\" \"),r=0;rwindow.innerHeight?-1*i.height:o,r=a.left+i.width>window.innerWidth?s-i.width:0,e.style.top=n+\"px\",e.style.left=r+\"px\"},DomHandler.prototype.absolutePosition=function(e,t){var n,r,i=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),o=i.height,s=i.width,a=t.offsetHeight,l=t.offsetWidth,c=t.getBoundingClientRect(),u=this.getWindowScrollTop(),p=this.getWindowScrollLeft();n=c.top+a+o>window.innerHeight?c.top+u-o:a+c.top+u,r=c.left+l+s>window.innerWidth?c.left+p+l-s:c.left+p,e.style.top=n+\"px\",e.style.left=r+\"px\"},DomHandler.prototype.getHiddenElementOuterHeight=function(e){e.style.visibility=\"hidden\",e.style.display=\"block\";var t=e.offsetHeight;return e.style.display=\"none\",e.style.visibility=\"visible\",t},DomHandler.prototype.getHiddenElementOuterWidth=function(e){e.style.visibility=\"hidden\",e.style.display=\"block\";var t=e.offsetWidth;return e.style.display=\"none\",e.style.visibility=\"visible\",t},DomHandler.prototype.getHiddenElementDimensions=function(e){var t={};return e.style.visibility=\"hidden\",e.style.display=\"block\",t.width=e.offsetWidth,t.height=e.offsetHeight,e.style.display=\"none\",e.style.visibility=\"visible\",t},DomHandler.prototype.scrollInView=function(e,t){var n=getComputedStyle(e).getPropertyValue(\"borderTopWidth\"),r=n?parseFloat(n):0,i=getComputedStyle(e).getPropertyValue(\"paddingTop\"),o=i?parseFloat(i):0,s=e.getBoundingClientRect(),a=t.getBoundingClientRect(),l=a.top+document.body.scrollTop-(s.top+document.body.scrollTop)-r-o,c=e.scrollTop,u=e.clientHeight,p=this.getOuterHeight(t);l<0?e.scrollTop=c+l:l+p>u&&(e.scrollTop=c+l-u+p)},DomHandler.prototype.fadeIn=function(e,t){e.style.opacity=0;var n=+new Date,r=function(){e.style.opacity=+e.style.opacity+((new Date).getTime()-n)/t,n=+new Date,+e.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(r)||setTimeout(r,16))};r()},DomHandler.prototype.fadeOut=function(e,t){var n=1,r=50,i=t,o=r/i,s=setInterval(function(){n-=o,e.style.opacity=n,n<=0&&clearInterval(s)},r)},DomHandler.prototype.getWindowScrollTop=function(){var e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)},DomHandler.prototype.getWindowScrollLeft=function(){var e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)},DomHandler.prototype.matches=function(e,t){var n=Element.prototype,r=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||function(e){return[].indexOf.call(document.querySelectorAll(e),this)!==-1};return r.call(e,t)},DomHandler.prototype.getOuterWidth=function(e,t){var n=e.offsetWidth;if(t){var r=getComputedStyle(e);n+=parseInt(r.paddingLeft)+parseInt(r.paddingRight)}return n},DomHandler.prototype.getHorizontalMargin=function(e){var t=getComputedStyle(e);return parseInt(t.marginLeft)+parseInt(t.marginRight)},DomHandler.prototype.innerWidth=function(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+=parseInt(n.paddingLeft)+parseInt(n.paddingRight)},DomHandler.prototype.width=function(e){var t=e.offsetWidth,n=getComputedStyle(e);return t-=parseInt(n.paddingLeft)+parseInt(n.paddingRight)},DomHandler.prototype.getOuterHeight=function(e,t){var n=e.offsetHeight;if(t){var r=getComputedStyle(e);n+=parseInt(r.marginTop)+parseInt(r.marginBottom)}return n},DomHandler.prototype.getHeight=function(e){var t=e.offsetHeight,n=getComputedStyle(e);return t-=parseInt(n.paddingTop)+parseInt(n.paddingBottom)+parseInt(n.borderTopWidth)+parseInt(n.borderBottomWidth)},DomHandler.prototype.getViewport=function(){var e=window,t=document,n=t.documentElement,r=t.getElementsByTagName(\"body\")[0],i=e.innerWidth||n.clientWidth||r.clientWidth,o=e.innerHeight||n.clientHeight||r.clientHeight;return{width:i,height:o}},DomHandler.prototype.equals=function(e,t){if(null==e||null==t)return!1;if(e==t)return!0;if(\"object\"==typeof e&&\"object\"==typeof t){for(var n in e){if(e.hasOwnProperty(n)!==t.hasOwnProperty(n))return!1;switch(typeof e[n]){case\"object\":if(!this.equals(e[n],t[n]))return!1;break;case\"function\":if(\"undefined\"==typeof t[n]||\"compare\"!=n&&e[n].toString()!=t[n].toString())return!1;break;default:if(e[n]!=t[n])return!1}}for(var n in t)if(\"undefined\"==typeof e[n])return!1;return!0}return!1},DomHandler.zindex=1e3,DomHandler=r([o.Injectable(),i(\"design:paramtypes\",[])],DomHandler)}();t.DomHandler=s},[1104,5],function(e,t,n){\"use strict\";var r=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=n(6),o=function(e){function OuterSubscriber(){e.apply(this,arguments)}return r(OuterSubscriber,e),OuterSubscriber.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(t)},OuterSubscriber.prototype.notifyError=function(e,t){this.destination.error(e)},OuterSubscriber.prototype.notifyComplete=function(e){this.destination.complete()},OuterSubscriber}(i.Subscriber);t.OuterSubscriber=o},function(e,t,n){\"use strict\";function subscribeToResult(e,t,n,u){var p=new c.InnerSubscriber(e,n,u);if(!p.isUnsubscribed){if(t instanceof s.Observable)return t._isScalar?(p.next(t.value),void p.complete()):t.subscribe(p);if(i.isArray(t)){for(var d=0,h=t.length;d=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=n(0),s=n(3),a=n(0),l=function(){function Header(){}return Header=r([a.Component({selector:\"header\",template:\"\"}),i(\"design:paramtypes\",[])],Header)}();t.Header=l;var c=function(){function Footer(){}return Footer=r([a.Component({selector:\"footer\",template:\"\"}),i(\"design:paramtypes\",[])],Footer)}();t.Footer=c;var u=function(){function TemplateWrapper(e){this.viewContainer=e}return TemplateWrapper.prototype.ngOnInit=function(){this.viewContainer.createEmbeddedView(this.templateRef,{$implicit:this.item})},r([o.Input(),i(\"design:type\",Object)],TemplateWrapper.prototype,\"item\",void 0),r([o.Input(\"pTemplateWrapper\"),i(\"design:type\",o.TemplateRef)],TemplateWrapper.prototype,\"templateRef\",void 0),TemplateWrapper=r([o.Directive({selector:\"[pTemplateWrapper]\"}),i(\"design:paramtypes\",[o.ViewContainerRef])],TemplateWrapper)}();t.TemplateWrapper=u;var p=function(){function Column(){this.sortFunction=new o.EventEmitter}return r([o.Input(),i(\"design:type\",String)],Column.prototype,\"field\",void 0),r([o.Input(),i(\"design:type\",String)],Column.prototype,\"header\",void 0),r([o.Input(),i(\"design:type\",String)],Column.prototype,\"footer\",void 0),r([o.Input(),i(\"design:type\",Object)],Column.prototype,\"sortable\",void 0),r([o.Input(),i(\"design:type\",Boolean)],Column.prototype,\"editable\",void 0),r([o.Input(),i(\"design:type\",Boolean)],Column.prototype,\"filter\",void 0),r([o.Input(),i(\"design:type\",String)],Column.prototype,\"filterMatchMode\",void 0),r([o.Input(),i(\"design:type\",Number)],Column.prototype,\"rowspan\",void 0),r([o.Input(),i(\"design:type\",Number)],Column.prototype,\"colspan\",void 0),r([o.Input(),i(\"design:type\",Object)],Column.prototype,\"style\",void 0),r([o.Input(),i(\"design:type\",String)],Column.prototype,\"styleClass\",void 0),r([o.Input(),i(\"design:type\",Boolean)],Column.prototype,\"hidden\",void 0),r([o.Input(),i(\"design:type\",Boolean)],Column.prototype,\"expander\",void 0),r([o.Input(),i(\"design:type\",String)],Column.prototype,\"selectionMode\",void 0),r([o.Output(),i(\"design:type\",o.EventEmitter)],Column.prototype,\"sortFunction\",void 0),r([o.ContentChild(o.TemplateRef),i(\"design:type\",o.TemplateRef)],Column.prototype,\"template\",void 0),Column=r([a.Component({selector:\"p-column\",template:\"\"}),i(\"design:paramtypes\",[])],Column)}();t.Column=p;var d=function(){function ColumnTemplateLoader(e){this.viewContainer=e}return ColumnTemplateLoader.prototype.ngOnInit=function(){this.viewContainer.createEmbeddedView(this.column.template,{$implicit:this.column,rowData:this.rowData,rowIndex:this.rowIndex})},r([o.Input(),i(\"design:type\",Object)],ColumnTemplateLoader.prototype,\"column\",void 0),r([o.Input(),i(\"design:type\",Object)],ColumnTemplateLoader.prototype,\"rowData\",void 0),r([o.Input(),i(\"design:type\",Number)],ColumnTemplateLoader.prototype,\"rowIndex\",void 0),ColumnTemplateLoader=r([a.Component({selector:\"p-columnTemplateLoader\",template:\"\"}),i(\"design:paramtypes\",[o.ViewContainerRef])],ColumnTemplateLoader)}();t.ColumnTemplateLoader=d;var h=function(){function SharedModule(){}return SharedModule=r([o.NgModule({imports:[s.CommonModule],exports:[l,c,p,u,d],declarations:[l,c,p,u,d]}),i(\"design:paramtypes\",[])],SharedModule)}();t.SharedModule=h},function(e,t,n){\"use strict\";var r=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=n(1),o=n(6),s=n(41),a=n(899),l=n(215),c=n(517),u=n(317),p=function(e){function Subject(t,n){e.call(this),this.destination=t,this.source=n,this.observers=[],this.isUnsubscribed=!1,this.isStopped=!1,this.hasErrored=!1,this.dispatching=!1,this.hasCompleted=!1,this.source=n}return r(Subject,e),Subject.prototype.lift=function(e){var t=new Subject(this.destination||this,this);return t.operator=e,t},Subject.prototype.add=function(e){return s.Subscription.prototype.add.call(this,e)},Subject.prototype.remove=function(e){s.Subscription.prototype.remove.call(this,e)},Subject.prototype.unsubscribe=function(){s.Subscription.prototype.unsubscribe.call(this)},Subject.prototype._subscribe=function(e){if(this.source)return this.source.subscribe(e);if(!e.isUnsubscribed){if(this.hasErrored)return e.error(this.errorValue);if(this.hasCompleted)return e.complete();this.throwIfUnsubscribed();var t=new a.SubjectSubscription(this,e);return this.observers.push(e),t}},Subject.prototype._unsubscribe=function(){this.source=null,this.isStopped=!0,this.observers=null,this.destination=null},Subject.prototype.next=function(e){this.throwIfUnsubscribed(),this.isStopped||(this.dispatching=!0,this._next(e),this.dispatching=!1,this.hasErrored?this._error(this.errorValue):this.hasCompleted&&this._complete())},Subject.prototype.error=function(e){this.throwIfUnsubscribed(),this.isStopped||(this.isStopped=!0,this.hasErrored=!0,this.errorValue=e,this.dispatching||this._error(e))},Subject.prototype.complete=function(){this.throwIfUnsubscribed(),this.isStopped||(this.isStopped=!0,this.hasCompleted=!0,this.dispatching||this._complete())},Subject.prototype.asObservable=function(){var e=new d(this);return e},Subject.prototype._next=function(e){this.destination?this.destination.next(e):this._finalNext(e)},Subject.prototype._finalNext=function(e){for(var t=-1,n=this.observers.slice(0),r=n.length;++t\"+i+\"\"};e.exports=function(e,t){var n={};n[e]=t(a),r(r.P+r.F*i(function(){var t=\"\"[e]('\"');return t!==t.toLowerCase()||t.split('\"').length>3}),\"String\",n)}},function(e,t,n){\"use strict\";var r=n(81),i=n(514),o=n(217),s=n(42),a=n(38),l=n(513),c=function(){function Subscription(e){this.isUnsubscribed=!1,e&&(this._unsubscribe=e)}return Subscription.prototype.unsubscribe=function(){var e,t=!1;if(!this.isUnsubscribed){this.isUnsubscribed=!0;var n=this,c=n._unsubscribe,u=n._subscriptions;if(this._subscriptions=null,o.isFunction(c)){var p=s.tryCatch(c).call(this);p===a.errorObject&&(t=!0,(e=e||[]).push(a.errorObject.e))}if(r.isArray(u))for(var d=-1,h=u.length;++d0?i(r(e),9007199254740991):0}},function(e,t,n){\"use strict\";var r=n(1082);t.async=new r.AsyncScheduler},function(e,t,n){\"use strict\";function __export(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}var r=n(86);t.HostMetadata=r.HostMetadata,t.InjectMetadata=r.InjectMetadata,t.InjectableMetadata=r.InjectableMetadata,t.OptionalMetadata=r.OptionalMetadata,t.SelfMetadata=r.SelfMetadata,t.SkipSelfMetadata=r.SkipSelfMetadata,__export(n(115));var i=n(162);t.forwardRef=i.forwardRef,t.resolveForwardRef=i.resolveForwardRef;var o=n(163);t.Injector=o.Injector;var s=n(571);t.ReflectiveInjector=s.ReflectiveInjector;var a=n(250);t.Binding=a.Binding,t.ProviderBuilder=a.ProviderBuilder,t.bind=a.bind,t.Provider=a.Provider,t.provide=a.provide;var l=n(253);t.ResolvedReflectiveFactory=l.ResolvedReflectiveFactory;var c=n(252);t.ReflectiveKey=c.ReflectiveKey;var u=n(251);t.NoProviderError=u.NoProviderError,t.AbstractProviderError=u.AbstractProviderError,t.CyclicDependencyError=u.CyclicDependencyError,t.InstantiationError=u.InstantiationError,t.InvalidProviderError=u.InvalidProviderError,t.NoAnnotationError=u.NoAnnotationError,t.OutOfBoundsError=u.OutOfBoundsError;var p=n(374);t.OpaqueToken=p.OpaqueToken},[1104,32],function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){\"use strict\";var r=n(13);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){var r=n(75);e.exports=function(e){return Object(r(e))}},function(e,t,n){\"use strict\";(function(e,n){var r={\"boolean\":!1,\"function\":!0,object:!0,number:!1,string:!1,undefined:!1};t.root=r[typeof self]&&self||r[typeof window]&&window;var i=(r[typeof t]&&t&&!t.nodeType&&t,r[typeof e]&&e&&!e.nodeType&&e,r[typeof n]&&n);!i||i.global!==i&&i.window!==i||(t.root=i)}).call(t,n(1100)(e),n(82))},function(e,t,n){\"use strict\";var r=n(0);t.NG_VALUE_ACCESSOR=new r.OpaqueToken(\"NgValueAccessor\")},52,function(e,t,n){\"use strict\";function _convertToPromise(e){return s.isPromise(e)?e:i.toPromise.call(e)}function _executeValidators(e,t){return t.map(function(t){return t(e)})}function _executeAsyncValidators(e,t){return t.map(function(t){return t(e)})}function _mergeErrors(e){var t=e.reduce(function(e,t){return s.isPresent(t)?o.StringMapWrapper.merge(e,t):e},{});return o.StringMapWrapper.isEmpty(t)?null:t}var r=n(0),i=n(313),o=n(47),s=n(32);t.NG_VALIDATORS=new r.OpaqueToken(\"NgValidators\"),t.NG_ASYNC_VALIDATORS=new r.OpaqueToken(\"NgAsyncValidators\");var a=function(){function Validators(){}return Validators.required=function(e){return s.isBlank(e.value)||s.isString(e.value)&&\"\"==e.value?{required:!0}:null},Validators.minLength=function(e){return function(t){if(s.isPresent(Validators.required(t)))return null;var n=t.value;return n.lengthe?{maxlength:{requiredLength:e,actualLength:n.length}}:null}},Validators.pattern=function(e){return function(t){if(s.isPresent(Validators.required(t)))return null;var n=new RegExp(\"^\"+e+\"$\"),r=t.value;return n.test(r)?null:{pattern:{requiredPattern:\"^\"+e+\"$\",actualValue:r}}}},Validators.nullValidator=function(e){return null},Validators.compose=function(e){if(s.isBlank(e))return null;var t=e.filter(s.isPresent);return 0==t.length?null:function(e){return _mergeErrors(_executeValidators(e,t))}},Validators.composeAsync=function(e){if(s.isBlank(e))return null;var t=e.filter(s.isPresent);return 0==t.length?null:function(e){var n=_executeAsyncValidators(e,t).map(_convertToPromise);return Promise.all(n).then(_mergeErrors)}},Validators}();t.Validators=a},function(e,t,n){\"use strict\";var r=n(0),i=n(123),o=n(72),s=n(16),a=n(126),l=n(278);t.PRIMITIVE=String;var c=function(){function Serializer(e){this._renderStore=e}return Serializer.prototype.serialize=function(e,n){var i=this;if(!s.isPresent(e))return null;if(s.isArray(e))return e.map(function(e){return i.serialize(e,n)});if(n==t.PRIMITIVE)return e;if(n==u)return this._renderStore.serialize(e);if(n===r.RenderComponentType)return this._serializeRenderComponentType(e);if(n===r.ViewEncapsulation)return s.serializeEnum(e);if(n===l.LocationType)return this._serializeLocation(e);throw new o.BaseException(\"No serializer for \"+n.toString())},Serializer.prototype.deserialize=function(e,n,a){var c=this;if(!s.isPresent(e))return null;if(s.isArray(e)){var p=[];return e.forEach(function(e){return p.push(c.deserialize(e,n,a))}),p}if(n==t.PRIMITIVE)return e;if(n==u)return this._renderStore.deserialize(e);if(n===r.RenderComponentType)return this._deserializeRenderComponentType(e);if(n===r.ViewEncapsulation)return i.VIEW_ENCAPSULATION_VALUES[e];if(n===l.LocationType)return this._deserializeLocation(e);throw new o.BaseException(\"No deserializer for \"+n.toString())},Serializer.prototype._serializeLocation=function(e){return{href:e.href,protocol:e.protocol,host:e.host,hostname:e.hostname,port:e.port,pathname:e.pathname,search:e.search,hash:e.hash,origin:e.origin}},Serializer.prototype._deserializeLocation=function(e){return new l.LocationType(e.href,e.protocol,e.host,e.hostname,e.port,e.pathname,e.search,e.hash,e.origin)},Serializer.prototype._serializeRenderComponentType=function(e){return{id:e.id,templateUrl:e.templateUrl,slotCount:e.slotCount,encapsulation:this.serialize(e.encapsulation,r.ViewEncapsulation),styles:this.serialize(e.styles,t.PRIMITIVE)}},Serializer.prototype._deserializeRenderComponentType=function(e){return new r.RenderComponentType(e.id,e.templateUrl,e.slotCount,this.deserialize(e.encapsulation,r.ViewEncapsulation),this.deserialize(e.styles,t.PRIMITIVE),{})},Serializer.decorators=[{type:r.Injectable}],Serializer.ctorParameters=[{type:a.RenderStore}],Serializer}();t.Serializer=c;var u=function(){function RenderStoreObject(){}return RenderStoreObject}();t.RenderStoreObject=u},function(e,t,n){var r=n(2),i=n(24),o=n(13);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],s={};s[e]=t(n),r(r.S+r.F*o(function(){n(1)}),\"Object\",s)}},function(e,t,n){var r=n(133),i=n(75);e.exports=function(e){return r(i(e))}},function(e,t,n){\"use strict\";function _convertToPromise(e){return s.isPromise(e)?e:i.toPromise.call(e)}function _executeValidators(e,t){return t.map(function(t){return t(e)})}function _executeAsyncValidators(e,t){return t.map(function(t){return t(e)})}function _mergeErrors(e){var t=e.reduce(function(e,t){return s.isPresent(t)?o.StringMapWrapper.merge(e,t):e},{});return o.StringMapWrapper.isEmpty(t)?null:t}var r=n(0),i=n(313),o=n(34),s=n(7);t.NG_VALIDATORS=new r.OpaqueToken(\"NgValidators\"),t.NG_ASYNC_VALIDATORS=new r.OpaqueToken(\"NgAsyncValidators\");var a=function(){function Validators(){}return Validators.required=function(e){return s.isBlank(e.value)||s.isString(e.value)&&\"\"==e.value?{required:!0}:null},Validators.minLength=function(e){return function(t){if(s.isPresent(Validators.required(t)))return null;var n=t.value;return n.lengthe?{maxlength:{requiredLength:e,actualLength:n.length}}:null}},Validators.pattern=function(e){return function(t){if(s.isPresent(Validators.required(t)))return null;var n=new RegExp(\"^\"+e+\"$\"),r=t.value;return n.test(r)?null:{pattern:{requiredPattern:\"^\"+e+\"$\",actualValue:r}}}},Validators.nullValidator=function(e){return null},Validators.compose=function(e){if(s.isBlank(e))return null;var t=e.filter(s.isPresent);return 0==t.length?null:function(e){return _mergeErrors(_executeValidators(e,t))}},Validators.composeAsync=function(e){if(s.isBlank(e))return null;var t=e.filter(s.isPresent);return 0==t.length?null:function(e){var n=_executeAsyncValidators(e,t).map(_convertToPromise);return Promise.all(n).then(_mergeErrors)}},Validators}();t.Validators=a},function(e,t,n){\"use strict\";var r=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=n(83),o=n(7),s=function(e){function InvalidPipeArgumentException(t,n){e.call(this,\"Invalid argument '\"+n+\"' for pipe '\"+o.stringify(t)+\"'\")}return r(InvalidPipeArgumentException,e),InvalidPipeArgumentException}(i.BaseException);t.InvalidPipeArgumentException=s},function(e,t,n){\"use strict\";/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nvar r=n(5),i=function(){function ParseLocation(e,t,n,r){this.file=e,this.offset=t,this.line=n,this.col=r}return ParseLocation.prototype.toString=function(){return r.isPresent(this.offset)?this.file.url+\"@\"+this.line+\":\"+this.col:this.file.url},ParseLocation}();t.ParseLocation=i;var o=function(){function ParseSourceFile(e,t){this.content=e,this.url=t}return ParseSourceFile}();t.ParseSourceFile=o;var s=function(){function ParseSourceSpan(e,t,n){void 0===n&&(n=null),this.start=e,this.end=t,this.details=n}return ParseSourceSpan.prototype.toString=function(){return this.start.file.content.substring(this.start.offset,this.end.offset)},ParseSourceSpan}();t.ParseSourceSpan=s,function(e){e[e.WARNING=0]=\"WARNING\",e[e.FATAL=1]=\"FATAL\"}(t.ParseErrorLevel||(t.ParseErrorLevel={}));var a=t.ParseErrorLevel,l=function(){function ParseError(e,t,n){void 0===n&&(n=a.FATAL),this.span=e,this.msg=t,this.level=n}return ParseError.prototype.toString=function(){var e=this.span.start.file.content,t=this.span.start.offset,n=\"\",i=\"\";if(r.isPresent(t)){t>e.length-1&&(t=e.length-1);for(var o=t,s=0,a=0;s<100&&t>0&&(t--,s++,\"\\n\"!=e[t]||3!=++a););for(s=0,a=0;s<100&&o]\"+e.substring(this.span.start.offset,o+1);n=' (\"'+l+'\")'}return this.span.details&&(i=\", \"+this.span.details),\"\"+this.msg+n+\": \"+this.span.start+i},ParseError}();t.ParseError=l},function(e,t,n){\"use strict\";function templateVisitAll(e,t,n){void 0===n&&(n=null);var i=[];return t.forEach(function(t){var o=t.visit(e,n);r.isPresent(o)&&i.push(o)}),i}var r=n(5),i=function(){function TextAst(e,t,n){this.value=e,this.ngContentIndex=t,this.sourceSpan=n}return TextAst.prototype.visit=function(e,t){return e.visitText(this,t)},TextAst}();t.TextAst=i;var o=function(){function BoundTextAst(e,t,n){this.value=e,this.ngContentIndex=t,this.sourceSpan=n}return BoundTextAst.prototype.visit=function(e,t){return e.visitBoundText(this,t)},BoundTextAst}();t.BoundTextAst=o;var s=function(){function AttrAst(e,t,n){this.name=e,this.value=t,this.sourceSpan=n}return AttrAst.prototype.visit=function(e,t){return e.visitAttr(this,t)},AttrAst}();t.AttrAst=s;var a=function(){function BoundElementPropertyAst(e,t,n,r,i,o){this.name=e,this.type=t,this.securityContext=n,this.value=r,this.unit=i,this.sourceSpan=o}return BoundElementPropertyAst.prototype.visit=function(e,t){return e.visitElementProperty(this,t)},BoundElementPropertyAst}();t.BoundElementPropertyAst=a;var l=function(){function BoundEventAst(e,t,n,r){this.name=e,this.target=t,this.handler=n,this.sourceSpan=r}return BoundEventAst.prototype.visit=function(e,t){return e.visitEvent(this,t)},Object.defineProperty(BoundEventAst.prototype,\"fullName\",{get:function(){return r.isPresent(this.target)?this.target+\":\"+this.name:this.name},enumerable:!0,configurable:!0}),BoundEventAst}();t.BoundEventAst=l;var c=function(){function ReferenceAst(e,t,n){this.name=e,this.value=t,this.sourceSpan=n}return ReferenceAst.prototype.visit=function(e,t){return e.visitReference(this,t)},ReferenceAst}();t.ReferenceAst=c;var u=function(){function VariableAst(e,t,n){this.name=e,this.value=t,this.sourceSpan=n}return VariableAst.prototype.visit=function(e,t){return e.visitVariable(this,t)},VariableAst}();t.VariableAst=u;var p=function(){function ElementAst(e,t,n,r,i,o,s,a,l,c,u){this.name=e,this.attrs=t,this.inputs=n,this.outputs=r,this.references=i,this.directives=o,this.providers=s,this.hasViewContainer=a,this.children=l,this.ngContentIndex=c,this.sourceSpan=u}return ElementAst.prototype.visit=function(e,t){return e.visitElement(this,t)},ElementAst}();t.ElementAst=p;var d=function(){function EmbeddedTemplateAst(e,t,n,r,i,o,s,a,l,c){this.attrs=e,this.outputs=t,this.references=n,this.variables=r,this.directives=i,this.providers=o,this.hasViewContainer=s,this.children=a,this.ngContentIndex=l,this.sourceSpan=c}return EmbeddedTemplateAst.prototype.visit=function(e,t){return e.visitEmbeddedTemplate(this,t)},EmbeddedTemplateAst}();t.EmbeddedTemplateAst=d;var h=function(){function BoundDirectivePropertyAst(e,t,n,r){this.directiveName=e,this.templateName=t,this.value=n,this.sourceSpan=r}return BoundDirectivePropertyAst.prototype.visit=function(e,t){return e.visitDirectiveProperty(this,t)},BoundDirectivePropertyAst}();t.BoundDirectivePropertyAst=h;var f=function(){function DirectiveAst(e,t,n,r,i){this.directive=e,this.inputs=t,this.hostProperties=n,this.hostEvents=r,this.sourceSpan=i}return DirectiveAst.prototype.visit=function(e,t){return e.visitDirective(this,t)},DirectiveAst}();t.DirectiveAst=f;var m=function(){function ProviderAst(e,t,n,r,i,o,s){this.token=e,this.multiProvider=t,this.eager=n,this.providers=r,this.providerType=i,this.lifecycleHooks=o,this.sourceSpan=s}return ProviderAst.prototype.visit=function(e,t){return null},ProviderAst}();t.ProviderAst=m,function(e){e[e.PublicService=0]=\"PublicService\",e[e.PrivateService=1]=\"PrivateService\",e[e.Component=2]=\"Component\",e[e.Directive=3]=\"Directive\",e[e.Builtin=4]=\"Builtin\"}(t.ProviderAstType||(t.ProviderAstType={}));var g=(t.ProviderAstType,function(){function NgContentAst(e,t,n){this.index=e,this.ngContentIndex=t,this.sourceSpan=n}return NgContentAst.prototype.visit=function(e,t){return e.visitNgContent(this,t)},NgContentAst}());t.NgContentAst=g,function(e){e[e.Property=0]=\"Property\",e[e.Attribute=1]=\"Attribute\",e[e.Class=2]=\"Class\",e[e.Style=3]=\"Style\",e[e.Animation=4]=\"Animation\"}(t.PropertyBindingType||(t.PropertyBindingType={}));t.PropertyBindingType;t.templateVisitAll=templateVisitAll},function(e,t){\"use strict\";var n=function(){function MessageBus(){}return MessageBus}();t.MessageBus=n},function(e,t){\"use strict\";t.PRIMARY_OUTLET=\"primary\"},function(e,t,n){var r=n(106),i=n(133),o=n(50),s=n(44),a=n(676);e.exports=function(e,t){var n=1==e,l=2==e,c=3==e,u=4==e,p=6==e,d=5==e||p,h=t||a;return function(t,a,f){for(var m,g,y=o(t),v=i(y),b=r(a,f,3),_=s(v.length),w=0,S=n?h(t,_):l?h(t,0):void 0;_>w;w++)if((d||w in v)&&(m=v[w],g=b(m,w,y),e))if(n)S[w]=g;else if(g)switch(e){case 3:return!0;case 5:return m;case 6:return w;case 2:S.push(m)}else if(u)return!1;return p?-1:c||u?u:S}}},function(e,t,n){var r=n(30),i=n(109);e.exports=n(35)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(472),i=n(2),o=n(199)(\"metadata\"),s=o.store||(o.store=new(n(798))),a=function(e,t,n){var i=s.get(e);if(!i){if(!n)return;s.set(e,i=new r)}var o=i.get(t);if(!o){if(!n)return;i.set(t,o=new r)}return o},l=function(e,t,n){var r=a(t,n,!1);return void 0!==r&&r.has(e)},c=function(e,t,n){var r=a(t,n,!1);return void 0===r?void 0:r.get(e)},u=function(e,t,n,r){a(n,r,!0).set(e,t)},p=function(e,t){var n=a(e,t,!1),r=[];return n&&n.forEach(function(e,t){r.push(t)}),r},d=function(e){return void 0===e||\"symbol\"==typeof e?e:String(e)},h=function(e){i(i.S,\"Reflect\",e)};e.exports={store:s,map:a,has:l,get:c,set:u,keys:p,key:d,exp:h}},function(e,t,n){var r=n(48),i=n(50),o=n(300)(\"IE_PROTO\"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:\"function\"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,n){\"use strict\";var r=n(347),i=function(){function InterpolationConfig(e,t){this.start=e,this.end=t}return InterpolationConfig.fromArray=function(e){return e?(r.assertInterpolationSymbols(\"interpolation\",e),new InterpolationConfig(e[0],e[1])):t.DEFAULT_INTERPOLATION_CONFIG},InterpolationConfig}();t.InterpolationConfig=i,t.DEFAULT_INTERPOLATION_CONFIG=new i(\"{{\",\"}}\")},[1107,263],function(e,t,n){\"use strict\";function controlPath(e,t){var n=r.ListWrapper.clone(t.path);return n.push(e),n}function setUpControl(e,t){o.isBlank(e)&&_throwError(t,\"Cannot find control with\"),o.isBlank(t.valueAccessor)&&_throwError(t,\"No value accessor for form control with\"),e.validator=s.Validators.compose([e.validator,t.validator]),e.asyncValidator=s.Validators.composeAsync([e.asyncValidator,t.asyncValidator]),t.valueAccessor.writeValue(e.value),t.valueAccessor.registerOnChange(function(n){t.viewToModelUpdate(n),e.markAsDirty(),e.setValue(n,{emitModelToViewChange:!1})}),e.registerOnChange(function(e,n){t.valueAccessor.writeValue(e),n&&t.viewToModelUpdate(e)}),t.valueAccessor.registerOnTouched(function(){return e.markAsTouched()})}function setUpFormContainer(e,t){o.isBlank(e)&&_throwError(t,\"Cannot find control with\"),e.validator=s.Validators.compose([e.validator,t.validator]),e.asyncValidator=s.Validators.composeAsync([e.asyncValidator,t.asyncValidator])}function _throwError(e,t){var n;throw n=e.path.length>1?\"path: '\"+e.path.join(\" -> \")+\"'\":e.path[0]?\"name: '\"+e.path+\"'\":\"unspecified name attribute\",new i.BaseException(t+\" \"+n)}function composeValidators(e){return o.isPresent(e)?s.Validators.compose(e.map(c.normalizeValidator)):null}function composeAsyncValidators(e){return o.isPresent(e)?s.Validators.composeAsync(e.map(c.normalizeAsyncValidator)):null}function isPropertyUpdated(e,t){if(!r.StringMapWrapper.contains(e,\"model\"))return!1;var n=e.model;return!!n.isFirstChange()||!o.looseIdentical(t,n.currentValue)}function selectValueAccessor(e,t){if(o.isBlank(t))return null;var n,r,i;return t.forEach(function(t){o.hasConstructor(t,l.DefaultValueAccessor)?n=t:o.hasConstructor(t,a.CheckboxControlValueAccessor)||o.hasConstructor(t,u.NumberValueAccessor)||o.hasConstructor(t,d.SelectControlValueAccessor)||o.hasConstructor(t,h.SelectMultipleControlValueAccessor)||o.hasConstructor(t,p.RadioControlValueAccessor)?(o.isPresent(r)&&_throwError(e,\"More than one built-in value accessor matches form control with\"),r=t):(o.isPresent(i)&&_throwError(e,\"More than one custom value accessor matches form control with\"),i=t)}),o.isPresent(i)?i:o.isPresent(r)?r:o.isPresent(n)?n:(_throwError(e,\"No valid value accessor for form control with\"),null)}var r=n(47),i=n(88),o=n(32),s=n(54),a=n(169),l=n(170),c=n(587),u=n(266),p=n(172),d=n(173),h=n(174);t.controlPath=controlPath,t.setUpControl=setUpControl,t.setUpFormContainer=setUpFormContainer,t.composeValidators=composeValidators,t.composeAsyncValidators=composeAsyncValidators,t.isPropertyUpdated=isPropertyUpdated,t.selectValueAccessor=selectValueAccessor},function(e,t){\"use strict\";!function(e){e[e.Get=0]=\"Get\",e[e.Post=1]=\"Post\",e[e.Put=2]=\"Put\",e[e.Delete=3]=\"Delete\",e[e.Options=4]=\"Options\",e[e.Head=5]=\"Head\",e[e.Patch=6]=\"Patch\"}(t.RequestMethod||(t.RequestMethod={}));t.RequestMethod;!function(e){e[e.Unsent=0]=\"Unsent\",e[e.Open=1]=\"Open\",e[e.HeadersReceived=2]=\"HeadersReceived\",e[e.Loading=3]=\"Loading\",e[e.Done=4]=\"Done\",e[e.Cancelled=5]=\"Cancelled\"}(t.ReadyState||(t.ReadyState={}));t.ReadyState;!function(e){e[e.Basic=0]=\"Basic\",e[e.Cors=1]=\"Cors\",e[e.Default=2]=\"Default\",e[e.Error=3]=\"Error\",e[e.Opaque=4]=\"Opaque\"}(t.ResponseType||(t.ResponseType={}));t.ResponseType;!function(e){e[e.NONE=0]=\"NONE\",e[e.JSON=1]=\"JSON\",e[e.FORM=2]=\"FORM\",e[e.FORM_DATA=3]=\"FORM_DATA\",e[e.TEXT=4]=\"TEXT\",e[e.BLOB=5]=\"BLOB\",e[e.ARRAY_BUFFER=6]=\"ARRAY_BUFFER\"}(t.ContentType||(t.ContentType={}));t.ContentType;!function(e){e[e.Text=0]=\"Text\",e[e.Json=1]=\"Json\",e[e.ArrayBuffer=2]=\"ArrayBuffer\",e[e.Blob=3]=\"Blob\"}(t.ResponseContentType||(t.ResponseContentType={}));t.ResponseContentType},[1106,418,419,419],function(e,t,n){\"use strict\";function createEmptyUrlTree(){return new o(new s([],{}),{},null)}function containsTree(e,t,n){return n?equalSegmentGroups(e.root,t.root):containsSegmentGroup(e.root,t.root)}function equalSegmentGroups(e,t){if(!equalPath(e.segments,t.segments))return!1;if(e.numberOfChildren!==t.numberOfChildren)return!1;for(var n in t.children){if(!e.children[n])return!1;if(!equalSegmentGroups(e.children[n],t.children[n]))return!1}return!0}function containsSegmentGroup(e,t){return containsSegmentGroupHelper(e,t,t.segments)}function containsSegmentGroupHelper(e,t,n){if(e.segments.length>n.length){var i=e.segments.slice(0,n.length);return!!equalPath(i,n)&&!t.hasChildren()}if(e.segments.length===n.length){if(!equalPath(e.segments,n))return!1;for(var o in t.children){if(!e.children[o])return!1;if(!containsSegmentGroup(e.children[o],t.children[o]))return!1}return!0}var i=n.slice(0,e.segments.length),s=n.slice(e.segments.length);return!!equalPath(e.segments,i)&&(!!e.children[r.PRIMARY_OUTLET]&&containsSegmentGroupHelper(e.children[r.PRIMARY_OUTLET],t,s))}function equalSegments(e,t){if(e.length!==t.length)return!1;for(var n=0;n0?n+\"(\"+o.join(\"//\")+\")\":\"\"+n}if(e.hasChildren()&&!t){var s=mapChildrenIntoArray(e,function(t,n){return n===r.PRIMARY_OUTLET?[serializeSegment(e.children[r.PRIMARY_OUTLET],!1)]:[n+\":\"+serializeSegment(t,!1)]});return serializePaths(e)+\"/(\"+s.join(\"//\")+\")\"}return serializePaths(e)}function encode(e){return encodeURIComponent(e)}function decode(e){return decodeURIComponent(e)}function serializePath(e){return\"\"+encode(e.path)+serializeParams(e.parameters)}function serializeParams(e){return pairs(e).map(function(e){return\";\"+encode(e.first)+\"=\"+encode(e.second)}).join(\"\")}function serializeQueryParams(e){var t=pairs(e).map(function(e){return encode(e.first)+\"=\"+encode(e.second)});return t.length>0?\"?\"+t.join(\"&\"):\"\"}function pairs(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(new u(n,e[n]));return t}function matchSegments(e){p.lastIndex=0;var t=e.match(p);return t?t[0]:\"\"}function matchQueryParams(e){d.lastIndex=0;var t=e.match(p);return t?t[0]:\"\"}function matchUrlQueryParamValue(e){h.lastIndex=0;var t=e.match(h);return t?t[0]:\"\"}var r=n(63),i=n(74);t.createEmptyUrlTree=createEmptyUrlTree,t.containsTree=containsTree;var o=function(){function UrlTree(e,t,n){this.root=e,this.queryParams=t,this.fragment=n}return UrlTree.prototype.toString=function(){return(new c).serialize(this)},UrlTree}();t.UrlTree=o;var s=function(){function UrlSegmentGroup(e,t){var n=this;this.segments=e,this.children=t,this.parent=null,i.forEach(t,function(e,t){return e.parent=n})}return UrlSegmentGroup.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(UrlSegmentGroup.prototype,\"numberOfChildren\",{get:function(){return Object.keys(this.children).length},enumerable:!0,configurable:!0}),UrlSegmentGroup.prototype.toString=function(){return serializePaths(this)},UrlSegmentGroup}();t.UrlSegmentGroup=s;var a=function(){function UrlSegment(e,t){this.path=e,this.parameters=t}return UrlSegment.prototype.toString=function(){return serializePath(this)},UrlSegment}();t.UrlSegment=a,t.equalSegments=equalSegments,t.equalPath=equalPath,t.mapChildrenIntoArray=mapChildrenIntoArray;var l=function(){function UrlSerializer(){}return UrlSerializer}();t.UrlSerializer=l;var c=function(){function DefaultUrlSerializer(){}return DefaultUrlSerializer.prototype.parse=function(e){var t=new f(e);return new o(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())},DefaultUrlSerializer.prototype.serialize=function(e){var t=\"/\"+serializeSegment(e.root,!0),n=serializeQueryParams(e.queryParams),r=null!==e.fragment&&void 0!==e.fragment?\"#\"+encodeURIComponent(e.fragment):\"\";return\"\"+t+n+r},DefaultUrlSerializer}();t.DefaultUrlSerializer=c,t.serializePaths=serializePaths,t.encode=encode,t.decode=decode,t.serializePath=serializePath;var u=function(){function Pair(e,t){this.first=e,this.second=t}return Pair}(),p=/^[^\\/\\(\\)\\?;=&#]+/,d=/^[^=\\?&#]+/,h=/^[^\\?&#]+/,f=function(){function UrlParser(e){this.url=e,this.remaining=e}return UrlParser.prototype.peekStartsWith=function(e){return this.remaining.startsWith(e)},UrlParser.prototype.capture=function(e){if(!this.remaining.startsWith(e))throw new Error('Expected \"'+e+'\".');this.remaining=this.remaining.substring(e.length)},UrlParser.prototype.parseRootSegment=function(){return this.remaining.startsWith(\"/\")&&this.capture(\"/\"),\"\"===this.remaining||this.remaining.startsWith(\"?\")||this.remaining.startsWith(\"#\")?new s([],{}):new s([],this.parseChildren())},UrlParser.prototype.parseChildren=function(){if(0==this.remaining.length)return{};this.peekStartsWith(\"/\")&&this.capture(\"/\");var e=[];for(this.peekStartsWith(\"(\")||e.push(this.parseSegments());this.peekStartsWith(\"/\")&&!this.peekStartsWith(\"//\")&&!this.peekStartsWith(\"/(\");)this.capture(\"/\"),e.push(this.parseSegments());var t={};this.peekStartsWith(\"/(\")&&(this.capture(\"/\"),t=this.parseParens(!0));var n={};return this.peekStartsWith(\"(\")&&(n=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(n[r.PRIMARY_OUTLET]=new s(e,t)),n},UrlParser.prototype.parseSegments=function(){var e=matchSegments(this.remaining);if(\"\"===e&&this.peekStartsWith(\";\"))throw new Error(\"Empty path url segment cannot have parameters: '\"+this.remaining+\"'.\");this.capture(e);var t={};return this.peekStartsWith(\";\")&&(t=this.parseMatrixParams()),new a(decode(e),t)},UrlParser.prototype.parseQueryParams=function(){var e={};if(this.peekStartsWith(\"?\"))for(this.capture(\"?\"),this.parseQueryParam(e);this.remaining.length>0&&this.peekStartsWith(\"&\");)this.capture(\"&\"),this.parseQueryParam(e);return e},UrlParser.prototype.parseFragment=function(){return this.peekStartsWith(\"#\")?decode(this.remaining.substring(1)):null},UrlParser.prototype.parseMatrixParams=function(){for(var e={};this.remaining.length>0&&this.peekStartsWith(\";\");)this.capture(\";\"),this.parseParam(e);return e},UrlParser.prototype.parseParam=function(e){var t=matchSegments(this.remaining);if(t){this.capture(t);var n=\"true\";if(this.peekStartsWith(\"=\")){this.capture(\"=\");var r=matchSegments(this.remaining);r&&(n=r,this.capture(n))}e[decode(t)]=decode(n)}},UrlParser.prototype.parseQueryParam=function(e){var t=matchQueryParams(this.remaining);if(t){this.capture(t);var n=\"\";if(this.peekStartsWith(\"=\")){this.capture(\"=\");var r=matchUrlQueryParamValue(this.remaining);r&&(n=r,this.capture(n))}e[decode(t)]=decode(n)}},UrlParser.prototype.parseParens=function(e){var t={};for(this.capture(\"(\");!this.peekStartsWith(\")\")&&this.remaining.length>0;){var n=matchSegments(this.remaining),i=this.remaining[n.length];if(\"/\"!==i&&\")\"!==i&&\";\"!==i)throw new Error(\"Cannot parse url '\"+this.url+\"'\");var o=void 0;n.indexOf(\":\")>-1?(o=n.substr(0,n.indexOf(\":\")),this.capture(o),this.capture(\":\")):e&&(o=r.PRIMARY_OUTLET);var a=this.parseChildren();t[o]=1===Object.keys(a).length?a[r.PRIMARY_OUTLET]:new s([],a),this.peekStartsWith(\"//\")&&this.capture(\"//\")}return this.capture(\")\"),t},UrlParser}()},function(e,t,n){\"use strict\";function shallowEqualArrays(e,t){if(e.length!==t.length)return!1;for(var n=0;n0?e[0]:null}function last(e){return e.length>0?e[e.length-1]:null}function and(e){return e.reduce(function(e,t){return e&&t},!0)}function merge(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function forEach(e,t){for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)}function waitForMap(e,t){var n=[],r={};return forEach(e,function(e,i){i===s.PRIMARY_OUTLET&&n.push(t(i,e).map(function(e){return r[i]=e,e}))}),forEach(e,function(e,i){i!==s.PRIMARY_OUTLET&&n.push(t(i,e).map(function(e){return r[i]=e,e}))}),n.length>0?o.of.apply(void 0,n).concatAll().last().map(function(e){return r}):o.of(r)}function andObservables(e){return e.mergeAll().every(function(e){return e===!0})}function wrapIntoObservable(e){return e instanceof r.Observable?e:e instanceof Promise?i.fromPromise(e):o.of(e)}n(304),n(497);var r=n(1),i=n(211),o=n(141),s=n(63);t.shallowEqualArrays=shallowEqualArrays,t.shallowEqual=shallowEqual,t.flatten=flatten,t.first=first,t.last=last,t.and=and,t.merge=merge,t.forEach=forEach,t.waitForMap=waitForMap,t.andObservables=andObservables,t.wrapIntoObservable=wrapIntoObservable},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError(\"Can't call method on \"+e);return e}},function(e,t,n){var r=n(137)(\"meta\"),i=n(15),o=n(48),s=n(30).f,a=0,l=Object.isExtensible||function(){return!0},c=!n(13)(function(){return l(Object.preventExtensions({}))}),u=function(e){s(e,r,{value:{i:\"O\"+ ++a,w:{}}})},p=function(e,t){if(!i(e))return\"symbol\"==typeof e?e:(\"string\"==typeof e?\"S\":\"P\")+e;if(!o(e,r)){if(!l(e))return\"F\";if(!t)return\"E\";u(e)}return e[r].i},d=function(e,t){if(!o(e,r)){if(!l(e))return!0;if(!t)return!1;u(e)}return e[r].w},h=function(e){return c&&f.NEED&&l(e)&&!o(e,r)&&u(e),e},f=e.exports={KEY:r,NEED:!1,fastKey:p,getWeak:d,onFreeze:h}},function(e,t,n){var r=n(197),i=n(109),o=n(57),s=n(97),a=n(48),l=n(453),c=Object.getOwnPropertyDescriptor;t.f=n(35)?c:function(e,t){if(e=o(e),t=s(t,!0),l)try{return c(e,t)}catch(n){}if(a(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t){e.exports=\".vt-row {\\n display: flex;\\n flex-wrap: wrap;\\n height: 100%;\\n width: 100%;\\n}\\n\\n.vt-card {\\n display: inline-table;\\n margin-left: 25px;\\n margin-bottom: 10px;\\n margin-top: 10px;\\n}\\n\\n.stats-container {\\n width: 100%;\\n}\\n\\n.vt-padding{\\n padding-left: 25px;\\n padding-right: 25px;\\n}\\n\\n>>> p-dialog .ui-dialog{\\n position: fixed !important;\\n top: 50% !important;\\n left: 50% !important;\\n transform: translate(-50%, -50%);\\n margin: 0;\\n width: auto !important;\\n}\\n\\n.vt-popUpContainer{\\n position: fixed;\\n padding: 0;\\n margin: 0;\\n z-index: 0;\\n bottom: 0;\\n right: 0;\\n top: 0;\\n left: 0;\\n min-height: 1000vh;\\n min-width: 1000vw;\\n height: 100%;\\n width: 100%;\\n background: rgba(0,0,0,0.6);\\n}\\n\\n.vt-dark-link:link {\\n text-decoration: none;\\n color: black;\\n}\\n\\n.vt-dark-link:visited {\\n text-decoration: none;\\n color: black;\\n}\\n\\n.vt-dark-link:hover {\\n text-decoration: none;\\n color: black;\\n}\\n\\n.vt-dark-link:active {\\n text-decoration: none;\\n color: black;\\n}\\n\\n/* Toolbar */\\n.vt-toolbar {\\n width: 100%;\\n text-align: center;\\n}\\n\\n>>> p-accordiontab a {\\n padding-left: 25px! important;\\n}\\n\\n>>> .ui-accordion-content button {\\n margin-top: 2px;\\n}\\n\\n>>> p-menu .ui-menu {\\n margin-top: 19px;\\n display: inline-block;\\n top: auto !important;\\n left: auto !important;\\n float: right;\\n \\n}\\n\\np-menu {\\n display: inline-block;\\n float: left;\\n}\\n\\n.vt-toolbar .vt-menu {\\n padding-top: 19px;\\n float: left;\\n}\\n\\n.vt-toolbar .vt-right-menu {\\n padding-top: 19px;\\n position: fixed;\\n right: 25px;\\n top: 19px;\\n}\\n\\n.vt-card-toolbar {\\n display: inline-block;\\n width: 100%;\\n}\\n\\n.vt-card-toolbar .vt-menu {\\n float: left;\\n}\\n.vt-card-toolbar .vt-title {\\n float: right;\\n margin: 0;\\n padding-left: 25px;\\n}\\n\\nmd-list:hover {\\n background: #E8E8E8\\n}\\n\"},function(e,t,n){\"use strict\";var r=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=n(1),o=n(308),s=n(80),a=n(98),l=function(e){function ArrayObservable(t,n){e.call(this),this.array=t,this.scheduler=n,n||1!==t.length||(this._isScalar=!0,this.value=t[0])}return r(ArrayObservable,e),ArrayObservable.create=function(e,t){return new ArrayObservable(e,t)},ArrayObservable.of=function(){for(var e=[],t=0;t1?new ArrayObservable(e,n):1===r?new o.ScalarObservable(e[0],n):new s.EmptyObservable(n)},ArrayObservable.dispatch=function(e){var t=e.array,n=e.index,r=e.count,i=e.subscriber;return n>=r?void i.complete():(i.next(t[n]),void(i.isUnsubscribed||(e.index=n+1,this.schedule(e))))},ArrayObservable.prototype._subscribe=function(e){var t=0,n=this.array,r=n.length,i=this.scheduler;if(i)return i.schedule(ArrayObservable.dispatch,0,{array:n,index:t,count:r,subscriber:e});for(var o=0;o0?\" { \"+e.children.map(serializeNode).join(\", \")+\" } \":\"\";return\"\"+e.value+t}function advanceActivatedRoute(e){e.snapshot?(a.shallowEqual(e.snapshot.queryParams,e._futureSnapshot.queryParams)||e.queryParams.next(e._futureSnapshot.queryParams),e.snapshot.fragment!==e._futureSnapshot.fragment&&e.fragment.next(e._futureSnapshot.fragment),a.shallowEqual(e.snapshot.params,e._futureSnapshot.params)||(e.params.next(e._futureSnapshot.params),e.data.next(e._futureSnapshot.data)),a.shallowEqualArrays(e.snapshot.url,e._futureSnapshot.url)||e.url.next(e._futureSnapshot.url),e.snapshot=e._futureSnapshot):(e.snapshot=e._futureSnapshot,e.data.next(e._futureSnapshot.data))}var r=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=n(207),o=n(63),s=n(73),a=n(74),l=n(281),c=function(e){function RouterState(t,n){e.call(this,t),this.snapshot=n,setRouterStateSnapshot(this,t)}return r(RouterState,e),Object.defineProperty(RouterState.prototype,\"queryParams\",{get:function(){return this.root.queryParams},enumerable:!0,configurable:!0}),Object.defineProperty(RouterState.prototype,\"fragment\",{get:function(){return this.root.fragment},enumerable:!0,configurable:!0}),RouterState.prototype.toString=function(){return this.snapshot.toString()},RouterState}(l.Tree);t.RouterState=c,t.createEmptyState=createEmptyState;var u=function(){function ActivatedRoute(e,t,n,r,i,o,s,a){this.url=e,this.params=t,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=s,this._futureSnapshot=a}return Object.defineProperty(ActivatedRoute.prototype,\"routeConfig\",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,\"root\",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,\"parent\",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,\"firstChild\",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,\"children\",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,\"pathFromRoot\",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),ActivatedRoute.prototype.toString=function(){return this.snapshot?this.snapshot.toString():\"Future(\"+this._futureSnapshot+\")\"},ActivatedRoute}();t.ActivatedRoute=u;var p=function(){function InheritedResolve(e,t){this.parent=e,this.current=t,this.resolvedData={}}return Object.defineProperty(InheritedResolve.prototype,\"flattenedResolvedData\",{get:function(){return this.parent?a.merge(this.parent.flattenedResolvedData,this.resolvedData):this.resolvedData},enumerable:!0,configurable:!0}),Object.defineProperty(InheritedResolve,\"empty\",{get:function(){return new InheritedResolve(null,{})},enumerable:!0,configurable:!0}),InheritedResolve}();t.InheritedResolve=p;var d=function(){function ActivatedRouteSnapshot(e,t,n,r,i,o,s,a,l,c,u){this.url=e,this.params=t,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=s,this._routeConfig=a,this._urlSegment=l,this._lastPathIndex=c,this._resolve=u}return Object.defineProperty(ActivatedRouteSnapshot.prototype,\"routeConfig\",{get:function(){return this._routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,\"root\",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,\"parent\",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,\"firstChild\",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,\"children\",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,\"pathFromRoot\",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),ActivatedRouteSnapshot.prototype.toString=function(){var e=this.url.map(function(e){return e.toString()}).join(\"/\"),t=this._routeConfig?this._routeConfig.path:\"\";return\"Route(url:'\"+e+\"', path:'\"+t+\"')\"},ActivatedRouteSnapshot}();t.ActivatedRouteSnapshot=d;var h=function(e){function RouterStateSnapshot(t,n){e.call(this,n),this.url=t,setRouterStateSnapshot(this,n)}return r(RouterStateSnapshot,e),Object.defineProperty(RouterStateSnapshot.prototype,\"queryParams\",{get:function(){return this.root.queryParams},enumerable:!0,configurable:!0}),Object.defineProperty(RouterStateSnapshot.prototype,\"fragment\",{get:function(){return this.root.fragment},enumerable:!0,configurable:!0}),RouterStateSnapshot.prototype.toString=function(){return serializeNode(this._root)},RouterStateSnapshot}(l.Tree);t.RouterStateSnapshot=h,t.advanceActivatedRoute=advanceActivatedRoute},function(e,t,n){\"use strict\";var r=n(43),i=(n.n(r),n(0));n.n(i);n.d(t,\"a\",function(){return a});var o=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},s=this&&this.__metadata||function(e,t){if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=function(){function VtctlService(e){this.http=e,this.vtctlUrl=\"../api/vtctl/\"}return VtctlService.prototype.sendPostRequest=function(e,t){var n=new r.Headers({\"Content-Type\":\"application/json\"}),i=new r.RequestOptions({headers:n});return this.http.post(e,JSON.stringify(t),i).map(function(e){return e.json()})},VtctlService.prototype.runCommand=function(e){return this.sendPostRequest(this.vtctlUrl,e)},VtctlService=o([n.i(i.Injectable)(),s(\"design:paramtypes\",[\"function\"==typeof(e=\"undefined\"!=typeof r.Http&&r.Http)&&e||Object])],VtctlService);var e}()},function(e,t,n){\"use strict\";var r=n(192);n.d(t,\"a\",function(){return i});var i=function(){function DialogContent(e,t,n,r,i){void 0===e&&(e=\"\"),void 0===t&&(t={}),void 0===n&&(n={}),void 0===r&&(r=void 0),void 0===i&&(i=\"\"),this.nameId=e,this.flags=t,this.requiredFlags=n,this.prepareFunction=r,this.action=i}return DialogContent.prototype.getName=function(){return this.flags[this.nameId]?this.flags[this.nameId].getStrValue():\"\"},DialogContent.prototype.setName=function(e){this.flags[this.nameId]&&this.flags[this.nameId].setValue(e)},DialogContent.prototype.getPostBody=function(e){void 0===e&&(e=void 0),e||(e=this.getFlags());var t=[],n=[];t.push(this.action);for(var r=0,i=e;r1?\"path: '\"+e.path.join(\" -> \")+\"'\":e.path[0]?\"name: '\"+e.path+\"'\":\"unspecified name\",new i.BaseException(t+\" \"+n)}function composeValidators(e){return o.isPresent(e)?s.Validators.compose(e.map(c.normalizeValidator)):null}function composeAsyncValidators(e){return o.isPresent(e)?s.Validators.composeAsync(e.map(c.normalizeAsyncValidator)):null}function isPropertyUpdated(e,t){if(!r.StringMapWrapper.contains(e,\"model\"))return!1;var n=e.model;return!!n.isFirstChange()||!o.looseIdentical(t,n.currentValue)}function selectValueAccessor(e,t){if(o.isBlank(t))return null;var n,r,i;return t.forEach(function(t){o.hasConstructor(t,l.DefaultValueAccessor)?n=t:o.hasConstructor(t,a.CheckboxControlValueAccessor)||o.hasConstructor(t,u.NumberValueAccessor)||o.hasConstructor(t,d.SelectControlValueAccessor)||o.hasConstructor(t,h.SelectMultipleControlValueAccessor)||o.hasConstructor(t,p.RadioControlValueAccessor)?(o.isPresent(r)&&_throwError(e,\"More than one built-in value accessor matches form control with\"),r=t):(o.isPresent(i)&&_throwError(e,\"More than one custom value accessor matches form control with\"),i=t)}),o.isPresent(i)?i:o.isPresent(r)?r:o.isPresent(n)?n:(_throwError(e,\"No valid value accessor for form control with\"),null)}var r=n(34),i=n(83),o=n(7),s=n(58),a=n(144),l=n(145),c=n(526),u=n(227),p=n(146),d=n(147),h=n(228);t.controlPath=controlPath,t.setUpControl=setUpControl,t.setUpControlGroup=setUpControlGroup,t.composeValidators=composeValidators,t.composeAsyncValidators=composeAsyncValidators,t.isPropertyUpdated=isPropertyUpdated,t.selectValueAccessor=selectValueAccessor},function(e,t,n){\"use strict\";var r=n(0),i=n(18),o=n(28),s=function(){function CompilerConfig(e){var t=void 0===e?{}:e,n=t.renderTypes,i=void 0===n?new l:n,o=t.defaultEncapsulation,s=void 0===o?r.ViewEncapsulation.Emulated:o,a=t.genDebugInfo,c=t.logBindingUpdate,u=t.useJit,p=void 0===u||u,d=t.deprecatedPlatformDirectives,h=void 0===d?[]:d,f=t.deprecatedPlatformPipes,m=void 0===f?[]:f;this.renderTypes=i,this.defaultEncapsulation=s,this._genDebugInfo=a,this._logBindingUpdate=c,this.useJit=p,this.platformDirectives=h,this.platformPipes=m}return Object.defineProperty(CompilerConfig.prototype,\"genDebugInfo\",{get:function(){return void 0===this._genDebugInfo?r.isDevMode():this._genDebugInfo},enumerable:!0,configurable:!0}),Object.defineProperty(CompilerConfig.prototype,\"logBindingUpdate\",{get:function(){return void 0===this._logBindingUpdate?r.isDevMode():this._logBindingUpdate},enumerable:!0,configurable:!0}),CompilerConfig}();t.CompilerConfig=s;var a=function(){function RenderTypes(){}return Object.defineProperty(RenderTypes.prototype,\"renderer\",{get:function(){return i.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderTypes.prototype,\"renderText\",{get:function(){return i.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderTypes.prototype,\"renderElement\",{get:function(){return i.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderTypes.prototype,\"renderComment\",{get:function(){return i.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderTypes.prototype,\"renderNode\",{get:function(){return i.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderTypes.prototype,\"renderEvent\",{get:function(){return i.unimplemented()},enumerable:!0,configurable:!0}),RenderTypes}();t.RenderTypes=a;var l=function(){function DefaultRenderTypes(){this.renderer=o.Identifiers.Renderer,this.renderText=null,this.renderElement=null,this.renderComment=null,this.renderNode=null,this.renderEvent=null}return DefaultRenderTypes}();t.DefaultRenderTypes=l},function(e,t){\"use strict\";function splitNsName(e){if(\":\"!=e[0])return[null,e];var t=e.indexOf(\":\",1);if(t==-1)throw new Error('Unsupported format \"'+e+'\" expecting \":namespace:name\"');return[e.slice(1,t),e.slice(t+1)]}function getNsPrefix(e){return null===e?null:splitNsName(e)[0]}function mergeNsAndName(e,t){return e?\":\"+e+\":\"+t:t}!function(e){e[e.RAW_TEXT=0]=\"RAW_TEXT\",e[e.ESCAPABLE_RAW_TEXT=1]=\"ESCAPABLE_RAW_TEXT\",e[e.PARSABLE_DATA=2]=\"PARSABLE_DATA\"}(t.TagContentType||(t.TagContentType={}));t.TagContentType;t.splitNsName=splitNsName,t.getNsPrefix=getNsPrefix,t.mergeNsAndName=mergeNsAndName,t.NAMED_ENTITIES={Aacute:\"Á\",aacute:\"á\",Acirc:\"Â\",acirc:\"â\",acute:\"´\",AElig:\"Æ\",aelig:\"æ\",Agrave:\"À\",agrave:\"à\",alefsym:\"ℵ\",Alpha:\"Α\",alpha:\"α\",amp:\"&\",and:\"∧\",ang:\"∠\",apos:\"'\",Aring:\"Å\",aring:\"å\",asymp:\"≈\",Atilde:\"Ã\",atilde:\"ã\",Auml:\"Ä\",auml:\"ä\",bdquo:\"„\",Beta:\"Β\",beta:\"β\",brvbar:\"¦\",bull:\"•\",cap:\"∩\",Ccedil:\"Ç\",ccedil:\"ç\",cedil:\"¸\",cent:\"¢\",Chi:\"Χ\",chi:\"χ\",circ:\"ˆ\",clubs:\"♣\",cong:\"≅\",copy:\"©\",crarr:\"↵\",cup:\"∪\",curren:\"¤\",dagger:\"†\",Dagger:\"‡\",darr:\"↓\",dArr:\"⇓\",deg:\"°\",Delta:\"Δ\",delta:\"δ\",diams:\"♦\",divide:\"÷\",Eacute:\"É\",eacute:\"é\",Ecirc:\"Ê\",ecirc:\"ê\",Egrave:\"È\",egrave:\"è\",empty:\"∅\",emsp:\"\u2003\",ensp:\"\u2002\",Epsilon:\"Ε\",epsilon:\"ε\",equiv:\"≡\",Eta:\"Η\",eta:\"η\",ETH:\"Ð\",eth:\"ð\",Euml:\"Ë\",euml:\"ë\",euro:\"€\",exist:\"∃\",fnof:\"ƒ\",forall:\"∀\",frac12:\"½\",frac14:\"¼\",frac34:\"¾\",frasl:\"⁄\",Gamma:\"Γ\",gamma:\"γ\",ge:\"≥\",gt:\">\",harr:\"↔\",hArr:\"⇔\",hearts:\"♥\",hellip:\"…\",Iacute:\"Í\",iacute:\"í\",Icirc:\"Î\",icirc:\"î\",iexcl:\"¡\",Igrave:\"Ì\",igrave:\"ì\",image:\"ℑ\",infin:\"∞\",\"int\":\"∫\",Iota:\"Ι\",iota:\"ι\",iquest:\"¿\",isin:\"∈\",Iuml:\"Ï\",iuml:\"ï\",Kappa:\"Κ\",kappa:\"κ\",Lambda:\"Λ\",lambda:\"λ\",lang:\"⟨\",laquo:\"«\",larr:\"←\",lArr:\"⇐\",lceil:\"⌈\",ldquo:\"“\",le:\"≤\",lfloor:\"⌊\",lowast:\"∗\",loz:\"◊\",lrm:\"\u200e\",lsaquo:\"‹\",lsquo:\"‘\",lt:\"<\",macr:\"¯\",mdash:\"—\",micro:\"µ\",middot:\"·\",minus:\"−\",Mu:\"Μ\",mu:\"μ\",nabla:\"∇\",nbsp:\"\u00a0\",ndash:\"–\",ne:\"≠\",ni:\"∋\",not:\"¬\",notin:\"∉\",nsub:\"⊄\",Ntilde:\"Ñ\",ntilde:\"ñ\",Nu:\"Ν\",nu:\"ν\",Oacute:\"Ó\",oacute:\"ó\",Ocirc:\"Ô\",ocirc:\"ô\",OElig:\"Œ\",oelig:\"œ\",Ograve:\"Ò\",ograve:\"ò\",oline:\"‾\",Omega:\"Ω\",omega:\"ω\",Omicron:\"Ο\",omicron:\"ο\",oplus:\"⊕\",or:\"∨\",ordf:\"ª\",ordm:\"º\",Oslash:\"Ø\",oslash:\"ø\",Otilde:\"Õ\",otilde:\"õ\",otimes:\"⊗\",Ouml:\"Ö\",ouml:\"ö\",para:\"¶\",permil:\"‰\",perp:\"⊥\",Phi:\"Φ\",phi:\"φ\",Pi:\"Π\",pi:\"π\",piv:\"ϖ\",plusmn:\"±\",pound:\"£\",prime:\"′\",Prime:\"″\",prod:\"∏\",prop:\"∝\",Psi:\"Ψ\",psi:\"ψ\",quot:'\"',radic:\"√\",rang:\"⟩\",raquo:\"»\",rarr:\"→\",rArr:\"⇒\",rceil:\"⌉\",rdquo:\"”\",real:\"ℜ\",reg:\"®\",rfloor:\"⌋\",Rho:\"Ρ\",rho:\"ρ\",rlm:\"\u200f\",rsaquo:\"›\",rsquo:\"’\",sbquo:\"‚\",Scaron:\"Š\",scaron:\"š\",sdot:\"⋅\",sect:\"§\",shy:\"\u00ad\",Sigma:\"Σ\",sigma:\"σ\",sigmaf:\"ς\",sim:\"∼\",spades:\"♠\",sub:\"⊂\",sube:\"⊆\",sum:\"∑\",sup:\"⊃\",sup1:\"¹\",sup2:\"²\",sup3:\"³\",supe:\"⊇\",szlig:\"ß\",Tau:\"Τ\",tau:\"τ\",there4:\"∴\",Theta:\"Θ\",theta:\"θ\",thetasym:\"ϑ\",thinsp:\"\u2009\",THORN:\"Þ\",thorn:\"þ\",tilde:\"˜\",times:\"×\",trade:\"™\",Uacute:\"Ú\",uacute:\"ú\",uarr:\"↑\",uArr:\"⇑\",Ucirc:\"Û\",ucirc:\"û\",Ugrave:\"Ù\",ugrave:\"ù\",uml:\"¨\",upsih:\"ϒ\",Upsilon:\"Υ\",upsilon:\"υ\",Uuml:\"Ü\",uuml:\"ü\",weierp:\"℘\",Xi:\"Ξ\",xi:\"ξ\",Yacute:\"Ý\",yacute:\"ý\",yen:\"¥\",yuml:\"ÿ\",Yuml:\"Ÿ\",Zeta:\"Ζ\",zeta:\"ζ\",zwj:\"\u200d\",zwnj:\"\u200c\"}},function(e,t,n){\"use strict\";function createUrlResolverWithoutPackagePrefix(){return new s}function createOfflineCompileUrlResolver(){return new s(o)}function getUrlScheme(e){var t=_split(e);return t&&t[a.Scheme]||\"\"}function _buildFromEncodedParts(e,t,n,r,o,s,a){var l=[];return i.isPresent(e)&&l.push(e+\":\"),i.isPresent(n)&&(l.push(\"//\"),i.isPresent(t)&&l.push(t+\"@\"),l.push(n),i.isPresent(r)&&l.push(\":\"+r)),i.isPresent(o)&&l.push(o),i.isPresent(s)&&l.push(\"?\"+s),i.isPresent(a)&&l.push(\"#\"+a),l.join(\"\")}function _split(e){return e.match(l)}function _removeDotSegments(e){if(\"/\"==e)return\"/\";for(var t=\"/\"==e[0]?\"/\":\"\",n=\"/\"===e[e.length-1]?\"/\":\"\",r=e.split(\"/\"),i=[],o=0,s=0;s0?i.pop():o++;break;default:i.push(a)}}if(\"\"==t){for(;o-- >0;)i.unshift(\"..\");0===i.length&&i.push(\".\")}return t+i.join(\"/\")+n}function _joinAndCanonicalizePath(e){var t=e[a.Path];return t=i.isBlank(t)?\"\":_removeDotSegments(t),e[a.Path]=t,_buildFromEncodedParts(e[a.Scheme],e[a.UserInfo],e[a.Domain],e[a.Port],t,e[a.QueryData],e[a.Fragment])}function _resolveUrl(e,t){var n=_split(encodeURI(t)),r=_split(e);if(i.isPresent(n[a.Scheme]))return _joinAndCanonicalizePath(n);n[a.Scheme]=r[a.Scheme];for(var o=a.Scheme;o<=a.Port;o++)i.isBlank(n[o])&&(n[o]=r[o]);if(\"/\"==n[a.Path][0])return _joinAndCanonicalizePath(n);var s=r[a.Path];i.isBlank(s)&&(s=\"/\");var l=s.lastIndexOf(\"/\");return s=s.substring(0,l+1)+n[a.Path],n[a.Path]=s,_joinAndCanonicalizePath(n)}var r=n(0),i=n(5),o=\"asset:\";t.createUrlResolverWithoutPackagePrefix=createUrlResolverWithoutPackagePrefix,t.createOfflineCompileUrlResolver=createOfflineCompileUrlResolver,t.DEFAULT_PACKAGE_URL_PROVIDER={provide:r.PACKAGE_ROOT_URL,useValue:\"/\"};var s=function(){function UrlResolver(e){void 0===e&&(e=null),this._packagePrefix=e}return UrlResolver.prototype.resolve=function(e,t){var n=t;i.isPresent(e)&&e.length>0&&(n=_resolveUrl(e,n));var r=_split(n),s=this._packagePrefix;if(i.isPresent(s)&&i.isPresent(r)&&\"package\"==r[a.Scheme]){var l=r[a.Path];if(this._packagePrefix!==o)return s=i.StringWrapper.stripRight(s,\"/\"),l=i.StringWrapper.stripLeft(l,\"/\"),s+\"/\"+l;var c=l.split(/\\//);n=\"asset:\"+c[0]+\"/lib/\"+c.slice(1).join(\"/\")}return n},UrlResolver.decorators=[{type:r.Injectable}],UrlResolver.ctorParameters=[{type:void 0,decorators:[{type:r.Inject,args:[r.PACKAGE_ROOT_URL]}]}],UrlResolver}();t.UrlResolver=s,t.getUrlScheme=getUrlScheme;var a,l=new RegExp(\"^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\\\w\\\\d\\\\-\\\\u0100-\\\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\\\?([^#]*))?(?:#(.*))?$\");!function(e){e[e.Scheme=1]=\"Scheme\",e[e.UserInfo=2]=\"UserInfo\",e[e.Domain=3]=\"Domain\",e[e.Port=4]=\"Port\",e[e.Path=5]=\"Path\",e[e.QueryData=6]=\"QueryData\",e[e.Fragment=7]=\"Fragment\"}(a||(a={}))},function(e,t,n){\"use strict\";function _enumExpression(e,t){if(s.isBlank(t))return l.NULL_EXPR;var n=s.resolveEnumToken(e.runtime,t);return l.importExpr(new o.CompileIdentifierMetadata({name:e.name+\".\"+n,moduleUrl:e.moduleUrl,runtime:t}))}var r=n(0),i=n(27),o=n(31),s=n(5),a=n(28),l=n(17),c=function(){function ViewTypeEnum(){}return ViewTypeEnum.fromValue=function(e){return _enumExpression(a.Identifiers.ViewType,e)},ViewTypeEnum.HOST=ViewTypeEnum.fromValue(i.ViewType.HOST),ViewTypeEnum.COMPONENT=ViewTypeEnum.fromValue(i.ViewType.COMPONENT),ViewTypeEnum.EMBEDDED=ViewTypeEnum.fromValue(i.ViewType.EMBEDDED),ViewTypeEnum}();t.ViewTypeEnum=c;var u=function(){function ViewEncapsulationEnum(){}return ViewEncapsulationEnum.fromValue=function(e){return _enumExpression(a.Identifiers.ViewEncapsulation,e)},ViewEncapsulationEnum.Emulated=ViewEncapsulationEnum.fromValue(r.ViewEncapsulation.Emulated),ViewEncapsulationEnum.Native=ViewEncapsulationEnum.fromValue(r.ViewEncapsulation.Native),ViewEncapsulationEnum.None=ViewEncapsulationEnum.fromValue(r.ViewEncapsulation.None),ViewEncapsulationEnum}();t.ViewEncapsulationEnum=u;var p=function(){function ChangeDetectionStrategyEnum(){}return ChangeDetectionStrategyEnum.fromValue=function(e){return _enumExpression(a.Identifiers.ChangeDetectionStrategy,e)},ChangeDetectionStrategyEnum.OnPush=ChangeDetectionStrategyEnum.fromValue(r.ChangeDetectionStrategy.OnPush),ChangeDetectionStrategyEnum.Default=ChangeDetectionStrategyEnum.fromValue(r.ChangeDetectionStrategy.Default),ChangeDetectionStrategyEnum}();t.ChangeDetectionStrategyEnum=p;var d=function(){function ChangeDetectorStatusEnum(){}return ChangeDetectorStatusEnum.fromValue=function(e){return _enumExpression(a.Identifiers.ChangeDetectorStatus,e)},ChangeDetectorStatusEnum.CheckOnce=ChangeDetectorStatusEnum.fromValue(i.ChangeDetectorStatus.CheckOnce),ChangeDetectorStatusEnum.Checked=ChangeDetectorStatusEnum.fromValue(i.ChangeDetectorStatus.Checked),ChangeDetectorStatusEnum.CheckAlways=ChangeDetectorStatusEnum.fromValue(i.ChangeDetectorStatus.CheckAlways),ChangeDetectorStatusEnum.Detached=ChangeDetectorStatusEnum.fromValue(i.ChangeDetectorStatus.Detached),ChangeDetectorStatusEnum.Errored=ChangeDetectorStatusEnum.fromValue(i.ChangeDetectorStatus.Errored),ChangeDetectorStatusEnum.Destroyed=ChangeDetectorStatusEnum.fromValue(i.ChangeDetectorStatus.Destroyed),ChangeDetectorStatusEnum}();t.ChangeDetectorStatusEnum=d;var h=function(){function ViewConstructorVars(){}return ViewConstructorVars.viewUtils=l.variable(\"viewUtils\"),ViewConstructorVars.parentInjector=l.variable(\"parentInjector\"),ViewConstructorVars.declarationEl=l.variable(\"declarationEl\"),ViewConstructorVars}();t.ViewConstructorVars=h;var f=function(){function ViewProperties(){}return ViewProperties.renderer=l.THIS_EXPR.prop(\"renderer\"),ViewProperties.projectableNodes=l.THIS_EXPR.prop(\"projectableNodes\"),ViewProperties.viewUtils=l.THIS_EXPR.prop(\"viewUtils\"),ViewProperties}();t.ViewProperties=f;var m=function(){function EventHandlerVars(){}return EventHandlerVars.event=l.variable(\"$event\"),EventHandlerVars}();t.EventHandlerVars=m;var g=function(){function InjectMethodVars(){}return InjectMethodVars.token=l.variable(\"token\"),InjectMethodVars.requestNodeIndex=l.variable(\"requestNodeIndex\"),InjectMethodVars.notFoundResult=l.variable(\"notFoundResult\"),InjectMethodVars}();t.InjectMethodVars=g;var y=function(){function DetectChangesVars(){}return DetectChangesVars.throwOnChange=l.variable(\"throwOnChange\"),DetectChangesVars.changes=l.variable(\"changes\"),DetectChangesVars.changed=l.variable(\"changed\"),DetectChangesVars.valUnwrapper=l.variable(\"valUnwrapper\"),DetectChangesVars}();t.DetectChangesVars=y},99,function(e,t,n){var r=n(95);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(8),i=n(462),o=n(288),s=n(300)(\"IE_PROTO\"),a=function(){},l=\"prototype\",c=function(){var e,t=n(451)(\"iframe\"),r=o.length,i=\"<\",s=\">\";for(t.style.display=\"none\",n(452).appendChild(t),t.src=\"javascript:\",e=t.contentWindow.document,e.open(),e.write(i+\"script\"+s+\"document.F=Object\"+i+\"/script\"+s),e.close(),c=e.F;r--;)delete c[l][o[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(a[l]=r(e),n=new a,a[l]=null,n[s]=e):n=c(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(464),i=n(288);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){\"use strict\";function multicast(e){var t;return t=\"function\"==typeof e?e:function(){return e},new r.ConnectableObservable(this,t)}var r=n(502);t.multicast=multicast},[1107,219],function(e,t){\"use strict\";var n=function(){function ElementSchemaRegistry(){}return ElementSchemaRegistry}();t.ElementSchemaRegistry=n},function(e,t,n){\"use strict\";function getPropertyInView(e,t,n){if(t===n)return e;for(var o=s.THIS_EXPR,a=t;a!==n&&i.isPresent(a.declarationElement.view);)a=a.declarationElement.view,o=o.prop(\"parent\");if(a!==n)throw new r.BaseException(\"Internal error: Could not calculate a property in a parent view: \"+e);if(e instanceof s.ReadPropExpr){var l=e;(n.fields.some(function(e){return e.name==l.name})||n.getters.some(function(e){return e.name==l.name}))&&(o=o.cast(n.classType))}return s.replaceVarInExpression(s.THIS_EXPR.name,o,e)}function injectFromViewParentInjector(e,t){var n=[a.createDiTokenExpression(e)];return t&&n.push(s.NULL_EXPR),s.THIS_EXPR.prop(\"parentInjector\").callMethod(\"get\",n)}function getViewFactoryName(e,t){return\"viewFactory_\"+e.type.name+t}function createFlatArray(e){for(var t=[],n=s.literalArr([]),r=0;r0&&(n=n.callMethod(s.BuiltinMethod.ConcatArray,[s.literalArr(t)]),t=[]),n=n.callMethod(s.BuiltinMethod.ConcatArray,[i])):t.push(i)}return t.length>0&&(n=n.callMethod(s.BuiltinMethod.ConcatArray,[s.literalArr(t)])),n}function createPureProxy(e,t,n,a){a.fields.push(new s.ClassField(n.name,null));var l=t0){var r=e.substring(0,n),i=e.substring(n+1).trim();t.set(r,i)}}),t},Headers.prototype.append=function(e,t){e=normalize(e);var n=this._headersMap.get(e),i=r.isListLikeIterable(n)?n:[];i.push(t),this._headersMap.set(e,i)},Headers.prototype.delete=function(e){this._headersMap.delete(normalize(e))},Headers.prototype.forEach=function(e){this._headersMap.forEach(e)},Headers.prototype.get=function(e){return r.ListWrapper.first(this._headersMap.get(normalize(e)))},Headers.prototype.has=function(e){return this._headersMap.has(normalize(e))},Headers.prototype.keys=function(){return r.MapWrapper.keys(this._headersMap)},Headers.prototype.set=function(e,t){var n=[];if(r.isListLikeIterable(t)){var i=t.join(\",\");n.push(i)}else n.push(t);this._headersMap.set(normalize(e),n)},Headers.prototype.values=function(){return r.MapWrapper.values(this._headersMap)},Headers.prototype.toJSON=function(){var e={};return this._headersMap.forEach(function(t,n){var i=[];r.iterateListLike(t,function(e){return i=r.ListWrapper.concat(i,e.split(\",\"))}),e[normalize(n)]=i}),e},Headers.prototype.getAll=function(e){var t=this._headersMap.get(normalize(e));return r.isListLikeIterable(t)?t:[]},Headers.prototype.entries=function(){throw new i.BaseException('\"entries\" method is not implemented on Headers class')},Headers}();t.Headers=s},function(e,t){\"use strict\";var n=function(){function ConnectionBackend(){}return ConnectionBackend}();t.ConnectionBackend=n;var r=function(){function Connection(){}return Connection}();t.Connection=r;var i=function(){function XSRFStrategy(){}return XSRFStrategy}();t.XSRFStrategy=i},function(e,t,n){\"use strict\";var r=n(0);t.RenderDebugInfo=r.__core_private__.RenderDebugInfo,t.wtfInit=r.__core_private__.wtfInit,t.ReflectionCapabilities=r.__core_private__.ReflectionCapabilities,t.VIEW_ENCAPSULATION_VALUES=r.__core_private__.VIEW_ENCAPSULATION_VALUES,t.DebugDomRootRenderer=r.__core_private__.DebugDomRootRenderer,t.reflector=r.__core_private__.reflector,t.NoOpAnimationPlayer=r.__core_private__.NoOpAnimationPlayer,t.AnimationPlayer=r.__core_private__.AnimationPlayer,t.AnimationSequencePlayer=r.__core_private__.AnimationSequencePlayer,t.AnimationGroupPlayer=r.__core_private__.AnimationGroupPlayer,t.AnimationKeyframe=r.__core_private__.AnimationKeyframe,t.AnimationStyles=r.__core_private__.AnimationStyles,t.prepareFinalAnimationStyles=r.__core_private__.prepareFinalAnimationStyles,t.balanceAnimationKeyframes=r.__core_private__.balanceAnimationKeyframes,t.flattenStyles=r.__core_private__.flattenStyles,t.clearStyles=r.__core_private__.clearStyles,t.collectAndResolveStyles=r.__core_private__.collectAndResolveStyles},function(e,t,n){\"use strict\";var r=n(0);t.DOCUMENT=new r.OpaqueToken(\"DocumentToken\")},function(e,t,n){\"use strict\";var r=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=n(0),o=n(33),s=n(16),a=n(62),l=n(55),c=function(){function ClientMessageBrokerFactory(){}return ClientMessageBrokerFactory}();t.ClientMessageBrokerFactory=c;var u=function(e){function ClientMessageBrokerFactory_(t,n){e.call(this),this._messageBus=t,this._serializer=n}return r(ClientMessageBrokerFactory_,e),ClientMessageBrokerFactory_.prototype.createMessageBroker=function(e,t){return void 0===t&&(t=!0),this._messageBus.initChannel(e,t),new d(this._messageBus,this._serializer,e)},ClientMessageBrokerFactory_.decorators=[{type:i.Injectable}],ClientMessageBrokerFactory_.ctorParameters=[{type:a.MessageBus},{type:l.Serializer}],ClientMessageBrokerFactory_}(c);t.ClientMessageBrokerFactory_=u;var p=function(){function ClientMessageBroker(){}return ClientMessageBroker}();t.ClientMessageBroker=p;var d=function(e){function ClientMessageBroker_(t,n,r){var i=this;e.call(this),this.channel=r,this._pending=new Map,this._sink=t.to(r),this._serializer=n;var o=t.from(r);o.subscribe({next:function(e){return i._handleMessage(e)}})}return r(ClientMessageBroker_,e),ClientMessageBroker_.prototype._generateMessageId=function(e){for(var t=s.stringify(s.DateWrapper.toMillis(s.DateWrapper.now())),n=0,r=e+t+s.stringify(n);s.isPresent(this._pending[r]);)r=\"\"+e+t+n,n++;return r},ClientMessageBroker_.prototype.runOnService=function(e,t){var n=this,r=[];s.isPresent(e.args)&&e.args.forEach(function(e){null!=e.type?r.push(n._serializer.serialize(e.value,e.type)):r.push(e.value)});var i,o=null;if(null!=t){var a;i=new Promise(function(e,t){a={resolve:e,reject:t}}),o=this._generateMessageId(e.method),this._pending.set(o,a),i.catch(function(e){s.print(e),a.reject(e)}),i=i.then(function(e){return null==n._serializer?e:n._serializer.deserialize(e,t)})}else i=null;var l={method:e.method,args:r};return null!=o&&(l.id=o),this._sink.emit(l),i},ClientMessageBroker_.prototype._handleMessage=function(e){var t=new h(e);if(s.StringWrapper.equals(t.type,\"result\")||s.StringWrapper.equals(t.type,\"error\")){var n=t.id;this._pending.has(n)&&(s.StringWrapper.equals(t.type,\"result\")?this._pending.get(n).resolve(t.value):this._pending.get(n).reject(t.value),this._pending.delete(n))}},ClientMessageBroker_}(p);t.ClientMessageBroker_=d;var h=function(){function MessageData(e){this.type=o.StringMapWrapper.get(e,\"type\"),this.id=this._getValueIfPresent(e,\"id\"),this.value=this._getValueIfPresent(e,\"value\")}return MessageData.prototype._getValueIfPresent=function(e,t){return o.StringMapWrapper.contains(e,t)?o.StringMapWrapper.get(e,t):null},MessageData}(),f=function(){function FnArg(e,t){this.value=e,this.type=t}return FnArg}();t.FnArg=f;var m=function(){function UiArguments(e,t){this.method=e,this.args=t}return UiArguments}();t.UiArguments=m},function(e,t,n){\"use strict\";var r=n(0),i=function(){function RenderStore(){this._nextIndex=0,this._lookupById=new Map,this._lookupByObject=new Map}return RenderStore.prototype.allocateId=function(){return this._nextIndex++},RenderStore.prototype.store=function(e,t){this._lookupById.set(t,e),this._lookupByObject.set(e,t)},RenderStore.prototype.remove=function(e){var t=this._lookupByObject.get(e);this._lookupByObject.delete(e),this._lookupById.delete(t)},RenderStore.prototype.deserialize=function(e){return null==e?null:this._lookupById.has(e)?this._lookupById.get(e):null},RenderStore.prototype.serialize=function(e){return null==e?null:this._lookupByObject.get(e)},RenderStore.decorators=[{type:r.Injectable}],RenderStore.ctorParameters=[],RenderStore}();t.RenderStore=i},function(e,t,n){\"use strict\";var r=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=n(0),o=n(33),s=n(16),a=n(62),l=n(55),c=function(){function ServiceMessageBrokerFactory(){}return ServiceMessageBrokerFactory}();t.ServiceMessageBrokerFactory=c;var u=function(e){function ServiceMessageBrokerFactory_(t,n){e.call(this),this._messageBus=t,this._serializer=n}return r(ServiceMessageBrokerFactory_,e),ServiceMessageBrokerFactory_.prototype.createMessageBroker=function(e,t){return void 0===t&&(t=!0),this._messageBus.initChannel(e,t),new d(this._messageBus,this._serializer,e)},ServiceMessageBrokerFactory_.decorators=[{type:i.Injectable}],ServiceMessageBrokerFactory_.ctorParameters=[{type:a.MessageBus},{type:l.Serializer}],ServiceMessageBrokerFactory_}(c);t.ServiceMessageBrokerFactory_=u;var p=function(){function ServiceMessageBroker(){}return ServiceMessageBroker}();t.ServiceMessageBroker=p;var d=function(e){function ServiceMessageBroker_(t,n,r){var i=this;e.call(this),this._serializer=n,this.channel=r,this._methods=new o.Map,this._sink=t.to(r);var s=t.from(r);s.subscribe({next:function(e){return i._handleMessage(e)}})}return r(ServiceMessageBroker_,e),ServiceMessageBroker_.prototype.registerMethod=function(e,t,n,r){var i=this;this._methods.set(e,function(e){for(var a=e.args,l=null===t?0:t.length,c=o.ListWrapper.createFixedSize(l),u=0;u0?n[n.length-1]._routeConfig._loadedConfig:null}function nodeChildrenAsMap(e){return e?e.children.reduce(function(e,t){return e[t.value.outlet]=t,e},{}):{}}function getOutlet(e,t){var n=e._outlets[t.outlet];if(!n){var r=t.component.name;throw t.outlet===g.PRIMARY_OUTLET?new Error(\"Cannot find primary outlet to load '\"+r+\"'\"):new Error(\"Cannot find the outlet \"+t.outlet+\" to load '\"+r+\"'\")}return n}n(140),n(499),n(305),n(500),n(493);var r=n(0),i=n(20),o=n(309),s=n(141),a=n(623),l=n(624),c=n(625),u=n(626),p=n(627),d=n(628),h=n(187),f=n(129),m=n(91),g=n(63),y=n(73),v=n(74),b=function(){function NavigationStart(e,t){this.id=e,this.url=t}return NavigationStart.prototype.toString=function(){return\"NavigationStart(id: \"+this.id+\", url: '\"+this.url+\"')\"},NavigationStart}();t.NavigationStart=b;var _=function(){function NavigationEnd(e,t,n){this.id=e,this.url=t,this.urlAfterRedirects=n}return NavigationEnd.prototype.toString=function(){return\"NavigationEnd(id: \"+this.id+\", url: '\"+this.url+\"', urlAfterRedirects: '\"+this.urlAfterRedirects+\"')\"},NavigationEnd}();t.NavigationEnd=_;var w=function(){function NavigationCancel(e,t){this.id=e,this.url=t}return NavigationCancel.prototype.toString=function(){return\"NavigationCancel(id: \"+this.id+\", url: '\"+this.url+\"')\"},NavigationCancel}();t.NavigationCancel=w;var S=function(){function NavigationError(e,t,n){this.id=e,this.url=t,this.error=n}return NavigationError.prototype.toString=function(){return\"NavigationError(id: \"+this.id+\", url: '\"+this.url+\"', error: \"+this.error+\")\"},NavigationError}();t.NavigationError=S;var C=function(){function RoutesRecognized(e,t,n,r){this.id=e,this.url=t,this.urlAfterRedirects=n,this.state=r}return RoutesRecognized.prototype.toString=function(){return\"RoutesRecognized(id: \"+this.id+\", url: '\"+this.url+\"', urlAfterRedirects: '\"+this.urlAfterRedirects+\"', state: \"+this.state+\")\"},RoutesRecognized}();t.RoutesRecognized=C;var E=function(){function Router(e,t,n,r,o,s,a,l){this.rootComponentType=e,this.resolver=t,this.urlSerializer=n,this.outletMap=r,this.location=o,this.injector=s,this.navigationId=0,this.navigated=!1,this.resetConfig(l),this.routerEvents=new i.Subject,this.currentUrlTree=y.createEmptyUrlTree(),this.configLoader=new h.RouterConfigLoader(a),this.currentRouterState=m.createEmptyState(this.currentUrlTree,this.rootComponentType)}return Router.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),this.navigateByUrl(this.location.path(!0))},Object.defineProperty(Router.prototype,\"routerState\",{get:function(){return this.currentRouterState},enumerable:!0,configurable:!0}),Object.defineProperty(Router.prototype,\"url\",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),Object.defineProperty(Router.prototype,\"events\",{get:function(){return this.routerEvents},enumerable:!0,configurable:!0}),Router.prototype.resetConfig=function(e){l.validateConfig(e),this.config=e},Router.prototype.ngOnDestroy=function(){this.dispose()},Router.prototype.dispose=function(){this.locationSubscription.unsubscribe()},Router.prototype.createUrlTree=function(e,t){var n=void 0===t?{}:t,r=n.relativeTo,i=n.queryParams,o=n.fragment,s=n.preserveQueryParams,a=n.preserveFragment,l=r?r:this.routerState.root,c=s?this.currentUrlTree.queryParams:i,p=a?this.currentUrlTree.fragment:o;return u.createUrlTree(l,this.currentUrlTree,e,c,p)},Router.prototype.navigateByUrl=function(e,t){if(void 0===t&&(t={skipLocationChange:!1}),e instanceof y.UrlTree)return this.scheduleNavigation(e,t);var n=this.urlSerializer.parse(e);return this.scheduleNavigation(n,t)},Router.prototype.navigate=function(e,t){return void 0===t&&(t={skipLocationChange:!1}),this.scheduleNavigation(this.createUrlTree(e,t),t)},Router.prototype.serializeUrl=function(e){return this.urlSerializer.serialize(e)},Router.prototype.parseUrl=function(e){return this.urlSerializer.parse(e)},Router.prototype.isActive=function(e,t){if(e instanceof y.UrlTree)return y.containsTree(this.currentUrlTree,e,t);var n=this.urlSerializer.parse(e);return y.containsTree(this.currentUrlTree,n,t)},Router.prototype.scheduleNavigation=function(e,t){var n=this,r=++this.navigationId;return this.routerEvents.next(new b(r,this.serializeUrl(e))),Promise.resolve().then(function(i){return n.runNavigate(e,t.skipLocationChange,r)})},Router.prototype.setUpLocationChangeListener=function(){var e=this;this.locationSubscription=this.location.subscribe(Zone.current.wrap(function(t){var n=e.urlSerializer.parse(t.url);return e.currentUrlTree.toString()!==n.toString()?e.scheduleNavigation(n,t.pop):null}))},Router.prototype.runNavigate=function(e,t,n){var r=this;return n!==this.navigationId?(this.location.go(this.urlSerializer.serialize(this.currentUrlTree)),this.routerEvents.next(new w(n,this.serializeUrl(e))),Promise.resolve(!1)):new Promise(function(i,o){var l,u,h,f,m=r.currentRouterState,g=r.currentUrlTree;a.applyRedirects(r.injector,r.configLoader,e,r.config).mergeMap(function(e){return f=e,p.recognize(r.rootComponentType,r.config,f,r.serializeUrl(f))}).mergeMap(function(t){return r.routerEvents.next(new C(n,r.serializeUrl(e),r.serializeUrl(f),t)),d.resolve(r.resolver,t)}).map(function(e){return c.createRouterState(e,r.currentRouterState)}).map(function(e){l=e,h=new P(l.snapshot,r.currentRouterState.snapshot,r.injector),h.traverse(r.outletMap)}).mergeMap(function(e){return h.checkGuards()}).mergeMap(function(e){return e?h.resolveData().map(function(){return e}):s.of(e)}).forEach(function(i){if(!i||n!==r.navigationId)return r.routerEvents.next(new w(n,r.serializeUrl(e))),void(u=!1);if(r.currentUrlTree=f,r.currentRouterState=l,new x(l,m).activate(r.outletMap),!t){var o=r.urlSerializer.serialize(f);r.location.isCurrentPathEqualTo(o)?r.location.replaceState(o):r.location.go(o)}u=!0}).then(function(){r.navigated=!0,r.routerEvents.next(new _(n,r.serializeUrl(e),r.serializeUrl(f))),i(u)},function(t){r.currentRouterState=m,r.currentUrlTree=g,r.routerEvents.next(new S(n,r.serializeUrl(e),t)),o(t)})})},Router}();t.Router=E;var R=function(){function CanActivate(e){this.path=e}return Object.defineProperty(CanActivate.prototype,\"route\",{get:function(){return this.path[this.path.length-1]},enumerable:!0,configurable:!0}),CanActivate}(),T=function(){function CanDeactivate(e,t){this.component=e,this.route=t}return CanDeactivate}(),P=function(){function PreActivation(e,t,n){this.future=e,this.curr=t,this.injector=n,this.checks=[]}return PreActivation.prototype.traverse=function(e){var t=this.future._root,n=this.curr?this.curr._root:null;this.traverseChildRoutes(t,n,e,[t.value])},PreActivation.prototype.checkGuards=function(){var e=this;return 0===this.checks.length?s.of(!0):o.from(this.checks).map(function(t){if(t instanceof R)return v.andObservables(o.from([e.runCanActivate(t.route),e.runCanActivateChild(t.path)]));if(t instanceof T){var n=t;return e.runCanDeactivate(n.component,n.route)}throw new Error(\"Cannot be reached\")}).mergeAll().every(function(e){return e===!0})},PreActivation.prototype.resolveData=function(){var e=this;return 0===this.checks.length?s.of(null):o.from(this.checks).mergeMap(function(t){return t instanceof R?e.runResolve(t.route):s.of(null)}).reduce(function(e,t){return e})},PreActivation.prototype.traverseChildRoutes=function(e,t,n,r){var i=this,o=nodeChildrenAsMap(t);e.children.forEach(function(e){i.traverseRoutes(e,o[e.value.outlet],n,r.concat([e.value])),delete o[e.value.outlet]}),v.forEach(o,function(e,t){return i.deactivateOutletAndItChildren(e,n._outlets[t])})},PreActivation.prototype.traverseRoutes=function(e,t,n,r){var i=e.value,o=t?t.value:null,s=n?n._outlets[e.value.outlet]:null;o&&i._routeConfig===o._routeConfig?(v.shallowEqual(i.params,o.params)||this.checks.push(new T(s.component,o),new R(r)),i.component?this.traverseChildRoutes(e,t,s?s.outletMap:null,r):this.traverseChildRoutes(e,t,n,r)):(o&&(o.component?this.deactivateOutletAndItChildren(o,s):this.deactivateOutletMap(n)),this.checks.push(new R(r)),i.component?this.traverseChildRoutes(e,null,s?s.outletMap:null,r):this.traverseChildRoutes(e,null,n,r))},PreActivation.prototype.deactivateOutletAndItChildren=function(e,t){t&&t.isActivated&&(this.deactivateOutletMap(t.outletMap),this.checks.push(new T(t.component,e)))},PreActivation.prototype.deactivateOutletMap=function(e){var t=this;v.forEach(e._outlets,function(e){e.isActivated&&t.deactivateOutletAndItChildren(e.activatedRoute.snapshot,e)})},PreActivation.prototype.runCanActivate=function(e){var t=this,n=e._routeConfig?e._routeConfig.canActivate:null;if(!n||0===n.length)return s.of(!0);var r=o.from(n).map(function(n){var r=t.getToken(n,e,t.future);return r.canActivate?v.wrapIntoObservable(r.canActivate(e,t.future)):v.wrapIntoObservable(r(e,t.future))});return v.andObservables(r)},PreActivation.prototype.runCanActivateChild=function(e){var t=this,n=e[e.length-1],r=e.slice(0,e.length-1).reverse().map(function(e){return t.extractCanActivateChild(e)}).filter(function(e){return null!==e});return v.andObservables(o.from(r).map(function(e){var r=o.from(e.guards).map(function(e){var r=t.getToken(e,e.node,t.future);return r.canActivateChild?v.wrapIntoObservable(r.canActivateChild(n,t.future)):v.wrapIntoObservable(r(n,t.future))});return v.andObservables(r)}))},PreActivation.prototype.extractCanActivateChild=function(e){var t=e._routeConfig?e._routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null},PreActivation.prototype.runCanDeactivate=function(e,t){var n=this,r=t&&t._routeConfig?t._routeConfig.canDeactivate:null;return r&&0!==r.length?o.from(r).map(function(r){var i=n.getToken(r,t,n.curr);return i.canDeactivate?v.wrapIntoObservable(i.canDeactivate(e,t,n.curr)):v.wrapIntoObservable(i(e,t,n.curr))}).mergeAll().every(function(e){return e===!0}):s.of(!0)},PreActivation.prototype.runResolve=function(e){var t=e._resolve;return this.resolveNode(t.current,e).map(function(n){return t.resolvedData=n,e.data=v.merge(e.data,t.flattenedResolvedData),null})},PreActivation.prototype.resolveNode=function(e,t){var n=this;return v.waitForMap(e,function(e,r){var i=n.getToken(r,t,n.future);return i.resolve?v.wrapIntoObservable(i.resolve(t,n.future)):v.wrapIntoObservable(i(t,n.future))})},PreActivation.prototype.getToken=function(e,t,n){var r=closestLoadedConfig(n,t),i=r?r.injector:this.injector;return i.get(e)},PreActivation}(),x=function(){function ActivateRoutes(e,t){this.futureState=e,this.currState=t}return ActivateRoutes.prototype.activate=function(e){var t=this.futureState._root,n=this.currState?this.currState._root:null;m.advanceActivatedRoute(this.futureState.root),this.activateChildRoutes(t,n,e)},ActivateRoutes.prototype.activateChildRoutes=function(e,t,n){var r=this,i=nodeChildrenAsMap(t);e.children.forEach(function(e){r.activateRoutes(e,i[e.value.outlet],n),delete i[e.value.outlet]}),v.forEach(i,function(e,t){return r.deactivateOutletAndItChildren(n._outlets[t])})},ActivateRoutes.prototype.activateRoutes=function(e,t,n){\nvar r=e.value,i=t?t.value:null;if(r===i)if(m.advanceActivatedRoute(r),r.component){var o=getOutlet(n,e.value);this.activateChildRoutes(e,t,o.outletMap)}else this.activateChildRoutes(e,t,n);else{if(i)if(i.component){var o=getOutlet(n,e.value);this.deactivateOutletAndItChildren(o)}else this.deactivateOutletMap(n);if(r.component){m.advanceActivatedRoute(r);var o=getOutlet(n,e.value),s=new f.RouterOutletMap;this.placeComponentIntoOutlet(s,r,o),this.activateChildRoutes(e,null,s)}else m.advanceActivatedRoute(r),this.activateChildRoutes(e,null,n)}},ActivateRoutes.prototype.placeComponentIntoOutlet=function(e,t,n){var i=[{provide:m.ActivatedRoute,useValue:t},{provide:f.RouterOutletMap,useValue:e}],o=closestLoadedConfig(this.futureState.snapshot,t.snapshot),s=null,a=null;o&&(s=o.factoryResolver,a=o.injector,i.push({provide:r.ComponentFactoryResolver,useValue:s})),n.activate(t,s,a,r.ReflectiveInjector.resolve(i),e)},ActivateRoutes.prototype.deactivateOutletAndItChildren=function(e){e&&e.isActivated&&(this.deactivateOutletMap(e.outletMap),e.deactivate())},ActivateRoutes.prototype.deactivateOutletMap=function(e){var t=this;v.forEach(e._outlets,function(e){return t.deactivateOutletAndItChildren(e)})},ActivateRoutes}()},function(e,t){\"use strict\";var n=function(){function RouterOutletMap(){this._outlets={}}return RouterOutletMap.prototype.registerOutlet=function(e,t){this._outlets[e]=t},RouterOutletMap.prototype.removeOutlet=function(e){this._outlets[e]=void 0},RouterOutletMap}();t.RouterOutletMap=n},function(e,t,n){\"use strict\";var r=n(43),i=(n.n(r),n(0));n.n(i);n.d(t,\"a\",function(){return a});var o=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},s=this&&this.__metadata||function(e,t){if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=function(){function FeaturesService(e){var t=this;this.http=e,this.activeReparents=!1,this.showStatus=!1,this.showTopologyCRUD=!1,this.showWorkflows=!1,this.workflows=[],this.featuresUrl=\"../api/features\",this.getFeatures().subscribe(function(e){t.activeReparents=e.activeReparents,t.showStatus=e.showStatus,t.showTopologyCRUD=e.showTopologyCRUD,t.showWorkflows=e.showWorkflows,t.workflows=e.workflows})}return FeaturesService.prototype.getFeatures=function(){return this.http.get(this.featuresUrl).map(function(e){return e.json()})},FeaturesService=o([n.i(i.Injectable)(),s(\"design:paramtypes\",[\"function\"==typeof(e=\"undefined\"!=typeof r.Http&&r.Http)&&e||Object])],FeaturesService);var e}()},function(e,t,n){\"use strict\";var r=n(43),i=(n.n(r),n(0)),o=(n.n(i),n(484)),s=(n.n(o),n(283)),a=n(644),l=n(284);n.d(t,\"a\",function(){return p});var c=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},u=this&&this.__metadata||function(e,t){if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.metadata)return Reflect.metadata(e,t)},p=function(){function KeyspaceService(e,t){this.http=e,this.shardService=t,this.keyspacesUrl=\"../api/keyspaces/\",this.srvKeyspaceUrl=\"../api/srv_keyspace/local/\"}return KeyspaceService.prototype.getShards=function(e){return this.shardService.getShards(e)},KeyspaceService.prototype.getKeyspaceNames=function(){return this.http.get(this.keyspacesUrl).map(function(e){return e.json()})},KeyspaceService.prototype.getSrvKeyspaces=function(){return this.http.get(this.srvKeyspaceUrl).map(function(e){return e.json()})},KeyspaceService.prototype.SrvKeyspaceAndNamesObservable=function(){var e=this.getKeyspaceNames(),t=this.getSrvKeyspaces();return e.combineLatest(t)},KeyspaceService.prototype.getKeyspaceShardingData=function(e){return this.http.get(this.keyspacesUrl+e).map(function(e){return e.json()})},KeyspaceService.prototype.getShardsAndShardingData=function(e){var t=this.getShards(e),n=this.getKeyspaceShardingData(e);return t.combineLatest(n)},KeyspaceService.prototype.buildKeyspace=function(e,t){return this.getShardsAndShardingData(e).map(function(n){var r=n[0],i=n[1],o=new a.a(e);return t.forEach(function(e){return o.addServingShard(e)}),r.forEach(function(e){o.contains(e)||o.addNonservingShard(e)}),o.shardingColumnName=i.sharding_column_name||\"\",o.shardingColumnType=i.sharding_column_type||\"\",o})},KeyspaceService.prototype.getServingShards=function(e,t){if(t&&t[e]){var n=t[e].partitions;if(void 0===n)return[];for(var r=0;r=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=n(0),s=n(9),a=n(3),l=function(){function Button(e,t){this.el=e,this.domHandler=t,this.iconPos=\"left\"}return Button.prototype.ngAfterViewInit=function(){if(this.domHandler.addMultipleClasses(this.el.nativeElement,this.getStyleClass()),this.icon){var e=document.createElement(\"span\"),t=\"right\"==this.iconPos?\"ui-button-icon-right\":\"ui-button-icon-left\";e.className=t+\" ui-c fa fa-fw \"+this.icon,this.el.nativeElement.appendChild(e)}var n=document.createElement(\"span\");n.className=\"ui-button-text ui-c\",n.appendChild(document.createTextNode(this.label||\"ui-button\")),this.el.nativeElement.appendChild(n),this.initialized=!0},Button.prototype.onMouseenter=function(e){this.hover=!0},Button.prototype.onMouseleave=function(e){this.hover=!1,this.active=!1},Button.prototype.onMouseDown=function(e){this.active=!0},Button.prototype.onMouseUp=function(e){this.active=!1},Button.prototype.onFocus=function(e){this.focus=!0},Button.prototype.onBlur=function(e){this.focus=!1},Button.prototype.isDisabled=function(){return this.el.nativeElement.disabled},Button.prototype.getStyleClass=function(){var e=\"ui-button ui-widget ui-state-default ui-corner-all\";return e+=this.icon?null!=this.label&&void 0!=this.label?\"left\"==this.iconPos?\" ui-button-text-icon-left\":\" ui-button-text-icon-right\":\" ui-button-icon-only\":\" ui-button-text-only\"},Object.defineProperty(Button.prototype,\"label\",{get:function(){return this._label},set:function(e){this._label=e,this.initialized&&(this.domHandler.findSingle(this.el.nativeElement,\".ui-button-text\").textContent=this._label)},enumerable:!0,configurable:!0}),Button.prototype.ngOnDestroy=function(){for(;this.el.nativeElement.hasChildNodes();)this.el.nativeElement.removeChild(this.el.nativeElement.lastChild);this.initialized=!1},r([o.Input(),i(\"design:type\",String)],Button.prototype,\"icon\",void 0),r([o.Input(),i(\"design:type\",String)],Button.prototype,\"iconPos\",void 0),r([o.HostListener(\"mouseenter\",[\"$event\"]),i(\"design:type\",Function),i(\"design:paramtypes\",[Object]),i(\"design:returntype\",void 0)],Button.prototype,\"onMouseenter\",null),r([o.HostListener(\"mouseleave\",[\"$event\"]),i(\"design:type\",Function),i(\"design:paramtypes\",[Object]),i(\"design:returntype\",void 0)],Button.prototype,\"onMouseleave\",null),r([o.HostListener(\"mousedown\",[\"$event\"]),i(\"design:type\",Function),i(\"design:paramtypes\",[Object]),i(\"design:returntype\",void 0)],Button.prototype,\"onMouseDown\",null),r([o.HostListener(\"mouseup\",[\"$event\"]),i(\"design:type\",Function),i(\"design:paramtypes\",[Object]),i(\"design:returntype\",void 0)],Button.prototype,\"onMouseUp\",null),r([o.HostListener(\"focus\",[\"$event\"]),i(\"design:type\",Function),i(\"design:paramtypes\",[Object]),i(\"design:returntype\",void 0)],Button.prototype,\"onFocus\",null),r([o.HostListener(\"blur\",[\"$event\"]),i(\"design:type\",Function),i(\"design:paramtypes\",[Object]),i(\"design:returntype\",void 0)],Button.prototype,\"onBlur\",null),r([o.Input(),i(\"design:type\",String)],Button.prototype,\"label\",null),Button=r([o.Directive({selector:\"[pButton]\",host:{\"[class.ui-state-hover]\":\"hover&&!isDisabled()\",\"[class.ui-state-focus]\":\"focus\",\"[class.ui-state-active]\":\"active\",\"[class.ui-state-disabled]\":\"isDisabled()\"},providers:[s.DomHandler]}),i(\"design:paramtypes\",[o.ElementRef,s.DomHandler])],Button)}();t.Button=l;var c=function(){function ButtonModule(){}return ButtonModule=r([o.NgModule({imports:[a.CommonModule],exports:[l],declarations:[l]}),i(\"design:paramtypes\",[])],ButtonModule)}();t.ButtonModule=c},function(e,t,n){\"use strict\";var r=n(1),i=n(505);r.Observable.prototype.map=i.map},function(e,t,n){\"use strict\";var r=n(79);t.of=r.ArrayObservable.of},function(e,t,n){\"use strict\";var r=n(51),i=r.root.Symbol;if(\"function\"==typeof i)i.iterator?t.$$iterator=i.iterator:\"function\"==typeof i.for&&(t.$$iterator=i.for(\"iterator\"));else if(r.root.Set&&\"function\"==typeof(new r.root.Set)[\"@@iterator\"])t.$$iterator=\"@@iterator\";else if(r.root.Map)for(var o=Object.getOwnPropertyNames(r.root.Map.prototype),s=0;s=this.length?i.$EOF:o.StringWrapper.charCodeAt(this.input,this.index)},_Scanner.prototype.scanToken=function(){for(var e=this.input,t=this.length,n=this.peek,r=this.index;n<=i.$SPACE;){if(++r>=t){n=i.$EOF;break}n=o.StringWrapper.charCodeAt(e,r)}if(this.peek=n,this.index=r,r>=t)return null;if(isIdentifierStart(n))return this.scanIdentifier();if(i.isDigit(n))return this.scanNumber(r);var s=r;switch(n){case i.$PERIOD:return this.advance(),i.isDigit(this.peek)?this.scanNumber(s):newCharacterToken(s,i.$PERIOD);case i.$LPAREN:case i.$RPAREN:case i.$LBRACE:case i.$RBRACE:case i.$LBRACKET:case i.$RBRACKET:case i.$COMMA:case i.$COLON:case i.$SEMICOLON:return this.scanCharacter(s,n);case i.$SQ:case i.$DQ:return this.scanString();case i.$HASH:case i.$PLUS:case i.$MINUS:case i.$STAR:case i.$SLASH:case i.$PERCENT:case i.$CARET:return this.scanOperator(s,o.StringWrapper.fromCharCode(n));case i.$QUESTION:return this.scanComplexOperator(s,\"?\",i.$PERIOD,\".\");case i.$LT:case i.$GT:return this.scanComplexOperator(s,o.StringWrapper.fromCharCode(n),i.$EQ,\"=\");case i.$BANG:case i.$EQ:return this.scanComplexOperator(s,o.StringWrapper.fromCharCode(n),i.$EQ,\"=\",i.$EQ,\"=\");case i.$AMPERSAND:return this.scanComplexOperator(s,\"&\",i.$AMPERSAND,\"&\");case i.$BAR:return this.scanComplexOperator(s,\"|\",i.$BAR,\"|\");case i.$NBSP:for(;i.isWhitespace(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(\"Unexpected character [\"+o.StringWrapper.fromCharCode(n)+\"]\",0)},_Scanner.prototype.scanCharacter=function(e,t){return this.advance(),newCharacterToken(e,t)},_Scanner.prototype.scanOperator=function(e,t){return this.advance(),newOperatorToken(e,t)},_Scanner.prototype.scanComplexOperator=function(e,t,n,r,i,s){this.advance();var a=t;return this.peek==n&&(this.advance(),a+=r),o.isPresent(i)&&this.peek==i&&(this.advance(),a+=s),newOperatorToken(e,a)},_Scanner.prototype.scanIdentifier=function(){var e=this.index;for(this.advance();isIdentifierPart(this.peek);)this.advance();var t=this.input.substring(e,this.index);return a.indexOf(t)>-1?newKeywordToken(e,t):newIdentifierToken(e,t)},_Scanner.prototype.scanNumber=function(e){var t=this.index===e;for(this.advance();;){if(i.isDigit(this.peek));else if(this.peek==i.$PERIOD)t=!1;else{if(!isExponentStart(this.peek))break;if(this.advance(),isExponentSign(this.peek)&&this.advance(),!i.isDigit(this.peek))return this.error(\"Invalid exponent\",-1);t=!1}this.advance()}var n=this.input.substring(e,this.index),r=t?o.NumberWrapper.parseIntAutoRadix(n):o.NumberWrapper.parseFloat(n);return newNumberToken(e,r)},_Scanner.prototype.scanString=function(){var e=this.index,t=this.peek;this.advance();for(var n,r=this.index,s=this.input;this.peek!=t;)if(this.peek==i.$BACKSLASH){null==n&&(n=new o.StringJoiner),n.add(s.substring(r,this.index)),this.advance();var a;if(this.peek==i.$u){var l=s.substring(this.index+1,this.index+5);try{a=o.NumberWrapper.parseInt(l,16)}catch(c){return this.error(\"Invalid unicode escape [\\\\u\"+l+\"]\",0)}for(var u=0;u<5;u++)this.advance()}else a=unescape(this.peek),this.advance();n.add(o.StringWrapper.fromCharCode(a)),r=this.index}else{if(this.peek==i.$EOF)return this.error(\"Unterminated quote\",0);this.advance()}var p=s.substring(r,this.index);this.advance();var d=p;return null!=n&&(n.add(p),d=n.toString()),newStringToken(e,d)},_Scanner.prototype.error=function(e,t){var n=this.index+t;return newErrorToken(n,\"Lexer Error: \"+e+\" at column \"+n+\" in expression [\"+this.input+\"]\")},_Scanner}();t.isIdentifier=isIdentifier,t.isQuote=isQuote},function(e,t,n){\"use strict\";function _createInterpolateRegExp(e){var t=o.escapeRegExp(e.start)+\"([\\\\s\\\\S]*?)\"+o.escapeRegExp(e.end);return new RegExp(t,\"g\")}var r=n(0),i=n(233),o=n(5),s=n(68),a=n(236),l=n(151),c=function(){function SplitInterpolation(e,t){this.strings=e,this.expressions=t}return SplitInterpolation}();t.SplitInterpolation=c;var u=function(){function TemplateBindingParseResult(e,t,n){this.templateBindings=e,this.warnings=t,this.errors=n}return TemplateBindingParseResult}();t.TemplateBindingParseResult=u;var p=function(){function Parser(e){this._lexer=e,this.errors=[]}return Parser.prototype.parseAction=function(e,t,n){void 0===n&&(n=s.DEFAULT_INTERPOLATION_CONFIG),this._checkNoInterpolation(e,t,n);var r=this._lexer.tokenize(this._stripComments(e)),i=new d(e,t,r,(!0),this.errors).parseChain();return new a.ASTWithSource(i,e,t,this.errors)},Parser.prototype.parseBinding=function(e,t,n){void 0===n&&(n=s.DEFAULT_INTERPOLATION_CONFIG);var r=this._parseBindingAst(e,t,n);return new a.ASTWithSource(r,e,t,this.errors)},Parser.prototype.parseSimpleBinding=function(e,t,n){void 0===n&&(n=s.DEFAULT_INTERPOLATION_CONFIG);var r=this._parseBindingAst(e,t,n);return h.check(r)||this._reportError(\"Host binding expression can only contain field access and constants\",e,t),new a.ASTWithSource(r,e,t,this.errors)},Parser.prototype._reportError=function(e,t,n,r){this.errors.push(new a.ParserError(e,t,n,r))},Parser.prototype._parseBindingAst=function(e,t,n){var r=this._parseQuote(e,t);if(o.isPresent(r))return r;this._checkNoInterpolation(e,t,n);var i=this._lexer.tokenize(this._stripComments(e));return new d(e,t,i,(!1),this.errors).parseChain()},Parser.prototype._parseQuote=function(e,t){if(o.isBlank(e))return null;var n=e.indexOf(\":\");if(n==-1)return null;var r=e.substring(0,n).trim();if(!l.isIdentifier(r))return null;var i=e.substring(n+1);return new a.Quote(new a.ParseSpan(0,e.length),r,i,t)},Parser.prototype.parseTemplateBindings=function(e,t){var n=this._lexer.tokenize(e);return new d(e,t,n,(!1),this.errors).parseTemplateBindings()},Parser.prototype.parseInterpolation=function(e,t,n){void 0===n&&(n=s.DEFAULT_INTERPOLATION_CONFIG);var r=this.splitInterpolation(e,t,n);if(null==r)return null;for(var i=[],l=0;l0?l.push(p):this._reportError(\"Blank expressions are not allowed in interpolated strings\",e,\"at column \"+this._findInterpolationErrorColumn(i,u,n)+\" in\",t)}return new c(a,l)},Parser.prototype.wrapLiteralPrimitive=function(e,t){return new a.ASTWithSource(new a.LiteralPrimitive(new a.ParseSpan(0,o.isBlank(e)?0:e.length),e),e,t,this.errors)},Parser.prototype._stripComments=function(e){var t=this._commentStart(e);return o.isPresent(t)?e.substring(0,t).trim():e},Parser.prototype._commentStart=function(e){for(var t=null,n=0;n1&&this._reportError(\"Got interpolation (\"+n.start+n.end+\") where expression was expected\",e,\"at column \"+this._findInterpolationErrorColumn(i,1,n)+\" in\",t)},Parser.prototype._findInterpolationErrorColumn=function(e,t,n){for(var r=\"\",i=0;i\":case\"<=\":case\">=\":this.advance();var n=this.parseAdditive();e=new a.Binary(this.span(e.span.start),t,e,n);continue}break}return e},_ParseAST.prototype.parseAdditive=function(){for(var e=this.parseMultiplicative();this.next.type==l.TokenType.Operator;){var t=this.next.strValue;switch(t){case\"+\":case\"-\":this.advance();var n=this.parseMultiplicative();e=new a.Binary(this.span(e.span.start),t,e,n);continue}break}return e},_ParseAST.prototype.parseMultiplicative=function(){for(var e=this.parsePrefix();this.next.type==l.TokenType.Operator;){var t=this.next.strValue;switch(t){case\"*\":case\"%\":case\"/\":this.advance();var n=this.parsePrefix();e=new a.Binary(this.span(e.span.start),t,e,n);continue}break}return e},_ParseAST.prototype.parsePrefix=function(){if(this.next.type==l.TokenType.Operator){var e=this.inputIndex,t=this.next.strValue,n=void 0;switch(t){case\"+\":return this.advance(),this.parsePrefix();case\"-\":return this.advance(),n=this.parsePrefix(),new a.Binary(this.span(e),t,new a.LiteralPrimitive(new a.ParseSpan(e,e),0),n);case\"!\":return this.advance(),n=this.parsePrefix(),new a.PrefixNot(this.span(e),n)}}return this.parseCallChain()},_ParseAST.prototype.parseCallChain=function(){for(var e=this.parsePrimary();;)if(this.optionalCharacter(i.$PERIOD))e=this.parseAccessMemberOrMethodCall(e,!1);else if(this.optionalOperator(\"?.\"))e=this.parseAccessMemberOrMethodCall(e,!0);else if(this.optionalCharacter(i.$LBRACKET)){this.rbracketsExpected++;var t=this.parsePipe();if(this.rbracketsExpected--,this.expectCharacter(i.$RBRACKET),this.optionalOperator(\"=\")){var n=this.parseConditional();e=new a.KeyedWrite(this.span(e.span.start),e,t,n)}else e=new a.KeyedRead(this.span(e.span.start),e,t)}else{if(!this.optionalCharacter(i.$LPAREN))return e;this.rparensExpected++;var r=this.parseCallArguments();this.rparensExpected--,this.expectCharacter(i.$RPAREN),e=new a.FunctionCall(this.span(e.span.start),e,r)}},_ParseAST.prototype.parsePrimary=function(){var e=this.inputIndex;if(this.optionalCharacter(i.$LPAREN)){this.rparensExpected++;var t=this.parsePipe();return this.rparensExpected--,this.expectCharacter(i.$RPAREN),t}if(this.next.isKeywordNull())return this.advance(),new a.LiteralPrimitive(this.span(e),null);if(this.next.isKeywordUndefined())return this.advance(),new a.LiteralPrimitive(this.span(e),(void 0));if(this.next.isKeywordTrue())return this.advance(),new a.LiteralPrimitive(this.span(e),(!0));if(this.next.isKeywordFalse())return this.advance(),new a.LiteralPrimitive(this.span(e),(!1));if(this.next.isKeywordThis())return this.advance(),new a.ImplicitReceiver(this.span(e));if(this.optionalCharacter(i.$LBRACKET)){this.rbracketsExpected++;var n=this.parseExpressionList(i.$RBRACKET);return this.rbracketsExpected--,this.expectCharacter(i.$RBRACKET),new a.LiteralArray(this.span(e),n)}if(this.next.isCharacter(i.$LBRACE))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMemberOrMethodCall(new a.ImplicitReceiver(this.span(e)),!1);if(this.next.isNumber()){var r=this.next.toNumber();return this.advance(),new a.LiteralPrimitive(this.span(e),r)}if(this.next.isString()){var o=this.next.toString();return this.advance(),new a.LiteralPrimitive(this.span(e),o)}return this.index>=this.tokens.length?(this.error(\"Unexpected end of expression: \"+this.input),new a.EmptyExpr(this.span(e))):(this.error(\"Unexpected token \"+this.next),new a.EmptyExpr(this.span(e)))},_ParseAST.prototype.parseExpressionList=function(e){var t=[];if(!this.next.isCharacter(e))do t.push(this.parsePipe());while(this.optionalCharacter(i.$COMMA));return t},_ParseAST.prototype.parseLiteralMap=function(){var e=[],t=[],n=this.inputIndex;if(this.expectCharacter(i.$LBRACE),!this.optionalCharacter(i.$RBRACE)){this.rbracesExpected++;do{var r=this.expectIdentifierOrKeywordOrString();e.push(r),this.expectCharacter(i.$COLON),t.push(this.parsePipe())}while(this.optionalCharacter(i.$COMMA));this.rbracesExpected--,this.expectCharacter(i.$RBRACE)}return new a.LiteralMap(this.span(n),e,t)},_ParseAST.prototype.parseAccessMemberOrMethodCall=function(e,t){void 0===t&&(t=!1);var n=e.span.start,r=this.expectIdentifierOrKeyword();if(this.optionalCharacter(i.$LPAREN)){this.rparensExpected++;var o=this.parseCallArguments();this.expectCharacter(i.$RPAREN),this.rparensExpected--;var s=this.span(n);return t?new a.SafeMethodCall(s,e,r,o):new a.MethodCall(s,e,r,o)}if(t)return this.optionalOperator(\"=\")?(this.error(\"The '?.' operator cannot be used in the assignment\"),new a.EmptyExpr(this.span(n))):new a.SafePropertyRead(this.span(n),e,r);if(this.optionalOperator(\"=\")){if(!this.parseAction)return this.error(\"Bindings cannot contain assignments\"),new a.EmptyExpr(this.span(n));var l=this.parseConditional();return new a.PropertyWrite(this.span(n),e,r,l)}return new a.PropertyRead(this.span(n),e,r)},_ParseAST.prototype.parseCallArguments=function(){if(this.next.isCharacter(i.$RPAREN))return[];var e=[];do e.push(this.parsePipe());while(this.optionalCharacter(i.$COMMA));return e},_ParseAST.prototype.expectTemplateBindingKey=function(){var e=\"\",t=!1;do e+=this.expectIdentifierOrKeywordOrString(),t=this.optionalOperator(\"-\"),t&&(e+=\"-\");while(t);return e.toString()},_ParseAST.prototype.parseTemplateBindings=function(){for(var e=[],t=null,n=[];this.index0&&e[e.length-1]===t}var r=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=n(10),o=n(5),s=n(60),a=n(85),l=n(68),c=n(546),u=n(102),p=function(e){function TreeError(t,n,r){e.call(this,n,r),this.elementName=t}return r(TreeError,e),TreeError.create=function(e,t,n){return new TreeError(e,t,n)},TreeError}(s.ParseError);t.TreeError=p;var d=function(){function ParseTreeResult(e,t){this.rootNodes=e,this.errors=t}return ParseTreeResult}();t.ParseTreeResult=d;var h=function(){function Parser(e){this._getTagDefinition=e}return Parser.prototype.parse=function(e,t,n,r){void 0===n&&(n=!1),void 0===r&&(r=l.DEFAULT_INTERPOLATION_CONFIG);var i=c.tokenize(e,t,this._getTagDefinition,n,r),o=new f(i.tokens,this._getTagDefinition).build();return new d(o.rootNodes,i.errors.concat(o.errors))},Parser}();t.Parser=h;var f=function(){function _TreeBuilder(e,t){this.tokens=e,this.getTagDefinition=t,this._index=-1,this._rootNodes=[],this._errors=[],this._elementStack=[],this._advance()}return _TreeBuilder.prototype.build=function(){for(;this._peek.type!==c.TokenType.EOF;)this._peek.type===c.TokenType.TAG_OPEN_START?this._consumeStartTag(this._advance()):this._peek.type===c.TokenType.TAG_CLOSE?this._consumeEndTag(this._advance()):this._peek.type===c.TokenType.CDATA_START?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===c.TokenType.COMMENT_START?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===c.TokenType.TEXT||this._peek.type===c.TokenType.RAW_TEXT||this._peek.type===c.TokenType.ESCAPABLE_RAW_TEXT?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===c.TokenType.EXPANSION_FORM_START?this._consumeExpansion(this._advance()):this._advance();return new d(this._rootNodes,this._errors)},_TreeBuilder.prototype._advance=function(){var e=this._peek;return this._index0)return this._errors=this._errors.concat(i.errors),null;var l=new s.ParseSourceSpan(e.sourceSpan.start,r.sourceSpan.end),u=new s.ParseSourceSpan(t.sourceSpan.start,r.sourceSpan.end);return new a.ExpansionCase(e.parts[0],i.rootNodes,l,e.sourceSpan,u)},_TreeBuilder.prototype._collectExpansionExpTokens=function(e){for(var t=[],n=[c.TokenType.EXPANSION_CASE_EXP_START];;){if(this._peek.type!==c.TokenType.EXPANSION_FORM_START&&this._peek.type!==c.TokenType.EXPANSION_CASE_EXP_START||n.push(this._peek.type),this._peek.type===c.TokenType.EXPANSION_CASE_EXP_END){if(!lastOnStack(n,c.TokenType.EXPANSION_CASE_EXP_START))return this._errors.push(p.create(null,e.sourceSpan,\"Invalid ICU message. Missing '}'.\")),null;if(n.pop(),0==n.length)return t}if(this._peek.type===c.TokenType.EXPANSION_FORM_END){if(!lastOnStack(n,c.TokenType.EXPANSION_FORM_START))return this._errors.push(p.create(null,e.sourceSpan,\"Invalid ICU message. Missing '}'.\")),null;n.pop()}if(this._peek.type===c.TokenType.EOF)return this._errors.push(p.create(null,e.sourceSpan,\"Invalid ICU message. Missing '}'.\")),null;t.push(this._advance())}},_TreeBuilder.prototype._consumeText=function(e){var t=e.parts[0];if(t.length>0&&\"\\n\"==t[0]){var n=this._getParentElement();o.isPresent(n)&&0==n.children.length&&this.getTagDefinition(n.name).ignoreFirstLf&&(t=t.substring(1))}t.length>0&&this._addToParent(new a.Text(t,e.sourceSpan))},_TreeBuilder.prototype._closeVoidElement=function(){if(this._elementStack.length>0){var e=i.ListWrapper.last(this._elementStack);this.getTagDefinition(e.name).isVoid&&this._elementStack.pop()}},_TreeBuilder.prototype._consumeStartTag=function(e){for(var t=e.parts[0],n=e.parts[1],r=[];this._peek.type===c.TokenType.ATTR_NAME;)r.push(this._consumeAttr(this._advance()));var i=this._getElementFullName(t,n,this._getParentElement()),o=!1;if(this._peek.type===c.TokenType.TAG_OPEN_END_VOID){this._advance(),o=!0;var l=this.getTagDefinition(i);l.canSelfClose||null!==u.getNsPrefix(i)||l.isVoid||this._errors.push(p.create(i,e.sourceSpan,'Only void and foreign elements can be self closed \"'+e.parts[1]+'\"'))}else this._peek.type===c.TokenType.TAG_OPEN_END&&(this._advance(),o=!1);var d=this._peek.sourceSpan.start,h=new s.ParseSourceSpan(e.sourceSpan.start,d),f=new a.Element(i,r,[],h,h,null);this._pushElement(f),o&&(this._popElement(i),f.endSourceSpan=h)},_TreeBuilder.prototype._pushElement=function(e){if(this._elementStack.length>0){var t=i.ListWrapper.last(this._elementStack);this.getTagDefinition(t.name).isClosedByChild(e.name)&&this._elementStack.pop()}var n=this.getTagDefinition(e.name),r=this._getParentElementSkippingContainers(),s=r.parent,l=r.container;if(o.isPresent(s)&&n.requireExtraParent(s.name)){var c=new a.Element(n.parentToAdd,[],[],e.sourceSpan,e.startSourceSpan,e.endSourceSpan);this._insertBeforeContainer(s,l,c)}this._addToParent(e),this._elementStack.push(e)},_TreeBuilder.prototype._consumeEndTag=function(e){var t=this._getElementFullName(e.parts[0],e.parts[1],this._getParentElement());this._getParentElement()&&(this._getParentElement().endSourceSpan=e.sourceSpan),this.getTagDefinition(t).isVoid?this._errors.push(p.create(t,e.sourceSpan,'Void elements do not have end tags \"'+e.parts[1]+'\"')):this._popElement(t)||this._errors.push(p.create(t,e.sourceSpan,'Unexpected closing tag \"'+e.parts[1]+'\"'))},_TreeBuilder.prototype._popElement=function(e){for(var t=this._elementStack.length-1;t>=0;t--){var n=this._elementStack[t];if(n.name==e)return i.ListWrapper.splice(this._elementStack,t,this._elementStack.length-t),!0;if(!this.getTagDefinition(n.name).closedByParent)return!1}return!1},_TreeBuilder.prototype._consumeAttr=function(e){var t=u.mergeNsAndName(e.parts[0],e.parts[1]),n=e.sourceSpan.end,r=\"\";if(this._peek.type===c.TokenType.ATTR_VALUE){var i=this._advance();r=i.parts[0],n=i.sourceSpan.end}return new a.Attribute(t,r,new s.ParseSourceSpan(e.sourceSpan.start,n))},_TreeBuilder.prototype._getParentElement=function(){return this._elementStack.length>0?i.ListWrapper.last(this._elementStack):null},_TreeBuilder.prototype._getParentElementSkippingContainers=function(){for(var e=null,t=this._elementStack.length-1;t>=0;t--){if(\"ng-container\"!==this._elementStack[t].name)return{parent:this._elementStack[t],container:e};e=this._elementStack[t]}return{parent:i.ListWrapper.last(this._elementStack),container:e}},_TreeBuilder.prototype._addToParent=function(e){var t=this._getParentElement();o.isPresent(t)?t.children.push(e):this._rootNodes.push(e)},_TreeBuilder.prototype._insertBeforeContainer=function(e,t,n){if(t){if(e){var r=e.children.indexOf(t);e.children[r]=n}else this._rootNodes.push(n);n.children.push(t),this._elementStack.splice(this._elementStack.indexOf(t),0,n)}else this._addToParent(n),this._elementStack.push(n)},_TreeBuilder.prototype._getElementFullName=function(e,t,n){return o.isBlank(e)&&(e=this.getTagDefinition(t).implicitNamespacePrefix,o.isBlank(e)&&o.isPresent(n)&&(e=u.getNsPrefix(n.name))),u.mergeNsAndName(e,t)},_TreeBuilder}()},function(e,t,n){\"use strict\";function splitClasses(e){return e.trim().split(/\\s+/g)}function createElementCssSelector(e,t){var n=new w.CssSelector,r=y.splitNsName(e)[1];n.setElement(r);for(var i=0;i0&&this._console.warn(\"Template parse warnings:\\n\"+a.join(\"\\n\")),l.length>0){var c=l.join(\"\\n\");throw new u.BaseException(\"Template parse errors:\\n\"+c)}return s.templateAst},TemplateParser.prototype.tryParse=function(e,t,n,r,i,o){var a;e.template&&(a=g.InterpolationConfig.fromArray(e.template.interpolation));var l,c=this._htmlParser.parse(t,o,!0,a),u=c.errors;if(0==u.length){var d=m.expandNodes(c.rootNodes);u.push.apply(u,d.errors),c=new f.ParseTreeResult(d.nodes,u)}if(c.rootNodes.length>0){var y=s.removeIdentifierDuplicates(n),v=s.removeIdentifierDuplicates(r),_=new b.ProviderViewContext(e,c.rootNodes[0].sourceSpan),w=new j(_,y,v,i,this._exprParser,this._schemaRegistry);l=h.visitAll(w,c.rootNodes,z),u.push.apply(u,w.errors.concat(_.errors))}else l=[];return this._assertNoReferenceDuplicationOnTemplate(l,u),u.length>0?new L(l,u):(p.isPresent(this.transforms)&&this.transforms.forEach(function(e){l=E.templateVisitAll(e,l)}),new L(l,u))},TemplateParser.prototype._assertNoReferenceDuplicationOnTemplate=function(e,t){var n=[];e.filter(function(e){return!!e.references}).forEach(function(e){return e.references.forEach(function(e){var r=e.name;if(n.indexOf(r)<0)n.push(r);else{var i=new V('Reference \"#'+r+'\" is defined several times',e.sourceSpan,v.ParseErrorLevel.FATAL);t.push(i)}})})},TemplateParser.decorators=[{type:i.Injectable}],TemplateParser.ctorParameters=[{type:l.Parser},{type:_.ElementSchemaRegistry},{type:f.HtmlParser},{type:o.Console},{type:Array,decorators:[{type:i.Optional},{type:i.Inject,args:[t.TEMPLATE_TRANSFORMS]}]}],TemplateParser}();t.TemplateParser=F;var j=function(){function TemplateParseVisitor(e,t,n,r,i,o){var s=this;this.providerViewContext=e,this._schemas=r,this._exprParser=i,this._schemaRegistry=o,this.errors=[],this.directivesIndex=new Map,this.ngContentCount=0,this.selectorMatcher=new w.SelectorMatcher;var a=e.component.template;p.isPresent(a)&&p.isPresent(a.interpolation)&&(this._interpolationConfig={start:a.interpolation[0],end:a.interpolation[1]}),c.ListWrapper.forEachWithIndex(t,function(e,t){var n=w.CssSelector.parse(e.selector);s.selectorMatcher.addSelectables(n,e),s.directivesIndex.set(e,t)}),this.pipesByName=new Map,n.forEach(function(e){return s.pipesByName.set(e.name,e)})}return TemplateParseVisitor.prototype._reportError=function(e,t,n){void 0===n&&(n=v.ParseErrorLevel.FATAL),this.errors.push(new V(e,t,n))},TemplateParseVisitor.prototype._reportParserErors=function(e,t){for(var n=0,r=e;no.MAX_INTERPOLATION_VALUES)throw new u.BaseException(\"Only support at most \"+o.MAX_INTERPOLATION_VALUES+\" interpolation values!\");return r}catch(i){return this._reportError(\"\"+i,t),this._exprParser.wrapLiteralPrimitive(\"ERROR\",n)}},TemplateParseVisitor.prototype._parseAction=function(e,t){var n=t.start.toString();try{var r=this._exprParser.parseAction(e,n,this._interpolationConfig);return r&&this._reportParserErors(r.errors,t),!r||r.ast instanceof a.EmptyExpr?(this._reportError(\"Empty expressions are not allowed\",t),this._exprParser.wrapLiteralPrimitive(\"ERROR\",n)):(this._checkPipes(r,t),r)}catch(i){return this._reportError(\"\"+i,t),this._exprParser.wrapLiteralPrimitive(\"ERROR\",n)}},TemplateParseVisitor.prototype._parseBinding=function(e,t){var n=t.start.toString();try{var r=this._exprParser.parseBinding(e,n,this._interpolationConfig);return r&&this._reportParserErors(r.errors,t),this._checkPipes(r,t),r}catch(i){return this._reportError(\"\"+i,t),this._exprParser.wrapLiteralPrimitive(\"ERROR\",n)}},TemplateParseVisitor.prototype._parseTemplateBindings=function(e,t){var n=this,r=t.start.toString();try{var i=this._exprParser.parseTemplateBindings(e,r);return this._reportParserErors(i.errors,t),i.templateBindings.forEach(function(e){p.isPresent(e.expression)&&n._checkPipes(e.expression,t)}),i.warnings.forEach(function(e){n._reportError(e,t,v.ParseErrorLevel.WARNING)}),i.templateBindings}catch(o){return this._reportError(\"\"+o,t),[]}},TemplateParseVisitor.prototype._checkPipes=function(e,t){var n=this;if(p.isPresent(e)){var r=new q;e.visit(r),r.pipes.forEach(function(e){n.pipesByName.has(e)||n._reportError(\"The pipe '\"+e+\"' could not be found\",t)})}},TemplateParseVisitor.prototype.visitExpansion=function(e,t){return null},TemplateParseVisitor.prototype.visitExpansionCase=function(e,t){return null},TemplateParseVisitor.prototype.visitText=function(e,t){var n=t.findNgContentIndex(N),r=this._parseInterpolation(e.value,e.sourceSpan);return p.isPresent(r)?new E.BoundTextAst(r,n,e.sourceSpan):new E.TextAst(e.value,n,e.sourceSpan)},TemplateParseVisitor.prototype.visitAttribute=function(e,t){return new E.AttrAst(e.name,e.value,e.sourceSpan)},TemplateParseVisitor.prototype.visitComment=function(e,t){return null},TemplateParseVisitor.prototype.visitElement=function(e,t){var n=this,r=e.name,i=R.preparseElement(e);if(i.type===R.PreparsedElementType.SCRIPT||i.type===R.PreparsedElementType.STYLE)return null;if(i.type===R.PreparsedElementType.STYLESHEET&&S.isStyleUrlResolvable(i.hrefAttr))return null;var o=[],s=[],a=[],l=[],c=[],u=[],d=[],f=[],m=[],g=!1,v=[],_=y.splitNsName(r.toLowerCase())[1],C=_==P;e.attrs.forEach(function(e){var t=n._parseAttr(C,e,o,s,c,u,a,l),r=n._parseInlineTemplateBinding(e,f,d,m);r&&g&&n._reportError(\"Can't have multiple template bindings on one element. Use only one attribute named 'template' or prefixed with *\",e.sourceSpan),t||r||(v.push(n.visitAttribute(e,null)),o.push([e.name,e.value])),r&&(g=!0)});var T=createElementCssSelector(r,o),x=this._parseDirectives(this.selectorMatcher,T),M=[],k=this._createDirectiveAsts(C,e.name,x,s,a,e.sourceSpan,M),I=this._createElementPropertyAsts(e.name,s,k).concat(c),A=t.isTemplateElement||g,O=new b.ProviderElementContext(this.providerViewContext,t.providerContext,A,k,v,M,e.sourceSpan),D=h.visitAll(i.nonBindable?G:this,e.children,U.create(C,k,C?t.providerContext:O));O.afterElement();var N,V=p.isPresent(i.projectAs)?w.CssSelector.parse(i.projectAs)[0]:T,L=t.findNgContentIndex(V);if(i.type===R.PreparsedElementType.NG_CONTENT)p.isPresent(e.children)&&e.children.length>0&&this._reportError(\" element cannot have content. must be immediately followed by \",e.sourceSpan),N=new E.NgContentAst((this.ngContentCount++),g?null:L,e.sourceSpan);else if(C)this._assertAllEventsPublishedByDirectives(k,u),this._assertNoComponentsNorElementBindingsOnTemplate(k,I,e.sourceSpan),N=new E.EmbeddedTemplateAst(v,u,M,l,O.transformedDirectiveAsts,O.transformProviders,O.transformedHasViewContainer,D,g?null:L,e.sourceSpan);else{this._assertOnlyOneComponent(k,e.sourceSpan);var F=g?null:t.findNgContentIndex(V);N=new E.ElementAst(r,v,I,u,M,O.transformedDirectiveAsts,O.transformProviders,O.transformedHasViewContainer,D,g?null:F,e.sourceSpan)}if(g){var j=createElementCssSelector(P,f),B=this._parseDirectives(this.selectorMatcher,j),W=this._createDirectiveAsts(!0,e.name,B,d,[],e.sourceSpan,[]),H=this._createElementPropertyAsts(e.name,d,W);this._assertNoComponentsNorElementBindingsOnTemplate(W,H,e.sourceSpan);var z=new b.ProviderElementContext(this.providerViewContext,t.providerContext,t.isTemplateElement,W,[],[],e.sourceSpan);z.afterElement(),N=new E.EmbeddedTemplateAst([],[],[],m,z.transformedDirectiveAsts,z.transformProviders,z.transformedHasViewContainer,[N],L,e.sourceSpan)}return N},TemplateParseVisitor.prototype._parseInlineTemplateBinding=function(e,t,n,r){var i=null;if(this._normalizeAttributeName(e.name)==x)i=e.value;else if(e.name.startsWith(M)){var o=e.name.substring(M.length);i=0==e.value.length?o:o+\" \"+e.value}if(p.isPresent(i)){for(var s=this._parseTemplateBindings(i,e.sourceSpan),a=0;a elements is deprecated. Use \"let-\" instead!',t.sourceSpan,v.ParseErrorLevel.WARNING),this._parseVariable(h,c,t.sourceSpan,a)):(this._reportError('\"var-\" on non