template 节点类

@class
@param {Object} aNode 抽象节点
@param {Node} parent 父亲节点
@param {Model} scope 所属数据环境
@param {Component} owner 所属组件环境
@param {DOMChildrenWalker?} reverseWalker 子元素遍历对象
165005
function TemplateNode(aNode, parent, scope, owner, reverseWalker) {
    this.aNode = aNode;
    this.owner = owner;
    this.scope = scope;
    this.parent = parent;
    this.parentComponent = parent.nodeType === NodeType.CMPT
        ? parent
        : parent.parentComponent;

    this.id = guid++;
    this.lifeCycle = LifeCycle.start;
    this.children = [];

    // #[begin] reverse
    if (reverseWalker) {
        this.sel = document.createComment(this.id);
        insertBefore(this.sel, reverseWalker.target, reverseWalker.current);

        var me = this;
        each(this.aNode.children, function (aNodeChild) {
            me.children.push(createReverseNode(aNodeChild, me, me.scope, me.owner, reverseWalker));
        });

        this.el = document.createComment(this.id);
        insertBefore(this.el, reverseWalker.target, reverseWalker.current);

        this.lifeCycle = LifeCycle.attached;
    }
    // #[end]
}
1010595
function preheatANode(aNode) {
    var stack = [];

    function recordHotspotData(expr, notContentData) {
        var refs = analyseExprDataHotspot(expr);

        if (refs.length) {
            for (var i = 0, len = stack.length; i < len; i++) {
                if (!notContentData || i !== len - 1) {
                    var data = stack[i].hotspot.data;
                    if (!data) {
                        data = stack[i].hotspot.data = {};
                    }

                    each(refs, function (ref) {
                        data[ref] = 1;
                    });
                }
            }
        }
    }


    function analyseANodeHotspot(aNode) {
        if (!aNode.hotspot) {
            stack.push(aNode);


            if (aNode.textExpr) {
                aNode.hotspot = {};
                aNode.Clazz = TextNode;
                recordHotspotData(aNode.textExpr);
            }
            else {
                var sourceNode;
                if (isBrowser && aNode.tagName
                    && !/^(template|slot|select|input|option|button)$/i.test(aNode.tagName)
                ) {
                    sourceNode = createEl(aNode.tagName);
                }

                aNode.hotspot = {
                    dynamicProps: [],
                    xProps: [],
                    props: {},
                    sourceNode: sourceNode
                };


                // === analyse hotspot data: start
                each(aNode.vars, function (varItem) {
                    recordHotspotData(varItem.expr);
                });

                each(aNode.props, function (prop) {
                    recordHotspotData(prop.expr);
                });

                for (var key in aNode.directives) {
                    /* istanbul ignore else  */
                    if (aNode.directives.hasOwnProperty(key)) {
                        var directive = aNode.directives[key];
                        recordHotspotData(
                            directive.value,
                            !/^(html|bind)$/.test(key)
                        );

                        // init trackBy getKey function
                        if (key === 'for') {
                            var trackBy = directive.trackBy;
                            if (trackBy
                                && trackBy.type === ExprType.ACCESSOR
                                && trackBy.paths[0].value === directive.item
                            ) {
                                aNode.hotspot.getForKey = new Function(
                                    directive.item,
                                    'return ' + trackBy.raw
                                );
                            }
                        }
                    }
                }

                each(aNode.elses, function (child) {
                    analyseANodeHotspot(child);
                });

                each(aNode.children, function (child) {
                    analyseANodeHotspot(child);
                });
                // === analyse hotspot data: end


                // === analyse hotspot props: start
                each(aNode.props, function (prop, index) {
                    aNode.hotspot.props[prop.name] = index;
                    prop.handler = getPropHandler(aNode.tagName, prop.name);

                    if (prop.name === 'id') {
                        prop.id = true;
                        aNode.hotspot.idProp = prop;
                        aNode.hotspot.dynamicProps.push(prop);
                    }
                    else if (prop.expr.value != null) {
                        if (sourceNode) {
                            prop.handler(sourceNode, prop.expr.value, prop.name, aNode);
                        }
                    }
                    else {
                        if (prop.x) {
                            aNode.hotspot.xProps.push(prop);
                        }
                        aNode.hotspot.dynamicProps.push(prop);
                    }
                });

                // ie 下，如果 option 没有 value 属性，select.value = xx 操作不会选中 option
                // 所以没有设置 value 时，默认把 option 的内容作为 value
                if (aNode.tagName === 'option'
                    && !getANodeProp(aNode, 'value')
                    && aNode.children[0]
                ) {
                    var valueProp = {
                        name: 'value',
                        expr: aNode.children[0].textExpr,
                        handler: getPropHandler(aNode.tagName, 'value')
                    };
                    aNode.props.push(valueProp);
                    aNode.hotspot.dynamicProps.push(valueProp);
                    aNode.hotspot.props.value = aNode.props.length - 1;
                }

                if (aNode.directives['if']) { // eslint-disable-line dot-notation
                    aNode.ifRinsed = {
                        children: aNode.children,
                        props: aNode.props,
                        events: aNode.events,
                        tagName: aNode.tagName,
                        vars: aNode.vars,
                        hotspot: aNode.hotspot,
                        directives: extend({}, aNode.directives)
                    };
                    aNode.Clazz = IfNode;
                    aNode = aNode.ifRinsed;
                    aNode.directives['if'] = null; // eslint-disable-line dot-notation
                }

                if (aNode.directives['for']) { // eslint-disable-line dot-notation
                    aNode.forRinsed = {
                        children: aNode.children,
                        props: aNode.props,
                        events: aNode.events,
                        tagName: aNode.tagName,
                        vars: aNode.vars,
                        hotspot: aNode.hotspot,
                        directives: extend({}, aNode.directives)
                    };
                    aNode.Clazz = ForNode;
                    aNode.forRinsed.directives['for'] = null; // eslint-disable-line dot-notation
                    aNode = aNode.forRinsed;
                }

                switch (aNode.tagName) {
                    case 'slot':
                        aNode.Clazz = SlotNode;
                        break;

                    case 'template':
                        aNode.Clazz = TemplateNode;
                }
                // === analyse hotspot props: end
            }

            stack.pop();
        }
    }

    if (aNode) {
        analyseANodeHotspot(aNode);
    }
}
1300605
function Context(view, parentContext) {
  this.view = view || {};
  this.cache = {
    '.': this.view
  };
  this.parent = parentContext;

  // If parent context isn't passed, but the model has parents, build the chain
  this.initialize(view, parentContext);
  if (this.isModel(view)) {
    this.lastModel = view;
  } else if (parentContext) {
    this.lastModel = parentContext.lastModel;
  }
}
36639
function(config, widget, parent_view, template, properties) {

		var name,
			argument,
			constructor;

		this.guid = Lava.guid++;
		if (Lava.schema.DEBUG && config.id && !Lava.isValidId(config.id)) Lava.t();
		if ('id' in config) {
			this.id = config.id;
		}
		if ('label' in config) {
			this.label = config.label;
		}

		Lava.view_manager.registerView(this);

		this._config = config;
		this._widget = widget;
		this._template = template;

		if (parent_view) {

			this._parent_view = parent_view;
			this._parent_with_container = parent_view.getContainer() ? parent_view : parent_view.getParentWithContainer();
			this.depth = parent_view.depth + 1;

		}

		this._initMembers(properties);

		for (name in config.assigns) {

			if (config.assigns[name].once) {

				argument = new Lava.scope.Argument(config.assigns[name], this, this._widget);
				this.set(name, argument.getValue());
				argument.destroy();

			} else {

				if (name in this._property_bindings_by_property) Lava.t("Error initializing assign: property binding already created");

				this._property_bindings_by_property[name] = new Lava.scope.PropertyBinding(this, name, config.assigns[name]);

			}

		}

		if ('container' in config) {

			constructor = Lava.ClassManager.getConstructor(config.container['type'], 'Lava.view.container');
			this._container = new constructor(this, config.container, widget);

		}

		this._postInit();

		if ('roles' in  config) Lava.view_manager.dispatchRoles(this, config.roles);

	}
