Perform parsing {@link _cWidget#bindings}
@param {_cWidget} widget_config
@param {(_cRawDirective|_cRawTag)} raw_element
196533
function(widget_config, raw_element) {

		if (raw_element.content.length != 1) Lava.t("Malformed binding in widget definition: " + raw_element.attributes.name);

		var binding = {
			property_name: raw_element.attributes.name,
			path_config: Lava.ExpressionParser.parseScopeEval(raw_element.content[0])
		};
		if ('from_widget' in raw_element.attributes) {
			if (Lava.schema.DEBUG && ['', '1', 'true'].indexOf(raw_element.attributes['from_widget']) == -1) Lava.t('binding: invalid from_widget attribute');
			binding.from_widget = true;
		}
		Lava.store(widget_config, 'bindings', raw_element.attributes.name, binding);

	}
1027936
@Override
	public void setWidget( Widget w )
	{
		// Validate
		if( w == widget )
			return;

		// Detach new child.
		if( w != null )
			w.removeFromParent();

		// Remove old child.
		if( widget != null )
			remove( widget );

		// Logical attach.
		widget = w;

		if( w != null )
		{
			// Physical attach.
			DOM.appendChild( containerElement, widget.getElement() );

			adopt( w );
		}
	}
678681
function(raw_directive) {

		if (Lava.schema.DEBUG) {
			if (!raw_directive.attributes || !raw_directive.attributes.title) Lava.t("define: missing 'title' attribute");
			if (raw_directive.attributes.title.indexOf(' ') != -1) Lava.t("Widget title must not contain spaces");
			if ('resource_id' in raw_directive.attributes) Lava.t("resource_id is not allowed on define");
			if (this._current_widget_title) Lava.t("Nested defines are not allowed: " + raw_directive.attributes.title);
		}

		this._current_widget_title = raw_directive.attributes.title;
		var widget_config = this._parseWidgetDefinition(raw_directive);
		this._current_widget_title = null;
		widget_config.is_extended = false; // reserve it for serialization

		if (Lava.schema.DEBUG && ('class_locator' in widget_config)) Lava.t("Dynamic class names are allowed only in inline widgets, not in x:define");

		Lava.storeWidgetSchema(raw_directive.attributes.title, widget_config);

	}
579826
function parseBindings(bindings) {
        var config = {};

        switch (typeof bindings.value) {
            case 'string':
            case 'function':
                config.title = bindings.value;
                break
            case 'object':
                config = Object.assign({}, bindings.value);
        }

        // Parse args (eg: v-d-tooltip:my-container)
        if (bindings.arg) {
            config.container = "#" + (bindings.arg); // #my-container
        }

        // Parse modifiers. eg: v-d-tooltip.my-modifier
        Object.keys(bindings.modifiers).forEach(function (mod) {
            // Parse if the title allows HTML
            if (/^html$/.test(mod)) {
                config.html = true;

            // Parse animation
            } else if (/^nofade$/.test(mod)) {
                config.animation = false;

            // Parse placement
            } else if (/^(auto|top(left|right)?|bottom(left|right)?|left(top|bottom)?|right(top|bottom)?)$/.test(mod)) {
                config.placement = mod;

            // Parse boundary
            } else if (/^(window|viewport)$/.test(mod)) {
                config.boundary = mod;

            // Parse delay
            } else if (/^d\d+$/.test(mod)) {
                var delay = parseInt(mod.slice(1), 10) || 0;
                if (delay) {
                    config.delay = delay;
                }

            // Parse offset
            }  else if (/^o-?\d+$/.test(mod)) {
                var offset = parseInt(mod.slice(1), 10) || 0;
                if (offset) {
                    config.offset = offset;
                }
            }
        });

        // Parse selected triggers.
        var selectedTriggers = {};
        var triggers = typeof config.trigger === 'string' ? config.trigger.trim().split(/\s+/) : [];

        triggers.forEach(function (trigger) {
            if (validTriggers[trigger]) {
                selectedTriggers[trigger] = true;
            }
        });

        // Parse trigger modifiers. eg: v-d-tooltip.click
        Object.keys(validTriggers).forEach(function (trigger) {
            if (bindings.modifiers[trigger]) {
                selectedTriggers[trigger] = true;
            }
        });

        config.trigger = Object.keys(selectedTriggers).join(' ');

        // Convert `blur` to `focus`
        if (config.trigger === 'blur') {
            config.trigger = 'focus';
        }

        // If there's no trigger assigned, just delete the key.
        if (!config.trigger) {
            delete config.trigger;
        }

        return config
    }
1270854
function Widget(options) {
  this.__data = {};
  try {
    var e;
    if (typeof options === 'undefined') options = {};
    if (typeof options.innerHTML !== 'undefined' && typeof options.childNodes !== 'undefined') {
      // On passe directement un élément.
      options = {element: options};
    }
    if (typeof options.tag === 'undefined') options.tag = "div";
    if (options.element) {
      this.element(options.element);
    } else if (typeof options.id !== 'undefined') {
      e = window.document.getElementById(options.id);
      if (!e) {
        throw Error("Can't find element with id: \"" + options.id + "\"!");
      }
      this.element(e);
    } else {
      this.element(window.document.createElement(options.tag));
      this.addClass("wdg", "custom");
    }
  }
  catch (ex) {
    console.error("[widget] ", ex);
    console.error("[Widget] ", JSON.stringify(options));
    throw Error(ex);
  }
}
150268
function(result, raw_tag) {

		var config = this.createDefaultWidgetConfig();

		config['extends'] = raw_tag.x.widget;
		config.container = this._toContainer(raw_tag);

		this._parseViewAttributes(config, raw_tag);
		// Otherwise, there will be ambiguity between the target of the attribute (widget or it's container)
		// to set resource_id with x:widget - rewrite the declaration to x:type='container' with <x:widget> inside
		if (Lava.schema.DEBUG && raw_tag.x && ('resource_id' in raw_tag.x)) Lava.t("x:widget attribute is not compatible with resource_id attribute");
		if (raw_tag.content) config.template = this.compileTemplate(raw_tag.content, config);

		result.push(config);

	}
139466
function(raw_tag, widget_config) {

		if ('sugar' in widget_config) Lava.t("Sugar is already defined");
		if (Lava.schema.DEBUG && raw_tag.content.length != 1) Lava.t("Malformed option: " + raw_tag.attributes.name);
		widget_config.sugar = Lava.parseOptions(raw_tag.content[0]);

	}
170415
function () {
/*Line 153 - 'AtomBinding.js' */                if (this.twoWays) {
/*Line 154 - 'AtomBinding.js' */                    if (this.jq) {
/*Line 155 - 'AtomBinding.js' */                        this.bindEvent(this.element, "change", "onValChanged");
/*Line 156 - 'AtomBinding.js' */                        this.bindEvent(this.element, "blur", "onValChanged");
/*Line 157 - 'AtomBinding.js' */                        if (this.events) {
/*Line 158 - 'AtomBinding.js' */                            var list = new AtomEnumerator(this.events.split(","));
/*Line 159 - 'AtomBinding.js' */                            while (list.next()) {
/*Line 160 - 'AtomBinding.js' */                                this.bindEvent(this.element, list.current(), "onValChanged");
/*Line 161 - 'AtomBinding.js' */                            }
/*Line 162 - 'AtomBinding.js' */                        }
/*Line 163 - 'AtomBinding.js' */                    } else {
/*Line 164 - 'AtomBinding.js' */                        this.bindEvent(this.control, "WatchHandler", "onPropChanged", this.key);
/*Line 165 - 'AtomBinding.js' */                    }
/*Line 166 - 'AtomBinding.js' */                }

/*Line 168 - 'AtomBinding.js' */                this.onDataChanged(this, null);

/*Line 170 - 'AtomBinding.js' */            }
1364727
function () {
                this.$InputElement.initWidget.call(this);

                var bindings = this._cfg.bind;
                var binding = bindings.selectedValue;
                if (binding) {
                    var newValue = this._transform(binding.transform, binding.inside[binding.to], "toWidget");
                    this._domElt.checked = (newValue === this._cfg.value);
                } else {
                    this.$logWarn(this.BINDING_NEEDED, [this.$class, "selectedValue"]);
                }
            }
677494
function(widget_config, raw_template) {

		var storage_schema = this.getMergedStorageSchema(widget_config),
			tags = Lava.parsers.Common.asBlockType(raw_template, 'tag'),
			i = 0,
			count = tags.length,
			item_schema;

		for (; i < count; i++) {

			item_schema = storage_schema[tags[i].name];
			if (Lava.schema.DEBUG && !item_schema) Lava.t('parsing storage; no schema for ' + tags[i].name);
			Lava.store(widget_config, 'storage', tags[i].name, this[this._root_handlers[item_schema.type]](item_schema, tags[i]));

		}

	}
121571
@SuppressWarnings("unchecked")
	// Suppressing warnings since Commons Collections is gangster...
	@Override
	public void addBindings(Bindings bindings) {
		try {
			SlingHttpServletRequest request = (SlingHttpServletRequest) bindings
					.get("request");
			String resourceType = request.getResource().getResourceType();
			Collection<ComponentBindingsProvider> cis = cif
					.getComponentBindingsProviders(resourceType);
			if (cis != null && cis.size() > 0) {
				CQVariables variables = variablesService.getVariables(bindings);
				for (ComponentBindingsProvider ci : cis) {
					try {
						log.debug("Invoking component bindings provider {}", ci);
						ci.addBindings(variables, bindings);
					} catch (Exception e) {
						log.error(
								"Exception invoking component bindings provider "
										+ ci, e);
						recentExceptions
								.add(new ComponentBindingsExceptionData(ci, e));
					}
				}
			}
		} catch (Exception e) {
			log.error("Exception invoking component binding providers", e);
		}
	}
1037819
function (cfg, ctxt, lineNumber) {
        var controller = new ariaWidgetsControllersDateController();
        this.$TextInput.constructor.call(this, cfg, ctxt, lineNumber, controller);
        controller.setPattern(cfg.pattern);
        if (cfg.minValue) {
            controller.setMinValue(new Date(cfg.minValue));
        }
        if (cfg.maxValue) {
            controller.setMaxValue(new Date(cfg.maxValue));
        }
        if (cfg.referenceDate) {
            controller.setReferenceDate(new Date(cfg.referenceDate));
        }
    }
89267
function (cfg, context, lineNumber) {
        this.$BaseWidget.constructor.apply(this, arguments);

        this._cfgOk = ariaCoreJsonValidator.validateCfg("aria.touch.widgets.SliderCfgBeans.SliderCfg", cfg);
        if (!this._cfgOk) {
            return;
        }

        /**
         * Value of the widget (must be between 0 and 1)
         * @type Number
         * @protected
         */
        this._value = 0;

        this._readValue();
        /**
         * Id generated for the button DOM element of the slider.
         * @type String
         * @protected
         */
        this._domId = cfg.id ? context.$getId(cfg.id) : this._createDynamicId();
        /**
         * Id generated for the highlight element.
         * @type String
         * @protected
         */
        this._highlightDomId = this._domId + "_highlight";
        /**
         * Id generated for the slider container element.
         * @type String
         * @protected
         */
        this._parentDomId = this._domId + "_parent";
        /**
         * Id generated for the slider switch on container element.
         * @type String
         * @protected
         */
        this._onSwitchId = this._domId + "_on";
        /**
         * Id generated for the slider switch off container element.
         * @type String
         * @protected
         */
        this._offSwitchId = this._domId + "_off";
        /**
         * Flag used for switching between switch and slider.
         * @type Boolean
         * @protected
         */
        this._isSwitch = cfg.toggleSwitch;

        /**
         * When using the widget as switch, this is the value above which all value are converted to 1
         * @type {Float}
         * @protected
         */
        this._switchThreshold = cfg.switchThreshold != null ? Math.min(1, Math.max(0, cfg.switchThreshold)) : 0.5;

        /**
         * Label for the on side of the switch.
         * @type String
         * @protected
         */
        this._onLabel = cfg.onLabel || "ON";

        /**
         * Label for the off side of the switch.
         * @type String
         * @protected
         */
        this._offLabel = cfg.offLabel || "OFF";

        /**
         * Reference to the on state DOM element of the slider.
         * @type HTMLElement
         * @protected
         */
        this._onContainer = null;
        /**
         * Reference to the off state DOM element of the slider.
         * @type HTMLElement
         * @protected
         */
        this._offContainer = null;

        /**
         * Reference to the button DOM element of the slider.
         * @type HTMLElement
         * @protected
         */
        this._slider = null;
        /**
         * Reference to the highlight DOM element of the slider.
         * @type HTMLElement
         * @protected
         */
        this._highlight = null;
        /**
         * Reference to the Container DOM element of the slider.
         * @type HTMLElement
         * @protected
         */
        this._sliderContainer = null;
        /**
         * Reference to the Width of the Thumb.
         * @type Number
         * @protected
         */
        this._sliderWidth = null;
        /**
         * Reference to the Dimension of the Slider.
         * @type {aria.utils.DomBeans:Geometry}
         * @protected
         */
        this._sliderDimension = null;

        /**
         * Width of the rail in which thumb travels.
         * @type {Number
         * @protected
         */
        this._railWidth = null;

        /**
         * Value of the page/clientX property of the touch event when the user started moving the slider. It is then
         * updated so that it is always the position of the touch for which there is no change of the position of the
         * slider.
         * @type Number
         * @protected
         */
        this._savedX = null;

        /**
         * Initial position of the element being dragged
         * @type {Number}
         * @protected
         */
        this._initialDrag = null;

        /**
         * ID used for delegating events
         * @type {String}
         */
        this._delegateId = null;

        var binding = this._cfg.bind ? this._cfg.bind.value : null;
        this._binding = binding;
        if (binding) {
            this._bindingCallback = {
                fn : this._notifyDataChange,
                scope : this,
                args : true
            };
            ariaUtilsJson.addListener(binding.inside, binding.to, this._bindingCallback, false);
        }
        /**
         * Drag instances associated to the thumb
         * @type {String} of aria.utils.dragdrop.Drag
         */
        this._draggable = null;
    }
412847
function (property) {
            var bindings = this._cfg.bind, bind = bindings[property];

            if (bindings && bind && bindings.hasOwnProperty(property) && property === "items") {
                var callback = {
                    fn : this._notifyDataChange,
                    scope : this,
                    args : property
                };
                try {
                    ariaUtilsJson.addListener(bind.inside, bind.to, callback, true, true);
                    this._bindingListeners[property] = {
                        inside : bind.inside,
                        to : bind.to,
                        transform : bind.transform,
                        cb : callback
                    };

                    var newValue = this._transform(bind.transform, bind.inside[bind.to], "toWidget");
                    this._cfg[property] = newValue;
                } catch (ex) {
                    this.$logError(this.INVALID_BEAN, [property, "bind"]);
                }
            } else {
                this.$TemplateBasedWidget._registerSingleProperty.apply(this, arguments);
            }
        }
54972
function(view, config, widget) {

		this._view = view;
		//this._config = config;
		this._widget = widget;

		if (('options' in config)) {

			if ('appender' in config.options) {
				if (Lava.schema.DEBUG && !this['_append' + config.options.appender]) Lava.t('[Emulated container] wrong appender: ' + config.options.appender);
				this.appendHTML = this['_append' + config.options.appender]
			}

			if ('prepender' in config.options) {
				if (Lava.schema.DEBUG && !this['_append' + config.options.prepender]) Lava.t('[Emulated container] wrong prepender: ' + config.options.prepender);
				this.prependHTML = this['_append' + config.options.prepender]
			}

		}

	}
871987
function(config, widget, parent_view, template, properties) {

		var name,
			count,
			i;

		if (Lava.schema.DEBUG && !config.is_extended) Lava.t("Widget was created with partial (unextended) config");

		if (Lava.schema.DEBUG) {
			for (name in this._property_descriptors) {
				if (!(name in this._properties)) Lava.t("All widget properties must have a default value");
			}
			if (config.default_events) {
				for (i = 0, count = config.default_events.length; i < count; i++) {
					if (!Lava.view_manager.isEventRouted(config.default_events[i])) Lava.t('Event is not routed: ' + config.default_events[i]);
				}
			}
		}

		this._parent_widget = widget;

		this.View$init(config, this, parent_view, template, properties);

		for (name in config.bindings) {

			this._bindings[name] = new Lava.scope.Binding(config.bindings[name], this);

		}

	}
514420
function(result, raw_block) {

		/** @type {_cView} */
		var config = {
				type: 'view',
				"class": null
			},
			i = 0,
			count;

		if (Lava.schema.parsers.PRESERVE_VIEW_NAME) {
			config.view_name = raw_block.name;
		}

		if ('arguments' in raw_block) {

			if (Lava.schema.DEBUG && raw_block.arguments.length > 1) Lava.t('Block may have no more than one argument');
			if (raw_block.arguments.length) {
				config.argument = raw_block.arguments[0];
			}

		}

		if ('class_locator' in raw_block) {
			config.class_locator = raw_block.class_locator;
			config.real_class = raw_block.real_class;
			config['class'] = Lava.schema.view.DEFAULT_CLASS_LOCATOR_GATEWAY;
		} else {
			config['class'] = this._viewNameToClass(raw_block.name);
		}

		if (raw_block.prefix == '$') {
			config.container = {type: 'Morph'};
		}

		this._parseViewHash(config, raw_block.hash); // before content, so directives could be parsed into the config

		if ('content' in raw_block) {
			config.template = this.compileTemplate(raw_block.content, config);
		} else {
			config.template = [];
		}

		if ('else_content' in raw_block) {
			config.else_template = this.compileTemplate(raw_block.else_content);
		}

		if ('elseif_arguments' in raw_block) {
			config.elseif_arguments = raw_block.elseif_arguments;
			config.elseif_templates = [];
			for (count = raw_block.elseif_content.length; i < count; i++) {
				config.elseif_templates.push(this.compileTemplate(raw_block.elseif_content[i]));
			}
		}

		result.push(config);

	}