From 8cbbf98957b7e7e971e8a04a960514d5653b3525 Mon Sep 17 00:00:00 2001 From: Matt Morgan Date: Fri, 10 Jul 2015 17:20:21 -0500 Subject: [PATCH] fixed Input pattern bug --- dist/platypus.css | 2 +- dist/platypus.less | 2 +- dist/platypusui.d.ts | 2 +- dist/platypusui.js | 8 +++++--- dist/platypusui.min.js | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dist/platypus.css b/dist/platypus.css index b869631..0e1690c 100644 --- a/dist/platypus.css +++ b/dist/platypus.css @@ -1,5 +1,5 @@ /** - * PlatypusUI v0.5.0 (https://platypi.io) + * PlatypusUI v0.5.1 (https://platypi.io) * Copyright 2015 Platypi, LLC. All rights reserved. * * PlatypusUI is licensed under the MIT license found at diff --git a/dist/platypus.less b/dist/platypus.less index a9d8c19..ef581f0 100644 --- a/dist/platypus.less +++ b/dist/platypus.less @@ -1,5 +1,5 @@ /** - * PlatypusUI v0.5.0 (https://platypi.io) + * PlatypusUI v0.5.1 (https://platypi.io) * Copyright 2015 Platypi, LLC. All rights reserved. * * PlatypusUI is licensed under the MIT license found at diff --git a/dist/platypusui.d.ts b/dist/platypusui.d.ts index 1d85e06..7098e52 100644 --- a/dist/platypusui.d.ts +++ b/dist/platypusui.d.ts @@ -1,5 +1,5 @@ /** - * PlatypusUI v0.5.0 (https://platypi.io) + * PlatypusUI v0.5.1 (https://platypi.io) * Copyright 2015 Platypi, LLC. All rights reserved. * * PlatypusUI is licensed under the MIT license found at diff --git a/dist/platypusui.js b/dist/platypusui.js index 08c2f90..0dece5d 100644 --- a/dist/platypusui.js +++ b/dist/platypusui.js @@ -6,7 +6,7 @@ var __extends = this.__extends || function (d, b) { }; /* tslint:disable */ /** - * PlatypusUI v0.5.0 (https://platypi.io) + * PlatypusUI v0.5.1 (https://platypi.io) * Copyright 2015 Platypi, LLC. All rights reserved. * * PlatypusUI is licensed under the MIT license found at @@ -3727,8 +3727,10 @@ var platui; * The event handler upon user text input. */ Input.prototype._onInput = function () { - var inputElement = this._inputElement, value = this._stripInput(inputElement.value); - inputElement.value = value; + var inputElement = this._inputElement, value = inputElement.value, strippedValue = this._stripInput(inputElement.value); + if (value !== strippedValue) { + value = inputElement.value = strippedValue; + } if (value === this.value) { return; } diff --git a/dist/platypusui.min.js b/dist/platypusui.min.js index 42bd174..d417410 100644 --- a/dist/platypusui.min.js +++ b/dist/platypusui.min.js @@ -1,4 +1,4 @@ var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},platui;!function(a){"use strict";var b="$",c=b+"Promise",d=b+"Compat",e=b+"Regex",f=b+"Window",g=b+"Document",h=b+"Animator",i=b+"DomEventInstance",j=b+"TemplateControlFactory",k="context",l="plat",m=l+"-",n=m+"button",o=m+"checkbox",p=m+"drawer",q=p+"-controller",r=m+"modal",s=m+"progress",t=m+"ring",u=m+"radio",v=m+"toggle",w=m+"slider",x=m+"range",y=m+"select",z=m+"input",A=m+"file",B=m+"carousel",C=m+"listview",D=m+"navbar",E=m+"hide",F=m+k,G=m+"checked",H=m+"foreach",I=m+"html",J=m+"bind",K=m+"disabled",L=m+"readonly",M=l+"Checked",N=l+"Bind",O={index:"index",even:"even",odd:"odd",first:"first",last:"last",group:"group"},P=m+"transition",Q=m+"enter",R=m+"leave",S="$tap",T="$touchstart",U="$touchend",V="$touchcancel",W="$swipe",X="$track",Y="$trackend",Z="__plat-button-",$="__plat-radio-",_="__platDrawerControllerFetch",aa="__platDrawerFound",ba="-reversed",ca="literal",da={right:"left",left:"right",up:"down",down:"up"},ea=function(){};"undefined"!=typeof window&&("undefined"==typeof window.platui&&(window.platui=a),"undefined"==typeof window.module&&(window.module={}));var fa=function(a){function b(){a.apply(this,arguments),this.replaceWith="button",this._isSelected=!1}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,n+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b.prototype.setTemplate=function(){for(var a,b,c=this._document,d=this.element,e=Array.prototype.slice.call(d.childNodes),f=this.utils.isEmpty;e.length>0;)a=e.shift(),a.nodeType===Node.TEXT_NODE?f(a.textContent.trim().match(/[^\r\n]/g))||(b=c.createElement("span"),b.insertBefore(a,null),d.insertBefore(b,null)):d.insertBefore(a,null)},b.prototype.loaded=function(){var a=this.element,b=this.options||{},c=b.value||{},d=c.group,e=this.utils.isString;return e(d)?(this._group=d,this.dom.hasClass(a,m+"selected")&&this._onTap(),void this._addEventListeners()):(d=this.attributes[N],void(e(d)&&(this._group=d,this.dom.hasClass(a,m+"selected")&&this._onTap(),this._addEventListeners())))},b.prototype.observeProperties=function(a){a.observeProperty(this._setBoundProperty)},b.prototype._setBoundProperty=function(a,b,c,d){this.utils.isString(a)&&a===this.element.textContent&&this._onTap()},b.prototype._addEventListeners=function(){var a=this;this.addEventListener(this.element,S,this._onTap,!1),this.on(Z+this._group,function(){a._isSelected&&(a.dom.removeClass(a.element,m+"selected"),a._isSelected=!1)})},b.prototype._onTap=function(){if(!this._isSelected){var a=this.element;this.dom.addClass(a,m+"selected"),this.dispatchEvent(Z+this._group,plat.events.EventManager.DIRECT),this._isSelected=!0,this.inputChanged(a.textContent)}},b._inject={_document:g},b}(plat.ui.BindControl);a.Button=fa,plat.register.control(n,fa);var ga=function(a){function b(){a.apply(this,arguments),this.templateString='
\n
\n
\n',this.isActive=!1,this._targetType="slide"}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,v+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b.prototype.loaded=function(){var a=this.element;this._targetElement=a.firstElementChild,this.addEventListener(a,S,this._onTap)},b.prototype.observeProperties=function(a){a.observeProperty(this._setBoundProperty)},b.prototype._setBoundProperty=function(a,b,c,d){if(a!==b){if(d===!0&&this.utils.isNull(a))return void this.inputChanged(this.isActive);var e=!!a;e!==this.isActive&&this._toggle(d)}},b.prototype._onTap=function(a){this._toggle(!0),this._trigger("change")},b.prototype._trigger=function(a){var b=plat.acquire(i);b.initialize(this.element,a),b.trigger()},b.prototype._toggle=function(a){var b=this.isActive,c=!b;this._activate(this._targetElement||(this._targetElement=this.element.firstElementChild)),this.isActive=this.element.checked=c,a===!0&&this.inputChanged(c,b)},b.prototype._activate=function(a){this.dom.toggleClass(a,m+this._targetType)},b}(plat.ui.BindControl);a.Toggle=ga,plat.register.control(v,ga);var ha=function(a){function b(){a.apply(this,arguments),this.templateString='
\n \n
\n',this._targetTypeSet=!1}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,o+" "+(a||""))},b.prototype.setTemplate=function(){var a=this.utils.isNull,b=this.innerTemplate;if(!a(b))for(var c,d,e,f=this._document,g=this.element,h=Array.prototype.slice.call(b.childNodes);h.length>0;)c=h.shift(),c.nodeType===Node.TEXT_NODE?(e=c.textContent.trim().match(/[^\r\n]/g),null!==e&&e.length>0&&(d=f.createElement("span"),d.insertBefore(c,null),g.insertBefore(d,null))):g.insertBefore(c,null)},b.prototype.loaded=function(){a.prototype.loaded.call(this);var b=this.options||{},c=b.value||{},d=this._targetType,e=this._targetType=c.mark||"check";switch(this._convertChecked(),e.toLowerCase()){case"check":case"x":break;default:this._log.debug("Invalid mark option specified for"+this.type+". Defaulting to checkmark."),this._targetType="check"}if(this._targetTypeSet){var f=this._targetElement;this.dom.removeClass(f,d),this._activate(f)}this._targetTypeSet=!0},b.prototype._convertChecked=function(){var a=this.element;a.hasAttribute(G)?(this._convertAttribute(a.getAttribute(G)),this.attributes.observe(this._convertAttribute,M)):a.hasAttribute("data-"+G)?(this._convertAttribute(a.getAttribute("data-"+G)),this.attributes.observe(this._convertAttribute,M)):(a.hasAttribute("checked")||a.hasAttribute("data-checked"))&&this._convertAttribute(!0)},b.prototype._convertAttribute=function(a,b){var c=this.utils;return c.isBoolean(a)?this._setBoundProperty(a,b,null,!0):void(c.isString(a)&&this._setBoundProperty("true"===a,"true"===b,null,!0))},b.prototype._activate=function(a){return this._targetTypeSet?void this.dom.toggleClass(a,m+this._targetType):void(this._targetTypeSet=!0)},b._inject={_document:g},b}(ga);a.Checkbox=ha,plat.register.control(o,ha);var ia=function(a){function b(){a.apply(this,arguments),this.templateString='
\n
\n
\n',this.groupName="",this._targetType="bullet",this._targetTypeSet=!0}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,u+" "+(a||""))},b.prototype.loaded=function(){var a=this.element;this._targetElement=a.firstElementChild,this.addEventListener(a,S,this._onTap),a.hasAttribute("name")?this.groupName=a.getAttribute("name"):a.hasAttribute(J)?this.groupName=a.getAttribute(J):a.hasAttribute("data-"+J)&&(this.groupName=a.getAttribute("data-"+J)),this._convertChecked()},b.prototype.inputChanged=function(b,c){this.isActive&&a.prototype.inputChanged.call(this,this._getValue())},b.prototype._setBoundProperty=function(a,b,c,d){if(a!==b){if(d===!0&&this.utils.isNull(a))return void this.inputChanged();var e=a===this._getValue(),f=this.isActive;e!==f&&this._toggle(d)}},b.prototype._onTap=function(b){this.isActive||a.prototype._onTap.call(this,b)},b.prototype._toggle=function(b){var c=this;if(a.prototype._toggle.call(this,b),this.utils.isFunction(this._removeListener)&&(this._removeListener(),this._removeListener=null),this.isActive){var d=this.groupName;this.dispatchEvent($+d,plat.events.EventManager.DIRECT);var e=this._removeListener=this.on($+d,function(){c._toggle(),e()})}},b.prototype._convertAttribute=function(a,b){var c=this.utils;return c.isBoolean(a)?void(a&&this._setBoundProperty(this._getValue(),null,null,!0)):void(c.isString(a)&&"true"===a&&this._setBoundProperty(this._getValue(),null,null,!0))},b.prototype._getValue=function(){var a=this.element;return a.hasAttribute("value")?a.getAttribute("value").trim():a.textContent.trim()},b}(ha);a.Radio=ia,plat.register.control(u,ia);var ja=function(a){function b(){a.apply(this,arguments),this.templateString='
\n
\n
\n'}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,t+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b}(plat.ui.TemplateControl);a.ProgressRing=ja,plat.register.control(t,ja);var ka=function(a){function b(){a.apply(this,arguments),this.templateString='
\n
\n
\n'}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,s+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b.prototype.loaded=function(){var a=this;this._barElement=this.element.firstElementChild.firstElementChild,this.setProgress(this.context),this.addEventListener(this._window,"resize",function(){a.setProgress(a.context)})},b.prototype.contextChanged=function(){this.setProgress(this.context)},b.prototype.setProgress=function(a){if(!this.utils.isNumber(a)||a>1||0>a)return void this._log.debug('The context of a "'+this.type+'" control must be a number between 0 and 1.');var b=this._barElement,c=b.parentElement.clientWidth;c&&(b.style.width=Math.ceil(c*a)+"px")},b._inject={_window:f},b}(plat.ui.TemplateControl);a.ProgressBar=ka,plat.register.control(s,ka);var la=function(a){function b(){a.apply(this,arguments),this._controllers=[],this._isInitialized=!1,this._preInitializedValue=!1}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,p+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b.prototype.setTemplate=function(){this.innerTemplate=this.dom.appendChildren(this.element.childNodes)},b.prototype.loaded=function(){var a=this,b=this.element,c=this.utils,d=this.options||{},e=d.value||{},f=this._currentPosition=e.position||"left",g=e.id||"",h=e.templateUrl,i=e.elastic===!0;return b.setAttribute(E,""),this.dom.addClass(b,m+f),c.isString(h)?void plat.ui.TemplateControl.determineTemplate(this,h).then(function(b){a.innerTemplate=b,a._initializeEvents(g,f,i)}):void this._initializeEvents(g,f,i)},b.prototype.open=function(){var a=this._controllers[0];return this.utils.isNull(a)?(this._log.debug("No controller, such as a "+q+", found for the "+this.type+" attempting to open."),this._Promise.resolve(null)):a.open()},b.prototype.close=function(){var a=this._controllers[0];return this.utils.isNull(a)?(this._log.debug("No controller, such as a "+q+", found for the "+this.type+" attempting to close."),this._Promise.resolve(null)):a.close()},b.prototype.toggle=function(){var a=this._controllers[0];return this.utils.isNull(a)?(this._log.debug("No controller, such as a "+q+", found for the "+this.type+" attempting to toggle."),this._Promise.resolve(null)):a.toggle()},b.prototype.reset=function(){var a=this._controllers[0];return this.utils.isNull(a)?(this._log.debug("No controller, such as a "+q+", found for the "+this.type+" attempting to reset."),this._Promise.resolve(null)):a.reset()},b.prototype.isOpen=function(){var a=this._controllers[0];return this.utils.isNull(a)?(this._log.debug("No controller, such as a "+q+", found for the "+this.type+" attempting to check if open."),!1):a.isOpen()},b.prototype.bindTemplate=function(a,b){var c=this,d=this.bindableTemplates;return d.add(a,b),d.bind(a).then(function(a){var b=c.element;c.dom.clearNode(b),b.appendChild(a)}).catch(function(a){c._log.debug("Error binding template for "+c.type+": "+a)})},b.prototype.controllerCount=function(){return this._controllers.length},b.prototype.spliceController=function(a){var b=this._controllers,c=b.indexOf(a);-1!==c&&b.splice(c,1)},b.prototype.observeProperties=function(a){a.observeProperty(this._setBoundProperty)},b.prototype._setBoundProperty=function(a,b,c,d){var e=this.utils,f=this._controllers[0];if(d===!0&&e.isNull(a))return void this.inputChanged(e.isNull(f)?!1:f.isOpen());if(e.isBoolean(a)){if(!this._isInitialized)return void(this._preInitializedValue=a);if(this._preInitializedValue=!1,e.isNull(f))return;if(a){if(f.isOpen())return;return void f.open()}return void(f.isOpen()&&f.close())}this._log.debug("Attempting to open or close "+this.type+" with a bound value that is something other than a boolean.")},b.prototype._changeDirection=function(a){if(!this.utils.isNull(a)&&a!==this._currentPosition){var b=this.dom,c=this.element;b.removeClass(c,m+this._currentPosition),b.addClass(c,m+a),this._currentPosition=a}},b.prototype._initializeEvents=function(a,b,c){var d=this,e=this.utils,f=this.innerTemplate;this.on(_+"_"+a,function(g,h){var i=h.control;if(!e.isNull(i))return e.isString(h.position)&&(b=h.position,d._changeDirection(b)),d._controllers.unshift(i),h.received||d.dispatchEvent(aa+"_"+a,plat.events.EventManager.DIRECT,{control:d,received:!0,position:b,template:e.isNode(f)?f.cloneNode(!0):null,elastic:c}),d._isInitialized=!0,h.useContext?void d._checkPreInit():void d.bindTemplate("drawer",f.cloneNode(!0)).then(function(){d._checkPreInit()})}),this.dispatchEvent(aa+"_"+a,plat.events.EventManager.DIRECT,{control:this,received:!1,position:b,template:e.isNode(f)?f.cloneNode(!0):null,elastic:c})},b.prototype._checkPreInit=function(){var a=this;if(this._preInitializedValue){var b=this.utils;b.postpone(function(){var c=a._controllers[0];b.isNull(c)||c.open()})}},b._inject={_Promise:c},b}(plat.ui.BindControl);a.Drawer=la,plat.register.control(p,la);var ma=function(a){function b(){a.apply(this,arguments),this._hasSwiped=!1,this._hasTapped=!1,this._isOpen=!1,this._touchState=0,this._isVertical=!1,this._isInitialized=!1,this._preInitializedValue=!1}return __extends(b,a),b.prototype.initialize=function(){this.dom.addClass(this.element,q)},b.prototype.loaded=function(){var a=this.options||{},b=a.value||{},c=b.position,d=b.id||"";this._type=b.type||"tap track",this._isElastic=b.elastic,this._useContext=b.useContext===!0,this._templateUrl=b.templateUrl,this._initializeEvents(d,c)},b.prototype.dispose=function(){a.prototype.dispose.call(this);var b=this.utils,c=this._drawer;if(!(b.isNull(c)||(c.spliceController(this),c.controllerCount()>0))){var d=c.storedProperties,e=this._rootElement;if(this.dom.removeClass(e,p+"-open plat-drawer-transition-prep "+this._directionalTransitionPrep),b.isObject(d)){var f=e.style,g=e.parentElement,h=d.parentOverflow;f.position=d.position,f.zIndex=d.zIndex,b.isObject(h)&&b.isNode(g)&&(g.style[h.key]=h.value),delete c.storedProperties,this._drawerElement.setAttribute(E,"")}}},b.prototype.open=function(){var a=this,b=!this._isOpen,c=this.utils;c.isFunction(this._toggleDelay)&&this._toggleDelay();var d=new this._Promise(function(b){a._toggleDelay=c.requestAnimationFrame(function(){a._touchState=0,a._toggleDelay=null,a._open().then(b)})});if(b){var e=this._drawer;this.inputChanged(!0),c.isNull(e)||e.inputChanged(!0)}return d},b.prototype.close=function(){var a=this,b=this._isOpen,c=this.utils;c.isFunction(this._toggleDelay)&&this._toggleDelay();var d=new this._Promise(function(b){a._toggleDelay=c.requestAnimationFrame(function(){a._touchState=0,a._toggleDelay=null,a._close().then(b)})});if(b){var e=this._drawer;this.inputChanged(!1),c.isNull(e)||e.inputChanged(!1)}return d},b.prototype.toggle=function(){return this._isOpen?this.close():this.open()},b.prototype.reset=function(){return this._isOpen?this.open():this.close()},b.prototype.isOpen=function(){return this._isOpen},b.prototype.bindTemplate=function(a,b){var c=this,d=this.bindableTemplates;return d.add(a,b),d.bind(a).then(function(a){var b=c._drawerElement;c.dom.clearNode(b),b.appendChild(a)}).catch(function(a){c._log.debug("Error binding template for "+c.type+": "+a)})},b.prototype.observeProperties=function(a){a.observeProperty(this._setBoundProperty)},b.prototype._setBoundProperty=function(a,b,c,d){var e=this,f=this.utils;if(d===!0&&f.isNull(a))return void this.inputChanged(this._isOpen);if(f.isBoolean(a)){if(!this._isInitialized)return void(this._preInitializedValue=a);if(a){if(this._isOpen)return;return void(this._toggleDelay=f.requestAnimationFrame(function(){e._touchState=0,e._toggleDelay=null,e._open()}))}return void(this._isOpen&&(this._toggleDelay=f.requestAnimationFrame(function(){e._touchState=0,e._toggleDelay=null,e._close()})))}this._log.debug("Attempting to bind "+this.type+" with a value that is something other than a boolean.")},b.prototype._open=function(){var a=this,b=this._rootElement,c=this._drawerElement,d=this.utils,e=d.isNode,f=!this._isOpen,g=this._getOffset();if(!(g&&e(b)&&e(c)))return this._Promise.resolve(null);var h;switch(this._position){case"left":h="translate3d("+g+"px,0,0)";break;case"right":h="translate3d("+-g+"px,0,0)";break;case"top":h="translate3d(0,"+g+"px,0)";break;case"bottom":h="translate3d(0,"+-g+"px,0)";break;default:return this._animator.resolve()}this._isOpen=!0,f?(this.dom.addClass(b,p+"-open "+this._directionalTransitionPrep),this._addEventIntercepts()):this.dom.addClass(b,this._directionalTransitionPrep);var i={};return i[this._transform]=h,this._animationThenable=this._animator.animate(b,P,{properties:i}).then(function(){a._animationThenable=null})},b.prototype._close=function(){var a=this,b=this._rootElement,c=this._drawerElement,d=this.dom,e=this.utils,f=e.isNode;if(this._isOpen&&(this._removeEventIntercepts(),d.removeClass(b,p+"-open")),this._isOpen=!1,!f(b)||!f(c))return this._Promise.resolve(null);var g={},h=this._transform;return g[h]=this._preTransform,this._animationThenable=this._animator.animate(b,P,{properties:g}).then(function(){a._animationThenable=null,a._isOpen||d.removeClass(b,a._directionalTransitionPrep)})},b.prototype._addEventIntercepts=function(){var a=this._clickEater,b=a.style,c=this._rootElement;if(b.top=c.scrollTop+"px",b.left=c.scrollLeft+"px",c.insertBefore(a,null),this._isTap&&this._addTapClose(),this._isSwipe&&this._addSwipeClose(),this._isTrack){var d=this.addEventListener(a,T,this._touchStart,!1),e=this.addEventListener(a,X,this._track,!1),f=this._touchEnd,g=this.addEventListener(a,Y,f,!1),h=this.addEventListener(a,U,f,!1);this._openTrackRemover=function(){d(),e(),g(),h()}}},b.prototype._removeEventIntercepts=function(){this._rootElement.removeChild(this._clickEater);var a=this.utils.isFunction;this._isTap&&a(this._openTapRemover)&&(this._openTapRemover(),this._openTapRemover=null),this._isTrack&&a(this._openTrackRemover)&&(this._openTrackRemover(),this._openTrackRemover=null),this._isSwipe&&a(this._openSwipeRemover)&&(this._openSwipeRemover(),this._openSwipeRemover=null)},b.prototype._addSwipeToggle=function(){var a=this,b=this.element,c=this.addEventListener(b,W+da[this._position],function(){a._hasSwiped=!0,a.open()},!1),d=this.addEventListener(b,W+this._position,function(){a._hasSwiped=!0,a.close()},!1);this._removeSwipeToggle=function(){c(),d()}},b.prototype._addSwipeClose=function(){var a=this;this._openSwipeRemover=this.addEventListener(this._clickEater,W+this._position,function(){a._hasSwiped=!0,a.close()},!1)},b.prototype._addTapToggle=function(){var a=this;this._removeTap=this.addEventListener(this.element,S,function(){a._hasTapped=!0,a.toggle()},!1)},b.prototype._addTapClose=function(){var a=this;this._openTapRemover=this.addEventListener(this._clickEater,S,function(){a._hasTapped=!0,a.close()},!1)},b.prototype._addEventListeners=function(){var a=this.element,b=this.utils.isNull,c=this._type.split(" "),d=this._position;if((this._isTap=-1!==c.indexOf("tap"))&&this._addTapToggle(),(this._isSwipe=-1!==c.indexOf("swipe"))&&this._addSwipeToggle(),this._isTrack=-1!==c.indexOf("track")){var e,f=this._track;switch(d){case"left":case"right":e=d;break;case"top":e="up";break;case"bottom":e="down";break;default:return}if(this._removePrimaryTrack=this.addEventListener(a,X+da[e],f,!1),this._removeSecondaryTrack=this.addEventListener(a,X+e,f,!1),b(this._lastTouch)){var g=this._touchEnd;this._lastTouch={x:0,y:0},this.addEventListener(a,T,this._touchStart,!1),this.addEventListener(a,U,g,!1),this.addEventListener(a,Y,g,!1)}}},b.prototype._removeEventListeners=function(){var a=this.utils.isFunction;this._isTap&&a(this._removeTap)&&(this._removeTap(),this._removeTap=null),this._isTrack&&(a(this._removePrimaryTrack)&&(this._removePrimaryTrack(),this._removePrimaryTrack=null),a(this._removeSecondaryTrack)&&(this._removeSecondaryTrack(),this._removeSecondaryTrack=null)),this._isSwipe&&a(this._removeSwipeToggle)&&(this._removeSwipeToggle(),this._removeSwipeToggle=null)},b.prototype._touchStart=function(a){1!==this._touchState&&(this.utils.isNull(this._animationThenable)||this._animationThenable.cancel(),this._initTouch(a))},b.prototype._initTouch=function(a){this._touchState=1,this._lastTouch={x:a.clientX,y:a.clientY},this._isOpen||this.dom.addClass(this._rootElement,this._directionalTransitionPrep)},b.prototype._touchEnd=function(a){var b=1!==this._touchState,c=this._hasSwiped,d=this._hasTapped;if(this._hasSwiped=this._hasTapped=!1,d||b||c)return void(this._touchState=0);this._touchState=2;var e=this._isVertical?a.clientY-this._lastTouch.y:a.clientX-this._lastTouch.x;if(this._isRightDirection(e)){var f=this._getOffset();if(!f)return;if(Math.abs(e)>Math.ceil(f/2))return void this.toggle();this.reset()}else this._isElastic?Math.abs(e)>0&&this.reset():this._isOpen||this.dom.removeClass(this._rootElement,this._directionalTransitionPrep)},b.prototype._track=function(a){var b=this;0!==this._touchState&&this.utils.requestAnimationFrame(function(){b._rootElement.style[b._transform]=b._calculateTranslation(a)})},b.prototype._isRightDirection=function(a){switch(this._position){case"left":case"top":return this._isOpen?0>a:a>0;case"right":case"bottom":return this._isOpen?a>0:0>a;default:return!1}},b.prototype._calculateTranslation=function(a){var b,c=this._getOffset();if(!c)return"translate3d(0,0,0)";switch(this._position){case"left":return b=this._checkElasticity(c,a.clientX-this._lastTouch.x),"translate3d("+b+"px,0,0)";case"right":return b=this._checkElasticity(c,this._lastTouch.x-a.clientX),"translate3d("+-b+"px,0,0)";case"top":return b=this._checkElasticity(c,a.clientY-this._lastTouch.y),"translate3d(0,"+b+"px,0)";case"bottom":return b=this._checkElasticity(c,this._lastTouch.y-a.clientY),"translate3d(0,"+-b+"px,0)";default:return this._preTransform}},b.prototype._checkElasticity=function(a,b){var c=this._isOpen?a+b:b;return this._isElastic?c:(0>c?c=0:c>a&&(c=a),c)},b.prototype._initializeEvents=function(a,b){var c=this,d=this._useContext,e=this.on(aa+"_"+a,function(f,g){e();var h=c.utils,i=h.isString,j=h.isUndefined,k=(c._drawer=g.control)||{},l=c._drawerElement=k.element;if(!i(b)){if(!i(g.position))return void c._log.debug('"position" is incorrectly defined for a control such as "'+p+'" or "'+c.type+'." Please ensure it is a string.');b=g.position}return l.removeAttribute(E),c._controllerIsValid(b.toLowerCase())?(c._setTransform(),c._addEventListeners(),j(c._isElastic)&&(c._isElastic=g.elastic===!0),g.received||c.dispatchEvent(_+"_"+a,plat.events.EventManager.DIRECT,{control:c,received:!0,position:b,useContext:d}),d?void c._determineTemplate(g.template).then(function(){c._isInitialized=!0,c._checkPreInit()}):(c._isInitialized=!0,void c._checkPreInit())):void 0});this.dispatchEvent(_+"_"+a,plat.events.EventManager.DIRECT,{control:this,received:!1,position:b,useContext:d})},b.prototype._checkPreInit=function(){var a=this;this._preInitializedValue&&(this._toggleDelay=this.utils.postpone(function(){a._touchState=0,a._toggleDelay=null,a._open()}))},b.prototype._determineTemplate=function(a){var b=this,c=this.utils;return c.isString(this._templateUrl)?plat.ui.TemplateControl.determineTemplate(this,this._templateUrl).then(function(a){return b.bindTemplate("drawer",a)}):c.isNode(a)?this.bindTemplate("drawer",a):this._Promise.resolve()},b.prototype._setTransform=function(){var a=this._rootElement.style,b=this.utils.isUndefined,c=this._compat.vendorPrefix;b(this._preTransform=a[c.lowerCase+"Transform"])?b(this._preTransform=a[c.upperCase+"Transform"])?this._transform="transform":this._transform=c.upperCase+"Transform":this._transform=c.lowerCase+"Transform"},b.prototype._controllerIsValid=function(a){var b=this.utils.isNull;if(b(this._drawerElement))return this._log.debug('Could not find a corresponding control such as "'+p+'" for this "'+this.type+'."'),!1;switch(a){case"top":case"bottom":this._isVertical=!0;case"left":case"right":this._position=a;break;default:return this._log.debug('Incorrect position: "'+a+'" defined for the a control such as "'+p+'", or "'+this.type+'."'),!1}var c=this._rootElement=this._getRootElement();return b(c)?(this._log.debug('Cannot have a "'+this.type+'" in a hierarchy above the corresponding control such as "'+p+'."'),!1):(this._clickEater=this._document.createElement("div"),this._clickEater.className="plat-clickeater",this.dom.addClass(c,"plat-drawer-transition-prep"),this._directionalTransitionPrep="plat-drawer-transition-"+a,!0)},b.prototype._getRootElement=function(){var a=this._drawer,b=this.utils;if(!b.isNull(a.storedProperties))return a.storedProperties.rootElement;for(var c,d=b.isNode,e=this.root,f=b.isObject(e)&&d(e.element)?e.element:this.element,g=this._drawerElement;d(c=f.parentElement)&&!c.contains(g);)f=c;var h=this._window,i=h.getComputedStyle(f),j=f.style,k=i.position,l=Number(i.zIndex),m={rootElement:f};if("static"===k&&(m.position=j.position,j.position="relative"),(!b.isNumber(l)||1>l)&&(m.zIndex=j.zIndex,j.zIndex="1"),d(c)){var n=c.style,o=n.overflow;if("hidden"!==o){var p,q,r=h.getComputedStyle(c);this._isVertical?(q="overflowY",p=r.overflowY):(q="overflowX",p=r.overflowX),"hidden"!==p&&(m.parentOverflow={key:q,value:n[q]},n[q]="hidden")}}return a.storedProperties=m,f},b.prototype._getOffset=function(){return this._isVertical?this._drawerElement.clientHeight:this._drawerElement.clientWidth},b._inject={_document:g,_window:f,_compat:d,_animator:h,_Promise:c},b}(plat.ui.BindControl);a.DrawerController=ma,plat.register.control(q,ma);var na=function(a){function b(){a.apply(this,arguments),this.templateString='
\n',this._isVisible=!1,this._scrollRemover=ea,this._scrollTop=0,this._transitionHash={up:!0,down:!0,left:!0,right:!0,fade:!0}}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,r+" "+E+" "+(a||""))},b.prototype.initialize=function(){var a=this.options||(this.options={}),b=a.value||(a.value={});this.templateUrl=b.templateUrl,this.setClasses()},b.prototype.setTemplate=function(){var a,b=this.utils;if(b.isString(this.templateUrl)){var c=this.dom,d=c.serializeHtml(this.templateString),e=this.element;a=this._container=d.firstChild,this.innerTemplate=c.appendChildren(e.childNodes),e.appendChild(d)}},b.prototype.loaded=function(){var a=this.options.value,b=a.transition;if(this._container=this._container||this.element.firstElementChild,this._injectElement(),!this.utils.isString(b)||"none"===b)return void this.dom.addClass(this._container,m+"no-transition");this._transitionHash[b]||this._log.debug('Custom transition: "'+b+'" defined for "'+this.type+'." Please ensure the transition is defined to avoid errors.');var c=this._compat.animationEvents;return this.utils.isNull(c)?(this._log.debug("This browser does not support CSS3 animations."),void this.dom.addClass(this._container,m+"no-transition")):(this._transitionEnd=c.$transitionEnd,void this.dom.addClass(this._container,m+b+" "+m+"modal-transition"))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._scrollRemover()},b.prototype.show=function(){var a=!this._isVisible,b=this._show();return a&&this.inputChanged(!0),b},b.prototype.hide=function(){var a=this.isVisible,b=this._hide();return a&&this.inputChanged(!1),b},b.prototype.toggle=function(){return this._isVisible?this.hide():this.show()},b.prototype.isVisible=function(){return this._isVisible},b.prototype.observeProperties=function(a){a.observeProperty(this._setBoundProperty)},b.prototype._setBoundProperty=function(a,b,c,d){var e=this.utils;if(d===!0&&e.isNull(a))return void this.inputChanged(this._isVisible);if(e.isBoolean(a)){if(a){if(this._isVisible)return;return void this._show()}return void(this._isVisible&&this._hide())}this._log.debug("Attempting to show or hide a "+this.type+" with a bound value that is something other than a boolean.")},b.prototype._show=function(){var a=this,b=this.dom,c=this.utils;return c.isNull(this.innerTemplate)?(this._isVisible=!0,new this._Promise(function(d){c.requestAnimationFrame(function(){a._alignModal(),b.removeClass(a.element,E),c.defer(function(){c.requestAnimationFrame(function(){b.addClass(a._container,m+"activate"),d()})},20)})})):this._bindInnerTemplate()},b.prototype._alignModal=function(a){var b=this,c=this.utils,d=c.isNull,e=this._document,f=e.documentElement,g=d(f)||!f.scrollTop?e.body:f,h=g.scrollTop;this._scrollTop!==h&&(d(a)?(this.element.style.top=h+"px",this._scrollRemover=this.addEventListener(this._window,"scroll",this._alignModal,!1)):c.requestAnimationFrame(function(){b.element.style.top=h+"px"}),this._scrollTop=h)},b.prototype._hide=function(){var a,b=this,c=this.dom,d=this.utils;return this._scrollRemover(),this._scrollRemover=ea,this._isVisible=!1,d.isString(this._transitionEnd)?(a=this._addHideOnTransitionEnd(),d.requestAnimationFrame(function(){c.removeClass(b._container,m+"activate")})):a=new this._Promise(function(a){d.requestAnimationFrame(function(){c.addClass(b.element,E),c.removeClass(b._container,m+"activate"),a()})}),a},b.prototype._bindInnerTemplate=function(){var a=this,b=this.innerTemplate,c=this.bindableTemplates,d="modal";return c.add(d,b),this.innerTemplate=null,c.bind(d).then(function(b){return a._container.insertBefore(b,null),a._show()})},b.prototype._injectElement=function(){var a=this.element,b=a.parentElement,c=this._document.body;this.utils.isNode(b)&&b!==c&&c.insertBefore(a,null)},b.prototype._addHideOnTransitionEnd=function(){var a=this;return new this._Promise(function(b){var c=a.element,d=a.addEventListener(c,a._transitionEnd,function(){d(),a.dom.addClass(c,E),b()},!1)})},b._inject={_window:f,_document:g,_compat:d,_Promise:c},b}(plat.ui.BindControl);a.Modal=na,plat.register.control(r,na);var oa=function(a){function b(){a.apply(this,arguments),this.templateString='
\n
\n
\n
\n
\n',this._isVertical=!1,this._knobOffset=0,this._touchState=0,this._cloneAttempts=0,this._maxCloneAttempts=25}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,w+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b.prototype.loaded=function(){var a=this.element,b=this._slider=a.firstElementChild.firstElementChild,c=this.utils.isNumber,d=this.options||{},e=d.value||{},f=Number(e.value),g=e.min,h=e.max,i=e.step,j=this._reversed=e.reverse===!0,k=this.min=c(g)?Math.floor(g):0,l=this.max=c(h)?Math.ceil(h):100,n=c(f)?Math.round(f):k,o=m+this._validateOrientation(e.orientation);this._knob=b.firstElementChild,j&&(o+=ba),this.dom.addClass(a,o),this.value=k,this._step=c(i)&&i>0?Math.round(i):1,k>=l&&(this._log.debug('"'+this.type+"'s\" min is greater than or equal to its max. Setting max to min + 1."),this.max=k+1),this._setLength(),this._initializeEvents(),this.setValue(n)},b.prototype.setValue=function(a){this._setValue(a,!0)},b.prototype.observeProperties=function(a){a.observeProperty(this._setBoundProperty)},b.prototype._setBoundProperty=function(a,b,c,d){return d===!0&&this.utils.isNull(a)?void this.inputChanged(this.value):void this._setValue(a,!1)},b.prototype._setValue=function(a,b){var c=this.utils;if(1===this._touchState)return void this._log.debug("Cannot set the value of "+this.type+" while the user is manipulating it.");if(c.isNull(a))a=this.min;else if(!c.isNumber(a))return;this._setValueProperty(a,!0,b)},b.prototype._initializeEvents=function(){var a,b,c=this,d=this.element,e=this._track,f=this._touchEnd;this._isVertical?(a=X+"down", -b=X+"up"):(a=X+"right",b=X+"left"),this.addEventListener(d,T,this._touchStart,!1),this.addEventListener(d,a,e,!1),this.addEventListener(d,b,e,!1),this.addEventListener(d,U,f,!1),this.addEventListener(d,Y,f,!1),this.addEventListener(this._window,"resize",function(){c._setLength(),c._setKnob()},!1)},b.prototype._touchStart=function(a){var b=this;if(1!==this._touchState){this._touchState=1,this._lastTouch={x:a.clientX,y:a.clientY,value:this.value};var c=a.target;if(c!==this._knob){var d;d=this._isVertical?c===this.element?this._reversed?a.offsetY-this._sliderOffset:this._maxOffset-(a.offsetY-this._sliderOffset):c===this._slider?this._reversed?a.offsetY:this._knobOffset-a.offsetY:this._reversed?a.offsetY:this._maxOffset-a.offsetY:c===this.element?this._reversed?this._maxOffset-(a.offsetX-this._sliderOffset):a.offsetX-this._sliderOffset:c===this._slider?this._reversed?this._knobOffset-a.offsetX:a.offsetX:this._reversed?this._maxOffset-a.offsetX:a.offsetX,this.utils.requestAnimationFrame(function(){b._knobOffset=b._setSliderProperties(d)})}}},b.prototype._touchEnd=function(a){var b=this;if(1!==this._touchState)return void(this._touchState=0);this._touchState=2;var c=this._calculateOffset(a),d=this._maxOffset;this.utils.requestAnimationFrame(function(){return b._touchState=0,b._lastTouch.value!==b.value&&b._trigger("change"),0>c?void(b._knobOffset=0):c>d?void(b._knobOffset=d):void(b._knobOffset=c)})},b.prototype._track=function(a){var b=this;0!==this._touchState&&this.utils.requestAnimationFrame(function(){b._setSliderProperties(b._calculateOffset(a))})},b.prototype._setSliderProperties=function(a){var b,c=this._maxOffset;if(0>=a){if(b=this.min,b-this.value>=0)return;a=0}else if(a>=c){if(b=this.max,b-this.value<=0)return;a=c}else b=this._calculateValue(a);return this._setValueProperty(b,!1,!0),this._slider.style[this._lengthProperty]=a+"px",a},b.prototype._calculateValue=function(a){var b=this._step;return this.min+Math.round(a/this._increment/b)*b},b.prototype._calculateKnobPosition=function(a){return(a-this.min)*this._increment},b.prototype._calculateOffset=function(a){return this._isVertical?this._reversed?this._knobOffset+a.clientY-this._lastTouch.y:this._knobOffset+this._lastTouch.y-a.clientY:this._reversed?this._knobOffset+this._lastTouch.x-a.clientX:this._knobOffset+a.clientX-this._lastTouch.x},b.prototype._setLength=function(a){var b=this.utils.isNode(a),c=b?a:this._slider.parentElement;return this._isVertical?(this._lengthProperty="height",this._maxOffset=c.clientHeight,this._sliderOffset=c.offsetTop):(this._lengthProperty="width",this._maxOffset=c.clientWidth,this._sliderOffset=c.offsetLeft),b||this._maxOffset?void this._setIncrement():void this._setOffsetWithClone(this._lengthProperty)},b.prototype._setIncrement=function(){return this._increment=this._maxOffset/(this.max-this.min)},b.prototype._setValueProperty=function(a,b,c){var d=this.value;if(a!==d){if(a>=this.max)a=this.max;else if(a<=this.min)a=this.min;else if(Math.abs(a-d)0;this._cloneAttempts=0;var g,h,i=b.cloneNode(!0),k=/\d+(?!\d+|%)/,l=this._window,m=[],n=i,o="important",p=this.utils.isNull;for(n.id="";!k.test(h=(g=l.getComputedStyle(b))[a]);){if("none"===g.display&&n.style.setProperty("display","block",o),n.style.setProperty(a,h,o),b=b.parentElement,p(b))return this._log.debug("The document's body contains a "+this.type+" that needs its length and is currently hidden. Please do not set the body's display to none."),void this.utils.defer(this._setOffsetWithClone,100,[a],this);n=b.cloneNode(!1),n.id="",m.push(n)}if(m.length>0){for(var q,r=m.pop();m.length>0;)q=m.pop(),r.insertBefore(q,null),r=q;r.insertBefore(i,null)}var s=n.style;s.setProperty(a,h,o),s.setProperty("visibility","hidden",o),c.appendChild(n),this._setLength(i.firstElementChild),c.removeChild(n),f&&this._setKnob()},b._inject={_document:g,_window:f,_animator:h},b}(plat.ui.BindControl);a.Slider=oa,plat.register.control(w,oa);var pa=function(a){function b(){a.apply(this,arguments),this.templateString='
\n
\n
\n
\n
\n
\n',this._isVertical=!1,this._touchState=0,this._cloneAttempts=0,this._maxCloneAttempts=25}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,x+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b.prototype.loaded=function(){var a=this.element,b=this._slider=a.firstElementChild.firstElementChild,c=this.utils,d=c.isNumber,e=this.options||{},f=e.value||{},g=Number(f.lower),h=Number(f.upper),i=f.identifiers||{},j=f.min,k=f.max,l=f.step,n=this._reversed=f.reverse===!0,o=this.min=d(j)?Math.floor(j):0,p=this.max=d(k)?Math.ceil(k):100,q=d(g)?Math.round(g):o,r=d(h)?Math.round(h):p,s=m+this._validateOrientation(f.orientation);if(this._lowerKnob=b.firstElementChild,this._upperKnob=b.lastElementChild,this._lowerIdentifier=i.lower||"lower",this._upperIdentifier=i.upper||"upper",n){var t=this._lowerKnob;this._lowerKnob=this._upperKnob,this._upperKnob=t,s+=ba}this.dom.addClass(a,s),this.lower=o,this.upper=p,this._step=d(l)&&l>0?Math.round(l):1,o>=p&&(this._log.debug('"'+this.type+"'s\" min is greater than or equal to its max. Setting max to min + 1."),this.max=o+1),this._setPositionAndLength(),this._setLowerKnobPosition(o),this._initializeEvents(),this.setLower(q),this.setUpper(r)},b.prototype.setLower=function(a){this._setLower(a,!0)},b.prototype.setUpper=function(a){this._setUpper(a,!0)},b.prototype.observeProperties=function(a){a.observeProperty(this._setLowerBoundProperty,this._lowerIdentifier),a.observeProperty(this._setUpperBoundProperty,this._upperIdentifier)},b.prototype._setLowerBoundProperty=function(a,b,c,d){d===!0&&this.utils.isNull(a)&&this._fireChange(),this._setLower(a,!1)},b.prototype._setUpperBoundProperty=function(a,b,c,d){d===!0&&this.utils.isNull(a)&&this._fireChange(),this._setUpper(a,!1)},b.prototype._setLower=function(a,b){var c=this.utils;if(2===this._touchState)return void this._log.debug("Cannot set the value of the "+this.type+"'s lower knob while the user is manipulating it.");if(c.isNull(a)&&(a=this.min),!c.isNumber(a)){var d=Number(a);if(!c.isNumber(d))return;a=d}this._setLowerValue(a,!0,b,!0)},b.prototype._setUpper=function(a,b){var c=this.utils;if(3===this._touchState)return void this._log.debug("Cannot set the upper value of the "+this.type+"'s upper knob while the user is manipulating it.");if(c.isNull(a)&&(a=this.max),!c.isNumber(a)){var d=Number(a);if(!c.isNumber(d))return;a=d}this._setUpperValue(a,!0,b,!0)},b.prototype._initializeEvents=function(){var a,b,c=this,d=this._lowerKnob,e=this._upperKnob,f=this._touchStart,g=this._touchEnd,h=this._trackLower,i=this._trackUpper;this._isVertical?(a=X+"down",b=X+"up"):(a=X+"right",b=X+"left"),this.addEventListener(d,T,f,!1),this.addEventListener(e,T,f,!1),this.addEventListener(d,a,h,!1),this.addEventListener(d,b,h,!1),this.addEventListener(e,a,i,!1),this.addEventListener(e,b,i,!1),this.addEventListener(d,U,g,!1),this.addEventListener(e,U,g,!1),this.addEventListener(d,Y,g,!1),this.addEventListener(e,Y,g,!1),this.addEventListener(this._window,"resize",function(){c._setPositionAndLength(),c._setLowerKnobPosition(),c._setUpperKnobPosition()},!1)},b.prototype._touchStart=function(a){var b=this._touchState;if(1!==b&&2!==b&&3!==b){this._touchState=1;var c=a.currentTarget,d=this._lastTouch;this.utils.isNull(d)?c.style.zIndex="1":d.target!==c&&(d.target.style.zIndex="0",c.style.zIndex="1"),this._lastTouch={x:a.clientX,y:a.clientY,value:c===this._lowerKnob?this.lower:this.upper,target:c}}},b.prototype._touchEnd=function(a){var b=this,c=this._touchState;if(0===c||4===c)return void(this._touchState=0);this._touchState=4;var d=this._lastTouch,e=a.currentTarget;this.utils.isNull(d)||d.target!==e||this.utils.requestAnimationFrame(function(){b._touchState=0;var c=e===b._lowerKnob,f=b._calculateOffset(a,c);c?d.value!==b.lower&&b._trigger("change"):d.value!==b.upper&&b._trigger("change"),b._setOffset(f,c)})},b.prototype._setOffset=function(a,b){var c=this._maxOffset;return 0>a?b?this._lowerKnobOffset=0:this._upperKnobOffset=0:a>c?b?this._lowerKnobOffset=c:this._upperKnobOffset=c:b?this._lowerKnobOffset=a:this._upperKnobOffset=a},b.prototype._trackLower=function(a){var b=this._touchState;if(2!==b)if(1===b)this._touchState=2;else if(0===b||3===b)return;var c,d=this._maxOffset,e=this._calculateOffset(a,!0);return 0>=e?(c=this.min,c-this.lower>=0&&(c=null),e=0):e>=d?(c=this.max,c-this.lower<=0&&(c=null),e=d):(c=this._calculateValue(e),c-this.lower===0&&(c=null)),e>this._upperKnobOffset?(this._positionTogether(e,c),void this._setOffset(e,!1)):void this._positionLower(e,c)},b.prototype._trackUpper=function(a){var b=this._touchState;if(3!==b)if(1===b)this._touchState=3;else if(0===b||2===b)return;var c,d=this._maxOffset,e=this._calculateOffset(a,!1);return 0>=e?(c=this.min,c-this.upper>=0&&(c=null),e=0):e>=d?(c=this.max,c-this.upper<=0&&(c=null),e=d):(c=this._calculateValue(e),c-this.upper===0&&(c=null)),e=this.max)a=this.max;else if(a<=this.min)a=this.min;else if(Math.abs(a-e)=this.max)a=this.max;else if(a<=this.min)a=this.min;else if(Math.abs(a-e)0;this._cloneAttempts=0;var g,h,i=b.cloneNode(!0),k=/\d+(?!\d+|%)/,l=this._window,m=[],n=i,o="important",p=this.utils.isNull;for(n.id="";!k.test(h=(g=l.getComputedStyle(b))[a]);){if("none"===g.display&&n.style.setProperty("display","block",o),n.style.setProperty(a,h,o),b=b.parentElement,p(b))return this._log.debug("The document's body contains a "+this.type+" that needs its length and is currently hidden. Please do not set the body's display to none."),void this.utils.defer(this._setOffsetWithClone,100,[a],this);n=b.cloneNode(!1),n.id="",m.push(n)}if(m.length>0){for(var q,r=m.pop();m.length>0;)q=m.pop(),r.insertBefore(q,null),r=q;r.insertBefore(i,null)}var s=n.style;s.setProperty(a,h,o),s.setProperty("visibility","hidden",o),c.appendChild(n),this._setPositionAndLength(i.firstElementChild),c.removeChild(n),f&&(this._setLowerKnobPosition(),this._setUpperKnobPosition())},b._inject={_document:g,_window:f,_animator:h},b}(plat.ui.BindControl);a.Range=pa,plat.register.control(x,pa);var qa=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,y+" "+(a||""))},b.prototype.initialize=function(){a.prototype.initialize.call(this),this.setClasses()},b}(plat.ui.controls.Select);a.Select=qa,plat.register.control(y,qa);var ra=function(a){function b(){a.apply(this,arguments),this.templateString='
\n \n \n \n \n \n
\n',this.value="",this._inTouch=!1,this._inAction=!1}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,z+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b.prototype.setTemplate=function(){for(var a,b,c,d=this.element,e=this._imageElement=d.firstElementChild.firstElementChild,f=this._inputElement=e.nextElementSibling,g=this.attributes,h=Object.keys(g),i=h.length,j=plat.dependency.injectors.control,k=!1,l=/plat-(?:control|hide|context)|class|style/,m=this.utils,n=m.isNull,o=m.delimit,p=m.isString,q=0;i>q;++q)a=h[q],b=o(a,"-"),c=g[a],p(c)&&!l.test(b)&&n(j[b])?"id"===b?(d.removeAttribute(b),f.setAttribute(b,c)):"placeholder"===b?(k=!0,f.placeholder=c):f.setAttribute(b,c):(b===K||b===L)&&f.setAttribute(b,c);if(!k&&!n(this.innerTemplate)){var r=this.innerTemplate.textContent.replace(/\r|\n/g,"");m.isEmpty(r)||(f.placeholder=r)}},b.prototype.loaded=function(){var a=this,b=this.options||{},c=b.value||{},d=this.element,e=this._type=this.attributes.type||c.type||"text",f=c.pattern,g=c.validation,h=this.utils,i=h.isString;this._imageElement=this._imageElement||d.firstElementChild.firstElementChild,this._inputElement=this._inputElement||this._imageElement.nextElementSibling,this.dom.addClass(d,m+e);var j=this._inputElement.nextElementSibling;this.addEventListener(j,U,function(){a._inputElement.focus()},!1),this._actionElement=j.firstElementChild,i(f)&&""!==f&&("/"===f[0]&&"/"===f[f.length-1]&&(f=f.slice(1,-1)),this._pattern=new RegExp(f)),i(g)&&""!==g&&("/"===g[0]&&"/"===g[g.length-1]&&(g=g.slice(1,-1)),this._validation=new RegExp(g)),this._initializeType()},b.prototype.validate=function(){return this._validation.test(this._inputElement.value)},b.prototype.clear=function(){var a=this._inputElement,b=a.value;if(""!==b){var c=this._actionElement;a.value=this.value="",this.inputChanged(this.value,b),c.textContent=this._typeChar="",c.setAttribute(E,"")}},b.prototype.focus=function(){this._inputElement.focus()},b.prototype.blur=function(){this._inputElement.blur()},b.prototype.observeProperties=function(a){a.observeProperty(this._setBoundProperty)},b.prototype._setBoundProperty=function(a,b,c,d){var e=this._inputElement.value;if(this.utils.isNull(a)){if(a="",d===!0)return void(this.utils.isNull(e)&&this._onInputChanged(a))}else if(a===e)return;this._onInputChanged(a)},b.prototype._initializeType=function(){var a=this._type,b=S,c=this._actionElement;switch(a){case"text":this._pattern=this._pattern||/[\S\s]*/,this._validation=this._validation||this._pattern,this._actionHandler=this._checkText.bind(this),this._typeHandler=this._erase;break;case"email":this._pattern=this._pattern||/[\S\s]*/,this._validation=this._validation||this._regex.validateEmail,this._actionHandler=this._checkEmail.bind(this),this._typeHandler=this._handleEmail;break;case"password":var d=this._handlePasswordHide;this._pattern=this._pattern||/[\S\s]*/,this._validation=this._validation||this._pattern,this._actionHandler=this._checkPassword.bind(this),this._typeHandler=this._handlePasswordShow,this.addEventListener(c,U,d),this.addEventListener(c,Y,d),b=T;break;case"tel":case"telephone":this._pattern=this._pattern||this._regex.validateTelephone,this._validation=this._validation||this._pattern,this._actionHandler=this._checkText.bind(this),this._typeHandler=this._erase;break;case"number":this._pattern=this._pattern||/^[0-9\.,]*$/,this._validation=this._validation||this._pattern,this._actionHandler=this._checkText.bind(this),this._typeHandler=this._erase,a="tel";break;case"hidden":return void this.element.setAttribute(E,"");case"radio":return void this._log.debug(a+" is not supported by "+this.type+". Please use a "+u+" instead.");case"checkbox":return void this._log.debug(a+" is not supported by "+this.type+". Please use a "+o+" instead.");case"range":return void this._log.debug(a+" is not supported by "+this.type+". Please use a "+w+" instead.");case"file":return void this._log.debug(a+" is not supported by "+this.type+". Please use a "+A+" instead.");default:this._log.debug(a+" is not yet fully supported by "+this.type+'. Defaulting to type="text".'),a="text",this._pattern=this._pattern||/[\S\s]*/,this._validation=this._validation||this._pattern,this._actionHandler=this._checkText.bind(this),this._typeHandler=this._erase}this._inputElement.type=a,c.textContent=this._typeChar="",c.setAttribute(E,""),this._addEventListeners(b)},b.prototype._addEventListeners=function(a){var b=this,c=this._actionElement,d=this._inputElement,e=function(){return b._inAction=!1};this.addEventListener(c,a,this._typeHandler,!1),this.addEventListener(c,T,function(){return b._inAction=!0},!1),this.addEventListener(c,U,e,!1),this.addEventListener(c,Y,e,!1),this.addEventListener(d,"focus",function(){""!==b.value&&c.removeAttribute(E)},!1),this.addEventListener(d,"blur",function(a){b._inAction||c.setAttribute(E,"")},!1),this._addTextEventListener()},b.prototype._addTextEventListener=function(){var a,b=this,c=this._inputElement,d=this._compat,e=this.utils,f=!1,g=function(){f||b._onInput()},h=function(){e.isFunction(a)||(a=e.postpone(function(){g(),a=null}))};e.isUndefined(d.ANDROID)&&(this.addEventListener(c,"compositionstart",function(){return f=!0},!1),this.addEventListener(c,"compositionend",function(){f=!1,g()},!1)),d.hasEvent("input")?this.addEventListener(c,"input",g,!1):(this.addEventListener(c,"keydown",function(a){var d=a.keyCode;if(!(91===d||92===d||d>15&&28>d||d>32&&41>d)){var e=b._pattern,f=a.char;return e.test(f)&&e.test(c.value+f)?void h():void a.preventDefault()}},!1),this.addEventListener(c,"cut",h,!1),this.addEventListener(c,"paste",h,!1)),this.addEventListener(c,"change",g,!1)},b.prototype._erase=function(){this.clear(),this.focus()},b.prototype._handlePasswordShow=function(){this._inTouch=!0,this._inputElement.type="text"},b.prototype._handlePasswordHide=function(){if(this._inTouch){this._inTouch=!1;var a=this._inputElement;a.type=this._type,a.focus()}},b.prototype._handleEmail=function(){var a=this._inputElement,b=a.value,c=this._typeChar;a.value=this.value="x"===c?"":b+c,this.inputChanged(this.value,b),this._checkEmail(),a.focus()},b.prototype._checkText=function(){var a=this._typeChar;"x"===a?""===this.value&&(this._typeChar=""):""!==this.value&&(this._typeChar="x");var b=this._typeChar;if(a!==b){var c=this._actionElement;if(c.textContent=b,""===b)return void c.setAttribute(E,"");c.removeAttribute(E)}},b.prototype._checkPassword=function(){var a=this._typeChar;"?"===a?""===this.value&&(this._typeChar=""):""!==this.value&&(this._typeChar="?");var b=this._typeChar;if(a!==b){var c=this._actionElement;if(c.textContent=b,""===b)return void c.setAttribute(E,"");c.removeAttribute(E)}},b.prototype._checkEmail=function(){var a=this._inputElement.value,b=this._typeChar;switch(b){case"@":if(-1!==a.indexOf("@")){if(-1!==a.indexOf(".com")){this._typeChar="x";break}this._typeChar=".com"}break;case".com":-1===a.indexOf("@")?this._typeChar="@":-1!==a.indexOf(".com")&&(this._typeChar="x");break;case"x":""===a?this._typeChar="":-1===a.indexOf("@")?this._typeChar="@":-1===a.indexOf(".com")&&(this._typeChar=".com");break;default:""===a?this._typeChar="":-1===a.indexOf("@")&&(this._typeChar="@")}var c=this._typeChar;if(b!==c){var d=this._actionElement;if(d.textContent=c,""===c)return void d.setAttribute(E,"");d.removeAttribute(E)}},b.prototype._onInput=function(){var a=this._inputElement,b=this._stripInput(a.value);a.value=b,b!==this.value&&(this.value=a.value,this.inputChanged(this.value),this._actionHandler())},b.prototype._onInputChanged=function(a){var b=this._inputElement;a=this._stripInput(a),b.value=a,this.value=b.value,this._actionHandler()},b.prototype._stripInput=function(a){for(var b,c="",d=c,e=this._pattern,f=a.length,g=0;f>g;++g)b=a[g],e.test(b)&&(c+=b,e.test(c)?d=c:c=d);return c},b._inject={_compat:d,_regex:e},b}(plat.ui.BindControl);a.Input=ra,plat.register.control(z,ra);var sa=function(a){function b(){a.apply(this,arguments),this.templateString='
\n \n \n \n
\n'}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,A+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b.prototype.setTemplate=function(){for(var a,b,c,d=this.element,e=this._hiddenInput=d.firstElementChild.firstElementChild,f=this._visibleInput=e.nextElementSibling,g=f.nextElementSibling,h=this.attributes,i=Object.keys(h),j=i.length,k=plat.dependency.injectors.control,l=/plat-(?:control|hide|context)|class|style/,m=!1,n=this.utils,o=n.isNull,p=n.delimit,q=n.isString,r=0;j>r;++r)a=i[r],b=p(a,"-"),c=h[a],q(c)&&!l.test(b)&&o(k[b])?"id"===b?(d.removeAttribute(b),e.setAttribute(b,c)):"multiple"===b?(m=!0,e.setAttribute(b,c)):"disabled"===b?(e.setAttribute(b,c),f.setAttribute(b,c),g.setAttribute(b,c)):e.setAttribute(b,c):b===K&&(e.setAttribute(b,c),f.setAttribute(b,c),g.setAttribute(b,c));if(o(this.innerTemplate))return void(g.textContent=m?"Select files":"Select a file");var s=this.innerTemplate.textContent.replace(/\r|\n/g,"");return n.isEmpty(s)?void(g.textContent=m?"Select files":"Select a file"):void(g.textContent=s)},b.prototype.loaded=function(){var a=this._hiddenInput=this._hiddenInput||this.element.firstElementChild.firstElementChild;this._visibleInput=this._visibleInput||a.nextElementSibling},b.prototype.validate=function(){return!this.utils.isEmpty(this._hiddenInput.value)},b.prototype.clear=function(){var a=this._hiddenInput;if(!this.utils.isEmpty(a.value)){var b=this._hiddenInput=a.cloneNode(!0);this.element.firstElementChild.replaceChild(b,a),this._visibleInput.value="",this.inputChanged(null)}},b.prototype.click=function(){this._selectFiles()},b.prototype.value=function(){var a=this._hiddenInput,b=a.files;if(!this.utils.isNull(b))return a.multiple?Array.prototype.slice.call(b):b[0]},b.prototype.disable=function(){var a="disabled",b=this._visibleInput;this._hiddenInput.setAttribute(a,a),b.setAttribute(a,a),b.nextElementSibling.setAttribute(a,a),this.element.setAttribute(a,a)},b.prototype.enable=function(){var a="disabled",b=this._visibleInput;this._hiddenInput.removeAttribute(a),b.removeAttribute(a),b.nextElementSibling.removeAttribute(a),this.element.removeAttribute(a)},b.prototype.observeProperties=function(a){a.observeProperty(this._setBoundProperty)},b.prototype._setBoundProperty=function(a,b,c,d){var e=this.utils;if(e.isUndefined(a))return void this.inputChanged(null);var f=this._hiddenInput,g=f.files;if(!e.isNull(g))return f.multiple?void this.inputChanged(Array.prototype.slice.call(g)):void(a!==g[0]&&this.inputChanged(g[0]))},b.prototype._onKeyDown=function(a){var b=a.keyCode,c=plat.controls.KeyCodes;return b===c.tab?!0:((b===c.backspace||b===c.delete)&&this.clear(),a.preventDefault(),!1)},b.prototype._selectFiles=function(){this._hiddenInput.click()},b.prototype._filesSelected=function(){var a=this._hiddenInput,b=this._visibleInput,c=a.files;if(!this.utils.isNull(c)){if(!a.multiple){var d=c[0];return b.value=d.name,void this.inputChanged(d)}for(var e=[],f=c.length,g=0;f>g;++g)e.push(c[g].name);b.value=e.join(", "),this.inputChanged(Array.prototype.slice.call(c))}},b._inject={_compat:d},b}(plat.ui.BindControl);a.File=sa,plat.register.control(A,sa);var ta=function(a){function b(){a.apply(this,arguments),this.templateString='\n',this._listeners=[],this._isVertical=!1,this._hasSwiped=!1,this._inTouch=!1,this._hasMoved=!1,this._lastTouch={x:0,y:0},this._loaded=!1,this._index=-1,this._previousIndex=-1,this._nextIndex=-1,this._currentOffset=0,this._removeInterval=ea,this._removeSuspend=ea,this._isAuto=!1,this._isPaused=!1,this._selfPause=!1,this._itemNodes=[],this._removeListeners=[],this._outerStart=!1,this._outerEnd=!1,this._goToIntervalConstant=125}return __extends(b,a),Object.defineProperty(b.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0}),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,B+" "+(a||""))},b.prototype.contextChanged=function(a,b){var c=this.utils;return c.isFunction(this._onLoad)?(c.isArray(a)?this._setListener():(this._log.debug(this.type+" context set to something other than an Array."),a=[]),this._executeEvent([{object:a,type:"splice"}]),void this._initializeIndex(0)):void this.loaded()},b.prototype.initialize=function(){this.setClasses()},b.prototype.setTemplate=function(){var a=this._document.createElement("div");a.className="plat-carousel-item",a.appendChild(this.innerTemplate),this.bindableTemplates.add("item",a)},b.prototype.loaded=function(){var a=this,b=this.utils,c=this.context;if(!b.isArray(c))return void this._log.warn("The context of a "+this.type+" must be an Array.");this._animate=!1;var d=this.options||{},e=d.value||{},f=e.index,g=b.isNumber,h=this._validateOrientation(e.orientation),i=e.interval,j=this._interval=g(i)?Math.abs(i):3e3,k=e.suspend,l=this._viewport=this.element.firstElementChild;this._container=l.firstElementChild,this._type=e.type||"track swipe",this._isInfinite=e.infinite===!0,this._suspend=Math.abs(g(k)?j-k:j-3e3),this.dom.addClass(this.element,m+h),this._onLoad=function(){var b=a._index;f=g(f)&&f>=0?fe;++e)c[e](a,b)},b.prototype.observeProperties=function(a){a.observeProperty(this._setBoundProperty)},b.prototype._setBoundProperty=function(a,b,c,d){var e=this.utils;if(e.isNull(a)){if(d===!0)return this._index=0,void this.inputChanged(0,a)}else if(e.isNumber(a)){if(0>a)return this._index=0,this.inputChanged(0,a),void this._initializeIndex(0)}else if(a=Number(a),!e.isNumber(a))return void this._log.debug(this.type+" has it's index bound to a property that cannot be interpreted as a Number.");return this._loaded?void this._goToIndex(a,!0,d===!0):void(this._index=a)},b.prototype._reset=function(){var a={};a[this._transform]=this._calculateStaticTranslation(0),this._initiateAnimation({properties:a})},b.prototype._verifyLength=function(){var a=this.context,b=this._index;if(!this.utils.isArray(a)||0===a.length)return this.utils.isUndefined(b)||this.inputChanged(this._index=void 0,b),this._container.style[this._transform]=this._calculateStaticTranslation(-this._currentOffset),this._removeEventListeners(),void this._checkArrows();var c=a.length-1;return b>c?void this.goToIndex(c):void this._checkArrows()},b.prototype._setIndexWindow=function(){var a=this._index,b=this._itemNodes.length-1;0>b?this._previousIndex=this._nextIndex=b:a>=b?(a>b&&(a=this._index=b),this._previousIndex=a-1,this._nextIndex=this._isInfinite?0:-1):0>=a?(0>a&&(a=this._index=0),this._previousIndex=this._isInfinite?b:-1,this._nextIndex=a+1):(this._previousIndex=a-1,this._nextIndex=a+1)},b.prototype._goToNext=function(a){var b=this;return this._Promise.all(this._addQueue).then(function(){var c=b._index,d=!1;if(c>=b._itemNodes.length-1&&!(d=b._isInfinite))return b._isAuto&&!b._isPaused&&(b.pause(),b._selfPause=!0),b._Promise.resolve(!1);var e=b._getLength();return e?b._cancelCurrentAnimations().then(function(){b._outerEnd||b._initializeOuterNodes();var f={};f[b._transform]=b._calculateStaticTranslation(-e); +b=X+"up"):(a=X+"right",b=X+"left"),this.addEventListener(d,T,this._touchStart,!1),this.addEventListener(d,a,e,!1),this.addEventListener(d,b,e,!1),this.addEventListener(d,U,f,!1),this.addEventListener(d,Y,f,!1),this.addEventListener(this._window,"resize",function(){c._setLength(),c._setKnob()},!1)},b.prototype._touchStart=function(a){var b=this;if(1!==this._touchState){this._touchState=1,this._lastTouch={x:a.clientX,y:a.clientY,value:this.value};var c=a.target;if(c!==this._knob){var d;d=this._isVertical?c===this.element?this._reversed?a.offsetY-this._sliderOffset:this._maxOffset-(a.offsetY-this._sliderOffset):c===this._slider?this._reversed?a.offsetY:this._knobOffset-a.offsetY:this._reversed?a.offsetY:this._maxOffset-a.offsetY:c===this.element?this._reversed?this._maxOffset-(a.offsetX-this._sliderOffset):a.offsetX-this._sliderOffset:c===this._slider?this._reversed?this._knobOffset-a.offsetX:a.offsetX:this._reversed?this._maxOffset-a.offsetX:a.offsetX,this.utils.requestAnimationFrame(function(){b._knobOffset=b._setSliderProperties(d)})}}},b.prototype._touchEnd=function(a){var b=this;if(1!==this._touchState)return void(this._touchState=0);this._touchState=2;var c=this._calculateOffset(a),d=this._maxOffset;this.utils.requestAnimationFrame(function(){return b._touchState=0,b._lastTouch.value!==b.value&&b._trigger("change"),0>c?void(b._knobOffset=0):c>d?void(b._knobOffset=d):void(b._knobOffset=c)})},b.prototype._track=function(a){var b=this;0!==this._touchState&&this.utils.requestAnimationFrame(function(){b._setSliderProperties(b._calculateOffset(a))})},b.prototype._setSliderProperties=function(a){var b,c=this._maxOffset;if(0>=a){if(b=this.min,b-this.value>=0)return;a=0}else if(a>=c){if(b=this.max,b-this.value<=0)return;a=c}else b=this._calculateValue(a);return this._setValueProperty(b,!1,!0),this._slider.style[this._lengthProperty]=a+"px",a},b.prototype._calculateValue=function(a){var b=this._step;return this.min+Math.round(a/this._increment/b)*b},b.prototype._calculateKnobPosition=function(a){return(a-this.min)*this._increment},b.prototype._calculateOffset=function(a){return this._isVertical?this._reversed?this._knobOffset+a.clientY-this._lastTouch.y:this._knobOffset+this._lastTouch.y-a.clientY:this._reversed?this._knobOffset+this._lastTouch.x-a.clientX:this._knobOffset+a.clientX-this._lastTouch.x},b.prototype._setLength=function(a){var b=this.utils.isNode(a),c=b?a:this._slider.parentElement;return this._isVertical?(this._lengthProperty="height",this._maxOffset=c.clientHeight,this._sliderOffset=c.offsetTop):(this._lengthProperty="width",this._maxOffset=c.clientWidth,this._sliderOffset=c.offsetLeft),b||this._maxOffset?void this._setIncrement():void this._setOffsetWithClone(this._lengthProperty)},b.prototype._setIncrement=function(){return this._increment=this._maxOffset/(this.max-this.min)},b.prototype._setValueProperty=function(a,b,c){var d=this.value;if(a!==d){if(a>=this.max)a=this.max;else if(a<=this.min)a=this.min;else if(Math.abs(a-d)0;this._cloneAttempts=0;var g,h,i=b.cloneNode(!0),k=/\d+(?!\d+|%)/,l=this._window,m=[],n=i,o="important",p=this.utils.isNull;for(n.id="";!k.test(h=(g=l.getComputedStyle(b))[a]);){if("none"===g.display&&n.style.setProperty("display","block",o),n.style.setProperty(a,h,o),b=b.parentElement,p(b))return this._log.debug("The document's body contains a "+this.type+" that needs its length and is currently hidden. Please do not set the body's display to none."),void this.utils.defer(this._setOffsetWithClone,100,[a],this);n=b.cloneNode(!1),n.id="",m.push(n)}if(m.length>0){for(var q,r=m.pop();m.length>0;)q=m.pop(),r.insertBefore(q,null),r=q;r.insertBefore(i,null)}var s=n.style;s.setProperty(a,h,o),s.setProperty("visibility","hidden",o),c.appendChild(n),this._setLength(i.firstElementChild),c.removeChild(n),f&&this._setKnob()},b._inject={_document:g,_window:f,_animator:h},b}(plat.ui.BindControl);a.Slider=oa,plat.register.control(w,oa);var pa=function(a){function b(){a.apply(this,arguments),this.templateString='
\n
\n
\n
\n
\n
\n',this._isVertical=!1,this._touchState=0,this._cloneAttempts=0,this._maxCloneAttempts=25}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,x+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b.prototype.loaded=function(){var a=this.element,b=this._slider=a.firstElementChild.firstElementChild,c=this.utils,d=c.isNumber,e=this.options||{},f=e.value||{},g=Number(f.lower),h=Number(f.upper),i=f.identifiers||{},j=f.min,k=f.max,l=f.step,n=this._reversed=f.reverse===!0,o=this.min=d(j)?Math.floor(j):0,p=this.max=d(k)?Math.ceil(k):100,q=d(g)?Math.round(g):o,r=d(h)?Math.round(h):p,s=m+this._validateOrientation(f.orientation);if(this._lowerKnob=b.firstElementChild,this._upperKnob=b.lastElementChild,this._lowerIdentifier=i.lower||"lower",this._upperIdentifier=i.upper||"upper",n){var t=this._lowerKnob;this._lowerKnob=this._upperKnob,this._upperKnob=t,s+=ba}this.dom.addClass(a,s),this.lower=o,this.upper=p,this._step=d(l)&&l>0?Math.round(l):1,o>=p&&(this._log.debug('"'+this.type+"'s\" min is greater than or equal to its max. Setting max to min + 1."),this.max=o+1),this._setPositionAndLength(),this._setLowerKnobPosition(o),this._initializeEvents(),this.setLower(q),this.setUpper(r)},b.prototype.setLower=function(a){this._setLower(a,!0)},b.prototype.setUpper=function(a){this._setUpper(a,!0)},b.prototype.observeProperties=function(a){a.observeProperty(this._setLowerBoundProperty,this._lowerIdentifier),a.observeProperty(this._setUpperBoundProperty,this._upperIdentifier)},b.prototype._setLowerBoundProperty=function(a,b,c,d){d===!0&&this.utils.isNull(a)&&this._fireChange(),this._setLower(a,!1)},b.prototype._setUpperBoundProperty=function(a,b,c,d){d===!0&&this.utils.isNull(a)&&this._fireChange(),this._setUpper(a,!1)},b.prototype._setLower=function(a,b){var c=this.utils;if(2===this._touchState)return void this._log.debug("Cannot set the value of the "+this.type+"'s lower knob while the user is manipulating it.");if(c.isNull(a)&&(a=this.min),!c.isNumber(a)){var d=Number(a);if(!c.isNumber(d))return;a=d}this._setLowerValue(a,!0,b,!0)},b.prototype._setUpper=function(a,b){var c=this.utils;if(3===this._touchState)return void this._log.debug("Cannot set the upper value of the "+this.type+"'s upper knob while the user is manipulating it.");if(c.isNull(a)&&(a=this.max),!c.isNumber(a)){var d=Number(a);if(!c.isNumber(d))return;a=d}this._setUpperValue(a,!0,b,!0)},b.prototype._initializeEvents=function(){var a,b,c=this,d=this._lowerKnob,e=this._upperKnob,f=this._touchStart,g=this._touchEnd,h=this._trackLower,i=this._trackUpper;this._isVertical?(a=X+"down",b=X+"up"):(a=X+"right",b=X+"left"),this.addEventListener(d,T,f,!1),this.addEventListener(e,T,f,!1),this.addEventListener(d,a,h,!1),this.addEventListener(d,b,h,!1),this.addEventListener(e,a,i,!1),this.addEventListener(e,b,i,!1),this.addEventListener(d,U,g,!1),this.addEventListener(e,U,g,!1),this.addEventListener(d,Y,g,!1),this.addEventListener(e,Y,g,!1),this.addEventListener(this._window,"resize",function(){c._setPositionAndLength(),c._setLowerKnobPosition(),c._setUpperKnobPosition()},!1)},b.prototype._touchStart=function(a){var b=this._touchState;if(1!==b&&2!==b&&3!==b){this._touchState=1;var c=a.currentTarget,d=this._lastTouch;this.utils.isNull(d)?c.style.zIndex="1":d.target!==c&&(d.target.style.zIndex="0",c.style.zIndex="1"),this._lastTouch={x:a.clientX,y:a.clientY,value:c===this._lowerKnob?this.lower:this.upper,target:c}}},b.prototype._touchEnd=function(a){var b=this,c=this._touchState;if(0===c||4===c)return void(this._touchState=0);this._touchState=4;var d=this._lastTouch,e=a.currentTarget;this.utils.isNull(d)||d.target!==e||this.utils.requestAnimationFrame(function(){b._touchState=0;var c=e===b._lowerKnob,f=b._calculateOffset(a,c);c?d.value!==b.lower&&b._trigger("change"):d.value!==b.upper&&b._trigger("change"),b._setOffset(f,c)})},b.prototype._setOffset=function(a,b){var c=this._maxOffset;return 0>a?b?this._lowerKnobOffset=0:this._upperKnobOffset=0:a>c?b?this._lowerKnobOffset=c:this._upperKnobOffset=c:b?this._lowerKnobOffset=a:this._upperKnobOffset=a},b.prototype._trackLower=function(a){var b=this._touchState;if(2!==b)if(1===b)this._touchState=2;else if(0===b||3===b)return;var c,d=this._maxOffset,e=this._calculateOffset(a,!0);return 0>=e?(c=this.min,c-this.lower>=0&&(c=null),e=0):e>=d?(c=this.max,c-this.lower<=0&&(c=null),e=d):(c=this._calculateValue(e),c-this.lower===0&&(c=null)),e>this._upperKnobOffset?(this._positionTogether(e,c),void this._setOffset(e,!1)):void this._positionLower(e,c)},b.prototype._trackUpper=function(a){var b=this._touchState;if(3!==b)if(1===b)this._touchState=3;else if(0===b||2===b)return;var c,d=this._maxOffset,e=this._calculateOffset(a,!1);return 0>=e?(c=this.min,c-this.upper>=0&&(c=null),e=0):e>=d?(c=this.max,c-this.upper<=0&&(c=null),e=d):(c=this._calculateValue(e),c-this.upper===0&&(c=null)),e=this.max)a=this.max;else if(a<=this.min)a=this.min;else if(Math.abs(a-e)=this.max)a=this.max;else if(a<=this.min)a=this.min;else if(Math.abs(a-e)0;this._cloneAttempts=0;var g,h,i=b.cloneNode(!0),k=/\d+(?!\d+|%)/,l=this._window,m=[],n=i,o="important",p=this.utils.isNull;for(n.id="";!k.test(h=(g=l.getComputedStyle(b))[a]);){if("none"===g.display&&n.style.setProperty("display","block",o),n.style.setProperty(a,h,o),b=b.parentElement,p(b))return this._log.debug("The document's body contains a "+this.type+" that needs its length and is currently hidden. Please do not set the body's display to none."),void this.utils.defer(this._setOffsetWithClone,100,[a],this);n=b.cloneNode(!1),n.id="",m.push(n)}if(m.length>0){for(var q,r=m.pop();m.length>0;)q=m.pop(),r.insertBefore(q,null),r=q;r.insertBefore(i,null)}var s=n.style;s.setProperty(a,h,o),s.setProperty("visibility","hidden",o),c.appendChild(n),this._setPositionAndLength(i.firstElementChild),c.removeChild(n),f&&(this._setLowerKnobPosition(),this._setUpperKnobPosition())},b._inject={_document:g,_window:f,_animator:h},b}(plat.ui.BindControl);a.Range=pa,plat.register.control(x,pa);var qa=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,y+" "+(a||""))},b.prototype.initialize=function(){a.prototype.initialize.call(this),this.setClasses()},b}(plat.ui.controls.Select);a.Select=qa,plat.register.control(y,qa);var ra=function(a){function b(){a.apply(this,arguments),this.templateString='
\n \n \n \n \n \n
\n',this.value="",this._inTouch=!1,this._inAction=!1}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,z+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b.prototype.setTemplate=function(){for(var a,b,c,d=this.element,e=this._imageElement=d.firstElementChild.firstElementChild,f=this._inputElement=e.nextElementSibling,g=this.attributes,h=Object.keys(g),i=h.length,j=plat.dependency.injectors.control,k=!1,l=/plat-(?:control|hide|context)|class|style/,m=this.utils,n=m.isNull,o=m.delimit,p=m.isString,q=0;i>q;++q)a=h[q],b=o(a,"-"),c=g[a],p(c)&&!l.test(b)&&n(j[b])?"id"===b?(d.removeAttribute(b),f.setAttribute(b,c)):"placeholder"===b?(k=!0,f.placeholder=c):f.setAttribute(b,c):(b===K||b===L)&&f.setAttribute(b,c);if(!k&&!n(this.innerTemplate)){var r=this.innerTemplate.textContent.replace(/\r|\n/g,"");m.isEmpty(r)||(f.placeholder=r)}},b.prototype.loaded=function(){var a=this,b=this.options||{},c=b.value||{},d=this.element,e=this._type=this.attributes.type||c.type||"text",f=c.pattern,g=c.validation,h=this.utils,i=h.isString;this._imageElement=this._imageElement||d.firstElementChild.firstElementChild,this._inputElement=this._inputElement||this._imageElement.nextElementSibling,this.dom.addClass(d,m+e);var j=this._inputElement.nextElementSibling;this.addEventListener(j,U,function(){a._inputElement.focus()},!1),this._actionElement=j.firstElementChild,i(f)&&""!==f&&("/"===f[0]&&"/"===f[f.length-1]&&(f=f.slice(1,-1)),this._pattern=new RegExp(f)),i(g)&&""!==g&&("/"===g[0]&&"/"===g[g.length-1]&&(g=g.slice(1,-1)),this._validation=new RegExp(g)),this._initializeType()},b.prototype.validate=function(){return this._validation.test(this._inputElement.value)},b.prototype.clear=function(){var a=this._inputElement,b=a.value;if(""!==b){var c=this._actionElement;a.value=this.value="",this.inputChanged(this.value,b),c.textContent=this._typeChar="",c.setAttribute(E,"")}},b.prototype.focus=function(){this._inputElement.focus()},b.prototype.blur=function(){this._inputElement.blur()},b.prototype.observeProperties=function(a){a.observeProperty(this._setBoundProperty)},b.prototype._setBoundProperty=function(a,b,c,d){var e=this._inputElement.value;if(this.utils.isNull(a)){if(a="",d===!0)return void(this.utils.isNull(e)&&this._onInputChanged(a))}else if(a===e)return;this._onInputChanged(a)},b.prototype._initializeType=function(){var a=this._type,b=S,c=this._actionElement;switch(a){case"text":this._pattern=this._pattern||/[\S\s]*/,this._validation=this._validation||this._pattern,this._actionHandler=this._checkText.bind(this),this._typeHandler=this._erase;break;case"email":this._pattern=this._pattern||/[\S\s]*/,this._validation=this._validation||this._regex.validateEmail,this._actionHandler=this._checkEmail.bind(this),this._typeHandler=this._handleEmail;break;case"password":var d=this._handlePasswordHide;this._pattern=this._pattern||/[\S\s]*/,this._validation=this._validation||this._pattern,this._actionHandler=this._checkPassword.bind(this),this._typeHandler=this._handlePasswordShow,this.addEventListener(c,U,d),this.addEventListener(c,Y,d),b=T;break;case"tel":case"telephone":this._pattern=this._pattern||this._regex.validateTelephone,this._validation=this._validation||this._pattern,this._actionHandler=this._checkText.bind(this),this._typeHandler=this._erase;break;case"number":this._pattern=this._pattern||/^[0-9\.,]*$/,this._validation=this._validation||this._pattern,this._actionHandler=this._checkText.bind(this),this._typeHandler=this._erase,a="tel";break;case"hidden":return void this.element.setAttribute(E,"");case"radio":return void this._log.debug(a+" is not supported by "+this.type+". Please use a "+u+" instead.");case"checkbox":return void this._log.debug(a+" is not supported by "+this.type+". Please use a "+o+" instead.");case"range":return void this._log.debug(a+" is not supported by "+this.type+". Please use a "+w+" instead.");case"file":return void this._log.debug(a+" is not supported by "+this.type+". Please use a "+A+" instead.");default:this._log.debug(a+" is not yet fully supported by "+this.type+'. Defaulting to type="text".'),a="text",this._pattern=this._pattern||/[\S\s]*/,this._validation=this._validation||this._pattern,this._actionHandler=this._checkText.bind(this),this._typeHandler=this._erase}this._inputElement.type=a,c.textContent=this._typeChar="",c.setAttribute(E,""),this._addEventListeners(b)},b.prototype._addEventListeners=function(a){var b=this,c=this._actionElement,d=this._inputElement,e=function(){return b._inAction=!1};this.addEventListener(c,a,this._typeHandler,!1),this.addEventListener(c,T,function(){return b._inAction=!0},!1),this.addEventListener(c,U,e,!1),this.addEventListener(c,Y,e,!1),this.addEventListener(d,"focus",function(){""!==b.value&&c.removeAttribute(E)},!1),this.addEventListener(d,"blur",function(a){b._inAction||c.setAttribute(E,"")},!1),this._addTextEventListener()},b.prototype._addTextEventListener=function(){var a,b=this,c=this._inputElement,d=this._compat,e=this.utils,f=!1,g=function(){f||b._onInput()},h=function(){e.isFunction(a)||(a=e.postpone(function(){g(),a=null}))};e.isUndefined(d.ANDROID)&&(this.addEventListener(c,"compositionstart",function(){return f=!0},!1),this.addEventListener(c,"compositionend",function(){f=!1,g()},!1)),d.hasEvent("input")?this.addEventListener(c,"input",g,!1):(this.addEventListener(c,"keydown",function(a){var d=a.keyCode;if(!(91===d||92===d||d>15&&28>d||d>32&&41>d)){var e=b._pattern,f=a.char;return e.test(f)&&e.test(c.value+f)?void h():void a.preventDefault()}},!1),this.addEventListener(c,"cut",h,!1),this.addEventListener(c,"paste",h,!1)),this.addEventListener(c,"change",g,!1)},b.prototype._erase=function(){this.clear(),this.focus()},b.prototype._handlePasswordShow=function(){this._inTouch=!0,this._inputElement.type="text"},b.prototype._handlePasswordHide=function(){if(this._inTouch){this._inTouch=!1;var a=this._inputElement;a.type=this._type,a.focus()}},b.prototype._handleEmail=function(){var a=this._inputElement,b=a.value,c=this._typeChar;a.value=this.value="x"===c?"":b+c,this.inputChanged(this.value,b),this._checkEmail(),a.focus()},b.prototype._checkText=function(){var a=this._typeChar;"x"===a?""===this.value&&(this._typeChar=""):""!==this.value&&(this._typeChar="x");var b=this._typeChar;if(a!==b){var c=this._actionElement;if(c.textContent=b,""===b)return void c.setAttribute(E,"");c.removeAttribute(E)}},b.prototype._checkPassword=function(){var a=this._typeChar;"?"===a?""===this.value&&(this._typeChar=""):""!==this.value&&(this._typeChar="?");var b=this._typeChar;if(a!==b){var c=this._actionElement;if(c.textContent=b,""===b)return void c.setAttribute(E,"");c.removeAttribute(E)}},b.prototype._checkEmail=function(){var a=this._inputElement.value,b=this._typeChar;switch(b){case"@":if(-1!==a.indexOf("@")){if(-1!==a.indexOf(".com")){this._typeChar="x";break}this._typeChar=".com"}break;case".com":-1===a.indexOf("@")?this._typeChar="@":-1!==a.indexOf(".com")&&(this._typeChar="x");break;case"x":""===a?this._typeChar="":-1===a.indexOf("@")?this._typeChar="@":-1===a.indexOf(".com")&&(this._typeChar=".com");break;default:""===a?this._typeChar="":-1===a.indexOf("@")&&(this._typeChar="@")}var c=this._typeChar;if(b!==c){var d=this._actionElement;if(d.textContent=c,""===c)return void d.setAttribute(E,"");d.removeAttribute(E)}},b.prototype._onInput=function(){var a=this._inputElement,b=a.value,c=this._stripInput(a.value);b!==c&&(b=a.value=c),b!==this.value&&(this.value=a.value,this.inputChanged(this.value),this._actionHandler())},b.prototype._onInputChanged=function(a){var b=this._inputElement;a=this._stripInput(a),b.value=a,this.value=b.value,this._actionHandler()},b.prototype._stripInput=function(a){for(var b,c="",d=c,e=this._pattern,f=a.length,g=0;f>g;++g)b=a[g],e.test(b)&&(c+=b,e.test(c)?d=c:c=d);return c},b._inject={_compat:d,_regex:e},b}(plat.ui.BindControl);a.Input=ra,plat.register.control(z,ra);var sa=function(a){function b(){a.apply(this,arguments),this.templateString='
\n \n \n \n
\n'}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,A+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b.prototype.setTemplate=function(){for(var a,b,c,d=this.element,e=this._hiddenInput=d.firstElementChild.firstElementChild,f=this._visibleInput=e.nextElementSibling,g=f.nextElementSibling,h=this.attributes,i=Object.keys(h),j=i.length,k=plat.dependency.injectors.control,l=/plat-(?:control|hide|context)|class|style/,m=!1,n=this.utils,o=n.isNull,p=n.delimit,q=n.isString,r=0;j>r;++r)a=i[r],b=p(a,"-"),c=h[a],q(c)&&!l.test(b)&&o(k[b])?"id"===b?(d.removeAttribute(b),e.setAttribute(b,c)):"multiple"===b?(m=!0,e.setAttribute(b,c)):"disabled"===b?(e.setAttribute(b,c),f.setAttribute(b,c),g.setAttribute(b,c)):e.setAttribute(b,c):b===K&&(e.setAttribute(b,c),f.setAttribute(b,c),g.setAttribute(b,c));if(o(this.innerTemplate))return void(g.textContent=m?"Select files":"Select a file");var s=this.innerTemplate.textContent.replace(/\r|\n/g,"");return n.isEmpty(s)?void(g.textContent=m?"Select files":"Select a file"):void(g.textContent=s)},b.prototype.loaded=function(){var a=this._hiddenInput=this._hiddenInput||this.element.firstElementChild.firstElementChild;this._visibleInput=this._visibleInput||a.nextElementSibling},b.prototype.validate=function(){return!this.utils.isEmpty(this._hiddenInput.value)},b.prototype.clear=function(){var a=this._hiddenInput;if(!this.utils.isEmpty(a.value)){var b=this._hiddenInput=a.cloneNode(!0);this.element.firstElementChild.replaceChild(b,a),this._visibleInput.value="",this.inputChanged(null)}},b.prototype.click=function(){this._selectFiles()},b.prototype.value=function(){var a=this._hiddenInput,b=a.files;if(!this.utils.isNull(b))return a.multiple?Array.prototype.slice.call(b):b[0]},b.prototype.disable=function(){var a="disabled",b=this._visibleInput;this._hiddenInput.setAttribute(a,a),b.setAttribute(a,a),b.nextElementSibling.setAttribute(a,a),this.element.setAttribute(a,a)},b.prototype.enable=function(){var a="disabled",b=this._visibleInput;this._hiddenInput.removeAttribute(a),b.removeAttribute(a),b.nextElementSibling.removeAttribute(a),this.element.removeAttribute(a)},b.prototype.observeProperties=function(a){a.observeProperty(this._setBoundProperty)},b.prototype._setBoundProperty=function(a,b,c,d){var e=this.utils;if(e.isUndefined(a))return void this.inputChanged(null);var f=this._hiddenInput,g=f.files;if(!e.isNull(g))return f.multiple?void this.inputChanged(Array.prototype.slice.call(g)):void(a!==g[0]&&this.inputChanged(g[0]))},b.prototype._onKeyDown=function(a){var b=a.keyCode,c=plat.controls.KeyCodes;return b===c.tab?!0:((b===c.backspace||b===c.delete)&&this.clear(),a.preventDefault(),!1)},b.prototype._selectFiles=function(){this._hiddenInput.click()},b.prototype._filesSelected=function(){var a=this._hiddenInput,b=this._visibleInput,c=a.files;if(!this.utils.isNull(c)){if(!a.multiple){var d=c[0];return b.value=d.name,void this.inputChanged(d)}for(var e=[],f=c.length,g=0;f>g;++g)e.push(c[g].name);b.value=e.join(", "),this.inputChanged(Array.prototype.slice.call(c))}},b._inject={_compat:d},b}(plat.ui.BindControl);a.File=sa,plat.register.control(A,sa);var ta=function(a){function b(){a.apply(this,arguments),this.templateString='\n',this._listeners=[],this._isVertical=!1,this._hasSwiped=!1,this._inTouch=!1,this._hasMoved=!1,this._lastTouch={x:0,y:0},this._loaded=!1,this._index=-1,this._previousIndex=-1,this._nextIndex=-1,this._currentOffset=0,this._removeInterval=ea,this._removeSuspend=ea,this._isAuto=!1,this._isPaused=!1,this._selfPause=!1,this._itemNodes=[],this._removeListeners=[],this._outerStart=!1,this._outerEnd=!1,this._goToIntervalConstant=125}return __extends(b,a),Object.defineProperty(b.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0}),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,B+" "+(a||""))},b.prototype.contextChanged=function(a,b){var c=this.utils;return c.isFunction(this._onLoad)?(c.isArray(a)?this._setListener():(this._log.debug(this.type+" context set to something other than an Array."),a=[]),this._executeEvent([{object:a,type:"splice"}]),void this._initializeIndex(0)):void this.loaded()},b.prototype.initialize=function(){this.setClasses()},b.prototype.setTemplate=function(){var a=this._document.createElement("div");a.className="plat-carousel-item",a.appendChild(this.innerTemplate),this.bindableTemplates.add("item",a)},b.prototype.loaded=function(){var a=this,b=this.utils,c=this.context;if(!b.isArray(c))return void this._log.warn("The context of a "+this.type+" must be an Array.");this._animate=!1;var d=this.options||{},e=d.value||{},f=e.index,g=b.isNumber,h=this._validateOrientation(e.orientation),i=e.interval,j=this._interval=g(i)?Math.abs(i):3e3,k=e.suspend,l=this._viewport=this.element.firstElementChild;this._container=l.firstElementChild,this._type=e.type||"track swipe",this._isInfinite=e.infinite===!0,this._suspend=Math.abs(g(k)?j-k:j-3e3),this.dom.addClass(this.element,m+h),this._onLoad=function(){var b=a._index;f=g(f)&&f>=0?fe;++e)c[e](a,b)},b.prototype.observeProperties=function(a){a.observeProperty(this._setBoundProperty)},b.prototype._setBoundProperty=function(a,b,c,d){var e=this.utils;if(e.isNull(a)){if(d===!0)return this._index=0,void this.inputChanged(0,a)}else if(e.isNumber(a)){if(0>a)return this._index=0,this.inputChanged(0,a),void this._initializeIndex(0)}else if(a=Number(a),!e.isNumber(a))return void this._log.debug(this.type+" has it's index bound to a property that cannot be interpreted as a Number.");return this._loaded?void this._goToIndex(a,!0,d===!0):void(this._index=a)},b.prototype._reset=function(){var a={};a[this._transform]=this._calculateStaticTranslation(0),this._initiateAnimation({properties:a})},b.prototype._verifyLength=function(){var a=this.context,b=this._index;if(!this.utils.isArray(a)||0===a.length)return this.utils.isUndefined(b)||this.inputChanged(this._index=void 0,b),this._container.style[this._transform]=this._calculateStaticTranslation(-this._currentOffset),this._removeEventListeners(),void this._checkArrows();var c=a.length-1;return b>c?void this.goToIndex(c):void this._checkArrows()},b.prototype._setIndexWindow=function(){var a=this._index,b=this._itemNodes.length-1;0>b?this._previousIndex=this._nextIndex=b:a>=b?(a>b&&(a=this._index=b),this._previousIndex=a-1,this._nextIndex=this._isInfinite?0:-1):0>=a?(0>a&&(a=this._index=0),this._previousIndex=this._isInfinite?b:-1,this._nextIndex=a+1):(this._previousIndex=a-1,this._nextIndex=a+1)},b.prototype._goToNext=function(a){var b=this;return this._Promise.all(this._addQueue).then(function(){var c=b._index,d=!1;if(c>=b._itemNodes.length-1&&!(d=b._isInfinite))return b._isAuto&&!b._isPaused&&(b.pause(),b._selfPause=!0),b._Promise.resolve(!1);var e=b._getLength();return e?b._cancelCurrentAnimations().then(function(){b._outerEnd||b._initializeOuterNodes();var f={};f[b._transform]=b._calculateStaticTranslation(-e); var g,h=b._initiateAnimation({properties:f});return d?b._index=g=0:g=++b._index,a||b.inputChanged(b._index,c),h.then(function(){return b._handleNext(g,e),b._checkArrows(),!0})}):b.goToIndex(b._nextIndex,!0)})},b.prototype._goToPrevious=function(a){var b=this;return this._Promise.all(this._addQueue).then(function(){var c=b._index,d=!1;if(0>=c&&!(d=b._isInfinite))return b._Promise.resolve(!1);b._selfPause&&b.resume();var e=b._getLength();return e?b._cancelCurrentAnimations().then(function(){b._outerStart||b._initializeOuterNodes();var f={};f[b._transform]=b._calculateStaticTranslation(e);var g,h=b._initiateAnimation({properties:f});return d?b._index=g=b._itemNodes.length-1:g=--b._index,a||b.inputChanged(b._index,c),h.then(function(){return b._handlePrevious(g,-e),b._checkArrows(),!0})}):b.goToIndex(b._previousIndex,!0)})},b.prototype._goToIndex=function(a,b,c){var d=this;return this._Promise.all(this._addQueue).then(function(){var e=d._index;return d.utils.isUndefined(e)?(d._initializeIndex(0),d.inputChanged(d._index,a),d._isInfinite||(a0&&a===d._nextIndex?d._goToNext(b):a===d._previousIndex?d._goToPrevious(b):d._handleGoToIndex(a,b)})},b.prototype._handleGoToIndex=function(a,b){var c=this._index;if(a===c||0>a||a>=this.context.length)return this._Promise.resolve(!1);if(this._selfPause&&this.resume(),!this._getLength())return this._initializeIndex(a),this._Promise.resolve(!0);var d,e,f,g=this._Promise,h=this.utils.defer;a>c?(d=this._goToNext,e=a-c,this._isInfinite&&(f=this._itemNodes.length-a+c,e>f&&(d=this._goToPrevious,e=f))):(d=this._goToPrevious,e=c-a,this._isInfinite&&(f=this._itemNodes.length-c+a,e>f&&(d=this._goToNext,e=f))),d=d.bind(this);for(var i=[],j=this._removeListeners,k=this._goToIntervalConstant,l=0,m=function(a){var c=h(function(){var e=j.indexOf(c);-1!==e&&j.splice(e,1),a(d(b))},l+=Math.round(k/e));j.push(c)};--e>0;)i.push(new g(m));return i.push(d(b)),g.all(i).then(function(a){for(var b=!1;a.length>0&&!(b=b||a.pop()););return b})},b.prototype._handleNext=function(a,b){var c=this._isInfinite,d=this._itemNodes,e=d.length,f=this.utils.isNode;if(c&&(3>e||f(this._preClonedNode)||f(this._postClonedNode)))return void this._initializeIndex(a);var g=this._container;this._outerStart?(c||a>1)&&(this.dom.insertBefore(d[this._previousIndex],Array.prototype.slice.call(g.childNodes,0,3)),g.style[this._transform]=this._calculateStaticTranslation(b),this._forceRepaint(g)):this._outerStart=!0,this._setIndexWindow(),(c||e-1>a)&&g.insertBefore(d[this._nextIndex],null)},b.prototype._handlePrevious=function(a,b){var c=this._isInfinite,d=this._itemNodes,e=d.length,f=this.utils.isNode;if(c&&(3>e||f(this._preClonedNode)||f(this._postClonedNode)))return void this._initializeIndex(a);var g=this._container;this._outerEnd?(c||e-2>a)&&this.dom.insertBefore(d[this._nextIndex],Array.prototype.slice.call(g.childNodes,-3)):this._outerEnd=!0,this._setIndexWindow(),(c||a>0)&&(g.insertBefore(d[this._previousIndex],g.firstChild),g.style[this._transform]=this._calculateStaticTranslation(b),this._forceRepaint(g))},b.prototype._clearInnerNodes=function(){this._removeClones(),this._outerStart=this._outerEnd=!1;var a=this._itemNodes;if(0===a.length)return!1;var b=Array.prototype.slice.call(this._container.childNodes),c=this.dom.insertBefore;switch(b.length){case 9:c(a[this._previousIndex],b.splice(0,3)),c(a[this._nextIndex],b.splice(-3,3)),c(a[this._index],b);break;case 6:var d=this._nextIndex,e=this._index;if(0>d||d===e){c(a[e],b.splice(-3,3)),c(a[0===e?this._previousIndex+1:e-1],b);break}c(a[d],b.splice(-3,3)),c(a[e],b);break;case 3:c(a[this._index],b)}return!0},b.prototype._initializeIndex=function(a){var b=this._clearInnerNodes();if(0===this._itemNodes.length?a=-1:0>a&&(a=0),this._index=a,this._setIndexWindow(),!b)return!1;var c=this._container;return c.insertBefore(this._itemNodes[a],null),c.style[this._transform]=this._calculateStaticTranslation(-this._currentOffset),this._forceRepaint(c),this._initializeOuterNodes(),this._checkArrows(),!0},b.prototype._initializeOuterNodes=function(){var a=this._getLength();if(!a)return void(this._outerStart=this._outerEnd=!1);var b,c=this._itemNodes,d=this._container,e=c.length;if(1>=e){if(this._isInfinite)return void this._cloneForInfinite(-a)}else{var f=this.utils.isNode;this._outerEnd||(b=c[this._nextIndex],f(b)&&(d.insertBefore(b,null),this._outerEnd=!0)),e>2?!this._outerStart&&(this._isInfinite||this._index>0)&&(b=c[this._previousIndex],f(b)&&(d.insertBefore(b,d.firstChild),d.style[this._transform]=this._calculateStaticTranslation(-a),this._forceRepaint(d),this._outerStart=!0)):this._isInfinite&&this._cloneForInfinite(-a)}},b.prototype._initiateAnimation=function(a){return this._animationThenable=this._animator.animate(this._container,P,a)},b.prototype._init=function(){var a=this,b=this._addQueue,c=this.context.length;this._setAliases();var d=this._addItems(0,c,0).then(function(){var c=b.indexOf(d);-1!==c&&b.splice(c,1),a._onLoad()}).catch(function(){a._log.debug("An error occurred while processing the "+a.type+". Please ensure you're context is correct."),a._loaded=!1});b.push(d),this._setListener(),this._setTransform()},b.prototype._addEventListeners=function(){var a=this._type.split(" ");-1!==a.indexOf("tap")&&this._initializeTap(),-1!==a.indexOf("swipe")&&this._initializeSwipe(),-1!==a.indexOf("track")&&this._initializeTrack(),-1!==a.indexOf("auto")&&this._initializeAuto()},b.prototype._removeEventListeners=function(){for(var a=this._removeListeners;a.length>0;)a.pop()();this._isAuto&&(this._removeInterval(),this._removeInterval=ea,this._removeSuspend(),this._removeSuspend=ea),this._isInfinite&&this._removeClones()},b.prototype._cloneForInfinite=function(a){this._removeClones();var b=this.context;if(this.utils.isArray(b)&&0!==b.length){var c=this._outerStart,d=this._outerEnd;if(!c||!d){var e=this._container;if(!d){var f=this._postClonedNode=e.firstElementChild.cloneNode(!0);e.insertBefore(f,null),this._outerEnd=!0}if(!c){var g=this._preClonedNode=e.lastElementChild.cloneNode(!0);e.insertBefore(g,e.firstChild),e.style[this._transform]=this._calculateStaticTranslation(a),this._forceRepaint(e),this._outerStart=!0}}}},b.prototype._removeClones=function(){var a=this._container,b=this._preClonedNode,c=this._postClonedNode,d=this.utils.isNode;d(b)&&a.contains(b)&&a.removeChild(b),d(c)&&a.contains(c)&&a.removeChild(c),this._preClonedNode=this._postClonedNode=null},b.prototype._initializeAuto=function(){this._isAuto=!0,this._initiateInterval()},b.prototype._initiateInterval=function(){this._removeInterval=this.utils.setInterval(this.goToNext,this._interval,null,this)},b.prototype._suspendInterval=function(){var a=this;this._isAuto&&!this._isPaused&&(this._removeSuspend(),this._removeInterval(),this._removeSuspend=this.utils.defer(function(){a._initiateInterval(),a._removeSuspend=ea},this._suspend))},b.prototype._initializeTap=function(){var a=this;this.utils.isNode(this._forwardArrow)||this._createArrowElements();var b=this._removeListeners;b.push(this.addEventListener(this._backArrow,S,function(){a._suspendInterval(),a.goToPrevious()},!1)),b.push(this.addEventListener(this._forwardArrow,S,function(){a._suspendInterval(),a.goToNext()},!1)),this._checkArrows()},b.prototype._createArrowElements=function(){var a=this._document,b=this._viewport,c=this._backArrow=a.createElement("div"),d=this._forwardArrow=a.createElement("div"),e=a.createElement("span"),f=a.createElement("span");this._isVertical?(e.className=m+"icon-arrow-up",f.className=m+"icon-arrow-down"):(e.className=m+"icon-arrow-left",f.className=m+"icon-arrow-right"),c.className=m+"back-arrow",d.className=m+"forward-arrow",c.appendChild(e),d.appendChild(f),b.appendChild(c),b.appendChild(d)},b.prototype._checkArrows=function(){var a=this.utils,b=a.isNode;if(!this._isInfinite&&b(this._forwardArrow)&&b(this._backArrow)){var c=this.context.length,d=this._index;if(a.isNull(d))return this._backArrow.setAttribute(E,""),void this._forwardArrow.setAttribute(E,"");0>=d?this._backArrow.setAttribute(E,""):this._backArrow.removeAttribute(E),d>=c-1?this._forwardArrow.setAttribute(E,""):this._forwardArrow.removeAttribute(E)}},b.prototype._initializeSwipe=function(){var a,b,c=this._viewport,d=this._handleSwipe;this._isVertical?(a=W+"up",b=W+"down"):(a=W+"left",b=W+"right");var e=this._removeListeners;e.push(this.addEventListener(c,a,d,!1)),e.push(this.addEventListener(c,b,d,!1))},b.prototype._initializeTrack=function(){var a,b,c=this._viewport,d=this._track,e=this._touchEnd;this._isVertical?(a=X+"up",b=X+"down"):(a=X+"left",b=X+"right");var f=this._removeListeners;f.push(this.addEventListener(c,a,d,!1)),f.push(this.addEventListener(c,b,d,!1)),f.push(this.addEventListener(c,T,this._touchStart,!1)),f.push(this.addEventListener(c,Y,e,!1)),f.push(this.addEventListener(c,U,e,!1))},b.prototype._handleSwipe=function(a){var b=a.direction.primary,c=!1;switch(b){case"left":!this._isVertical&&(this._isInfinite||this._index0)&&(this._suspendInterval(),c=!0,this.goToPrevious());break;case"up":this._isVertical&&(this._isInfinite||this._index0)&&(this._suspendInterval(),c=!0,this.goToPrevious());break;default:return}this._hasSwiped=c},b.prototype._touchStart=function(a){this._inTouch||(this._isAuto&&(this._removeInterval(),this._removeInterval=ea),this._inTouch=!0,this._hasMoved=!1,this._lastTouch={x:a.clientX,y:a.clientY})},b.prototype._touchEnd=function(a){var b=this,c=this._inTouch,d=this._hasMoved,e=this._hasSwiped;if(this._inTouch=this._hasSwiped=this._hasMoved=!1,c&&!e&&(this._isAuto&&!this._isPaused&&this._initiateInterval(),d)){var f=this._isVertical?a.clientY-this._lastTouch.y:a.clientX-this._lastTouch.x,g=this._getLength();return g&&Math.abs(f)>Math.ceil(g/2)?0>f?void this.goToNext().then(function(a){a||b._reset()}):void this.goToPrevious().then(function(a){a||b._reset()}):void this._reset()}},b.prototype._track=function(a){var b=this;this._inTouch&&(this._hasMoved||this._cancelCurrentAnimations().then(function(){b._outerStart&&b._outerEnd||b._initializeOuterNodes()}),this._hasMoved=!0,this.utils.requestAnimationFrame(function(){var c=b._calculateDynamicTranslation(a);null!==c&&(b._container.style[b._transform]=c)}))},b.prototype._calculateStaticTranslation=function(a){return this._isVertical?"translate3d(0,"+(this._currentOffset+=a)+"px,0)":"translate3d("+(this._currentOffset+=a)+"px,0,0)"},b.prototype._calculateDynamicTranslation=function(a){var b;return this._isVertical?(b=a.clientY-this._lastTouch.y,Math.abs(b)>this._getLength()?(this._touchEnd(a),null):"translate3d(0,"+(this._currentOffset+b)+"px,0)"):(b=a.clientX-this._lastTouch.x,Math.abs(b)>this._getLength()?(this._touchEnd(a),null):"translate3d("+(this._currentOffset+b)+"px,0,0)")},b.prototype._setTransform=function(){var a=this._container.style,b=this.utils.isUndefined,c=this._compat.vendorPrefix;b(a[c.lowerCase+"Transform"])?b(a[c.upperCase+"Transform"])?this._transform="transform":this._transform=c.upperCase+"Transform":this._transform=c.lowerCase+"Transform"},b.prototype._getLength=function(){return this._isVertical?this._viewport.offsetHeight:this._viewport.offsetWidth},b.prototype._validateOrientation=function(a){if(this.utils.isUndefined(a))return"horizontal";var b;return"horizontal"===a?b=a:"vertical"===a?(b=a,this._isVertical=!0):(this._log.debug('Invalid orientation "'+a+'" for '+this.type+'. Defaulting to "horizontal."'),b="horizontal"),b},b.prototype._appendItems=function(a){if(this._itemNodes=this._itemNodes.concat(a),this._loaded){if(0===this._removeListeners.length)return this._addEventListeners(),this._initializeIndex(0),void this.inputChanged(0,b);var b=this._index;b>=this._itemNodes.length-2&&this._initializeIndex(b)}},b.prototype._removeItems=function(a,b){for(var c=this._TemplateControlFactory.dispose,d=this.controls,e=this._itemNodes,f=a+b;f-->a;)c(d[f]),e.pop();this._updateResource(d.length-1),this._verifyLength()},b.prototype._cancelCurrentAnimations=function(){return this.utils.isNull(this._animationThenable)?this._Promise.resolve():this._animationThenable.cancel()},b.prototype._forceRepaint=function(a){var b=a.style,c=b.display,d="none";return b.display===d?void a.offsetWidth:(b.display=d,a.offsetWidth,void(b.display=c))},b._inject={_document:g,_window:f,_compat:d,_TemplateControlFactory:j},b}(plat.ui.controls.ForEach);a.Carousel=ta,plat.register.control(B,ta);var ua=function(a){function b(){var b=this;a.call(this),this.templateString='
\n
\n
\n
\n
\n',this._aliases={index:O.index,even:O.even,odd:O.odd,first:O.first,last:O.last,group:O.group},this._templates={},this._isVertical=!0,this._isLoading=!1,this._scrollPosition=0,this._isRefreshing=!1,this._touchState=0,this._hasMoved=!1,this._lastTouch={x:0,y:0},this._nodeNormalizeRegex=/-|\.|_/g,this._isGrouped=!1,this._cloneAttempts=0,this._maxCloneAttempts=25,this.__listenerSet=!1,this.itemsLoaded=new this._Promise(function(a){b.__resolveFn=a})}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,C+" "+(a||""))},b.prototype.initialize=function(){var a=this.options||(this.options={}),b=a.value||(a.value={});this.templateUrl=this.templateUrl||b.templateUrl,this.setClasses()},b.prototype.setTemplate=function(){if(this.utils.isString(this.templateUrl)){var a=this.dom.serializeHtml(this.templateString),b=this.element;this.innerTemplate=this.dom.appendChildren(b.childNodes),b.appendChild(a)}},b.prototype.contextChanged=function(a,b){this.utils.isArray(a)?this._setListener():(this._log.debug(this.type+" context set to something other than an Array."),a=[]),this._executeEvent([{object:a,type:"splice"}])},b.prototype.loaded=function(){var a=this.options.value,b=this.utils,c=b.isString,d=this.element,e=this._viewport=d.firstElementChild,f=this._scrollContainer=e.firstElementChild,g=this._loading=a.loading,h=this._animate=a.animate===!0,i=a.onItemsRequested,j=a.onRefresh,k=a.itemTemplate;if(this._container=f.firstElementChild,this.dom.addClass(d,m+this._validateOrientation(a.orientation)+(h?" "+m+"animated":"")),!c(k))return void this._log.debug("No item template or item template selector specified for "+this.type+".");var l=this._normalizeTemplateName(k),n=a.headerTemplate,o=c(n)?this._normalizeTemplateName(n):null;this._parseInnerTemplate(l,o),this._determineTemplates(k,l,o),this._defaultGroup={name:null,control:this,itemContainer:this._container,element:d,index:null,itemCount:0,addQueue:[],animationQueue:[]};var p=!1,q=!1;return c(g)&&(c(i)?(p=!0,this._determineLoading(i,a.infiniteProgress!==!1)):this._log.debug(this.type+' loading type specified as "'+g+'" but no option specifying an onItemsRequested handler.')),c(j)&&(q=!0,this._initializeRefresh(j)),this._initializeTracking(p,q),b.isArray(this.context)?(this._setAliases(),this.render(),void this._setListener()):void(b.isNull(this.context)||this._log.debug(this.type+"'s context must be an Array."))},b.prototype.dispose=function(){this.__resolveFn=null},b.prototype.render=function(a,b,c){var d=this.utils.isNumber,e=c||this._defaultGroup,f=e.control,g=this===f?this.context:f.context.items;d(a)||(a=0);var h=g.length-a,i=d(b)&&h>=b?b:h;this._createItems(a,i,e,0)},b.prototype.rerender=function(a){this.render(0,null,a)},b.prototype._childContextChanged=function(a,b,c){this._executeChildEvent(a,[{object:b||[],type:"splice"}])},b.prototype._setListener=function(){this.__listenerSet||(this.observeArray(this._executeEvent),this.__listenerSet=!0)},b.prototype._setAliases=function(){var a=this.options.value.aliases,b=this.utils;if(b.isObject(a))for(var c,d=this._aliases,e=b.isString,f=Object.keys(d),g=f.length,h=0;g>h;++h)c=a[f[h]],e(c)&&(d[f[h]]=c)},b.prototype._determineTemplates=function(a,b,c){var d,e=this.utils,f=this.bindableTemplates,g=this._templates;if(e.isString(c)&&(this._isGrouped=!0,this.dom.addClass(this._container,m+"grouped"),d=g[c],e.isNode(d)?(this._headerTemplate=c,this.bindableTemplates.add(c,d),delete g[c]):this._log.debug(C+' group header template "'+c+'" was not a template defined in the DOM.'),this._headerTemplatePromise=this._createGroupTemplate()),d=g[b],e.isNode(d))return this._itemTemplate=b,this.bindableTemplates.add(b,d),void delete g[b];var h=this.findProperty(a)||{};if(!e.isFunction(h.value))return void this._log.debug(C+' item template "'+a+'" was neither a template defined in the DOM nor a template selector function in its control hiearchy.');this._templateSelector=h.value.bind(h.control),this._templateSelectorKeys={};for(var i,j=Object.keys(g);j.length>0;)i=j.pop(),f.add(i,g[i]),delete g[i]},b.prototype._createGroupTemplate=function(){var a,b=this,c=this._document,d=this.bindableTemplates,e=this._headerTemplate,f=C+"-group",g=c.createElement("div"),h=c.createElement("div");return g.className=f,h.className=C+"-items",this.utils.isString(e)&&(a=d.templates[e].then(function(a){g.insertBefore(a.cloneNode(!0),null)})),this._Promise.resolve(a).then(function(){g.insertBefore(h,null),d.add(f,g)}).then(null,function(a){b._log.debug(b.type+" error: "+a)})},b.prototype._addGroups=function(a,b,c){for(var d=this,e=b,f=+(b+a),g=[];f>b;)g.push(this._bindGroup(b++));return this._Promise.all(g).then(function(a){for(var b=a.length,f=0;b>f;++f)d._addGroup(f+e,a[f],c>f)})},b.prototype._addGroup=function(b,c,d){var e,f,g=this,h=this.context,i=this._groups||(this._groups={}),j=h[b],k=j.group,l=c.childNodes[1],m=l.lastElementChild,n=this.controls[b],o=i[k]={name:k,index:b,element:l,itemContainer:m,control:n,itemCount:0,addQueue:[],animationQueue:[]},p="items";if(n.dispose=function(){a.prototype.dispose.call(g),delete i[k]},n.observe(function(a,b){var c=a.group;if(c!==k&&g.utils.isObject(a)){var d=i[k];delete i[k],d.name=c,i[c]=d,k=c,e(),f(),e=n.observe(g._childContextChanged.bind(g,k),p),f=n.observeArray(g._executeChildEvent.bind(g,k),p)}}),e=n.observe(this._childContextChanged.bind(this,k),p),f=n.observeArray(this._executeChildEvent.bind(this,k),p),this._createItems(0,(j.items||[]).length,o,0),d){var q=this._defaultGroup.animationQueue,r={animation:this._animator.enter(c,Q,this._container).then(function(){var a=q.indexOf(r);a>-1&&q.splice(a,1),g._isVertical||g._setItemContainerHeight(m,!0)}),op:null};q.push(r)}else this._container.insertBefore(c,null),this._isVertical||this._setItemContainerHeight(m,!0)},b.prototype._bindGroup=function(a){return this.bindableTemplates.bind(C+"-group",a,this._getAliases(this.context,a))},b.prototype._createItems=function(a,b,c,d){var e=this,f=this.utils,g=c||this._defaultGroup,h=g.control,i=this._isVertical,j=this===h;if(j){if(this._isGrouped)return void this._headerTemplatePromise.then(function(){e._addGroups(b,a,d)}).then(null,function(a){e._log.debug(e.type+" error: "+a)});i||this._setItemContainerHeight(g.itemContainer,!1)}var k=g.addQueue,l=function(){var a=k.indexOf(r);-1!==a&&k.splice(a,1),j||(g.element.removeAttribute(E),i||e._setItemContainerWidth(g.itemContainer))},m=function(a){e._log.debug(e.type+" error: "+(f.isString(a.message)?a.message:a))};if(f.isFunction(this._templateSelector)){var n=[];g.itemCount+=b;for(var o=0;b>o;++o,++a)n.push(this._renderUsingFunction(a,g));var p=this.itemsLoaded=this._Promise.all(n).then(function(a){for(var b=a.length,c=0;b>c;++c)e._appendRenderedItem(a[c],g,d>c)}).then(l,m);return void k.push(p)}var q=this._itemTemplate;if(!f.isUndefined(this.bindableTemplates.templates[q])){this._disposeFromIndex(a,g),g.itemCount+=b;var r=this._addItems(a,b,g,d).then(l,m);k.push(r)}},b.prototype._addItems=function(a,b,c,d){var e,f,g=this,h=c||this._defaultGroup,i=h.control,j=h.itemContainer,k=+(a+b),l=[],m=this._itemTemplate,n=i.bindableTemplates,o=a;for(this===i?(e="",f=this.context):(e="items.",f=i.context.items);k>a;)l.push(n.bind(m,e+a,this._getAliases(f,a++)));return l.length>0&&(this.itemsLoaded=this._Promise.all(l).then(function(a){if(d>0)for(var b=a.length,c=0;b>c;++c)d>c?g._appendAnimatedItem(a[c],h):j.insertBefore(a[c],null);else g._appendItems(a,j);g._updateResource(o-1,i),g.utils.isFunction(g.__resolveFn)&&(g.__resolveFn(),g.__resolveFn=null)}).catch(function(a){g.utils.postpone(function(){g._log.debug(a)})})),this.itemsLoaded},b.prototype._renderUsingFunction=function(a,b){var c,d,e,f=this,g=this._Promise,h=this.utils,i=b||this._defaultGroup,j=i.control;return this===j?(c=a,d=this.context):(c="items."+a,d=j.context.items,e=i.name),g.resolve(this._templateSelectorPromise).then(function(){return f._templateSelectorPromise=g.resolve(f._templateSelector(d[a],a,e))}).then(function(b){var e=j.bindableTemplates,g=e.templates,k=j.controls,l=f._normalizeTemplateName(b),m=i.name,n=f._templateSelectorKeys[m],o=aa||a>=c.length||c[a].resources.add(this._getAliases(this===b?this.context:b.context.items,a))},b.prototype._getAliases=function(a,b){var c=0===(1&b),d={},e=this._aliases,f=ca;return d[e.index]={value:b,type:f},d[e.even]={value:c,type:f},d[e.odd]={value:!c,type:f},d[e.first]={value:0===b,type:f},d[e.last]={value:b===a.length-1,type:f},d},b.prototype._appendItems=function(a,b){this.dom.appendChildren(a,b)},b.prototype._appendAnimatedItem=function(a,b){if(this.utils.isNode(a)){var c=b.animationQueue,d={animation:this._animator.enter(a,Q,b.itemContainer).then(function(){var a=c.indexOf(d);-1!==a&&c.splice(a,1)}),op:null};c.push(d)}},b.prototype._removeItems=function(a,b,c){for(var d=this._TemplateControlFactory.dispose,e=c.control,f=e.controls,g=a+b,h=g>a;g-->a;)d(f[g]);this._updateResource(f.length-1,e),this!==e&&(h&&!this._isVertical&&this._resetItemContainerWidth(c.itemContainer),0===f.length&&c.element.setAttribute(E,""))},b.prototype._disposeFromIndex=function(a,b){for(var c=b||this._defaultGroup,d=c.control,e=d.controls,f=this._TemplateControlFactory.dispose,g=e.length,h=g>a;g-->a;)f(e[g]);this!==d&&(h&&!this._isVertical&&this._resetItemContainerWidth(c.itemContainer),0===e.length&&b.element.setAttribute(E,""))},b.prototype._determineLoading=function(a,b){var c=this,d=this.findProperty(a)||{};if(!this.utils.isFunction(d.value))return void this._log.debug(C+' onItemsRequested function "'+a+'" was not found.');this._requestItems=d.value.bind(d.control);var e;switch(this._loading){case"infinite":this._removeScroll=this.addEventListener(this._scrollContainer,"scroll",this._onScroll,!1),b&&(e=this._loadingProgressRing=this._document.createElement("div"),e.className="plat-infinite",e.insertBefore(this._generateProgressRing(),null)),this.itemsLoaded.then(function(){c._handleScroll()});break;case"incremental":e=this._loadingProgressRing=this._document.createElement("div"),e.className="plat-incremental",e.setAttribute(E,""),e.insertBefore(this._generateProgressRing(),null),this.element.insertBefore(e,null)}},b.prototype._onScroll=function(a){var b=this._scrollContainer,c=this._scrollPosition,d=this._isVertical?b.scrollTop+b.offsetHeight:b.scrollLeft+b.offsetWidth;return c>d?void(this._scrollPosition=d):void(c+5>d||(this._scrollPosition=d,this._handleScroll()))},b.prototype._handleScroll=function(){var a=this,b=this._scrollContainer,c=.8*(this._isVertical?b.scrollHeight:b.scrollWidth),d=this.utils;if(0!==c&&this._scrollPosition>=c){var e=this._requestItems();if(e===!1)this._removeScroll();else if(d.isPromise(e)){var f=this._loadingProgressRing,g=!d.isNull(f),h=this._container;this._removeScroll(),g&&d.requestAnimationFrame(function(){h.insertBefore(f,null)}),e.then(function(c){g&&d.requestAnimationFrame(function(){h.removeChild(f)}),c!==!1&&(a._removeScroll=a.addEventListener(b,"scroll",a._onScroll,!1))})}}},b.prototype._initializeRefresh=function(a){var b=this.findProperty(a)||{};if(!this.utils.isFunction(b.value))return void this._log.debug(C+' onRefresh function "'+a+'" was not found.');this._refresh=b.value.bind(b.control);var c=this._refreshProgressRing=this._document.createElement("div");c.className="plat-refresh",c.setAttribute(E,""),c.insertBefore(this._generateProgressRing(),null),this.element.insertBefore(c,null)},b.prototype._initializeTracking=function(a,b){if(a||b){this._setTransform();var c,d;this._isVertical?(c=X+"down",d=X+"up"):(c=X+"right",d=X+"left");var e,f,g=this._viewport;this.addEventListener(g,T,this._touchStart,!1),a&&(e=this._touchEndLoad,f=this._trackLoad,this.addEventListener(g,U,e,!1),this.addEventListener(g,Y,e,!1),this.addEventListener(g,V,e,!1),this.addEventListener(g,c,f,!1),this.addEventListener(g,d,f,!1)),b&&(e=this._touchEndRefresh,f=this._trackRefresh,this.addEventListener(g,U,e,!1),this.addEventListener(g,Y,e,!1),this.addEventListener(g,V,e,!1),this.addEventListener(g,c,f,!1),this.addEventListener(g,d,f,!1))}},b.prototype._touchStart=function(a){var b=this;if(0===this._touchState){if(!this._isVertical){var c=Math.ceil(a.offsetY),d=this._viewport.offsetHeight-20;if(c>=d)return}return this._touchState=1,this._lastTouch={x:a.clientX,y:a.clientY},this.utils.isNull(this._touchAnimationThenable)?void(this._touchState=2):void this._touchAnimationThenable.cancel().then(function(){b._touchAnimationThenable=null,b._touchState=2})}},b.prototype._touchEndLoad=function(a){var b=this._isLoading;if(this._isLoading=!1,!b)return void(this._isRefreshing||(this._touchState=0));var c,d,e=this._scrollContainer;return this._isVertical?(c=e.scrollTop+e.offsetHeight,d=e.scrollHeight):(c=e.scrollLeft+e.offsetWidth,d=e.scrollWidth),d>c+1?void(this._touchState=0):void this._touchEnd(a,!1)},b.prototype._touchEndRefresh=function(a){var b=this._isRefreshing;return this._isRefreshing=!1,b?(this._isVertical?this._scrollContainer.scrollTop:this._scrollContainer.scrollLeft)>0?void(this._touchState=0):void this._touchEnd(a,!0):void(this._isLoading||(this._touchState=0))},b.prototype._touchEnd=function(a,b){var c=this,d=this._touchState,e=this._hasMoved;if(this._hasMoved=!1,!(2>d)&&e){var f,g={},h=this.dom,i=this._viewport,j=b?this._refreshProgressRing:this._loadingProgressRing,k=3===d;if(k){var l;this._isVertical?(l=b?j.offsetHeight:-j.offsetHeight,f="translate3d(0,"+l+"px,0)"):(l=b?j.offsetWidth:-j.offsetWidth,f="translate3d("+l+"px,0,0)")}else f=this._preTransform;g[this._transform]=f,this._touchAnimationThenable=this._animator.animate(i,P,{properties:g}).then(function(){return c._touchState=4,c._hasMoved=!1,c._touchAnimationThenable=null,k?c._Promise.resolve(b?c._refresh():c._requestItems()):(h.removeClass(i,m+"manipulation-prep"),j.setAttribute(E,""),c._Promise.resolve())}).then(function(){return k?(h.removeClass(j,m+"play"),g[c._transform]=c._preTransform,c._touchAnimationThenable=c._animator.animate(i,P,{properties:g}).then(function(){c._touchState=0,c._touchAnimationThenable=null,h.removeClass(i,m+"manipulation-prep"),j.setAttribute(E,"")})):void(c._touchState=0)}).then(null,function(a){c._touchState=0,c._log.debug(c.type+"error: "+a)})}},b.prototype._trackLoad=function(a){if(!this._isRefreshing){if(!this._isLoading){var b,c,d=this._scrollContainer;if(this._isVertical){if("up"!==a.direction.y)return;b=d.scrollTop+d.offsetHeight,c=d.scrollHeight}else{if("left"!==a.direction.x)return;b=d.scrollLeft+d.offsetWidth,c=d.scrollWidth}if(c>b+1)return;this._isLoading=!0}this._track(a,!1)}},b.prototype._trackRefresh=function(a){if(!this._isLoading){if(!this._isRefreshing){if(this._isVertical){if("down"!==a.direction.y||this._scrollContainer.scrollTop>0)return}else if("right"!==a.direction.x||this._scrollContainer.scrollLeft>0)return;this._isRefreshing=!0}this._track(a,!0)}},b.prototype._track=function(a,b){var c=this,d=this._touchState;if(2===d||3===d){var e=this._calculateTranslation(a,b);this.utils.requestAnimationFrame(function(){c._viewport.style[c._transform]=e})}},b.prototype._calculateTranslation=function(a,b){var c,d,e=this._isVertical,f=b?this._refreshProgressRing:this._loadingProgressRing;return e?(c=a.clientY-this._lastTouch.y,d=f.offsetHeight):(c=a.clientX-this._lastTouch.x,d=f.offsetWidth),b&&0>c||!b&&c>0?c=0:this._hasMoved?Math.abs(c)>=d?this._touchState<3&&(this._touchState=3,this.dom.addClass(f,m+"play")):3===this._touchState&&(this._touchState=2,this.dom.removeClass(f,m+"play")):(this._hasMoved=!0,this.dom.addClass(this._viewport,m+"manipulation-prep"),f.removeAttribute(E)),e?"translate3d(0,"+c+"px,0)":"translate3d("+c+"px,0,0)"},b.prototype._setTransform=function(){var a=this._viewport.style,b=this.utils.isUndefined,c=this._compat.vendorPrefix;b(this._preTransform=a[c.lowerCase+"Transform"])?b(this._preTransform=a[c.upperCase+"Transform"])?(this._preTransform=a.transform,this._transform="transform"):this._transform=c.upperCase+"Transform":this._transform=c.lowerCase+"Transform"},b.prototype._parseInnerTemplate=function(a,b){for(var c,d,e,f=this._templates,g=Array.prototype.slice,h=this.dom.appendChildren,i=this._document,j=!this.utils.isNull(b),k=g.call(this.innerTemplate.childNodes);k.length>0;)c=k.pop(),c.nodeType===Node.ELEMENT_NODE&&(d=this._normalizeTemplateName(c.nodeName),j&&d===b?(e=i.createElement("div"),e.className=m+"header"):e=i.createDocumentFragment(),h(c.childNodes,e),f[d]=e)},b.prototype._executeEvent=function(a){var b="_"+a[0].type;this.utils.isFunction(this[b])&&this[b](a)},b.prototype._executeChildEvent=function(a,b){var c=this.utils,d="_"+b[0].type;if(c.isFunction(this[d])){var e=this._groups[a];if(c.isNull(e))return;this[d](b,e)}},b.prototype._push=function(a,b){var c=a[0],d=c.addedCount;this._createItems(c.index,d,b,this._animate?d:0)},b.prototype._pop=function(a,b){var c=this,d=b||this._defaultGroup,e=d.addQueue,f=a[0],g=f.object.length;if(0!==f.removed.length){var h=f.object.length;d.itemCount>0&&d.itemCount--,this._Promise.all(e).then(function(){return c._animate?void c._animateItems(g,1,R,d,"leave",!1).then(function(){c._removeItems(h,1,d)}):void c._removeItems(h,1,d)})}},b.prototype._unshift=function(a,b){if(this.utils.isFunction(this._templateSelector))return void this.rerender(b);var c=b||this._defaultGroup,d=a[0],e=d.addedCount;if(this._animate){var f=c.animationQueue,g=f.length;this._animateItems(0,e,Q,c,null,g>0&&"clone"===f[g-1].op)}this._createItems(d.object.length-e,e,c,0)},b.prototype._shift=function(a,b){var c=this,d=b||this._defaultGroup,e=d.addQueue,f=a[0];if(0!==f.removed.length){this._animate&&0===e.length&&(e=e.concat([this._animateItems(0,1,R,d,"clone",!0)]));var g=f.object.length;d.itemCount>0&&d.itemCount--,this._Promise.all(e).then(function(){c._removeItems(g,1,d)})}},b.prototype._splice=function(a,b){var c=this,d=this.utils,e=a[0],f=b||this._defaultGroup,g=e.addedCount,h=f.itemCount,i=(f.control,f.addQueue),j=this._animate;if(d.isNull(g)){j&&this._cancelCurrentAnimations();var k=e.object.length,l=h-k;if(k>h){if(d.isFunction(this._templateSelector))return void(d.isNull(e.index)?this.rerender(f):this.render(e.index,g,f)); this._createItems(h,-l,f,0)}else h>k&&(f.itemCount>=l?f.itemCount-=l:f.itemCount=0,this._Promise.all(i).then(function(){c._removeItems(h-l,l,f)}))}else{var m=e.removed.length,n=f.animationQueue;if(g>m){var o,p=g-m;if(d.isFunction(this._templateSelector))return void(d.isNull(e.index)?this.rerender(f):this.render(e.index,g,f));if(j){o=g;var q=n.length,r=e.index;g-r>h&&(o=h-r),this._animateItems(r,o,Q,f,null,q>0&&"clone"===n[q-1].op),o=g-o}else o=0;this._createItems(e.object.length-p,p,f,o)}else if(m>g){var s=g>0;j&&!s&&0===i.length&&(i=i.concat([this._animateItems(e.index,m,R,f,"clone",!0)]));var t=m-g;f.itemCount>=t?f.itemCount-=t:f.itemCount=0,this._Promise.all(i).then(function(){if(j&&s){var a=n.length;c._animateItems(e.index,g,Q,f,null,a>0&&"clone"===n[a-1].op)}c._removeItems(h-t,t,f)})}}},b.prototype._animateItems=function(a,b,c,d,e,f){switch(e){case"clone":return this._handleClonedContainerAnimation(this._getAnimatedNodes(a,b,d),c,d,f===!0);case"leave":return this._handleLeave(this._getAnimatedNodes(a,b,d),c,d);default:return this._handleSimpleAnimation(this._getAnimatedNodes(a,b,d),c,d,f===!0)}},b.prototype._getAnimatedNodes=function(a,b,c){if(this._isGrouped&&c===this._defaultGroup){var d=3,e=a*d;return Array.prototype.slice.call(c.itemContainer.childNodes,e,b*d+e)}var f=this.utils,g=f.isNode,h=Array.prototype.slice.call(c.itemContainer.childNodes),i=a+b-1,j=c.control.controls;j.length<=i&&(i=j.length-1);var k=j[a].startNode,l=j[i].endNode;if(!g(k)||!g(l))return[];var m=h.indexOf(k),n=h.indexOf(l);return-1===m||-1===n?[]:h.slice(m,n+1)},b.prototype._handleSimpleAnimation=function(a,b,c,d){if(0===a.length)return this._Promise.resolve();var e=(c.itemContainer,c.animationQueue),f=this._animator.create(a,b),g={animation:h,op:null},h=f.current.then(function(){var a=e.indexOf(g);-1!==a&&e.splice(a,1)}),i=function(){return f.previous.then(function(){h.start()}),h};if(d&&e.length>0){var j=this._cancelCurrentAnimations().then(i);return e.push(g),j}return e.push(g),i()},b.prototype._handleLeave=function(a,b,c){if(0===a.length)return this._Promise.resolve();var d=(c.itemContainer,c.animationQueue),e=this._animator.leave(a,b).then(function(){var a=d.indexOf(f);-1!==a&&d.splice(a,1)}),f={animation:e,op:"leave"};return d.push(f),e},b.prototype._handleClonedContainerAnimation=function(a,b,c,d){if(0===a.length)return this._Promise.resolve();var e,f=c.itemContainer,g=f.cloneNode(!0),h=c.animationQueue,i=this.utils.isNull,j=this._animator.create(a,b),k=j.current.then(function(){var a=h.indexOf(l);a>-1&&h.splice(a,1),i(e)||e.replaceChild(f,g)}),l={animation:k,op:"clone"},m=function(){return e=f.parentNode,i(e)||k.isCanceled()?k:(e.replaceChild(g,f),j.previous.then(function(){k.start()}),k)};if(d&&h.length>0){var n=this._cancelCurrentAnimations().then(m);return h.push(l),n}return h.push(l),m()},b.prototype._cancelCurrentAnimations=function(a){for(var b=(a||this._defaultGroup).animationQueue,c=[],d=b.length,e=0;d>e;++e)c.push(b[e].animation.cancel());return this._Promise.all(c)},b.prototype._normalizeTemplateName=function(a){return this.utils.isString(a)?a.toLowerCase().replace(this._nodeNormalizeRegex,""):void 0},b.prototype._generateProgressRing=function(){var a=this._document,b=a.createElement("div"),c=a.createElement("div"),d=a.createElement("div");return d.className="plat-animated-ring",c.insertBefore(d,null),c.className="plat-progress-container",b.insertBefore(c,null),b.className="plat-ring",b},b.prototype._validateOrientation=function(a){if(this.utils.isUndefined(a))return"vertical";var b;return"vertical"===a?b=a:"horizontal"===a?(b=a,this._isVertical=!1):(this._log.debug('Invalid orientation "'+a+'" for '+this.type+'. Defaulting to "vertical."'),b="vertical"),b},b.prototype._setItemContainerWidth=function(a,b){var c=a.scrollWidth;if(!c)return void this._setItemContainerWidthWithClone(a,b);var d=function(){a.style.width=c+"px"};return b===!0?void d():void this.utils.requestAnimationFrame(d)},b.prototype._resetItemContainerWidth=function(a){a.style.width="",this._setItemContainerWidth(a,!0)},b.prototype._setItemContainerWidthWithClone=function(a,b){var c=this._document.body,d=a.parentElement,e=this.utils,f=d.lastElementChild;if(!c.contains(d)){var g=++this._cloneAttempts;if(g===this._maxCloneAttempts){var h=this.type;return this._log.debug("Max clone attempts reached before the "+h+" was placed into the DOM. Disposing of the "+h+"."),void this._TemplateControlFactory.dispose(this)}return void e.defer(this._setItemContainerWidthWithClone,20,[a],this)}this._cloneAttempts=0;var i,j,k=d.cloneNode(!0),l=k.lastElementChild,m=/\d+(?!\d+|%)/,n=this._window,o=[],p=l,q="width",r="height",s="important",t=e.isNull;if(p.id="",!m.test(j=(i=n.getComputedStyle(f))[q]))for("none"===i.display&&p.style.setProperty("display","block",s),p.style.setProperty(q,j,s),p.style.setProperty(r,i.height,s),f=f.parentElement,p=k,p.id="";!m.test(j=(i=n.getComputedStyle(f))[q]);){if("none"===i.display&&p.style.setProperty("display","block",s),p.style.setProperty(q,j,s),p.style.setProperty(r,i.height,s),f=f.parentElement,t(f))return this._log.debug("The document's body contains a "+this.type+" that needs its length and is currently hidden. Please do not set the body's display to none."),void e.defer(this._setItemContainerWidthWithClone,100,[q],this);p=f.cloneNode(!1),p.id="",o.push(p)}if(o.length>0){for(var u,v=o.pop();o.length>0;)u=o.pop(),v.insertBefore(u,null),v=u;v.insertBefore(k,null)}var w=p.style;w.setProperty(q,j,s),w.setProperty(r,i.height,s),w.setProperty("visibility","hidden",s),c.appendChild(p);var x=l.scrollWidth+"px",y=function(){a.style.width=x};return c.removeChild(p),b===!0?void y():void e.requestAnimationFrame(y)},b.prototype._setItemContainerHeight=function(a,b){var c=a.parentElement,d=c.offsetHeight,e=0;return d&&(b!==!0||(e=c.firstElementChild.offsetHeight))?void this.utils.requestAnimationFrame(function(){a.style.height=d-e+"px"}):void this._setItemContainerHeightWithClone(a,b)},b.prototype._setItemContainerHeightWithClone=function(a,b){var c=this._document.body,d=a.parentElement,e=d.firstElementChild;if(!c.contains(d)){var f=++this._cloneAttempts;if(f===this._maxCloneAttempts){var g=this.type;return this._log.debug("Max clone attempts reached before the "+g+" was placed into the DOM. Disposing of the "+g+"."),void this._TemplateControlFactory.dispose(this)}return void this.utils.defer(this._setItemContainerHeightWithClone,20,[a],this)}this._cloneAttempts=0;var h,i,j=d.cloneNode(!0),k=j.firstElementChild,l=/\d+(?!\d+|%)/,m=this._window,n=[],o=k,p="height",q="important",r=this.utils.isNull;if(o.id="",!l.test(i=(h=m.getComputedStyle(e))[p]))for("none"===h.display&&o.style.setProperty("display","block",q),o.style.setProperty(p,i,q),e=e.parentElement,o=j,o.id="";!l.test(i=(h=m.getComputedStyle(e))[p]);){if("none"===h.display&&o.style.setProperty("display","block",q),o.style.setProperty(p,i,q),e=e.parentElement,r(e))return this._log.debug("The document's body contains a "+this.type+" that needs its length and is currently hidden. Please do not set the body's display to none."),void this.utils.defer(this._setItemContainerHeightWithClone,100,[p],this);o=e.cloneNode(!1),o.id="",n.push(o)}if(n.length>0){for(var s,t=n.pop();n.length>0;)s=n.pop(),t.insertBefore(s,null),t=s;t.insertBefore(j,null)}var u=o.style;u.setProperty(p,i,q),u.setProperty("visibility","hidden",q),c.appendChild(o);var v=b===!0?j.offsetHeight-k.offsetHeight+"px":k.offsetHeight+"px";c.removeChild(o),this.utils.requestAnimationFrame(function(){a.style.height=v})},b._inject={_document:g,_window:f,_compat:d,_animator:h,_Promise:c,_TemplateControlFactory:j},b}(plat.ui.TemplateControl);a.Listview=ua,plat.register.control(C,ua);var va=function(a){function b(){a.apply(this,arguments),this.templateString='
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n',this.context={left:[{content:"",action:ea}],center:[{content:"",action:ea}],right:[{content:"",action:ea}]},this.hasOwnContext=!0,this._overrides={left:!1,center:!1,right:!1}}return __extends(b,a),b.prototype.setClasses=function(a,b){this.dom.addClass(b||this.element,D+" "+(a||""))},b.prototype.initialize=function(){this.setClasses()},b.prototype.setTemplate=function(){var a=this.utils.isNull,b=this.innerTemplate;if(!a(b))for(var c,d,e=this._document,f=this._overrides,g=Array.prototype.slice,h=this.dom.appendChildren,i=g.call(b.childNodes),j=this.element,k=g.call(j.children);i.length>0;)if(c=i.shift(),c.nodeType===Node.ELEMENT_NODE)switch(c.nodeName.toLowerCase()){case"left":f.left=!0,d=e.createElement("div"),d.className=D+"-left",d.setAttribute(F,"left"),j.replaceChild(h(g.call(c.childNodes),d),k[0]);break;case"center":f.center=!0,d=e.createElement("div"),d.className=D+"-center",d.setAttribute(F,"center"),j.replaceChild(h(g.call(c.childNodes),d),k[1]);break;case"right":f.right=!0,d=e.createElement("div"),d.className=D+"-right",d.setAttribute(F,"right"),j.replaceChild(h(g.call(c.childNodes),d),k[2])}},b.prototype.loaded=function(){var a=this.options||{},b=a.value||{},c=this.utils.isString(b.position)&&"bottom"===b.position.toLowerCase()?"-bottom":"-top";this.dom.addClass(this.element,D+c)},b.prototype.setLeft=function(a){this._setComponent("left",a)},b.prototype.setCenter=function(a){this._setComponent("center",a)},b.prototype.setRight=function(a){this._setComponent("right",a)},b.prototype.leftAction=function(a,b){this._executeAction(b,"left",a)},b.prototype.centerAction=function(a,b){this._executeAction(b,"center",a)},b.prototype.rightAction=function(a,b){this._executeAction(b,"right",a)},b.prototype._setComponent=function(a,b){var c=this.context;if(!this.utils.isArray(b)){if(this._overrides[a])return this._parseComponent(b),void(c[a]=b);b=[b]}for(var d=b.length;d-->0;)this._parseComponent(b[d],c[a][d]);c[a]=b},b.prototype._parseComponent=function(a,b){var c,d,e,f,g=this.utils,h=g.isObject,i=h(b);if(i&&g.isUndefined(a.content)&&(a.content=b.content),g.isFunction(a.action)||(a.action=i?b.action:ea),c=a.customActions,h(c))for(d=Object.keys(c),f=d.length;f-->0;)e=d[f],this[e]=c[e]},b.prototype._executeAction=function(a,b,c){var d=this.utils,e=this.context[b];return d.isArray(e)&&!d.isNull(c)&&(e=e[c]),d.isFunction(e.action)?void e.action(a):void this._log.debug("An action function is not defined for the component "+e+".")},b._inject={_document:g},b}(plat.ui.TemplateControl);a.Navbar=va,plat.register.control(D,va,null,!0)}(platui||(platui={})),module.exports=platui; \ No newline at end of file