8891
function (aNode, sourceBuffer, owner, extra) {
        var dataLiteral = '{}';

        sourceBuffer.addRaw('var $sourceSlots = [];');
        if (aNode.children) {
            var defaultSourceSlots = [];
            var sourceSlotCodes = {};

            each(aNode.children, function (child) {
                var slotBind = !child.textExpr && getANodeProp(child, 'slot');
                if (slotBind) {
                    if (!sourceSlotCodes[slotBind.raw]) {
                        sourceSlotCodes[slotBind.raw] = {
                            children: [],
                            prop: slotBind
                        };
                    }

                    sourceSlotCodes[slotBind.raw].children.push(child);
                }
                else {
                    defaultSourceSlots.push(child);
                }
            });

            if (defaultSourceSlots.length) {
                sourceBuffer.addRaw('$sourceSlots.push([function (componentCtx) {');
                sourceBuffer.addRaw('  var html = "";');
                defaultSourceSlots.forEach(function (child) {
                    aNodeCompiler.compile(child, sourceBuffer, owner);
                });
                sourceBuffer.addRaw('  return html;');
                sourceBuffer.addRaw('}]);');
            }

            for (var key in sourceSlotCodes) {
                var sourceSlotCode = sourceSlotCodes[key];
                sourceBuffer.addRaw('$sourceSlots.push([function (componentCtx) {');
                sourceBuffer.addRaw('  var html = "";');
                sourceBuffer.addRaw(sourceSlotCode.children.forEach(function (child) {
                    aNodeCompiler.compile(child, sourceBuffer, owner);
                }));
                sourceBuffer.addRaw('  return html;');
                sourceBuffer.addRaw('}, ' + compileExprSource.expr(sourceSlotCode.prop.expr) + ']);');
            }
        }


        var givenData = [];
        each(camelComponentBinds(aNode.props), function (prop) {
            postProp(prop);
            givenData.push(
                compileExprSource.stringLiteralize(prop.name)
                + ':'
                + compileExprSource.expr(prop.expr)
            );
        });

        dataLiteral = '{' + givenData.join(',\n') + '}';
        if (aNode.directives.bind) {
            dataLiteral = 'extend('
                + compileExprSource.expr(aNode.directives.bind.value)
                + ', '
                + dataLiteral
                + ')';
        }

        var renderId = compileComponentSource(sourceBuffer, extra.ComponentClass, owner.ssrContextId);
        sourceBuffer.addRaw('html += componentRenderers.' + renderId + '(');
        sourceBuffer.addRaw(dataLiteral + ', true, componentCtx, '
            + stringifier.str(aNode.tagName) + ', $sourceSlots);');
        sourceBuffer.addRaw('$sourceSlots = null;');
    }
463698
function renderContent(data, context, parentView, key, isLayout, onRender) {
		// Render template against data as a tree of subviews (nested rendered template instances), or as a string (top-level template).
		// If the data is the parent view, treat as layout template, re-render with the same data context.
		var i, l, dataItem, newView, childView, itemResult, props, swapContent, tagCtx, tag_, outerOnRender, tmplName,
			self = this,
			tmpl = self,
			allowDataLink = !self.attr || self.attr === "html",
			result = "";

		if (key === TRUE) {
			swapContent = TRUE;
			key = 0;
		}
		if (self._is === "tag") {
			tag_ = self._;
			tmplName = self.tagName;
			tagCtx = self.tagCtx;
			// This is a call from renderTag
			tmpl = tagCtx.isElse ? tag_.elses[tagCtx.isElse-1] : tag_.tmpl;
			context = extendCtx(context, self.ctx);
			props = tagCtx.props;
			if ( props.link === FALSE ) {
				// link=false setting on block tag
				// We will override inherited value of link by the explicit setting link=false taken from props
				// The child views of an unlinked view are also unlinked. So setting child back to true will not have any effect.
				context =  context || {};
				context.link = FALSE;
			}
			parentView = parentView || tagCtx.view;
			data = data === undefined ?  parentView : data;
		} else {
			tmpl = self.jquery && (self[0] || error('Unknown template: "' + self.selector + '"')) // This is a call from $(selector).render
				|| self;
		}
		if (tmpl) {
			if (parentView) {
				onRender = onRender || parentView._.onRender;
				if (data === parentView) {
					// Inherit the data from the parent view.
					// This may be the contents of an {{if}} block
					// Set isLayout = true so we don't iterate the if block if the data is an array.
					data = parentView.data;
					isLayout = TRUE;
				}
				context = extendCtx(context, parentView.ctx);
			} else {
				(context = context || {}).root = data; // Provide ~root as shortcut to top-level data.
			}

			// Set additional context on views created here, (as modified context inherited from the parent, and to be inherited by child views)
			// Note: If no jQuery, $extend does not support chained copies - so limit extend() to two parameters

			if (!tmpl.fn) {
				tmpl = $templates[tmpl] || $templates(tmpl);
			}

			if (tmpl) {
				onRender = (context && context.link) !== FALSE && allowDataLink && onRender;
				// If link===false, do not call onRender, so no data-linking marker nodes
				outerOnRender = onRender;
				if (onRender === TRUE) {
					// Used by view.refresh(). Don't create a new wrapper view.
					outerOnRender = undefined;
					onRender = parentView._.onRender;
				}
				if ($.isArray(data) && !isLayout) {
					// Create a view for the array, whose child views correspond to each data item. (Note: if key and parentView are passed in
					// along with parent view, treat as insert -e.g. from view.addViews - so parentView is already the view item for array)
					newView = swapContent ? parentView : (key !== undefined && parentView) || View(context, "array", parentView, data, tmpl, key, onRender);
					for (i = 0, l = data.length; i < l; i++) {
						// Create a view for each data item.
						dataItem = data[i];
						childView = View(context, "item", newView, dataItem, tmpl, (key || 0) + i, onRender);
						itemResult = tmpl.fn(dataItem, childView, $views);
						result += newView._.onRender ? newView._.onRender(itemResult, childView) : itemResult;
					}
				} else {
					// Create a view for singleton data object. The type of the view will be the tag name, e.g. "if" or "myTag" except for
					// "item", "array" and "data" views. A "data" view is from programatic render(object) against a 'singleton'.
					newView = swapContent ? parentView : View(context, tmplName||"data", parentView, data, tmpl, key, onRender);
					if (tag_ && !self.flow) {
						newView.tag = self;
					}
					result += tmpl.fn(data, newView, $views);
				}
				return outerOnRender ? outerOnRender(result, newView) : result;
			}
		}
		return "";
	}
122503
function($animate, joyrideService, $compile, $templateRequest, $timeout, $window){
    return {
      restrict: 'E',
      scope: {},
      template: '<div class="jr_overlay"></div>',
      link: function(scope, element, attrs){
        scope.joyride = joyrideService;
        var joyrideContainer,
            // overlay = '<div class="jr_overlay"></div>',
            template;

        angular.element($window).bind('resize', function(){
          if (scope.joyride.start) {
            setPos();
          }
        });

        function appendJoyride(){
          var appendHtml = $compile(template)(scope),
              currentStep = scope.joyride.config.steps[scope.joyride.current],
              divElement = angular.element(document.querySelector('body')),
              hasSelectedElement = false;

          if (currentStep.type === 'element' && !currentStep.appendToBody) {
            var tempElement = angular.element(document.querySelector(currentStep.selector));
            if (tempElement.length) {
              hasSelectedElement = true;
              divElement = tempElement;
            }
            else {
              console.warn('Could not find element with selector:', currentStep.selector);
            }
          }

          divElement.append(appendHtml);
          joyrideContainer = document.querySelector('.jr_container');

          /********************************************
          When joyride is nested inside an element this
          prevents any functions or state changes that are
          binded to the parentfrom executing when
          clicking on the joyride
          ********************************************/
          if (hasSelectedElement) {
            angular.element(joyrideContainer).on('click', function(event) {
              event.preventDefault();
              event.stopPropagation();
            });
          }

          angular.element(joyrideContainer).append("<div class='triangle'></div>");
          if (scope.joyride.start) {
            if (!scope.joyride.transitionStep) {
              angular.element(joyrideContainer).addClass('jr_start').addClass('jr_transition');
            }
          }

        }

        function removeJoyride(){
          angular.element(joyrideContainer).remove();
        }

        //////// Watching for change in the start variable
          scope.$watch('joyride.start', function(show, oldShow) {
            if (show !== oldShow || show === true) {

              //////// Joyride was opened
              if (show) {
                template = scope.joyride.config.template || 'ngJoyrideDefault.html';
                $templateRequest(template,false).then(function (html) {
                  template=html;
                  angular.element(document.querySelector('body')).addClass('jr_active');
                  if (scope.joyride.config.overlay !== false) {
                    angular.element(document.querySelector('body')).addClass('jr_overlay_show');
                  }

                  if (typeof scope.joyride.config.steps[scope.joyride.current].beforeStep === "function") {
                    scope.joyride.config.steps[scope.joyride.current].beforeStep(start);
                  }

                  else{
                    start();
                  }
                });

                function start(){
                  appendJoyride();
                    $animate.addClass(joyrideContainer, 'jr_start').then(scope.joyride.config.onStart);
                    setPos();
                }
              }

              ////////// Joyride was closed
              if (!show) {
                $animate.removeClass(joyrideContainer, 'jr_start').then(joyrideEnded);
              }
          }
        });

        //////////// Watching for transition trigger
        scope.$watch('joyride.transitionStep', function(val, oldVal) {
          if (val !== oldVal && scope.joyride.start) {
            if (val) {

              if (val == 'next' && scope.joyride.current == scope.joyride.config.steps.length-1) {
                scope.joyride.start = false;
              }

              else if (val == 'prev' && scope.joyride.current == 0) {
                return;
              }

              else{
                $animate.addClass(joyrideContainer, 'jr_transition').then(beforeTransition);
              }

            }
            if (!val) {
              $animate.removeClass(joyrideContainer, 'jr_transition');
            }
          }
        });

        ////// check for afterStep function before going to next step
        function beforeTransition(){
          if (typeof scope.joyride.config.steps[scope.joyride.current].afterStep === "function") {
            scope.joyride.config.steps[scope.joyride.current].afterStep(afterTransition);
          }

          else{
            afterTransition();
          }
        }

        ////// Remove -> Append joyride and transition in
        scope.joyride.resumeJoyride = function(){
          if (!scope.joyride.start) {
            return;
          }
          scope.joyride.transitionStep = false;
          if (typeof scope.joyride.config.onStepChange === "function") {
            scope.joyride.config.onStepChange();
          }
          removeJoyride();
          appendJoyride();
          $timeout(function(){
            setPos();
          })
        }


        ////// Set position and current step after joyride transitions out
        function afterTransition(){

          ////// transitions in the next step
            if (scope.joyride.transitionStep == 'next') {
              scope.joyride.current++;
            }
            else{
              scope.joyride.current--;
            }

            /********************************************
            if step contains a beforeStep function
            execute it first before transitioning in
            else just transition in
            ********************************************/
              if (typeof scope.joyride.config.steps[scope.joyride.current].beforeStep === "function") {
                scope.joyride.config.steps[scope.joyride.current].beforeStep(scope.joyride.resumeJoyride);
              }

              else{
                scope.joyride.resumeJoyride();
              }

        }

        // Reset variables after joyride ends
        var joyrideEnded = function(){
          angular.element(document.querySelector('body')).removeClass('jr_active jr_overlay_show');
          removeJoyride();
          scope.joyride.current = 0;
          scope.joyride.transitionStep = true;
          if (typeof scope.joyride.config.onFinish === "function") {
            scope.joyride.config.onFinish();
          }
          if (document.querySelector(".jr_target")) {
            angular.element(document.querySelector(".jr_target")).removeClass('jr_target');
          }
        }

       // Handles joyride positioning
        function setPos(){
          var currentStep = scope.joyride.config.steps[scope.joyride.current];

          $timeout(function(){

            removeClassByPrefix(joyrideContainer, "jr_pos_");
            var step = scope.joyride.config.steps[scope.joyride.current];
            

          // If step type equals 'element' set position and styles
          if (step.type == 'element' && document.querySelector(step.selector)) {
            joyrideContainer.removeAttribute('style');
            angular.element(joyrideContainer).addClass('jr_element');
            

            if (document.querySelector(".jr_target")) {
              angular.element(document.querySelector(".jr_target")).removeClass('jr_target');  
            }
            
            var jrElement = angular.element(document.querySelector(step.selector));
            var position = getElementOffset(jrElement[0]);
            var window_width = window.innerWidth;

            var jrWidth = joyrideContainer.offsetWidth;
            var targetWidth = jrElement[0].offsetWidth;
            
            var jrHeight = joyrideContainer.clientHeight;
            var targetHeight = jrElement[0].clientHeight;
                
            jrElement.addClass('jr_target');

            /********************************************
            Check where the step should be positioned then 
            change the position property accordingly
            ********************************************/
            var placement = step.placement || 'bottom';
            if (step.responsive && window_width < step.responsive.breakpoint) {
              placement = step.responsive.placement || 'bottom';
            }

            angular.element(joyrideContainer).addClass('jr_pos_'+placement);

            if (currentStep.appendToBody){
              if (placement === 'top' || placement === 'bottom') {
                if (placement === 'top') {
                  position.top -= jrHeight + 20;
                }

                else {
                  position.top += targetHeight + 20;
                }
                

                position.left = ((position.left + targetWidth/2) - jrWidth/2 );
                
              }

              else{
                
                
                position.top = ((position.top + targetHeight/2) - jrHeight/2 );
                if (placement === 'left') {
                  position.left -= jrWidth + 20;

                }

                else {
                  position.left += targetWidth + 20;
                }

              }

              // Set joyride position
              joyrideContainer.style.left = position.left + 'px';
              joyrideContainer.style.top = position.top + 'px';
              joyrideContainer.style.right = 'auto';
              joyrideContainer.style.bottom = 'auto';
              joyrideContainer.style.transform = 'none';
              
            
            }

            /** 
            Check if Joyride is out of bounds and adjust position
            */
            
            var joyridePosition = getElementOffset(joyrideContainer);

            /**
            Handle top/bottom cases
            */
            if(placement !== "left" && placement !== "right"){

              if(joyridePosition.left < 0){
                var triangle = document.querySelector(".jr_container .triangle");
                triangle.style.left = (targetWidth/2 - triangle.offsetWidth/2)  + 'px';
                triangle.style.right = "auto";
                joyrideContainer.style.left = 0;
                joyrideContainer.style.right = "auto";
              }

              else if((joyridePosition.left + jrWidth) > window_width){
                var tempPos = joyridePosition.left + (jrWidth/2)
                var triangle = document.querySelector(".jr_container .triangle");
                triangle.style.right = (targetWidth/2 - triangle.offsetWidth/2)  + 'px';
                triangle.style.left = "auto";
                joyrideContainer.style.left = "auto";
                joyrideContainer.style.right = 0;
              }
            }
            

            /**
            Handle left/right cases
            */
            else{

              if(joyridePosition.top < 0){
                var triangle = document.querySelector(".jr_container .triangle");
                var trianglePos = targetHeight/2 - triangle.offsetHeight/2;
                triangle.style.top = trianglePos < 0 ? 0 + "px" : trianglePos + "px";

                triangle.style.bottom = "auto";
                joyrideContainer.style.top = 0;
                joyrideContainer.style.transform = "none";
              }

            }

            // Scroll to element if scroll is enabled
              if (step.scroll !== false) {
                if (placement === 'bottom') {
                  scroll_pos = position.top - targetHeight;
                }
                else if(placement === 'top'){
                  scroll_pos = position.top - jrHeight;
                }
                else{
                  if(targetHeight < jrHeight){
                    scroll_pos = position.top -  (jrHeight - targetHeight) /2;
                  }
                }
                
                scrollToElement(scroll_pos);
              }
          }


          // If step isn't an element
          else{
            angular.element(joyrideContainer).removeClass('jr_element');
            if (document.querySelector(".jr_target")) {
              angular.element(document.querySelector(".jr_target")).removeClass('jr_target');  
            }
            joyrideContainer.style.left = '';
            joyrideContainer.style.top = getScroll(placement, joyrideContainer) + 100 + 'px';
          }
      });

        }
      }

    }

  }
1022100
function IfNode(aNode, parent, scope, owner, reverseWalker) {
    this.aNode = aNode;
    this.owner = owner;
    this.scope = scope;
    this.parent = parent;
    this.parentComponent = parent.nodeType === NodeType.CMPT
        ? parent
        : parent.parentComponent;

    this.id = guid++;
    this.children = [];

    // #[begin] reverse
    if (reverseWalker) {
        if (evalExpr(this.aNode.directives['if'].value, this.scope, this.owner)) { // eslint-disable-line dot-notation
            this.elseIndex = -1;
            this.children[0] = createReverseNode(
                this.aNode.ifRinsed,
                this,
                this.scope,
                this.owner,
                reverseWalker
            );
        }
        else {
            var me = this;
            each(aNode.elses, function (elseANode, index) {
                var elif = elseANode.directives.elif;

                if (!elif || elif && evalExpr(elif.value, me.scope, me.owner)) {
                    me.elseIndex = index;
                    me.children[0] = createReverseNode(
                        elseANode,
                        me,
                        me.scope,
                        me.owner,
                        reverseWalker
                    );
                    return false;
                }
            });
        }

        this._create();
        insertBefore(this.el, reverseWalker.target, reverseWalker.current);
    }
    // #[end]
}
221272
function() {
      _.each(cdb.core.View.views, function(view) {
        _.each(view, function(prop, k) {
          if( k !== '_parent' &&
              view.hasOwnProperty(k) &&
              prop instanceof cdb.core.View &&
              view._subviews[prop.cid] === undefined) {
            console.log("=========");
            console.log("untracked view: ");
            console.log(prop.el);
            console.log('parent');
            console.log(view.el);
            console.log(" ");
          }
        });
      });
    }
765215
function View(context, type, parentView, data, template, key, onRender) {
		// Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)
		var views, parentView_,
			isArray = type === "array",
			self_ = {
				key: 0,
				useKey: isArray ? 0 : 1,
				id: "" + viewId++,
				onRender: onRender,
				bnd: {}
			},
			self = {
				data: data,
				tmpl: template,
				views: isArray ? [] : {},
				parent: parentView,
				ctx: context,
				type: type,
				// If the data is an array, this is an 'array view' with a views array for each child 'item view'
				// If the data is not an array, this is an 'item view' with a views 'map' object for any child nested views
				// ._.useKey is non zero if is not an 'array view' (owning a data array). Uuse this as next key for adding to child views map
				get: getView,
				getIndex: getIndex,
				getRsc: getResource,
				hlp: getHelper,
				_: self_
		};

		if (parentView) {
			views = parentView.views;
			parentView_ = parentView._;
			if (parentView_.useKey) {
				// Parent is an 'item view'. Add this view to its views object
				// self._key = is the key in the parent view map
				views[self_.key = "_" + parentView_.useKey++] = self;
			} else {
				// Parent is an 'array view'. Add this view to its views array
				views.splice(
					// self._.key = self.index - the index in the parent view array
					self_.key = self.index =
						key !== undefined
							? key
							: views.length,
				0, self);
			}
			// If no context was passed in, use parent context
			// If context was passed in, it should have been merged already with parent context
			self.ctx = context || parentView.ctx;
		}
		return self;
	}
1213579
private void visitBlockScopedName(NodeTraversal t, Node decl, Node nameNode) {
    Scope scope = t.getScope();
    Node parent = decl.getParent();
    // Normalize "let x;" to "let x = undefined;" if in a loop, since we later convert x
    // to be $jscomp$loop$0.x and want to reset the property to undefined every loop iteration.
    if ((decl.isLet() || decl.isConst())
        && !nameNode.hasChildren()
        && (parent == null || !parent.isForIn())
        && inLoop(decl)) {
      Node undefined = createUndefinedNode().srcref(nameNode);
      nameNode.addChildToFront(undefined);
      compiler.reportChangeToEnclosingScope(undefined);
    }

    String oldName = nameNode.getString();
    Scope hoistScope = scope.getClosestHoistScope();
    if (scope != hoistScope) {
      String newName = oldName;
      if (hoistScope.hasSlot(oldName) || undeclaredNames.contains(oldName)) {
        do {
          newName = oldName + "$" + compiler.getUniqueNameIdSupplier().get();
        } while (hoistScope.hasSlot(newName));
        nameNode.setString(newName);
        compiler.reportChangeToEnclosingScope(nameNode);
        Node scopeRoot = scope.getRootNode();
        renameTable.put(scopeRoot, oldName, newName);
      }
      Var oldVar = scope.getVar(oldName);
      scope.undeclare(oldVar);
      hoistScope.declare(newName, nameNode, oldVar.input);
    }
  }
476216
function parseDirective(aNode, name, value, options) {
    if (name === 'else-if') {
        name = 'elif';
    }

    var parser = directiveParsers[name];
    if (parser) {
        (aNode.directives[name] = parser(value, options)).raw = value;
    }
}
794289
function setScope (vnode) {
    var i;
    var ancestor = vnode;
    while (ancestor) {
      if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
        nodeOps.setAttribute(vnode.elm, i, '');
      }
      ancestor = ancestor.parent;
    }
    // for slot content they should also get the scopeId from the host instance.
    if (isDef(i = activeInstance) &&
        i !== vnode.context &&
        isDef(i = i.$options._scopeId)) {
      nodeOps.setAttribute(vnode.elm, i, '');
    }
  }
1124609
function () {
            /*  determine parameters  */
            var params = $cs.params("property", arguments, {
                name:        { pos: 0, req: true      },
                value:       { pos: 1, def: undefined },
                def:         {         def: undefined },
                scope:       {         def: undefined },
                bubbling:    {         def: true      },
                targeting:   {         def: true      },
                returnowner: {         def: false     }
            });

            /*  sanity check usage  */
            if (!params.targeting && !params.bubbling)
                throw _cs.exception("property", "disabling both targeting and bubbling makes no sense");

            /*  start resolving with the default value  */
            var result; result = params.def;

            /*  get old configuration value
                (on current node or on any parent node)  */
            var v;
            for (var scope = [], node = this;
                node !== null;
                scope.unshift(node.name()), node = node.parent()) {

                /*  optionally skip the target component
                    (usually if a property on the parent components
                    should be resolved only, but the scoping for the
                    target component should be still taken into account
                    on the parent) */
                if (scope.length === 0 && !params.targeting)
                    continue;

                /*  first try: child-scoped property  */
                if (scope.length > 0) {
                    for (var i = scope.length - 1; i >= 0; i--) {
                        var probePath = scope.slice(0, i + 1).join("/");
                        v = node.cfg("ComponentJS:property:" + params.name + "@" + probePath);
                        if (typeof v !== "undefined")
                            break;
                    }
                    if (typeof v !== "undefined") {
                        result = (params.returnowner ? node : v);
                        break;
                    }
                }

                /*  second try: unscoped property  */
                v = node.cfg("ComponentJS:property:" + params.name);
                if (typeof v !== "undefined") {
                    result = (params.returnowner ? node : v);
                    break;
                }

                /*  if we should not bubble, stop immediately  */
                if (!params.bubbling)
                    break;
            }

            /*  optionally set new configuration value
                (on current node only)  */
            if (typeof params.value !== "undefined")
                if (typeof params.scope !== "undefined")
                    this.cfg("ComponentJS:property:" + params.name + "@" + params.scope, params.value);
                else
                    this.cfg("ComponentJS:property:" + params.name, params.value);

            /*  return result (either the old configuration
                value or the owning component)  */
            return result;
        }
717827
function createNode(aNode, parent, scope, owner) {
    if (aNode.Clazz) {
        return new aNode.Clazz(aNode, parent, scope, owner);
    }

    var ComponentOrLoader = owner.getComponentType
        ? owner.getComponentType(aNode)
        : owner.components[aNode.tagName];

    if (ComponentOrLoader) {
        return typeof ComponentOrLoader === 'function'
            ? new ComponentOrLoader({
                source: aNode,
                owner: owner,
                scope: scope,
                parent: parent,
                subTag: aNode.tagName
            })
            : new AsyncComponent({
                source: aNode,
                owner: owner,
                scope: scope,
                parent: parent,
                subTag: aNode.tagName
            }, ComponentOrLoader);
    }

    aNode.Clazz = Element;
    return new Element(aNode, parent, scope, owner);
}
1286373
function templateVisitAll(visitor, asts, context) {
    if (context === void 0) { context = null; }
    var /** @type {?} */ result = [];
    var /** @type {?} */ visit = visitor.visit ?
        function (ast) { return visitor.visit(ast, context) || ast.visit(visitor, context); } :
        function (ast) { return ast.visit(visitor, context); };
    asts.forEach(function (ast) {
        var /** @type {?} */ astResult = visit(ast);
        if (astResult) {
            result.push(astResult);
        }
    });
    return result;
}
262318
function() {
		var lastScope;

		// find the first reference scope
		var templateContext = this.getScope(function(scope) {
			lastScope = scope;
			return scope._context instanceof TemplateContext;
		});

		// if there is no reference scope, add one as the root
		if(!templateContext) {
			templateContext = new Scope(new TemplateContext());

			// add templateContext to root of the scope chain so it
			// can be found using `getScope` next time it is looked up
			lastScope._parent = templateContext;
		}
		return templateContext;
	}