openhab2_tizen/lib/tau/wearable/js/tau.min.js
2019-04-07 14:49:51 +02:00

28 lines
No EOL
349 KiB
JavaScript

/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://floralicense.org/license/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
!function(a,b,c){"use strict";var d=a.tau=a.tau||{},e=a.tauConfig=a.tauConfig||{};e.rootNamespace="tau",e.fileName="tau",d.version="0.13.46",function(b,d){var e=0,f=+new Date,g=[].slice,h="",i="",j=function(a){var b=new Date;a.unshift("["+h+"]["+b.toLocaleString()+"]")},k=a.ns||a.tau||{},l=a.nsConfig||a.tauConfig||{};k.info=k.info||{profile:"custom"},k.tauPerf=k.tauPerf||{},a.ns=k,a.nsConfig=l,a.tau=k,a.tauConfig=l,h=l.rootNamespace,i=l.fileName,k.getUniqueId=function(){return h+"-"+k.getNumberUniqueId()+"-"+f},k.getNumberUniqueId=function(){return e++},k.log=function(){var a=g.call(arguments);j(a),d&&d.log.apply(d,a)},k.warn=function(){var a=g.call(arguments);j(a),d&&d.warn.apply(d,a)},k.error=function(){var a=g.call(arguments);j(a),d&&d.error.apply(d,a)},k.getConfig=function(a,b){return l[a]===c?b:l[a]},k.setConfig=function(a,b,d){d&&l[a]!==c||(l[a]=b)},k.getFrameworkPath=function(){var a,c,d,e,f=b.getElementsByTagName("script"),g=f.length;for(a=0;g>a;a++)if(c=f[a].src,d=c.split("/"),e=d.length,d[e-1]===i+".js"||d[e-1]===i+".min.js")return d.slice(0,e-1).join("/");return null}}(a.document,a.console),function(a,b){function c(){var c,d=b.createElement("div"),e=b.createElement("body"),f=b.getElementsByTagName("html")[0],g=getComputedStyle(d);return d.classList.add("is-circle-test"),e.appendChild(d),f.insertBefore(e,f.firstChild),c="1px"===g.width,f.removeChild(e),"?circle"===a.location.search&&(c=!0),c}var e=!("undefined"==typeof a.tizen);d.support={cssTransitions:!0,mediaquery:!0,cssPseudoElement:!0,touchOverflow:!0,cssTransform3d:!0,boxShadow:!0,scrollTop:0,dynamicBaseTag:!0,cssPointerEvents:!1,boundingRect:!0,browser:{ie:!1,tizen:e},shape:{circle:e?a.matchMedia("(-tizen-geometric-shape: circle)").matches:c()},gradeA:function(){return!0},isCircleShape:c}}(a,a.document),function(){d.setConfig("autoBuildOnPageChange",!1,!0),d.support.shape.circle?(d.setConfig("pageTransition","pop",!0),d.setConfig("popupTransition","pop",!0),d.setConfig("popupFullSize",!0,!0),d.setConfig("scrollEndEffectArea","screen",!0),d.setConfig("enablePageScroll",!0,!0),d.setConfig("enablePopupScroll",!0,!0)):(d.setConfig("popupTransition","slideup",!0),d.setConfig("enablePageScroll",!1,!0),d.setConfig("enablePopupScroll",!1,!0))}(),function(){d.setConfig("rootDir",d.getFrameworkPath(),!0),d.setConfig("version","",!0),d.setConfig("allowCrossDomainPages",!1,!0),d.setConfig("domCache",!1,!0),d.setConfig("autoBuildOnPageChange",!0,!0),d.setConfig("autoInitializePage",!0,!0),d.setConfig("dynamicBaseEnabled",!0,!0),d.setConfig("pageTransition","none",!0),d.setConfig("popupTransition","none",!0),d.setConfig("popupFullSize",!1,!0),d.setConfig("scrollEndEffectArea","content",!0),d.setConfig("enablePopupScroll",!1,!0),d.setConfig("pageContainer",b.body,!0),d.setConfig("findProfileFile",!1,!0)}(),function(a,b,c){function d(a,b){var c,d=new XMLHttpRequest;return d.open("get",a,!1),b&&d.overrideMimeType(b),d.send(),4===d.readyState&&(c=d.status,200===c||0===c&&d.responseText)?d.responseText:null}function e(a){for(var b,c=l.call(a.querySelectorAll("script[src]")),d=c.length;--d>=0;)b=c[d],b.parentNode.removeChild(b);return c}function f(b){return function(){try{a.eval(b)}catch(d){d.stack?c.error(d.stack):d.name&&d.message?c.error(d.name,d.message):c.error(d)}}}function g(a){var b,c=a.length;for(b=0;c>b;++b)a[b]()}function h(a,c){var d,e,f,g,h=[];for(f=0,g=a.length;g>f;++f)e=j.fetchSync(a[f].src,"text/plain"),e&&(d=b.adoptNode(a[f]),d.setAttribute("data-src",a[f].src),d.removeAttribute("src"),h.push(j.safeEvalWrap(e)),c&&c.appendChild(d));return h}var i=null,j=c.util||{},k=[],l=[].slice,m=!1;j._requestAnimationFrameOnSetTimeout=function(b){i=a.setTimeout(b.bind(b,+new Date),1e3/60)},j._loop=function(){var a=l.call(k),b=a.shift(),c=performance.now();for(k=[];b;)b(),b=performance.now()-c<15?a.shift():null;a.length||k.length?(k.unshift.apply(k,a),j.windowRequestAnimationFrame(j._loop)):m=!1},j._getRequestAnimationFrame=function(){return(a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||j._requestAnimationFrameOnSetTimeout).bind(a)},j.windowRequestAnimationFrame=j._getRequestAnimationFrame(),j.requestAnimationFrame=function(a){k.push(a),m||(j.windowRequestAnimationFrame(j._loop),m=!0)},j._cancelAnimationFrameOnSetTimeout=function(){a.clearTimeout(i)},j._getCancelAnimationFrame=function(){return(a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.mozCancelAnimationFrame||a.oCancelAnimationFrame||a.msCancelAnimationFrame||j._cancelAnimationFrameOnSetTimeout).bind(a)},j.cancelAnimationFrame=j._getCancelAnimationFrame(),j.fetchSync=d,j._removeExternalScripts=e,j.safeEvalWrap=f,j.batchCall=g,j._createScriptsSync=h,j.async=j.requestAnimationFrame,j.importEvaluateAndAppendElement=function(a,c){var d=j._createScriptsSync(j._removeExternalScripts(a),a),e=b.importNode(a,!0);return c.appendChild(e),j.batchCall(d),e},j.isNumber=function(a){var b=parseFloat(a);return!isNaN(b)&&isFinite(b)},j.runScript=function(c,d){var e,f,g,h=b.createElement("script"),i=l.call(d.attributes),k=d.getAttribute("src");for(null!==k&&(k=j.path.makeUrlAbsolute(k,c)),f=i.length;--f>=0;)g=i[f],"src"!==g.name?h.setAttribute(g.name,g.value):h.setAttribute("data-src",g.value);e=k?j.fetchSync(k,"text/plain"):d.textContent,e&&(h.src=a.URL.createObjectURL(new Blob([e],{type:"text/javascript"})),h.textContent=e),d.parentNode.replaceChild(h,d)},c.util=j}(a,a.document,d),function(a){function b(a,b){var c,d,e=!1;return isNaN(a)&&isNaN(b)?(e=!0,c=a.charCodeAt(0),d=b.charCodeAt(0)):(c=isNaN(a)?0:a,d=isNaN(b)?0:b),{inival:c,endval:d,chars:e}}function d(a,c,d){var e,f,g,h,i,j=[],k=d||1;if(i=b(a,c),e=i.inival,f=i.endval,h=i.chars,g=f>=e)for(;f>=e;)j.push(h?String.fromCharCode(e):e),e+=k;else for(;e>=f;)j.push(h?String.fromCharCode(e):e),e-=k;return j}function e(a){return Array.isArray(a)||a instanceof NodeList||"function"==typeof a}function f(a){var b=a.length;return 0===b||"number"==typeof b&&b>0&&b-1 in a}function g(a){return a&&a!==a.window?e(a)&&f(a):!1}function h(a,b){var c,d,e=a;for(a instanceof Array||(e=[].slice.call(a)),d=e.length,c=0;d>c;c++)b(e[c],c,e)}function i(a,b){var c,d,e,f=[],g=a;for(a instanceof Array||(g=[].slice.call(a)),d=g.length,c=0;d>c;c++)e=g[c],b(e,c,g)&&f.push(e);return f}function j(a,b){var c,d,e=[],f=a;for(a instanceof Array||(f=[].slice.call(a)),d=f.length,c=0;d>c;c++)e.push(b(f[c],c,f));return e}function k(a,b,d){var e,f,g,h=d,i=a;for(a instanceof Array||(i=[].slice.call(a)),f=i.length,e=0;f>e;e++)g=i[e],h=h===c&&0===e?g:b(h,g,e,i);return h}a.util.array={range:d,isArrayLike:g,forEach:h,filter:i,map:j,reduce:k}}(d),function(a,d){function e(a){var b;return g.forEach(function(c){c.element===a&&(b=c.instance)}),b}function f(a){g.forEach(function(b,c){b.element===a&&g.splice(c,1)})}var g=[],h=Array.isArray,i=d.util.array.isArrayLike,j=/\s+/g,k=function(a){return a.trim()},l=function(a,b){var c,d,e=[];if("string"==typeof a&&(a=a.split(j).map(k)),h(a))for(d=0;d<a.length;d++)e.push({type:a[d],callback:b});else for(c in a)a.hasOwnProperty(c)&&e.push({type:c,callback:a[c]});return e};d.event={trigger:function(a,b,c,d,e){var f=new CustomEvent(b,{detail:c,bubbles:"boolean"==typeof d?d:!0,cancelable:"boolean"==typeof e?e:!0});return a.dispatchEvent(f)},preventDefault:function(a){var b=a._originalEvent;b&&b.preventDefault&&b.preventDefault(),a.preventDefault()},stopPropagation:function(a){var b=a._originalEvent;b&&b.stopPropagation&&b.stopPropagation(),a.stopPropagation()},stopImmediatePropagation:function(a){var b=a._originalEvent;b&&b.stopImmediatePropagation&&b.stopImmediatePropagation(),a.stopImmediatePropagation()},documentRelativeCoordsFromEvent:function(c){var d,e=c?c:a.event,f={x:e.clientX,y:e.clientY},g={x:e.pageX,y:e.pageY},h=0,i=0,j=b.body,k=b.documentElement;return c.type.match(/^touch/)&&(d=e.targetTouches[0]||e.originalEvent.targetTouches[0],g={x:d.pageX,y:d.pageY},f={x:d.clientX,y:d.clientY}),g.x||g.y?(h=g.x,i=g.y):(f.x||f.y)&&(h=f.x+j.scrollLeft+k.scrollLeft,i=f.y+j.scrollTop+k.scrollTop),{x:h,y:i}},targetRelativeCoordsFromEvent:function(a){var b=a.target,e={x:a.offsetX,y:a.offsetY};return(e.x===c||isNaN(e.x)||e.y===c||isNaN(e.y))&&(e=d.event.documentRelativeCoordsFromEvent(a),e.x-=b.offsetLeft,e.y-=b.offsetTop),e},fastOn:function(a,b,c,d){a.addEventListener(b,c,d||!1)},fastOff:function(a,b,c,d){a.removeEventListener(b,c,d||!1)},prefixedFastOn:function(a,b,c,d){var e=b.charAt(0).toLocaleUpperCase()+b.substring(1);a.addEventListener(b.toLowerCase(),c,d||!1),a.addEventListener("webkit"+e,c,d||!1),a.addEventListener("moz"+e,c,d||!1),a.addEventListener("ms"+e,c,d||!1),a.addEventListener("o"+e.toLowerCase(),c,d||!1)},prefixedFastOff:function(a,b,c,d){var e=b.charAt(0).toLocaleUpperCase()+b.substring(1);a.removeEventListener(b.toLowerCase(),c,d||!1),a.removeEventListener("webkit"+e,c,d||!1),a.removeEventListener("moz"+e,c,d||!1),a.removeEventListener("ms"+e,c,d||!1),a.removeEventListener("o"+e.toLowerCase(),c,d||!1)},on:function(a,b,c,e){var f,g,h,j,k,m;for(k=i(a)?a:[a],h=k.length,m=l(b,c),j=m.length,f=0;h>f;f++)if("function"==typeof k[f].addEventListener)for(g=0;j>g;g++)d.event.fastOn(k[f],m[g].type,m[g].callback,e)},off:function(a,b,c,e){var f,g,h,j,k,m;for(k=i(a)?a:[a],h=k.length,m=l(b,c),j=m.length,f=0;h>f;f++)if("function"==typeof k[f].addEventListener)for(g=0;j>g;g++)d.event.fastOff(k[f],m[g].type,m[g].callback,e)},one:function(a,b,c,e){var f,g,h,j,k,m,n=[].slice,o=[];for(k=i(a)?n.call(a):[a],h=k.length,m=l(b,c),j=m.length,f=0;h>f;f++)if("function"==typeof k[f].addEventListener)for(o[f]=[],g=0;j>g;g++)o[f][g]=function(a,b){var c=n.call(arguments);d.event.fastOff(k[a],m[b].type,o[a][b],e),c.shift(),c.shift(),m[b].callback.apply(this,c)}.bind(null,f,g),d.event.fastOn(k[f],m[g].type,o[f][g],e)},enableGesture:function(a){var b=e(a),c=arguments.length,f=1;for(b||(b=new d.event.gesture.Instance(a),g.push({element:a,instance:b}));c>f;f++)b.addDetector(arguments[f])},disableGesture:function(a){var b=e(a),c=arguments.length,d=1;b&&(c>1?b.removeDetector(arguments[d]):(b.destroy(),f(a)))}}}(a,d),function(a,b){var c=d.event,e={profile:"default",theme:"default",version:d.version,refreshTheme:function(d){var e,f=b.createElement("span"),g=b.body;return"interactive"!==b.readyState&&"complete"!==b.readyState?(c.fastOn(b,"DOMContentLoaded",this.refreshTheme.bind(this,d)),null):(f.classList.add("tau-info-theme"),g.appendChild(f),e=a.getComputedStyle(f,":after").content,g.removeChild(f),e&&e.length>0&&(this.theme=e),e=e||null,d&&d(e),e)}};e.refreshTheme(),d.info=e}(a,a.document),function(b,c){function d(a){var b=c.getConfig("namespace");return"[data-"+(b?b+"-":"")+a+"]"}function e(a,b){return l&&a[l]?a[l](b):!1}function f(a){for(var c=[],d=a.parentNode;d&&d!==b;)c.push(d),d=d.parentNode;return c}function g(a,c){for(var d=a;d&&d!==b;){if(c(d))return d;d=d.parentNode}return null}function h(a,b){return e(b,a)}function i(a,b){return b&&b.classList&&b.classList.contains(a)}function j(a,b){return b.tagName.toLowerCase()===a}var k=[].slice,l=function(){var a=b.createElement("div");return"function"==typeof a.webkitMatchesSelector?"webkitMatchesSelector":"function"==typeof a.mozMatchesSelector?"mozMatchesSelector":"function"==typeof a.msMatchesSelector?"msMatchesSelector":"function"==typeof a.matchesSelector?"matchesSelector":"function"==typeof a.matches?"matches":""}();c.util.selectors={matchesSelector:e,getChildrenBySelector:function(a,b){return k.call(a.children).filter(h.bind(null,b))},getChildrenByDataNS:function(a,b){return k.call(a.children).filter(h.bind(null,d(b)))},getChildrenByClass:function(a,b){return k.call(a.children).filter(i.bind(null,b))},getChildrenByTag:function(a,b){return k.call(a.children).filter(j.bind(null,b))},getParents:f,getParentsBySelector:function(a,b){return f(a).filter(h.bind(null,b))},getParentsBySelectorNS:function(a,b){return f(a).filter(h.bind(null,d(b)))},getParentsByClass:function(a,b){return f(a).filter(i.bind(null,b))},getParentsByTag:function(a,b){return f(a).filter(j.bind(null,b))},getClosestBySelector:function(a,b){return g(a,h.bind(null,b))},getClosestBySelectorNS:function(a,b){return g(a,h.bind(null,d(b)))},getClosestByClass:function(a,b){return g(a,i.bind(null,b))},getClosestByTag:function(a,b){return g(a,j.bind(null,b))},getAllByDataNS:function(a,b){return k.call(a.querySelectorAll(d(b)))},getScrollableParent:function(c){for(var d,e;c&&c!==b.body;){if(e=a.getComputedStyle(c),e&&(d=e.getPropertyValue("overflow-y"),"scroll"===d||"auto"===d&&c.scrollHeight>c.clientHeight))return c;c=c.parentNode}return null}}}(a.document,d),function(){var a={copy:function(b){return a.merge({},b)},fastMerge:function(a,b){var c;for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a},merge:function(){var a,b,d,e,f,g=[].slice.call(arguments),h=g.length;for(a=g.shift(),d=!0,"boolean"==typeof arguments[h-1]&&(d=arguments[h-1],h--),f=0;h>f;f++)if(b=g.shift(),null!==b)for(e in b)b.hasOwnProperty(e)&&(d||a[e]===c)&&(a[e]=b[e]);return a},inherit:function(a,b,c){var d,e,f=new b;for(d in c)c.hasOwnProperty(d)&&(e=c[d],"function"==typeof e?f[d]=function(a,b,c){var d=function(){var c=a.prototype[b];return c?c.apply(this,arguments):null};return function(){var a,b=this._super;return this._super=d,a=c.apply(this,arguments),this._super=b,a}}(b,d,e):f[d]=e);a.prototype=f,a.prototype.constructor=a},hasPropertiesOfValue:function(a,b){var c=Object.keys(a),d=c.length;if(0===d)return!1;for(;--d>=0;)if(a[c[d]]!==b)return!1;return!0},removeProperties:function(a,b){var c,d,e=b.length;for(d=0;e>d;d++)c=b[d],a.hasOwnProperty(c)&&delete a[c];return a}};d.util.object=a}(),function(a,b){function e(a){return a.match(/\[data-role=/)&&!a.match(/:not\(\[data-role=/)?a.trim():a.trim()+":not([data-role='none'])"}function f(a,f,g,h,i,j,k,l){var m;if(a){if(!Q[a]||j)return g=g||[],g.push("destroy","disable","enable","option","refresh","value"),m={name:a,methods:g,selector:f||"",selectors:f?f.split(",").map(e):[],widgetClass:h||null,namespace:i||"",widgetNameToLowercase:k===c?!0:!!k,BaseElement:l},Q[a]=m,i&&(Q[i+"."+a]=m),L.trigger(b,"widgetdefined",m,!1),!0}else d.error("Widget with selector ["+f+"] defined without a name, aborting!");return!1}function g(a,b,c){var d,e,f=c?c.split("."):[],g=f.pop(),h=f.pop();return g?d=a.instances[g]:(e=Object.keys(a.instances),d=a.instances[e[0]]),h&&d&&d.namespace!==h&&(d=null),d&&d.element===b?d:null}function h(a,c){var d,e=a&&typeof a!==U?a.id:a;return typeof a===U&&(a=b.getElementById(e)),a&&(d=R[e],d&&"object"==typeof d)?g(d,a,c):null}function i(a){var b=a.element.id,c=a.name,d=R[b];d||(d={elementId:b,element:a.element,instances:{}}),d.instances[c]=a,R[b]=d}function j(a){var b=a&&typeof a!==U?a.id:a;return R[b]&&R[b].instances||null}function k(a,b){var c,d;return c=b.split(Z),d=c.indexOf(a),d>-1&&(c.splice(d,1),b=c.join(Z)),b}function l(a){a.removeAttribute(W),a.removeAttribute(Y),a.removeAttribute(X)}function m(a,b){var c,d,e;b?(c=k(b,a.getAttribute(W)||""),d=k(b,a.getAttribute(Y)||""),e=k(b,a.getAttribute(X)||""),c&&d&&e?(a.setAttribute(W,c),a.setAttribute(Y,d),a.setAttribute(X,e)):l(a)):l(a)}function n(a,b){var c=a[b];return c?(c.element&&typeof c.element.setAttribute===V&&m(c.element,b),delete a[b],!0):!1}function o(a,b){var c,d,e=!0;for(d in a)a.hasOwnProperty(d)&&(c=n(a,d),a[d]=null,e=e&&c);return N.hasPropertiesOfValue(a,null)&&(R[b]=null),e}function p(a,b,c){var d;return b?(d=n(a,b),N.hasPropertiesOfValue(a,null)&&(R[c]=null)):d=o(a,c),d}function q(a,b){var c,d=typeof a===U?a:a.id,e=R[d];if(e){if(typeof a===U&&(a=e.element),a&&m(a,b),c=R[d]&&R[d].instances)return p(c,b,d);R[d].instances&&0===Object.keys(R[d].instances).length&&(R[d]=null)}return!1}function r(a){return q(a)}function s(a,c){return a&&a instanceof HTMLElement||(a=typeof c.createEmptyElement===V?c.createEmptyElement():b.createElement("div")),a}function t(a,c,d,e){var f,g=e||{},h=g.create;c.configure(d,a,e),typeof h===V&&L.one(a,d.name.toLowerCase()+"create",h),a.id&&(c.id=a.id),f=a.getAttribute(W),f&&-1!==f.split(Z).indexOf(c.name)||(a=c.build(a)),a&&(c.element=a,i(c),c.trigger(aa.WIDGET_BUILT,c,!1),T||c.init(a),c.bindEvents(a,T),c.trigger(c.widgetEventPrefix+aa.WIDGET_INIT),c.trigger(aa.WIDGET_BOUND,c,!1),L.trigger(b,aa.WIDGET_BOUND,c))}function u(a,b,c){var d,e,f,g=b.widgetClass;return a=s(a,g),d=g?new g(a):!1,e=O.getParentsBySelectorNS(a,"enhance=false"),f=h(a,b.name),f&&f.element===a?a:d?(e.length||t(a,d,b,c),d.element):null}function v(a,c){var d;typeof a===U&&(a=b.getElementById(a)),d=h(a,c),d&&(d.destroy(),d.trigger("widgetdestroyed"),q(a,c))}function w(a){var b,c,d;d=j(a);for(b in d)d.hasOwnProperty(b)&&(c=d[b],c&&(c.destroy(),c.trigger("widgetdestroyed")))}function x(a,c){var d,e;for(typeof a===U&&(a=b.getElementById(a)),c||w(a),d=K.call(a.querySelectorAll("["+Y+"]")),e=d.length-1;e>=0;e-=1)d[e]&&x(d[e],!1);r(a)}function y(a,b,c){var d=a&&a.getAttribute(X)||b&&b.name;return b=b||d&&Q[d]||{name:d},u(a,b,c)}function z(a,b){var c=Node.DOCUMENT_POSITION_CONTAINS|Node.DOCUMENT_POSITION_PRECEDING;return a.element===b.element?0:a.element.compareDocumentPosition(b.element)&c?1:-1}function A(a){y(a.element||a,Q[a.widgetName])}function B(a){var c,d,e,f,g,h,i,j=K.call(a.querySelectorAll($)),k=[],l=Object.keys(Q),m=l.length;for(j.forEach(A),e=0;m>e;++e)if(h=l[e],-1===h.indexOf(".")&&(g=Q[h],i=g.selectors,i.length))for(d=_(h),c=K.call(a.querySelectorAll(i.join(d+",")+d)),f=c.length;--f>=0;)k.push({element:c[f],widgetName:h});k.sort(z),k.forEach(A),L.trigger(b,"built"),L.trigger(b,aa.BOUND)}function C(a){B(a.target)}function D(){var a,c,d,e,f=b.head;if(c=f.querySelectorAll('[name="viewport"]'),a=c.length,a>0)for(--a,e=0;a>e;++e)f.removeChild(c[e]);else d=b.createElement("meta"),d.setAttribute("name","viewport"),d.setAttribute("content","width=device-width, user-scalable=no"),f.firstChild?f.insertBefore(d,f.firstChild):f.appendChild(d)}function E(){L.trigger(b,aa.READY),D()}function F(){}function G(){F(),L.fastOff(b,"create",C),x(b.body,!0),L.trigger(b,aa.DESTROY)}function H(a,b){var c=b instanceof HTMLElement?"HTMLElement":typeof b;return a[c]=b,a}function I(a){return P.reduce(a,H,{})}var J,K=[].slice,L=d.event,M=d.util,N=M.object,O=M.selectors,P=d.util.array,Q={},R={},S=a.location,T="#build"===S.hash,U="string",V="function",W="data-tau-built",X="data-tau-name",Y="data-tau-bound",Z=",",$="*["+W+"]["+X+"]:not(["+Y+"])",_=function(a){return":not(["+W+"*='"+a+"']):not(["+Y+"*='"+a+"'])"},aa={INIT:"tauinit",READY:"tauready",WIDGET_BOUND:"widgetbound",WIDGET_DEFINED:"widgetdefined",WIDGET_BUILT:"widgetbuilt",DESTROY:"taudestroy",BOUND:"bound",WIDGET_INIT:"init"};d.widgetDefinitions={},J={justBuild:"#build"===S.hash,dataTau:{built:W,name:X,bound:Y,separator:Z},destroyWidget:v,destroyAllWidgets:x,createWidgets:B,getDefinitions:function(){return Q},getWidgetDefinition:function(a){return Q[a]},defineWidget:f,getBinding:h,getAllBindings:j,setBinding:i,removeBinding:q,removeAllBindings:r,_clearBindings:function(){R={}},build:E,run:function(){switch(F(),L.fastOn(b,"create",C),L.trigger(b,aa.INIT,{tau:d}),b.readyState){case"interactive":case"complete":E();break;default:L.one(b,"DOMContentLoaded",E.bind(J))}},instanceWidget:function(a,b,c){var d,e,f=I(arguments);return a=f.HTMLElement,b=f.string,c=f.object,a&&(d=h(a,b)),!d&&Q[b]?(e=Q[b],a=y(a,e,c),d=h(a,b)):d&&d.option(c),d},stop:F,destroy:G,setJustBuild:function(a){a?S.hash="build":S.hash="",T=a},getJustBuild:function(){return T},_createEventHandler:C},J.eventType=aa,d.engine=J}(a,a.document),function(){d.util.DOM=d.util.DOM||{}}(),function(){function a(a,b){var c=d.getConfig(g),e="";return b||(e="data-"),e+(c?c+"-":"")+a}function b(a,b,c){a[b]=c,a.setAttribute(b,c)}var e=d.util.selectors,f=d.util.DOM,g="namespace";f.inheritAttr=function(a,b,c){var d,f=a.getAttribute(b);return!f&&(d=e.getClosestBySelector(a,c))?d.getAttribute(b):f},f.getNumberFromAttribute=function(a,b,c,d){var e=a.getAttribute(b),f=d;return isNaN(e)||("float"===c?(e=parseFloat(e),isNaN(e)||(f=e)):(e=parseInt(e,10),isNaN(e)||(f=e))),f},f.setNSData=function(b,c,d){b.setAttribute(a(c),d)},f.getNSData=function(b,c,d){var e=b.getAttribute(a(c,d));return"true"===e?!0:"false"===e?!1:e},f.hasNSData=function(b,c){return b.hasAttribute(a(c))},f.nsData=function(a,b,d){return d===c?f.getNSData(a,b):f.setNSData(a,b,d)},f.removeNSData=function(b,c){b.removeAttribute(a(c))},f.getData=function(a){var b,c,d,e,f,g="data-",h={},i=a.attributes,j=i.length;for(e=0;j>e;e++)b=i.item(e),c=b.nodeName,c.indexOf(g)>-1&&(d=b.value,f=d.toLowerCase(),"true"===f?d=!0:"false"===f&&(d=!1),h[c.replace(g,"")]=d);return h},f.removeAttribute=function(a,b){a.removeAttribute(b),a[b]=!1},f.setAttribute=b,f.setAttributes=function(a,c){var d,e,f,g=Object.keys(c);for(d=0,f=g.length;f>d;d++)e=g[d],b(a,e,c[e])}}(),function(a,b,d){var e,f=d.util.object,g=d.util.selectors,h=d.util.DOM,i={},j={uiStateKey:"&ui-state",urlParseRE:/^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)((#[^\?]*)(\?.*)?)?/,getLocation:function(b){var c=this.parseUrl(b||a.location.href),d=c.hash,e=c.hashSearch;return d="#"!==d||e?d:"",i=c,c.protocol+"//"+c.host+c.pathname+c.search+d+e},getDocumentUrl:function(a){return a?f.copy(j.documentUrl):j.documentUrl.href},parseLocation:function(){return this.parseUrl(this.getLocation())},parseUrl:function(a){var b;return"object"==typeof a?a:(b=j.urlParseRE.exec(a||"")||[],{href:b[0]||"",hrefNoHash:b[1]||"",hrefNoSearch:b[2]||"",domain:b[3]||"",protocol:b[4]||"",doubleSlash:b[5]||"",authority:b[6]||"",username:b[8]||"",password:b[9]||"",host:b[10]||"",hostname:b[11]||"",port:b[12]||"",pathname:b[13]||"",directory:b[14]||"",filename:b[15]||"",search:b[16]||"",hash:b[18]||"",hashSearch:b[19]||""})},makePathAbsolute:function(a,b){var c,d,e,f;if(a&&"/"===a.charAt(0))return a;for(a=a||"",b=b?b.replace(/^\/|(\/[^\/]*|[^\/]+)$/g,""):"",c=b?b.split("/"):[],d=a.split("/"),f=0;f<d.length;f++)switch(e=d[f]){case".":break;case"..":c.length&&c.pop();break;default:c.push(e)}return"/"+c.join("/")},isSameDomain:function(a,b){return j.parseUrl(a).domain===j.parseUrl(b).domain},isRelativeUrl:function(a){return""===j.parseUrl(a).protocol},isAbsoluteUrl:function(a){return""!==j.parseUrl(a).protocol},makeUrlAbsolute:function(a,b){var c,d,e,f,g,h,i,k,l;return j.isRelativeUrl(a)?(c=j.parseUrl(a),d=j.parseUrl(b),e=c.protocol||d.protocol,f=c.protocol?c.doubleSlash:c.doubleSlash||d.doubleSlash,g=c.authority||d.authority,h=""!==c.pathname,i=j.makePathAbsolute(c.pathname||d.filename,d.pathname),k=c.search||!h&&d.search||"",l=c.hash,e+f+g+i+k+l):a},addSearchParams:function(a,b){var c,d=j.parseUrl(a),e="object"==typeof b?this.getAsURIParameters(b):b,f=d.hash;return j.isEmbedded(a)&&e.length>0?(c=d.hashSearch||"?",d.hrefNoHash+(f||"")+c+("?"===c.charAt(c.length-1)?"":"&")+e):(c=d.search||"?",d.hrefNoSearch+c+("?"===c.charAt(c.length-1)?"":"&")+e+(f||""))},addHashSearchParams:function(a,b){var c=j.parseUrl(a),d="object"==typeof b?j.getAsURIParameters(b):b,e=c.hash,f=e?e.indexOf("?")<0?e+"?":e+"&":"#?";return c.hrefNoHash+f+("?"===f.charAt(f.length-1)?"":"&")+d},convertUrlToDataUrl:function(b,c,d){var e=j.parseUrl(b);return j.isEmbeddedPage(e,!!c)?j.getFilePath(e.hash+e.hashSearch,c):(d=d||j.documentBase,j.isSameDomain(e,d)?e.hrefNoHash.replace(d.domain,""):a.decodeURIComponent(b))},get:function(a){return a===c&&(a=this.parseLocation().hash),this.stripHash(a).replace(/[^\/]*\.[^\/*]+$/,"")},isPath:function(a){return/\//.test(a)},clean:function(a,b){return a.replace(b.domain,"")},stripHash:function(a){return a.replace(/^#/,"")},stripQueryParams:function(a){return a.replace(/\?.*$/,"")},isHashValid:function(a){return/^#[^#]+$/.test(a)},isExternal:function(a,b){var c=j.parseUrl(a);return c.protocol&&c.domain!==b.domain?!0:!1},hasProtocol:function(a){return/^(:?\w+:)/.test(a)},isEmbedded:function(a){var b=j.parseUrl(a);return""!==b.protocol?!j.isPath(b.hash)&&!!b.hash&&b.hrefNoHash===j.parseLocation().hrefNoHash:/\?.*#|^#/.test(b.href)},squash:function(a,b){var c,d,e,f,g=this.isPath(a),h=this.parseUrl(a),i=h.hash,k="";return b=b||(j.isPath(a)?j.getLocation():j.getDocumentUrl()),d=g?j.stripHash(a):a,d=j.isPath(h.hash)?j.stripHash(h.hash):d,f=d.indexOf(this.uiStateKey),f>-1&&(k=d.slice(f),d=d.slice(0,f)),c=j.makeUrlAbsolute(d,b),e=this.parseUrl(c).search,g?((j.isPath(i)||0===i.replace("#","").indexOf(this.uiStateKey))&&(i=""),k&&-1===i.indexOf(this.uiStateKey)&&(i+=k),-1===i.indexOf("#")&&""!==i&&(i="#"+i),c=j.parseUrl(c),c=c.protocol+"//"+c.host+c.pathname+e+i):c+=c.indexOf("#")>-1?k:"#"+k,c},isPreservableHash:function(a){return 0===a.replace("#","").indexOf(this.uiStateKey)},hashToSelector:function(a){var b="#"===a.substring(0,1);return b&&(a=a.substring(1)),(b?"#":"")+a.replace(new RegExp("([!\"#$%&'()*+,./:;<=>?@[\\]^`{|}~])","g"),"\\$1")},isFirstPageUrl:function(a,b,d,e,f){var g,h,i,k;return d=d===c?j.documentBase:d,e=e===c?j.documentBaseDiffers:e,f=f===c?j.documentUrl:f,g=j.parseUrl(j.makeUrlAbsolute(a,d)),h=g.hrefNoHash===f.hrefNoHash||e&&g.hrefNoHash===d.hrefNoHash,i=b&&b.id||!1,k=g.hash,h&&(!k||"#"===k||i&&k.replace(/^#/,"")===i)},isPermittedCrossDomainRequest:function(a,b){return d.getConfig("allowCrossDomainPages",!1)&&"file:"===a.protocol&&-1!==b.search(/^https?:/)},getAsURIParameters:function(a){var b,c="";for(b in a)a.hasOwnProperty(b)&&(c+=encodeURIComponent(b)+"="+encodeURIComponent(a[b])+"&");return c.substring(0,c.length-1)},documentUrl:null,documentBaseDiffers:!1,set:function(a){i.hash=a},getFilePath:function(a,b){var c="&"+d.getConfig("subPageUrlKey","");return a&&a.split(c)[0].split(b)[0]},cleanHash:function(a,b){return j.stripHash(a.replace(/\?.*$/,"").replace(b,""))},isEmbeddedPage:function(a,b){var c=j.parseUrl(a);return""!==c.protocol?c.hash&&(b?c.hrefNoHash===j.documentUrl.hrefNoHash:c.hrefNoHash===j.parseLocation().hrefNoHash):/^#/.test(c.href)}};j.documentUrl=j.parseLocation(),e=b.querySelector("base"),j.documentBase=e?j.parseUrl(j.makeUrlAbsolute(e.getAttribute("href"),j.documentUrl.href)):j.documentUrl,j.documentBaseDiffers=j.documentUrl.hrefNoHash!==j.documentBase.hrefNoHash,j.getDocumentBase=function(a){return a?f.copy(j.documentBase):j.documentBase.href},j.getClosestBaseUrl=function(a,b){var c=h.getNSData(g.getClosestBySelector(a,b),"url"),e=j.documentBase.hrefNoHash;return d.getConfig("dynamicBaseEnabled",!0)&&c&&j.isPath(c)||(c=e),j.makeUrlAbsolute(c,e)},d.util.path=j}(a,a.document,d),function(a){function b(a){for(var b,c=[],d=0,e=0,g="";null!=(b=o.exec(a));){var h=b[0],i=b[1],j=b.index;if(g+=a.slice(e,j),e=j+h.length,i)g+=i[1];else{g&&(c.push(g),g="");var k=b[2],l=b[3],m=b[4],n=b[5],p=b[6],q="+"===p||"*"===p,r="?"===p||"*"===p,s=k||"/";c.push({name:l||d++,prefix:k||"",delimiter:s,optional:r,repeat:q,pattern:f(m||n||"[^"+s+"]+?")})}}return e<a.length&&(g+=a.substr(e)),g&&c.push(g),c}function c(a){return d(b(a))}function d(a){for(var b=new Array(a.length),c=0;c<a.length;c++)"object"==typeof a[c]&&(b[c]=new RegExp("^"+a[c].pattern+"$"));return function(c){var d="";c=c||{};for(var e=0;e<a.length;e++){var f=a[e];if("string"!=typeof f){var g=c[f.name];if(null==g){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to be defined')}if(n(g)){if(!f.repeat)throw new TypeError('Expected "'+f.name+'" to not repeat');if(0===g.length){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to not be empty')}for(var h=0;h<g.length;h++){if(!b[e].test(g[h]))throw new TypeError('Expected all "'+f.name+'" to match "'+f.pattern+'"');d+=(0===h?f.prefix:f.delimiter)+encodeURIComponent(g[h])}}else{if(!b[e].test(g))throw new TypeError('Expected "'+f.name+'" to match "'+f.pattern+'"');d+=f.prefix+encodeURIComponent(g)}}else d+=f}return d}}function e(a){return a.replace(/([.+*?=^!:${}()[\]|\/])/g,"\\$1")}function f(a){return a.replace(/([=!:$\/()])/g,"\\$1")}function g(a,b){return a.keys=b,a}function h(a){return a.sensitive?"":"i"}function i(a,b){var c=a.source.match(/\((?!\?)/g);if(c)for(var d=0;d<c.length;d++)b.push({name:d,prefix:null,delimiter:null,optional:!1,repeat:!1,pattern:null});return g(a,b)}function j(a,b,c){for(var d=[],e=0;e<a.length;e++)d.push(m(a[e],b,c).source);var f=new RegExp("(?:"+d.join("|")+")",h(c));return g(f,b)}function k(a,c,d){for(var e=b(a),f=l(e,d),h=0;h<e.length;h++)"string"!=typeof e[h]&&c.push(e[h]);return g(f,c)}function l(a,b){b=b||{};for(var c=b.strict,d=b.end!==!1,f="",g=a[a.length-1],i="string"==typeof g&&/\/$/.test(g),j=0;j<a.length;j++){var k=a[j];if("string"==typeof k)f+=e(k);else{var l=e(k.prefix),m=k.pattern;k.repeat&&(m+="(?:"+l+m+")*"),m=k.optional?l?"(?:"+l+"("+m+"))?":"("+m+")?":l+"("+m+")",f+=m}}return c||(f=(i?f.slice(0,-2):f)+"(?:\\/(?=$))?"),f+=d?"$":c&&i?"":"(?=\\/|$)",new RegExp("^"+f,h(b))}function m(a,b,c){return b=b||[],n(b)?c||(c={}):(c=b,b=[]),a instanceof RegExp?i(a,b,c):n(a)?j(a,b,c):k(a,b,c)}var n=Array.isArray;m.parse=b,m.compile=c,m.tokensToFunction=d,m.tokensToRegExp=l;var o=new RegExp(["(\\\\.)","([\\/.])?(?:\\:(\\w+)(?:\\(((?:\\\\.|[^)])*)\\))?|\\(((?:\\\\.|[^)])*)\\))([+*?])?"].join("|"),"g");a.pathToRegexp=m}(a),function(a){d.util.pathToRegexp=a.pathToRegexp}(a),function(){d.router=d.router||{}}(),function(){d.router.route=d.router.route||{}}(),function(a){var b,c=d.util.object,e=0,f=0,g=a.history,h={activeState:null,replace:function(a,d,i){var j=c.merge({},a,{uid:b?f:++e,stateUrl:i,stateTitle:d});g[b?"replaceState":"pushState"](j,d,i),h.setActive(j)},back:function(){g.back()},setActive:function(a){return a&&(h.activeState=a,f=a.uid,a.volatileRecord)?void h.enableVolatileMode():void h.disableVolatileMode()},getDirection:function(a){return a?a.uid<=f?"back":"forward":"back"},enableVolatileMode:function(){b=!0},disableVolatileMode:function(){b=!1}};d.history=h}(a),function(a,b,d){function e(a,b,c,d){var e,f,g,h;for(e=0,f=d.length;f>e;++e)h=d[e],(isNaN(c[h])===!1||isNaN(a[h])===!1)&&(g=Object.getOwnPropertyDescriptor(b,h),"detail"===h||g&&!g.writable||(b[h]=c[h]||a[h]))}function f(a,b,c){var d,f,g,h,i=new CustomEvent(a,{bubbles:b.bubbles,cancelable:b.cancelable,detail:b.detail}),j=b.type,k=0;if(e(b,i,c,x),i._originalEvent=b,-1!==j.indexOf("touch")&&(j=b.touches,d=b.changedTouches,f=j&&j.length?j[0]:d&&d.length?d[0]:null))for(g=D.length;g>k;k++)h=D[k],i[h]=f[h];return i}function g(a,b,c){return b.target.dispatchEvent(f(a,b,c||{}))}function h(a){g("vmousedown",a)}function i(a){var b=a.clientX,c=a.clientY;return b||c?void 0:t(a)}function j(a){g("vclick",a,i(a))}function k(a){g("vmouseup",a)}function l(a){g("vmousemove",a)}function m(a){g("vmouseover",a)}function n(a){g("vmouseout",a)}function o(a){var b,c=a.touches;c&&1===c.length&&(y=!1,b=c[0],B=b.pageX,C=b.pageY,g("vmousedown",a))}function p(a){var b=a.touches;b&&0===b.length&&(g("vmouseup",a),g("vmouseout",a),A=null)}function q(a){var d,e=a.touches&&a.touches[0],f=y,h=w.eventDistanceThreshold;return e===c||e.identifier>0?void a.stopPropagation():(y=y||Math.abs(e.pageX-B)>h||Math.abs(e.pageY-C)>h,d=b.elementFromPoint(e.pageX,e.pageY),d&&A!==d&&(A=d,g("vmouseover",a)),y&&!f&&(g("vmousecancel",a),A=null),void g("vmousemove",a))}function r(a){y||g("vmousecancel",a),y=!0}function s(a){g("vmousecancel",a),A=null}function t(a){var b=a.target&&a.target.getBoundingClientRect(),c={};return b&&(c={clientX:b.left+b.width/2,clientY:b.top+b.height/2,which:1}),c}function u(a){var b;a.keyCode===E.enter&&(b=t(a),g("vmouseup",a,b),g("vclick",a,b))}function v(a){a.keyCode===E.enter&&g("vmousedown",a,t(a))}var w,x,y,z=a.hasOwnProperty("ontouchstart"),A=null,B=0,C=0,D=["clientX","clientY","pageX","pageY","screenX","screenY"],E={enter:13};x=["currentTarget","detail","button","buttons","clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","toElement","which"],w={eventDistanceThreshold:10,touchSupport:z},w.bindCommonEvents=function(){b.addEventListener("keyup",u,!0),b.addEventListener("keydown",v,!0),b.addEventListener("scroll",r,!0),b.addEventListener("click",j,!0)},w.bindTouch=function(){b.addEventListener("touchstart",o,!0),
b.addEventListener("touchend",p,!0),b.addEventListener("touchmove",q,!0),b.addEventListener("touchcancel",s,!0)},w.bindMouse=function(){b.addEventListener("mousedown",h,!0),b.addEventListener("mouseup",k,!0),b.addEventListener("mousemove",l,!0),b.addEventListener("mouseover",m,!0),b.addEventListener("mouseout",n,!0)},w.unbindTouch=function(){b.removeEventListener("touchstart",o,!0),b.removeEventListener("touchend",p,!0),b.removeEventListener("touchmove",q,!0),b.removeEventListener("touchcancel",s,!0),b.removeEventListener("click",j,!0)},w.unbindMouse=function(){b.removeEventListener("mousedown",h,!0),b.removeEventListener("mouseup",k,!0),b.removeEventListener("mousemove",l,!0),b.removeEventListener("mouseover",m,!0),b.removeEventListener("mouseout",n,!0),b.removeEventListener("keyup",u,!0),b.removeEventListener("keydown",v,!0),b.removeEventListener("scroll",r,!0),b.removeEventListener("click",j,!0)},d.event.vmouse=w,z?w.bindTouch():w.bindMouse(),w.bindCommonEvents()}(a,a.document,d),function(a,b){function c(a){return o.trigger(b,t,a,!0,!0)}function e(a){var b,d,e,f,g=a.target,h=p.getClosestBySelector(g,l);return!h||1!==a.which||(b=h.getAttribute("href"),f=h.getAttribute("rel"),d="external"===f||h.hasAttribute("target"),d||(e=s.getData(h),e.event=a,f&&!e.rel?e.rel=f:f=e.rel,b&&!e.href&&(e.href=b),"popup"===f&&h&&!e.link&&(e.link=h),n.disableVolatileMode(),c(e)||f&&"back"===f))?!0:(o.preventDefault(a),!1)}function f(a){var d,e=a.state,f=n.activeState,g={},i=!0,j=!1;h.locked?(n.disableVolatileMode(),f&&n.replace(f,f.stateTitle,f.stateUrl)):e&&(d="back"===n.getDirection(e),g=q.merge(g,e,{reverse:d,transition:d?f&&f.transition||"none":e.transition,fromHashChange:!0}),f&&(i=o.trigger(b,u,q.merge(g,{url:r.getLocation(),stateUrl:f.stateUrl}),!0,!0),j=i),e.url=r.getLocation(),n.setActive(e),j||(g.event=a,c(g)))}function g(a){var b=a.newURL;b&&n.activeState.url!==b&&c({href:b,fromHashChange:!0,event:a})}var h=Object.create(null),i="popstate",j="hashchange",k="vclick",l="a,tau-button",m=d.util,n=d.history,o=d.event,p=m.selectors,q=m.object,r=m.path,s=m.DOM,t="historystatechange",u="historyhashchange",v="historyenabled",w="historydisabled",x={STATECHANGE:t,HASHCHANGE:u,ENABLED:v,DISABLED:w};h.events=x,h.enabled=!0,h.locked=!1,h.lock=function(){this.locked=!0},h.unlock=function(){this.locked=!1},h.enable=function(){b.addEventListener(k,e,!1),a.addEventListener(i,f,!1),a.addEventListener(j,g,!1),n.enableVolatileMode(),this.enabled=!0,o.trigger(b,v,this)},h.disable=function(){b.removeEventListener(k,e,!1),a.removeEventListener(i,f,!1),a.removeEventListener(j,g,!1),n.disableVolatileMode(),this.enabled=!1,o.trigger(b,w,this)},d.history.manager=h}(a,a.document),function(){function a(a,b){return b.toLocaleUpperCase()}function b(a,b){return"-"+b.toLowerCase()}function c(b){return b.replace(i,a)}function e(a){return a.replace(j,b)}function f(a){return a.charAt(0).toLocaleUpperCase()+a.substring(1)}function g(a){var b;return a&&-1===(a+"").indexOf("%")?(b=parseInt(a,10),isNaN(b)&&(b=null),b):a}function h(a){var b;return b="string"==typeof a?a.split(","):a||[],k.map(b,g)}var i=/-([a-z])/gi,j=/([A-Z])/g,k=d.util.array;d.util.string={dashesToCamelCase:c,camelCaseToDashes:e,firstToUpperCase:f,parseProperty:h}}(),function(a,c){function d(b,c,d,e){var f,g=a.getComputedStyle(b),h=d;if(g&&(f=g.getPropertyValue(c)))switch(e){case"integer":f=parseInt(f,10),isNaN(f)||(h=f);break;case"float":f=parseFloat(f),isNaN(f)||(h=f);break;default:h=f}return h}function e(a){return(a+"").indexOf(".")>-1?parseFloat(a):parseInt(a,10)}function f(b,c,d,f){var g,h,i,j=a.getComputedStyle(b,d);for(g in c)c.hasOwnProperty(g)&&(h=j.getPropertyValue(g),i=e(h),isNaN(i)&&f||(h=i),c[g]=h)}function g(a,b,c,d,e){var g,h,i,j,k=a.style;return"none"!==k.display?(f(a,b,c,!0),j=a[e]):d&&(g=k.display,h=k.visibility,i=k.position,k.display="block",k.visibility="hidden",k.position="relative",f(a,b,c,!0),j=a[e],k.display=g,k.visibility=h,k.position=i),j}function h(a,b,c,d,f,h){var i,j,k=0,l=b&&"outer"===b||!1,m={height:0,"margin-top":0,"margin-bottom":0,"padding-top":0,"padding-bottom":0,"border-top-width":0,"border-bottom-width":0,"box-sizing":""};if(a){i=g(a,m,f,h,"offsetHeight");for(j in m)m.hasOwnProperty(j)&&"box-sizing"!==j&&(m[j]=e(m[j]));k+=m.height,"border-box"!==m["box-sizing"]&&(k+=m["padding-top"]+m["padding-bottom"]),c?k=i:l&&"border-box"!==m["box-sizing"]&&(k+=m["border-top-width"]+m["border-bottom-width"]),d&&(k+=Math.max(0,m["margin-top"])+Math.max(0,m["margin-bottom"]))}return k}function i(a,b,c,d,e,f){var h,i,j,k=0,l=b&&"outer"===b||!1,m={width:0,"margin-left":0,"margin-right":0,"padding-left":0,"padding-right":0,"border-left-width":0,"border-right-width":0,"box-sizing":""};if(a){i=g(a,m,e,f,"offsetWidth");for(j in m)m.hasOwnProperty(j)&&"box-sizing"!==j&&(h=parseFloat(m[j]),m[j]=h);k+=m.width,"border-box"!==m["box-sizing"]&&(k+=m["padding-left"]+m["padding-right"]),c?k=i:l&&"border-box"!==m["box-sizing"]&&(k+=m["border-left-width"]+m["border-right-width"]),d&&(k+=Math.max(0,m["margin-left"])+Math.max(0,m["margin-right"]))}return k}function j(a){var b=0,c=0,d=a;do c+=d.offsetTop,b+=d.offsetLeft,d=d.offsetParent;while(null!==d);return{top:c,left:b}}function k(a){return!(a.offsetWidth<=0&&a.offsetHeight<=0)}function l(a,b,c){var d=a.style,e=b,f="object"!=typeof c?{webkit:c,moz:c,o:c,ms:c,normal:c}:c;d.setProperty(b,f.normal),d.setProperty("-webkit-"+e,f.webkit),d.setProperty("-moz-"+e,f.moz),d.setProperty("-o-"+e,f.o),d.setProperty("-ms-"+e,f.ms)}function m(a){return{webkit:"-webkit-"+a,moz:"-moz-"+a,o:"-ms-"+a,ms:"-o-"+a,normal:a}}function n(a,b){var c,d,e=m(b);for(d in e)if(e.hasOwnProperty(d)&&(c=a[e[d]],c&&"none"!==c))return c;return c}function o(a){var b="",c=t.parseProperty(a);return c&&2===c.length&&(b="width: "+c[0]+"px; height: "+c[1]+"px;"),b}function p(a,c,d){var e,f,g,h=[];r||(e=b.head||b.getElementsByTagName("head")[0],f=b.createElement("style"),f.type="text/css",e.appendChild(f),r=f.sheet);for(g in d)d.hasOwnProperty(g)&&h.push(g+": "+d[g]);return h.length?r.addRule(a+"::"+c,h.join("; ")):null}function q(a){r&&r.deleteRule(a)}var r,s=c.util.DOM,t=c.util.string;s.getCSSProperty=d,s.extractCSSProperties=f,s.getElementHeight=h,s.getElementWidth=i,s.getElementOffset=j,s.isOccupiedPlace=k,s.setPrefixedStyle=l,s.getPrefixedValue=m,s.getPrefixedStyleValue=n,s.toCSSSize=o,s.setStylesForPseudoClass=p,s.removeCSSRule=q}(a,d),function(a,b){var c=function(){this._data=[]};c.prototype={add:function(){var a=this._data;this._data=a.concat.apply(a,[].slice.call(arguments)).filter(function(a,b,c){return c.indexOf(a)===b})},clear:function(){this._data=[]},"delete":function(a){var b=this._data,c=b.indexOf(a);c>-1&&b.splice(c,1)},has:function(a){return this._data.indexOf(a)>-1},forEach:function(a){this._data.forEach(a)}},b.util._Set=c,b.util.Set=a.Set||c}(a,d),function(a){function b(a,b,c){var d={name:a,element:b,options:c};return d}function c(a,c,d){var e=b(a,c,d);return g.instanceWidget(e.element,e.name,e.options)}function e(a){var b=a.detail,e=b.name;d.widget[e]=c.bind(null,e)}function f(){a.removeEventListener(h.WIDGET_DEFINED,e,!0),a.removeEventListener(h.DESTROY,f,!1)}var g=d.engine,h=g.eventType,i={getInstance:g.getBinding,getAllInstances:g.getAllBindings};a.addEventListener(h.WIDGET_DEFINED,e,!0),a.addEventListener(h.DESTROY,f,!1),d.widget=i}(a.document),function(a,b){function d(a){return!a.toRemove}function e(a){a.object[a.property]===a.value&&(n.requestAnimationFrame(a.callback.bind(a.object)),a.toRemove=!0)}function f(){j.forEach(e),j=j.filter(d),j.length&&n.requestAnimationFrame(f)}function g(a,b){var d=b.classList;d!==c&&(d instanceof s?d.clear():(d=new s,b.classList=d),a.classList.length&&d.add.apply(d,k.call(a.classList)))}function h(a,b){g(a,b),b.offsetWidth!==c&&(b.offsetWidth=a.offsetWidth),b.style!==c&&p.extractCSSProperties(a,b.style,null,!0),b.children!==c&&b.children.forEach(function(b,c){h(a.children[c],b)})}function i(a,b,d){var e=!1;a.classList!==c&&(k.call(b.classList).forEach(function(c){a.classList.has(c)||(b.classList.remove(c),e=!0)}),a.classList.forEach(function(a){b.classList.contains(a)||(b.classList.add(a),e=!0)})),a.style!==c&&Object.keys(a.style).forEach(function(c){b.style[c]=a.style[c]}),a.children!==c&&a.children.forEach(function(a,c){i(a,b.children[c],!0)}),e&&!d&&n.requestAnimationFrame(h.bind(null,b,a))}var j,k=[].slice,l=b.engine,m=l.dataTau,n=b.util,o=b.event,p=n.DOM,q=n.string,r=n.object,s=n.Set,t=function(){return this.flowState="created",this},u=p.getNSData,v={},w="function",x="ui-state-disabled",y="aria-disabled";t.classes={disable:x},v._configureDefinition=function(a){var c,d,e=this;a&&(c=a.name,d=a.namespace,e.name=c,e.widgetName=c,e.widgetEventPrefix=c.toLowerCase(),e.namespace=d,e.widgetFullName=((d?d+"-":"")+c).toLowerCase(),e.id=b.getUniqueId(),e.selector=a.selector)},v.configure=function(a,b,c){var d=this;d.flowState="configuring",d.options=d.options||{},d.element=d.element||null,d._configureDefinition(a),typeof d._configure===w&&d._configure(b),d.isCustomElement=!!b.createdCallback,d._getCreateOptions(b),r.fastMerge(d.options,c),d.flowState="configured"},v._getCreateOptions=function(a){var b=this,c=b.options,d=a.localName.toLowerCase();return c&&Object.keys(c).forEach(function(e){var f=q.camelCaseToDashes(e),g=u(a,f,!0),h=u(a,f);null!==h?c[e]=h:"boolean"==typeof c[e]&&b._readBooleanOptionFromElement(a,e),("type"!==e||"input"!==d)&&null!==g&&(c[e]=g)}),c},v.build=function(a){var b,c,d=this,e=a.getAttribute(m.built),f=a.getAttribute(m.name);return o.trigger(a,d.widgetEventPrefix+"beforecreate"),d.flowState="building",b=a.id,b?d.id=b:a.id=d.id,c=typeof d._build===w?d._build(a):a,d._setBooleanOptions(a),e=e?e+m.separator+d.name:d.name,f=f?f+m.separator+d.name:d.name,a.setAttribute(m.built,e),a.setAttribute(m.name,f),d.flowState="built",c},v.init=function(a){var b=this;return b.id=a.id,b.flowState="initiating",typeof b._init===w&&b._init(a),a.getAttribute("disabled")||b.options.disabled===!0?b.disable():b.enable(),b.flowState="initiated",b},v.getContainer=function(){var a=this;return typeof a._getContainer===w?a._getContainer():a.element},v.bindEvents=function(a,b){var c=this,d=a.getAttribute(m.bound);return b||(d=d?d+m.separator+c.name:c.name,a.setAttribute(m.bound,d)),typeof c._buildBindEvents===w&&c._buildBindEvents(a),b||typeof c._bindEvents!==w||c._bindEvents(a),c.trigger(c.widgetEventPrefix+"create",c),c},v.focus=function(b){var c,d,e=this,f=e.element;return b=b||{},c=b.previousElement,c&&(d=l.getBinding(c),d?(b=r.merge({},b,{element:c}),d.blur(b)):c.blur()),b=r.merge({},b,{element:f}),o.trigger(a,"taufocus",b),f.focus(),!0},v.blur=function(b){var c=this,d=c.element;return b=r.merge({},b,{element:d}),o.trigger(a,"taublur",b),d.blur(),!0},v.destroy=function(a){var b=this;a=a||b.element,b.flowState="destroying",typeof b._destroy===w&&b._destroy(a),b.element&&b.trigger(b.widgetEventPrefix+"destroy"),a&&l.removeBinding(a,b.name),b.flowState="destroyed"},v.disable=function(){var a=this,b=k.call(arguments),c=a.element;return c.classList.add(x),c.setAttribute(y,!0),typeof a._disable===w&&(b.unshift(c),a._disable.apply(a,b)),this},v.isDisabled=function(){var a=this;return a.element.getAttribute("disabled")||a.options.disabled===!0},v.enable=function(){var a=this,b=k.call(arguments),c=a.element;return c.classList.remove(x),c.setAttribute(y,!1),typeof a._enable===w&&(b.unshift(c),a._enable.apply(a,b)),this},v.refresh=function(){var a=this;return typeof a._refresh===w&&a._refresh.apply(a,arguments),a},v._readBooleanOptionFromElement=function(a,b){var c,d=this._classesPrefix;d&&(c=d+q.camelCaseToDashes(b),this.options[b]=a.classList.contains(c))},v._setBooleanOption=function(a,b,c){var d,e=this._classesPrefix;return e&&(d=e+q.camelCaseToDashes(b),a.classList.toggle(d,c)),!1},v._setBooleanOptions=function(a){var b=this,d=b._classesPrefix,e=b.options;return d&&e!==c&&Object.keys(e).forEach(function(c){"boolean"==typeof e[c]&&(e[c]=b._setBooleanOption(a,c,e[c]))}),e},v._processOptionObject=function(a){var b,d,e=this,f=!1;for(b in a)a.hasOwnProperty(b)&&(d=e._oneOption(b,a[b]),b!==c&&a[b]!==c&&(f=f||d));return f},v.option=function(a,b){var d=this,e=a,f=b,g=null,h=!1;return"string"==typeof e?(g=d._oneOption(e,f),f!==c&&(h=g,g=null)):"object"==typeof e&&(h=d._processOptionObject(e)),h&&d.refresh(),g},v._oneOption=function(a,b){var d,e=this,f=!1;return b===c?(d="_get"+(a[0].toUpperCase()+a.slice(1)),typeof e[d]===w?e[d]():e.options[a]):(d="_set"+(a[0].toUpperCase()+a.slice(1)),typeof e[d]===w?f=e[d](e.element,b):"boolean"==typeof b?f=e._setBooleanOption(e.element,a,b):(e.options[a]=b,e.element&&(e.element.setAttribute("data-"+a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()}),b),f=!0)),f)},v.isBound=function(a){var b=this.element;return a=a||this.name,b&&b.hasAttribute(m.bound)&&b.getAttribute(m.bound).indexOf(a)>-1},v.isBuilt=function(a){var b=this.element;return a=a||this.name,b&&b.hasAttribute(m.built)&&b.getAttribute(m.built).indexOf(a)>-1},v.value=function(a){var b=this;return a!==c?typeof b._setValue===w?b._setValue(a):b:typeof b._getValue===w?b._getValue():b},v.trigger=function(a,b,c,d){return o.trigger(this.element,a,b,c,d)},v.on=function(a,b,c){o.on(this.element,a,b,c)},v.off=function(a,b,c){o.off(this.element,a,b,c)},v._framesFlow=function(){var a=this,b=k.call(arguments),d=b.shift();"function"==typeof d&&d(),d!==c&&n.requestAnimationFrame(function(){a._framesFlow.apply(a,b)})},v._waitFor=function(a,b,c){var d=this;d[a]===b?c.call(d):(j=j||[],j.push({object:d,property:a,value:b,callback:c})),f()},v._render=function(a){var b=this,c=b._stateDOM,d=b.element;a?i(c,d):n.requestAnimationFrame(i.bind(null,c,d))},v._initDOMstate=function(){h(this.element,this._stateDOM)},v._togglePrefixedClass=function(a,b,c){var d=!1,e=b+c;return a.classList.forEach(function(c){0===c.indexOf(b)&&e!==c&&(a.classList["delete"](c),d=!0)}),a.classList.has(e)||(a.classList.add(e),d=!0),d},t.prototype=v,b.widget.BaseWidget=t}(a.document,d),function(a,b){b.widget.core=b.widget.core||{}}(a.document,d),function(b,d){var e=d.widget.BaseWidget,f=d.util,g=f.DOM,h=f.selectors,i=d.engine,j=function(){var a=this;a._contentFillAfterResizeCallback=null,a._initialContentStyle={},a.options={},a._contentStyleAttributes=["height","width","minHeight","marginTop","marginBottom"],a._ui={}},k={SHOW:"pageshow",HIDE:"pagehide",CREATE:"pagecreate",BEFORE_CREATE:"pagebeforecreate",BEFORE_SHOW:"pagebeforeshow",BEFORE_HIDE:"pagebeforehide"},l={uiPage:"ui-page",uiPageActive:"ui-page-active",uiSection:"ui-section",uiHeader:"ui-header",uiFooter:"ui-footer",uiContent:"ui-content",uiTitle:"ui-title",uiPageScroll:"ui-scroll-on",uiScroller:"ui-scroller"},m="header,[data-role='header'],."+l.uiHeader,n="footer,[data-role='footer'],."+l.uiFooter,o="[data-role='content'],."+l.uiContent,p=new e;j.classes=l,j.events=k,p._configure=function(){var a=this.options;a.header=null,a.footer=null,a.content=null,a.enablePageScroll=d.getConfig("enablePageScroll"),a.autoBuildWidgets=d.getConfig("autoBuildOnPageChange"),this.options=a},p._contentFill=function(){var b,c=this,d=c.element,e=a.innerWidth,f=a.innerHeight,h=d.style,i=c._ui,j=i.content,k=i.header,l=0,m=0,n=i.footer;h.width=e+"px",h.height=f+"px",j&&!d.classList.contains("ui-page-flex")&&(b=j.style,k&&(l=g.getElementHeight(k)),n&&(m=g.getElementHeight(n),b.marginBottom=m+"px",b.paddingBottom=-m+"px"),c.options.enablePageScroll||(b.height=f-l-m+"px"))},p._storeContentStyle=function(){var a=this,b=a._initialContentStyle,c=a._contentStyleAttributes,d=a.element.querySelector("."+l.uiContent),e=d?d.style:{};c.forEach(function(a){b[a]=e[a]})},p._restoreContentStyle=function(){var a=this,b=a._initialContentStyle,c=a._contentStyleAttributes,d=a.element.querySelector("."+l.uiContent),e=d?d.style:{};c.forEach(function(a){e[a]=b[a]})},p._setFooter=function(a,c){var d=this,e=d._ui,f=e.footer;!f&&c&&(f=b.createElement("footer"),a.appendChild(f),e.footer=f),f&&(c===!1?(a.removeChild(f),e.footer=null):(f.classList.add(l.uiFooter),"string"==typeof c&&(e.footer.textContent=c)),d.options.footer=c)},p._setHeader=function(a,c){var d=this,e=d._ui,f=e.header;!f&&c&&(f=b.createElement("header"),a.appendChild(f),e.header=f),f&&(c===!1?(a.removeChild(f),e.header=null):(f.classList.add(l.uiHeader),"string"==typeof c&&(e.header.textContent=c)),d.options.header=c)},p._setContent=function(a,c){var d,e=this,f=e._ui,g=f.content,h=a.firstChild;if(!g&&c){for(g=b.createElement("div");h;)d=h.nextSibling,h!==f.footer&&h!==f.header&&g.appendChild(h),h=d;a.insertBefore(g,f.footer),f.content=g}g&&(c===!1?(a.removeChild(g),f.content=null):(g.classList.add(l.uiContent),"string"==typeof c&&(g.textContent=c)),e.options.content=c)},p._buildHeader=function(a){var b=this;b._ui.header=h.getChildrenBySelector(a,m)[0]||null,b.options.header===c&&(b.options.header=!!b._ui.header),b._setHeader(a,b.options.header)},p._buildFooter=function(a){var b=this;b._ui.footer=h.getChildrenBySelector(a,n)[0]||null,b.options.footer===c&&(b.options.footer=!!b._ui.footer),b._setFooter(a,b.options.footer)},p._buildContent=function(a){var b=this;b._ui.content=h.getChildrenBySelector(a,o)[0]||null,b.options.content===c&&(b.options.content=!!b._ui.content),b._setContent(a,b.options.content)},p._setAria=function(){var a=this,b=a._ui,c=b.content,d=b.header,e=b.footer,f=b.title;c&&c.setAttribute("role","main"),d&&d.setAttribute("role","header"),e&&e.setAttribute("role","footer"),f&&(f.setAttribute("role","heading"),f.setAttribute("aria-level",1),f.setAttribute("aria-label","title"))},p._setTitle=function(a){var b,c=this,d=g.getNSData(a,"title"),e=c._ui.header,f=d;e&&(b=h.getChildrenBySelector(e,"h1, h2, h3, h4, h5, h6")[0],b&&b.classList.add(l.uiTitle),!f&&b&&(f=b.innerText,c._ui.title=b),!d&&f&&g.setNSData(a,"title",f))},p._build=function(a){var b=this;return a.classList.add(l.uiPage),b._buildHeader(a),b._buildFooter(a),b._buildContent(a),b._setTitle(a),b._setAria(),b.options.enablePageScroll!==!0||a.querySelector("."+l.uiScroller)||i.instanceWidget(a,"Scrollview"),a},p.setActive=function(a){var b=this.element.classList;a||a===c?(this.focus(),b.add(l.uiPageActive)):(this.blur(),b.remove(l.uiPageActive))},p.isActive=function(){return this.element.classList.contains(l.uiPageActive)},p.focus=function(){var a=this.element,b=a.querySelector("[autofocus]")||a;b.focus()},p.blur=function(){var a=this.element,c=b.activeElement||a;c.blur()},p._bindEvents=function(){var b=this;b._contentFillAfterResizeCallback=b._contentFill.bind(b),a.addEventListener("resize",b._contentFillAfterResizeCallback,!1)},p._refresh=function(){this._restoreContentStyle(),this._contentFill()},p.layout=function(){this._storeContentStyle(),this._contentFill()},p.onBeforeShow=function(){this.trigger(k.BEFORE_SHOW)},p.onShow=function(){this.trigger(k.SHOW)},p.onBeforeHide=function(){this.trigger(k.BEFORE_HIDE)},p.onHide=function(){this._restoreContentStyle(),this.trigger(k.HIDE)},p._destroy=function(b){var c=this;b=b||c.element,a.removeEventListener("resize",c._contentFillAfterResizeCallback,!1),i.destroyAllWidgets(b,!0),c._contentFillAfterResizeCallback=null},p.getScroller=function(){var a=this.element,b=a.querySelector("."+l.uiScroller);return b||a.querySelector("."+l.uiContent)||a},j.prototype=p,j.createEmptyElement=function(){var a=b.createElement("div");return a.classList.add(l.uiPage),a},i.defineWidget("Page","[data-role=page],.ui-page",["focus","blur","setActive"],j,"mobile"),d.widget.core.Page=j}(a.document,d),function(b,c){function d(a,b,c,d){a&&(a.onHide(),d.reverse&&a.destroy(),c._removeExternalPage(a,d)),b.onShow(),c.trigger(k.PAGE_CHANGE)}var e=c.widget.BaseWidget,f=c.util,g=f.DOM,h=c.engine,i={pageContainer:"ui-page-container",uiViewportTransitioning:"ui-viewport-transitioning",out:"out","in":"in",reverse:"reverse",uiPreIn:"ui-pre-in",uiBuild:"ui-page-build"},j=function(){this.activePage=null,this.inTransition=!1},k={PAGE_BEFORE_CHANGE:"pagebeforechange",PAGE_CHANGE:"pagechange",PAGE_REMOVE:"pageremove"},l="animationend",m="webkitAnimationEnd",n="mozAnimationEnd",o="msAnimationEnd",p="oAnimationEnd",q=[l,m,n,o,p],r=new e;j.events=k,j.classes=i,r._build=function(a){return a.classList.add(i.pageContainer),a},r.change=function(a,b){var c,e=this,f=e.getActivePage(),g=b||{};e._options=g,g.widget=g.widget||"Page",f&&f.element===a||(a.parentNode!==e.element&&(a=e._include(a)),e.trigger(k.PAGE_BEFORE_CHANGE),a.classList.add(i.uiBuild),c=h.instanceWidget(a,g.widget),c.layout(),c.option("autoBuildWidgets")&&h.createWidgets(a),f&&f.onBeforeHide(),c.onBeforeShow(),a.classList.remove(i.uiBuild),g===e._options&&(g.deferred={resolve:d},e._transition(c,f,g)))},r._transition=function(b,c,d){var e,f,g=this,h=g.element,j=h.classList,k=c&&d.transition?d.transition:"none",l=d.deferred,m=[i["in"],i.out,i.uiPreIn,k];d.reverse&&m.push(i.reverse),g.inTransition=!0,j.add(i.uiViewportTransitioning),e=l.resolve,l.resolve=function(){var a=c&&c.element.classList,f=b.element.classList;g._setActivePage(b),g._clearTransitionClasses(m,a,f),e(c,b,g,d)},"none"!==k?(f=function(){b.off(q,f,!1),l.resolve()},b.on(q,f,!1),g._appendTransitionClasses(c,b,k,d.reverse)):a.setTimeout(l.resolve,0)},r._appendTransitionClasses=function(a,b,c,d){var e;a&&(e=a.element.classList,e.add(c,i.out),d&&e.add(i.reverse)),e=b.element.classList,e.add(c,i["in"],i.uiPreIn),d&&e.add(i.reverse)},r._clearTransitionClasses=function(a,b,c){var d=this,e=d.element,f=e.classList;f.remove(i.uiViewportTransitioning),d.inTransition=!1,a.forEach(function(a){c.remove(a)}),b&&a.forEach(function(a){b.remove(a)})},r._include=function(a){var c=this.element;return a.parentNode&&a.ownerDocument===b||(a=f.importEvaluateAndAppendElement(a,c)),a},r._setActivePage=function(a){var b=this;b.activePage&&b.activePage.setActive(!1),b.activePage=a,a.setActive(!0)},r.getActivePage=function(){return this.activePage},r._removeExternalPage=function(a,b){var c=a.element;b&&b.reverse&&g.hasNSData(c,"external")&&c.parentNode&&(c.parentNode.removeChild(c),this.trigger(k.PAGE_REMOVE))},j.prototype=r,c.widget.core.PageContainer=j,h.defineWidget("pagecontainer","",["change","getActivePage"],j,"core")}(a.document,d),function(){function a(a){return l[a]}function b(a,b){l[a]=b}function c(a,b){k[a]=b}function e(a){k[a]=null}function f(a){return k[a]}function g(a,b){var c=d.info.profile,e=a.lastIndexOf(".");return j.isAbsoluteUrl(a)?a:(b&&(a=a.substring(0,e)+"."+c+a.substring(e)),j.makeUrlAbsolute((l.pathPrefix||"")+a,j.getLocation()))}function h(b,c,e,f){var h,i=k[f||a("default")||""],j=function(a,b){a.absUrl=h,e(a,b)},m=function(a,d){a.success?j(a,d):(h=g(b,!1),i(l,h,c||{},j))};i||(i=k[Object.keys(k).pop()]),i?(h=g(b,d.getConfig("findProfileFile",!1)),i(l,h,c||{},m)):e({success:!1,description:"Can't get engine system"},null)}var i,j=d.util.path,k={},l={pathPrefix:"","default":""};i={get:a,set:b,register:c,unregister:e,engine:f,render:h},d.template=i}(),function(a,b){function c(a){for(;a&&(a.nodeType!==Node.ELEMENT_NODE||!a.nodeName||"A"!==a.nodeName);)a=a.parentNode;return a}function e(a,b){var d,e,f,g=c(b.target);g&&1===b.which&&(d=g.getAttribute("href"),e="external"===g.getAttribute("rel")||g.hasAttribute("target"),e||(f=q.getData(g),a.open(d,f,b),p.preventDefault(b)))}function f(a,b){var c,d,e,f,g,h=v.route,i=w.activeState,j=b&&"back"===w.getDirection(b),k=[],l=r.getLocation(),m=!0;f=j?i&&i.transition||"none":b.transition,e=t.merge({},b,{reverse:j,transition:f,fromHashChange:!0});for(d in h)h.hasOwnProperty(d)&&h[d].active&&k.push(h[d].orderNumber);if(c=Math.max.apply(null,k),g=h[D[c]],g&&g.onHashChange(l,e,i)){if(10===c)return;m=!1}w.setActive(b),m&&a.open(b.url,e)}function g(a){var b=G.classes,c="."+b.uiPageActive,d=B.call(a.querySelectorAll(c));d.forEach(function(a){a.classList.remove(c)})}function h(a,b){f(a,b.detail)}function i(a,b){var c=b.detail,d=c.reverse?c.url:c.href||c.url;delete c.event,a.open(d,c),p.preventDefault(b),p.stopImmediatePropagation(b)}function j(a,c){var e=null,f=b.implementation.createHTMLDocument(c),g=f.body;if(a instanceof HTMLElement)e=a;else try{g.insertAdjacentHTML("beforeend",a),e=g.firstChild}catch(h){d.error("Failed to inject element",h)}return e}function k(a,b){b&&a instanceof HTMLElement&&!q.hasNSData(a,"url")&&(b=b.replace(/^#/,""),q.setNSData(a,"url",b))}function l(a,b){var c,d=b.detail,e=d.content,f=d.options,g=f.href||f.url;e&&(c=j(e,f.title),k(c,g),a.open(c,f),p.preventDefault(b))}function m(a){var c,d;return"string"==typeof a&&(c="#"===a[0]?a.substr(1):a,d=b.getElementById(c),d&&(a=d)),a}var n,o=d.util,p=d.event,q=o.DOM,r=o.path,s=o.selectors,t=o.object,u=d.engine,v=d.router,w=d.history,x=w.manager,y=x.events,z=v.route,A=b.body,B=[].slice,C=!1,D={1:"page",10:"panel",100:"popup",101:"dialog",1e3:"drawer",2e3:"circularindexscrollbar"},E={BEFORE_ROUTER_INIT:"beforerouterinit",ROUTER_INIT:"routerinit"},F=/[#|\s]/g,G=d.widget.core.Page,H=d.template,I=function(){var a=this;a.container=null,a.settings={},a._onStateChangeHandler=null,a._onHashChangeHandler=null,a._onControllerContent=null,a.locked=!1};I.prototype.defaults={fromHashChange:!1,reverse:!1,volatileRecord:!1},I.prototype.linkClick=function(a){e(this,a)},I.prototype.detectRel=function(a){var b,c;for(c in z)if(z.hasOwnProperty(c)&&(b=z[c],s.matchesSelector(a,b.filter)))return c;return null},I.prototype._openDeferred=function(a,b,c){var d=this,e=z[b.rel],f={resolve:function(a,b){e.open(b,a,c)},reject:function(a){p.trigger(d.container.element,"changefailed",a)}};"string"==typeof a?a.replace(F,"")&&d._loadUrl(a,b,e,f):a&&s.matchesSelector(a,e.filter)?f.resolve(b,a):f.reject(b)},I.prototype.open=function(a,b,c){var d,e,f=this;if(!C)if(a=m(a),d=b&&b.rel||a instanceof HTMLElement&&f.detectRel(a),d=d||"page",e=z[d],"back"===d)w.back();else{if(!e)throw new Error("Not defined router rule ["+d+"]");b=t.merge({rel:d},f.defaults,e.option(),b),f._openDeferred(a,b,c)}},I.prototype._initRoutes=function(){var a,b=v.route;for(a in b)b.hasOwnProperty(a)&&b[a].init&&b[a].init()},I.prototype._autoInitializePage=function(c,e,f){var h,i=this,j=a.location,k=G.classes.uiPageActive,l=c.querySelector("."+k);if(l||(l=e[0]),l&&g(c),j.hash&&(h=b.getElementById(j.hash.replace("#","")),h&&s.matchesSelector(h,f)&&(l=h)),!l&&d.getConfig("addPageIfNotExist",!0)){for(l=G.createEmptyElement();c.firstChild;)l.appendChild(c.firstChild);c.appendChild(l)}return i.justBuild&&l&&i.register(u.instanceWidget(c,"pagecontainer"),l),l},I.prototype.init=function(a){var c,e,f,g=d.engine.getWidgetDefinition("Page"),h=g.selector,i=this;p.trigger(b,E.BEFORE_ROUTER_INIT,i,!1),A=b.body,i.justBuild=a,c=d.getConfig("pageContainer")||A,f=B.call(c.querySelectorAll(h)),d.getConfig("pageContainerBody",!1)||(c=f.length?f[0].parentNode:c),d.getConfig("autoInitializePage",!0)&&(e=i._autoInitializePage(c,f,h),a)||(x.enable(),i._initRoutes(),i.register(u.instanceWidget(c,"pagecontainer"),e),p.trigger(b,E.ROUTER_INIT,i,!1))},I.prototype.destroy=function(){var b=this;x.disable(),a.removeEventListener("popstate",b.popStateHandler,!1),A&&(A.removeEventListener("pagebeforechange",b.pagebeforechangeHandler,!1),A.removeEventListener("vclick",b.linkClickHandler,!1))},I.prototype.setContainer=function(a){this.container=a},I.prototype.getContainer=function(){return this.container},I.prototype.getFirstPage=function(){return this.getRoute("page").getFirstElement()},I.prototype.register=function(c,e){var f=this,g=this.getRoute("popup");f.container=c,f.getRoute("page").setFirstElement(e),p.trigger(b,"themeinit",f),f._onHashChangeHandler||(f._onHashChangeHandler=h.bind(null,f),a.addEventListener(y.HASHCHANGE,f._onHashChangeHandler,!1)),f._onStateChangeHandler||(f._onStateChangeHandler=i.bind(null,f),a.addEventListener(y.STATECHANGE,f._onStateChangeHandler,!1)),f._onControllerContent||(f._onControllerContent=l.bind(null,f),a.addEventListener("controller-content-available",f._onControllerContent,!1)),d.getConfig("loader",!1)&&c.element.appendChild(f.getLoader().element),w.enableVolatileMode(),e&&f.open(e,{transition:"none"}),g&&g.setActive(null)},I.prototype.close=function(a,b){var c,d="back",e=m(a);if(b&&b.rel?d=b.rel:e&&(d=this.detectRel(e)),c=z[d],!this.locked)if("back"===d)w.back();else{if(!c)throw new Error("Not defined router rule ["+d+"]");c.close(e,b)}},I.prototype.back=function(){this.locked||w.back()},I.prototype.openPopup=function(a,b){this.open(a,t.fastMerge({rel:"popup"},b))},I.prototype.closePopup=function(a){var b=this.getRoute("popup");b&&b.close(null,a)},I.prototype.lock=function(){this.locked=!0},I.prototype.unlock=function(){this.locked=!1},I.prototype._loadUrl=function(a,b,c,d){var e,f=r.makeUrlAbsolute(a,r.getLocation()),g=this,h=b.data||{};e=c.find(f),!e&&r.isEmbedded(f)?d.reject({}):e?d.resolve(t.fastMerge({absUrl:f},b),e):(p.trigger(g.getContainer().element,b.rel+"beforeload"),h.fullDocument=!0,H.render(a,h,function(a,e){a.success?(g._loadSuccess(a.absUrl,b,c,d,e),p.trigger(g.getContainer().element,b.rel+"load")):g._loadError(a.absUrl,b,d)}))},I.prototype._loadError=function(a,b,c){var e=t.fastMerge({url:a},b),f=this;d.error("load error, file: ",a),f.container.trigger("loadfailed",e),c.reject(e)},I.prototype._loadSuccess=function(a,b,c,d,e){var f=t.fastMerge({url:a},b),g=c.parse(e,a);g?d.resolve(f,g):d.reject(f)},I.prototype._getInitialContent=function(){return this.getRoute("page").getFirstElement()},I.prototype._showError=function(a){d.error("load error, file: ",a)},I.prototype.getActive=function(a){var b=this.getRoute(a||"page");return b&&b.getActive()},I.prototype.hasActive=function(a){var b=this.getRoute(a||"page");return!(!b||!b.hasActive())},I.prototype.hasActivePopup=function(){return this.hasActive("popup")},I.prototype.getRoute=function(a){return z[a]},I.prototype.getLoader=function(){var a,c=u.getWidgetDefinition("Loader"),d=c.selector;return c?(a=b.querySelector(d),u.instanceWidget(a,"Loader")):null},I.newInstance=function(){return n=new I},I.getInstance=function(){return n?n:this.newInstance()},v.Router=I,I.eventType=E,u.getRouter=function(){return d.warn("getRouter() method is deprecated! Use tau.router.Router.getInstance() instead"),I.getInstance()},d.getConfig("disableRouter",!1)||(b.addEventListener(u.eventType.READY,function(){I.getInstance().init()},!1),b.addEventListener(u.eventType.DESTROY,function(){I.getInstance().destroy()},!1))}(a,a.document),function(a){function b(b,c){var d=g.stripQueryParams(b).replace("#",""),e=a.getElementById(d);return e&&j.matchesSelector(e,c)?b===d?h.setNSData(e,"url","#"+d):h.setNSData(e,"url",b):e=null,e}var c,e,f=d.util,g=f.path,h=f.DOM,i=f.object,j=f.selectors,k=d.history,l=d.engine,m={};m.orderNumber=1,m.defaults={transition:"none"},m.filter=l.getWidgetDefinition("Page").selector.replace(/(\s*)/g,""),m.firstPage=null,m.option=function(){var a=i.merge({},m.defaults);return a.transition=d.getConfig("pageTransition",a.transition),a},m.init=function(){var b=[].slice.call(a.querySelectorAll(this.filter));b.forEach(function(a){h.getNSData(a,"url")||h.setNSData(a,"url",a.id&&"#"+a.id||location.pathname+location.search)})},m.open=function(b,c){var d,e,f=a.title;d=b!==this.getFirstElement()||c.dataUrl?h.getNSData(b,"url"):g.documentUrl.hrefNoHash,!d&&c.href&&(d=c.href,h.setNSData(b,"url",d)),f=h.getNSData(b,"title")||j.getChildrenBySelector(b,".ui-header > .ui-title").textContent||f,h.getNSData(b,"title")||h.setNSData(b,"title",f),d&&!c.fromHashChange&&(!g.isPath(d)&&d.indexOf("#")<0&&(d=g.makeUrlAbsolute("#"+d,g.documentUrl.hrefNoHash)),e=i.merge({},c,{url:d}),k.replace(e,f,d)),this._setBase(d),a.title=f,this.active=!0,this.getContainer().change(b,c)},m.find=function(a){var c,e=this,f=d.router.Router.getInstance(),h=e._createDataUrl(a),i=e.getFirstElement(),j=f.getContainer(),k="[data-url='"+h+"']",l=/,/gm;return/#/.test(a)&&g.isPath(h)?null:(k+=e.filter.replace(l,",[data-url='"+h+"']"),c=j.element.querySelector(k),c||!h||g.isPath(h)||(c=b(h,e.filter)),!c&&g.isFirstPageUrl(h,e.getFirstElement())&&i&&(c=i),c)},m.parse=function(a,b){var c,d=this,e=d._createDataUrl(b);return d._setBase(b),c=a.querySelector(d.filter),c&&(h.setNSData(c,"url",e),
h.setNSData(c,"external",!0)),c},m.onHashChange=function(){return null},m._createDataUrl=function(a){return g.convertUrlToDataUrl(a,!0)},m.onOpenFailed=function(){this._setBase(g.parseLocation().hrefNoSearch)},m._getBaseElement=function(){return e||(e=a.querySelector("head")),c||(c=a.querySelector("base"),c||(c=a.createElement("base"),c.href=g.documentBase.hrefNoHash,e.appendChild(c))),c},m._setBase=function(a){var b=this._getBaseElement(),c=b.href;g.isPath(a)&&(a=g.makeUrlAbsolute(a,g.documentBase),g.parseUrl(c).hrefNoSearch!==g.parseUrl(a).hrefNoSearch&&(b.href=a,g.documentBase=g.parseUrl(g.makeUrlAbsolute(a,g.documentUrl.href))))},m.getContainer=function(){return d.router.Router.getInstance().getContainer()},m.getActive=function(){return this.getContainer().getActivePage()},m.getActiveElement=function(){return this.getActive().element},m.getFirstElement=function(){return this.firstPage},m.setFirstElement=function(a){this.firstPage=a},d.router.route.page=m}(a.document),function(a,b,d){d.util.callbacks=function(a){var b,e,f,g,h,i,j,k,l=d.util.object,m=l.copy(a),n=[].slice,o=[],p=!m.once&&[],q={add:function(){var a;return o&&(a=o.length,k(arguments),f?h=o.length:b&&(g=a,j(b))),this},remove:function(){return o&&n.call(arguments).forEach(function(a){for(var b=o.indexOf(a);b>-1;)o.splice(b,1),f&&(h>=b&&h--,i>=b&&i--),b=o.indexOf(a,b)}),this},has:function(a){return a?!!o&&o.indexOf(a)>-1:!(!o||!o.length)},empty:function(){return o=[],h=0,this},disable:function(){return o=p=b=c,this},disabled:function(){return!o},lock:function(){return p=c,b||q.disable(),this},locked:function(){return!p},fireWith:function(a,b){return!o||e&&!p||(b=b||[],b=[a,b.slice?b.slice():b],f?p.push(b):j(b)),this},fire:function(){return q.fireWith(this,arguments),this},fired:function(){return!!e}};return k=function(a){n.call(a).forEach(function(a){var b=typeof a;"function"===b?m.unique&&q.has(a)||o.push(a):a&&a.length&&"string"!==b&&k(a)})},j=function(a){for(b=m.memory&&a,e=!0,i=g||0,g=0,h=o.length,f=!0;o&&h>i;){if(o[i].apply(a[0],a[1])===!1&&m.stopOnFalse){b=!1;break}i++}f=!1,o&&(p?p.length&&j(p.shift()):b?o=[]:q.disable())},q}}(a,a.document,d),function(a,b,c){var d=function(a){var b=c.util.callbacks,e=c.util.object,f=[["resolve","done",b({once:!0,memory:!0}),"resolved"],["reject","fail",b({once:!0,memory:!0}),"rejected"],["notify","progress",b({memory:!0})]],g="pending",h={},i={state:function(){return g},always:function(){return h.done(arguments).fail(arguments),this},then:function(){var a=arguments;return new d(function(b){f.forEach(function(c,d){var e="function"==typeof a[d]&&a[d];h[c[1]](function(){var a=e&&e.apply(this,arguments);a&&"function"==typeof a.promise?a.promise().done(b.resolve).fail(b.reject).progress(b.notify):b[c[0]+"With"](this===i?b.promise():this,e?[a]:arguments)})}),a=null}).promise()},promise:function(a){return a?e.merge(a,i):i}};return i.pipe=i.then,f.forEach(function(a,b){var c=a[2],d=a[3];i[a[1]]=c.add,d&&c.add(function(){g=d},f[1^b][2].disable,f[2][2].lock),h[a[0]]=function(){return h[a[0]+"With"](this===h?i:this,arguments),this},h[a[0]+"With"]=c.fireWith}),i.promise(h),a&&a.call(h,h),h};c.util.deferred=d}(a,a.document,d),function(){function c(a,b,c){var d=a.element,e=d.classList,f=a._ui.overlay,g=a._callbacks.animationEnd;d.removeEventListener("animationend",g,!1),d.removeEventListener("webkitAnimationEnd",g,!1),d.removeEventListener("mozAnimationEnd",g,!1),d.removeEventListener("oAnimationEnd",g,!1),d.removeEventListener("msAnimationEnd",g,!1),b.split(" ").forEach(function(a){a=a.trim(),a.length>0&&(e.remove(a),f&&f.classList.remove(a))}),"pending"===c.state()&&c.resolve()}function e(a,b){var c=new i;return c.then(function(){c===a._callbacks.transitionDeferred&&b()}),a._callbacks.transitionDeferred=c,c}var f=d.widget.BaseWidget,g=d.engine,h=d.util.object,i=d.util.deferred,j=d.util.selectors,k=d.event,l=d.router&&d.router.Router,m="[data-role='popup'], .ui-popup",n=function(){var a=this,b={};a.selectors=s,a.options=h.merge({},n.defaults),a.storedOptions=null,a.state=p.CLOSED,b.overlay=null,b.header=null,b.footer=null,b.content=null,b.container=null,b.wrapper=null,a._ui=b,a._callbacks={}},o={transition:"none",dismissible:!0,overlay:!0,header:!1,footer:!1,content:null,overlayClass:"",closeLinkSelector:"[data-rel='back']",history:null,closeAfter:null},p={DURING_OPENING:0,OPENED:1,DURING_CLOSING:2,CLOSED:3},q="ui-popup",r={popup:q,active:q+"-active",overlay:q+"-overlay",header:q+"-header",footer:q+"-footer",content:q+"-content",wrapper:q+"-wrapper",toast:q+"-toast",toastSmall:q+"-toast-small",build:"ui-build"},s={header:"."+r.header,content:"."+r.content,footer:"."+r.footer},t="popup",u={show:t+"show",hide:t+"hide",before_show:t+"beforeshow",transition_start:t+"transitionstart",before_hide:t+"beforehide"},v=new f;n.classes=r,n.events=u,n.defaults=o,n.selector=m,v._buildContent=function(a){var c,d,e=this,f=e._ui,g=e.selectors,h=e.options,i=f.content||a.querySelector(g.content),j=f.footer||a.querySelector(g.footer),k=[].slice.call(a.childNodes),l=k.length;if(!i){for(i=b.createElement("div"),i.className=r.content,c=0;l>c;++c)d=k[c],d!==f.footer&&d!==f.header&&i.appendChild(d);"string"==typeof h.content&&(i.innerHTML=h.content),a.insertBefore(i,j)}i.classList.add(r.content),f.content=i},v._buildHeader=function(a){var c=this,d=c._ui,e=c.options,f=c.selectors,g=d.content||a.querySelector(f.content),h=d.header||a.querySelector(f.header);h||e.header===!1||(h=b.createElement("div"),h.className=r.header,"boolean"!=typeof e.header&&(h.innerHTML=e.header),a.insertBefore(h,g)),h&&h.classList.add(r.header),d.header=h},v._setHeader=function(a,b){var c=this,d=c._ui,e=d.header;e&&(e.parentNode.removeChild(e),d.header=null),c.options.header=b,c._buildHeader(d.container)},v._buildFooter=function(a){var c=this,d=c._ui,e=c.options,f=d.footer||a.querySelector(c.selectors.footer);f||e.footer===!1||(f=b.createElement("div"),f.className=r.footer,"boolean"!=typeof e.footer&&(f.innerHTML=e.footer),a.appendChild(f)),f&&f.classList.add(r.footer),d.footer=f},v._setFooter=function(a,b){var c=this,d=c._ui,e=d.footer;e&&(e.parentNode.removeChild(e),d.footer=null),c.options.footer=b,c._buildFooter(d.container)},v._build=function(a){var c,d=this,e=d._ui,f=a.firstChild,g=a.classList;for(g.add(r.popup),g.contains(r.toastSmall)&&g.add(r.toast),c=b.createElement("div"),c.classList.add(r.wrapper),e.wrapper=c,e.container=c;f;)c.appendChild(f),f=a.firstChild;return a.appendChild(c),d._buildHeader(e.container),d._buildFooter(e.container),d._buildContent(e.container),d._setOverlay(a,d.options.overlay),a},v._setOverlay=function(a,c){var e=this,f=e.options.overlayClass,g=e._ui,h=g.overlay;a.classList.contains("ui-slider-popup")||a.classList.contains(r.toast)||(h||(h=b.createElement("div"),a.parentNode?a.parentNode.insertBefore(h,a):d.warn("Popup is creating on element outside DOM"),g.overlay=h),h.className=r.overlay+(f?" "+f:""),c?h.style.opacity="":h.style.opacity=0)},v._isActive=function(){var a=this.state;return a===p.DURING_OPENING||a===p.OPENED},v._isOpened=function(){return this.state===p.OPENED},v._init=function(b){var c=this,d=c.selectors,e=c._ui,f=c.options,g=c.element.classList;e.header=e.header||b.querySelector(d.header),e.footer=e.footer||b.querySelector(d.footer),e.content=e.content||b.querySelector(d.content),e.wrapper=e.wrapper||b.querySelector("."+r.wrapper),e.container=e.wrapper||b,e.page=j.getClosestByClass(b,"ui-page")||a,g.contains(r.toast)&&(f.closeAfter=f.closeAfter||2e3),null===f.history&&(f.history=!g.contains(r.toast))},v._setActive=function(a){var b,c=this,d=r.active,e=c.element.classList,f=l&&l.getInstance().getRoute("popup");b=h.merge({},c.options,{positionTo:null,link:null}),a?(f&&f.setActive(c,b),e.add(d),c.state=p.OPENED):(f&&f.setActive(null,b),e.remove(d),c.state=p.CLOSED)},v._bindEvents=function(){var c=this;k.on(c._ui.page,"pagebeforehide",c,!1),k.on(a,"resize",c,!1),k.on(b,"click touchstart",c,!1)},v._unbindEvents=function(){var c=this;k.off(c._ui.page,"pagebeforehide",c,!1),k.off(a,"resize",c,!1),k.off(b,"click touchstart",c,!1)},v._layout=function(){},v.open=function(b){var c,e=this,f=e.close.bind(e);e._isActive()||(e._storeOpenOptions(b),c=h.merge(e.options,b),c.dismissible||d.router.Router.getInstance().lock(),c.closeAfter>0?(e.element.classList.contains(r.toast)&&(c.transition="fade"),e._show(c),e._closeTimeout=a.setTimeout(f,c.closeAfter)):e._show(c))},v.close=function(a){var b=this,c=h.merge(b.options,a);b._isActive()&&(clearTimeout(b._closeTimeout),c.dismissible||d.router.Router.getInstance().unlock(),b._hide(c))},v._storeOpenOptions=function(a){var b,c=this,d=c.options,e={};for(b in a)a.hasOwnProperty(b)&&(e[b]=d[b]);c.storedOptions=e},v._restoreOpenOptions=function(){var a=this,b=a.options,c=["x","y","fromHashChange"];b=h.merge(b,a.storedOptions),h.removeProperties(b,c)},v._show=function(a){var b=this,c=h.merge({},a),d=b._ui.overlay;b._layout(b.element),b.state=p.DURING_OPENING,c.ext=" in ",b.trigger(u.before_show),d&&(d.style.display="block"),b._transition(c,b._onShow.bind(b)),b.trigger(u.transition_start)},v._onShow=function(){var a=this;a._setActive(!0),a.trigger(u.show)},v._hide=function(a){var b=this,c=b._isOpened(),d=b._callbacks;b.state=p.DURING_CLOSING,b.trigger(u.before_hide),c?(a.ext=" out ",b._transition(a,b._onHide.bind(b))):(d.transitionDeferred&&d.transitionDeferred.reject(),d.animationEnd&&d.animationEnd(),b._onHide())},v._onHide=function(){var a=this,b=a._ui.overlay;a._setActive(!1),b&&(b.style.display=""),a._restoreOpenOptions(),a.trigger(u.hide)},v.handleEvent=function(a){var b=this,c=d.router.Router.getInstance();switch(a.type){case"pagebeforehide":c.close(null,{transition:"none",rel:"popup"});break;case"resize":b._onResize(a);break;case"click":a.target===b._ui.overlay&&b._onClickOverlay(a);break;case"touchstart":b.element.classList.contains(r.toast)&&b._isActive()&&c.close(null,{rel:"popup"})}},v._refresh=function(){var a=this;a._setOverlay(a.element,a.options.overlay)},v._onClickOverlay=function(a){var b=this.options;a.preventDefault(),a.stopPropagation(),b.dismissible&&d.router.Router.getInstance().close(null,{rel:"popup"})},v._onResize=function(){this._isOpened()&&this._refresh()},v._transition=function(b,f){var g,h,i,j=this,k=b.transition||j.options.transition||"none",l=k+b.ext,m=j.element,n=m.classList;return j._ui.overlay&&(g=j._ui.overlay.classList),h=e(j,f),"none"!==k?(i=c.bind(null,j,l,h),j._callbacks.animationEnd=i,m.addEventListener("animationend",i,!1),m.addEventListener("webkitAnimationEnd",i,!1),m.addEventListener("mozAnimationEnd",i,!1),m.addEventListener("oAnimationEnd",i,!1),m.addEventListener("msAnimationEnd",i,!1),l.split(" ").forEach(function(a){a=a.trim(),a.length>0&&(n.add(a),g&&g.add(a))})):d.getConfig("noAsync",!1)?h.resolve():a.setTimeout(h.resolve,0),h},v._destroy=function(){var a,b=this,c=b.element,d=b._ui,e=d.wrapper;if(e){for(a=e.firstChild;a;)c.appendChild(a),a=e.firstChild;e.parentNode&&e.parentNode.removeChild(e)}b._unbindEvents(c),b._setOverlay(c,!1),d.wrapper=null},n.prototype=v,d.widget.core.Popup=n,g.defineWidget("Popup",m,["open","close","reposition"],n,"core")}(),function(a,b,c){function d(a,c){var d,e=/^#/;return a=a.replace(e,""),d=b.getElementById(a),d&&i.matchesSelector(d,c)?j.setNSData(d,"url","#"+a):d=null,d}var e=c.widget.core.Popup,f=c.util,g={defaults:{transition:"none",container:null,volatileRecord:!0},filter:"."+e.classes.popup,activePopup:null,events:{POPUP_HIDE:"popuphide"},_path:c.util.path,_history:c.history},h=c.engine,i=c.util.selectors,j=c.util.DOM,k=c.util.object,l="popup=true",m=/([&|\?]popup=true)/;g.orderNumber=100,g.option=function(){var a=k.merge({},g.defaults);return a.transition=c.getConfig("popupTransition",a.transition),a},g.setActive=function(a,b){var c,d=g._path.getLocation(),e=d.replace(m,"");this.activePopup=a,a?b&&!b.fromHashChange&&b.history&&(c=g._path.addHashSearchParams(e,l),g._history.replace(b,"",c),this.active=!0):d!==e&&(this.active=!1,g._history.back())},g.open=function(a,d,e){var i,k,l=this,m=c.router.Router.getInstance(),n=l.events,o=function(){b.removeEventListener(n.POPUP_HIDE,o,!1),a.parentNode.removeChild(a),l.activePopup=null},p=function(){var c,f=d["position-to"];f&&(d.positionTo=f),e&&(c=e.touches?e.touches[0]:e,d.x=c.clientX,d.y=c.clientY),b.removeEventListener(n.POPUP_HIDE,p,!1),i=h.instanceWidget(a,"Popup",d),i.open(d),l.activePopup=i,l.active=i.options.history},q=m.container.getActivePage();j.getNSData(a,"external")===!0&&(k=d.container?q.element.querySelector(d.container):q.element,a.parentNode!==k&&(a=f.importEvaluateAndAppendElement(a,k)),b.addEventListener(g.events.POPUP_HIDE,o,!1)),l.hasActive()?(b.addEventListener(n.POPUP_HIDE,p,!1),l.close()||p()):p()},g.close=function(a,b){var d,f=g._path.getLocation(),i=f.replace(m,"");return b=b||{},!a||a instanceof e||(a=h.instanceWidget(a,"Popup",b)),a=a||this.activePopup,a?(d=a.options,d.history&&f!==i?(d.transition=b.transition||d.transition,d.ext=b.ext||d.ext,d.dismissible||c.router.Router.getInstance().unlock(),g._history.back()):a.close(b),!0):!1},g.onHashChange=function(a,b){var c=this.activePopup;return c&&(c.close(b),this.active)?(this.active=!1,!0):!1},g.onOpenFailed=function(){return null},g.find=function(a){var b,e=this,f=e._createDataUrl(a),h=c.router.Router.getInstance().getContainer().getActivePage();return b=h.element.querySelector("[data-url='"+f+"']"+e.filter),b||!f||g._path.isPath(f)||(b=d(f,e.filter)),b},g.parse=function(a,b){var c,d=this,e=d._createDataUrl(b);return c=a.querySelector(d.filter),c&&(j.setNSData(c,"url",e),j.setNSData(c,"external",!0)),c},g._createDataUrl=function(a){return g._path.convertUrlToDataUrl(a)},g.hasActive=function(){return this.active},g.getActive=function(){return this.activePopup},g.getActiveElement=function(){var a=this.getActive();return a&&a.element},c.router.route.popup=g}(a,a.document,d),function(a){var b=a.event,c=function(b,c){return new a.event.gesture.Instance(b,c)};c.defaults={triggerEvent:!1,updateVelocityInterval:16,estimatedPointerTimeDifference:15},c.Orientation={VERTICAL:"vertical",HORIZONTAL:"horizontal"},c.Direction={UP:"up",DOWN:"down",LEFT:"left",RIGHT:"right"},c.Event={START:"start",MOVE:"move",END:"end",CANCEL:"cancel",BLOCKED:"blocked"},c.Result={PENDING:1,RUNNING:2,FINISHED:4,BLOCK:8},c.plugin={},c.createDetector=function(a,b,c){if(!a.plugin[a])throw a+" gesture is not supported";return new a.plugin[a](b,c)},b.gesture=c}(d),function(b,d){function e(b,c){var d=b._ui.drawerOverlay;j.disableGesture(c),j.off(c,"drag dragstart dragend dragcancel swipe swipeleft swiperight vmouseup",b,!1),j.prefixedFastOff(b.element,"transitionEnd",b,!1),j.off(a,"resize",b,!1),d&&j.off(d,"vclick",b,!1)}function f(b,c){var d=b._ui.drawerOverlay;b._eventBoundElement=c,j.enableGesture(c,new l.Drag,new l.Swipe({orientation:l.Orientation.HORIZONTAL})),j.on(c,"drag dragstart dragend dragcancel swipe swipeleft swiperight vmouseup",b,!1),j.prefixedFastOn(b.element,"transitionEnd",b,!1),j.on(a,"resize",b,!1),d&&j.on(d,"vclick",b,!1)}var g=d.widget.BaseWidget,h=d.util.selectors,i=d.util.DOM,j=d.event,k=d.history,l=d.event.gesture,m=d.widget.core.Page,n={CLOSED:"closed",OPENED:"opened",SLIDING:"sliding",SETTLING:"settling"},o={OPEN:"draweropen",CLOSE:"drawerclose"},p={WIDTH:240,DURATION:300,POSITION:"left"},q=function(){var a=this;a.options={position:p.POSITION,width:p.WIDTH,duration:p.DURATION,closeOnClick:!0,overlay:!0,drawerTarget:"."+m.classes.uiPage,enable:!0,dragEdge:1},a._pageSelector=null,a._isDrag=!1,a._state=n.CLOSED,a._settlingType=n.CLOSED,a._translatedX=0,a._ui={},a._eventBoundElement=null,a._drawerOverlay=null},r={page:m.classes.uiPage,drawer:"ui-drawer",left:"ui-drawer-left",right:"ui-drawer-right",overlay:"ui-drawer-overlay",open:"ui-drawer-open",close:"ui-drawer-close"},s=new g;q.prototype=s,q.classes=r,s.handleEvent=function(a){var b=this;switch(a.type){case"drag":b._onDrag(a);break;case"dragstart":b._onDragStart(a);break;case"dragend":b._onDragEnd(a);break;case"dragcancel":b._onDragCancel(a);break;case"vmouseup":b._onMouseup(a);break;case"swipe":case"swipeleft":case"swiperight":b._onSwipe(a);break;case"vclick":b._onClick(a);break;case"transitionend":case"webkitTransitionEnd":case"mozTransitionEnd":case"oTransitionEnd":case"msTransitionEnd":b._onTransitionEnd(a);break;case"resize":b._onResize(a)}},s._onMouseup=function(){var a=this;a._state===n.SLIDING&&a.close()},s._onClick=function(){var a=this;a._state===n.OPENED&&a.close()},s._onResize=function(){var a=this;a._refresh()},s._onTransitionEnd=function(){var a=this,b=a.options.position,c=a._drawerOverlay;a._state===n.SETTLING&&(a._settlingType===n.OPENED?(a.trigger(o.OPEN,{position:b}),a._setActive(!0),a._state=n.OPENED):(a.close(),a.trigger(o.CLOSE,{position:b}),a._setActive(!1),a._state=n.CLOSED,c&&(c.style.visibility="hidden")))},s._onSwipe=function(a){var b,c=this,d=c.options;a.detail?b="left"===a.detail.direction?"right":"left":"swiperight"===a.type?b="left":"swipeleft"===a.type&&(b="right"),d.enable&&c._isDrag&&d.position===b&&(c.open(),c._isDrag=!1)},s._onDragStart=function(a){var b=this;b._state!==n.OPENED&&(b.options.enable&&!b._isDrag&&b._state!==n.SETTLING&&b._checkSideEdge(a)?b._isDrag=!0:b.close())},s._onDrag=function(b){var c,d=this,e=b.detail.deltaX,f=d.options,g=d._translatedX;f.enable&&d._isDrag&&d._state!==n.SETTLING&&("left"===f.position?(c=-f.width+e+g,0>c&&d._translate(c,0)):(c=a.innerWidth+e-g,c>0&&c>a.innerWidth-f.width&&d._translate(c,0)))},s._onDragEnd=function(a){var b=this,c=b.options,d=a.detail;c.enable&&b._isDrag&&(Math.abs(d.deltaX)>c.width/2?b.open():b._state!==n.SETTLING&&b.close()),b._isDrag=!1},s._onDragCancel=function(){var a=this;a.options.enable&&a._isDrag&&a.close(),a._isDrag=!1},s._translate=function(a,b){var c=this,d=c.element;c._state!==n.SETTLING&&(c._state=n.SLIDING),b&&i.setPrefixedStyle(d,"transition",i.getPrefixedValue("transform "+b/1e3+"s ease-out")),i.setPrefixedStyle(d,"transform","translate3d("+a+"px, 0px, 0px)"),c.options.overlay&&c._setOverlay(a),b||c._onTransitionEnd()},s._setOverlay=function(b){var c=this,d=c.options,e=c._ui.drawerOverlay,f=e.style,g=Math.abs(b),h="right"===d.position?g/a.innerWidth:g/d.width;1>h?f.visibility="visible":f.visibility="hidden",f.opacity=1-h},s._setActive=function(a){var b=this,c=d.router.getInstance().getRoute("drawer");a?c.setActive(b):c.setActive(null)},s._build=function(a){var c,d=this,e=d._ui,f=d.options;return a.classList.add(r.drawer),a.style.top=0,c=h.getClosestBySelector(a,f.drawerTarget),c&&(c.appendChild(a),c.style.overflowX="hidden"),d.options.overlay&&(e.drawerOverlay=d._createOverlay(a),e.drawerOverlay.style.visibility="hidden"),e.placeholder||(e.placeholder=b.createComment(a.id+"-placeholder"),a.parentNode.insertBefore(e.placeholder,a)),e.targetElement=c,a},s._init=function(a){var b=this,c=b._ui;return c.drawerPage=h.getClosestByClass(a,r.page),c.drawerPage.style.overflowX="hidden",b._initLayout(),a},s._initLayout=function(){var b,c=this,d=c.options,e=c.element,f=e.style,g=c._ui,h=g.drawerOverlay?g.drawerOverlay.style:null;d.width=d.width||g.targetElement.offsetWidth,b=g.targetElement.offsetHeight,f.width=0!==d.width?d.width+"px":"100%",f.height=0!==b?b+"px":"100%",f.top="0",h&&(h.width=a.innerWidth+"px",h.height=a.innerHeight+"px",h.top=0),"right"===d.position?(e.classList.add(r.right),c._translate(a.innerWidth,0)):(e.classList.add(r.left),c._translate(-d.width,0)),c._state=n.CLOSED},s._translateRight=function(){var b=this,c=b.options;"right"===c.position&&(b._state===n.OPENED?b._translate(a.innerWidth-c.width,0):b._translate(a.innerWidth,0))},s._checkSideEdge=function(a){var b=this,c=a.detail,d=c.pointer.clientX-c.estimatedDeltaX,e=b.options,f=e.position,g=b._eventBoundElement,h=g.offsetWidth,i=g.offsetLeft+h,j=h*e.dragEdge;return"left"===f&&d>0&&j>d||"right"===f&&d>i-j&&i>d},s._refresh=function(){var a=this;a._translateRight(),a._initLayout()},s._createOverlay=function(a){var c=b.createElement("div");return c.classList.add(r.overlay),a.parentNode.insertBefore(c,a),c},s._bindEvents=function(){var a=this,b=a._ui.targetElement;f(a,b)},s._enable=function(){this._oneOption("enable",!0)},s._disable=function(){this._oneOption("enable",!1)},s.isOpen=function(){return this._state===n.OPENED},s.open=function(b){var d=this,e=d.options,f=d.element.classList,g=d._ui.drawerOverlay;d._state!==n.OPENED&&(d._state=n.SETTLING,d._settlingType=n.OPENED,b=b!==c?b:e.duration,g&&(g.style.visibility="visible"),f.remove(r.close),f.add(r.open),"left"===e.position?d._translate(0,b):d._translate(a.innerWidth-e.width,b))},s.close=function(b,e){var f=this,g=b?b.reverse:!1,h=f.options,i=f.element.classList;if(f._state!==n.CLOSED){if(!g&&f._state===n.OPENED&&!d.getConfig("disableRouter"))return void k.back();f._state=n.SETTLING,f._settlingType=n.CLOSED,e=e!==c?e:h.duration,i.remove(r.open),i.add(r.close),"left"===h.position?f._translate(-h.width,e):f._translate(a.innerWidth,e)}},s.setDragHandler=function(a){var b=this;b.options.dragEdge=1,e(b,b._eventBoundElement),f(b,a)},s.transition=function(a){var b=this,c=b.options;"left"===c.position?b._translate(-c.width+a,c.duration):b._translate(c.width-a,c.duration),b._translatedX=a},s.getState=function(){return this._state},s._destroy=function(){var a=this,b=a._ui,c=b.drawerOverlay,d=b.placeholder,f=d.parentNode,g=a.element;f.insertBefore(g,d),f.removeChild(d),c&&c.removeEventListener("vclick",a._onClickBound,!1),e(a,a._eventBoundElement)},d.widget.core.Drawer=q}(a.document,d),function(){var a=d.widget.core.Drawer,b=d.router.Router,c=d.util.path,e=d.history,f=d.engine,g={},h="drawer=true",i=/([&|\?]drawer=true)/;g.orderNumber=1e3,g.defaults={transition:"none"},g.filter="."+a.classes.drawer,g.option=function(){return null},g.open=function(a){var b=f.instanceWidget(a,"Drawer");b.open()},g.find=function(a){var d,e=c.convertUrlToDataUrl(a),f=b.getInstance().getContainer().getActivePage();return d=f.element.querySelector("#"+e)},g.parse=function(){return null},g.setActive=function(a){var b,d=c.getLocation(),f=d.replace(i,"");this._activeDrawer=a,a?(b=c.addHashSearchParams(f,h),e.replace({},"",b),this.active=!0):d!==f&&e.back()},g.onHashChange=function(a,b,c){var d=this,e=d._activeDrawer,f=c.stateUrl;return e&&f.search(h)>0&&a.search(h)<0?(e.close(b),this.active=!1,!0):!1},d.router.route.drawer=g}(),function(a,b,c){function d(a){return x.getClosestBySelector(a,"a, label")}function e(a){return x.getClosestByClass(a,v.BUTTON)||x.getClosestByClass(a,v.HEADER_BUTTON)||x.getClosestByClass(a,v.NAVIGATION_BUTTON)||x.getClosestByClass(a,v.TABBAR_ANCHOR)}function f(a){var b=a.target,c=b.classList;c.contains(v.ACTIVE_BTN)&&!c.contains(v.INACTIVE_BTN)?(B._activeAnimationFinished=!0,(B._touchEnd||b!==B._buttonTarget)&&c.add(v.INACTIVE_BTN)):(c.contains(v.ACTIVE_BTN)||c.contains(v.INACTIVE_BTN)||(b.parentNode.classList.remove(v.ACTIVE_BTN),b.parentNode.classList.remove(v.INACTIVE_BTN)),c.remove(v.INACTIVE_BTN),c.remove(v.ACTIVE_BTN))}function g(){B._buttonTarget&&B._buttonTarget.classList.add(v.INACTIVE_BTN)}function h(){B._buttonTarget.classList.add(v.ACTIVE_BTN),B._activeAnimationFinished=!1}function i(){var a=B._buttonTarget;a&&(a.classList.remove(v.ACTIVE_BTN),a.classList.remove(v.INACTIVE_BTN)),B._target&&B._target.classList.remove(v.ACTIVE_LI)}function j(){var a,b;B._startTime&&(b=Date.now()-B._startTime,b>B.options.addActiveClassDelay?(B._startTime=0,B._buttonTarget=e(B._target),B._target=d(B._target),B._didScroll||(B._liTarget=B._detectLiElement(B._target),B._liTarget&&(B._liTarget.classList.add(v.ACTIVE_LI),y.trigger(B._liTarget,w.ACTIVE_LI,{})),B._liTarget=null,B._buttonTarget&&(a=B._buttonTarget.classList,a.remove(v.ACTIVE_BTN),a.remove(v.INACTIVE_BTN),B._requestAnimationFrame(h)))):B._requestAnimationFrame(j))}function k(){return C.call(a.getElementsByClassName(v.ACTIVE_LI))}function l(){for(var a=k(),b=a.length,c=0;b>c;c++)a[c].classList.remove(v.ACTIVE_LI)}function m(){var a=Date.now()-B._startRemoveTime;a>B.options.keepActiveClassDelay?l():B._requestAnimationFrame(m)}function n(a){var b=a.touches[0],c=B.options.scrollThreshold;!B._didScroll&&(z(b.clientX-t)>c||z(b.clientY-u)>c)&&(B._startTime=0,B._requestAnimationFrame(l),B._didScroll=!0)}function o(a){var b,c=a.touches;1===c.length&&(b=c[0],B._didScroll=!1,t=b.clientX,u=b.clientY,B._target=a.target,B._startTime=Date.now(),B._startRemoveTime=0,B._requestAnimationFrame(j),B._touchEnd=!1)}function p(a){B._startRemoveTime=a.timeStamp,0===a.touches.length&&(B._didScroll||(B._startTime=0,B._requestAnimationFrame(m)),B._activeAnimationFinished&&B._requestAnimationFrame(g),B._didScroll=!1,B._touchEnd=!0)}function q(){"hidden"===a.visibilityState&&B._removeActiveClassLoop()}function r(){a.addEventListener("touchstart",B._touchstartHandler,!1),a.addEventListener("touchend",B._touchendHandler,!1),a.addEventListener("touchmove",B._touchmoveHandler,!1),a.addEventListener("visibilitychange",B._checkPageVisibility,!1),a.addEventListener("pagehide",B._hideClear,!1),a.addEventListener("popuphide",B._hideClear,!1),a.addEventListener("animationend",B._clearBtnActiveClass,!1),a.addEventListener("animationEnd",B._clearBtnActiveClass,!1),a.addEventListener("webkitAnimationEnd",B._clearBtnActiveClass,!1)}function s(){a.removeEventListener("touchstart",B._touchstartHandler,!1),a.removeEventListener("touchend",B._touchendHandler,!1),a.removeEventListener("touchmove",B._touchmoveHandler,!1),a.removeEventListener("visibilitychange",B._checkPageVisibility,!1),a.removeEventListener("pagehide",B._hideClear,!1),a.removeEventListener("popuphide",B._hideClear,!1),a.removeEventListener("animationend",B._clearBtnActiveClass,!1),a.removeEventListener("animationEnd",B._clearBtnActiveClass,!1),a.removeEventListener("webkitAnimationEnd",B._clearBtnActiveClass,!1)}var t=0,u=0,v={ACTIVE_LI:"ui-li-active",ACTIVE_BTN:"ui-btn-active",INACTIVE_BTN:"ui-btn-inactive",BUTTON:"ui-btn",HEADER_BUTTON:"ui-header-btn",TABBAR_ANCHOR:"ui-tabbar-anchor",NAVIGATION_BUTTON:"ui-navigation-item"},w={ACTIVE_LI:"anchorhighlightactiveli"},x=c.util.selectors,y=c.event,z=Math.abs,A=function(a){return x.getClosestByTag(a,"li")},B={options:{scrollThreshold:10,addActiveClassDelay:50,keepActiveClassDelay:100},_startTime:0,_startRemoveTime:0,_touchEnd:!1,_liTarget:null,_target:null,_didScroll:!1,_buttonTarget:null,_activeAnimationFinished:!1,_requestAnimationFrame:c.util.windowRequestAnimationFrame},C=Array.prototype.slice;c.util.anchorHighlight=B,B.enable=r,B.disable=s,B._clearActiveClass=l,B._detectHighlightTarget=d,B._detectBtnElement=e,B._clearBtnActiveClass=f,B._removeActiveClassLoop=m,B._addButtonInactiveClass=g,B._addButtonActiveClass=h,B._hideClear=i,B._addActiveClass=j,B._detectLiElement=A,B._touchmoveHandler=n,B._touchendHandler=p,B._touchstartHandler=o,B._checkPageVisibility=q,B._hideClear=i,B._clearBtnActiveClass=f,r()}(b,a,d),function(a,b,c){function d(a,b,c,d){var e=d*n/180;return{x:a+c*p(e),y:b-c*o(e)}}function e(a,b,c,e,f){var g=d(a,b,c,f),h=d(a,b,c,e),i=180>=f-e?"0":"1",j=0;return["M",g.x,g.y,"A",c,c,0,i,j,h.x,h.y].join(" ")}function f(a,c){var d=b.createElementNS(q,"path");d.setAttribute("class",c.classes),d.setAttribute("fill","none"),d.setAttribute("stroke",c.color),d.setAttribute("stroke-width",c.width),d.setAttribute("d",e(c.x,c.y,c.r,c.referenceDegree+c.arcStart,c.referenceDegree+c.arcEnd)),d.setAttribute("data-initial-degree",c.referenceDegree),d.setAttribute("stroke-linecap",c.linecap),a.appendChild(d)}function g(a,b){var c=a.style,d=b.x+"px "+b.y+"px",e=b.referenceDegree+b.arcStart||b.degrees;a.classList&&a.classList.add(s.animated),c.webkitTransformOrigin=d,c.mozTransformOrigin=d,c.transformOrigin=d,d="rotate("+e+"deg)",c.webkitTransform=d,c.mozTransform=d,c.transform=d}function h(a,c){var e,f,g=b.createElementNS(q,"line");return g.setAttribute("class",c.classes),g.setAttribute("stroke",c.color),g.setAttribute("stroke-width",c.width),"out"===c.direction?(e=d(c.x,c.y,c.r,c.degrees),f=d(c.x,c.y,c.r-c.length,c.degrees)):(e=d(c.x,c.y,c.r-c.length,c.degrees),f=d(c.x,c.y,c.r,c.degrees)),g.setAttribute("x1",e.x),g.setAttribute("y1",e.y),g.setAttribute("x2",f.x),g.setAttribute("y2",f.y),a.appendChild(g),g}function i(a,c){var d=b.createElementNS(q,"text");d.setAttribute("x",c.x),d.setAttribute("y",c.y),d.setAttribute("text-anchor",c.position),d.setAttribute("fill",c.color),d.setAttribute("transform",c.transform),d.textContent=c.text,a.appendChild(d)}function j(a,c){var d=b.createElementNS(q,"circle");return d.setAttribute("stroke",c.color),d.setAttribute("stroke-width",c.width),d.setAttribute("cx",c.x),d.setAttribute("cy",c.y),d.setAttribute("r",c.r),d.setAttribute("fill",c.fill),a.appendChild(d),d}function k(a,b){var c;b.animation?g(a,b):a&&(c=parseInt(a.getAttribute("data-initial-degree"),10)||b.referenceDegree,a.setAttribute("data-initial-degree",c),a.setAttribute("d",e(b.x,b.y,b.r,c+b.arcStart,c+b.arcEnd)))}function l(a,b){var c,e;b.animation?g(a,b):a&&(c=d(b.x,b.y,b.r,b.degrees),e=d(b.x,b.y,b.r-b.length,b.degrees),a.setAttribute("x1",c.x),a.setAttribute("y1",c.y),a.setAttribute("x2",e.x),a.setAttribute("y2",e.y))}var m,n=Math.PI,o=Math.cos,p=Math.sin,q="http://www.w3.org/2000/svg",r=c.util.object,s={polar:"ui-polar",animated:"ui-animated"},t={x:180,y:180,r:170,arcStart:0,arcEnd:90,width:5,color:"black",animation:!1,linecap:"butt",referenceDegree:0},u={x:180,y:180,r:170,degrees:0,length:180,direction:"in",width:5,color:"black"},v={x:180,y:180,text:"Text",position:"middle",color:"white"},w={x:180,y:180,r:170,color:"white"};m={"default":{arc:t,radius:u,text:v},classes:s,polarToCartesian:d,createSVG:function(a){var c=b.createElementNS(q,"svg");return c.classList&&c.classList.add(s.polar),a&&a.appendChild(c),c},addArc:function(a,b){return a=a||this.createSVG(),b=r.merge({},t,b||{}),f(a,b),a},addRadius:function(a,b){return a=a||this.createSVG(),b=r.merge({},u,b||{}),h(a,b)},addText:function(a,b){return a=a||this.createSVG(),b=r.merge({},v,b||{}),i(a,b),a},updatePosition:function(a,b,c){var d,e=a&&a.querySelector("path"+b);e?(c=r.merge({},t,c||{}),k(e,c)):(d=a&&a.querySelector("line"+b),d&&l(d,c))},addCircle:function(a,b){var c=this;return a=a||c.createSVG(),b=r.merge({},w,b||{}),j(a,b),a}},c.util.polar=m}(a,a.document,d),function(a,b,c){function d(){aa&&(clearTimeout(ha),aa.classList.add(D.fadeIn),ha=setTimeout(function(){aa&&aa.classList.remove(D.fadeIn)},2e3))}function e(b){for(;b&&b!==a;){if(b===P)return!0;b=b.parentElement}return!1}function f(a){var b=a.touches,c=b[0];U=e(a.target),U&&1===b.length&&(H=V?c.clientX:c.clientY,M=Date.now(),B.trigger(P,F.SCROLL_BEFORE_START,{scrollLeft:V?-I:0,scrollTop:V?0:-I,fromAPI:ia}))}function g(a){var b=a.touches,c=b[0],e=V?c.clientX:c.clientY,f=0,g=0;ia=!1,J=e-H,E||(I+J>0&&(J=-I),-O>I+J&&(J=-O-I)),V?f=-(I+J):g=-(I+J),T||B.trigger(P,F.SCROLL_START,{scrollLeft:f,scrollTop:g,fromAPI:ia}),B.trigger(P,F.SCROLL,{scrollLeft:f,scrollTop:g,inBounds:I+J>=-O&&0>=I+J,fromAPI:ia}),d()}function h(a){var b=a.touches;U&&(1===b.length&&g(a),T||(T=!0),la(q))}function i(a){var b=Date.now()-M;a&&S(J/b)>1?(K=X(Y(W(I+1e3*J/b),0),-O),ka&&(K=ka*W(K/ka)),S(J/b)>1&&B.trigger(P,F.SCROLL_FLICK,{scrollLeft:V?-K:0,scrollTop:V?0:-K,fromAPI:ia}),la(o)):(ka&&(K=ka*W(I/ka),la(o)),T=!1)}function j(a){E?a||(K=I>0?0:-O,la(o)):(-O>I&&(I=-O),I>0&&(I=0))}function k(a){B.trigger(P,F.SCROLL,a),B.trigger(P,F.SCROLL_END,a)}function l(){var a,b=0,c=0;T&&(I+=J,a=I>=-O&&0>=I,i(a),j(a),V?b=-I:c=-I,J=0,k({scrollLeft:b,scrollTop:c,inBounds:a,fromAPI:ia}),d(),U=!1,la(q))}function m(a){var b=a.detail&&a.detail.direction;"CW"===b?K-=ka||50:K+=ka||50,ka&&(K=ka*W(K/ka)),-O>K&&(K=-O),K>0&&(K=0),la(o),la(q),B.trigger(P,F.SCROLL_START,{scrollLeft:V?-K:0,scrollTop:V?0:-K,fromAPI:!1}),a.stopImmediatePropagation()}function n(){var a=K-I,b=S(a);b>10?(I=W(I+a/10),la(o)):b>2?(I=W(I+a/2),la(o)):I=K,E||(-O>I&&(I=-O),I>0&&(I=0))}function o(){var a=0,b=0;P&&(n(),V?a=-I:b=-I,B.trigger(P,F.SCROLL,{scrollLeft:a,scrollTop:b,inBounds:I>=-O&&0>=I,fromAPI:ia}),T||B.trigger(P,F.SCROLL_END,{scrollLeft:a,scrollTop:b,fromAPI:ia}),d())}function p(){ea?C.updatePosition(ga,"."+D.thumb,{
arcStart:ca,arcEnd:ca+fa,r:G}):ba&&(V?ba.style.transform="translate("+ca+"px, 0)":ba.style.transform="translate(0, "+ca+"px)")}function q(){var a=I+J;a!==L&&(L=a,ca=O>-a?-a/O*da:da,0>ca&&(ca=0),!ja&&N&&(N.transform=V?"translate("+L+"px, 0)":"translate(0, "+L+"px)"),p(),la(q))}function r(){H=0,I=0,ca=0,J=0,K=0,L=0,M=Date.now()}function s(d,e,g){var i,j;if(ja=g,E=!1,ka=!1,P)c.warn("Scrolling exist on another element, first call disable method");else{for(V="x"===e?1:0,Q=a.createElement("div");d.firstElementChild;)Q.appendChild(d.firstElementChild);d.appendChild(Q),P=d,i=d.getBoundingClientRect(),j=Q.getBoundingClientRect(),O=W(V?j.width-i.width:j.height-i.height),N=Q.style,r(),R=b.getComputedStyle(d).getPropertyValue("overflow"),d.style.overflow="hidden",a.addEventListener("touchstart",f,!1),a.addEventListener("touchmove",h,!1),a.addEventListener("touchend",l,!1),b.addEventListener("rotarydetent",m,!0)}}function t(){x(),a.removeEventListener("touchstart",f,!1),a.removeEventListener("touchmove",h,!1),a.removeEventListener("touchend",l,!1),b.removeEventListener("rotarydetent",m,!0),P&&(P.style.overflow=R),N=null,P=null,Q=null,ga=null}function u(){var a=V?0:90;aa.classList.add(D.circular),ga=C.createSVG(),C.addArc(ga,{arcStart:a-Z/2,arcEnd:a+Z/2,classes:D.path,width:10,r:G,linecap:"round"}),C.addArc(ga,{referenceDegree:a-Z/2,arcStart:0,arcEnd:fa,classes:D.thumb,width:10,r:G,linecap:"round"}),aa.appendChild(ga),P.parentElement.insertBefore(aa,P.nextSibling)}function v(b){var c,d,e,f=0,g=0;aa.classList.add(D.direction+"-"+(V?"x":"y")),ba=a.createElement("div"),e=ba.style,ba.classList.add(D.thumb),c=P.getBoundingClientRect(),d=Q.getBoundingClientRect(),V?(f=c.width-2*_,b.width=f+"px",b.left=c.left+_+"px",e.transform="translate3d("+ca+"px,0,0)",e.width=f/d.width*f+"px"):(g=c.height-2*_,b.height=g+"px",b.top=c.top+_+"px",e.transform="translate3d(0,"+ca+"px,0)",e.height=g/d.height*g+"px"),aa.appendChild(ba),P.parentElement.insertBefore(aa,P.nextSibling),da=V?f-ba.getBoundingClientRect().width:g-ba.getBoundingClientRect().height}function w(){aa=a.createElement("div"),aa.classList.add(D.scrollbar),ea?u():v(aa.style)}function x(){aa&&(aa.parentElement.removeChild(aa),aa=null,ba=null)}function y(a){K=a,ia=!0,B.trigger(P,F.SCROLL_BEFORE_START,{scrollLeft:V?-I:0,scrollTop:V?0:-I,fromAPI:ia}),la(o),q()}function z(){return-I}function A(){return O}var B=c.event,C=c.util.polar,D={circular:"scrolling-circular",direction:"scrolling-direction",scrollbar:"scrolling-scrollbar",path:"scrolling-path",thumb:"scrolling-scrollthumb",fadeIn:"fade-in"},E=!1,F={SCROLL_BEFORE_START:"beforeScrollStart",SCROLL_START:"scrollStart",SCROLL_END:"scrollEnd",SCROLL_FLICK:"flick",SCROLL:"scroll"},G=174,H=0,I=0,J=0,K=0,L=0,M=Date.now(),N=null,O=0,P=null,Q=null,R="",S=Math.abs,T=!1,U=!1,V=0,W=Math.round,X=Math.max,Y=Math.min,Z=60,$=6,_=11,aa=null,ba=null,ca=0,da=0,ea=c.support.shape.circle,fa=$,ga=null,ha=null,ia=!1,ja=!1,ka=null,la=b.requestAnimationFrame||b.webkitRequestAnimationFrame;c.util.scrolling={getScrollPosition:z,enable:s,disable:t,enableScrollBar:w,disableScrollBar:x,scrollTo:y,isElement:function(a){return P===a},setMaxScroll:function(a){var b=P.getBoundingClientRect(),c=V?"width":"height",d=b[c],e=X(a-d,0);e!==O&&(O=e||Number.POSITIVE_INFINITY,aa&&(ea?(fa=X(d/(O+d)*Z,$),da=Z-fa,C.updatePosition(ga,"."+D.thumb,{arcStart:ca,arcEnd:ca+fa,r:G})):(d-=2*_,ba.style[c]=d/(O+d)*d+"px",da=d-ba.getBoundingClientRect()[c])))},getMaxScroll:A,setSnapSize:function(a){ka=a,ka&&(O=ka*W(O/ka))},setBounceBack:function(a){E=a}}}(b,a,d),function(a,b,c){function d(a){"CW"===a.detail.direction?j.scrollTop+=k:j.scrollTop-=k}function e(b,c){j=b,c&&(k=c),a.addEventListener("rotarydetent",d)}function f(){k=40,a.removeEventListener("rotarydetent",d)}function g(){return k}function h(a){k=a}var i={},j=null,k=40;i.enable=e,i.disable=f,i.setScrollStep=h,i.getScrollStep=g,c.util.rotaryScrolling=i}(b,a,d),function(a){var b=/([\-0-9.]*)(ms|s)?/i,c={convertToMiliseconds:function(a){var c,d=a.match(b),e=0;return 3===d.length&&(c=parseFloat(d[1])||0,"ms"===d[2]?e=c:"s"===d[2]&&(e=1e3*c)),e}};a.util.date=c}(d),function(a){function b(a){var b=a.detail.name,d=a.detail.BaseElement||HTMLElement,f=Object.create(d.prototype),h=["search","text","slider","checkbox","radio","button"],i=b.toLowerCase(),j="tau-"+i,k="";switch(d){case HTMLInputElement:k="input";break;case HTMLSelectElement:k="select";break;case HTMLTextAreaElement:k="textarea";break;case HTMLButtonElement:k="button"}f._tauName=b,f.createdCallback=function(){var a=this,b=a.getAttribute("is");b&&[].some.call(h,function(c){if(b&&-1!==b.indexOf(c)){switch(c){case"slider":a.type="range";break;default:"textarea"!==a.tagName.toLowerCase()&&(a.type=c)}return!0}}),a._tauWidget=e.instanceWidget(a,a._tauName)},f.attributeChangedCallback=function(a,b,d){var e=this._tauWidget;e&&("value"===a?e.value(d):e.options&&e.options[a]!==c&&("false"===d&&(d=!1),"true"===d&&(d=!0),e.option(a,d),e.refresh()))},f.attachedCallback=function(){"function"==typeof this._tauWidget.onAttach&&this._tauWidget.onAttach()},g[j]=""!==k?{"extends":k,prototype:f}:{prototype:f}}var e=d.engine,f={},g={};a.addEventListener("tauinit",function(){Object.keys(g).forEach(function(b){f[b]?d.warn(b+" already registered"):f[b]=a.registerElement(b,g[b])})}),"function"==typeof a.registerElement&&d.getConfig("registerCustomElements",!0)&&a.addEventListener("widgetdefined",b)}(a.document),function(a,b){var c=b.widget.BaseWidget,d=b.engine,e=b.util.DOM,f={BTN:"ui-btn",DISABLED:"ui-state-disabled",INLINE:"ui-inline",BTN_ICON:"ui-btn-icon",ICON_PREFIX:"ui-icon-",BTN_CIRCLE:"ui-btn-circle",BTN_NOBG:"ui-btn-nobg",BTN_ICON_ONLY:"ui-btn-icon-only",BTN_TEXT_LIGHT:"ui-btn-text-light",BTN_TEXT_DARK:"ui-btn-text-dark",BTN_ICON_POSITION_PREFIX:"ui-btn-icon-",BTN_ICON_MIDDLE:"ui-btn-icon-middle"},g=function(){var a=this;a.options={},a._classesPrefix=f.BTN+"-"},h={CIRCLE:"circle",TEXTLIGHT:"light",TEXTDARK:"dark",NOBG:"nobg",ICON_MIDDLE:"icon-middle"},i=new c;g.classes=f,g.prototype=i,i._configure=function(){this.options={inline:!1,icon:null,disabled:!1,style:null,iconpos:"left",size:null,middle:!1}},i._setStyle=function(a,b){var c=this.options,d=a.classList,e=!1;switch(b=b||c.style){case h.CIRCLE:d.remove(f.BTN_NOBG),d.add(f.BTN_CIRCLE),e=!0;break;case h.NOBG:d.remove(f.BTN_CIRCLE),d.add(f.BTN_NOBG),e=!0;break;case h.TEXTLIGHT:d.add(f.BTN_TEXT_LIGHT),e=!0;break;case h.TEXTDARK:d.add(f.BTN_TEXT_DARK),e=!0}e&&(c.style=b)},i._setInline=function(a,b){var c=this.options;b=b||c.inline,b&&(a.classList.add(f.INLINE),c.inline=b)},i._setIcon=function(a,b){var c,d=this,g=a.classList,h=d.options,i={},j=d._iconCSSRule;b=b||h.icon,h.icon=b,b?(g.add(f.BTN_ICON),-1===b.indexOf(".")?(g.add(f.ICON_PREFIX+b),d._setTitleForIcon(a),j&&e.removeCSSRule(j)):(c='url("'+b+'")',i["-webkit-mask-image"]=c,i["mask-image"]=c,d._iconCSSRule=e.setStylesForPseudoClass("#"+a.id,"after",i))):j&&e.removeCSSRule(j)},i._setIconpos=function(a,b){var c=this.options,d=c.style,e=a.textContent.length||(a.value?a.value.length:0);b=b||c.iconpos,c.icon&&d!==h.CIRCLE&&d!==h.NOBG&&(e>0?a.classList.add(f.BTN_ICON_POSITION_PREFIX+b):a.classList.add(f.BTN_ICON_ONLY),c.iconpos=b)},i._setTitleForIcon=function(a){var c=this.options,d=a.textContent;"notext"!==c.iconpos||a.getAttribute("title")||(a.setAttribute("title",d),b.warn("iconpos='notext' is deprecated."))},i._setDisabled=function(a,b){var c=this,d=c.options,e=a.classList;b===!0||d.disabled===!0||a.disabled||e.contains(f.DISABLED)?(d.disabled=!0,c._disable(a)):d.disabled=!1},i._build=function(a){var b=this,c=a.classList;return c.contains(f.BTN)||c.add(f.BTN),b._setStyle(a),b._setInline(a),b._setIconpos(a),b._setIcon(a),b._setSize(a),b._setDisabled(a),a},i._refresh=function(){var a=this,b=this.element;return a._setStyle(b),a._setInline(b),a._setIconpos(b),a._setIcon(b),a._setSize(b),a._setDisabled(b),null},i._getValue=function(){return this.element.textContent},i._setSize=function(a,b){var c=a.style,d=this.options,e=parseInt(b||d.size,10);32>e&&(e=32),e>230&&(e=230),c.height=e+"px",c.width=e+"px"},i._setValue=function(a){this.element.textContent=a},i._enable=function(a){var b=this,c=b.options;a&&("button"===a.tagName.toLowerCase()&&(a.disabled=!1),this.isCustomElement||a.removeAttribute("disabled"),a.classList.remove(f.DISABLED),c.disabled=!1)},i._disable=function(a){var b=this.options;a&&("button"===a.tagName.toLowerCase()&&(a.disabled=!0),this.isCustomElement||a.setAttribute("disabled","disabled"),a.classList.add(f.DISABLED),b.disabled=!0)},b.widget.core.Button=g,d.defineWidget("Button","button, [data-role='button'], .ui-btn, input[type='button']",[],g,"core"),d.defineWidget("inputButton","",[],g,"core",!1,!1,HTMLInputElement),d.defineWidget("formButton","",[],g,"core",!1,!1,HTMLButtonElement)}(a.document,d),function(a,b){var c=b.widget.BaseWidget,d=b.engine,e=function(){this.element=null},f={checkbox:"ui-checkbox"},g=new c;e.prototype=g,g._build=function(a){return"checkbox"===a.getAttribute("type")&&a.classList.add(f.checkbox),a},g._getValue=function(){return this.element.value},g._setValue=function(a){this.element.value=a},b.widget.core.Checkbox=e,d.defineWidget("Checkbox","input[type='checkbox']:not(.ui-slider-switch-input):not([data-role='toggleswitch']):not(.ui-toggleswitch):not(.ui-toggle-switch), input.ui-checkbox",[],e,"core",!1,!1,HTMLInputElement)}(a.document,d),function(a,b){var c=b.widget.BaseWidget,d=b.engine,e=function(){this.element=null},f={radio:"ui-radio"},g=new c;e.prototype=g,g._build=function(a){return"radio"===a.getAttribute("type")&&a.classList.add(f.radio),a},g._getValue=function(){return this.element.value},g._setValue=function(a){this.element.value=a},b.widget.core.Radio=e,d.defineWidget("Radio","input[type='radio'], input.ui-radio",[],e,"core",!1,!1,HTMLInputElement)}(a.document,d),function(b,d){var e=0,f=+new Date,g=[].slice,h="",i="",j=function(a){var b=new Date;a.unshift("["+h+"]["+b.toLocaleString()+"]")},k=a.ns||a.tau||{},l=a.nsConfig||a.tauConfig||{};k.info=k.info||{profile:"custom"},k.tauPerf=k.tauPerf||{},a.ns=k,a.nsConfig=l,a.tau=k,a.tauConfig=l,h=l.rootNamespace,i=l.fileName,k.getUniqueId=function(){return h+"-"+k.getNumberUniqueId()+"-"+f},k.getNumberUniqueId=function(){return e++},k.log=function(){var a=g.call(arguments);j(a),d&&d.log.apply(d,a)},k.warn=function(){var a=g.call(arguments);j(a),d&&d.warn.apply(d,a)},k.error=function(){var a=g.call(arguments);j(a),d&&d.error.apply(d,a)},k.getConfig=function(a,b){return l[a]===c?b:l[a]},k.setConfig=function(a,b,d){d&&l[a]!==c||(l[a]=b)},k.getFrameworkPath=function(){var a,c,d,e,f=b.getElementsByTagName("script"),g=f.length;for(a=0;g>a;a++)if(c=f[a].src,d=c.split("/"),e=d.length,d[e-1]===i+".js"||d[e-1]===i+".min.js")return d.slice(0,e-1).join("/");return null}}(a.document,a.console),function(a,b,c){function d(a,b){var c,d=new XMLHttpRequest;return d.open("get",a,!1),b&&d.overrideMimeType(b),d.send(),4===d.readyState&&(c=d.status,200===c||0===c&&d.responseText)?d.responseText:null}function e(a){for(var b,c=l.call(a.querySelectorAll("script[src]")),d=c.length;--d>=0;)b=c[d],b.parentNode.removeChild(b);return c}function f(b){return function(){try{a.eval(b)}catch(d){d.stack?c.error(d.stack):d.name&&d.message?c.error(d.name,d.message):c.error(d)}}}function g(a){var b,c=a.length;for(b=0;c>b;++b)a[b]()}function h(a,c){var d,e,f,g,h=[];for(f=0,g=a.length;g>f;++f)e=j.fetchSync(a[f].src,"text/plain"),e&&(d=b.adoptNode(a[f]),d.setAttribute("data-src",a[f].src),d.removeAttribute("src"),h.push(j.safeEvalWrap(e)),c&&c.appendChild(d));return h}var i=null,j=c.util||{},k=[],l=[].slice,m=!1;j._requestAnimationFrameOnSetTimeout=function(b){i=a.setTimeout(b.bind(b,+new Date),1e3/60)},j._loop=function(){var a=l.call(k),b=a.shift(),c=performance.now();for(k=[];b;)b(),b=performance.now()-c<15?a.shift():null;a.length||k.length?(k.unshift.apply(k,a),j.windowRequestAnimationFrame(j._loop)):m=!1},j._getRequestAnimationFrame=function(){return(a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||j._requestAnimationFrameOnSetTimeout).bind(a)},j.windowRequestAnimationFrame=j._getRequestAnimationFrame(),j.requestAnimationFrame=function(a){k.push(a),m||(j.windowRequestAnimationFrame(j._loop),m=!0)},j._cancelAnimationFrameOnSetTimeout=function(){a.clearTimeout(i)},j._getCancelAnimationFrame=function(){return(a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.mozCancelAnimationFrame||a.oCancelAnimationFrame||a.msCancelAnimationFrame||j._cancelAnimationFrameOnSetTimeout).bind(a)},j.cancelAnimationFrame=j._getCancelAnimationFrame(),j.fetchSync=d,j._removeExternalScripts=e,j.safeEvalWrap=f,j.batchCall=g,j._createScriptsSync=h,j.async=j.requestAnimationFrame,j.importEvaluateAndAppendElement=function(a,c){var d=j._createScriptsSync(j._removeExternalScripts(a),a),e=b.importNode(a,!0);return c.appendChild(e),j.batchCall(d),e},j.isNumber=function(a){var b=parseFloat(a);return!isNaN(b)&&isFinite(b)},j.runScript=function(c,d){var e,f,g,h=b.createElement("script"),i=l.call(d.attributes),k=d.getAttribute("src");for(null!==k&&(k=j.path.makeUrlAbsolute(k,c)),f=i.length;--f>=0;)g=i[f],"src"!==g.name?h.setAttribute(g.name,g.value):h.setAttribute("data-src",g.value);e=k?j.fetchSync(k,"text/plain"):d.textContent,e&&(h.src=a.URL.createObjectURL(new Blob([e],{type:"text/javascript"})),h.textContent=e),d.parentNode.replaceChild(h,d)},c.util=j}(a,a.document,d),function(){function a(a,b){return 1-3*b+3*a}function b(a,b){return 3*b-6*a}function c(a){return 3*a}function e(d,e,f){return((a(e,f)*d+b(e,f))*d+c(e))*d}function f(d,e,f){return 3*a(e,f)*d*d+2*b(e,f)*d+c(e)}function g(a,b,c,d,f){var g,h,i=0;do h=b+(c-b)/2,g=e(h,d,f)-a,g>0?c=h:b=h;while(Math.abs(g)>m&&++i<n);return h}function h(a,b,c,d){for(var g=0;k>g;++g){var h=f(b,c,d);if(0===h)return b;var i=e(b,c,d)-a;b-=i/h}return b}function i(a){if(!a||4!==a.length)throw new Error("BezierEasing: points must contains 4 values");for(var b=0;4>b;++b)if("number"!=typeof a[b]||isNaN(a[b])||!isFinite(a[b]))throw new Error("BezierEasing: points should be integers.");if(a[0]<0||a[0]>1||a[2]<0||a[2]>1)throw new Error("BezierEasing x values must be in [0, 1] range.")}function j(a,b,c,d){return 4===arguments.length?new j([a,b,c,d]):this instanceof j?(i(a),this._str="BezierEasing("+a+")",this._css="cubic-bezier("+a+")",this._p=a,this._mSampleValues=q?new Float32Array(o):[],this._precomputed=!1,this.get=this.get.bind(this),this):new j(a)}var k=4,l=.001,m=1e-7,n=10,o=11,p=1/(o-1),q="function"==typeof Float32Array;j.prototype={get:function(a){var b=this._p[0],c=this._p[1],d=this._p[2],f=this._p[3];return this._precomputed||this._precompute(),b===c&&d===f?a:0>=a?0:a>=1?1:e(this._getTForX(a),c,f)},_precompute:function(){var a=this._p[0],b=this._p[1],c=this._p[2],d=this._p[3];this._precomputed=!0,(a!==b||c!==d)&&this._calcSampleValues()},_calcSampleValues:function(){for(var a=this._p[0],b=this._p[2],c=0;o>c;++c)this._mSampleValues[c]=e(c*p,a,b)},_getTForX:function(a){for(var b=this._p[0],c=this._p[2],d=this._mSampleValues,e=0,i=1,j=o-1;i!==j&&d[i]<=a;++i)e+=p;--i;var k=(a-d[i])/(d[i+1]-d[i]),m=e+k*p,n=f(m,b,c);return n>=l?h(a,m,b,c):0===n?m:g(a,e,e+p,b,c)}},j.css={ease:j.ease=new j(.25,.1,.25,1),easeIn:j.easeIn=new j(.42,0,1,1),easeOut:j.easeOut=new j(0,0,.58,1),easeInOut:j.easeInOut=new j(.42,0,.58,1)},d&&d.util&&(d.util.bezierCurve=j)}(),function(a,b,d){function e(){for(var a,b=[].slice.call(arguments),d=0,e=b.length;e>d;d++)if(a=b[d],a!==c)return a;return null}function f(a,b){var c,d,e,f=a.steps,g=a.from,h=null,i=0,j=100;for(c in f)f.hasOwnProperty(c)&&(d=f[c],e=c/100,b>=e?(g=d,i=e):null===h&&(h=d,j=e));return g+(b-i)/(j-i)*(h-g)}function g(a,b,c){var d,g,h=c.steps||a.steps;c.duration=e(c.duration,a.duration),c.delay=e(c.delay,a.delay,0),d=e(c.object,this._object),c.simpleProperty=c.property,c.property.split(".").forEach(function(a){"object"==typeof d[a]&&null!==d[a]?(d=d[a],c.propertyObject=d):c.simpleProperty=a}),c.propertyObject=d,h?(c.calculate=f.bind(null,c),h[0]=e(h[0],c.from,d[c.simpleProperty]),c.from=h[0],c.to=e(h[100],c.to),c.diff=0,c.current=h[0],c.direction=c.from<c.to?1:-1):(c.calculate=c.calculate||n,g=e(c.from,d[c.simpleProperty]),c.from=g,c.diff=c.to-g,c.current=g,c.direction=g<c.to?1:-1),c.startTime=Date.now()+c.delay,this._pausedTimeDiff&&(c.startTime=Date.now()-this._pausedTimeDiff,this._pausedTimeDiff=0),c.lastCalculationTime=c.startTime,c.timing=e(c.timing,a.timing,n),b.push(c)}function h(a,b){a._animate&&(a._animate.chain=[].slice.call(b),a.start())}function i(a,b){var c=[].slice.call(b),d=[];c.forEach(function(a){d.unshift(a),a.forEach(function(a){a.timing=o})}),a._animate.chain=d,a._animate.callback=null,a.start()}function j(a,b){var c,d;if(a&&a.startTime<b){if(c=b-a.startTime,c>=a.duration&&(c=a.duration,a.callback&&a.callback()),d=a.calculate(a.timing(c/a.duration),a.diff,a.from,a.current),null!==d)return a.current=d,a.propertyObject[a.simpleProperty]=a.current,c>=a.duration?2:1;if(c>=a.duration)return 2}return 0}var k=d.util,l=k.requestAnimationFrame,m=function(a){var b=this;b._object=a,b._animate={chain:[],chainIndex:0},b._pausedTimeDiff=null,b._animateConfig=null},n=function(a,b,d){return b=b===c?1:b,d=d===c?0:d,a*(b||0)+(d||0)},o=function(a){return 1-a},p={};k.bezierCurve=k.bezierCurve||bezierCurve,m.prototype=p,m.timing={linear:n,ease:k.bezierCurve.ease.get,easeInOut:k.bezierCurve.easeInOut.get},p.destroy=function(){var a=this;a._object=null,a._animate=null,a._animateConfig=null},p._initAnimate=function(){var a=this,b=[],c=a._animate.chain[a._animate.chainIndex++];c?(c.forEach(g.bind(a,a._config,b)),a._animateConfig=b):a._animateConfig=null},p.set=function(a){var b,c,d=this,e=[].slice.call(arguments);return b=e.pop(),Array.isArray(b)?(e.push(b),b=null):d._animate.config=b,d._config=b,c=[].slice.call(e),b&&(b.loop?d._animate.callback=h.bind(null,d,c):b.withRevert?d._animate.callback=i.bind(null,d,c):d._animate.callback=a.callback||b.callback),d._animate.chain=e,d},p.start=function(a){var b=this;return b._initAnimate(),a=b._animate.callback||a,b._animate.chainIndex<b._animate.chain.length?b._animationTimeout=b._calculateAnimate.bind(b,b.start.bind(b,a)):b._animationTimeout=b._calculateAnimate.bind(b,a),b._calculateAnimate(a),b},p.stop=function(){var a=this;return a._animate.chainIndex=0,a._animateConfig=null,a._animationTimeout=null,a},p.pause=function(){var a=this;a._animateConfig&&(a._pausedTimeDiff=Date.now()-a._animateConfig[0].startTime,a.stop())},p._calculateAnimate=function(a){var b,c,d,e=this,f=e._animateConfig,g=!1,h=0,i=Date.now();if(f){for(b=f.length,c=f.length;c>h;)d=j(f[h],i),2===d?(b--,f.splice(h,1),c--,h--,g=!0):1===d&&(g=!0),h++;g&&e._tickFunction&&e._tickFunction(e._object),b?e._animationTimeout&&l(e._animationTimeout):(e.stop(),a&&a())}},p.tick=function(a){var b=this._tickFunction;return b?this._tickFunction=function(c){b(c),a(c)}:this._tickFunction=a,this},k.Animate=m}(a,a.document,d),function(a,b){function c(a){var b=a._animation,c=a.state;a.options.currentIteration++<a.options.iteration?(b.set(c.animation,c.animationConfig),b.stop(),b.start()):(a.options.animation=h.STOPPED,a.trigger(l.MARQUEE_END))}var d=b.widget.BaseWidget,e=b.engine,f=b.util.object,g=b.util.Animate,h={RUNNING:"running",STOPPED:"stopped",IDLE:"idle"},i=function(){this.options=f.copy(i.defaults),this._callbacks={}},j=new d,k="ui-marquee",l={MARQUEE_START:"marqueestart",MARQUEE_END:"marqueeend",MARQUEE_STOPPED:"marqueestopped"},m={MARQUEE_CONTENT:k+"-content",MARQUEE_GRADIENT:k+"-gradient",MARQUEE_ELLIPSIS:k+"-ellipsis",ANIMATION_RUNNING:k+"-anim-running",ANIMATION_STOPPED:k+"-anim-stopped",ANIMATION_IDLE:k+"-anim-idle"},n={SCROLL:"scroll",SLIDE:"slide",ALTERNATE:"alternate",ENDTOEND:"endToEnd"},o={GRADIENT:"gradient",ELLIPSIS:"ellipsis",NONE:"none"},p=function(a){return Math.round(100*a)/100},q={marqueeStyle:n.SLIDE,speed:60,iteration:1,currentIteration:1,delay:0,timingFunction:"linear",ellipsisEffect:o.GRADIENT,runOnlyOnEllipsisText:!0,animation:h.STOPPED,autoRun:!0},r={LEFT:"-webkit-linear-gradient(left, transparent 0, rgb(255, 255, 255) 15%, rgb(255, 255, 255) 100%)",BOTH:"-webkit-linear-gradient(left, transparent 0, rgb(255, 255, 255) 15%, rgb(255, 255, 255) 85%, transparent 100%",RIGHT:"-webkit-linear-gradient(left, rgb(255, 255, 255) 0, rgb(255, 255, 255) 85%, transparent 100%)"};i.classes=m,i.defaults=q,j._calculateTranslateFunctions={scroll:function(a,b,c,d,e){var f,g=d+b*c;return f="translateX(-"+p(g)+"px)",e===f?null:f},slide:function(a,b,c,d,e){var f,g,h=a._stateDOM,i=h.offsetWidth,j=h.children[0].offsetWidth;return f=b*(j-i),g="translateX(-"+p(f)+"px)",e===g?null:g},alternate:function(a,b,c,d,e){var f,g=a._stateDOM,h=g.offsetWidth,i=g.children[0].offsetWidth,j=d+b*c;return j>i/2?j=i-2*(j-i/2):j*=2,j=j/i*(i-h),f="translateX(-"+p(j)+"px)",e===f?null:f},endToEnd:function(a,b,c,d,e){var f,g,h=a._stateDOM,i=h.children[0].offsetWidth,j=h.offsetWidth;return f=b*(i+j),f=f>i?j-f+i:-f,g="translateX("+p(f)+"px)",e===g?null:g}},j._calculateEndToEndGradient=function(a,b,c,d){var e,f=this,g=f._stateDOM,h=g.children[0].offsetWidth,i=g.offsetWidth,j=h/(h+i);return e=a>j?r.RIGHT:a>0?r.BOTH:r.LEFT,d===e?null:e},j._calculateStandardGradient=function(a,b,c,d){var e;return e=1===a?r.LEFT:a>0?r.BOTH:r.RIGHT,d===e?null:e},j._build=function(b){var c=b.querySelector("."+m.MARQUEE_CONTENT);if(!c){for(c=a.createElement("div");b.hasChildNodes();)c.appendChild(b.removeChild(b.firstChild));c.classList.add(m.MARQUEE_CONTENT),b.appendChild(c)}return b},j._initStateDOMstructure=function(){this._stateDOM={classList:[],offsetWidth:null,style:{webkitMaskImage:null},children:[{offsetWidth:null,style:{webkitTransform:null}}]}},j._initAnimation=function(){var a=this,b=a._stateDOM,c=b.children[0],d=c.offsetWidth,e=new g({}),f={hasEllipsisText:d>0,animation:[{object:c.style,property:"webkitTransform",calculate:a._calculateTranslateFunctions.scroll.bind(null,a),from:0,to:d},{object:b.style,calculate:a._calculateStandardGradient.bind(a),property:"webkitMaskImage",from:0,to:1}],animationConfig:{duration:d/a.options.speed*1e3,timing:g.timing.linear}};a.state=f,e.tick(a._render.bind(a,!0)),a._animation=e},j._init=function(a){var b=this;return b._initStateDOMstructure(),b._initDOMstate(),b._initAnimation(),b.option(b.options),a},j._setEllipsisEffect=function(a,b){return this._togglePrefixedClass(this._stateDOM,k+"-",b)},j._updateDuration=function(){var a=this,b=a._stateDOM,c=a.state,d=b.children[0],e=d.offsetWidth,f=e-b.offsetWidth,g=c.animationConfig;g.duration=f>0?e/a.options.speed*1e3:0,a._animation.set(c.animation,g)},j._setSpeed=function(a,b){var c=this;return c.options.speed=parseInt(b,10),c._updateDuration(),!1},j._setIteration=function(a,b){var d=this,e=d.state,f=e.animationConfig;return"infinite"===b?(f.loop=!0,f.callback=function(){d.options.animation=h.STOPPED,d.trigger.bind(d,l.MARQUEE_END)}):(b=parseInt(b,10),d.options.currentIteration=1,f.loop=!1,f.callback=c.bind(null,d)),d._animation.set(e.animation,f),d.options.loop=b,!1},j._setDelay=function(a,b){var c=this,d=c.state,e=d.animationConfig;return b=parseInt(b,10),e.delay=b,c._animation.set(d.animation,e),c.options.delay=b,!1},j._setTimingFunction=function(a,b){var c=this,d=c.state,e=d.animationConfig;return e.timing=g.timing[b],c._animation.set(d.animation,e),c.options.timing=b,!1},j._setAutoRun=function(a,b){return b&&this.start(),!1},j._setAnimation=function(a,b){var c=this,d=c._animation,e=c._stateDOM,f=c.options,g=e.children[0].offsetWidth-e.offsetWidth,i=f.runOnlyOnEllipsisText;return b!==f.animation&&(b===h.RUNNING?(i&&g||!i)&&(c.options.currentIteration=1,d.start(),c.trigger(l.MARQUEE_START)):(d.pause(),c.trigger(l.MARQUEE_STOPPED)),f.animation=b),!1},j._setMarqueeStyle=function(a,b){var c=this,d=c.state.animation;return d[0].calculate=c._calculateTranslateFunctions[b].bind(null,c),"endToEnd"===b?d[1].calculate=c._calculateEndToEndGradient.bind(c):d[1].calculate=c._calculateStandardGradient.bind(c),c.options.marqueeStyle=b,!1},j._destroy=function(){var a=this;a.state=null,a._stateDOM=null,a._animation.destroy(),a._animation=null},j.start=function(){this.option("animation","running")},j.stop=function(){var a=this,b=a._animation;b.pause(),this.option("animation","stopped")},j.reset=function(){var a=this,b=a._stateDOM;this.option("animation","stopped"),b.style.webkitMaskImage=r.RIGHT,b.children[0].style.webkitTransform="translateX(0)",a._render()},i.prototype=j,b.widget.core.Marquee=i,e.defineWidget("Marquee",".ui-marquee",["start","stop","reset"],i,"core")}(a.document,d),function(a){a.widget.core.viewswitcher=a.widget.core.viewswitcher||{}}(d),function(a,b){b.widget.core.viewswitcher.animation=b.widget.core.viewswitcher.animation||{}}(a,d),function(a,b){b.widget.core.viewswitcher.animation["interface"]={initPosition:function(){},animate:function(){},resetPosition:function(){}}}(a.document,d),function(a,b){function d(a,b,c,d,e){e&&g.setPrefixedStyle(a,"transition",g.getPrefixedValue("transform "+e/1e3+"s ease-out")),g.setPrefixedStyle(a,"transform","translate3d("+b+"px, "+c+"px, "+d+"px)")}function e(a){a.style.left="",a.style.right="",a.style.zIndex=j.ZINDEX_MIDDLE,a.style.transform="translateZ("+-a.parentNode.offsetWidth/2+"px)",a.style.webkitTransform="translateZ("+-a.parentNode.offsetWidth/2+"px)"}var f=b.util.object,g=b.util.DOM,h=b.widget.core.viewswitcher.animation,i=h["interface"],j={PERSPECTIVE:280,ZINDEX_TOP:3,ZINDEX_MIDDLE:2,ZINDEX_BOTTOM:1,DIM_LEVEL:6},k={useDim:!0,dimLevel:j.DIM_LEVEL},l={CAROUSEL:"ui-view-carousel",CAROUSEL_ACTIVE:"ui-view-carousel-active",CAROUSEL_LEFT:"ui-view-carousel-left",CAROUSEL_RIGHT:"ui-view-carousel-right",CAROUSEL_DIM:"ui-view-carousel-dim"};h.carousel=f.merge({},i,{initPosition:function(b,c){var d,e,f,g=b[0].parentNode,h=g.offsetWidth;if(g.classList.add(l.CAROUSEL),g.style.webkitPerspective=j.PERSPECTIVE,k.useDim)for(f=b.length,e=0;f>e;e++)d=a.createElement("DIV"),d.classList.add(l.CAROUSEL_DIM),b[e].appendChild(d);b[c].classList.add(l.CAROUSEL_ACTIVE),c>0&&(b[c-1].classList.add(l.CAROUSEL_LEFT),b[c-1].style.transform="translateZ("+-h/2+"px)"),c<b.length-1&&(b[c+1].classList.add(l.CAROUSEL_RIGHT),b[c+1].style.transform="translateZ("+-h/2+"px)")},animate:function(a,b,e){var f,g,h,i,m=a[0].parentNode,n=m.offsetWidth,o=n/2,p=b>0?a[b-1]:c,q=b<a.length-1?a[b+1]:c,r=a[b],s=e/100*n,t=s/2,u=o-r.offsetWidth/2,v=u/(.6*o),w=Math.abs(s),x=Math.abs(e),y=0>e?1:-1,z=.2*o*y,A=1.6*-y*o-t,B=-o-t,C=-o+t,D=.2*-t;r.style.left=(n-r.offsetWidth)/2+"px",r.style.zIndex=j.ZINDEX_TOP,g=0>s?q:p,i=0>s?g&&g.nextElementSibling:g&&g.previousElementSibling,f=0>s?p:q,h=0>s?f&&f.previousElementSibling:f&&f.nextElementSibling,g&&(.2*n>w?(g.style.zIndex=j.ZINDEX_MIDDLE,d(g,-t*v,0,0>s?B:C)):(r.style.zIndex=j.ZINDEX_MIDDLE,g.style.zIndex=j.ZINDEX_TOP,d(g,(2*z+t)*v,0,0>s?B:C)),i&&(i.classList.add(0>s?l.CAROUSEL_RIGHT:l.CAROUSEL_LEFT),d(i,.6*(0>s?B:-C),0,-n-t*y))),f&&(h&&h.classList.remove(0>s?l.CAROUSEL_LEFT:l.CAROUSEL_RIGHT),f.style.zIndex=j.ZINDEX_BOTTOM,d(f,D,0,0>s?C:B)),.8*n>w?d(r,t*v,0,t*y):d(r,A*v,0,t*y),k.useDim&&(r.querySelector("."+l.CAROUSEL_DIM).style.opacity=x*k.dimLevel/1e3,g&&(g.querySelector("."+l.CAROUSEL_DIM).style.opacity=k.dimLevel/10*(1-x/100)))},resetPosition:function(a,b){var c,d,f=a[0].parentNode,g=a[b],h=f.querySelectorAll("."+l.CAROUSEL_RIGHT),i=f.querySelectorAll("."+l.CAROUSEL_LEFT);for(f.querySelector("."+l.CAROUSEL_ACTIVE).classList.remove(l.CAROUSEL_ACTIVE),g.classList.add(l.CAROUSEL_ACTIVE),g.style.transform="",g.style.webkitTransform="",d=h.length,c=0;d>c;c++)h[c].classList.remove(l.CAROUSEL_RIGHT);for(b<a.length-1&&(a[b+1].classList.add(l.CAROUSEL_RIGHT),e(a[b+1])),d=i.length,c=0;d>c;c++)i[c].classList.remove(l.CAROUSEL_LEFT);b>0&&(a[b-1].classList.add(l.CAROUSEL_LEFT),e(a[b-1]))}}),h.carousel.options=k}(a.document,d),function(a,b){var c=b.widget.BaseWidget,d=b.event,e=b.engine,f=b.util.object,g=b.event.gesture,h=b.util.cancelAnimationFrame,i=b.util.requestAnimationFrame,j={ACTIVE_INDEX:0,ANIMATION_TYPE:"carousel",ANIMATION_SPEED:30,ANIMATION_TIMING_FUNCTION:"ease-out"},k={CHANGE_START:"viewchangestart",CHANGE_END:"viewchangeend",CHANGE:"viewchange"},l=function(){var a=this;a.options={},a._ui={}},m={VIEW:"ui-view",VIEW_ACTIVE:"ui-view-active",ANIMATION_TYPE:"ui-animation-"},n=new c;l.prototype=n,l.classes=m,n._configure=function(){var a=this;a.options=f.merge(a.options,{active:j.ACTIVE_INDEX,animationType:j.ANIMATION_TYPE,animationSpeed:j.ANIMATION_SPEED})},n._build=function(a){var b=this,c=b._ui;return c._views=a.querySelectorAll("."+m.VIEW),a},n._init=function(a){var b=this;return b._elementOffsetWidth=a.offsetWidth,b._initPosition(),a},n._initPosition=function(){var a=this,c=a._ui._views,d=a.options,e=a._getActiveIndex();a._type=b.widget.core.viewswitcher.animation[d.animationType],a._type.initPosition(c,e),a._activeIndex=e},n._getActiveIndex=function(){var a,b,c=this,d=c._ui,e=d._views;for(b=e.length,a=0;b>a;a++)if(e[a].classList.contains(m.VIEW_ACTIVE))return a;return c.options.active},n._bindEvents=function(){var a=this,b=a.element;d.enableGesture(b,new d.gesture.Drag({blockVertical:!0,threshold:0}),new d.gesture.Swipe({orientation:g.Orientation.HORIZONTAL})),d.on(b,"drag dragstart dragend swipe",a,!1)},n.handleEvent=function(a){var b=this;switch(a.type){case"drag":b._onDrag(a);break;case"dragstart":b._onDragStart(a);break;case"dragend":case"swipe":b._onDragEnd(a)}},n._onDrag=function(a){var b=this,c=a.detail.direction,d=a.detail.estimatedDeltaX,e=d/b._elementOffsetWidth*100,f=b._ui,g=f._views[b._activeIndex];"left"===c&&!g.nextElementSibling||"right"===c&&!g.previousElementSibling||b._dragging&&!b._isAnimating&&Math.abs(e)<100&&(b._type.animate(f._views,b._activeIndex,e),b._triggerChange(e))},n._onDragStart=function(a){var b=this,c=a.detail.direction,d=b._ui,e=d._views[b._activeIndex];"left"===c&&!e.nextElementSibling||"right"===c&&!e.previousElementSibling||b._dragging||(b._dragging=!0)},n._onDragEnd=function(a){var b=this,c=b._ui,d=c._views[b._activeIndex],e=a.detail.direction,f=a.detail.estimatedDeltaX;!b._dragging||b._isAnimating||"left"===e&&!d.nextElementSibling||"right"===e&&!d.previousElementSibling||(b._lastDirection=e,"dragend"===a.type&&Math.abs(f)<b._elementOffsetWidth/2&&(e="backward"),b.trigger(k.CHANGE_START),b._requestFrame(f,e))},n._triggerChange=function(a){var b=this,c=Math.abs(a);c>50&&!b._changed?(b.trigger(k.CHANGE,{index:b._activeIndex+(0>a?1:-1)}),b._changed=!0):50>c&&b._changed&&(b.trigger(k.CHANGE,{index:b._activeIndex}),b._changed=!1)},n._requestFrame=function(a,b,c){var d,e,f,g=this,l=g._elementOffsetWidth,n=c?c:j.ANIMATION_TIMING_FUNCTION,o=!1,p=g._lastDirection,q=g._ui,r=a,s=r/l*100,t=g._animationFrame;return"backward"===b?(d="left"===p?"right":"left",("left"===p&&r>0||"right"===p&&0>r)&&(o=!0,e=0)):(d=b,Math.abs(r)>l&&(o=!0,e=100)),f="left"===d?-1:1,o?(g._type.animate(q._views,g._activeIndex,e*f),h(t),"backward"!==b&&(q._views[g._activeIndex].classList.remove(m.VIEW_ACTIVE),g._activeIndex=g._activeIndex-f,g._type.resetPosition(q._views,g._activeIndex),q._views[g._activeIndex].classList.add(m.VIEW_ACTIVE)),g._dragging=!1,g._isAnimating=!1,g._changed=!1,void g.trigger(k.CHANGE_END)):(g._type.animate(q._views,g._activeIndex,s),g._triggerChange(s),g._isAnimating=!0,"ease-out"===n?r+=Math.abs(r)>.95*l?f:g.options.animationSpeed*f:"linear"===n&&(r+=g.options.animationSpeed*f),void(g._animationFrame=i(g._requestFrame.bind(g,r,b,c))))},n.setActiveIndex=function(a){var b,c,d,e=this,f=e._activeIndex,g=f-a;if(!e._isAnimating&&a<e._ui._views.length&&a>=0)for(e._lastDeltaX=0,b=0>g?"left":"right",d=Math.abs(g),e._lastDirection=b,c=0;d>c;c++)e.trigger(k.CHANGE_START),e._requestFrame(0,b,"linear")},n.getActiveIndex=function(){return this._activeIndex},n._destroy=function(){var a=this.element;d.disableGesture(a),d.off(a,"drag dragstart dragend",this,!1),this.options=null,this._ui=null},b.widget.core.viewswitcher.ViewSwitcher=l,e.defineWidget("ViewSwitcher","[data-role='viewSwitcher'], .ui-view-switcher",["setActiveIndex","getActiveIndex"],l);
}(a.document,d),function(b,d){var e=d.widget.BaseWidget,f=d.engine,g=function(){var a=this;a._activeIndex=null,a.options={}},h={indicator:"ui-page-indicator",indicatorActive:"ui-page-indicator-active",indicatorItem:"ui-page-indicator-item",indicatorDashed:"ui-page-indicator-dashed",linearIndicator:"ui-page-indicator-linear",circularIndicator:"ui-page-indicator-circular"},i={IN_CIRCLE:60,IN_LINEAR:5},j={LINEAR:"linear",CIRCULAR:"circular"},k=8,l=new e;g.classes=h,l._configure=function(){this.options={maxPage:null,numberOfPages:null,layout:"linear",intervalAngle:6,style:"dashed"}},l._build=function(a){var b=this,c=b.options;return b._createIndicator(a),c.layout===j.CIRCULAR&&b._circularPositioning(a),"dashed"===c.style&&a.classList.add(h.indicatorDashed),a},l._createIndicator=function(a){var c,e,f,g,i=this,k=i.options.numberOfPages;if(null===k)return void d.error("build error: numberOfPages is null");for(i.options.layout=i.options.layout.toLowerCase(),i.options.layout===j.CIRCULAR?(a.classList.remove(h.linearIndicator),a.classList.add(h.circularIndicator)):(a.classList.remove(h.circularIndicator),a.classList.add(h.linearIndicator)),f=i._getMaxPage(),e=f>k?k:f,c=0;e>c;c++)g=b.createElement("span"),g.classList.add(h.indicatorItem),a.appendChild(g)},l._circularPositioning=function(a){var b,c,d,e=this,f=a.children,g=f.length,h=e.options.intervalAngle-"0";for(b=a.offsetWidth/2-k,d=0;g>d;d++)c="rotate("+(d*h-90-(g-1)*h*.5)+"deg) translate("+b+"px) ",f[d].style.transform=c},l._getMaxPage=function(){var a,b=this,c=b.options;return a=c.layout===j.CIRCULAR?c.maxPage||i.IN_CIRCLE:c.maxPage||i.IN_LINEAR},l._removeIndicator=function(a){a.textContent=""},l.setActive=function(b){var e,f,g,i=this,j=b,k=i.element.children,l=parseInt(i.options.numberOfPages,10),m=0,n=h.indicatorActive;if(null!==b&&b!==c){if(i._activeIndex=b,e=i._getMaxPage(),f=a.parseInt(e/2,10),l>e)m=l-e;else{if(isNaN(l))return void d.error("setActive error: numberOfPages is not a number");if(0===l)return}g=i.element.querySelector("."+n),g&&g.classList.remove(n),b>f&&f+m>=b?j=f:b>f+m&&(j=b-m),k[j].classList.add(n)}},l._refresh=function(){var a=this,b=a.element;a._removeIndicator(b),a._createIndicator(b),a.options.layout===j.CIRCULAR&&a._circularPositioning(b)},l._destroy=function(){this._removeIndicator(this.element)},g.prototype=l,d.widget.core.PageIndicator=g,f.defineWidget("PageIndicator","[data-role='page-indicator'], .ui-page-indicator",["setActive"],g,"core")}(a.document,d),function(a,b){var c=a.event.gesture;c.utils={getCenter:function(a){var c=[],d=[];return[].forEach.call(a,function(a){c.push(isNaN(a.clientX)?a.pageX:a.clientX),d.push(isNaN(a.clientY)?a.pageY:a.clientY)}),{clientX:(b.min.apply(b,c)+b.max.apply(b,c))/2,clientY:(b.min.apply(b,d)+b.max.apply(b,d))/2}},getVelocity:function(a,c,d){return{x:b.abs(c/a)||0,y:b.abs(d/a)||0}},getAngle:function(a,c){var d=c.clientY-a.clientY,e=c.clientX-a.clientX;return 180*b.atan2(d,e)/b.PI},getDirection:function(a,d){var e=b.abs(a.clientX-d.clientX),f=b.abs(a.clientY-d.clientY);return e>=f?a.clientX-d.clientX>0?c.Direction.LEFT:c.Direction.RIGHT:a.clientY-d.clientY>0?c.Direction.UP:c.Direction.DOWN},getDistance:function(a,c){var d=c.clientX-a.clientX,e=c.clientY-a.clientY;return b.sqrt(d*d+e*e)},getScale:function(a,b){return a.length>=2&&b.length>=2?this.getDistance(b[0],b[1])/this.getDistance(a[0],a[1]):1},getRotation:function(a,b){return a.length>=2&&b.length>=2?this.getAngle(b[1],b[0])-this.getAngle(a[1],a[0]):0},isVertical:function(a){return a===c.Direction.UP||a===c.Direction.DOWN},isHorizontal:function(a){return a===c.Direction.LEFT||a===c.Direction.RIGHT},getOrientation:function(a){return this.isVertical(a)?c.Orientation.VERTICAL:c.Orientation.HORIZONTAL}}}(d,a.Math),function(a){var b=a.event.gesture,c=a.util.object.merge,d=function(a,b){this.sender=b,this.strategy=a.create(),this.name=this.strategy.name,this.index=this.strategy.index||100,this.options=this.strategy.options||{}};d.prototype.detect=function(a){return this.strategy.handler(a,this.sender,this.strategy.options)},d.Sender={sendEvent:function(){}},d.plugin={},d.plugin.create=function(a){var b;return a.types||(a.types=[a.name]),b=function(b){this.options=c({},a.defaults,b)},b.prototype.create=function(){return c({options:this.options},a)},d.plugin[a.name]=b,b},b.Detector=d}(d),function(a,b,c){var d=a.event.gesture,e=d.utils,f=d.Detector,g=a.util.object.merge,h={start:"dragstart",drag:"drag",end:"dragend",cancel:"dragcancel",prepare:"dragprepare"},i=!!b.navigator.userAgent.match(/tizen/i)&&function(){var b,d=!0;if(c&&c.systeminfo&&c.systeminfo.getCapability)try{return b=c.systeminfo.getCapability("http://tizen.org/feature/platform.version"),"3.0">b}catch(e){a.error("Error name: "+e.name+", message: "+e.message)}return d}(),j=b.navigator.userAgent.indexOf("Chrome")>-1,k=d.Result,l=f.plugin.create({name:"drag",index:500,defaults:{blockHorizontal:!1,blockVertical:!1,threshold:20,delay:0},isTriggered:!1,handler:function(a,b,c){var f,l=c.threshold,m=k.PENDING,n=a.direction;if(!this.isTriggered&&a.eventType===d.Event.MOVE){if(Math.abs(a.deltaX)<l&&Math.abs(a.deltaY)<l)return j&&a.preventDefault(),k.PENDING;if(c.delay&&a.deltaTime<c.delay)return i||a.preventDefault(),k.PENDING;if(c.blockHorizontal&&e.isHorizontal(a.direction)||c.blockVertical&&e.isVertical(a.direction))return k.FINISHED;this.fixedStartPointX=0,this.fixedStartPointY=0,e.isHorizontal(a.direction)?this.fixedStartPointX=(a.deltaX<0?1:-1)*l:this.fixedStartPointY=(a.deltaY<0?1:-1)*l}switch(c.blockHorizontal&&(n=a.deltaY<0?d.Direction.UP:d.Direction.DOWN),c.blockVertical&&(n=a.deltaX<0?d.Direction.LEFT:d.Direction.RIGHT),f=g({},a,{deltaX:a.deltaX+this.fixedStartPointX,deltaY:a.deltaY+this.fixedStartPointY,estimatedDeltaX:a.estimatedDeltaX+this.fixedStartPointX,estimatedDeltaY:a.estimatedDeltaY+this.fixedStartPointY,direction:n}),f.eventType){case d.Event.START:this.isTriggered=!1,b.sendEvent(h.prepare,f)===!1&&(m=k.FINISHED);break;case d.Event.MOVE:this.isTriggered||b.sendEvent(h.start,f)!==!1||f.preventDefault(),m=b.sendEvent(h.drag,f)?k.RUNNING:k.FINISHED,m===!1&&f.preventDefault(),this.isTriggered=!0;break;case d.Event.BLOCKED:case d.Event.END:m=k.FINISHED,this.isTriggered&&(b.sendEvent(h.end,f)===!1&&f.preventDefault(),this.isTriggered=!1);break;case d.Event.CANCEL:m=k.FINISHED,this.isTriggered&&(b.sendEvent(h.cancel,f)===!1&&f.preventDefault(),this.isTriggered=!1)}return m}});a.event.gesture.Drag=l}(d,a,a.tizen),function(a,b){b.widget.core.scroller=b.widget.core.scroller||{}}(a,d),function(a,b){b.widget.core.scroller.effect=b.widget.core.scroller.effect||{}}(a,d),function(a,b){var c=b.util.object,d=b.util.selectors,e=function(a,d){var f=this;f._orientation=null,f._maxValue=null,f._container=null,f._minEffectElement=null,f._maxEffectElement=null,f.options=c.merge({},e.defaults,{scrollEndEffectArea:b.getConfig("scrollEndEffectArea",e.defaults.scrollEndEffectArea)}),f._targetElement=null,f._isShow=!1,f._isDrag=!1,f._isShowAnimating=!1,f._isHideAnimating=!1,f._create(a,d)},f={VERTICAL:"vertical",HORIZONTAL:"horizontal"},g={content:"content",screen:"screen"},h={duration:500,scrollEndEffectArea:"content"},i={bouncingEffect:"ui-scrollbar-bouncing-effect",page:"ui-page",left:"ui-left",right:"ui-right",top:"ui-top",bottom:"ui-bottom",hide:"ui-hide",show:"ui-show"};e.Orientation=f,e.defaults=h,e.prototype={_create:function(a,b){var c=this;c.options.scrollEndEffectArea===g.content?c._container=a:c._container=d.getClosestByClass(a,i.page),c._orientation=b.orientation,c._maxValue=c._getValue(b.maxScrollX,b.maxScrollY),c._initLayout()},_initLayout:function(){var b=this,c=b._minEffectElement=a.createElement("DIV"),d=b._maxEffectElement=a.createElement("DIV"),e=i.bouncingEffect;b._orientation===f.HORIZONTAL?(c.className=e+" "+i.left,d.className=e+" "+i.right):(c.className=e+" "+i.top,d.className=e+" "+i.bottom),b._container.appendChild(c),b._container.appendChild(d),c.addEventListener("animationEnd",this),c.addEventListener("webkitAnimationEnd",this),c.addEventListener("mozAnimationEnd",this),c.addEventListener("msAnimationEnd",this),c.addEventListener("oAnimationEnd",this),d.addEventListener("animationEnd",this),d.addEventListener("webkitAnimationEnd",this),d.addEventListener("mozAnimationEnd",this),d.addEventListener("msAnimationEnd",this),d.addEventListener("oAnimationEnd",this)},drag:function(a,b){this._isDrag=!0,this._checkAndShow(a,b)},dragEnd:function(){var a=this;!a._isShow||a._isShowAnimating||a._isHideAnimating||a._beginHide(),a._isDrag=!1},show:function(){var a=this;a._targetElement&&(a._isShow=!0,a._beginShow())},hide:function(){var a=this;a._isShow&&(a._minEffectElement.style.display="none",a._maxEffectElement.style.display="none",a._targetElement.classList.remove(i.hide),a._targetElement.classList.remove(i.show)),a._isShow=!1,a._isShowAnimating=!1,a._isHideAnimating=!1,a._targetElement=null},_checkAndShow:function(a,b){var c=this,d=c._getValue(a,b);c._isShow?!c._isShow||c._isDrag||c._isShowAnimating||c._isHideAnimating||c._beginHide():d>=0?(c._targetElement=c._minEffectElement,c.show()):d<=c._maxValue&&(c._targetElement=c._maxEffectElement,c.show())},_getValue:function(a,b){return this._orientation===f.HORIZONTAL?a:b},_beginShow:function(){var a=this;a._targetElement&&!a._isShowAnimating&&(a._targetElement.style.display="block",a._targetElement.classList.remove(i.hide),a._targetElement.classList.add(i.show),a._isShowAnimating=!0,a._isHideAnimating=!1)},_finishShow:function(){var a=this;a._isShowAnimating=!1,a._isDrag||(a._targetElement.classList.remove(i.show),a._beginHide())},_beginHide:function(){var a=this;a._isHideAnimating||(a._targetElement.classList.remove(i.show),a._targetElement.classList.add(i.hide),a._isHideAnimating=!0,a._isShowAnimating=!1)},_finishHide:function(){var a=this;a._isHideAnimating=!1,a._targetElement.classList.remove(i.hide),a.hide(),a._checkAndShow()},handleEvent:function(a){a.type.toLowerCase().indexOf("animationend")>-1&&"-"!==a.animationName.charAt(0)&&(this._isShowAnimating?this._finishShow():this._isHideAnimating&&this._finishHide())},destroy:function(){var a=this,b=this._maxEffectElement,c=this._minEffectElement;c.removeEventListener("animationEnd",this),c.removeEventListener("webkitAnimationEnd",this),c.removeEventListener("mozAnimationEnd",this),c.removeEventListener("msAnimationEnd",this),c.removeEventListener("oAnimationEnd",this),b.removeEventListener("animationEnd",this),b.removeEventListener("webkitAnimationEnd",this),b.removeEventListener("mozAnimationEnd",this),b.removeEventListener("msAnimationEnd",this),b.removeEventListener("oAnimationEnd",this),a._container.removeChild(c),a._container.removeChild(b),a._container=null,a._minEffectElement=null,a._maxEffectElement=null,a._targetElement=null,a._isShow=null,a._orientation=null,a._maxValue=null}},b.widget.core.scroller.effect.Bouncing=e}(a.document,d),function(b,c){var d=c.widget.BaseWidget,e=c.engine,f=c.util.object,g=c.event,h=new d,i=c.widget.core.scroller.effect.Bouncing,j={START:"scrollstart",MOVE:"scrollmove",END:"scrollend",CANCEL:"scrollcancel"},k=!1,l=function(){};l.Orientation={VERTICAL:"vertical",HORIZONTAL:"horizontal"},l.EventType=j,h._build=function(a){return 1!==a.children.length?c.error("[Scroller] Scroller should have only one child."):(this.scroller=a.children[0],this.scrollerStyle=this.scroller.style,this.bouncingEffect=null,this.scrollbar=null,this.scrollerWidth=0,this.scrollerHeight=0,this.scrollerOffsetX=0,this.scrollerOffsetY=0,this.maxScrollX=0,this.maxScrollY=0,this.startScrollerOffsetX=0,this.startScrollerOffsetY=0,this.orientation=null,this.enabled=!0,this.scrolled=!1,this.dragging=!1,this.scrollCanceled=!1),a},h._configure=function(){this.options=f.merge({},this.options,{scrollDelay:0,threshold:30,scrollbar:"",useBouncingEffect:!0,orientation:"vertical"})},h._init=function(a){var b=null,c=this.options,d=null,e=a.style,f=null,g=a.offsetWidth/2,h=a.offsetHeight/2;return b=a.children[0],this.scroller=b,f=b.style,this.scrollerStyle=f,d=b.children,this.orientation=this.orientation||("horizontal"===c.orientation?l.Orientation.HORIZONTAL:l.Orientation.VERTICAL),this.scrollerWidth=b.offsetWidth,this.scrollerHeight=b.offsetHeight,d.length?(this.maxScrollX=g-this.scrollerWidth+d[d.length-1].offsetWidth/2,this.maxScrollY=h-this.scrollerHeight+d[d.length-1].offsetHeight/2,this.minScrollX=g-d[0].offsetWidth/2,this.minScrollY=h-d[0].offsetHeight/2):(this.maxScrollY=360,this.minScrollY=0),this.scrolled=!1,this.touching=!0,this.scrollCanceled=!1,this.orientation===l.Orientation.HORIZONTAL?this.maxScrollY=0:this.maxScrollX=0,e.overflow="hidden",e.position="relative",f.position="absolute",f.top="0px",f.left="0px",f.width=this.scrollerWidth+"px",f.height=this.scrollerHeight+"px",this._initScrollbar(),this._initBouncingEffect(),a},h._initScrollbar=function(){var a,b=this.options.scrollbar;b&&(a=c.widget.core.scroller.scrollbar.type[b],a&&(this.scrollbar=e.instanceWidget(this.element,"ScrollBar",{type:a,orientation:this.orientation})))},h._initBouncingEffect=function(){var a=this.options;a.useBouncingEffect&&(this.bouncingEffect=new i(this.element,{maxScrollX:this.maxScrollX,maxScrollY:this.maxScrollY,orientation:this.orientation}))},h._resetLayout=function(){var a=this.element.style,b=this.scrollerStyle;a.overflow="",a.position="",a.overflow="hidden",a.position="relative",b&&(b.position="",b.top="",b.left="",b.width="",b.height="",b["-webkit-transform"]="",b["-moz-transition"]="",b["-ms-transition"]="",b["-o-transition"]="",b.transition="")},h._bindEvents=function(){c.event.enableGesture(this.scroller,new c.event.gesture.Drag({threshold:this.options.threshold,delay:this.options.scrollDelay,blockVertical:this.orientation===l.Orientation.HORIZONTAL,blockHorizontal:this.orientation===l.Orientation.VERTICAL})),g.on(this.scroller,"drag dragstart dragend dragcancel",this),a.addEventListener("resize",this)},h._unbindEvents=function(){this.scroller&&(c.event.disableGesture(this.scroller),g.off(this.scroller,"drag dragstart dragend dragcancel",this),a.removeEventListener("resize",this))},h.handleEvent=function(a){switch(a.type){case"dragstart":this._start(a);break;case"drag":this._move(a);break;case"dragend":this._end(a);break;case"dragcancel":this._cancel(a);break;case"resize":this.refresh()}},h._refresh=function(){this._unbindEvents(),this._clear(),this._init(this.element),this._bindEvents()},h.scrollTo=function(a,b,c){this._translate(a,b,c),this._translateScrollbar(a,b,c)},h._translate=function(b,c,d){var e,f={normal:"none",webkit:"none",moz:"none",ms:"none",o:"none"},g=this.scrollerStyle;d&&(f.normal="transform "+d/1e3+"s ease-out",f.webkit="-webkit-transform "+d/1e3+"s ease-out",f.moz="-moz-transform "+d/1e3+"s ease-out",f.ms="-ms-transform "+d/1e3+"s ease-out",f.o="-o-transform "+d/1e3+"s ease-out"),e="translate3d("+b+"px,"+c+"px, 0)",g["-webkit-transform"]=g["-moz-transform"]=g["-ms-transform"]=g["-o-transform"]=g.transform=e,g.transition=f.normal,g["-webkit-transition"]=f.webkit,g["-moz-transition"]=f.moz,g["-ms-transition"]=f.ms,g["-o-transition"]=f.o,this.scrollerOffsetX=a.parseInt(b,10),this.scrollerOffsetY=a.parseInt(c,10)},h._translateScrollbar=function(a,b,c,d){this.scrollbar&&this.scrollbar.translate(this.orientation===l.Orientation.HORIZONTAL?-a:-b,c,d)},h._start=function(){var a=this;a.scrolled=!1,a.dragging=!0,a.scrollCanceled=!1,a.startScrollerOffsetX=a.scrollerOffsetX,a.startScrollerOffsetY=a.scrollerOffsetY},h._move=function(a){var b=this.startScrollerOffsetX,c=this.startScrollerOffsetY,d=!k;this.enabled&&!this.scrollCanceled&&this.dragging&&(this.orientation===l.Orientation.HORIZONTAL?b+=a.detail.estimatedDeltaX:c+=a.detail.estimatedDeltaY,(b>this.minScrollX||b<this.maxScrollX)&&(b=b>this.minScrollX?this.minScrollX:this.maxScrollX),(c>this.minScrollY||c<this.maxScrollY)&&(c=c>this.minScrollY?this.minScrollY:this.maxScrollY),b!==this.scrollerOffsetX||c!==this.scrollerOffsetY?(this.scrolled||this.trigger(j.START),this.scrolled=!0,this._translate(b,c),this._translateScrollbar(b,c,0,d),this.trigger(j.MOVE),this.bouncingEffect&&this.bouncingEffect.hide()):(this.bouncingEffect&&this.bouncingEffect.drag(b,c),this._translateScrollbar(b,c,0,d)))},h._end=function(){this.dragging&&(this.bouncingEffect&&this.bouncingEffect.dragEnd(),this.scrollbar&&this.scrollbar.end(),this._endScroll(),this.dragging=!1)},h._endScroll=function(){this.scrolled&&this.trigger(j.END),this.scrolled=!1},h._cancel=function(){this.scrollCanceled=!0,this.scrolled&&(this._translate(this.startScrollerOffsetX,this.startScrollerOffsetY),this._translateScrollbar(this.startScrollerOffsetX,this.startScrollerOffsetY),this.trigger(j.CANCEL)),this.scrollbar&&this.scrollbar.end(),this.scrolled=!1,this.dragging=!1},h._clear=function(){this.scrolled=!1,this.scrollCanceled=!1,this._resetLayout(),this._clearScrollbar(),this._clearBouncingEffect()},h._clearScrollbar=function(){this.scrollbar&&this.scrollbar.destroy(),this.scrollbar=null},h._clearBouncingEffect=function(){this.bouncingEffect&&this.bouncingEffect.destroy(),this.bouncingEffect=null},h._disable=function(){this.enabled=!1},h._enable=function(){this.enabled=!0},h._destroy=function(){this._unbindEvents(),this._clear(),this.scrollerStyle=null,this.scroller=null},l.prototype=h,c.widget.core.scroller.Scroller=l,e.defineWidget("Scroller",".scroller",["scrollTo","cancel"],l)}(a.document,d),function(a,b){b.widget.core.scroller.scrollbar=b.widget.core.scroller.scrollbar||{}}(a,d),function(a,b){b.widget.core.scroller.scrollbar.type=b.widget.core.scroller.scrollbar.type||{}}(a,d),function(a,b){b.widget.core.scroller.scrollbar.type["interface"]={setScrollbarLayout:function(){},remove:function(){},start:function(){},end:function(){},offset:function(){}}}(a.document,d),function(a,b){var c=b.util.object,d=b.widget.core.scroller.scrollbar.type,e=d["interface"],f=b.widget.core.scroller.Scroller;d.bar=c.merge({},e,{options:{animationDuration:500},setScrollbar:function(a,b,c){this._viewLayout=a,this._clipLayout=c,this._firstChildLayout=b,this._ratio=c/b},getScrollbarSize:function(){return this._firstChildLayout/this._viewLayout*this._firstChildLayout*this._ratio},offset:function(a,b){var c,d;return b=b*this._clipLayout/this._viewLayout,a===f.Orientation.VERTICAL?(c=0,d=b):(c=b,d=0),{x:c,y:d}},start:function(a){var b=a.style,c=this.options.animationDuration;b["-webkit-transition"]=b["-moz-transition"]=b["-ms-transition"]=b["-o-transition"]=b.transition="opacity "+c/1e3+"s ease",b.opacity=1},end:function(a){var b=a.style,c=this.options.animationDuration;b["-webkit-transition"]=b["-moz-transition"]=b["-ms-transition"]=b["-o-transition"]=b.transition="opacity "+c/1e3+"s ease",b.opacity=0}})}(a.document,d),function(b,c){var d=c.util.object,e=c.widget.core.scroller.scrollbar.type,f=e["interface"],g=c.widget.core.scroller.Scroller;e.tab=d.merge({},f,{options:{wrapperClass:"ui-scrollbar-tab-type",barClass:"ui-scrollbar-indicator",margin:1},insertAndDecorate:function(b){var c,d,e,f,h=b.wrapper,i=b.bar,j=b.container,k=b.clip,l=b.sections,m=b.orientation,n=this.options.margin,o=k.offsetWidth,p=k.offsetHeight,q=j.offsetWidth,r=j.offsetHeight,s=m===g.Orientation.VERTICAL?p:o,t=m===g.Orientation.VERTICAL?r:q,u=s/t;if(this.containerSize=q,this.maxScrollOffset=s-t,this.scrollZoomRate=q/s,this.barSize=a.parseInt((q-2*n*(u-1))/u),h.className=this.options.wrapperClass,i.className=this.options.barClass,i.style.width=this.barSize+"px",i.style.left="0px",j.insertBefore(h,k),d=i.offsetHeight,c=p-d,k.style.height=c+"px",l&&l.length)for(e=0,f=l.length;f>e;e++)l[e].style.height=c+"px"},remove:function(a){var b=a.wrapper,c=a.container;c&&b&&c.removeChild(b)},offset:function(a,b){return{x:0===b?-1:b===this.maxScrollOffset?this.containerSize-this.barSize-this.options.margin:b*this.scrollZoomRate,y:0}}})}(a.document,d),function(b,c){var d=c.widget.BaseWidget,e=c.engine,f=new d,g=c.util.object,h=c.util.selectors,i=c.widget.core.Page,j={wrapperClass:"ui-scrollbar-bar-type",barClass:"ui-scrollbar-indicator",orientationClass:"ui-scrollbar-",page:i.classes.uiPage},k=c.widget.core.scroller.Scroller,l=function(){this.wrapper=null,this.barElement=null,this.container=null,this.view=null,this.options={},this.type=null,this.maxScroll=null,this.started=!1,this.displayDelayTimeoutId=null,this.lastScrollPosition=0};f._build=function(a){return this.clip=a,this.view=a.children[0],this.firstChild=this.view.children[0],a},f._configure=function(){this.options=g.merge({},this.options,{type:!1,displayDelay:700,orientation:k.Orientation.VERTICAL})},f._init=function(a){this.clip=a,this.view=a.children[0],this.firstChild=this.view.children[0],this.type=this.options.type,this.type&&this._createScrollbar()},f._bindEvents=function(){b.addEventListener("visibilitychange",this)},f._createScrollbar=function(){var a=this.options.orientation,c=b.createElement("DIV"),d=b.createElement("span"),e=this.view,f=this.clip,g=this.firstChild,h=this.type;f.appendChild(c),c.appendChild(d),c.classList.add(j.wrapperClass),d.className=j.barClass,a===k.Orientation.HORIZONTAL?(h.setScrollbar(e.offsetWidth,g.offsetWidth,f.offsetWidth),d.style.width=h.getScrollbarSize()+"px",c.classList.add(j.orientationClass+"horizontal")):(h.setScrollbar(e.offsetHeight,g.offsetHeight,f.offsetHeight),d.style.height=h.getScrollbarSize()+"px",c.classList.add(j.orientationClass+"vertical")),this.wrapper=c,this.barElement=d},f._removeScrollbar=function(){this.clip.removeChild(this.wrapper),this.wrapper=null,this.barElement=null},f._refresh=function(){var a=this;a._clear(),a._init(),a.translate(a.lastScrollPosition)},f.translate=function(b,c,d){var e,f,g,h=this.options.orientation,i={normal:"none",webkit:"none",moz:"none",ms:"none",o:"none"};this.wrapper&&this.type&&this.lastScrollPosition!==b&&(d=d!==!1,this.lastScrollPosition=b,b=this.type.offset(h,b),f=this.barElement.style,c&&(i.normal="transform "+c/1e3+"s ease-out",i.webkit="-webkit-transform "+c/1e3+"s ease-out",i.moz="-moz-transform "+c/1e3+"s ease-out",i.ms="-ms-transform "+c/1e3+"s ease-out",i.o="-o-transform "+c/1e3+"s ease-out"),e="translate3d("+b.x+"px,"+b.y+"px, 0)",f["-webkit-transform"]=f["-moz-transform"]=f["-ms-transform"]=f["-o-transform"]=f.transform=e,f["-webkit-transition"]=i.webkit,f["-moz-transition"]=i.moz,f["-ms-transition"]=i.ms,f["-o-transition"]=i.o,f.transition=i.normal,this.started||this._start(),null!==this.displayDelayTimeoutId&&(a.clearTimeout(this.displayDelayTimeoutId),this.displayDelayTimeoutId=null),d&&(g=(c||0)+this.options.displayDelay,this.displayDelayTimeoutId=a.setTimeout(this._end.bind(this),g)))},f.end=function(){this.displayDelayTimeoutId||(this.displayDelayTimeoutId=a.setTimeout(this._end.bind(this),this.options.displayDelay))},f._start=function(){this.type.start(this.wrapper,this.barElement),this.started=!0},f._end=function(){this.started=!1,this.displayDelayTimeoutId=null,this.type&&this.type.end(this.wrapper,this.barElement)},f.handleEvent=function(a){var d;switch(a.type){case"visibilitychange":d=h.getClosestBySelector(this.clip,"."+j.page),"visible"===b.visibilityState&&d===c.activePage&&this.refresh()}},f._clear=function(){this._removeScrollbar(),this.started=!1,this.type=null,this.barElement=null,this.displayDelayTimeoutId=null},f._destroy=function(){this._clear(),b.removeEventListener("visibilitychange",this),this.options=null,this.clip=null,this.view=null},l.prototype=f,c.widget.core.scroller.scrollbar.ScrollBar=l,e.defineWidget("ScrollBar","",["translate"],l)}(a.document,d),function(a){function b(a,b,d){a.forEach(function(a){c.matchesSelector(a,b)&&a.classList.add(d)})}var c=a.util.selectors,d=[].slice,e=[null,"solo","a","b","c","d"];a.util.grid={makeGrid:function(a,c){var f,g=a.classList,h=d.call(a.children);c||(c=e[h.length],c||(c="a",f=2,g.add("ui-grid-duo"))),f||(f=e.indexOf(c)),g.add("ui-grid-"+c),b(h,":nth-child("+f+"n+1)","ui-block-a"),f>1&&b(h,":nth-child("+f+"n+2)","ui-block-b"),f>2&&b(h,":nth-child("+f+"n+3)","ui-block-c"),f>3&&b(h,":nth-child("+f+"n+4)","ui-block-d"),f>4&&b(h,":nth-child("+f+"n+5)","ui-block-e")}}}(d),function(a){a.util.easing={cubicOut:function(a,b,c,d){return a/=d,a--,c*(a*a*a+1)+b},easeOutQuad:function(a,b,c,d){return-c*(a/=d)*(a-2)+b},easeOutSine:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},easeOutExpo:function(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b},linear:function(a,b,c,d){return b+c*a/d}}}(d),function(a,b,d){var e=b.body,f=d.event,g=d.engine.eventType,h={_window:a,supported:a.orientation!==c&&a.onorientationchange!==c,properties:["orientation"],_orientation:"portrait"},i=function(b){var c=h._window,d=c.innerWidth,e=c.innerHeight;c.screen&&(d=c.screen.availWidth,e=c.screen.availHeight),d>e?h._orientation="landscape":h._orientation="portrait",b||f.trigger(a,"orientationchange",{orientation:h._orientation})},j=function(){if(h._window.orientation)switch(h._window.orientation){case 90:case-90:h._orientation="portrait";break;default:h._orientation="landscape"}else i(!0)},k=function(b,c){b.matches?h._orientation="portrait":h._orientation="landscape",c||f.trigger(a,"orientationchange",{orientation:h._orientation})},l=null;h.getOrientation=function(){return h._orientation},h.trigger=function(a){f.trigger(a,"orientationchange",{orientation:h._orientation})},h.unbind=function(){a.removeEventListener("orientationchange",j,!1),e.removeEventListener("throttledresize",i,!1),b.removeEventListener(g.DESTROY,h.unbind,!1)},h.detect=function(){h.supported?(a.addEventListener("orientationchange",j,!1),j()):h._window.matchMedia?(l=h._window.matchMedia("(orientation: portrait)"),l.matches?h._orientation="portrait":h._orientation="landscape",l.addListener(k)):(e.addEventListener("throttledresize",i,!1),i())},b.addEventListener(g.DESTROY,h.unbind,!1),h.detect(),d.event.orientationchange=h}(a,a.document,d),function(a,b,c){function d(a){"static"===o.getCSSProperty(a,"position")?a.style.position="relative":a.style.position="absolute"}function e(a,b,c,d,e,f,g,h,i,j){var k=(new Date).getTime()-c,n=parseInt(m.cubicOut(k,d,f,j),10),o=parseInt(m.cubicOut(k,e,g,j),10);b.scrollLeft!==h&&(b.scrollLeft=n),b.scrollTop!==i&&(b.scrollTop=o),(n!==h||o!==i)&&n>=0&&o>=0&&a.currentTransition?l.requestAnimationFrame(a.currentTransition):a.currentTransition=null}function f(a,b,c,d,f){f?(a.currentTransition=e.bind(null,a,b,(new Date).getTime(),b.scrollLeft,b.scrollTop,c,d,b.scrollLeft+c,b.scrollTop+d,f),l.requestAnimationFrame(a.currentTransition)):(c&&(b.scrollLeft=b.scrollLeft+c),d&&(b.scrollTop=b.scrollTop+d))}function g(a){var b=a._ui,c=b.jumpHorizontalButton,d=b.jumpVerticalButton,e=c||d?o.getElementOffset(a.element):null;c&&(c.style.left=e.left+"px"),d&&(d.style.top=e.top+"px")}function h(a){var b=a.classList,c=p.getChildrenByClass(a,w.indicatorTop)[0],d=p.getChildrenByClass(a,w.indicatorBottom)[0];b.remove(w.indicatorTopShown),b.remove(w.indicatorBottomShown),b.remove(w.indicatorRightShown),b.remove(w.indicatorLeftShown),c.style="",d.style=""}function i(a,b){var c,d=p.getChildrenByClass(a,w.indicatorTop)[0],e=p.getChildrenByClass(a,w.indicatorBottom)[0];d&&(c=d.style,c.width=b.width+"px",c.top=b.clipTop+"px",c.backgroundColor=b.color),e&&(c=e.style,c.width=b.width+"px",c.top=b.clipTop+b.clipHeight-o.getElementHeight(e)+"px",c.backgroundColor=b.color)}var j=c.widget.BaseWidget,k=c.engine,l=c.util,m=c.util.easing,n=c.event,o=c.util.DOM,p=c.util.selectors,q=null,r=c.widget.core.Page,s=r.classes.uiPage,t=r.classes.uiPageActive,u=r.events,v=function(){var a,b=this;b._scrollState={currentTransition:null},b.scrollDuration=300,b.scrollviewSetHeight=!1,b.options={scroll:"y",scrollJump:!1,scrollIndicator:!1},a=b._ui||{},a.view=null,a.page=null,a.jumpHorizontalButton=null,a.jumpVerticalButton=null,b._ui=a,b._callbacks={repositionJumps:null,jumpTop:null,jumpBottom:null},b._timers={scrollIndicatorHide:null}},w={view:"ui-scrollview-view",clip:"ui-scrollview-clip",jumpTop:"ui-scroll-jump-top-bg",jumpLeft:"ui-scroll-jump-left-bg",indicatorTop:"ui-overflow-indicator-top",indicatorBottom:"ui-overflow-indicator-bottom",indicatorTopShown:"ui-scrollindicator-top",indicatorBottomShown:"ui-scrollindicator-bottom",indicatorLeftShown:"ui-scrollindicator-left",indicatorRightShown:"ui-scrollindicator-right"};v.classes=w,v.prototype=new j,v.prototype._build=function(a){var c,e,f,g=this,h=g._ui,i=p.getChildrenByClass(a,w.view)[0]||b.createElement("div"),j=a.style,l=a.firstChild,m=g.options,n=m.scroll;for(i.className=w.view;l;)c=l,l=l.nextSibling,i!==c&&i.appendChild(c);switch(i.parentNode!==a&&a.appendChild(i),d(i),a.classList.add(w.clip),a.classList.add("ui-content"),n){case"x":j.overflowX="scroll";break;case"xy":j.overflow="scroll";break;default:j.overflowY="auto"}return m.scrollJump&&(n.indexOf("x")>-1&&(f=b.createElement("div"),f.className=w.jumpLeft,e=b.createElement("div"),f.appendChild(e),a.appendChild(f),k.instanceWidget(e,"Button",{icon:"scrollleft",style:"box"}),h.jumpHorizontalButton=f),n.indexOf("y")>-1&&(f=b.createElement("div"),f.className=w.jumpTop,e=b.createElement("div"),f.appendChild(e),a.appendChild(f),k.instanceWidget(e,"Button",{icon:"scrolltop",style:"box"}),h.jumpVerticalButton=f)),h.view=i,m.scrollIndicator&&g._addOverflowIndicator(a),a},v.prototype._init=function(a){var b=this._ui,c=b.page;b.view||(b.view=p.getChildrenByClass(a,w.view)[0]),c||(c=p.getClosestByClass(a,s),c&&(b.page=c,c.classList.contains(t)&&this.options.scrollJump&&g(this)))},v.prototype._addOverflowIndicator=function(a){a.insertAdjacentHTML("beforeend","<div class='"+w.indicatorTop+"'></div><div class='"+w.indicatorBottom+"'></div>")},v.prototype._showScrollIndicator=function(){var b=this,c=b.element,d=b._ui.view,e=c.scrollTop,f=o.getElementHeight(c),g=o.getElementOffset(c),j=o.getElementHeight(d),k=o.getElementWidth(d),l=o.getElementOffset(d);switch(h(c),b.options.scroll){case"x":case"xy":break;default:i(c,{clipTop:g.top,clipHeight:f,width:k,color:a.getComputedStyle(c).backgroundColor}),l.top-e<g.top&&c.classList.add(w.indicatorTopShown),l.top-e+j>g.top+f&&c.classList.add(w.indicatorBottomShown)}},v.prototype._hideScrollIndicator=function(){var b=this,c=b._timers,d=c.scrollIndicatorHide;d&&a.clearTimeout(d),c.scrollIndicatorHide=a.setTimeout(function(){h(b.element)},1500)},v.prototype.scrollTo=function(a,b,c){var d=this.element;this.translateTo(a-d.scrollLeft,b-d.scrollTop,c)},v.prototype.translateTo=function(a,b,c){f(this._scrollState,this.element,a,b,c)},v.prototype.ensureElementIsVisible=function(a){var b,c,d,e,f,g=this.element,h=o.getElementHeight(g),i=o.getElementWidth(g),j=0,k=h,l=o.getElementHeight(a),m=o.getElementWidth(a),n=0,p=h>=l&&i>=m,q=function(a){var b=a.getAttribute("id"),c=a.tagName.toLowerCase();return b&&["input","textarea","button"].indexOf(c)>-1?a.parentNode.querySelector("label[for="+b+"]"):void 0},r=!0;for(f=a.parentNode;f&&f!==g;)n+=f.offsetTop,f=f.parentNode;switch(b=n+l,r){case p&&n>j&&k>b:case n>j&&k>n&&b>k:case j>n&&k>b:break;case p&&n>j&&b>k:case p&&j>n&&k>b:case p:this.centerToElement(a);break;default:for(c=q(a),c||(c=a),d=c.offsetLeft+o.getCSSProperty(c,"margin-left",0,"integer"),e=c.offsetTop+o.getCSSProperty(c,"margin-top",0,"integer"),f=c.parentNode;f&&f!==g;)d+=f.offsetLeft,e+=f.offsetTop,f=f.parentNode;this.scrollTo(d,e,this.scrollDuration)}},v.prototype.centerToElement=function(a){for(var b=this.element,c=parseInt(o.getElementWidth(b)/2-o.getElementWidth(a)/2,10),d=parseInt(o.getElementHeight(b)/2-o.getElementHeight(a)/2,10),e=a.offsetLeft,f=a.offsetTop,g=a.parentNode;g&&g!==b;)e+=g.offsetLeft+o.getCSSProperty(g,"margin-left",0,"integer"),f+=g.offsetTop+o.getCSSProperty(g,"margin-top",0,"integer"),g=g.parentNode;this.scrollTo(e-c,f-d,this.scrollDuration)},v.prototype.getScrollPosition=function(){var a=this.element;return{x:a.scrollLeft,y:a.scrollTop}},v.prototype._bindEvents=function(c){var d,e,f,h=null,i=function(){n.trigger(c,"scrollstop"),a.clearTimeout(h),h=null},j=this,k=j._ui,l=k.page,m=k.jumpVerticalButton,o=k.jumpHorizontalButton,p=j._callbacks;l&&(this.options.scrollJump&&(d=g.bind(null,this),e=function(){j.scrollTo(c.scrollLeft,0,250);
},f=function(){j.scrollTo(0,c.scrollTop,250)},l.addEventListener(u.SHOW,d,!1),m&&m.firstChild.addEventListener("vclick",e,!1),o&&o.firstChild.addEventListener("vclick",f,!1),p.repositionJumps=d,p.jumpTop=e,p.jumpLeft=f),c.addEventListener("scroll",function(){h?a.clearTimeout(h):n.trigger(c,"scrollstart"),h=a.setTimeout(i,100),n.trigger(c,"scrollupdate")},!1),b.addEventListener("vmousedown",function(){q&&(q=null)},!1),j.options.scrollIndicator&&(p.scrollUpdate=j._showScrollIndicator.bind(j),c.addEventListener("scrollupdate",p.scrollUpdate,!1),p.scrollStop=j._hideScrollIndicator.bind(j),c.addEventListener("scrollstop",p.scrollStop,!1)))},v.prototype._destroy=function(){var b=this,c=b.element,d=b._ui,e=d.page,f=this.options.scrollJump,g=d.jumpVerticalButton,h=d.jumpHorizontalButton,i=b._callbacks,j=i.repositionJumps,k=i.jumpTop,l=i.jumpLeft;f&&(e&&j&&e.removeEventListener(u.SHOW,j,!1),g&&k&&g.firstChild.removeEventListener("vclick",k,!1),h&&l&&h.firstChild.removeEventListener("vclick",l,!1)),b.options.scrollIndicator&&c.removeEventListener("scrollupdate",i.scrollUpdate,!1),b._timers.scrollIndicatorHide&&a.clearTimeout(b._timers.scrollIndicatorHide)},c.widget.core.Scrollview=v}(a,a.document,d),function(a,b){var c=b.widget.BaseWidget,d=b.engine,e=b.event,f=function(){},g={},h={TAB_CHANGE:"tabchange"},i=new c;f.prototype=i,f.classes=g,i._setActive=function(a){var b=this.element;e.trigger(b,h.TAB_CHANGE,{active:a})},i.setActive=function(a){this._setActive(a)},i._getActive=function(){return this.options.active},i.getActive=function(){return this._getActive()},b.widget.core.Tab=f,d.defineWidget("Tab","",["setActive","getActive"],f,"tizen")}(a.document,d),function(a,b){var c=b.widget.core.Tab,d=b.engine,e=b.util.object,f=function(){this.tabSize=0,this.width=0},g=c.prototype,h=new c;f.prototype=h,h._init=function(a){var b=this.options;this.width=a.offsetWidth,a.classList.add(b.wrapperClass)},h._configure=function(){e.merge(this.options,{margin:4,triggerEvent:!1,wrapperClass:"ui-tab-indicator",itemClass:"ui-tab-item",activeClass:"ui-tab-active",active:0})},h._createIndicator=function(){var b,c=this.options,d=a.createDocumentFragment(),e=[],f=c.margin,g=0,h=this.tabSize,i=this.width-f*(h-1),j=Math.floor(i/h),k=i%h,l=0;for(g=0;h>g;g++)e[g]=j;for(g=Math.floor((h-k)/2);k>0;g++,k--)e[g]+=1;for(g=0;h>g;g++)b=a.createElement("span"),b.classList.add(c.itemClass),b.style.width=e[g]+"px",b.style.left=l+"px",l+=e[g]+f,g===c.active&&b.classList.add(c.activeClass),d.appendChild(b);this.element.appendChild(d)},h._removeIndicator=function(){this.element.innerHTML=""},h._refresh=function(){this._removeIndicator(),this._createIndicator()},h._setActive=function(a){var b=this.options,c=this.element.children;b.active=a,[].forEach.call(c,function(a){a.classList.remove(b.activeClass)}),a<c.length&&(c[a].classList.add(b.activeClass),g._setActive.call(this,a))},h.setSize=function(a){var b=this.tabSize!==a;this.tabSize=a,b&&this.refresh()},h._destroy=function(){var a=this.options;this._removeIndicator(),this.element.classList.remove(a.wrapperClass)},b.widget.core.TabIndicator=f,d.defineWidget("TabIndicator",".ui-tab",["setActive","getActive","setSize"],f)}(a.document,d),function(a,b){function d(){this.options={}}function e(a,b,d){var e=b.length,f=d!==c?d:e,g=0,h=0;for(f>e&&(f=e),h;f>h;h++)g+=a===i.HORIZONTAL?b[h].offsetWidth:b[h].offsetHeight;return g}function f(a,b,c){var d=e(a,b,c+1),f=b[c];return f&&(d-=a===i.HORIZONTAL?f.offsetWidth/2:f.offsetHeight/2),d}var g=b.widget.core.scroller.Scroller,h=b.event.gesture,i=h.Orientation,j=b.engine,k=b.util.object,l=b.event,m=b.util.object.merge({CHANGE:"sectionchange"},g.EventType),n={uiSectionChanger:"ui-section-changer"};k.inherit(d,g,{_build:function(a){var b,c=this,d=c.options;return c.tabIndicatorElement=null,c.tabIndicator=null,c.sections=null,c.sectionPositions=[],c.activeIndex=0,c.beforeIndex=0,c._super(a),a.classList.add(n.uiSectionChanger),c.scroller.style.position="absolute",b=a.offsetHeight,0===b&&(b=a.parentNode.offsetHeight,a.style.height=b+"px"),c._sectionChangerWidth=a.offsetWidth,c._sectionChangerHeight=b,c._sectionChangerHalfWidth=c._sectionChangerWidth/2,c._sectionChangerHalfHeight=c._sectionChangerHeight/2,c.orientation="horizontal"===d.orientation?i.HORIZONTAL:i.VERTICAL,a},_configure:function(){this._super(),this.options=k.merge(this.options,{items:"section",activeClass:"ui-section-active",circular:!1,animate:!0,animateDuration:100,orientation:"horizontal",changeThreshold:-1,useTab:!1,fillContent:!0})},_init:function(a){var c,d,e,f=this,g=f.options,h=f.scroller;if("tab"===g.scrollbar&&(g.scrollbar=!1,g.useTab=!0),f.sections="string"==typeof g.items?h.querySelectorAll(g.items):g.items,c=f.sections.length,g.circular&&3>c)b.error("[SectionChanger] if you use circular option, you must have at least three sections.");else{for(d=0;c>d;d++)e=f.sections[d].className,e&&e.indexOf(g.activeClass)>-1&&(f.activeIndex=d),f.sectionPositions[d]=d;f._prepareLayout(),f._initLayout(),f._super(a),f._repositionSections(!0),f.setActiveSection(f.activeIndex),g.animate||(g.animateDuration=0),g.changeThreshold<0&&(g.changeThreshold=f._sectionChangerHalfWidth)}return a},_prepareLayout:function(){var a,b=this.options,c=this.sections.length,d=this._sectionChangerWidth,f=this._sectionChangerHeight,g=this.orientation,h=this.scroller.style;b.useTab&&(this._initTabIndicator(),a=this.tabIndicatorElement.offsetHeight,f-=a,this._sectionChangerHalfHeight=f/2,this.element.style.height=f+"px",this._sectionChangerHeight=f),g===i.HORIZONTAL?(h.width=(b.fillContent?d*c:e(g,this.sections))+"px",h.height=f+"px"):(h.width=d+"px",h.height=(b.fillContent?f*c:e(g,this.sections))+"px")},_initLayout:function(){var a,b,c,d=0,f=0;for(b=0,c=this.sections.length;c>b;b++)a=this.sections[b].style,a.position="absolute",this.options.fillContent&&(a.width=this._sectionChangerWidth+"px",a.height=this._sectionChangerHeight+"px"),this.orientation===i.HORIZONTAL?(f=0,d=e(this.orientation,this.sections,b)):(f=e(this.orientation,this.sections,b),d=0),a.top=f+"px",a.left=d+"px"},_initBouncingEffect:function(){var a=this.options;a.circular||this._super()},_translateScrollbar:function(a,b,c,d){var e,f=this,g=f.scrollbar;g&&(e=f.orientation===i.HORIZONTAL?-a+f.minScrollX:-b+f.minScrollY,g.translate(e,c,d))},_translateScrollbarWithPageIndex:function(a,b){var c;this.scrollbar&&(c=e(this.orientation,this.sections,this.activeIndex),this.scrollbar.translate(c,b))},_initTabIndicator:function(){var b=this,c=a.createElement("div"),d=b.element,e=null;b.tabIndicatorElement=c,d.parentNode.insertBefore(c,d),e=new j.instanceWidget(c,"TabIndicator"),b.tabIndicator=e,e.setSize(b.sections.length),e.setActive(b.activeIndex),b.tabIndicatorHandler=function(a){this.tabIndicator.setActive(a.detail.active)}.bind(b),d.addEventListener(m.CHANGE,b.tabIndicatorHandler,!1)},_clearTabIndicator:function(){this.tabIndicator&&(this.element.parentNode.removeChild(this.tabIndicatorElement),this.element.removeEventListener(m.CHANGE,this.tabIndicatorHandler,!1),this.tabIndicator.destroy(),this.tabIndicator=null,this.tabIndicatorElement=null,this.tabIndicatorHandler=null)},_resetLayout:function(){var a,b,c;for(b=0,c=this.sections.length;c>b;b++)a=this.sections[b].style,a.position="",a.width="",a.height="",a.top="",a.left="";this._super()},_bindEvents:function(){var c=this;c._super(),b.event.enableGesture(c.scroller,new b.event.gesture.Swipe({orientation:c.orientation===i.HORIZONTAL?h.Orientation.HORIZONTAL:h.Orientation.VERTICAL})),l.on(c.scroller,"swipe transitionEnd webkitTransitionEnd mozTransitionEnd msTransitionEnd oTransitionEnd",c),a.addEventListener("rotarydetent",c,!0)},_unbindEvents:function(){var c=this;c._super(),c.scroller&&(b.event.disableGesture(c.scroller),l.off(c.scroller,"swipe transitionEnd webkitTransitionEnd mozTransitionEnd msTransitionEnd oTransitionEnd",c)),a.removeEventListener("rotarydetent",c,!0)},handleEvent:function(a){switch(this._super(a),a.type){case"swipe":case"rotarydetent":this._change(a);break;case"webkitTransitionEnd":case"mozTransitionEnd":case"msTransitionEnd":case"oTransitionEnd":case"transitionEnd":a.target===this.scroller&&this._endScroll()}},_notifyChangedSection:function(a){var b,c=this.options.activeClass,d=this.sections.length,e=0;for(e=0;d>e;e++)b=this.sections[e],b.classList.remove(c),e===this.activeIndex&&b.classList.add(c);this.trigger(m.CHANGE,{active:a})},setActiveSection:function(a,b,c){var d=this.sectionPositions[a],e=b,g=this.activeIndex,h=0,j=0;this.orientation===i.HORIZONTAL?h=this._sectionChangerHalfWidth-f(this.orientation,this.sections,d):j=this._sectionChangerHalfHeight-f(this.orientation,this.sections,d),(this.beforeIndex-a>1||this.beforeIndex-a<-1)&&(e=0),this.activeIndex=a,this.beforeIndex=this.activeIndex,h!==this.scrollerOffsetX||j!==this.scrollerOffsetY?(c!==!1&&(this.trigger(m.START),this.scrolled=!0),this._translate(h,j,b),this._translateScrollbarWithPageIndex(a,e)):this._endScroll(),this.activeIndex!==g&&this._notifyChangedSection(this.activeIndex)},getActiveSectionIndex:function(){return this.activeIndex},_start:function(a){this._super(a),this.beforeIndex=this.activeIndex},_move:function(a){var b=this,c=b.options.changeThreshold,d=b.orientation===i.HORIZONTAL?a.detail.deltaX:a.detail.deltaY,e=b.activeIndex,f=b.beforeIndex;b._super(a),b.scrolled&&(d>c?b.activeIndex=b._calculateIndex(f-1):-c>d?b.activeIndex=b._calculateIndex(f+1):b.activeIndex=f,b.activeIndex!==e&&b._notifyChangedSection(b.activeIndex))},_end:function(){var a=this;a.scrollbar&&a.scrollbar.end(),a.enabled&&!a.scrollCanceled&&a.dragging&&(a.bouncingEffect&&a.bouncingEffect.dragEnd(),a.setActiveSection(a.activeIndex,a.options.animateDuration,!1),a.dragging=!1)},_change:function(a){var b=this,c=a.detail.direction,d=c===h.Direction.UP||c===h.Direction.LEFT||"CW"===c?1:-1,e=b._calculateIndex(b.beforeIndex+d);b.enabled&&!b.scrollCanceled&&(b.bouncingEffect&&b.bouncingEffect.dragEnd(),b.activeIndex!==e&&(b.activeIndex=e,b._notifyChangedSection(e)),b.setActiveSection(e,b.options.animateDuration,!1),b.dragging=!1)},_endScroll:function(){this.enabled&&this.scrolled&&!this.scrollCanceled&&(this._repositionSections(),this._super())},_repositionSections:function(a){var b,c,d,g,h,j,k,l=this,m=l.sections,n=l.activeIndex,o=l.orientation,p=o===i.HORIZONTAL,q=m.length,r=l.sectionPositions[n],s=Math.floor(q/2),t=l.options.circular,u=0,v=0;if(p?(j=-f(o,m,t?s:n),k=0):(j=0,k=-f(o,m,t?s:n)),l._translateScrollbarWithPageIndex(n),(a||0===r||r===q-1)&&(p?u=l._sectionChangerHalfWidth+j:v=l._sectionChangerHalfHeight+k,l._translate(u,v),t))for(b=0;q>b;b++)d=(q+n-s+b)%q,c=m[d].style,l.sectionPositions[d]=b,p?(g=0,h=e(o,m,b)):(g=e(o,m,b),h=0),c.top=g+"px",c.left=h+"px"},_calculateIndex:function(a){var b=this.sections.length;return a=this.options.circular?(b+a)%b:0>a?0:a>b-1?b-1:a},_clear:function(){this._clearTabIndicator(),this._super(),this.sectionPositions.length=0},_destroy:function(){var a=this.element;a.style.height=null,a.style.width=null,this._super()}}),b.widget.core.SectionChanger=d,j.defineWidget("SectionChanger","[data-role='section-changer'], .ui-section-changer",["getActiveSectionIndex","setActiveSection"],d)}(a.document,d),function(a,b){function d(a,b,c,d,e){var f=e._ui,g=f.edgeEffect||f.scrollview.querySelector("."+v.edgeEffect),h=g.style,i=q(p(a/8)-1,10);return"vertical"===b?(h.top="start"===c?"0":"auto",h.bottom="start"===c?"auto":"0"):(h.left="start"===c?"0":"auto",h.right="start"===c?"auto":"0"),e._edgeEffectGradientSize=i,h.boxShadow="0 0 0 "+i+"px "+u.replace("{1}",.5)+",0 0 0 "+2*i+"px "+u.replace("{1}",.4)+",0 0 0 "+3*i+"px "+u.replace("{1}",.3)+",0 0 0 "+4*i+"px "+u.replace("{1}",.2)+",0 0 0 "+5*i+"px "+u.replace("{1}",.1),0}function e(a){return l.getClosestByClass(a,"ui-scroller")||a.parentElement}function f(a,b){var c=null;return a.scrollElement&&(c="string"==typeof a.scrollElement?l.getClosestBySelector(b,"."+a.scrollElement):a.scrollElement),c||(c=e(b)),c}function g(a,b){return b.getAttribute("data-index")===""+a}function h(a,b,c){return c>a}function i(a,b){return-1===a.indexOf(b)}function j(a,b){var d,e,f,j=a.element,k=a._itemSize,l=a.options,m="vertical"===l.orientation?"scrollTop":"scrollLeft",n=b.detail&&b.detail[m],o=a._ui,p=o.scrollview.firstElementChild.style,q=0,t=l.dataLength,u=[],w=a._numberOfItems,x=0,y=l.infinite,z=0,A=0,B={scrollTop:0,scrollLeft:0},C=0,D=0;if(l.edgeEffect&&(b.detail.inBounds?a._edgeEffectGradientSize>0?((o.edgeEffect||o.scrollview.querySelector("."+v.edgeEffect)).style.boxShadow="none",a._edgeEffectGradientSize=0):a._scrollviewWidget&&a._scrollviewWidget.hideBouncingEffect():(C=0>n?n:n+a._containerSize-l.dataLength*a._itemSize,n=n-C+l.edgeEffect(C,l.orientation,0>n?"start":"end",n,a))),n!==c){if(a._scrollBegin=n,z=r(n/a._itemSize),z!==r(a._scrollBeginPrev/a._itemSize)&&z>=0){for(n<a._itemSize?(q=0,A=0):z>t-w&&!y?(q=t-w,A=k*(z-q)):(q=z-1,A=k),x=q;q+w>x;++x)u[x-q]=s.call(j.children,g.bind(null,x%t))[0];for(d=s.call(j.children,i.bind(null,u)),x=q+w-1;x>=q;--x)D=x%t,(x>=0&&t>x||y)&&(u[x-q]||(e=d.shift(),u[x-q]=e,a._updateListItem(e,D),x-q===w-1||q>D&&n>a._scrollBeginPrev?j.appendChild(e):(f=u.filter(h.bind(null,x-q))[0],f?j.insertBefore(e,f):j.insertBefore(e,j.firstElementChild))));B[m]=A+n%a._itemSize}else n>=0?n<a._itemSize?B[m]=n%k:z>t-w&&!y?(q=t-w,A=k*(z-q),B[m]=A+n%k):B[m]=k+n%k:B[m]=n;p.webkitTransform="translate("+-B.scrollLeft+"px, "+-B.scrollTop+"px)",a._scrollBeginPrev=n,a._snapListviewWidget&&a._snapListviewWidget.refresh()}}var k=b.widget.BaseWidget,l=b.util.selectors,m=b.util.scrolling,n=b.support.shape.circle,o=function(){var a=this;a.options={dataLength:0,listItemUpdater:null,scrollElement:null,orientation:"vertical",snap:!1,edgeEffect:n?null:d,infinite:!1},a._ui={edgeEffect:null,scrollview:null},a._scrollBegin=0,a._elementsMap=[],a._itemSize=0,a._numberOfItems=5,a._edgeEffectGradientSize=0},p=Math.abs,q=Math.min,r=Math.floor,s=Array.prototype.filter,t=new k,u="rgba(61, 185, 204, {1})",v={uiVirtualListContainer:"ui-virtual-list-container",edgeEffect:"ui-virtual-list-edge-effect"};o.classes=v,t._build=function(a){var b,c,d=this,e=d._ui,g=o.classes,h=d.options;return a.classList.add(g.uiVirtualListContainer),c="horizontal"===h.orientation.toLowerCase()?"horizontal":"vertical",b=f(h,a),e.scrollview=b,h.orientation=c,a},t._buildList=function(){var c,e,f,g=this,h=g._ui,i=g.options,j=g._ui.scrollview,k="vertical"===i.orientation?"height":"width",n=g.element,o="UL"===n.tagName||"OL"===n.tagName?"li":"div",p=g._numberOfItems,q=l.getClosestBySelector(n,".ui-content").getBoundingClientRect(),r=null,s=[].reduce.call(j.children,function(a,b){return a+b.getBoundingClientRect()[k]},0),t=b.support.shape.circle;for(e=b.engine.getBinding(l.getClosestBySelector(n,".ui-page"),"Scrollview"),e&&(e.option("bouncingEffect",!1),g._scrollviewWidget=e,i.edgeEffect=function(a,b,c){e.showBouncingEffect(c)}),i.dataLength<p&&(p=i.dataLength),f=0;p>f;++f)c=a.createElement(o),g._updateListItem(c,f),n.appendChild(c),r=g.element.getBoundingClientRect(),r[k]<q[k]&&p++;i.snap&&t&&(g._snapListviewWidget=b.engine.instanceWidget(n,"SnapListview",i.snap)),r=g.element.getBoundingClientRect(),g._itemSize=p>0?Math.round(r[k]/p):0,g._numberOfItems=p,g._containerSize=q[k],g._numberOfVisibleElements=Math.ceil(q[k]/g._itemSize),m.enable(j,"horizontal"===i.orientation?"x":"y",!0),i.infinite?m.setMaxScroll(null):(m.enableScrollBar(),j.classList.contains("ui-scroller")?m.setMaxScroll((i.dataLength+1)*g._itemSize+s):m.setMaxScroll(i.dataLength*g._itemSize)),i.snap&&t&&m.setSnapSize(g._itemSize),i.edgeEffect===d&&(h.edgeEffect=a.createElement("div"),h.edgeEffect.classList.add(v.edgeEffect,"orientation-"+i.orientation),h.scrollview.appendChild(h.edgeEffect)),m.setBounceBack(!0)},t._updateListItem=function(a,b){a.setAttribute("data-index",b),this.options.listItemUpdater(a,b)},t._refresh=function(){var a=this;a._buildList(),a._snapListviewWidget&&a._snapListviewWidget.refresh(),a.trigger("draw")},t.draw=function(){this.refresh()},t.scrollTo=function(a){m.scrollTo(-a)},t.scrollToIndex=function(a){this.scrollTo(Math.floor(this._itemSize*a))},t._bindEvents=function(){var a=j.bind(null,this),b=this._ui.scrollview;b&&(b.addEventListener("scroll",a,!1),this._scrollEventBound=a)},t._destroy=function(){m.disable()},t.setListItemUpdater=function(a){this.options.listItemUpdater=a,this.refresh()},o.prototype=t,b.engine.defineWidget("VirtualListviewSimple","",["draw","setListItemUpdater","scrollTo","scrollToIndex"],o,"",!0),b.widget.core.VirtualListviewSimple=o}(a.document,d),function(a,b,c){function d(a){var b;return a?(b=Object.keys(a).join(":"),b.indexOf("__impl")>-1||b.indexOf("__upgraded__")>-1||b.indexOf("__attached__")>-1):!1}function e(b){var c=a.ShadowDOMPolyfill&&a.ShadowDOMPolyfill.wrap;return b&&c?c(b):b}function f(b){var d=a.ShadowDOMPolyfill&&a.ShadowDOMPolyfill.unwrap;return b&&d?d(b):(c.error("Unwrap method not available"),b)}function g(a){for(var b,c=a.attributes,d=c.length,e=0,f=a.tagName.toLowerCase();d>e;++e)b=c.item(e),f+="["+b.name+'="'+b.value+'"]';return f}function h(a){for(var c=g(a),d=a.parentNode;d;)c=g(d)+">"+c,d=d.parentNode,d===b&&(d=null);return c}function i(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function j(a,b){for(;a.firstChild;)b.appendChild(a.firstChild)}function k(a,c){var d=b.createElement("div"),e=!1;return a.appendChild(d),d.innerHTML=c.replace(o,function(){return e=!0,"<span id='temp-container-"+ ++l+"'></span>"}),{container:d,contentFlag:e}}var l=0,m=[].slice,n=c.util.DOM,o=/(\$\{content\})/gi;n.getNodeSelector=g,n.getNodeSelectorPath=h,n.isNodeEqual=function(c,e){var f,g,i=c,j=e,k=a.ShadowDOMPolyfill&&a.ShadowDOMPolyfill.unwrap;return null===c||null===e?!1:(f=d(c),g=d(e),f&&(i=k?k(c):b.querySelector(h(c))),g&&(j=k?k(e):b.querySelector(h(e))),i===j)},n.isNodeWebComponentPolyfilled=d,n.unwrapWebComponentPolyfill=f,n.wrapWebComponentPolyfill=e,n.isElement=function(a){var b=a;return b?"string"==typeof b.localName&&b.localName.length>0?!0:(a instanceof Element||d(a)&&(b=f(a)),b instanceof Element):!1},n.appendNodes=function(a,b){var c,d,e;if(a){if(b instanceof Array||b instanceof NodeList||b instanceof HTMLCollection)for(e=m.call(b),c=0,d=e.length;d>c;c+=1)a.appendChild(e[c]);else a.appendChild(b),e=b;return e}throw"Context empty!"},n.replaceWithNodes=function(a,b){var c;return b instanceof Array||b instanceof NodeList||b instanceof HTMLCollection?(c=this.insertNodesBefore(a,b),a.parentNode.removeChild(a)):(a.parentNode.replaceChild(b,a),c=b),c},n.removeAllChildren=function(a){a.innerHTML=""},n.insertNodesBefore=function(a,b){var c,d,e,f;if(a){if(e=a.parentNode,b instanceof Array||b instanceof NodeList||b instanceof HTMLCollection)for(f=m.call(b),c=0,d=f.length;d>c;++c)e.insertBefore(f[c],a);else e.insertBefore(b,a),f=b;return f}throw"Context empty!"},n.insertNodeAfter=function(a,b){if(a)return a.parentNode.insertBefore(b,a.nextSibling),b;throw"Context empty!"},n.wrapInHTML=function(a,c){var d,e,f,g=b.createDocumentFragment(),h=b.createDocumentFragment(),m=a.length,n=m?a[0].parentNode:a.parentNode,o=m?a[m-1].nextSibling:a.nextSibling;return f=k(g,c),f.contentFlag===!0?(d=f.container.querySelector("span#temp-container-"+l),e=this.replaceWithNodes(d,a)):(d=f.container.children[0],e=this.appendNodes(d||f.container,a)),j(g.firstChild,h),i(g),n?n.insertBefore(h,o):i(h),e}}(a,a.document,d),function(a,b){b.widget.wearable=b.widget.wearable||{}}(a,d),function(a,b,c){var d=c.widget.BaseWidget,e=c.event,f=c.engine,g=c.util,h=g.scrolling,i=g.DOM,j=g.selectors,k={CIRCLE:"tizen-circular-scrollbar"},l=c.widget.core.scroller.effect.Bouncing,m=function(){this.options={bouncingEffect:!0}},n={uiHeader:"ui-header",uiContent:"ui-content",uiPageScroll:"ui-scroll-on",uiScroller:"ui-scroller"},o=new d;o._build=function(a){var d,e,f,g=n.uiPageScroll,h=[].slice.call(a.children);return a.classList.add(g),d=b.createElement("div"),d.classList.add(n.uiScroller),f=b.createDocumentFragment(),h.forEach(function(a){j.matchesSelector(a,".ui-header:not(.ui-fixed), .ui-content, .ui-footer:not(.ui-fixed)")&&f.appendChild(a)}),a.children.length>0&&a.children[0].classList.contains(n.uiHeader)?i.insertNodeAfter(a.children[0],d):a.insertBefore(d,a.firstChild),d.appendChild(f),c.support.shape.circle&&(d&&d.setAttribute(k.CIRCLE,""),e=a.querySelector("."+n.uiContent),e&&e.setAttribute(k.CIRCLE,"")),this.scroller=d,a},o._setBouncingEffect=function(a,b){var d=this,f=d.scroller;b?(c.event.enableGesture(f,new c.event.gesture.Drag({threshold:30,delay:d.options.scrollDelay,blockVertical:d.orientation===l.Orientation.HORIZONTAL,blockHorizontal:d.orientation===l.Orientation.VERTICAL})),e.on(f,"drag dragstart dragend",d)):(c.event.disableGesture(f),e.off(f,"drag dragstart dragend",d))},o._init=function(){var b=this,c=b.scroller;b.maxScrollX=0,b.maxScrollY=0,c&&(b.maxScrollY=c.scrollHeight-a.innerHeight),b.minScrollX=0,b.minScrollY=0,b.bouncingEffect=new l(b.element,{maxScrollX:b.maxScrollX,maxScrollY:b.maxScrollY,orientation:"vertical"}),b.scrollerOffsetX=0,b.scrollerOffsetY=0,b._setBouncingEffect(b.element,b.options.bouncingEffect)},o._start=function(){var a=this;a.scrolled=!1,a.dragging=!0,a.scrollCanceled=!1,a.startScrollerOffsetX=a.scrollerOffsetX,a.startScrollerOffsetY=a.scrollerOffsetY},o._end=function(){this.dragging&&(this.bouncingEffect&&this.bouncingEffect.dragEnd(),this.dragging=!1)},o.showBouncingEffect=function(a){var b=this.bouncingEffect;"end"===a?b.drag(0,-this.scroller.getBoundingClientRect().height):b.drag(0,0)},o.hideBouncingEffect=function(){var a=this.bouncingEffect;a&&a.dragEnd()},o.handleEvent=function(a){switch(a.type){case"dragstart":this._start(a);break;case"drag":this._move(a);break;case"dragend":this._end(a)}},o._move=function(a){var b,c,d=this,e=d.scroller,f=d.startScrollerOffsetX,g=d.startScrollerOffsetY,i=a.detail.deltaY,j=d.bouncingEffect;h.isElement(e)?(b=h.getScrollPosition(),c=h.getMaxScroll()):(b=e.scrollTop,c=d.maxScrollY),(0===b&&i>0||b===c&&0>i)&&j&&j.drag(0,-b),d.scrollerOffsetX=f,d.scrollerOffsetY=g},m.prototype=o,c.widget.wearable.Scrollview=m,f.defineWidget("Scrollview","",[],m)}(a,a.document,d),function(a,b,c){function d(b,c){var d,e,f,g=b.options,h=g.arrow.split(","),i=b.element,j=a.innerWidth,l=a.innerHeight,m=k.getElementWidth(i,"outer"),n=k.getElementHeight(i,"outer"),o=c.getBoundingClientRect(),p=o.left,q=o.top,r=Math.min(o.width,j-p),s=Math.min(o.height,l-q),t={l:{dir:"l",fixedPositionField:"x",fixedPositionFactor:1,size:m,max:p},r:{dir:"r",fixedPositionField:"x",fixedPositionFactor:-1,size:m,max:j-p-r},b:{dir:"b",fixedPositionField:"y",fixedPositionFactor:-1,size:n,max:q},t:{dir:"t",fixedPositionField:"y",fixedPositionFactor:1,size:n,max:l-q-s}};return d=t[h[0]]||t.t,h.forEach(function(a){var b=t[a],c=b.max;e||(b.size<c?e=b:c>d.max&&(d=b))}),e||(e=d,"x"===e.fixedPositionField?m=e.max:n=e.max),f={x:p+r/2-m/2,y:q+s/2-n/2,w:m,h:n,dir:e.dir},f[e.fixedPositionField]+=("x"===e.fixedPositionField?(m+r)*e.fixedPositionFactor:(n+s)*e.fixedPositionFactor)/2+g.distance*e.fixedPositionFactor,f.x=f.x<0?0:f.x+f.w>j?j-f.w:f.x,f.y=f.y<0?0:f.y+f.h>l?l-f.h:f.y,f}function e(b,c,d,e){var f,g,h,i=b._ui,j=i.wrapper,l=i.arrow,m=b.element,n=l.style,o=a.innerWidth,p=a.innerHeight,q=j.getBoundingClientRect(),r=l.offsetWidth/2,s={"padding-top":0,"padding-bottom":0,"padding-left":0,"padding-right":0,"border-top-width":0,"border-left-width":0,"box-sizing":null},t={"margin-top":0,"margin-bottom":0,"margin-left":0,"margin-right":0,"padding-top":0,"padding-bottom":0,"padding-left":0,"padding-right":0},u={t:{pos:d,min:"left",max:"right",posField:"x",valField:"w",styleField:"left"},b:{pos:d,min:"left",max:"right",posField:"x",valField:"w",styleField:"left"},l:{pos:e,min:"top",max:"bottom",posField:"y",valField:"h",styleField:"top"},r:{pos:e,min:"top",max:"bottom",posField:"y",valField:"h",styleField:"top"}},v=u[c.dir];return k.extractCSSProperties(m,s),k.extractCSSProperties(j,t),h="border-box"===s["box-sizing"],f={t:s["padding-top"]+t["margin-top"]+t["padding-top"],b:s["padding-bottom"]+t["margin-bottom"]+t["padding-bottom"],l:s["padding-left"]+t["margin-left"]+t["padding-left"],r:s["padding-right"]+t["margin-right"]+t["padding-right"]},q={left:f.l+c.x,right:f.l+q.width+c.x,top:f.t+c.y,bottom:q.height+f.t+c.y},q[v.min]>v.pos-r?(g=c[v.posField],g>0?(c[v.posField]=Math.max(v.pos-r,0),v.pos=c[v.posField]+r):v.pos=q[v.min]+r):q[v.max]<v.pos+r&&(g=("w"===v.valField?o:p)-(c[v.posField]+c[v.valField]),g>0?(c[v.posField]+=Math.min(g,v.pos+r-q[v.max]),v.pos=c[v.posField]+c[v.valField]-r):v.pos=q[v.max]-r),n[v.styleField]=v.pos-r-c[v.posField]-(h?s["border-"+v.styleField+"-width"]:0)+"px",c}function f(a,b){var c=b.getBoundingClientRect(),d={};switch(a){case"l":d.x=c.right,d.y=c.top+c.height/2;break;case"r":d.x=c.left,d.y=c.top+c.height/2;break;case"t":d.x=c.left+c.width/2,d.y=c.bottom;break;case"b":d.x=c.left+c.width/2,d.y=c.top}return d}var g=c.widget.core.Popup,h=g.prototype,i=c.engine,j=c.util.object,k=c.util.DOM,l={arrow:"l,b,r,t",positionTo:"window",positionOriginCenter:!1,distance:0,link:null},m=function(){var a,b=this;g.call(b),b.options=j.merge(b.options,l),a=b._ui||{},a.arrow=null,b._ui=a},n="ui-popup",o=j.merge({},g.classes,{context:"ui-ctxpopup",contextOverlay:"ui-ctxpopup-overlay",arrow:"ui-arrow",arrowDir:n+"-arrow-"}),p=j.merge({},g.events,{before_position:"beforeposition"}),q={WINDOW:"window",ORIGIN:"origin",ABSOLUTE:"absolute"},r=new g;m.defaults=j.merge({},g.defaults,l),m.classes=o,m.events=p,m.positionTypes=q,r._build=function(a){var c,d=this,e=d._ui;return h._build.call(d,a),a.classList.add(o.popup),c=b.createElement("div"),c.appendChild(b.createElement("span")),c.classList.add(o.arrow),e.arrow=c,a.appendChild(c),a},r._init=function(a){var b=this,c=b._ui;h._init.call(this,a),c.arrow=c.arrow||a.querySelector("."+o.arrow)},r._layout=function(a){var b=this;this._reposition(),h._layout.call(b,a)},r._reposition=function(a){var b=this,c=b.element,d=b._ui,e=c.classList;a=j.merge({},b.options,a),b.trigger(p.before_position,null,!1),e.add(o.build),b._setContentHeight(),"origin"===a.positionTo&&d.overlay&&d.overlay.classList.add(o.contextOverlay),b._placementCoords(a),e.remove(o.build)},r._placementCoordsWindow=function(b){var c=b.style,d=b.offsetWidth,e=b.offsetHeight,f=k.getCSSProperty(b,"margin-top",0,"float"),g=k.getCSSProperty(b,"margin-bottom",0,"float"),h=a.innerHeight-e-f-g;c.top=h+"px",c.left="50%",c.marginLeft=-(d/2)+"px"},r._placementCoordsAbsolute=function(a,b,c){var d=a.style,e=a.offsetWidth,f=a.offsetHeight;d.top=c+"px",d.left=b+"px",d.marginTop=-(f/2)+"px",d.marginLeft=-(e/2)+"px"},r._findClickedElement=function(a,c){return b.elementFromPoint(a,c)},r._placementCoordsOrigin=function(a,b){var c,g,h,i,j=this,k=j.element,l=k.style,m=k.classList,n=b.x,p=b.y;m.add(o.context),i=k.offsetHeight,c=d(j,a),h=c.dir,m.add(o.arrowDir+h),j._ui.arrow.setAttribute("type",h),("number"!=typeof n&&"number"!=typeof p||j.options.positionOriginCenter)&&(g=f(h,a),n=g.x,p=g.y),c=e(j,c,n,p),i>c.h&&j._setContentHeight(c.h),l.left=c.x+"px",l.top=c.y+"px"},r._placementCoordsElement=function(a){var b,c,e=this,f=e.element,g=f.style;f.classList.add(o.context),c=f.offsetHeight,b=d(e,a),c>b.h&&e._setContentHeight(b.h),g.left=b.x+"px",g.top=b.y+"px"},r._placementCoords=function(a){var c,d,e=this,f=a.positionTo,g=a.x,h=a.y,i=e.element;switch(f){case q.ORIGIN:if(d=a.link,d?"string"==typeof d?c=b.getElementById(d):"object"==typeof d&&(c=d):"number"==typeof g&&"number"==typeof h&&(c=e._findClickedElement(g,h)),c)return void e._placementCoordsOrigin(c,a);break;case q.WINDOW:return void e._placementCoordsWindow(i);case q.ABSOLUTE:if("number"==typeof g&&"number"==typeof h)return void e._placementCoordsAbsolute(i,g,h);break;default:if("string"==typeof f)try{c=b.querySelector(a.positionTo)}catch(j){}else"object"==typeof f&&(c=f);if(c)return void e._placementCoordsElement(c,a)}e._placementCoordsWindow(i)},r._setContentHeight=function(b){var c,d,e,f=this,g=f.element,h=f._ui.content;h&&(c=h.style,(c.height||c.minHeight)&&(c.height="",c.minHeight=""),b=b||a.innerHeight,d=h.offsetHeight,e=g.offsetHeight,e>b&&(d-=e-b,c.height=d+"px",c.minHeight=d+"px"))},r._onHide=function(){var a=this,b=a._ui,c=a.element,d=c.classList,e=b.arrow;d.remove(o.context),["l","r","b","t"].forEach(function(a){d.remove(o.arrowDir+a)}),c&&c.removeAttribute("style"),e&&e.removeAttribute("style"),h._onHide.call(a)},r._destroy=function(){var a=this,b=a._ui,c=b.arrow;h._destroy.call(a),c&&c.parentNode&&c.parentNode.removeChild(c),b.arrow=null},r.reposition=function(a){this._isActive()&&this._reposition(a)},r._refresh=function(){this._isActive()&&(h._refresh.call(this),this.reposition(this.options))},m.prototype=r,c.widget.core.ContextPopup=m,i.defineWidget("Popup","[data-role='popup'], .ui-popup",["open","close","reposition"],m,"core",!0),c.widget.popup=c.widget.Popup}(a,a.document,d),function(a,b,c){var d=c.widget.core.ContextPopup,e=d.prototype,f=c.engine,g=c.util.object,h={fullSize:!1,enablePopupScroll:!1},i=g.merge({},d.classes,{popupScroll:"ui-scroll-on",fixed:"ui-fixed",sideButton:"ui-side-button",hasSideButtons:"ui-has-side-buttons",toast:"ui-popup-toast",ctx:"ui-ctxpopup"}),j=function(){var a=this;d.call(a),a.options=g.merge(a.options,{fullSize:c.getConfig("popupFullSize",h.fullSize),enablePopupScroll:c.getConfig("enablePopupScroll",h.enablePopupScroll)})},k=new d;k._layout=function(b){var c=this,d=b.classList,f=c._ui,g=f.wrapper,h=f.header,j=f.footer,k=f.content,l=0,m=0;c._blockPageScroll(),e._layout.call(c,b),c.options.enablePopupScroll===!0?b.classList.add(i.popupScroll):b.classList.remove(i.popupScroll),d.contains(i.popupScroll)&&(d.add(i.build),h&&(l=h.offsetHeight,h.classList.contains(i.fixed)&&(k.style.marginTop=l+"px")),j&&(m=j.offsetHeight,j.classList.contains(i.fixed)&&(k.style.marginBottom=m+"px"),j.classList.contains(i.sideButton)&&d.add(i.hasSideButtons)),g.style.height=Math.min(k.offsetHeight+l+m,b.offsetHeight)+"px",d.remove(i.build)),!c.options.fullSize||d.contains(i.toast)||d.contains(i.ctx)||(g.style.height=a.innerHeight+"px")},k._onHide=function(){var a=this,b=a._ui,c=b.wrapper;c&&c.removeAttribute("style"),a._unblockPageScroll(),e._onHide.call(a)},k._blockPageScroll=function(){var a=c.widget.Page(this._ui.page);a.getScroller&&(a.getScroller().style.overflow="hidden")},k._unblockPageScroll=function(){var a=c.widget.Page(this._ui.page);a.getScroller&&(a.getScroller().style.overflow="")},j.prototype=k,c.widget.wearable.Popup=j,f.defineWidget("Popup","[data-role='popup'], .ui-popup",["open","close","reposition"],j,"wearable",!0)}(a,a.document,d),function(a,b){var c=b.widget.core.Drawer,d=b.engine,e=function(){var a=this;c.call(a)},f=new c;e.prototype=f,f._configure=function(){var a=this;a.options.width=0},b.widget.wearable.Drawer=e,d.defineWidget("Drawer",".ui-drawer",["transition","setDragHandler","open","close","isOpen","getState"],e,"wearable")}(a.document,d),function(a,b,c){function d(a,b){return a.index<b.index?-1:a.index>b.index?1:0}var e=a.event.gesture,f=e.utils,g=a.util.object,h=null,i=/touch/,j=function(){var a=this;a.instances=[],a.gestureDetectors=[],a.runningDetectors=[],a.detectorRequestedBlock=null,a.unregisterBlockList=[],a.gestureEvents={},a.velocity=null,a._isReadyDetecting=!1,a._blockMouseEvent=!1,a.touchSupport="ontouchstart"in b};j.prototype={_bindStartEvents:function(a){var b=a.getElement();this.touchSupport?b.addEventListener("touchstart",this,!1):b.addEventListener("mousedown",this,!1)},_bindEvents:function(){var a=this;a.touchSupport?(c.addEventListener("touchmove",a),c.addEventListener("touchend",a),c.addEventListener("touchcancel",a)):(c.addEventListener("mousemove",a),c.addEventListener("mouseup",a))},_unbindStartEvents:function(a){var b=a.getElement();this.touchSupport?b.removeEventListener("touchstart",this,!1):b.removeEventListener("mousedown",this,!1)},_unbindEvents:function(){var a=this;a.touchSupport?(c.removeEventListener("touchmove",a,!1),c.removeEventListener("touchend",a,!1),c.removeEventListener("touchcancel",a,!1)):(c.removeEventListener("mousemove",a,!1),
c.removeEventListener("mouseup",a,!1))},_detectEventType:function(a){var b=a.type;if(b.match(i))this._blockMouseEvent=!0;else if(this._blockMouseEvent||1!==a.which)return null;return b},handleEvent:function(a){var b=this,c=b._detectEventType(a);switch(c){case"mousedown":case"touchstart":b._start(a);break;case"mousemove":case"touchmove":b._move(a);break;case"mouseup":case"touchend":b._end(a);break;case"touchcancel":b._cancel(a)}},_start:function(a){var b=this,c=a.currentTarget,f={},h=[];b._isReadyDetecting||(b._resetDetecting(),b._bindEvents(),f=b._createDefaultEventData(e.Event.START,a),b.gestureEvents={start:f,last:f},b.velocity={event:f,x:0,y:0},f=g.fastMerge(f,b._createGestureEvent(e.Event.START,a)),b._isReadyDetecting=!0),b.instances.forEach(function(a){a.getElement()===c&&(h=h.concat(a.getGestureDetectors()))},b),h.sort(d),b.gestureDetectors=b.gestureDetectors.concat(h),b._detect(h,f)},_move:function(a){var b,c=this;c._isReadyDetecting&&(b=c._createGestureEvent(e.Event.MOVE,a),c._detect(c.gestureDetectors,b),c.gestureEvents.last=b)},_end:function(a){var b=this,c=g.merge({},b.gestureEvents.last,b._createDefaultEventData(e.Event.END,a));0===c.pointers.length&&(b._detect(b.gestureDetectors,c),b.unregisterBlockList.forEach(function(a){this.unregister(a)},b),b._resetDetecting(),b._blockMouseEvent=!1)},_cancel:function(a){var b=this;a=g.merge({},b.gestureEvents.last,b._createDefaultEventData(e.Event.CANCEL,a)),b._detect(b.gestureDetectors,a),b.unregisterBlockList.forEach(function(a){this.unregister(a)},b),b._resetDetecting(),b._blockMouseEvent=!1},_detect:function(a,b){var c=this,d=[];a.forEach(function(a){var f;c.detectorRequestedBlock||(f=a.detect(b),f&e.Result.RUNNING&&c.runningDetectors.indexOf(a)<0&&c.runningDetectors.push(a),f&e.Result.FINISHED&&d.push(a),f&e.Result.BLOCK&&(c.detectorRequestedBlock=a))}),d.forEach(function(a){var b=c.gestureDetectors.indexOf(a);b>-1&&c.gestureDetectors.splice(b,1),b=c.runningDetectors.indexOf(a),b>-1&&c.runningDetectors.splice(b,1)}),c.detectorRequestedBlock&&(c.runningDetectors.forEach(function(a){var c=g.fastMerge({},b);c.eventType=e.Event.BLOCKED,a.detect(c)}),c.runningDetectors.length=0,c.gestureDetectors.length=0,d.indexOf(c.detectorRequestedBlock)<0&&c.gestureDetectors.push(c.detectorRequestedBlock))},_resetDetecting:function(){var a=this;a._isReadyDetecting=!1,a.gestureDetectors.length=0,a.runningDetectors.length=0,a.detectorRequestedBlock=null,a.gestureEvents={},a.velocity=null,a._unbindEvents()},_createDefaultEventData:function(a,b){var c=b.touches;return c||("mouseup"===b.type?c=[]:(b.identifier=1,c=[b])),{eventType:a,timeStamp:Date.now(),pointer:c[0],pointers:c,srcEvent:b,preventDefault:b.preventDefault.bind(b),stopPropagation:b.stopPropagation.bind(b)}},_createGestureEvent:function(a,b){var c,d=this,h=d._createDefaultEventData(a,b),i=d.gestureEvents.start,j=d.gestureEvents.last,k=d.velocity,l=k.event,m={time:h.timeStamp-i.timeStamp,x:h.pointer.clientX-i.pointer.clientX,y:h.pointer.clientY-i.pointer.clientY},n={x:h.pointer.clientX-j.pointer.clientX,y:h.pointer.clientY-j.pointer.clientY},o=e.defaults.estimatedPointerTimeDifference;return i&&h.pointers.length!==i.pointers.length&&(i.pointers=Array.prototype.slice.call(h.pointers)),h.timeStamp-l.timeStamp>e.defaults.updateVelocityInterval&&(g.fastMerge(k,f.getVelocity(h.timeStamp-l.timeStamp,h.pointer.clientX-l.pointer.clientX,h.pointer.clientY-l.pointer.clientY)),k.event=h),c={x:Math.round(h.pointer.clientX+o*k.x*(n.x<0?-1:1)),y:Math.round(h.pointer.clientY+o*k.y*(n.y<0?-1:1))},(n.x<0&&c.x>j.estimatedX||n.x>0&&c.x<j.estimatedX)&&(c.x=j.estimatedX),(n.y<0&&c.y>j.estimatedY||n.y>0&&c.y<j.estimatedY)&&(c.y=j.estimatedY),g.fastMerge(h,{deltaTime:m.time,deltaX:m.x,deltaY:m.y,velocityX:k.x,velocityY:k.y,estimatedX:c.x,estimatedY:c.y,estimatedDeltaX:c.x-i.pointer.clientX,estimatedDeltaY:c.y-i.pointer.clientY,distance:f.getDistance(i.pointer,h.pointer),angle:f.getAngle(i.pointer,h.pointer),direction:f.getDirection(i.pointer,h.pointer),scale:f.getScale(i.pointers,h.pointers),rotation:f.getRotation(i.pointers,h.pointers),startEvent:i,lastEvent:j}),h},register:function(a){var b=this,c=b.instances.indexOf(a);0>c&&(b.instances.push(a),b._bindStartEvents(a))},unregister:function(a){var b,c=this;c.gestureDetectors.length?c.unregisterBlockList.push(a):(b=c.instances.indexOf(a),b>-1&&(c.instances.splice(b,1),c._unbindStartEvents(a)),c.instances.length||c._destroy())},_destroy:function(){var a=this;a._resetDetecting(),a.instances.length=0,a.unregisterBlockList.length=0,a._blockMouseEvent=!1,h=null}},j.getInstance=function(){return h||(h=new j),h},e.Manager=j}(d,a,a.document),function(a){var b=a.event.gesture,c=b.Detector,d=b.Manager,e=a.event,f=a.util.object.merge,g=function(a,e){this.element=a,this.eventDetectors=[],this.options=f({},b.defaults,e),this.gestureManager=d.getInstance(),this.eventSender=f({},c.Sender,{sendEvent:this.trigger.bind(this)})};g.prototype={setOptions:function(a){return f(this.options,a),this},addDetector:function(a){var b=new c(a,this.eventSender),d=!!this.eventDetectors.length;return this.eventDetectors.push(b),this.eventDetectors.length&&!d&&this.gestureManager.register(this),this},removeDetector:function(a){var b=this.eventDetectors.indexOf(a);return b>-1&&this.eventDetectors.splice(b,1),this.eventDetectors.length||this.gestureManager.unregister(this),this},trigger:function(a,b){return e.trigger(this.element,a,b,!1)},getElement:function(){return this.element},getGestureDetectors:function(){return this.eventDetectors},destroy:function(){this.element=null,this.eventHandlers={},this.gestureManager=null,this.eventSender=null,this.eventDetectors.length=0}},b.Instance=g}(d),function(a,b){function c(a){var b=a._ui.barElement;j.enableGesture(b,new k.Drag({orientation:a.options.orientation,threshold:0})),j.on(b,"dragstart drag dragend dragcancel",a,!1)}function d(a){var b=a._ui.barElement;j.disableGesture(b),j.off(b,"dragstart drag dragend dragcancel",a,!1)}function e(a,b,c,d,e,f,g,h){parseFloat(h)>parseFloat(e)?a.style.background="-webkit-linear-gradient("+c+","+d+" "+e+", "+f+" "+g+")":a.style.background=d}var f=b.widget.BaseWidget,g=b.engine,h=b.util.selectors,i=b.util.DOM,j=b.event,k=b.event.gesture,l={BACKGROUND:"rgba(145, 145, 145, 0.7)",ACTIVE:"rgba(61, 185, 204, 1)",WARNING_BG:"rgba(201, 133, 133, 1)",WARNING:"rgba(255, 25, 25, 1)"},m={HORIZONTAL:"horizontal"},n=function(){var a=this;a.options={type:"normal",orientation:m.HORIZONTAL,expand:!1,warning:!1,warningLevel:0,disabled:!1},a._ui={}},o={SLIDER:"ui-slider",SLIDER_HORIZONTAL:"ui-slider-horizontal",SLIDER_VERTICAL:"ui-slider-vertical",SLIDER_VALUE:"ui-slider-value",SLIDER_HANDLER:"ui-slider-handler",SLIDER_HANDLER_EXPAND:"ui-slider-handler-expand",SLIDER_CENTER:"ui-slider-center",SLIDER_HANDLER_ACTIVE:"ui-slider-handler-active",SLIDER_WARNING:"ui-slider-warning",SLIDER_DISABLED:"ui-disabled",SLIDER_HANDLER_VALUE:"ui-slider-handler-value",SLIDER_HANDLER_SMALL:"ui-slider-handler-small"},p=new f;n.prototype=p,n.classes=o,p._build=function(b){var c=this,d=c._ui,e=a.createElement("div"),f=a.createElement("div"),g=a.createElement("div");return b.style.display="none",e.classList.add(o.SLIDER),f.classList.add(o.SLIDER_VALUE),e.appendChild(f),g.classList.add(o.SLIDER_HANDLER),e.appendChild(g),b.parentNode.appendChild(e),d.valueElement=f,d.handlerElement=g,d.barElement=e,b},p._init=function(a){var b=this,c=parseFloat(a.getAttribute("min")),d=parseFloat(a.getAttribute("max")),e=parseFloat(a.getAttribute("value"));return b._min=c?c:0,b._max=d?d:100,b._minValue=b._min,b._maxValue=b._max,b._value=e?e:parseFloat(b.element.value),b._interval=b._max-b._min,b._previousValue=b._value,b._warningLevel=parseInt(b.options.warningLevel,10),b._setDisabled(a),b._initLayout(),a},p._initLayout=function(){var a=this,b=a.options,c=a._ui,d=c.barElement,e=c.handlerElement;b.orientation===m.HORIZONTAL?(d.classList.remove(o.SLIDER_VERTICAL),d.classList.add(o.SLIDER_HORIZONTAL)):(d.classList.remove(o.SLIDER_HORIZONTAL),d.classList.add(o.SLIDER_VERTICAL)),"center"===b.type?d.classList.add(o.SLIDER_CENTER):d.classList.remove(o.SLIDER_CENTER),b.expand?e.classList.add(o.SLIDER_HANDLER_EXPAND):e.classList.remove(o.SLIDER_HANDLER_EXPAND),a._barElementWidth=c.barElement.offsetWidth,a.options.orientation!==m.HORIZONTAL&&(a._barElementHeight=c.barElement.offsetHeight),a._setValue(a._value),a._setSliderColors(a._value)},p._setCenterValue=function(a){var b,c,d,e,f,g,h=this,i=h._ui;h.options.orientation===m.HORIZONTAL?(d=h._barElementWidth,e=d/2,b=d*(a-h._min)/h._interval,f=e>b?"right":"left",g=e>b?"left":"right",c="width",i.handlerElement.style.left=b+"px"):(d=h._barElementHeight,e=d/2,b=d*(a-h._min)/h._interval,f=e>b?"top":"bottom",g=e>b?"bottom":"top",c="height",i.handlerElement.style.top=d-b+"px"),i.valueElement.style[f]="50%",i.valueElement.style[g]="initial",i.valueElement.style[c]=Math.abs(e-b)+"px"},p._setNormalValue=function(a){var b,c,d=this,e=d._ui,f=d.options;f.orientation===m.HORIZONTAL?(b=d._barElementWidth,c=b*(a-d._min)/d._interval,e.valueElement.style.width=c+"px",e.handlerElement.style.left=c+"px"):(b=d._barElementHeight,c=b*(a-d._min)/d._interval,e.valueElement.style.height=c+"px",e.handlerElement.style.top=b-c+"px")},p._setValue=function(a){var b,c,d=this,e=d._ui,f=d.options,g=d.element;d._previousValue=d.element.value,a<d._min?a=d._min:a>d._max&&(a=d._max),b=parseFloat(a),"center"===f.type?d._setCenterValue(a):"normal"===f.type&&d._setNormalValue(a),d._setHandlerStyle(a),d._updateSliderColors(a),d.options.expand&&(c=o.SLIDER_HANDLER_VALUE,(b>99||-10>b)&&(c+=" "+o.SLIDER_HANDLER_SMALL),e.handlerElement.innerHTML="<span class="+c+">"+b+"</span>"),g.value-0!==b&&(g.setAttribute("value",b),g.value=b,d._value=b,j.trigger(g,"input"))},p._setSliderColors=function(a){var b,c,d,f,g,h=this,i=h._ui,j=i.barElement,k=i.valueElement;"normal"===h.options.type&&h.options.warning&&a>=h._min&&a<=h._max?(h.options.orientation===m.HORIZONTAL?(b="right",c="left",d=h._barElementWidth):(b="top",c="bottom",d=h._barElementHeight),f=d*h._warningLevel/(h._max-h._min)+"px",g=d*a/(h._max-h._min)+"px",e(k,b,c,l.ACTIVE,f,l.WARNING,f,g),e(j,b,c,l.BACKGROUND,f,l.WARNING_BG,f,parseInt(f,10)+2)):(k.style.background=l.ACTIVE,j.style.background=l.BACKGROUND)},p._updateSliderColors=function(a){this._setSliderColors(a)},p._setHandlerStyle=function(a){var b=this;b.options.warning&&(a>=b._warningLevel?b._ui.handlerElement.classList.add(o.SLIDER_WARNING):b._ui.handlerElement.classList.remove(o.SLIDER_WARNING))},p._setDisabled=function(a){var b=this,c=b.options;c.disabled===!0||a.disabled?b._disable(a):b._enable(a)},p._enable=function(a){a&&(this.options.disabled=!1,this._ui.barElement&&this._ui.barElement.classList.remove(o.SLIDER_DISABLED))},p._disable=function(a){a&&(this.options.disabled=!0,this._ui.barElement&&this._ui.barElement.classList.add(o.SLIDER_DISABLED))},p._bindEvents=function(){c(this)},p.handleEvent=function(a){var b=this;if(!this.options.disabled)switch(a.type){case"dragstart":b._onDragstart(a);break;case"dragend":case"dragcancel":b._onDragend(a);break;case"drag":b._onDrag(a)}},p._onDrag=function(a){var b,c,d=this,e=d._ui;d._active&&(b=d.options.orientation===m.HORIZONTAL?a.detail.estimatedX-e.barElement.offsetLeft:d._barElementHeight-(a.detail.estimatedY-i.getElementOffset(e.barElement).top+h.getScrollableParent(d.element).scrollTop),c=d.options.orientation===m.HORIZONTAL?d._interval*b/d._barElementWidth:d._interval*b/d._barElementHeight,c+=d._min,d._setValue(c))},p._onDragstart=function(a){var b=this,c=b._ui,d=b.options.orientation===m.HORIZONTAL?a.detail.estimatedX-c.barElement.offsetLeft:b._barElementHeight-(a.detail.estimatedY-i.getElementOffset(c.barElement).top+h.getScrollableParent(b.element).scrollTop),e=b.options.orientation===m.HORIZONTAL?b._interval*d/b._barElementWidth:b._interval*d/b._barElementHeight;c.handlerElement.classList.add(o.SLIDER_HANDLER_ACTIVE),e+=b._min,b._setValue(e),b._active=!0},p._onDragend=function(){var a=this,b=a._ui;b.handlerElement.classList.remove(o.SLIDER_HANDLER_ACTIVE),a._active=!1,a._previousValue!==a.element.value&&j.trigger(a.element,"change"),a._previousValue=a.element.value},p.refresh=function(){this._setDisabled(this.element),this._initLayout()},p._destroy=function(){var a=this,b=a._ui.barElement;d(a),b.parentNode.removeChild(b),a._ui=null,a._options=null},b.widget.core.Slider=n,g.defineWidget("Slider","input[data-role='slider'], input[type='range'], input[data-type='range']",["value"],n,"core")}(a.document,d),function(b,c){function d(a,b){var c=(b-a._minValue)/(a._maxValue-a._minValue)*100,d=a._ui,f=a._size,g=a.options.thickness,h=d.canvasContext,k=30,l=100,m=0,n=a.options.bgcolor,p=parseInt(a.options.margin,10);i(h,f,g,p,n),m=2*o*(c/100)-.5*o,100===c?j(h,0,2*o,f,g,p):c>0&&j(h,1.5*o,m,f,g,p),a.options.endPoint&&(k=f+(f-p-g/2)*Math.cos(m),l=f+(f-p-g/2)*Math.sin(m),e(d.endPoint,k,l))}function e(a,b,c){a.style.left=b+"px",a.style.top=c+"px"}function f(b,c){var d=parseFloat(c),e=a.innerWidth,f=b._ui,g=f.progressContainer.style,h=f.progressContainer.classList,i=f.canvas,j=0;if(h.remove(u.uiProgressbarFull),isNaN(d))switch(c){case w.FULL:j=e/2,h.add(u.uiProgressbarFull);break;case w.LARGE:j=.15625*e;break;case w.MEDIUM:j=.13125*e;break;case w.SMALL:j=.0875*e}else j=d/2;j=Math.floor(j),b._size=j,g.width=2*j+"px",g.height=2*j+"px",i.width=2*j,i.height=2*j}function g(a,b){b.size&&f(a,b.size),b.containerClassName&&a._ui.progressContainer.classList.add(b.containerClassName),b.endPoint?a._ui.endPoint.classList.add(u.endPointActive):a._ui.endPoint.classList.remove(u.endPointActive),b.pressed?a._ui.endPoint.classList.add(u.endPointPressed):a._ui.endPoint.classList.remove(u.endPointPressed)}function h(a){var b=a.element,d=0;a._maxValue=m.getNumberFromAttribute(b,"max",null,100),a._minValue=m.getNumberFromAttribute(b,"min",null,0),a._maxValue<=a._minValue&&(c.error("max value of progress must be positive number that bigger than zero!"),a._maxValue=100),d=m.getNumberFromAttribute(b,"value",null,(a._maxValue+a._minValue)/2),d>a._maxValue?d=a._maxValue:d<a._minValue&&(d=a._minValue),a._value=d,m.setAttribute(b,"value",d)}function i(a,b,c,d,e){a.clearRect(0,0,2*b,2*b),a.strokeStyle=e,a.lineWidth=c,a.beginPath(),a.arc(b,b,b-d-c/2,0,2*o),a.closePath(),a.stroke()}function j(a,b,c,d,e,f){a.strokeStyle="rgba(55,161,237,1)",a.lineWidth=e,a.beginPath(),a.arc(d,d,d-f-e/2,b,c),a.stroke()}var k=c.widget.BaseWidget,l=c.engine,m=c.util.DOM,n=c.util.object,o=Math.PI,p={CHANGE:"progresschange"},q={margin:0,endPoint:!1,bgcolor:"rgba(71,71,71,1)"},r=function(){var a=this,b={};a.options=n.merge({},q,a.options),b.progressContainer=null,b.endPoint=null,a._ui=b,a._maxValue=null,a._minValue=null,a._value=null},s=new k,t="ui-progressbar",u={uiProgressbar:t,uiProgressbarFull:t+"-full",endPoint:t+"-end-point",endPointActive:t+"-end-point-active",endPointPressed:t+"-end-point-pressed"},v={progressContainer:"."+u.uiProgressbar},w={FULL:"full",LARGE:"large",MEDIUM:"medium",SMALL:"small"};r.classes=u,s._configure=function(a){this.options=n.merge({},{thickness:8,size:w.MEDIUM,containerClassName:null,type:"circle",margin:0,bgcolor:"rgba(61, 185, 204, 0.4)",endPoint:!1,pressed:!1},a)},s._build=function(a){var c=this,d=c._ui,e=a,f=b.createElement("div"),g=b.createElement("canvas"),h=g.getContext("2d"),i=b.createElement("div");return d.progressContainer=f,d.endPoint=i,d.canvasContext=h,d.canvas=g,f.className=u.uiProgressbar,i.className=u.endPoint,f.id=e.id?e.id+"-container":"",e.parentNode.insertBefore(f,e),f.appendChild(g),f.appendChild(i),a},s._init=function(a){var b=this,c=b._ui,e=a.parentNode,f=b.options;return c.progressContainer=c.progressContainer||e.querySelector(v.progressContainer),c.endPoint=c.endPoint||e.querySelector("."+u.endPoint),h(b),g(b,f),d(b,b._value),a},s._getValue=function(){return parseInt(this.element.getAttribute("value"),10)},s._setValue=function(a){var b,c=this;b=a>c._maxValue?c._maxValue:a<c._minValue?c._minValue:isNaN(a)?c._minValue:a,m.setAttribute(c.element,"value",b),c._value!==b&&(c._value=b,c.trigger(p.CHANGE)),d(c,b)},s._refresh=function(){var a=this;return h(a),g(a,a.options),d(a,a._value),null},s._destroy=function(){var a=this;return a.element.parentNode.removeChild(a._ui.progressContainer),a.element=null,a._ui=null,a._maxValue=null,a._minValue=null,a._value=null,null},r.prototype=s,c.widget.wearable.CircleProgressBar=r,l.defineWidget("CircleProgressBar",".ui-circle-progress",[],r,"wearable")}(a.document,d),function(b,c){var d=c.widget.core.Slider,e=d.prototype,f=c.widget.wearable.CircleProgressBar,g=f.prototype,h=c.support.shape,i=c.engine,j=c.event,k=c.util.object,l=Math.round,m=Math.floor,n=Math.atan2,o=Math.PI,p=2*o,q=5*o/2,r=function(){var a=this;d.call(a),a._step=1,a._middlePoint={x:0,y:0}},s=new d,t={CHANGE:"change"},u="ui-slider",v={container:u+"-container",titles:u+"-titles",buttons:u+"-buttons",plus:u+"-plus",minus:u+"-minus",number:u+"-number",icon:u+"-icon",title:u+"-title",subtitle:u+"-subtitle"},w=Array.prototype.slice;r.prototype=s,r.classes=v,s._configure=function(){var a,b=this;h.circle&&(b.options=k.merge({},b.options,{margin:0,endPoint:!1,bgcolor:"white",pressed:!1}),g._configure.call(b)),a=b.options,a.size="full",a.touchableWidth=50,a.buttons=!1,a.bgcolor="rgba(61, 185, 204, 0.4)",a.endPoint=!0,a.margin=7},s._buildButtons=function(a){var c=b.createElement("div");c.classList.add(v.buttons),c.innerHTML="<div class='"+v.minus+"'></div><div class='"+v.number+"'></div><div class='"+v.plus+"'></div>",a.parentElement.insertBefore(c,a)},s._build=function(a){var c=this,d=c.options,h=a.parentElement,i=null,j=null,k=null;return"circle"===d.type?(f.call(this),a.style.display="none",g._build.call(c,a),d.buttons&&c._buildButtons(a),i=w.call(h.querySelectorAll("."+v.icon+", ."+v.title+", ."+v.subtitle+", ."+v.buttons)),i.length&&(j=b.createElement("div"),j.classList.add(v.container),i.forEach(j.appendChild.bind(j)),h.appendChild(j),i=w.call(h.querySelectorAll("."+v.subtitle+", ."+v.title)),k=b.createElement("div"),k.classList.add(v.titles),i.forEach(k.appendChild.bind(k)),j.appendChild(k),c._ui.container=j)):e._build.call(c,a),a},s._init=function(a){var b=this,c=b.options;return"circle"===c.type?(g._init.call(b,a),b._circleInit()):e._init.call(b,a),b._ui.container&&(b._ui.valueField=b._ui.container.querySelector("."+v.number)),b.value(b._value),a},s._circleInit=function(){var b=this;b._step=parseInt(b.element.getAttribute("step"),10)||b._step||1,b._middlePoint.x=a.innerWidth/2,b._middlePoint.y=a.innerHeight/2,b._step<1?b._step=1:b._step>b._maxValue-b._minValue&&(b._step=b._maxValue-b._minValue)},s._bindEvents=function(){var a=this,c=a.options;"circle"===c.type?j.on(b,"rotarydetent touchstart touchmove touchend click",a,!1):e._bindEvents.call(a)},s.handleEvent=function(a){var b=this,c=b.options;if("circle"===c.type)switch(a.type){case"rotarydetent":b._onRotary(a);break;case"touchstart":case"touchmove":case"touchend":b._onTouch(a);break;case"click":b._onClick(a)}else e.handleEvent.call(b,a)},s._onRotary=function(a){var b=this,c=b._step,d=b.value();b.value(d+("CW"===a.detail.direction?c:-c))},s._onTouch=function(a){var b=this,c=a.changedTouches&&a.changedTouches[0]||a,d=c.clientX,e=c.clientY,f=b._isValidStartPosition(d,e);f&&(a.preventDefault(),a.stopPropagation(),b._setValueByCoord(d,e)),b.options.endPoint&&("touchstart"===a.type?b.option("pressed",!0):"touchend"===a.type&&b.option("pressed",!1))},s._onClick=function(a){var b=this,c=a.target.classList;c.contains(v.plus)?b.value(b.value()+b._step):c.contains(v.minus)&&b.value(b.value()-b._step)},s._setPressed=function(a,b){return b="false"===b?!1:b,this.options.pressed===!b?(this.options.pressed=!!b,!0):!1},s._isValidStartPosition=function(a,b){var c=this,d=c._middlePoint.x,e=c._middlePoint.y,f=e-c.options.touchableWidth;return(b-e)*(b-e)+(a-d)*(a-d)>f*f},s._setValueByCoord=function(a,b){var c,d=this;c=d._convertCoordToValue(a,b),0===c&&a===d._middlePoint.x&&g._getValue.call(d)>(d._maxValue+d._minValue)/2&&(c=d._maxValue),d.value(c)},s._convertCoordToValue=function(a,b){return l((n(b-this._middlePoint.y,a-this._middlePoint.x)+q)%p/p*(this._maxValue-this._minValue)+this._minValue)},s._calibrateValue=function(a){var b=this,c=b._step,d=c/2;return m((a-b._minValue+d)/c)*c+b._minValue},s._setValue=function(a){var b=this,c=b._value;return parseInt(a,10)>b._maxValue&&(a=b._maxValue),parseInt(a,10)<b._minValue&&(a=b._minValue),a=b._calibrateValue(a),"circle"!==b.options.type?e._setValue.call(b,a):(g._setValue.call(b,a),b._ui.valueField&&(b._ui.valueField.textContent=a),a!==c&&b.trigger(t.CHANGE),void 0)},s._getValue=function(){var a=this;return"circle"===a.options.type?g._getValue.call(a):e._getValue.call(a)},s.refresh=function(){var a=this,b=a.options;"circle"===b.type?(g._refresh.call(a),a._circleInit()):e.refresh.call(a)},s._destroy=function(){var a=this,c=a.options;"circle"===c.type?(j.off(b,"rotarydetent touchstart touchmove touchend click",a,!1),a.element.style.display="inline-block",g._destroy.call(a),a._ui=null,a.options=null):e._destroy.call(a)},c.widget.wearable.Slider=r,i.defineWidget("Slider","."+u,["value"],r,"wearable",!0)}(a.document,d),function(a,b){var c=b.widget.BaseWidget,d=b.engine,e=function(){},f={LISTVIEW:"ui-listview",DETAILS:"ui-details"},g=new c;e.classes=f,g._build=function(a){return a.classList.add(f.LISTVIEW),a},e.prototype=g,b.widget.core.Listview=e,d.defineWidget("Listview","[data-role='listview'], .ui-listview",[],e,"core")}(a.document,d),function(b,d){function e(a,b){var c=a.style;c.height=b.height+"px",c.position="relative"}function f(a){null!==a&&null!==a.to&&(a.current.scale=a.to.scale,a.repaint=!0)}function g(a,b){a.style.height=b.getBoundingClientRect().height+"px",a.classList.add(K.SELECTION_SHOW)}function h(a,c){var d,e,f=b.createElement("div"),g=b.createDocumentFragment(),h=0;for(f.classList.add(K.CAROUSEL,K.PREFIX+c);c+4>h;h++)d=b.createElement("ul"),d.classList.add(K.CAROUSEL_ITEM),d.classList.add(K.LISTVIEW),e=b.createElement("ul"),e.classList.add(K.CAROUSEL_ITEM),e.classList.add(K.CAROUSEL_ITEM_SEPARATOR),e.classList.add(K.LISTVIEW),a.items[h]={carouselSeparator:e,carouselElement:d},g.appendChild(e),g.appendChild(d);return f.appendChild(g),f}var i=d.widget,j=i.core.Listview,k=i.core.Page,l=d.event,m=[].slice,n=333,o=180,p=360,q=400,r=1500,s=15,t=400,u=140,v=10,w=40,x=(a.innerHeight-112)/2,y=d.engine,z=d.util,A=z.selectors,B=z.easing.easeOutSine,C=Math.round,D=Math.min,E=Math.max,F=Math.sqrt,G=Math.abs,H=d.util.array,I=function(){var a=this;a.options={selectedIndex:0,ellipsisA:n,ellipsisB:o,bouncingTimeout:1e3,visibleItems:3},a._items=[],a._scrollAnimationEnd=!0,a._carousel={items:[]},a._initializeState(),a._renderCallback=a._render.bind(this),a._halfItemsCount=null,a._rendering=!1,a._lastRenderRequest=0,a._carouselIndex=0,a._ui={selection:null,scroller:null}},J="ui-arc-listview",K={WIDGET:J,PREFIX:J+"-",SELECTION:J+"-selection",SELECTION_SHOW:J+"-selection-show",CAROUSEL:J+"-carousel",CAROUSEL_ITEM:J+"-carousel-item",CAROUSEL_ITEM_SEPARATOR:J+"-carousel-item-separator",GROUP_INDEX:"ui-li-group-index",DIVIDER:"ui-listview-divider",FORCE_RELATIVE:"ui-force-relative-li-children",LISTVIEW:"ui-listview",SELECTED:"ui-arc-listview-selected"},L={CHANGE:"change"},M={PAGE:"."+k.classes.uiPage,POPUP:".ui-popup",SCROLLER:".ui-scroller",ITEMS:"."+J+" > li",SELECTION:"."+J+"-selection",TEXT_INPUT:"input[type='text'], input[type='number'], input[type='password'], input[type='email'], input[type='url'], input[type='tel'], input[type='search']"},N=new j,O=!1,P=0,Q=0,R=0,S=0,T=0,U=0,V=[],W=0,X=0,Y=0;I.createItem=function(){return{element:null,id:0,y:0,rect:null,current:{scale:-1},from:null,to:null,repaint:!1}},I.calcFactors=function(a,b){var c;for(c=0;b>=c;c++)V[c]=F(a*a*(1-c*c/b/b))/a;return V},N._initializeState=function(){this._state={startTime:Date.now(),duration:0,progress:0,scroll:{current:10,from:null,to:null},currentIndex:0,toIndex:0,items:[],separators:[]}},N._setAnimatedItems=function(){var a=this,b=a._items,d=0,f=b[0],g=null,h=null,i=null,j=null,k=a._ui.scroller,l=a._state,m=f.parentElement,n=m.classList;i=m.getBoundingClientRect(),e(m,i),n.add(K.FORCE_RELATIVE),H.forEach(b,function(a,b){b>=0&&!l.items[b]&&a!==c&&(h=a.getBoundingClientRect(),g=I.createItem(),a.classList.contains(K.GROUP_INDEX)||a.classList.contains(K.DIVIDER)?l.separators.push({itemElement:g,insertBefore:b-l.separators.length}):(l.items.push(g),g.id=d,d++),g.element=a,g.y=C(h.top+h.height/2+k.scrollTop),g.height=h.height,g.rect=h,null===j&&(j=h.top-i.top))}),n.remove(K.FORCE_RELATIVE),H.forEach(b,function(a){m.removeChild(a)})},N._updateScale=function(a){var b,c=this,d=c._state,e=d.items,f=0;H.forEach(e,function(e){null!==e&&(b=e.y,e.id<d.currentIndex&&(b-=e.height/4),e.id>d.currentIndex&&(b+=e.height/4),f=c._getScaleByY(b-p/2-a),e.current.scale!==f?(e.from=e.from||{},e.from.scale=e.current.scale,e.to=e.to||{},e.to.scale=f):e.to=null)})},N._getSeparatorBeforeListItem=function(a){for(var b=this,c=b._state,d=c.separators,e=0,f=d.length;f>e;e++){if(d[e].insertBefore===a)return d[e];if(d[e].insertBefore>a)return null}},N._calc=function(){var a=this,b=a._state,c=Date.now(),d=b.startTime,e=c-d,g=b.scroll;e>=b.duration&&(a._scrollAnimationEnd=!0,e=b.duration),b.progress=0!==b.duration?e/b.duration:1,null!==g.to&&(g.current=B(b.progress,g.from,g.to-g.from,1),a._scrollAnimationEnd&&(a.trigger(L.CHANGE,{selected:b.currentIndex}),l.trigger(b.items[b.currentIndex].element,"selected"),b.toIndex=b.currentIndex,g.to=null,g.from=null)),a._updateScale(-1*g.current),H.forEach(b.items,f)},N._setBouncingTimeout=function(){var a=this;setTimeout(function(){a._bouncingEffect.dragEnd()},a.options.bouncingTimeout)},N._drawItem=function(a,b){var c,d,e,c,d,f,g,h,i,j,k,l,m=this,n=m._carousel,o=m._halfItemsCount+1,p=m._carouselIndex;if(null!==a)if(e=a.element,g=m._getSeparatorBeforeListItem(b),h=m._getSeparatorBeforeListItem(b+1),a.repaint){if(l=e.style,o>b-p&&b-p>-o&&(c=n.items[b-p+o-1])){if(d=c.carouselElement,f=c.carouselSeparator,e.parentElement!==d&&d.appendChild(e),g){for(i=g.itemElement.element;f.firstChild;)f.removeChild(f.firstChild);f.appendChild(i)}else f.firstChild&&f.removeChild(f.firstChild);if(j=n.items[b-p+o])if(k=j.carouselSeparator,h){for(;k.firstChild;)k.removeChild(k.firstChild);k.appendChild(h.itemElement.element)}else k.firstChild&&k.removeChild(k.firstChild)}l.transform="translateY(-50%) scale3d("+a.current.scale+","+a.current.scale+","+a.current.scale+")",l.opacity=1.15*a.current.scale,a.repaint=!1}else null!==e.parentNode&&a.current.scale<.01&&e.parentNode.removeChild(e)},N._draw=function(){var a,b=this,c=b._state,d=c.items,e=d.length;for(Math.abs(b._carouselIndex-c.currentIndex)>=2&&(b._carouselIndex=c.currentIndex),a=0;e>a;a++)b._drawItem(d[a],a);b._carouselUpdate(c.currentIndex),b._ui.scroller.scrollTop=-1*c.scroll.current},N._carouselUpdate=function(a){var b,d,e,f,g,h,i,j,k=this,l=k._carousel,m=k._state,n=k._halfItemsCount;for(Math.abs(k._carouselIndex-a)>=2&&(k._carouselIndex=a),e=-n,d=n;d>=e;e++)f=k._carouselIndex+e,b=m.items[f],h=l.items[e+n].carouselElement,i=l.items[e+n].carouselSeparator,b!==c?(j=m.scroll.current+b.y-b.height/2,g=i.childElementCount?j-(b.height+i.offsetHeight)/2:0):(j=0,g=0),h.style.transform="translateY("+j+"px)",i.style.transform="translateY("+g+"px)"},N._render=function(){var a=this,b=a._state;a._calc(),a._draw(),a._scrollAnimationEnd?a._rendering=!1:(b.currentIndex=a._findItemIndexByY(-1*(b.scroll.current-p/2+1)),z.requestAnimationFrame(a._renderCallback))},N._requestRender=function(){var a=this;a._rendering||(a._rendering=!0,z.requestAnimationFrame(a._renderCallback)),a._lastRenderRequest=Date.now()},N._findItemIndexByY=function(a){var b,c,d,e=this._state.items,f=e.length,g=e[0].y,h=e[f-1].y,i=!0,j=h-g,k=0!==j?C((a-g)/j*f):0;for(k=D(f-1,E(0,k));i;)b=G(e[k-1]?a-e[k-1].y:1/0),c=G(a-e[k].y),d=G(e[k+1]?a-e[k+1].y:-(1/0)),c>b?k--:c>d?k++:i=!1;return k},N._refresh=function(){var a,b,c=this,d=c._state,e=Date.now(),f=e-U,g=d.items,h=d.scroll;Q+=-1*f,R+=X,P=R/Q,c._halfItemsCount=Math.ceil((parseInt(c.options.visibleItems,10)+2)/2),0!==S&&(S*=P,S=E(D(S,t),-t),b=-1*(h.current-S-p/2+1),a=c._findItemIndexByY(b),b=g[a].y,d.currentIndex=a,h.from=h.current,h.to=-1*(b-p/2+1),d.duration=D(q*E(Math.abs(P)/4,1),r)),c._scrollAnimationEnd&&(d.startTime=Date.now(),c._scrollAnimationEnd=!1,c._requestRender())},N._scroll=function(){var a=this;S=S===c?0:S,a._refresh(),a._requestRender()},N._getScaleByY=function(a){var b=this,c=C(a);return c>b.options.ellipsisB||c<-b.options.ellipsisB?0:V[G(c)]},N._roll=function(a){var b=this,d=b._state,e=d.scroll;d.duration=a!==c?a:q*(1+(G(d.currentIndex-d.toIndex)-1)/4),e.from=e.current,e.to=-1*(d.items[d.toIndex].y-p/2+1),b._scrollAnimationEnd&&(d.startTime=Date.now(),b._scrollAnimationEnd=!1,b._requestRender())},N._rollDown=function(){var a=this,b=a._state,c=a._bouncingEffect;a.trigger(L.CHANGE,{unselected:b.currentIndex}),b.toIndex<b.items.length-1?(b.toIndex++,c.dragEnd()):(c.drag(0,-a._maxScrollY),a._setBouncingTimeout()),a._roll()},N._rollUp=function(){var a=this,b=a._state,c=a._bouncingEffect;a.trigger(L.CHANGE,{unselected:b.currentIndex}),b.toIndex>0?(b.toIndex--,c.dragEnd()):(c.drag(0,0),a._setBouncingTimeout()),a._roll()},N._onRotary=function(a){var b=this;b._scrollAnimationEnd=!0,"CW"===a.detail.direction?b._rollDown():b._rollUp()},N.scrollToPosition=function(a,b){var c=this,d=c._state;c.trigger(L.CHANGE,{unselected:d.currentIndex}),d.toIndex=a,d.toIndex>d.items.length-1&&(d.toIndex=d.items.length-1),d.toIndex<0&&(d.toIndex=0),b?c._roll(w):c._roll()},N.getSelectedIndex=function(){return this._state.currentIndex},N._onTouchStart=function(a){var b=this,c=a.changedTouches[0],d=b._state;X=0,W=c.clientY,T=Date.now(),Y=0,U=T,P=0,Q=0,R=0,S=0,b._scrollAnimationEnd=!0,O=!1,b._carouselUpdate(d.currentIndex)},N._onTouchMove=function(a){var b,c=this,d=c._state,e=a.changedTouches[0],f=d.scroll,g=f.current,h=c._bouncingEffect;U=Date.now(),b=U-T,X=e.clientY-W,g+=X,Y+=X,O===!1&&(b>u||G(Y)>v)&&(O=!0,c.trigger(L.CHANGE,{unselected:d.currentIndex})),O&&(W=e.clientY,g>0?(g=0,h.drag(0,0),c._setBouncingTimeout()):g<-c._maxScrollY?(g=-c._maxScrollY,h.drag(0,g),c._setBouncingTimeout()):h.dragEnd(),f.current=g,d.currentIndex=c._findItemIndexByY(-1*(g-p/2+1)),c._carouselUpdate(d.currentIndex),S=0,c._scroll(),U=Date.now())},N._onTouchEnd=function(a){var b=a.changedTouches[0],c=this,d=c._state,e=d.scroll,f=c._bouncingEffect;O&&(X=b.clientY-W,W=b.clientY,e.current+=X,e.current>0&&(e.current=0),d.currentIndex=c._findItemIndexByY(-1*(e.current-p/2+1)),c._carouselUpdate(d.currentIndex),S=s,c._scrollAnimationEnd=!0,c._scroll(),U=0,f&&f.dragEnd())},N._selectItem=function(a){var b=this._ui,c=this._state,d=c.items[a].element;d.classList.contains(K.SELECTED)?g(b.arcListviewSelection,d):(l.one(d,"transitionend",function(){g(b.arcListviewSelection,d)}),d.classList.add(K.SELECTED))},N._onChange=function(a){var b=a.detail.selected,d=a.detail.unselected,e=this._ui.arcListviewSelection.classList;a.defaultPrevented||(b!==c?this._selectItem(b):(e.remove(K.SELECTION_SHOW),this._state.items[d].element.classList.remove(K.SELECTED)))},N._onClick=function(a){var b=this,c=a.target,d=b._state,e=A.getClosestByTag(c,"li"),f=d.items.map(function(a){return a.element}).indexOf(e);f&&f!==d.currentIndex&&(b.trigger(L.CHANGE,{unselected:d.currentIndex}),f>=0&&f<d.items.length&&(d.toIndex=f),b._roll())},N._onPageInit=function(){this._init()},N._buildArcListviewSelection=function(a){var c=a.querySelector(M.SELECTION);return c||(c=b.createElement("div"),c.classList.add(K.SELECTION),a.appendChild(c)),c},N._build=function(a){return y.getBinding(a,"Listview")?null:y.getBinding(a,"SnapListview")?(d.warn("Can't create Listview on SnapListview element"),null):a},N._init=function(){var a,b,c,e=this,f=e.element,g=e.options,i=e._ui,j=e._carousel,k=parseInt(e.options.visibleItems,10);b=A.getClosestBySelector(f,M.PAGE),i.page=b,c=A.getClosestBySelector(f,M.SCROLLER),c&&(f.classList.add(J,K.PREFIX+k),e._items=m.call(b.querySelectorAll(M.ITEMS))||[],
H.forEach(e._items,function(a){var b=A.getChildrenBySelector(a,M.TEXT_INPUT)[0];b&&d.widget.TextInput(b)}),i.arcListviewSelection=e._buildArcListviewSelection(b),a=h(j,k),i.arcListviewCarousel=a,c.parentElement.appendChild(a),e._ui.arcListviewCarousel.addEventListener("vclick",e,!0),i.scroller=c,I.calcFactors(g.ellipsisA,g.ellipsisB),e._setAnimatedItems(),e._scrollAnimationEnd=!0,S=1,e._refresh(),e._scroll(),e._initBouncingEffect())},N.handleEvent=function(a){var b=this,c=b._ui.page;if("pageinit"===a.type)b._onPageInit(a);else if(c&&c.classList.contains("ui-page-active"))switch(a.type){case"touchmove":b._onTouchMove(a);break;case"rotarydetent":b._onRotary(a);break;case"touchstart":b._onTouchStart(a);break;case"touchend":b._onTouchEnd(a);break;case"change":b._onChange(a);break;case"vclick":b._onClick(a)}},N._bindEvents=function(){var a=this,c=a.element,d=a._ui.page;d.addEventListener("touchstart",a,!0),d.addEventListener("touchmove",a,!0),d.addEventListener("touchend",a,!0),d.addEventListener("pageinit",a,!0),a._ui.arcListviewCarousel&&a._ui.arcListviewCarousel.addEventListener("vclick",a,!0),b.addEventListener("rotarydetent",a,!0),c.addEventListener("change",a,!0)},N.enableList=function(){var a=this,c=a._ui.page;c.addEventListener("touchstart",a,!0),c.addEventListener("touchmove",a,!0),c.addEventListener("touchend",a,!0),a._ui.arcListviewCarousel&&a._ui.arcListviewCarousel.addEventListener("vclick",a,!0),b.addEventListener("rotarydetent",a,!0)},N.disableList=function(){var a=this,c=a._ui.page;c.removeEventListener("touchstart",a,!0),c.removeEventListener("touchmove",a,!0),c.removeEventListener("touchend",a,!0),a._ui.arcListviewCarousel.removeEventListener("vclick",a,!0),b.removeEventListener("rotarydetent",a,!0)},N._unbindEvents=function(){var a=this,c=a.element,d=a._ui.page;d.removeEventListener("touchstart",a,!0),d.removeEventListener("touchmove",a,!0),d.removeEventListener("touchend",a,!0),d.removeEventListener("pageinit",a,!0),a._ui.arcListviewCarousel&&a._ui.arcListviewCarousel.removeEventListener("vclick",a,!0),b.removeEventListener("rotarydetent",a,!0),c.removeEventListener("change",a,!0)},N._destroy=function(){var a=this,b=a._ui,c=b.arcListviewSelection,d=b.arcListviewCarousel;a._unbindEvents(),a._items.forEach(function(b){a.element.appendChild(b),b.setAttribute("style","")}),a._items=[],c&&c.parentElement&&c.parentElement.removeChild(c),d&&d.parentElement&&d.parentElement.removeChild(d)},N._initBouncingEffect=function(){var a=this;a._maxScrollY=a.element.getBoundingClientRect().height-x,a._bouncingEffect=new d.widget.core.scroller.effect.Bouncing(a._ui.page,{maxScrollX:0,maxScrollY:a._maxScrollY,orientation:"vertical"})},I.prototype=N,d.widget.wearable.ArcListview=I,I.classes=K,y.defineWidget("ArcListview","."+J,[],I,"wearable")}(a.document,d),function(a,b){var c=b.widget.core.Listview,d=b.widget.wearable.ArcListview,e=b.engine,f=b.support.shape.circle,g=f?d:c,h=function(){g.call(this)},i=new g;h.events=g.events,h.prototype=i,b.widget.wearable.Listview=h,e.defineWidget("Listview",".ui-listview",[],h,"wearable",!0)}(a.document,d),function(a){a.widget.core.indexscrollbar=a.widget.core.indexscrollbar||{}}(d),function(a,b){function c(a,b){return this.element=a,this.options=d.merge(b,this._options,!1),this.container=this.options.container,this.indices={original:this.options.index,merged:[]},this._init(),this}var d=b.util.object,e=b.util.DOM;c.prototype={_options:{container:null,offsetLeft:0,index:[],verticalCenter:!1,moreChar:"*",moreCharLineHeight:9,indexHeight:41,selectedClass:"ui-state-selected",ulClass:null,maxIndexLen:0},_init:function(){this.indices.original=this.options.index,this.indexLookupTable=[],this.indexElements=null,this.selectedIndex=-1,this.visiblity="hidden",this._setMaxIndexLen(),this._makeMergedIndices(),this._drawDOM(),this._appendToContainer(),this.options.verticalCenter&&this._adjustVerticalCenter(),this._setIndexCellInfo()},_clear:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.indices.merged.length=0,this.indexLookupTable.length=0,this.indexElements=null,this.selectedIndex=-1,this.visiblity=null},refresh:function(){this._clear(),this._init()},destroy:function(){this._clear()},show:function(){this.visibility="visible",this.element.style.visibility=this.visibility},hide:function(){this.visibility="hidden",this.element.style.visibility=this.visibility},isShown:function(){return"visible"===this.visibility},_setMaxIndexLen:function(){var a,b=this,c=b.options,d=b.container,e=c.indexHeight,f=d.offsetHeight;a=Math.floor(f/e),a>0&&a%2===0&&(a-=1),c.maxIndexLen=c.maxIndexLen>0?Math.min(a,c.maxIndexLen):a},_makeMergedIndices:function(){var a,b,c=this.indices.original,d=c.length,e=Math.min(this.options.maxIndexLen,d),f=d-e,g=parseInt(f/parseInt(e/2,10),10),h=f%parseInt(e/2,10),i=[],j=[],k=0;for(a=0,b=e;b>a;a++)i[a]=1,a%2&&(i[a]+=g+(h-->0?1:0)),k+=i[a],j.push({start:k-1,length:i[a]});this.indices.merged=j},_drawDOM:function(){var b,c,d,e,f,g=this.indices.original,h=this.indices.merged,i=h.length,j=this.options.indexHeight,k=this.options.moreChar,l=this.container.clientHeight-(i-1)*j,m=this.options.moreCharLineHeight;for(c=a.createDocumentFragment(),e=0;i>e;e++)f=h[e],b=1===f.length?g[f.start]:k,d=a.createElement("li"),d.innerText=b.toUpperCase(),d.style.height=(e===i-1?l:j)+"px",d.style.lineHeight=b===k?j+m+"px":j+"px",c.appendChild(d);this.element.appendChild(c),this.options.ulClass&&this.element.classList.add(this.options.ulClass)},_adjustVerticalCenter:function(){var a=this.indices.merged.length,b=a*this.options.indexHeight,c=parseInt((this.container.offsetHeight-b)/2,10);this.element.style.paddingTop=c+"px"},_appendToContainer:function(){var b=this,c=b.options,d=b.element,e=b.container,f=d.style,g=a.createElement("div"),h=c.paddingBottom+"px";e.appendChild(d),f.left=c.offsetLeft+"px",c.paddingBottom&&(f.paddingBottom=h,g.classList.add("ui-indexscrollbar-margin"),g.style.height=h,e.appendChild(g))},setPaddingTop:function(a){var b=this.element.clientHeight,c=this.element.style.paddingTop,d=this.container.clientHeight;c=""===c?0:parseInt(c,10),b-=c,b>d&&(a-=a+b-d),this.element.style.paddingTop=a+"px",this._setIndexCellInfo()},getOffsetTopByIndex:function(a){var b=this.indexLookupTable[a].cellIndex,c=this.indexElements[b],d=c.offsetTop;return d},_setIndexCellInfo:function(){var a=this.element,b=this.indices.merged,c=e.getElementOffset(this.container).top,d=this.element.querySelectorAll("LI"),f=[];[].forEach.call(d,function(a,d){for(var e=b[d],g=e.start,h=g+e.length,i=c+a.offsetTop,j=a.offsetHeight/e.length;h>g;g++)f.push({cellIndex:d,top:i,range:j}),i+=j}),this.indexLookupTable=f,this.indexElements=a.children},getIndexByPosition:function(a){var b,c,d,e,f=this.indexLookupTable;if(f[0]&&(b=f[0],a<b.top))return 0;if(f[f.length-1]&&(b=f[f.length-1],a>=b.top+b.range))return f.length-1;for(c=0,d=f.length;d>c;c++)if(b=f[c],e=a-b.top,e>=0&&e<b.range)return c;return 0},getValueByIndex:function(a){return 0>a&&(a=0),this.indices.original[a]},select:function(a){var b,c;this.clearSelected(),this.selectedIndex!==a&&(this.selectedIndex=a,b=this.indexLookupTable[a].cellIndex,c=this.indexElements[b],c.classList.add(this.options.selectedClass))},clearSelected:function(){var a=this.element,b=this.options.selectedClass,c=a.querySelectorAll("."+b);[].forEach.call(c,function(a){a.classList.remove(b)}),this.selectedIndex=-1}},b.widget.core.indexscrollbar.IndexBar=c}(a.document,d),function(a,b){function c(a){a.preventDefault(),a.stopPropagation()}function d(a,b){return this.element=a,this.options=e.merge(b,this._options,!1),this.value=null,this._init(),this}var e=b.util.object,f=b.event;d.prototype={_options:{className:"ui-indexscrollbar-indicator",selectedClass:"ui-selected",alignTo:"container",container:null},_init:function(){var a=this,b=a.options,d=a.element;d.className=b.className,d.innerHTML="<span></span>",f.on(d,["touchstart","touchmove"],c,!1),b.referenceElement.parentNode.insertBefore(d,b.referenceElement),a.fitToContainer()},fitToContainer:function(a){var b=this,c=b.element,d=c.style,e=b.options,f=e.container,g=f.getBoundingClientRect();a=a||e.alignTo,d.width=g.width+"px","container"===a?d.height=g.height+"px":d.height=g.height+g.top+"px",d.top=("container"===a?g.top:0)+"px",d.left=g.left+"px"},setValue:function(a){var b="",c="";this.value=a,a=a.toUpperCase(),b=a.substr(a.length-1),c=a.substr(0,a.length-1),this.element.firstChild.innerHTML="<span>"+c+'</span><span class="ui-selected">'+b+"</span>"},show:function(){this.element.style.display="block"},hide:function(){this.element.style.display="none"},destroy:function(){for(var a=this.element;a.firstChild;)a.removeChild(a.firstChild);f.off(a,["touchstart","touchmove"],c,!1),this.element=null}},b.widget.core.indexscrollbar.IndexIndicator=d}(a.document,d),function(b,c){var d=function(){var a=this;a.indicator=null,a.indexBar1=null,a.indexBar2=null,a._ui={},a.index=null,a.touchAreaOffsetLeft=0,a.indexElements=null,a.selectEventTriggerTimeoutId=null,a.ulMarginTop=0,a.eventHandlers={}},e=c.widget.BaseWidget,f=c.event,g=c.util.selectors,h=c.util.object,i=c.util.DOM,j=c.widget.core.indexscrollbar.IndexBar,k=c.widget.core.indexscrollbar.IndexIndicator,l=c.widget.core.Page,m=c.engine.getWidgetDefinition("Page").selector,n={SELECT:"select"},o="vmousedown",p="vmousemove",q="vmouseup",r=!1,s=new e;d.prototype=s,h.merge(s,{widgetName:"IndexScrollbar",widgetClass:"ui-indexscrollbar",_configure:function(){this.options={moreChar:"*",indexScrollbarClass:"ui-indexscrollbar",selectedClass:"ui-state-selected",indicatorClass:"ui-indexscrollbar-indicator",delimiter:",",index:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1"],maxIndexLen:0,indexHeight:41,keepSelectEventDelay:50,container:null,supplementaryIndex:null,supplementaryIndexMargin:1,moreCharLineHeight:9,verticalCenter:!0,indicatorAlignTo:"container"}},_build:function(a){return a},_init:function(a){var b=this,c=b.options;return a.classList.add(c.indexScrollbarClass),b._ui.page=g.getClosestBySelector(a,m),b._setIndex(a,c.index),b._setMaxIndexLen(a,c.maxIndexLen),b._setInitialLayout(),b._createSubObjects(),b._updateLayout(),b._extended(!0),a},_refresh:function(){var a=this;a._isExtended()&&(a._unbindEvent(),a.indicator.hide(),a._extended(!1)),a._updateLayout(),a.indexBar1.options.index=a.options.index,a.indexBar1.refresh(),a.indicator.fitToContainer(),a._bindEvents(),a._extended(!0)},_destroy:function(){var a=this;a.isBound()&&(a._unbindEvent(),a._extended(!1),a._destroySubObjects(),a.indicator=null,a.index=null,a.eventHandlers={})},_createSubObjects:function(){var a=this,c=a.options,d=a.element;a.indexBar1=new j(b.createElement("UL"),{container:d,offsetLeft:0,index:c.index,verticalCenter:c.verticalCenter,indexHeight:c.indexHeight,maxIndexLen:c.maxIndexLen,paddingBottom:c.paddingBottom,moreCharLineHeight:c.moreCharLineHeight}),"function"==typeof c.supplementaryIndex&&(a.indexBar2=new j(b.createElement("UL"),{container:d,offsetLeft:-d.clientWidth-c.supplementaryIndexMargin,index:[],indexHeight:c.indexHeight,ulClass:"ui-indexscrollbar-supplementary"}),a.indexBar2.hide()),a.indicator=new k(b.createElement("DIV"),{container:a._getContainer(),referenceElement:a.element,className:c.indicatorClass,alignTo:c.indicatorAlignTo})},_destroySubObjects:function(){var a,b,c,d={iBar1:this.indexBar1,iBar2:this.indexBar2,indicator:this.indicator};for(c in d)d.hasOwnProperty(c)&&(a=d[c],a&&(b=a.element,a.destroy(),b.parentNode.removeChild(b)))},_setInitialLayout:function(){var b=this.element,c=this._getContainer(),d=a.getComputedStyle(c).position,e=b.style;"absolute"!==d&&"relative"!==d&&(e.top=c.offsetTop+"px",e.height=c.offsetHeight+"px")},_setMaxIndexLen:function(a,b){var c=this,d=c.options,e=c._getContainer(),f=e.offsetHeight;0>=b&&(b=Math.floor(f/d.indexHeight)),b>0&&b%2===0&&(b-=1),d.maxIndexLen=b},_updateLayout:function(){var a=this;a._setInitialLayout(),a._draw(),a.touchAreaOffsetLeft=a.element.offsetLeft-10},_draw:function(){return this.indexBar1.show(),this},_removeIndicator:function(){var a=this.indicator,b=a.element.parentNode;b.removeChild(a.element),a.destroy(),this.indicator=null},_getEventReceiverByPosition:function(b){var c,d=a.innerWidth,e=this.element.clientWidth;return c=this.options.supplementaryIndex?b>=d-e&&d>=b?this.indexBar1:this.indexBar2:this.indexBar1},_updateIndicatorAndTriggerEvent:function(b){this.indicator.setValue(b),this.indicator.show(),this.selectEventTriggerTimeoutId&&a.clearTimeout(this.selectEventTriggerTimeoutId),this.selectEventTriggerTimeoutId=a.setTimeout(function(){this.trigger(n.SELECT,{index:b}),this.selectEventTriggerTimeoutId=null}.bind(this),this.options.keepSelectEventDelay)},_onTouchStartHandler:function(a){var c=a.touches||a._originalEvent&&a._originalEvent.touches,d=null,e=null,f=0,g=0;return r=!0,c&&c.length>1?(a.preventDefault(),void a.stopPropagation()):(d=this._getPositionFromEvent(a),e=this.indexBar1,f=e.getIndexByPosition(d.y),g=e.getValueByIndex(f),e.select(f),b.addEventListener(p,this.eventHandlers.touchMove),b.addEventListener(q,this.eventHandlers.touchEnd),b.addEventListener("touchcancel",this.eventHandlers.touchEnd),void this._updateIndicatorAndTriggerEvent(g))},_onTouchMoveHandler:function(a){var b,c,d,e=a._originalEvent&&a._originalEvent.touches,g=null,h=null,i=null;return e&&e.length>1||!r?(f.preventDefault(a),void f.stopPropagation(a)):(g=this._getPositionFromEvent(a),h=this.indexBar1,i=this.indexBar2,c=this._getEventReceiverByPosition(g.x),c===i&&(i.options.index=this.options.supplementaryIndex(h.getValueByIndex(h.selectedIndex)),i.refresh()),b=c.getIndexByPosition(g.y),d=c.getValueByIndex(b),c===i?d=h.getValueByIndex(h.selectedIndex)+d:i&&!i.isShown()&&i.setPaddingTop(h.getOffsetTopByIndex(h.selectedIndex)),c.select(b),c.show(),h===c&&i&&i.hide(),this._updateIndicatorAndTriggerEvent(d),f.preventDefault(a),void f.stopPropagation(a))},_onTouchEndHandler:function(a){var c=this,d=a._originalEvent&&a._originalEvent.touches;(d&&0===d.length||!d)&&(r=!1),c.indicator.hide(),c.indexBar1.clearSelected(),c.indexBar2&&(c.indexBar2.clearSelected(),c.indexBar2.hide()),b.removeEventListener(p,c.eventHandlers.touchMove),b.removeEventListener(q,c.eventHandlers.touchEnd),b.removeEventListener("touchcancel",c.eventHandlers.touchEnd)},_bindOnPageShow:function(){var a=this;a.eventHandlers.onPageShow=a.refresh.bind(a),a._ui.page&&a._ui.page.addEventListener(l.events.BEFORE_SHOW,a.eventHandlers.onPageShow,!1)},_unbindOnPageShow:function(){var a=this;a.eventHandlers.onPageShow&&a._ui.page&&a._ui.page.removeEventListener(l.events.BEFORE_SHOW,a.eventHandlers.onPageShow,!1)},_bindEvents:function(){var a=this;a._bindResizeEvent(),a._bindEventToTriggerSelectEvent(),a._bindOnPageShow()},_unbindEvent:function(){var a=this;a._unbindResizeEvent(),a._unbindEventToTriggerSelectEvent(),a._unbindOnPageShow()},_bindResizeEvent:function(){this.eventHandlers.onresize=function(){this.refresh()}.bind(this),a.addEventListener("resize",this.eventHandlers.onresize)},_unbindResizeEvent:function(){this.eventHandlers.onresize&&a.removeEventListener("resize",this.eventHandlers.onresize)},_bindEventToTriggerSelectEvent:function(){var a=this;a.eventHandlers.touchStart=a._onTouchStartHandler.bind(a),a.eventHandlers.touchEnd=a._onTouchEndHandler.bind(a),a.eventHandlers.touchMove=a._onTouchMoveHandler.bind(a),a.element.addEventListener(o,a.eventHandlers.touchStart)},_unbindEventToTriggerSelectEvent:function(){var a=this;a.element.removeEventListener(o,a.eventHandlers.touchStart)},_data:function(a,b){var c,d=this.element,e=d.__data;if(e||(e=d.__data={}),"object"==typeof a){for(c in a)a.hasOwnProperty(c)&&this._data(c,a[c]);return this}return"undefined"==typeof b?e[a]:(e[a]=b,this)},_isValidElement:function(a){return a.classList.contains(this.widgetClass)},_isExtended:function(){return!!this._data("extended")},_extended:function(a){return this._data("extended",a),this},_setIndex:function(a,b){var c=this.options;"string"==typeof b&&(b=b.split(c.delimiter)),c.index=b},_getOffset:function(a){var b=0,c=0;do c+=a.offsetTop,b+=a.offsetLeft,a=a.offsetParent;while(a);return{top:c,left:b}},_getContainer:function(){var a,c=this.options.container,d=this.element,e=d.parentNode;if(!c){for(;e&&e!==b.body;){if(a=i.getCSSProperty(e,"overflow-y"),"scroll"===a||"auto"===a&&e.scrollHeight>e.clientHeight)return e;e=e.parentNode}c=d.parentNode}return c||d.parentNode},_getPositionFromEvent:function(a){return-1!==a.type.search(/^touch/)?{x:a.touches[0].clientX,y:a.touches[0].clientY}:{x:a.clientX,y:a.clientY}},addEventListener:function(a,b){this.element.addEventListener(a,b)},removeEventListener:function(a,b){this.element.removeEventListener(a,b)}}),c.widget.core.IndexScrollbar=d}(a.document,d),function(a,b){var c=b.engine,d=b.widget.core.IndexScrollbar,e=new d,f=function(){d.call(this)};f.prototype=e,b.widget.wearable.IndexScrollbar=f,c.defineWidget("IndexScrollbar",".ui-indexscrollbar",[],f,"wearable")}(a.document,d),function(a,b){var c=b.widget.BaseWidget,d=b.engine,e=b.event,f=e.trigger,g=new c,h=function(){this._phase=null,this._tid={phaseOne:0,phaseThree:0},this._detent={phaseOne:0},this.options={},this._activeIndex=0},i={CW:"CW",CCW:"CCW"},j={SELECT:"select"},k={INDEXSCROLLBAR:"ui-circularindexscrollbar",INDICATOR:"ui-circularindexscrollbar-indicator",INDICATOR_TEXT:"ui-circularindexscrollbar-indicator-text",SHOW:"ui-circularindexscrollbar-show"};h.prototype=g,g._configure=function(){this.options={delimiter:",",index:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1"]}},g._build=function(b){var c,d;return c=a.createElement("div"),c.classList.add(k.INDICATOR),d=a.createElement("span"),d.classList.add(k.INDICATOR_TEXT),c.appendChild(d),b.appendChild(c),b.classList.add(k.INDEXSCROLLBAR),b},g._init=function(a){var b=this,c=b.options;return b._phase=1,b._setIndices(c.index),b._setValueByPosition(b._activeIndex,!0),a},g._setIndices=function(a){var c=this,d=c.options;return null===a?(b.warn("CircularIndexScrollbar must have indices."),void(d.index=null)):("string"==typeof a&&(a=a.split(d.delimiter)),void(d.index=a))},g._setValueByPosition=function(a,b){var c,d=this;d.options.index&&(c=d.element.querySelector("."+k.INDICATOR_TEXT),d._activeIndex=a,c.innerHTML=d.options.index[a],b&&f(d.element,j.SELECT,{index:d.options.index[a]}))},g._nextIndex=function(){var a,b=this,c=b._activeIndex,d=b.options.index.length;d-1>c&&(a=c+1,b._setValueByPosition(a,!0))},g._prevIndex=function(){var a,b=this,c=b._activeIndex;c>0&&(a=c-1,b._setValueByPosition(a,!0))},g._setValue=function(a){var b,c=this,d=c.options.index;d&&(b=d.indexOf(a))>=0&&c._setValueByPosition(b,!1)},g._getValue=function(){var a=this,b=a.options.index;return b?b[a._activeIndex]:null},g._rotary=function(a){var b=this,c=a.detail.direction;b.options.index&&(1===b._phase?b._rotaryPhaseOne():3===b._phase&&(a.stopPropagation(),b._rotaryPhaseThree(c)))},g._rotaryPhaseOne=function(){var a=this;clearTimeout(a._tid.phaseOne),a._tid.phaseOne=setTimeout(function(){1===a._phase&&(a._detent.phaseOne=0)},100),a._detent.phaseOne>3?(a._phase=3,clearTimeout(a._tid.phaseOne),a._detent.phaseOne=0):a._detent.phaseOne++},g._rotaryPhaseThree=function(a){var b=this;clearTimeout(b._tid.phaseThree),b._tid.phaseThree=setTimeout(function(){b.element.classList.remove(k.SHOW),b._phase=1},1e3),3===b._phase&&(b.element.classList.add(k.SHOW),a===i.CW?b._nextIndex():b._prevIndex())},g.handleEvent=function(a){var b=this;switch(a.type){case"rotarydetent":b._rotary(a)}},g._bindEvents=function(){var b=this;e.on(a,"rotarydetent",b)},g._unbindEvents=function(){var b=this;e.off(a,"rotarydetent",b)},g._refresh=function(){var a=this,b=a.options;a._unbindEvents(),a._setIndices(b.index),a._setValueByPosition(a._activeIndex,!0),a._bindEvents()},g._destroy=function(){var a=this;a._unbindEvents()},b.widget.wearable.CircularIndexScrollbar=h,d.defineWidget("CircularIndexScrollbar",".ui-circularindexscrollbar",[],h,"wearable")}(a.document,d),function(a,b){var c=b.widget.BaseWidget,d=b.engine,e=function(){return this},f=new c;e.events={},f._build=function(a){return a},f._init=function(a){return a},f._bindEvents=function(a){return a},f._refresh=function(){return null},f._destroy=function(){return null},e.prototype=f,b.widget.wearable.Progress=e,d.defineWidget("Progress","progress",[],e,"wearable")}(a.document,d),function(a,b){var c=b.widget.BaseWidget,d=b.engine,e=function(){return this},f=new c;e.events={},f._build=function(a){return a},f._init=function(a){return a},f._bindEvents=function(a){return a},f._refresh=function(){return null},f._destroy=function(){return null},e.prototype=f,b.widget.wearable.Progressing=e,d.defineWidget("Progressing",".ui-progress",[],e,"wearable")}(a.document,d),function(a,b){function c(a){return k[a]}function d(a,b){a.classList.add(c(b))}function e(b){return a.createElement(b)}var f=b.widget.BaseWidget,g=b.engine,h=function(){this.options={text:null}},i={},j="ui-switch",k={handler:j+"-handler",inneroffset:j+"-inneroffset",activation:j+"-activation",input:j+"-input",text:j+"-text"},l=new f;h.events=i,h.classes=k,l._build=function(a){var b,c=this.options,f=c.text,g=e("label"),h=e("input"),i=e("div"),j=e("div"),k=e("div");return f&&(b=e("div"),d(b,"text"),b.innerHTML=f,a.appendChild(b)),d(k,"handler"),j.appendChild(k),d(j,"inneroffset"),i.appendChild(j),d(i,"activation"),g.classList.add("ui-toggleswitch"),h.type="checkbox",d(h,"input"),g.appendChild(h),g.appendChild(i),a.appendChild(g),a},h.prototype=l,b.widget.wearable.ToggleSwitch=h,g.defineWidget("ToggleSwitch",".ui-switch",[],h,"wearable")}(a.document,d),function(a,b){function d(a,b){for(var c=a._renderList,d=0,e=c.length;e>d;d+=4)"propset"===c[d]&&(c[d+1][c[d+2]]=c[d+3]);0===e&&b-a._lastRenderClearTimestamp>a._lastRenderClearTTL&&(a._lastRenderClearTimestamp=b,a._sizeMap.length=0,a._avgListItemSize=-1),c.length=0}function e(a,b){var c=a._scroll,d=o,e=a._ui.scrollview,f=c.lastPositionX,g=c.lastPositionY,h=e.scrollLeft,i=b&&b.detail&&b.detail.scrollTop||e.scrollTop;a._refreshScrollbar(),g>i&&(d=p),f>h&&(d=s),i>g&&(d=q),h>f&&(d=r),c.lastJumpY=Math.abs(i-g),c.lastJumpX=Math.abs(h-f),c.lastPositionX=h,c.lastPositionY=i,c.dir=d,c.clipHeight=e.clientHeight,c.clipWidth=e.clientWidth}function f(a,b){return parseInt(b===t?a.clientHeight:a.clientWidth,10)}function g(a,b){var c,d,e,g,h,i,j=a.element,k=a.options,l=a._scroll,m=k.dataLength,n=a._avgListItemSize,o=k.bufferSize,p=!1;for(c=k.orientation===t?l.clipHeight:l.clipWidth,-1===n&&(a._avgListItemSize=n=f(j,k.orientation)/o),e=Math.floor((o-Math.floor(c/n))/2),i=0>=b-e?0:b-e,i+o>=m&&(i=m-o,0>i&&(i=0),p=!0),d=b-i,a._loadData(i),v=!0,h=i*n,k.orientation===t?(p&&(h=a._ui.spacer.clientHeight),a._addToRenderList("propset",j.style,"margin-top",h+"px")):(p&&(h=a._ui.spacer.clientWidth),a._addToRenderList("propset",j.style,"margin-left",h+"px")),g=0;d>g;g+=1)h+=f(j.children[g],k.orientation);k.orientation===t?A.isElement(a._ui.scrollview)?A.scrollTo(h):a._ui.scrollview.scrollTop=h:a._ui.scrollview.scrollLeft=h,v=!1,a._currentIndex=i}function h(a,b,c,d,e,f,g){var h,i,j=0;if(f>0){for(i=g;i>0;i--)h=b.firstElementChild,c.appendChild(h),a._updateListItem(h,e),b.appendChild(h),j+=d(h,e++);a._currentIndex+=g}else{for(i=g;i>0;i--)h=b.lastElementChild,c.appendChild(h),a._updateListItem(h,e),b.insertBefore(h,b.firstElementChild),j-=d(h,e--);a._currentIndex-=g}return j}function i(a,b,c,d,e,f,g){var h,i=0===(2&d),j=1===(2&d),k=a._currentIndex;i&&(h=f+e,0>=k&&(a._currentIndex=k=0,h=0),k>=b-1&&(h=a._ui.spacer.clientHeight),0>h&&(h=0),a._addToRenderList("propset",c,"margin-top",h+"px")),j&&(h=g+e,0>=k&&(a._currentIndex=k=0,h=0),k>=b-1&&(h=a._ui.spacer.clientWidth),0>h&&(h=0),a._addToRenderList("propset",c,"margin-left",h+"px"))}function j(a,b){for(var c=0,d=a.length;--d>=0;)c+=a[d][b];return c}function k(a,b,d,e){return a[e]===c&&(a[e]=b?d.clientWidth:d.clientHeight),a[e]}function l(a){var b,c,d,e,g=a.element,l=a._scroll,m=a.options,n=g.style,u=a._currentIndex,v=parseInt(m.bufferSize,10),w=m.dataLength,x=l.dir,y=l.lastPositionY,z=l.lastPositionX,A=parseInt(n.marginTop,10)||0,B=parseInt(n.marginLeft,10)||0,C=0,D=a._domBuffer,E=a._avgListItemSize,F=j(g.children,m.orientation===t?"clientHeight":"clientWidth"),G=a._sizeMap,H=0,I=0;switch(-1===E&&(a._avgListItemSize=E=f(g,m.orientation)/v),x){case o:break;case q:I=y-A,C=w-u-v;break;case p:I=A+F-(y+l.clipHeight),C=u;break;case s:I=z-B,C=w-u-v;break;case r:I=B+F-(z-l.clipWidth),C=u}I>0&&2>=F/I&&(b=I/E-(v-l.clipHeight/E)/5|0|0,b=Math.min(C,b),c=b/v|0,b%=v,d=x===q||x===s?1:-1,c>0&&(a._loadData(u+d*c*v),u=a._currentIndex,H+=d*c*v*E),e=u+(d>0?v:-1),H+=h(a,g,D,k.bind(null,G,2&x),e,d,b),i(a,w,n,x,H,A,B))}function m(a,b){var c=a._scroll;e(a,b),(c.lastJumpY>0||c.lastJumpX>0&&!v)&&(l(a),z.trigger(a.element,"vlistupdate"))}var n=b.widget.BaseWidget,o=-1,p=0,q=1,r=2,s=3,t="y",u="x",v=!1,w=b.util,x=w.requestAnimationFrame,y=w.selectors,z=b.event,A=b.util.scrolling,B=function(){var b=this;return b._ui={scrollview:null,spacer:null,itemSize:0},b._scroll={direction:[0,0,0,0],dir:o,lastPositionX:0,lastPositionY:0,lastJumpX:0,lastJumpY:0,clipWidth:0,clipHeight:0},b.name="VirtualListview",b._currentIndex=0,b.options={bufferSize:100,dataLength:0,orientation:t,listItemUpdater:null,scrollElement:null,optimizedScrolling:!1},b._scrollEventBound=null,b._render=d.bind(null,this),b._renderList=[],b._sizeMap=[],b._domBuffer=a.createDocumentFragment(),b._lastRenderClearTimestamp=0,b._lastRenderClearTTL=1e4,b._avgListItemSize=-1,b},C=new n;B.classes={uiVirtualListContainer:"ui-virtual-list-container",spacer:"ui-virtual-list-spacer"},C._updateListItem=function(a,b){this.options.listItemUpdater(a,b)},C._setupScrollview=function(a,b){var c,d=y.getClosestByClass(a,"ui-scroller")||a.parentElement;return c=d.style,b===u?(c.overflowX="scroll",c.overflowY="hidden"):(c.overflowX="hidden",c.overflowY="scroll"),d},C._getScrollView=function(a,b){var c=null;return a.scrollElement&&(c="string"==typeof a.scrollElement?y.getClosestBySelector(b,"."+a.scrollElement):a.scrollElement),c||(c=this._setupScrollview(b,a.orientation)),c},C._build=function(b){var c,d,e,f=this,g=f._ui,h=B.classes,i=f.options,j=a.createElement("div");return b.style.position="relative",b.classList.add(h.uiVirtualListContainer),e=i.orientation.toLowerCase()===u?u:t,c=f._getScrollView(i,b),j.classList.add(h.spacer),d=j.style,d.display="block",d.position="static",e===u&&(d["float"]="left"),c.appendChild(j),g.spacer=j,g.scrollview=c,i.orientation=e,b},C._init=function(a){var b,c,d=this,e=d._ui,f=d.options,g=d.scrollview||d._getScrollView(f,a);f.dataLength<f.bufferSize&&(f.bufferSize=f.dataLength),f.bufferSize<1&&(f.bufferSize=1),b=a.getBoundingClientRect(),c=g.getBoundingClientRect(),d._initTopPosition=b.top-c.top,d._initLeftPosition=b.left-c.left,g.classList.add("ui-has-virtual-list"),e.spacer=e.spacer||g.querySelector("."+B.classes.spacer),e.scrollview=g,f.orientation=f.orientation.toLowerCase()===u?u:t,f.optimizedScrolling&&(A.enable(g,f.orientation),A.enableScrollBar())},C._buildList=function(){var b,c,d=this,e=d.element,f=d.options,g="UL"===e.tagName||"OL"===e.tagName||"TAU-VIRTUALLISTVIEW"===e.tagName?"li":"div",h=f.bufferSize,i=d._domBuffer,j=f.orientation;for(c=0;h>c;++c)b=a.createElement(g),j===u&&(b.style["float"]="left"),d._updateListItem(b,c),i.appendChild(b);e.appendChild(i),this._refresh()},C._refresh=function(){this._refreshScrollbar()},C._loadData=function(a){var b=this,c=b.element.firstElementChild;if(b._currentIndex!==a){b._currentIndex=a;do b._updateListItem(c,a),++a,c=c.nextElementSibling;while(c)}},C._refreshScrollbar=function(){var a,b,c=this,d=c.element,e=c.options,f=c._ui,g=f.spacer.style;e.orientation===t?(a=parseFloat(d.clientHeight)||0,b=a/e.bufferSize*e.dataLength,e.optimizedScrolling?A.setMaxScroll(b):c._addToRenderList("propset",g,"height",b-a+"px")):(a=parseFloat(d.clientWidth)||0,b=a/e.bufferSize*e.dataLength,e.optimizedScrolling?A.setMaxScroll(b):c._addToRenderList("propset",g,"width",a/e.bufferSize*(e.dataLength-1)-4/3*a+"px"))},C._addToRenderList=function(){var a=this,b=a._renderList;b.push.apply(b,arguments),x(a._render)},C._bindEvents=function(){var a=m.bind(null,this),b=this._ui.scrollview;b&&(b.addEventListener("scroll",a,!1),this._scrollEventBound=a)},C._destroy=function(){var a=this,b=a._ui.scrollview,c=a._ui.spacer,d=a.element,e=d.style;for(e.position="static",a.options.orientation===t?e.top="auto":e.left="auto",b&&(A.disable(b),b.removeEventListener("scroll",a._scrollEventBound,!1)),c.parentNode&&c.parentNode.removeChild(c);d.firstElementChild;)d.removeChild(d.firstElementChild)},C.scrollTo=function(a){var b=this;A.isElement(b._ui.scrollview)?A.scrollTo(a):b._ui.scrollview.scrollTop=a},C.scrollToIndex=function(a){0>a&&(a=0),a>=this.options.dataLength&&(a=this.options.dataLength-1),e(this),g(this,a)},C.draw=function(){this._buildList(),this.trigger("draw")},C.setListItemUpdater=function(a){this.options.listItemUpdater=a},B.prototype=C,b.widget.core.VirtualListview=B}(a.document,d),function(a,b){var c=b.widget.core.VirtualListview;c.prototype=new c,b.widget.wearable.VirtualListview=c,b.engine.defineWidget("VirtualListview","",["draw","setListItemUpdater","scrollTo","scrollToIndex"],c,"wearable")}(a.document,d),function(a,b,c){function d(a,c){var d=c.detail,e=d.selector,f=-1;e.indexOf(j)>-1&&(d.selector=e=e.replace(k,function(b,c,d){return c&&d?(f=0|d,"#"+a.id+" [data-index='"+f+"']"):b}),f>-1&&(a.scrollToIndex(f),d.nextElement=b.querySelector(e),c.preventDefault()))}var e=c.widget.wearable.VirtualListview,f=c.engine,g=c.util.DOM,h="x",i="y",j="::virtualgrid",k=/(::virtualgrid\((\d+)\))/gi,l=function(){return this.options={bufferSize:100,dataLength:0,orientation:i,listItemUpdater:function(){return null}},this._onFocusQuery=null,this},m=new e,n=e.prototype,o=n.draw,p=n._refreshScrollbar,q=n._bindEvents,r=n._destroy;m.draw=function(){var a=this,c=a.element,d=a._ui,e=null,f=null;a.options.orientation===h&&(e=b.createElement("div"),f=e.style,c.parentNode.appendChild(e),e.appendChild(c),e.appendChild(d.spacer),f.width="10000px",f.height="100%",d.container=e),a._initListItem(),o.call(a)},m._bindEvents=function(a){var b=this;q.call(b,a),b._onFocusQuery=d.bind(null,b),b.element.addEventListener("focusquery",b._onFocusQuery)},m._destroy=function(a){var b=this;r.call(b,a),b.element.removeEventListener("focusquery",b._onFocusQuery)},m._refreshScrollbar=function(){var a=0,b=this._ui;p.call(this),b.container&&(a=this.element.clientWidth+b.spacer.clientWidth,b.container.style.width=a+"px")},m._initListItem=function(){var a=this,c=a.element,d=b.createElement("div"),e=b.createElement("div"),f=d.style,h=a.options.orientation,j=c.style,k=e.style;f.overflow="hidden",e.style.overflow="hidden",c.appendChild(e),e.appendChild(d),a.options.listItemUpdater(d,0),h===i?(j.overflowY="auto",j.overflowX="hidden",k.overflow="hidden",d.style["float"]="left",a._cellSize=g.getElementWidth(d),a._columnsCount=Math.floor(g.getElementWidth(c)/a._cellSize)):(j.overflowX="auto",j.overflowY="hidden",k.overflow="hidden",k["float"]="left",j.height="100%",k.height="100%",a._cellSize=g.getElementHeight(d),a._columnsCount=Math.floor(g.getElementHeight(c)/a._cellSize)),c.removeChild(e),a.options.originalDataLength=a.options.dataLength,a.options.dataLength/=a._columnsCount},m._updateListItem=function(a,c){var d,e,f,g,j,k=a.style,l=this.options;for(a.innerHTML="",k.overflow="hidden",k.position="relative",l.orientation===h&&(k.height="100%"),f=this._columnsCount,j=100/f,e=0;f>e;e++)d=b.createElement("div"),g=d.style,g.overflow="hidden",d.setAttribute("data-index",f*c+e),l.orientation===i?(d.style["float"]="left",d.style.width=j+"%"):d.style.height=j+"%",f*c+e<l.originalDataLength&&this.options.listItemUpdater(d,f*c+e,f),a.appendChild(d)},l.prototype=m,c.widget.wearable.VirtualGrid=l,f.defineWidget("VirtualGrid",".ui-virtualgrid",[],l)}(a,a.document,d),function(a,b,d){function e(a){var b=a._selectedIndex;null!==b&&(a._listItems[b].element.classList.remove(E.SNAP_LISTVIEW_SELECTED),
a._selectedIndex=null)}function f(a){return"none"!==a.element.style.display}function g(b){var c=b.querySelector(".ui-content"),d=0;return c&&(d=parseInt(a.getComputedStyle(c).marginTop,10)),-b.firstElementChild.getBoundingClientRect().top+d}function h(a){var b,d,h,i,j=a._ui,k=a._listItems,l=j.scrollableParent,m=l.height||j.page.offsetHeight,n=l.element||j.page,o=g(n)+m/2,p=k.length,q=a._selectedIndex;for(h=0;p>h;h++)if(b=k[h],d=b.coord,f(b)&&d.top<o&&d.top+d.height>=o){i=h;break}i!==q&&i!==c&&(e(a),a._selectTimeout&&clearTimeout(a._selectTimeout),a._selectTimeout=setTimeout(function(){var b=a._listItems&&a._listItems[i].element;b&&(a._selectedIndex=i,b.classList.add(E.SNAP_LISTVIEW_SELECTED),u.trigger(b,z.SELECTED))},300))}function i(a){a._isTouched===!1&&(a._isScrollStarted=!1,u.trigger(a.element,z.SCROLL_END),h(a))}function j(b){var c=b._callbacks,d=c.scrollEnd;b._isScrollStarted||(b._isScrollStarted=!0,u.trigger(b.element,z.SCROLL_START),b._scrollEventCount=0),b._scrollEventCount++,(b._scrollEventCount>2||b._isTouched===!0)&&e(b),b._listItemAnimate(),b._isTouched===!1&&(a.clearTimeout(b._scrollEndTimeoutId),b._scrollEndTimeoutId=a.setTimeout(d,F))}function k(a){a._isTouched=!0}function l(a){a._isTouched=!1,h(a)}function m(a){for(var c;a&&a!==b.body;){if(y.isElement(a))return a;if(c=w.getCSSProperty(a,"overflow-y"),"scroll"===c||"auto"===c&&a.scrollHeight>a.clientHeight)return a;a=a.parentNode}return null}function n(b,c){var d,e,f=b._listItems,g=b._selectedIndex;d=p(c.target,b.element),d&&d.classList.contains(E.SNAP_LISTVIEW_SELECTED)||(e=o(d,f),u.preventDefault(c),u.stopPropagation(c),e>-1&&null!==g&&(g>e?u.trigger(a,"rotarydetent",{direction:"CCW"},!0):e>g&&u.trigger(a,"rotarydetent",{direction:"CW"},!0)))}function o(a,b){var c,d=b.length;for(c=0;d>c;c++)if(b[c].element===a)return c;return-1}function p(a,b){for(var d=a;d.parentNode&&d!==b;){if(d.classList.contains(E.SNAP_LISTVIEW_ITEM))return d;d=d.parentNode}return c}function q(a,b,c,d){return function(a){var c=1-a,e=3*c,f=a*a,g=f*a,h=e*a*c,i=e*f;return h*b+i*d+g}}function r(b,c,d,e,f){var g=q(.25,.46,.45,1),h=0,i=0,j=0,k=0,l=d-c,m=b.scrollTop,n=B.animationTimer;h=a.performance.now(),null!==n&&a.cancelAnimationFrame(n),n=a.requestAnimationFrame(function o(){var c;i=a.performance.now(),j=(i-h)/e,k=g(j),c=l*k,b.scrollTop=m+c,1>=j&&j>=0?n=a.requestAnimationFrame(o):(n=null,f&&"function"==typeof f&&f())})}var s=d.widget.BaseWidget,t=d.engine,u=d.event,v=d.util,w=v.DOM,x=v.selectors,y=v.scrolling,z={SCROLL_START:"scrollstart",SCROLL_END:"scrollend",SELECTED:"selected"},A=d.util.array,B=function(){var a=this;a._ui={page:null,scrollableParent:{element:null,height:0},childItems:{}},a.options={selector:"li:not(.ui-listview-divider)",animate:"none",scale:{from:.67,to:1},opacity:{from:.7,to:1}},a._listItems=[],a._callbacks={},a._scrollEndTimeoutId=null,a._isScrollStarted=!1,a._selectedIndex=null,a._currentIndex=null,a._enabled=!0,a._isTouched=!1,a._scrollEventCount=0},C=new s,D="ui-snap-listview",E={SNAP_CONTAINER:"ui-snap-container",SNAP_DISABLED:"ui-snap-disabled",SNAP_LISTVIEW:D,SNAP_LISTVIEW_SELECTED:D+"-selected",SNAP_LISTVIEW_ITEM:D+"-item"},F=0;B.classes=E,B.animationTimer=null,B.ListItem=function(a,b){var c,d;a.classList.add(E.SNAP_LISTVIEW_ITEM),c=a.offsetTop,d=a.offsetHeight,this.element=a,this.rate=-1,this.coord={top:c,height:d},this.position={begin:c-b,start:c-b+d,stop:c,end:c+d}},B.ListItem.prototype={animate:function(a,b){var c,d=this.element,e=this.position,f=e.begin,g=e.end,h=e.start,i=e.stop;c=a>=h&&i>=a?Math.min(1,Math.abs((a-h)/(i-h))):a>f&&h>a||g>a&&a>i?0:-1,this.rate!==c&&(b(d,c),this.rate=c)}},C._listItemAnimate=function(){var a,b=this,c=b.options.animate,d=b._callbacks[c],e=b._ui.scrollableParent.element||b._ui.page;d&&(a=g(e),A.forEach(b._listItems,function(b){b.animate(a,d)}))},C._initSnapListview=function(a){var c,d,e,f=this,g=f._ui,h=a.firstElementChild.getBoundingClientRect().height;g.page=x.getClosestByClass(a,"ui-page")||b.body,c=m(a),c&&(y.isElement(c)||y.enable(c,"y"),e=a.getBoundingClientRect().top-c.getBoundingClientRect().top-h/2,y.setMaxScroll(c.firstElementChild.getBoundingClientRect().height+e),y.setSnapSize(h),c.classList.add(E.SNAP_CONTAINER),g.scrollableParent.element=c,d=c.clientHeight,g.scrollableParent.height=d)},C._refreshSnapListview=function(a){var b,c=this,d=c._ui,e=c.options,f=[],g=d.scrollableParent.element;g||c._initSnapListview(a),b=d.scrollableParent.height||d.page.offsetHeight,c._selectedIndex=null,A.forEach(a.querySelectorAll(e.selector),function(a,d){f.push(new B.ListItem(a,b)),a.classList.contains(E.SNAP_LISTVIEW_SELECTED)&&(c._selectedIndex=d,c._currentIndex=d)}),c._listItems=f,c._listItemAnimate()},C._build=function(a){var b=a.classList;return t.getBinding(a,"Listview")?(d.warn("Can't create SnapListview on Listview element"),null):(b.contains(E.SNAP_LISTVIEW)||b.add(E.SNAP_LISTVIEW),a)},C._init=function(a){var b=this,c=this.options,d=c.scale.from,e=c.scale.to,f=c.opacity.from,g=c.opacity.to;return b._callbacks={scroll:j.bind(null,b),scrollEnd:i.bind(null,b),scale:function(a,b){var c,h;return 0>b?(a.style.webkitTransform="",void(a.style.opacity="")):(b=b>.5?1-b:b,c=d+(e-d)*b*2,h=f+(g-f)*b*2,a.style.webkitTransform="scale3d("+c+","+c+","+c+")",void(a.style.opacity=h))}},b._refreshSnapListview(a),h(b),a},C._refresh=function(){var a=this,b=a.element;return a._refreshSnapListview(b),h(a),null},C._bindEvents=function(){var a=this,b=a.element,c=a._ui.scrollableParent.element;a._callbacks.touchstart=k.bind(null,a),a._callbacks.touchend=l.bind(null,a),a._callbacks.vclick=n.bind(null,a),c&&u.on(c,"scroll",this._callbacks.scroll,!1),b.addEventListener("touchstart",a._callbacks.touchstart,!1),b.addEventListener("touchend",a._callbacks.touchend,!1),b.addEventListener("vclick",a._callbacks.vclick,!1)},C._unbindEvents=function(){var a=this,b=a.element,c=a._ui.scrollableParent.element;c&&u.off(c,"scroll",this._callbacks.scroll,!1),b.removeEventListener("touchstart",a._callbacks.touchstart,!1),b.removeEventListener("touchend",a._callbacks.touchend,!1),b.removeEventListener("vclick",a._callbacks.vclick,!1)},C._destroy=function(){var b=this;return b._unbindEvents(),b._ui=null,b._callbacks=null,b._listItems=null,b._isScrollStarted=null,b._scrollEndTimeoutId&&a.clearTimeout(b._scrollEndTimeoutId),b._scrollEndTimeoutId=null,b._selectedIndex=null,b._currentIndex=null,y.disable(),null},C._enable=function(){var a=this,b=a._ui.scrollableParent.element||a._ui.page;b.classList.remove(E.SNAP_DISABLED),a._enabled||(a._enabled=!0,a._refresh())},C._disable=function(){var a=this,b=a._ui.scrollableParent.element;b.classList.add(E.SNAP_DISABLED),a._enabled=!1},C.getSelectedIndex=function(){return this._currentIndex||this._selectedIndex},C.scrollToPosition=function(a){return this._scrollToPosition(a)},C._scrollToPosition=function(a,b){var c,d,g=this,h=g._ui,i=g._enabled,j=g._listItems,k=h.scrollableParent,l=j.length,m=j[a];return!i||0>a||a>=l||g._currentIndex===a||!f(m)?!1:(g._currentIndex=a,e(g),c=j[a].coord,d=c.top-k.height/2+c.height/2,r(k.element,-k.element.firstElementChild.getBoundingClientRect().top,d,450,b),!0)},B.prototype=C,d.widget.wearable.SnapListview=B,t.defineWidget("SnapListview",".ui-snap-listview",[],B,"wearable")}(a,a.document,d),function(a){var b=a.event.gesture,c=b.Result,d=b.Detector,e=d.plugin.create({name:"swipe",index:400,defaults:{timeThreshold:400,velocity:.6,orientation:b.Orientation.HORIZONTAL},handler:function(a,d,e){var f=c.PENDING,g=e.velocity;return a.eventType===b.Event.END&&(a.deltaTime>e.timeThreshold||e.orientation!==b.utils.getOrientation(a.direction)?f=c.FINISHED:(a.velocityX>g||a.velocityY>g)&&(d.sendEvent(this.name,a),f=c.FINISHED|c.BLOCK)),f}});b.Swipe=e}(d),function(b,d){var e=d.event.gesture,f=d.event,g=d.engine,h=d.util.DOM,i=d.util.selectors,j={LEFT:"swipelist.left",RIGHT:"swipelist.right"},k=function(){this.container=null,this.swipeElement=null,this.swipeLeftElement=null,this.swipeRightElement=null,this.swipeElementStyle=null,this.swipeLeftElementStyle=null,this.swipeRightElementStyle=null,this.activeElement=null,this.activeTarget=null,this.resetLayoutCallback=null,this.options={},this._interval=0,this._cancelled=!1,this._dragging=!1,this._animating=!1},l=new d.widget.BaseWidget,m=function(a){a.preventDefault()};l._configure=function(){this.options={threshold:10,animationThreshold:150,animationDuration:200,animationInterval:8,container:null,swipeTarget:"li",swipeElement:".ui-swipelist",swipeLeftElement:".ui-swipelist-left",swipeRightElement:".ui-swipelist-right",ltrStartColor:"",ltrEndColor:"",rtlStartColor:"",rtlEndColor:""}},l._init=function(a){var b,e,f=i.getClosestBySelector(a,"."+d.widget.core.Page.classes.uiPage),g=this.options,j=/rgb\(([0-9]+), ([0-9]+), ([0-9]+)\)/g;g.container?this.container=f.querySelector(g.container):this.container=a.parentNode,this.scrollableElement=i.getScrollableParent(a),this.scrollableElement||(this.scrollableElement=this.container),this.swipeElement=f.querySelector(g.swipeElement),this.swipeLeftElement=g.swipeLeftElement?f.querySelector(g.swipeLeftElement):c,this.swipeRightElement=g.swipeRightElement?f.querySelector(g.swipeRightElement):c,this.swipeElement&&(this.swipeElementStyle=this.swipeElement.style,this.swipeElementStyle.display="none",this.swipeElementStyle.background="transparent",this.swipeElementStyle.width=this.scrollableElement.offsetWidth+"px",this.swipeElementStyle.height=this.scrollableElement.offsetHeight+"px"),this.swipeLeftElement&&(this.swipeLeftElementStyle=this.swipeLeftElement.style,this.swipeLeftElementStyle.display="none",b=this.swipeLeftElement?h.getCSSProperty(this.swipeLeftElement,"background-image").match(j):c),this.swipeRightElement&&(this.swipeRightElementStyle=this.swipeRightElement.style,this.swipeRightElementStyle.display="none",e=this.swipeRightElement?h.getCSSProperty(this.swipeRightElement,"background-image").match(j):c),b&&(g.ltrStartColor=g.ltrStartColor||b[0],g.ltrEndColor=g.ltrEndColor||b[1]),e&&(g.rtlStartColor=g.rtlStartColor||e[0],g.rtlEndColor=g.rtlEndColor||e[1]),this.resetLayoutCallback=null,this.swipeElement.parentNode!==this.container&&(this.resetLayoutCallback=function(a,b,c){return function(){try{b?a.insertBefore(c,b):a.appendChild(c)}catch(d){c.parentNode.removeChild(c)}}}(this.swipeElement.parentNode,this.swipeElement.nextElementSibling,this.swipeElement),this.container.appendChild(this.swipeElement))},l._reset=function(){this.container.style.position="",this.swipeElementStyle.display="",this.swipeElementStyle.background="",this.swipeElementStyle.width="",this.swipeElementStyle.height="",this.swipeLeftElementStyle.display="",this.swipeLeftElementStyle.background="",this.swipeRightElementStyle.display="",this.swipeRightElementStyle.background="",this.resetLayoutCallback&&this.resetLayoutCallback(),this._unbindEvents()},l._bindEvents=function(){d.event.enableGesture(this.element,new e.Drag({threshold:this.options.threshold,blockVertical:!0}),new e.Swipe({orientation:e.Orientation.HORIZONTAL})),f.on(this.element,"drag dragstart dragend dragcancel swipe",this),f.on(b,"scroll touchcancel",this),f.on(this.swipeElement,"touchstart touchmove touchend",m,!1)},l._unbindEvents=function(){d.event.disableGesture(this.element),f.off(this.element,"drag dragstart dragend dragcancel swipe",this),f.off(b,"scroll touchcancel",this),f.off(this.swipeElement,"touchstart touchmove touchend",m,!1)},l.handleEvent=function(a){switch(a.type){case"dragstart":this._start(a);break;case"drag":this._move(a);break;case"dragend":this._end(a);break;case"swipe":this._swipe(a);break;case"dragcancel":case"scroll":this._cancel()}},l._translate=function(b,c,d){var e,f,g,h=c/a.innerWidth*100,i=this;this.swipeLeftElement&&c>=0?(e=i.options.ltrStartColor,f=i.options.ltrEndColor,g="left"):this.swipeRightElement&&0>c&&(e=i.options.rtlStartColor,f=i.options.rtlEndColor,g="right",h=Math.abs(h)),function j(){b.background="-webkit-linear-gradient("+g+", "+e+" 0%, "+f+" "+h+"%)",d&&h<i.options.animationDuration?(i._animating=!0,h+=i.options.animationInterval,a.webkitRequestAnimationFrame(j)):d&&h>=i.options.animationDuration&&(i._animating=!1,i._transitionEnd())}()},l._findSwipeTarget=function(a){for(var b=this.options.swipeTarget;a&&a.webkitMatchesSelector&&!a.webkitMatchesSelector(b);)a=a.parentNode;return a},l._fireEvent=function(a,b){var c=this.activeTarget||this.listElement;f.trigger(c,a,b)},l._start=function(a){var b,c,d,e=a.detail;this._dragging=!1,this._cancelled=!1,this.activeTarget=this._findSwipeTarget(e.srcEvent.target),this.activeTarget&&(b=this.activeTarget.offsetWidth,c=this.activeTarget.offsetHeight,d=this.activeTarget.offsetTop-this.scrollableElement.scrollTop,this.swipeLeftElementStyle&&(this.swipeLeftElementStyle.width=b+"px",this.swipeLeftElementStyle.height=c+"px",this.swipeLeftElementStyle.top=d+"px"),this.swipeRightElementStyle&&(this.swipeRightElementStyle.width=b+"px",this.swipeRightElementStyle.height=c+"px",this.swipeRightElementStyle.top=d+"px"),this._dragging=!0)},l._move=function(a){var b,c=a.detail,d=c.estimatedDeltaX;this._dragging&&!this._cancelled&&(this.swipeLeftElement&&c.direction===e.Direction.RIGHT&&d>=0?(this.swipeRightElementStyle&&(this.swipeRightElementStyle.display="none"),this.activeElement=this.swipeLeftElement,b=this.swipeLeftElementStyle):this.swipeRightElement&&c.direction===e.Direction.LEFT&&0>d&&(this.swipeLeftElementStyle&&(this.swipeLeftElementStyle.display="none"),this.activeElement=this.swipeRightElement,b=this.swipeRightElementStyle),b&&(b.display="block",this.swipeElementStyle.display="block",this._translate(b,d,!1)))},l._end=function(a){var b=a.detail;this._dragging&&!this._cancelled&&(this.swipeLeftElement&&b.estimatedDeltaX>this.options.animationThreshold?this._fire(j.LEFT,a):this.swipeRightElement&&b.estimatedDeltaX<-this.options.animationThreshold?this._fire(j.RIGHT,a):this._hide(),this._dragging=!1)},l._swipe=function(a){var b=a.detail;this._dragging&&!this._cancelled&&(this.swipeLeftElement&&b.direction===e.Direction.RIGHT?this._fire(j.LEFT,a):this.swipeRightElement&&b.direction===e.Direction.LEFT?this._fire(j.RIGHT,a):this._hide(),this._dragging=!1)},l._fire=function(a,b){var c=b.detail;a===j.LEFT?this._translate(this.swipeLeftElementStyle,c.estimatedDeltaX,!0):a===j.RIGHT&&this._translate(this.swipeRightElementStyle,c.estimatedDeltaX,!0)},l._transitionEnd=function(){this._hide(),this.activeElement===this.swipeLeftElement?this._fireEvent(j.LEFT):this.activeElement===this.swipeRightElement&&this._fireEvent(j.RIGHT)},l._cancel=function(){this._dragging=!1,this._cancelled=!0,this._hide()},l._hide=function(){this.swipeElementStyle&&(this.swipeElementStyle.display="none"),this.activeElement&&(this.activeElement.style.display="none")},l._destroy=function(){this._reset(),this.element=null,this.container=null,this.swipeElement=null,this.swipeLeftElement=null,this.swipeRightElement=null,this.swipeElementStyle=null,this.swipeLeftElementStyle=null,this.swipeRightElementStyle=null,this.activeElement=null,this.activeTarget=null,this.startX=null,this.options=null,this.gesture=null,this._cancelled=null,this._dragging=null,this._animating=null},k.prototype=l,d.widget.wearable.SwipeList=k,g.defineWidget("SwipeList",".ui-swipe",[],k)}(a.document,d),function(a){var b=a.event.gesture,c=b.Detector,d=c.plugin.create({name:"longpress",index:600,defaults:{longPressTimeThreshold:750,longPressDistanceThreshold:20,preventClick:!0},isTriggered:!1,longPressTimeOutId:0,handler:function(a,c,d){var e=b.Result.PENDING;switch(a.eventType){case b.Event.START:this.isTriggered=!1,this.longPressTimeOutId=setTimeout(function(){this.isTriggered=!0,c.sendEvent(this.name,a)}.bind(this),d.longPressTimeThreshold);break;case b.Event.MOVE:a.distance>d.longPressDistanceThreshold&&!this.isTriggered&&(clearTimeout(this.longPressTimeOutId),e=b.Result.FINISHED);break;case b.Event.END:this.isTriggered?d.preventClick&&a.preventDefault():clearTimeout(this.longPressTimeOutId),e=b.Result.FINISHED}return e}});b.LongPress=d}(d),function(b,d){function e(a,c,d){var e,g,h,i=[];for(f(a,d),h=c.length,g=0;h>g;g++)g%d.maxItemNumber||(e=b.createElement("div"),e.classList.add(u.LAYER),a.appendChild(e),i.push(e)),e&&(e.appendChild(c[g]),o.getNSData(c[g],"active")&&(c[g].classList.add(u.ITEM_ACTIVE),e.classList.add(u.LAYER_ACTIVE)));return i}function f(a,b){var c,d,e,f,g,h=a.getElementsByClassName(u.LAYER);if(h.length)for(e=h.length,d=0;e>d;d++){for(c=h[0].querySelectorAll(b.itemSelector),g=c.length,f=0;g>f;f++)a.appendChild(c[f]);a.removeChild(h[0])}}function g(a){var c=a.element;q.enableGesture(c,new p.Drag,new p.LongPress,new p.Swipe({orientation:p.Orientation.HORIZONTAL})),q.on(b,"rotarydetent",a,!1),q.on(b,"swipe",a,!0),a.on("dragstart drag dragend click longpress mouseup touchend transitionend animationend webkitAnimationEnd",a,!1)}function h(a){var c=a.element;q.disableGesture(c),q.off(b,"rotarydetent",a,!1),q.off(b,"swipe",a,!0),a.off("dragstart drag dragend click longpress mouseup touchend transitionend animationend webkitAnimationEnd",a,!1)}function i(a){var b=a.previousElementSibling,c=a.nextElementSibling;b&&b.classList.remove(u.LAYER_PREV),c&&c.classList.remove(u.LAYER_NEXT),a.classList.remove(u.LAYER_ACTIVE)}function j(a){var b=a.previousElementSibling,c=a.nextElementSibling;b&&b.classList.contains(u.LAYER)&&b.classList.add(u.LAYER_PREV),c&&c.classList.contains(u.LAYER)&&c.classList.add(u.LAYER_NEXT),a.classList.add(u.LAYER_ACTIVE),a.style.transform="none"}function k(a,b,c,d,e){a.style.transform="rotate("+b+"deg) translate3d(0, "+-c+"px, 0) rotate("+d+"deg) "+e}function l(a,b){a.style.transform="rotate("+b+"deg) translate3d(0, 0, 0)",a.style.transition="transform 300ms"}function m(a,c){var d,e,f,g;d=b.createElement("div"),d.classList.add(u.INDICATOR),a.indicator=d,g=b.createElement("div"),g.classList.add(u.INDICATOR_ICON),a.indicatorIcon=g,a.indicator.appendChild(a.indicatorIcon),e=b.createElement("div"),e.classList.add(u.INDICATOR_TEXT),a.indicatorText=e,d.appendChild(e),f=b.createElement("div"),f.classList.add(u.INDICATOR_SUBTEXT),a.indicatorSubText=f,a.indicator.appendChild(a.indicatorSubText),c.appendChild(a.indicator)}var n=d.engine,o=d.util.DOM,p=d.event.gesture,q=d.event,r=d.util.object,s=a.requestAnimationFrame||a.webkitRequestAnimationFrame,t=function(){var a=this;a._ui={},a.options={editable:!1,plusButton:!0},a._editModeEnabled=!1,a._movedElementIndex=null,a._destinationIndex=null,a._pointedLayer=null,a._changeLayerInterval=null,a._itemsToReorder=[],a._removedItemIndex=null,a._reorderEnd=null,a._reorderAnimationEnd=null},u={SELECTOR:"ui-selector",LAYER:"ui-layer",LAYER_ACTIVE:"ui-layer-active",LAYER_PREV:"ui-layer-prev",LAYER_NEXT:"ui-layer-next",LAYER_HIDE:"ui-layer-hide",ITEM:"ui-item",ITEM_ACTIVE:"ui-item-active",ITEM_REMOVABLE:"ui-item-removable",ITEM_ICON_REMOVE:"ui-item-icon-remove",ITEM_ICON_REMOVE_BG:"ui-item-icon-remove-bg",INDICATOR:"ui-selector-indicator",INDICATOR_ACTIVE:"ui-selector-indicator-active",INDICATOR_TEXT:"ui-selector-indicator-text",INDICATOR_ICON:"ui-selector-indicator-icon",INDICATOR_ICON_ACTIVE:"ui-selector-indicator-icon-active",INDICATOR_ICON_ACTIVE_WITH_TEXT:"ui-selector-indicator-icon-active-with-text",INDICATOR_SUBTEXT:"ui-selector-indicator-subtext",INDICATOR_WITH_SUBTITLE:"ui-selector-indicator-with-subtext",INDICATOR_NEXT_END:"ui-selector-indicator-next-end",INDICATOR_PREV_END:"ui-selector-indicator-prev-end",INDICATOR_ARROW:"ui-selector-indicator-arrow",EDIT_MODE:"ui-selector-edit-mode",REORDER:"ui-selector-reorder",PLUS_BUTTON:"ui-item-plus",ITEM_PLACEHOLDER:"ui-item-placeholder",ITEM_MOVED:"ui-item-moved",ITEM_REMOVED:"ui-item-removed",ITEM_END:"ui-item-moved-end"},v={RADIUS_RATIO:.8,SCALE_FACTOR:.8235},w={ITEM_SELECTOR:"."+u.ITEM,INDICATOR_SELECTOR:"."+u.INDICATOR,INDICATOR_TEXT_SELECTOR:"."+u.INDICATOR_TEXT,INDICATOR_ARROW_SELECTOR:"."+u.INDICATOR_ARROW,ITEM_DEGREE:30,MAX_ITEM_NUMBER:11,ITEM_RADIUS:-1,ITEM_START_DEGREE:30,ITEM_END_DEGREE:330,ITEM_NORMAL_SCALE:"scale("+v.SCALE_FACTOR+")",ITEM_ACTIVE_SCALE:"scale(1)",ITEM_MOVED_SCALE:"scale(0.92)",EMPTY_STATE_TEXT:"Selector is empty"},x={ITEM_CHANGE:"selectoritemchange",LAYER_CHANGE:"selectorlayerchange"},y=d.widget.BaseWidget,z=new y;t.prototype=z,z._configure=function(){var a=this;a.options=r.merge(a.options,{itemSelector:w.ITEM_SELECTOR,indicatorSelector:w.INDICATOR_SELECTOR,indicatorTextSelector:w.INDICATOR_TEXT_SELECTOR,indicatorArrowSelector:w.INDICATOR_ARROW_SELECTOR,itemDegree:w.ITEM_DEGREE,itemRadius:w.ITEM_RADIUS,maxItemNumber:w.MAX_ITEM_NUMBER,indicatorAutoControl:!0,emptyStateText:w.EMPTY_STATE_TEXT})},z._buildIndicator=function(a){var c,d=this,e=d.options,f=d._ui,g=a.querySelector(e.indicatorSelector),h=a.querySelector(e.indicatorArrowSelector),i=a.querySelector(e.indicatorTextSelector);g?(f.indicator=g,i&&(f.indicatorText=i)):m(f,a),h?f.indicatorArrow=h:(c=b.createElement("div"),c.classList.add(u.INDICATOR_ARROW),f.indicatorArrow=c,a.appendChild(f.indicatorArrow))},z._build=function(a){var b,c=this,f=c._ui,g=c.options,h=a.querySelectorAll(c.options.itemSelector);return h&&h.length?(b=e(a,h,g),a.classList.add(u.SELECTOR),g.indicatorAutoControl&&c._buildIndicator(a),f.items=h,f.layers=b,a):(d.warn("Please check your item selector option. Default value is '.ui-item'"),null)},z._init=function(a){var b,c,d=this,e=d.options,f=d._ui.items,g=d._getActiveLayer(),h=d._getActiveItem(),i=a.offsetWidth>a.offsetHeight?a.offsetHeight:a.offsetWidth;for(d._started=!1,d._enabled=!0,d._activeItemIndex=null===h?0:h,e.itemRadius=e.itemRadius<0?i/2*v.RADIUS_RATIO:e.itemRadius,c=f.length,b=0;c>b;b++)o.setNSData(f[b],"index",b),k(f[b],w.ITEM_END_DEGREE,e.itemRadius,-w.ITEM_END_DEGREE,w.ITEM_NORMAL_SCALE);return null===g?(d._activeLayerIndex=0,d._setActiveLayer(0)):(d._activeLayerIndex=g,d._setActiveLayer(g)),a},z._initItems=function(a){var b,c,d,e=this,f=e.options,g=a.querySelectorAll(f.itemSelector);for(d=g.length>f.maxItemNumber?f.maxItemNumber:g.length,c=0;d>c;c++)-1===e._itemsToReorder.indexOf(c)&&(b=w.ITEM_START_DEGREE+f.itemDegree*c,k(g[c],b,f.itemRadius,-b,w.ITEM_NORMAL_SCALE));e._editModeEnabled&&e._animateReorderedItems(),e.options.plusButton&&d--,!e._editModeEnabled&&d>0&&e._setActiveItem(e._activeItemIndex)},z._animateReorderedItems=function(){var a,b,c=this,d=c.options,e=c._ui.layers[c._activeLayerIndex],f=e.querySelectorAll(d.itemSelector),g=c._itemsToReorder,h=g.length;h&&(c._disable(),setTimeout(function(){for(b=0;h>b;b++)a=w.ITEM_START_DEGREE+d.itemDegree*g[b],k(f[g[b]],a,d.itemRadius,-a,w.ITEM_NORMAL_SCALE);c._itemsToReorder=[]},30))},z._addIconRemove=function(a,c){var d,e,f=this.options.maxItemNumber,g=1/v.SCALE_FACTOR,h=b.createElement("div"),i=b.createElement("div");d=parseInt(f/2,10)-1,e=c%f>d?"right":"left",i.classList.add(u.ITEM_ICON_REMOVE_BG),h.classList.add(u.ITEM_ICON_REMOVE+"-"+e),h.style.transform="scale("+g+")",h.appendChild(i),a.classList.add(u.ITEM_REMOVABLE),a.appendChild(h)},z._addRemoveIcons=function(){var a,b,c,d=this,e=d._ui.items;for(c=0;c<e.length;c++)b=e[c],a=o.getNSData(b,"removable"),b.setAttribute("draggable","true"),a!==!1&&d._addIconRemove(b,c)},z._removeRemoveIcons=function(){var a,b,c=this,d=c._ui.items;for(a=0;a<d.length;a++)b=d[a],b.classList.contains(u.ITEM_REMOVABLE)&&(b.innerHTML="",b.classList.remove(u.ITEM_REMOVABLE))},z._bindEvents=function(){g(this)},z.handleEvent=function(a){var b=this;switch(a.type){case"dragstart":b._onDragstart(a);break;case"drag":b._onDrag(a);break;case"dragend":b._onDragend(a);break;case"click":b._onClick(a);break;case"rotarydetent":b._onRotary(a);break;case"transitionend":b._onTransitionEnd(a);break;case"animationend":case"webkitAnimationEnd":b._onAnimationEnd(a);break;case"longpress":b._onLongPress(a);break;case"mouseup":case"touchend":b._onTouchEnd(a);break;case"tizenhwkey":a.stopPropagation(),b._onHWKey(a);break;case"swipe":b._onSwipe(a)}},z._getActiveLayer=function(){var a,b,c=this,d=c._ui;for(b=d.layers.length,a=0;b>a;a++)if(d.layers[a].classList.contains(u.LAYER_ACTIVE))return a;return null},z._setActiveLayer=function(a){var b=this,c=b._ui,d=b._activeLayerIndex,e=c.layers[d],f=c.layers[a];e&&i(e),f&&j(f),b._activeLayerIndex=a,c.items.length>0&&c.layers[a]&&(b._initItems(f),q.trigger(f,x,{index:a}))},z._getActiveItem=function(){var a,b,c=this,d=c._ui;for(b=d.items.length,a=0;b>a;a++)if(d.items[a].classList.contains(u.ITEM_ACTIVE))return a;return null},z._setActiveItem=function(a){var b,d,e=this,f=e.element,g=e._ui,h=g.items,i=f.querySelector("."+u.ITEM_ACTIVE);a=a!==c?a:0,b=h[a].style.transform||h[a].style.webkitTransform,i&&(i.style.transform=i.style.transform.replace(w.ITEM_ACTIVE_SCALE,w.ITEM_NORMAL_SCALE),i.classList.remove(u.ITEM_ACTIVE)),h.length&&(h[a].classList.add(u.ITEM_ACTIVE),d=b.replace(w.ITEM_NORMAL_SCALE,w.ITEM_ACTIVE_SCALE),h[a].style.transform=d,h[a].style.webkitTransform=d,e.options.indicatorAutoControl&&e._setIndicatorIndex(a),e._activeItemIndex=a,q.trigger(h[a],x.ITEM_CHANGE,{layer:g.layers[e._activeLayerIndex],layerIndex:e._activeLayerIndex,index:a,title:o.getNSData(h[a],"title")}))},z._setIndicatorIndex=function(a){var b=this,c=b._ui,d=c.items[a],e=o.getNSData(d,"title"),f=o.getNSData(d,"icon"),g=o.getNSData(d,"subtitle"),h=u.INDICATOR_ICON_ACTIVE,i=u.INDICATOR_ICON_ACTIVE_WITH_TEXT,j=u.INDICATOR_WITH_SUBTITLE,k=c.indicator,m=c.indicatorText,n=c.indicatorIcon,p=c.indicatorSubText,q=c.indicatorArrow,r=k.classList,s=n.classList,t=a%b.options.maxItemNumber;e?(m.textContent=e,g?(r.add(j),p.textContent=g):(r.remove(j),p.textContent=""),f&&s.add(i)):(m.textContent="",s.remove(i)),f?(s.add(h),n.style.backgroundImage="url("+f+")",p.textContent=""):(s.remove(h),s.remove(i)),o.setNSData(k,"index",a),l(q,w.ITEM_START_DEGREE+b.options.itemDegree*t)},z._onDragstart=function(){this._started=!0},z._onAnimationEnd=function(a){var b=this,c=b._ui,d=a.target.classList;d.contains(u.INDICATOR)?c.indicator.classList.remove(u.INDICATOR_ACTIVE):d.contains(u.ITEM_MOVED)&&(b._reorderAnimationEnd=!0,b._reorderEnd&&!b._started&&setTimeout(function(){c.movedItem.classList.add(u.ITEM_END)},30))},z._onTransitionEnd=function(a){var b=this,c=a.target,d=c.classList;!b._enabled&&d.contains(u.ITEM)&&(d.contains(u.ITEM_REMOVED)?b.removeItem(parseInt(o.getNSData(c,"index"),10)):d.contains(u.ITEM_END)?b._clearReorder():d.contains(u.ITEM_MOVED)?s(function(){d.add(u.ITEM_END)}):b._reorderEnd||b._enable())},z._clearReorder=function(){var a=this,b=a._ui;b.items[a._destinationIndex].classList.remove(u.ITEM_PLACEHOLDER),a.element.removeChild(a._ui.movedItem),b.movedItem=null,a.element.classList.remove(u.REORDER),a._movedElementIndex=null,a._destinationIndex=null,a._pointedLayer=null,clearInterval(a._changeLayerInterval),a._changeLayerInterval=null,a._enable(),a._reorderEnd=!1,a._reorderAnimationEnd=!1},z._onDragMovedElement=function(a,b,c,d){var e=this,f=e._ui.movedItem.style,g=a&&a.classList;f.top=c+"px",f.left=b+"px",a&&(g.contains(u.LAYER_PREV)?e._pointedLayer="prev":g.contains(u.LAYER_NEXT)?e._pointedLayer="next":(e._pointedLayer=null,clearInterval(e._changeLayerInterval),e._changeLayerInterval=null)),e._enabled&&(a&&null!==e._pointedLayer&&e._moveItemToLayer(),null!==d&&d!==e._destinationIndex&&e._setNewItemDestination(d))},z._onDrag=function(a){var c,d,e,f=this,g=null;this._started&&(c=a.detail.estimatedX,d=a.detail.estimatedY,e=b.elementFromPoint(c,d),e&&e.classList.contains(u.ITEM)&&!e.classList.contains(u.ITEM_PLACEHOLDER)&&(g=parseInt(o.getNSData(e,"index"),10)),f._editModeEnabled||null===g||f._setActiveItem(g),null!==f._movedElementIndex&&f._onDragMovedElement(e,c,d,g))},z._moveItemToLayer=function(){var a=this,b=a._pointedLayer;null===a._changeLayerInterval&&(a._changeLayerInterval=setInterval(function(){null!==a._pointedLayer&&b===a._pointedLayer&&("prev"===b?a._setPreviousLayer():a._setNextLayer())},1e3))},z._setNextLayer=function(){var a,b=this,c=b.options,d=b._ui.items,e=d.length;if(b._enabled){for(a=0;e>a;a++)o.setNSData(d[a],"index",a),k(d[a],w.ITEM_START_DEGREE,c.itemRadius,-w.ITEM_START_DEGREE,w.ITEM_NORMAL_SCALE);b._setItemAndLayer(b._activeLayerIndex+1,(b._activeLayerIndex+1)*b.options.maxItemNumber)}},z._setPreviousLayer=function(){var a,b=this,c=b.options,d=b._ui.items,e=d.length;if(b._enabled){for(a=0;e>a;a++)o.setNSData(d[a],"index",a),k(d[a],w.ITEM_END_DEGREE,c.itemRadius,-w.ITEM_END_DEGREE,w.ITEM_NORMAL_SCALE);b._setItemAndLayer(b._activeLayerIndex-1,b._activeLayerIndex*b.options.maxItemNumber-1)}},z._setNewItemDestination=function(a){var b,c=this,d=c.element,e=c._destinationIndex,g=c._ui.items;f(d,c.options),b=g[e].parentNode,a+1>c._destinationIndex?b.insertBefore(g[e],g[a+1]):b.insertBefore(g[e],g[a]),c._ui.items=d.querySelectorAll("."+u.ITEM+":not(."+u.ITEM_MOVED+")"),c._refresh(),c._destinationIndex=a},z._onTouchEnd=function(){var a,b,c,d=this,e=d._ui;null===d._movedElementIndex||d._reorderEnd||(d.disable(),d._reorderEnd=!0,a=e.movedItem,b=a.style,b.transition="top 200ms, left 200ms, opacity 200ms, transform 200ms",c=e.items[d._destinationIndex].getBoundingClientRect(),d._reorderAnimationEnd&&!d._started?setTimeout(function(){a.classList.add(u.ITEM_END)},30):d._reorderAnimationEnd&&(b.top=c.top+c.width/2+"px",b.left=c.left+c.height/2+"px"))},z._onDragend=function(a){var b,c=this,d=c._getPointedElement(a.detail);!c._editModeEnabled&&d&&d.classList.contains(u.ITEM)&&(b=parseInt(o.getNSData(d,"index"),10),c._setActiveItem(b)),c._started=!1},z._onClickChangeActive=function(a){var c,d,e,f,g=this,h=g._ui,i=b.elementFromPoint(event.pageX,event.pageY),j=g._ui.indicator.classList;h.items.length>0&&(c=h.layers[g._activeLayerIndex],d=c.previousElementSibling,e=c.nextElementSibling),a.classList.contains(u.LAYER_PREV)&&d?g._setPreviousLayer():a.classList.contains(u.LAYER_NEXT)&&e?g._setNextLayer():g._enabled&&!g._editModeEnabled&&(i&&(i.classList.contains(u.INDICATOR)||i.parentElement.classList.contains(u.INDICATOR))&&(j.remove(u.INDICATOR_ACTIVE),s(function(){j.add(u.INDICATOR_ACTIVE)})),i&&i.classList.contains(u.ITEM)&&(f=parseInt(o.getNSData(i,"index"),10),g._setActiveItem(f)))},z._onClick=function(a){var b=this,c=a.target,d=c.classList,e=b._getActiveItem(),f=null;null!==e&&b._ui.items[e]===c&&(f=b._ui.indicator.classList,s(function(){f.add(u.INDICATOR_ACTIVE)})),b._onClickChangeActive(c),c.classList.contains(u.PLUS_BUTTON)&&b.trigger("add"),b._editModeEnabled&&(a.stopImmediatePropagation(),b._enabled&&(d.contains(u.ITEM_ICON_REMOVE+"-left")||d.contains(u.ITEM_ICON_REMOVE+"-right"))&&(b._disable(),c.parentElement.classList.add(u.ITEM_REMOVED)))},z._setItemAndLayer=function(a,b){this._activeItemIndex=b,this._changeLayer(a)},z._onRotaryCW=function(){var a,b=this,c=b._ui,d=b.options,e=c.layers[b._activeLayerIndex],f=e&&e.querySelectorAll(d.itemSelector).length;b._activeItemIndex===f+b._activeLayerIndex*d.maxItemNumber-1||b._editModeEnabled?b._siblingLayerExists("next")?b._setNextLayer():(a=w.ITEM_START_DEGREE+d.itemDegree*(b._activeItemIndex%d.maxItemNumber),l(c.indicatorArrow,a+d.itemDegree/3),setTimeout(function(){l(c.indicatorArrow,a)},100)):b._changeItem(b._activeItemIndex+1)},z._onRotaryCCW=function(){var a=this,b=a._ui,c=a.options;a._activeItemIndex%c.maxItemNumber===0||a._editModeEnabled?a._siblingLayerExists("prev")?a._setPreviousLayer():(l(b.indicatorArrow,w.ITEM_START_DEGREE-w.ITEM_START_DEGREE/3),setTimeout(function(){l(b.indicatorArrow,w.ITEM_START_DEGREE)},100)):a._changeItem(a._activeItemIndex-1)},z._onRotary=function(a){var b=this,c=b._ui,d=b.options,e=a.detail.direction;d.indicatorAutoControl&&b._enabled&&0!==c.items.length&&(a.stopPropagation(),"CW"===e?b._onRotaryCW():b._onRotaryCCW())},z._hideItems=function(a){var b,c,d=this,e=a.getElementsByClassName(u.ITEM);for(a.classList.add(u.LAYER_HIDE),c=e.length,b=0;c>b;b++)k(e[b],w.ITEM_START_DEGREE,d.options.itemRadius,-w.ITEM_START_DEGREE,w.ITEM_NORMAL_SCALE);setTimeout(function(){for(c=e.length,b=0;c>b;b++)k(e[b],w.ITEM_END_DEGREE,d.options.itemRadius,-w.ITEM_END_DEGREE,w.ITEM_NORMAL_SCALE);a.classList.remove(u.LAYER_HIDE)},150)},z._setIndexes=function(){var a,b=this,c=b._ui,d=c.items;for(a=0;a<c.items.length;a++)o.setNSData(d[a],"index",a);
},z._refreshEditMode=function(){var a,b,c,d,e=this,f=e._ui,g=f.items,h=e.options,i=e._itemsToReorder,j=h.maxItemNumber,l=e._activeLayerIndex,m=(l+1)*j,n=l*j;for(c=0;c<f.items.length;c++)a=parseInt(o.getNSData(g[c],"index"),10),d=c!==a&&!Number.isNaN(a),d&&m>c&&c>=n&&!g[c].classList.contains(u.ITEM_PLACEHOLDER)&&(a>=m&&(b=w.ITEM_START_DEGREE+h.itemDegree*j,k(g[c],b,h.itemRadius,-b,w.ITEM_NORMAL_SCALE)),i.push(c%j))},z._refresh=function(){var a=this,b=a._ui,c=b.items,d=a.options,f=a.element;a._editModeEnabled?(a._removeRemoveIcons(),a._refreshEditMode(),a._setIndexes(),a._addRemoveIcons()):a._setIndexes(),b.layers=e(f,c,d),a._setActiveLayer(a._activeLayerIndex)},z._changeLayer=function(a){var b=this,c=b._ui.layers,e=c[b._activeLayerIndex];return 0>a||a>c.length-1?void d.warn("Please insert index between 0 to layers number"):(b._enabled=!1,b._hideItems(e),void s(function(){b._setActiveLayer(a)}))},z._onLongPress=function(a){var b,c=this,d=c._getPointedElement(a.detail),e=d.classList,f=parseInt(o.getNSData(d,"index"),10);c.options.editable&&c._editModeEnabled===!1&&c._enableEditMode(),c._editModeEnabled&&e.contains(u.ITEM)&&!e.contains(u.PLUS_BUTTON)&&(b=c._ui.items[f],c._cloneMovedItem(f),b.classList.add(u.ITEM_PLACEHOLDER),c._movedElementIndex=f,c._destinationIndex=f,c.element.classList.add(u.REORDER))},z._getPointedElement=function(a){var c=a.estimatedX,d=a.estimatedY;return b.elementFromPoint(c,d)},z._cloneMovedItem=function(a){var b,c,d,e,f,g=this,h=g.element;b=g._ui.items[a],d=b.cloneNode(!0),c=b.getBoundingClientRect(),e=c.left+c.height/2,f=c.top+c.width/2,d.classList.add(u.ITEM_MOVED),d.setAttribute("style","left:"+e+"px; top:"+f+"px"),h.appendChild(d),g._ui.movedItem=h.querySelector("."+u.ITEM_MOVED)},z._onHWKey=function(a){var b=this;"back"===a.keyName&&b.options.editable&&b._editModeEnabled&&b._disableEditMode()},z._siblingLayerExists=function(a){var b=this,c="next"===a,d=b._ui,e=d.layers[b._activeLayerIndex],f=e&&(c?e.nextElementSibling:e.previousElementSibling);return f&&f.classList.contains(c?u.LAYER_NEXT:u.LAYER_PREV)},z._onSwipe=function(a){var b=this;"right"===a.detail.direction&&b._siblingLayerExists("next")?b._setNextLayer():"left"===a.detail.direction&&b._siblingLayerExists("prev")&&b._setPreviousLayer()},z._addPlusButton=function(){var a;a=b.createElement("div"),a.classList.add(u.PLUS_BUTTON),o.setNSData(a,"removable","false"),this.addItem(a)},z._removePlusButton=function(){var a,b=this,c=b._ui.items,d=c.length-1,e=b.options.maxItemNumber,f=b._activeLayerIndex;a=f*e,d===a&&b._changeLayer(f-1),c[d].classList.contains(u.PLUS_BUTTON)&&b.removeItem(d)},z._enableEditMode=function(){var b=this,c=b._ui,d=c.items.length,e=c.items[b._activeItemIndex];b.options.plusButton&&b._addPlusButton(),b._addRemoveIcons(),b.element.classList.add(u.EDIT_MODE),c.indicatorText.textContent="Edit mode",d>0&&(e.classList.remove(u.ITEM_ACTIVE),s(function(){e.style.transform=e.style.transform.replace(w.ITEM_ACTIVE_SCALE,w.ITEM_NORMAL_SCALE)})),q.on(a,"tizenhwkey",b,!0),b._editModeEnabled=!0},z._disableEditMode=function(){var b,c=this,d=c._ui,e=c.element.classList;c.options.plusButton&&c._removePlusButton(),e.remove(u.EDIT_MODE),b=d.items,b.length>0?(b[c._activeItemIndex].classList.add(u.ITEM_ACTIVE),c._removeRemoveIcons(),s(function(){c._setActiveItem(c._activeItemIndex)})):(d.indicatorText.textContent=c.options.emptyStateText,d.indicatorSubText.textContent="",d.indicatorIcon.classList.remove(u.INDICATOR_ICON_ACTIVE,u.INDICATOR_ICON_ACTIVE_WITH_TEXT)),q.off(a,"tizenhwkey",c,!0),c._editModeEnabled=!1},z._changeItem=function(a){this._setActiveItem(a)},z.changeItem=function(a){this._changeItem(a)},z.addItem=function(a,b){var c=this,d=c.element,e=d.querySelectorAll(c.options.itemSelector),g=e.length-1,h=e[g].classList.contains(u.PLUS_BUTTON),i=c._ui,j=h?i.items.length:i.items.length-1;f(c.element,c.options),k(a,w.ITEM_END_DEGREE,c.options.itemRadius,-w.ITEM_END_DEGREE,w.ITEM_NORMAL_SCALE),a.classList.add(u.ITEM),b>=0&&j>b?d.insertBefore(a,e[b]):h?d.insertBefore(a,e[g]):d.appendChild(a),i.items=d.querySelectorAll(c.options.itemSelector),c._refresh()},z.removeItem=function(a){var b,c=this,d=c._ui,e=c.element,g=c.options.maxItemNumber;f(c.element,c.options),e.removeChild(d.items[a]),d.items=e.querySelectorAll(c.options.itemSelector),b=d.items.length,a%g===0&&a===d.items.length-1&&c._changeLayer(c._activeLayerIndex-1),c._activeItemIndex>=b&&(c._activeItemIndex=b-1),c._refresh()},z._destroy=function(){var a,b=this;h(b),a=b._getActiveItem(),null!==a&&b._ui.items[a].classList.remove(u.ITEM_ACTIVE),b._ui=null},z._disable=function(){this._enabled=!1},z._enable=function(){this._enabled=!0},d.widget.wearable.Selector=t,n.defineWidget("Selector",".ui-selector",["changeItem","addItem","removeItem","enable","disable"],t,"wearable")}(a.document,d),function(a,b){function e(a,c){var d=b.createElement("li"),e=b.createElement("a"),f=b.createElement("img");return c=c||"#",f.setAttribute("src",a),f.setAttribute("class",G.THUMB),e.setAttribute("href",c),e.appendChild(f),d.appendChild(e),d.setAttribute("class",G.POSITIONED),d}function f(a){var b=a.element,c=b.classList;a._currentIndex>-1&&(c.remove(G.MODE3X3),c.remove(G.THUMBNAIL),c.add(G.IMAGE),a.options.mode="image")}function g(a,b){for(var c=r.call(a.element.children,0),d=-1;null!==b&&0>d;){if(d=c.indexOf(b),d>-1)return d;b=b.parentNode}return d}function h(a){var b=a.element,c=b.style,d="translate3d("+a.position.left+"px, "+a.position.top+"px, 0)",e="scale("+a.scale+")";c.transform=d+" "+e,c.webkitTransform=d+" "+e,c.opacity=a.opacity}function i(a,b){var c,d,e=a.to,f=a.from,g=a.position;e&&f&&(c=f.position,d=e.position,d&&c&&(g.top=w(b,c.top,d.top-c.top,1),g.left=w(b,c.left,d.left-c.left,1)),a.scale=w(b,f.scale,e.scale-f.scale,1),a.opacity=w(b,f.opacity,e.opacity-f.opacity,1))}function j(a,b){return"object"!=typeof b&&(b={}),b.element=a,b.position={left:0,top:0},b.scale=0,b.opacity=1,b.to={position:{},scale:1,opacity:1},b.from={position:{},scale:0,opacity:1},b}function k(a){for(var b,c,d=a.length,e=0;d>e;++e)b=a[e],c=b.from,c.position={left:b.position.left,top:b.position.top},c.scale=b.scale,c.opacity=b.opacity}function l(a,b,c,d){for(var e,f,g=a.length,h=0;g>h;++h)e=a[h],f=e.to,f.position={},f.position[c]=e.position[c]+b,f.position[d]=e.position[d]}function m(a,b){for(var c=a.length,d=0;c>d;++d)a[d].to.scale=b}function n(a){for(var b,c=a._items,d=c.length,e=0;d>e;++e)b=c[e].to,b.position={},b.position[a._scrollDimension]=e*a._getItemSize("thumbnail")+200*(e-a._currentIndex),b.position[a._nonScrollDimension]=0,b.scale=M.IMAGE,"rectangle"===a.options.shape&&(b.opacity=e===a._currentIndex?O:N)}function o(a,b){var c,d=a._items.length,e=a.options,f=a._settings;switch(b){case"3x3":c=t(v(d/e.lines)*v(H*f.scale)+f.marginLeft+f.marginRight,H);break;case"image":c=d*H;break;case"thumbnail":c=d*H*f.scaleThumbnailX+(d-1.5)*f.marginThumbnail+H*(1-f.scaleThumbnailX);break;default:c=H}return c}var p=d.widget.wearable.Listview,q=d.engine,r=[].slice,s=Math.min,t=Math.max,u=Math.round,v=Math.ceil,w=d.util.easing.easeOutQuad,x=[],y=function(b){var c=Date.now()-b.startTime,d=c/b.duration;b.end||(b.current=w(Math.min(d,1),b.from,b.to,1),b.element[b.propertyName]=b.current,b.requestHandler=a.requestAnimationFrame(b.render)),d>1&&(b.end=!0,a.cancelAnimationFrame(b.requestHandler),b.requestHandler=null)},z=function(a,b,c,d,e){var f={from:a,to:b,current:a,startTime:Date.now(),duration:d,end:!0,render:null,requestHandler:null,element:c,propertyName:e&&e.propertyName||"scrollTop"};return f.render=y.bind(null,f),x.push(f),f},A=function(a){return x.filter(function(b){return b.element===a})[0]},B=function(b,c){for(var d=c.length,e=0,f=b.duration,g=(Date.now()-b.startTime)/f,h=b.drawFn,i=b.timingFn;d>e;++e)i(c[e],s(g,1));for(e=0;d>e;++e)h(c[e],e);b.end?"function"==typeof b.onEnd&&b.onEnd():b.handler=a.requestAnimationFrame(b.request),g>1&&(b.end=!0)},C=function(b,c,d,e,f){var g={end:!1,startTime:Date.now(),duration:c,timingFn:d,drawFn:e,onEnd:f};return b=Array.isArray(b)?b:[b],g.request=B.bind(null,g,b),g.handler=a.requestAnimationFrame(g.request),g},D={2:{circle:{marginTop:-75,marginLeft:38,marginRight:140,scale:.3833,scaleThumbnail:.6,scaleThumbnailX:.6,marginThumbnail:26,size:146},rectangle:{marginTop:-66,marginLeft:57,marginRight:230,scale:.325,scaleThumbnail:.715,scaleThumbnailX:.4722,marginThumbnail:-8,size:130}},3:{circle:{marginTop:0,marginLeft:11,marginRight:179,scale:.3027,scaleThumbnail:.6,scaleThumbnailX:.6,marginThumbnail:26,size:115},rectangle:{}}},E=function(){var a=this;a.options={mode:"3x3",scrollbar:!0,lines:3,shape:"circle",orientation:"horizontal"},a._ui={container:null},a._currentIndex=-1,a._settings=D[3].circle},F="ui-grid",G={SHAPE_PREFIX:F+"-",MODE3X3:F+"-3x3",THUMBNAIL:F+"-thumbnail",IMAGE:F+"-image",THUMB:"thumb",POSITIONED:"ui-positioned"},H=360,I=101,J=5,K=250,L=450,M={IMAGE:1},N=.75,O=1,P=new p;P._scrollTo=function(a,b,c,d){var e=d.propertyName||"scrollTop",f=A(a)||z(a[e],b,a,c,d);f.startTime=Date.now(),f.end?(f.end=!1,f.from=a[e],f.to=b,f.duration=c,f.render()):(f.from=f.current,f.to+=2*b-(f.current+f.to)%b)},P._toggleSelectedItem=function(a){var b=this,c=this._items[b._currentIndex];a?c.element.classList.add("ui-selected"):c.element.classList.remove("ui-selected")},P._getItemSize=function(a){var b=this,c=b._settings;switch(a||b.options.mode){case"3x3":return H*c.scale+J;case"image":return H;case"thumbnail":return H*c.scaleThumbnailX+c.marginThumbnail;default:return 0}},P._prepareInsertItem=function(a,b,c,d){var e=this,f=a[b],g=a.filter(function(a,c){return b>c}),h=a.filter(function(a,c){return c>b});e._applyItemsTo(g),l(h,c,e._scrollDimension,e._nonScrollDimension),l([f],c*b,e._scrollDimension,e._nonScrollDimension),e._applyItemsTo([f]),f.scale=0,m([f],d),k(a)},P._prepareRemoveItem=function(a,b,c){var d=this,e=a.filter(function(a,c){return c>b});l(e,-1*c,d._scrollDimension,d._nonScrollDimension)},P.add=function(a,b){var d=this,f=d.element,g=e(a),l=d._createSnapPoint(),m=d._items;switch(b!==c&&b<f.children.length?(m.splice(b,0,j(g)),d._snapPoints.splice(b,0,l),f.insertBefore(g,f.children[b])):(m.push(j(g)),d._snapPoints.push(l),f.appendChild(g)),d._updateSnapPointPositions(),d.options.mode){case"3x3":k(m),d._assembleItemsTo3x3(m);break;case"image":d._prepareInsertItem(m,b,d._getItemSize(),M.IMAGE);break;case"thumbnail":d._prepareInsertItem(m,b,d._getItemSize(),d.settings.scaleThumbnailX)}return C(m,L,i,h,function(){f.style[d._scrollSize]=o(d,d.options.mode)+"px"}),d},P.remove=function(a){var b=this,d=b.element,e=d.style,f=b._items,g=f[a],j=g.to,l=g.element,m=b._snapPoints;if(a!==c&&a<d.children.length)switch(k([g]),b.options.mode){case"3x3":j.scale=0,j.position={},j.position[b._scrollDimension]=g.position[b._scrollDimension]+b._getItemSize()/2,j.position[b._nonScrollDimension]=g.position[b._nonScrollDimension],C(g,L,i,h),f.splice(a,1),m.splice(a,1),k(f),b._assembleItemsTo3x3(f),C(f,L,i,h,function(){b._updateSnapPointPositions(),d.removeChild(l),e[b._scrollSize]=o(b,"3x3")+"px"});break;case"image":case"thumbnail":j.scale=0,k(f),b._prepareRemoveItem(f,a,b._getItemSize()),C(f,L,i,h,function(){b._updateSnapPointPositions(),d.removeChild(l),e[b._scrollSize]=o(b,b.options.mode)+"px",f.splice(a,1),m.splice(a,1)})}return b},P._changeModeTo3x3=function(){var a=this,b=a.element,c=b.classList;c.remove(G.IMAGE),c.add(G.MODE3X3),a.options.mode="3x3",b.style[a._scrollSize]=a._getGridSize("3x3")+"px"},P._changeModeToThumbnail=function(){-1!==this._currentIndex&&this.element.classList.add(G.THUMBNAIL)},P.mode=function(a){var b=this,c=b.options.mode;switch(a){case"3x3":"image"===c?(b.trigger("modechange",{mode:a}),b._imageToGrid()):(b.trigger("modechange",{mode:a}),b._changeModeTo3x3());break;case"image":"3x3"===c?(b.trigger("modechange",{mode:a}),b._gridToImage()):"thumbnail"===c&&(b.trigger("modechange",{mode:a}),b._thumbnailToImage());break;case"thumbnail":"image"===c?(b.trigger("modechange",{mode:a}),b._imageToThumbnail()):"3x3"===c&&d.warn("thumbnail mode is not allowed directly from 3x3 mode,change to image mode before");break;default:d.warn("unsupported grid mode, available: 3x3 | image | thumbnail")}return b},P.changeIndex=function(a){var b=this,c=b._ui.container,d=b._scrollProperty;return b._currentIndex=a,b._scrollTo(c,b._getGridScrollPosition(b.options.mode)-c[d],K,{propertyName:d}),b},P.getIndex=function(){var a=this;return a._currentIndex=a._findItemIndexByScroll(a._ui.container),a._currentIndex},P._createSnapPoint=function(){var a=b.createElement("div");return a.className="snap-point",a},P._createSnapPoints=function(){for(var a,c=this,d=b.createDocumentFragment(),e=c._items,f=e.length,g=0,h=[];f>g;g++)a=c._createSnapPoint(),h.push(a),d.appendChild(a);c._ui.container.appendChild(d),c._snapPoints=h},P._updateSnapPointPositions=function(){var a,b=this,c=b._snapPoints,d=c.length,e=0,f=0,g=3,h=0,i=b._settings,j=i.scale;switch(b.options.mode){case"3x3":e=H*j/2+i.marginLeft,f=H*j/3,g=3;break;case"image":e=H/2,f=H,g=1;break;case"thumbnail":e=H/2,f=H*i.scaleThumbnailX+i.marginThumbnail,g=1}for(;d>h;h++)a=c[h],a.style[b._scrollDimension]=e+f*(h-h%g)+"px"},P._build=function(a){var c=this,d=b.createElement("div");return c._ui.container=d,d.setAttribute("class","ui-grid-container"),c._setScrollbar(a,c.options.scrollbar),a.parentElement.replaceChild(d,a),d.appendChild(a),a},P._setScrollbar=function(a,b){var c=this._ui.container;b?c.setAttribute("tizen-circular-scrollbar",""):c.removeAttribute("tizen-circular-scrollbar")},P._setLines=function(a,b){var c=parseInt(b,10),d=this.options;2!==c&&(c=3),this._settings=D[c][d.shape],d.lines=c},P._setOrientation=function(a,b){var c=this,d=c.options;"vertical"!==b&&(b="horizontal"),"horizontal"===b?(c._scrollProperty="scrollLeft",c._scrollDimension="left",c._nonScrollDimension="top",c._scrollSize="width"):(c._scrollProperty="scrollTop",c._scrollDimension="top",c._nonScrollDimension="left",c._scrollSize="height"),d.orientation=b,a.classList.add(F+"-"+b),c._ui.container.classList.add(F+"-"+b)},P._setShape=function(a,b){var c=b,d=this.options,e=a.classList;"rectangle"!==c&&(c="circle"),e.remove(G.SHAPE_PREFIX+d.shape),e.add(G.SHAPE_PREFIX+c),this._settings=D[d.lines][c],d.shape=c},P._init=function(){var a=this,b=[],c=a.element,d=a.options;a._items=b,c.classList.add("ui-children-positioned"),a._setLines(c,d.lines),a._setShape(c,d.shape),a._setOrientation(c,d.orientation),a._getItems(),a._assembleItemsTo3x3(b),a._transformItems(),a._createSnapPoints(),a._updateSnapPointPositions(),a.mode(d.mode)},P._findChildIndex=function(a){return g(this,a)},P._transformItems=function(){var a=this,b=a._items;a._applyItemsTo(b),b.forEach(h)},P._applyItemsTo=function(a){for(var b,c,d=a.length,e=0;d>e;++e)b=a[e],c=b.to,c.position&&(b.position.left=c.position.left,b.position.top=c.position.top),c.scale&&(b.scale=c.scale),c.opacity&&(b.opacity=c.opacity)},P._assembleItemsTo3x3=function(a){for(var b,c,d,e,f=this,g=a.length,h=0,i=f._settings,j=i.size,k=[[j/2,-I],[0,0],[j/2,I]];g>h;++h)e=a[h].to,3===f.options.lines?(b=h%3,c=k[b][0]+(h/3|0)*j,d=k[b][1]):(c=(h/2|0)*j,d=h%2*j),e.scale=i.scale,e.position={},e.position[f._scrollDimension]=c+i.marginLeft,e.position[f._nonScrollDimension]=d+i.marginTop},P._assembleItemsToImages=function(){for(var a,b=this,c=b._items,d=c.length,e=0,f=b._getItemSize("image");d>e;++e)a=c[e].to,a.position={},a.position[b._scrollDimension]=e*f,a.position[b._nonScrollDimension]=0,a.scale=M.IMAGE},P._scaleItemsToThumbnails=function(){for(var a,b,c=this,d=c._items,e=c._currentIndex,f=d.length,g=c._getItemSize("thumbnail"),h=c._settings,i=h.scaleThumbnailX,j=2*((c._ui.container[c._scrollProperty]-h.marginThumbnail)%g)/g-1,k=Math.abs(j)/2,l=0;f>l;++l)a=d[l].to,a.position={},a.position[c._scrollDimension]=l*g,a.position[c._nonScrollDimension]=0,a.scale=i,b=h.scaleThumbnail-i,a.opacity=N,l===e?(a.scale+=b*(.5+k),a.opacity+=(1-N)*(.5+k)):(l-e===1&&0>j||l-e===-1&&j>=0)&&(a.scale+=b*(.5-k),a.opacity+=(1-N)*(.5-k))},P._moveItemsToImages=function(){for(var a,b=this,c=b._items,d=c.length,e=0;d>e;++e)a=c[e].to,a.position={},a.position[b._scrollDimension]=e*b._getItemSize("image"),a.position[b._nonScrollDimension]=0,a.scale=b._settings.scaleThumbnail,a.opacity=O},P._getItems=function(){for(var a,b=this,c=r.call(b.element.children),d=c.length,e=b._items,f=0;d>f;++f)a=c[f],e[f]=j(a,e[f]),a.classList.add("ui-positioned")},P._getGridSize=function(a){return o(this,a)},P._getGridScrollPosition=function(a){var b,c=this,d=c._getItemSize(a),e=c._currentIndex;switch(a){case"3x3":b=((e-1)/3|0)*v(d);break;case"image":case"thumbnail":b=e*d;break;default:b=0}return b},P._setGridSize=function(a){var b=this,c=b.element;b.options.mode="image",c.style[b._scrollSize]=o(b,a)+"px",c.parentElement[b._scrollProperty]=b._getGridScrollPosition(a)},P._findItemIndexByScroll=function(a){var b=this,c=a[b._scrollProperty],d=b._getItemSize(),e=b._items;switch(b.options.mode){case"image":return s(u(c/d),e.length-1);case"thumbnail":return s(u((c-b._settings.marginThumbnail)/d),e.length-1);default:return-1}},P._gridToImage=function(){var a=this,b=a.element;-1===a._currentIndex&&(a._currentIndex=0),a._dispersionItems(a._currentIndex),k(a._items),C(a._items,L,i,h,function(){f(a),a._assembleItemsToImages(),a._transformItems(),a._setGridSize("image"),a._updateSnapPointPositions()}),d.router.Router.getInstance().open(b,{url:"#image",rel:"grid"})},P._imageToThumbnail=function(){var a=this,b=a.element,c=a._items;n(a),a._transformItems(),a.options.mode="thumbnail",a._changeModeToThumbnail(),b.parentElement[a._scrollProperty]=a._getGridScrollPosition("thumbnail"),k(c),a._scaleItemsToThumbnails(),C(c,L,i,h,function(){b.style[a._scrollSize]=o(a,"thumbnail")+"px",a._updateSnapPointPositions()}),d.router.Router.getInstance().open(b,{url:"#thumbnail",rel:"grid"})},P._imageToGrid=function(){var a=this,b=a.element,c=a._items,d=a._getGridScrollPosition("3x3");a._assembleItemsTo3x3(c),a._transformItems(),a._dispersionItems(a._currentIndex),a._transformItems(),a._changeModeTo3x3(),b.parentElement[a._scrollProperty]=s(d,o(a,"3x3")-H),c[a._currentIndex].position[a._scrollDimension]=s(d,o(a,"3x3")-H),k(c),a._assembleItemsTo3x3(c),C(c,L,i,h,function(){b.style[a._scrollSize]=o(a,"3x3")+"px",a._updateSnapPointPositions()})},P._thumbnailToImage=function(){var a=this,b=a._items;a._moveItemsToImages(),a._transformItems(),a._setGridSize("image"),a._assembleItemsToImages(),k(b),f(a),C(b,L,i,h,function(){a._updateSnapPointPositions()})},P._dispersionItems=function(a){for(var b,c,d=this,e=d.element,f=d._items,g=f[a],h=f.length,i=0;h>i;++i)b=f[i],c=b.position,i!==a?b.to={position:{left:c.left+2.2*(c.left-g.position.left),top:c.top+2.2*(c.top-g.position.top)},scale:d._settings.scale}:(b.to={position:{},scale:M.IMAGE},b.to.position[d._scrollDimension]=e.parentElement[d._scrollProperty],b.to.position[d._nonScrollDimension]=0)},P._onClick=function(a){var b=this;switch(b._currentIndex=b._findChildIndex(a.target),b.options.mode){case"3x3":b.mode("image");break;case"image":b.mode("thumbnail")}},P._onPopState=function(a){var b=this;switch(b._currentIndex=b._findItemIndexByScroll(b._ui.container),b.options.mode){case"image":a.preventDefault(),a.stopImmediatePropagation(),b.mode("3x3");break;case"thumbnail":a.preventDefault(),a.stopImmediatePropagation(),b.mode("image")}},P._onHWKey=function(a){switch(a.keyName){case"back":this._onPopState(a)}},P._onRotary=function(a){var b=this,c=b._getItemSize(),d="CW"===a.detail.direction?1:-1,e=b._ui.container;0!==c&&b._scrollTo(e,d*c,K,{propertyName:b._scrollProperty})},P._onScroll=function(){var a=this,b=a._findItemIndexByScroll(a._ui.container),c=a.options;"rectangle"===c.shape&&"thumbnail"===c.mode&&(a._currentIndex=b,a._scaleItemsToThumbnails(),C(a._items,0,i,h,function(){a._updateSnapPointPositions()})),a.trigger("change",{active:b})},P.handleEvent=function(a){var b=this;switch(a.type){case"rotarydetent":b._onRotary(a);break;case"click":b._onClick(a);break;case"tizenhwkey":b._onHWKey(a);break;case"popstate":b._onPopState(a);break;case"scroll":b._onScroll()}},P._bindEvents=function(c){var d=this;b.addEventListener("rotarydetent",d,!0),a.addEventListener("popstate",d,!0),c.addEventListener("click",d,!0),a.addEventListener("tizenhwkey",d,!0),d._ui.container.addEventListener("scroll",d,!0)},P._unbindEvents=function(){var c=this;b.removeEventListener("rotarydetent",c,!0),a.removeEventListener("popstate",c,!0),c.element.removeEventListener("click",c,!0),a.removeEventListener("tizenhwkey",c,!0),c._ui.container.removeEventListener("scroll",c,!0)},P._destroy=function(){var a=this,b=a._items,c=b.length,d=0;for(a._unbindEvents();c>d;++d)b[d]=null;a._items=[]},E.prototype=P,d.widget.wearable.Grid=E,q.defineWidget("Grid","."+F,[],E,"wearable")}(a,a.document),function(a,b){function d(a,b,c,d){var e,f,g,h,i,j,k=d.max-d.min+d.step,l=k/d.step,m=Math.round((a-d.min)/d.step);return"enabled"===d.loop&&(a>=d.max-2*d.step?3>l-m&&3>b&&(b+=l):a<=d.min+2*d.step&&3>m&&b>l-3&&(b-=l)),e=a-d.min-b*d.step,f=0>e?1:-1,g=Math.abs(e),h=1-d.scaleFactor*g,i=1-d.moveFactor*g,j=1-(d.enabled?d.scaleFactor:1)*g,h=0>h?0:h,j=0>j?0:j,i=f*(o*(1-i))+c,{moveY:i,scale:h,opacity:j}}function e(a){var c=a._ui.items,e=a.options,f=a._itemHeight,g=a._objectValue,h=(a._containerRect.height-f)/2;c.forEach(function(a,b){var c=d(g.value,b,h,e);c.opacity>0?a.style.transform="translateY("+c.moveY+"px) scale("+c.scale+")":a.style.transform="translateY(-1000px)",a.style.opacity=c.opacity}),b.event.trigger(a.element,"spinstep",parseInt(g.value,10))}function f(a){var b=null===a._prevValue?a.options.value:a._prevValue,c=b,d=a.options.value-b,e=0,f=0;return"enabled"===a.options.moduloValue&&(f=d/a.length|0,Math.abs(d)>=a.length&&(c=b+a.length*f),e=d%a.length,"enabled"===a.options.shortPath&&Math.abs(e)>a.length/2&&(f+=0>e?-1:1,c=b+a.length*f)),c}var g=a.document,h=b.widget.BaseWidget,i=b.engine,j=b.event,k=j.gesture,l=b.util.Animate,m=300,n=600,o=100,p=30,q=10,r=0,s=null,t=function(){this.options={min:0,max:9,step:1,moduloValue:"enabled",shortPath:"enabled",duration:n,direction:"up",rollHeight:"custom",itemHeight:38,momentumLevel:0,scaleFactor:.4,moveFactor:.4,loop:"enabled",labels:[],digits:0},this._ui={},this.length=this.options.max-this.options.min+1,this._prevValue=null,null===s&&(s=new k.Drag({blockHorizontal:!0}),j.enableGesture(g,s))},u="ui-spin",v={SPIN:u,ITEM:u+"-item",SELECTED:u+"-item-selected",NEXT:u+"-item-next",PREV:u+"-item-prev",ENABLED:"enabled",ENABLING:u+"-enabling"},w=new h;t.classes=v,t.timing=l.timing,w._valueToIndex=function(a){var b=this.options,c=b.max-b.min+1;for(a-=b.min;a<b.min;)a+=c;for(;a>b.max;)a-=c;return parseInt(a,10)%this.length},w._removeSelectedLayout=function(){var a=this;null!==a._prevValue&&a._ui.items[a._valueToIndex(a._prevValue)].classList.remove(v.SELECTED)},w._addSelectedLayout=function(){var a=this,b=a._valueToIndex(a.options.value);a._ui.items[b].classList.add(v.SELECTED)},w._show=function(a){var c=this,d=new l({}),g=null,h={value:f(c)};c._removeSelectedLayout(),g={animation:[{object:h,property:"value",to:c.options.value}],animationConfig:{duration:c.options.enabled?c.options.duration:1,timing:t.timing.ease}},c.state=g,c._objectValue=h,c._animation=d,d.set(g.animation,g.animationConfig),d.tick(e.bind(null,c)),d.start(function(){c._addSelectedLayout(),a&&b.event.trigger(c.element,"spinchange",{value:parseInt(c.options.value,10),dValue:parseInt(c.options.value,10)-parseInt(c._prevValue,10)})})},w._modifyItems=function(){var a,b=this,c=b.options,e=b.element,f=0,h=[].slice.call(e.querySelectorAll("."+v.ITEM)),i=c.max-c.min+1,j=i-h.length,k=null,l=0;if(j>0)for(;j>l;l++)k=g.createElement("div"),k.classList.add(v.ITEM),e.appendChild(k),h.push(k);else if(0>j)for(j=-j;j>l;l++)e.removeChild(h.pop());h.forEach(function(a,d){var e="";if(b.options.labels.length)e=b.options.labels[d];else if(e+=c.min+d,c.digits>0)for(;e.length<c.digits;)e="0"+e;a.innerHTML=e}),"container"===c.rollHeight?f=b._containerRect.height:"custom"===c.rollHeight?f=c.itemHeight:(k=h[0],f=k?k.getBoundingClientRect().height:b._containerRect.height),b._itemHeight=f,a=(b._containerRect.height-f)/2,h.forEach(function(e,f){var g=d(b.value,f,a,c);e.style.transform="translateY("+g.moveY+"px) scale("+g.scale+")",e.style.opacity=g.opacity}),b._ui.items=h},w._setItemHeight=function(a,b){b="string"==typeof b?parseInt(b.replace("px").trim(),10):b,this.options.itemHeight=b},w._refresh=function(){var a=this;a._containerRect=a.element.getBoundingClientRect(),a._modifyItems(),a._show()},w._init=function(){var a=this,b=a.options;b.min=b.min!==c?parseInt(b.min,10):0,b.max=b.max!==c?parseInt(b.max,10):0,b.value=b.value!==c?parseInt(b.value,10):0,b.duration=b.duration!==c?parseInt(b.duration,10):0,b.labels=Array.isArray(b.labels)?b.labels:b.labels.split(","),a.length=b.max-b.min+1,a._refresh()},w._build=function(a){return a.classList.add(v.SPIN),a},w._setValue=function(c,d){var e,f=this;c=a.parseInt(c,10),isNaN(c)?b.warn("Spin: value is not a number"):c!==f.options.value&&(c>=f.options.min&&c<=f.options.max||"enabled"===f.options.loop)&&(f._prevValue=f.options.value,"enabled"===f.options.loop&&(c>f.options.max?c=f.options.min:c<f.options.min&&(c=f.options.max)),f.options.value=c,e=f.state.animation[0],null!==e&&e.to!==e.current&&f._animation.stop(),f._show(d))},w._getValue=function(){return this.options.value},w._setMax=function(a,b){var d=this.options;d.max=b!==c?parseInt(b,10):0,this.length=d.max-d.min+1},w._setMin=function(a,b){var d=this.options;d.min=b!==c?parseInt(b,10):0,this.length=d.max-d.min+1},w._setLabels=function(a,b){var c=this;c.options.labels=b.split(","),c._refresh()},w._setModuloValue=function(a,b){this.options.moduloValue="enabled"===b?"enabled":"disabled"},w._setShortPath=function(a,b){this.options.shortPath="enabled"===b?"enabled":"disabled"},w._setLoop=function(a,b){this.options.loop="enabled"===b?"enabled":"disabled"},w._setDuration=function(b,c){this.options.duration=a.parseInt(c,10)},w._setEnabled=function(b,c){var d=this;return d.options.enabled="false"===c?!1:c,d.options.enabled?(b.classList.add(v.ENABLING),a.setTimeout(function(){b.classList.remove(v.ENABLING)},m),b.classList.add(v.ENABLED),j.on(g,"drag dragend",d)):(b.classList.add(v.ENABLING),a.setTimeout(function(){b.classList.remove(v.ENABLING),d.refresh()},m),b.classList.remove(v.ENABLED),j.off(g,"drag dragend",d)),this._prevValue=null,!0},w._setDirection=function(a,b){this.options.direction=["up","down"].indexOf(b)>-1?b:"up"},w._drag=function(b){var c,d,e=this;null===g.getElementById(e.element.id)?j.off(g,"drag dragend",e):e.options.enabled&&(d=e.value(),c=b.detail.deltaY-r,Math.abs(c)>p&&(e._setValue(d-Math.round(c/p),!0),r=b.detail.deltaY,a.navigator.vibrate(q)))},w._dragEnd=function(){r=0},w._click=function(a){var b=a.target,c=this,d=c._ui.items,e=c.value(),f=d.indexOf(b),g=c._valueToIndex(e);f>-1&&f!==g&&(g===d.length-1&&0==f?c._setValue(e+1,!0):0===g&&f==d.length-1?c._setValue(e-1,!0):g>f?c._setValue(e-1,!0):f>g&&c._setValue(e+1,!0))},w.handleEvent=function(a){switch(a.type){case"drag":this._drag(a);break;case"dragend":this._dragEnd(a);break;case"click":this._click(a)}},w._bindEvents=function(){var a=this;j.on(a.element,"click",a)},w._unbindEvents=function(){var a=this;j.off(a.element,"drag dragend",a),j.off(a.element,"click",a)},w._destroy=function(){var a=this,b=a.element;a._unbindEvents(),a._ui.items.forEach(function(a){a.parentNode.removeChild(a)}),b.classList.remove(v.SPIN)},t.prototype=w,b.widget.wearable.Spin=t,i.defineWidget("Spin","."+u,[],t,"wearable")}(a,d),function(){function a(a,b){var c=null;n.forEach(b,function(b){c=a[b],"number"==typeof c||Number.isInteger(c)||(a[b]=parseInt(c,10))})}function b(a,b){var c=null,d=b.width,e=b.height,f=b.degrees,g=b.tickHeight;return c=m.addRadius(a,{classes:b.classes,x:d/2,y:e/2,r:b.r,degrees:f,length:g,direction:"out",width:b.strokeWidth,color:b.color,animation:b.animation||!1})}function c(a,b){m.addCircle(a,{arcStart:0,arcEnd:360,r:b.r,width:b.width,color:b.color,fill:"none"})}function e(a,b){m.addArc(a,{arcStart:b.arcStart,arcEnd:b.arcEnd,r:b.r-50,width:b.width,color:b.color,fill:"none"})}function f(a,b){var c=m.createSVG(a._ui.element),d=null,e=a.options,f=0,g=parseInt(e.start,10),h=parseInt(b.r,10),i=0;return a._ui.svgIndicator=c,m.addCircle(c,{arcStart:0,arcEnd:360,r:h,width:8,color:b.color,fill:"transparent"}),d=c.querySelector("circle"),f=g-90,i=2*Math.PI*h,d.setAttribute("stroke-dasharray",""+i),c.style.transform="rotate("+f+"deg)",d.setAttribute("stroke-dashoffset",""+i),a.minimumCirclePoints=i,d}function g(a,b){var c=0,d=0,e=a+"";if(b>0&&e.toString().length<b)for(c=0,d=b-a.toString.length;d>c;c++)e="0"+e;return e}function h(a,b,c,d,e){var f=a.options,h=a._ui.svg,i=f.text,j=f.textDigits,k=f.textColor,l="",n=null,o="";n=m.polarToCartesian(c/2,d/2+8,f.textR,e),l=g(b,j),"rotated"===i&&(o="rotate("+e+","+n.x+","+(n.y-8)+")"),m.addText(h,{x:n.x,y:n.y,text:l,transform:o,color:k})}function i(a,c,d){var e=a.options,f=a._ui.svg,g=360/(e.to-e.from),i=d*g+e.start,j=c.getClientRects()[0],k=j.width,l=j.height;e.bigTick&&d%e.bigTick===0?(b(f,{degrees:i,width:k,height:l,tickHeight:e.bigTickHeight,classes:"ui-big",color:e.bigTickColor,strokeWidth:e.bigTickWidth,r:e.bigTickR}),"none"!==a.options.text&&h(a,d,k,l,i)):e.smallTick&&d%e.smallTick===0&&b(f,{degrees:i,width:k,height:l,tickHeight:e.smallTickHeight,classes:"ui-small",color:e.smallTickColor,strokeWidth:e.smallTickWidth,r:e.smallTickR})}function j(a,b){var d={r:b.circleR,width:b.circleWidth,color:b.circleColor};0!==b.circleStartArc||0!==b.circleEndArc?(d.arcStart=b.circleStartArc,d.arcEnd=b.circleEndArc,e(a,d)):c(a,d)}var k=d.widget.BaseWidget,l=d.engine,m=d.util.polar,n=d.util.array,o=function(){this.options={circleR:0,circleStartArc:0,circleEndArc:0,circleWidth:2,circleColor:"white",from:0,to:60,start:0,cut:0,text:"none",textR:180,textColor:"white",textDigits:0,bigTick:0,bigTickColor:"white",bigTickHeight:10,bigTickWidth:3,bigTickR:0,smallTick:0,smallTickHeight:5,smallTickWidth:1,smallTickR:0,smallTickColor:"white",indicatorType:"arc",indicatorColor:"red",indicatorHeight:40,indicatorWidth:2,indicatorR:180},this._ui={element:null},this.indicatorValue=0,this.minimumCirclePoints=0},p="ui-circleindicator",q={WIDGET:p},r=new k;o.classes=q,r._drawIndicator=function(a){var c=this,d=c.options,e=c._ui,g=e.svg,h=a.getClientRects()[0],i=h.width,j=h.height;switch(d.indicatorType){case"line":e.pointer=b(g,{degrees:c.indicatorValue+d.start,width:i,strokeWidth:d.indicatorWidth,height:j,tickHeight:d.indicatorHeight,r:d.indicatorR,classes:"ui-pointer",color:d.indicatorColor,animation:!0});break;case"arc":e.pointer=f(c,{r:d.indicatorR,color:d.indicatorColor})}},r._prepareTicksCircle=function(a){for(var b=this,c=b._ui.svg,d=b.options,e=0,f=d.cut>0&&d.cut<d.to?d.cut:d.to;f>e;)i(b,a,e),++e;d.circleR&&j(c,d)},r._build=function(b){var c=b.id,d=this,e=m.createSVG(b);return a(d.options,["to","from","textR","cut","bigTick","start","textDigits","bigTickR","smallTick","circleWidth","indicatorR","circleEndArc","circleStartArc","indicatorHeight","indicatorWidth","bigTickHeight","smallTickHeight"]),c||(b.id="tau-custom-widget-"+Date.now()),b.classList.add(p),d._ui={element:b,svgIndicator:null,pointer:null,svg:e},d._prepareTicksCircle(b),d._drawIndicator(b),b},r._getValue=function(){return this.indicatorValue},r._setValue=function(a){var b=this,c=b.options,d=b._ui,e=d.svg,f=d.pointer,g=c.indicatorType,h=d.element.getClientRects()[0],i=c.bigTickR,j=h.width,k=h.height,l=0,n=c.to;b.indicatorValue=a,"line"===g?m.updatePosition(e,".ui-pointer",{degrees:a*(j/n),classes:f.getAttribute("class"),color:f.getAttribute("stroke"),direction:"out",length:40,r:i,width:f.getAttribute("stroke-width"),x:j/2,y:k/2,animation:!0}):"arc"===g&&(l=b.minimumCirclePoints-a*b.minimumCirclePoints/n,f.setAttribute("stroke-dashoffset",""+l))},r._removeItems=function(){for(var a=this._ui.element;a.firstChild;)a.removeChild(a.firstChild)},r._removeTicksCircle=function(){var a,b=this._ui.svg.querySelectorAll(".ui-big, .ui-small"),c=b.length;for(a=0;c>a;a++)b[a].parentElement.removeChild(b[a]);
},r._refresh=function(){var a=this._ui.pointer;this._removeTicksCircle(),this._prepareTicksCircle(this.element),a.parentElement.appendChild(a)},r._destroy=function(){this._removeItems()},o.prototype=r,d.widget.wearable.CircleIndicator=o,l.defineWidget("CircleIndicator","."+q.WIDGET,[],o,"wearable")}(),function(a,b){function c(){var a=this;a.options={min:0,max:12,step:1,disabled:!1,accelerated:0},a._circleIndicator=null,a._spin=null,a._ui={number:null,page:null,container:null,indicator:null,buttonSet:null,label:null,footer:null}}function e(a){d.event.trigger(a.element,"change",{value:a.value()}),history.back()}function f(a,b){var c=parseInt(a.options.step,10),d=Date.now(),e=parseInt(a.options.accelerated,10);a._spin.option("enabled")&&(e&&(d-a._previousRotaryTime<30&&(c*=e),a._previousRotaryTime=d),"CW"===b.detail.direction?a.value(a.value()+c):a.value(a.value()-c))}function g(a,b){b?a._ui.number.classList.contains("enabled")||(a._ui.label.classList.add(p.HIDDEN),a._spin.option("enabled",!0)):a._ui.number.classList.contains("enabled")&&(a._ui.label.classList.remove(p.HIDDEN),a._spin.option("enabled",!1))}function h(a,b){var c=b.target;c&&g(a,j.getClosestByClass(c,m)===a._ui.number)}function i(a,b){var c=b.target;c&&(a.element.value=b.detail.value,a.element.setAttribute("value",b.detail.value))}var j=d.util.selectors,k=new d.widget.BaseWidget,l=d.widget.wearable.Spin,m=l.classes.SPIN,n="ui-number-picker",o="input[type='number']",p={CONTAINER:n+"-container",NUMBER:n+"-number",NUMBER_BLINK:n+"-number-blink",LABEL:n+"-label",LABEL_PRESSED:n+"-label-pressed",BUTTON_SET:n+"-set",DISABLED:n+"-disabled",HIDDEN:"hidden"};c.classes=p,k._extractLabel=function(a){var c="",d=null;return c=a.getAttribute("id"),c&&(d=b.querySelector('*[for="'+c+'"]')),d||(d=j.getClosestByTag(a,"label")),d&&a.parentElement===d&&d.parentElement.replaceChild(a,d),d||(d=b.createElement("label"),a.parentNode.appendChild(d)),d},k._findFooter=function(a){var c=j.getClosestBySelector(a,".ui-page, .ui-popup"),d=null,e=null;return c&&(e=c.querySelector("footer, .ui-footer, .ui-popup-footer"),e||(e=b.createElement("footer"),c.appendChild(e)),d=e.classList,d.add("ui-footer"),d.add("ui-bottom-button"),d.add("ui-fixed")),e},k._createWidgets=function(a){var b=this,c=b._ui,e=b.options;b._circleIndicator=d.widget.CircleIndicator(c.indicator,{text:e.circleType||"none",circleR:e.circleR||0,from:e.from||0,to:e.to||360,indicatorType:"line",indicatorHeight:21,indicatorColor:"rgba(249,123,47,1)",indicatorWidth:6,indicatorR:180,bigTick:e.bigTick||0,bigTickR:e.bigTickR||0,bigTickHeight:e.bigTickHeight||0,bigTickWidth:e.bigTickWidth,smallTick:e.smallTick||0,smallTickR:e.smallTickR||0,smallTickHeight:e.smallTickHeight||0}),a&&(b._spin=d.widget.Spin(c.number,{min:b.options.min,max:b.options.max,loop:"enabled",rollHeight:"custom",itemHeight:38,duration:300,value:a.value}))},k._getOptions=function(a){var b=this.options;a=this.element||a,b.min=parseInt(a.getAttribute("min"),10),b.max=parseInt(a.getAttribute("max"),10),b.step=parseInt(a.getAttribute("step"),10),b.disabled=a.getAttribute("disabled",10)},k._configure=function(a){this._getOptions(a)},k._toggle=function(a){var b=this;b.options.disabled=a,a?b._ui.container.classList.add(p.DISABLED):b._ui.container.classList.remove(p.DISABLED)},k._toggleCircleIndicator=function(a){var b=this;a?b._circleIndicator.element.classList.remove(p.HIDDEN):b._circleIndicator.element.classList.add(p.HIDDEN)},k._refresh=function(){var a=this,b=a.element;a._getOptions(),a._setValue(b.getAttribute("value")),a._toggleCircleIndicator(!1),a._toggle(!!a.options.disabled)},k._updateValue=function(a){this._spin.value(a)},k._getValue=function(){return parseInt(this.element.value,10)},k._setValue=function(a){var b=this,c=b.element,d=b.options;a=parseInt(a,10),a>d.max?a=d.min:a<d.min&&(a=d.max),c.setAttribute("value",a),c.value=a,b._updateValue(a)},k._init=function(){var a=this;a.value(a.element.value),a._toggle(!!a.options.disabled),a._toggleCircleIndicator(!1)},k._build=function(a){var c=this,d=c._ui,e=b.createElement("div"),f=j.getClosestBySelector(a,".ui-page, .ui-popup"),g=b.createElement("div"),h=b.createElement("div"),i=b.createElement("button"),k=null,l=null;return k=c._extractLabel(a),l=c._findFooter(a),g.classList.add(p.CONTAINER),h.classList.add(p.NUMBER),k.classList.add(p.LABEL),i.innerHTML="Set",i.classList.add("ui-btn"),i.classList.add(p.BUTTON_SET),l.appendChild(i),g.appendChild(h),g.appendChild(e),g.appendChild(k),a.parentElement.appendChild(g),g.appendChild(a),d.indicator=e,d.parent=f,d.container=g,d.number=h,d.buttonSet=i,d.label=k,d.footer=l,c._createWidgets(a),a},k._destroy=function(){var a=this,b=a._ui,c=b.container,d=b.footer;a._unbindEvents(),a._circleIndicator.destroy(),c.classList.remove(p.CONTAINER),b.number.classList.remove(p.NUMBER),b.label.classList.remove(p.LABEL),b.buttonSet.classList.remove(p.BUTTON_SET),d.classList.remove("ui-bottom-button"),c.parentElement&&c.parentElement.replaceChild(a.element,c)},k._bindEvents=function(){var a=this;a._onSet=e.bind(null,a),a._onRotary=f.bind(null,a),a._onNumberClick=h.bind(null,a),a._onNumberChange=i.bind(null,a),a._ui.buttonSet.addEventListener("click",a._onSet),a._ui.parent.addEventListener("click",a._onNumberClick),a._ui.number.addEventListener("spinchange",a._onNumberChange),b.addEventListener("rotarydetent",a._onRotary)},k._unbindEvents=function(){var a=this;a._ui.buttonSet.removeEventListener("click",a._onSet),a._ui.parent.removeEventListener("click",a._onNumberClick),a._ui.number.removeEventListener("spinchange",a._onNumberChange),b.removeEventListener("rotarydetent",a._onRotary)},c.prototype=k,d.widget.wearable.NumberPicker=c,d.engine.defineWidget("NumberPicker",o,[],c,"")}(a,a.document),function(a,b,c){function d(){var a=this;a._circleIndicator=null,a._circleIndicatorSupporter=null,a._actualMax=0,a.rotaryControler=0,a._rotation=0,a._spins=null,g.call(a)}var e=c.event,f=c.util.selectors.getClosestByClass,g=c.widget.wearable.NumberPicker,h=Object.create(g.prototype),i="ui-time-picker",j={CONTAINER:i+"-container",HOURS_CONTAINER:i+"-container-hours",MINUTES_CONTAINER:i+"-container-minutes",AMPM_CONTAINER:i+"-container-ampm",AMPM_PRESSED:i+"-container-ampm-pressed",COLON:i+"-colon-container",AMPM:i+"-am-pm",AMPM_INNER_CONTAINER:i+"-am-pm-inner-container",NO_AMPM:i+"-no-am-pm",ACTIVE_LABEL:i+"-active-label",ACTIVE_LABEL_ANIMATION:i+"-active-label-animation",SHOW_PM_ANIMATION:i+"-show-pm",HIDE_PM_ANIMATION:i+"-hide-pm",DISABLE_ANIMATION:i+"-disable-animation",CIRCLE_INDICATOR_BACKGROUND:i+"-background",HIDDEN:i+"-hidden",HIDDEN_LABEL:"ui-number-picker-label-hidden"},k="."+i,l=300;h._configure=function(){var a=this.options;a.circleType="none",a.circleR=0,a.from=0,a.to=12,a.format=a.format||"H"},h._init=function(){var a=this,b=new Date,c=a._ui,d=c.numberHours,e=c.numberPickerHoursInput;a._setValue(b),"H"===a.options.format?a._maxHour=24:a._maxHour=12,d.classList.add(j.ACTIVE_LABEL),d.classList.add(j.ACTIVE_LABEL_ANIMATION),a._actualMax=parseInt(e.max,10),a._toggleCircleIndicator(),a._circleIndicator.option("to",12),a._showIndicator()},h._buildAMPM=function(a,c){var d,e,f,g,h=this,i=h._ui;"h"===h.options.format?(d=b.createElement("div"),d.classList.add(j.AMPM_CONTAINER),c.appendChild(d),g=b.createElement("div"),g.classList.add(j.AMPM_INNER_CONTAINER),d.appendChild(g),e=b.createElement("span"),f=b.createElement("span"),e.innerHTML="AM",f.innerHTML="PM",g.appendChild(e),g.appendChild(f),h.options.amOrPm="AM",i.amOrPmContainer=d,a.classList.add(j.AMPM)):a.classList.add(j.NO_AMPM)},h._build=function(a){var c,d=this,e=d._ui,f=b.createElement("div"),h=b.createElement("div"),i=b.createElement("button"),k=b.createElement("span"),l=d._addIndicator("Hours"),m=b.createElement("div"),n=d._addIndicator("Minutes");return c=d._findFooter(a),i.innerHTML="SET",a.classList.add(g.classes.CONTAINER),i.classList.add("ui-btn"),i.classList.add(g.classes.BUTTON_SET),l.classList.add(j.HOURS_CONTAINER),l.classList.add(j.CONTAINER),m.classList.add(j.COLON),n.classList.add(j.MINUTES_CONTAINER),n.classList.add(j.CONTAINER),k.innerHTML=":",a.appendChild(l),a.appendChild(m),a.appendChild(n),m.appendChild(k),d._buildAMPM(l,a),a.appendChild(h),a.appendChild(f),c.appendChild(i),e.indicator=f,e.indicatorMinutes=h,e.buttonSet=i,e.footer=c,d._createWidgets(a),d._buildNumberPicker(),d._circleIndicator.element.classList.add(j.CIRCLE_INDICATOR_BACKGROUND),a},h._onRotary=function(a){var c,d,e=this,f=b.querySelector("."+j.ACTIVE_LABEL);f&&(d=f.parentElement.children[2],c=parseInt(d.value,10),"CW"===a.detail.direction?(c++,c%e._circleIndicator.options.to===0&&e._rotation++):(c--,(c-e._circleIndicator.options.to)%e._circleIndicator.options.to===-1&&e._rotation--),e.value(c))},h._onClick=function(b){var c=this,d=c._ui,e=b.target,g=d.numberHours,h=d.numberMinutes,i=d.numberPickerHoursInput,k=d.amOrPmContainer,m=f(e,j.CONTAINER);m&&m.classList.contains(j.HOURS_CONTAINER)?(g.classList.add(j.ACTIVE_LABEL),h.classList.remove(j.ACTIVE_LABEL),d.labelHours.classList.add(j.HIDDEN_LABEL),d.labelMinutes.classList.remove(j.HIDDEN_LABEL),g.classList.add(j.ACTIVE_LABEL_ANIMATION),h.classList.remove(j.ACTIVE_LABEL_ANIMATION),c._actualMax=parseInt(i.max,10),c._circleIndicator.option("to",12),c._spins&&(c._spins.Minutes.option("enabled")&&c._spins.Minutes.option("enabled",!1),c._spins.Hours.option("enabled")||c._spins.Hours.option("enabled",!0))):m&&m.classList.contains(j.MINUTES_CONTAINER)?(g.classList.remove(j.ACTIVE_LABEL),h.classList.add(j.ACTIVE_LABEL),d.labelHours.classList.remove(j.HIDDEN_LABEL),d.labelMinutes.classList.add(j.HIDDEN_LABEL),g.classList.remove(j.ACTIVE_LABEL_ANIMATION),h.classList.add(j.ACTIVE_LABEL_ANIMATION),c._actualMax=60,c._circleIndicator.option("to",60),c._spins&&(c._spins.Hours.option("enabled")&&c._spins.Hours.option("enabled",!1),c._spins.Minutes.option("enabled")||c._spins.Minutes.option("enabled",!0))):e.parentElement.classList.contains(j.AMPM_INNER_CONTAINER)?(k.classList.add(j.AMPM_PRESSED),a.setTimeout(function(){k.classList.remove(j.AMPM_PRESSED)},l),"AM"===c.options.amOrPm?(k.firstElementChild.classList.remove(j.HIDE_PM_ANIMATION),k.firstElementChild.classList.add(j.SHOW_PM_ANIMATION),c.options.amOrPm="PM"):(k.firstElementChild.classList.remove(j.SHOW_PM_ANIMATION),k.firstElementChild.classList.add(j.HIDE_PM_ANIMATION),c.options.amOrPm="AM")):e.classList.contains("ui-number-picker-set")?(c.trigger("change",{value:c.value()}),history.back()):(d.labelHours.classList.remove(j.HIDDEN_LABEL),d.labelMinutes.classList.remove(j.HIDDEN_LABEL),c._spins&&(c._spins.Hours.option("enabled",!1),c._spins.Minutes.option("enabled",!1)))},h._onSpinChange=function(a){var b=this,c=f(a.target,j.CONTAINER);c&&b.value(a.detail.value)},h.handleEvent=function(a){var b=this;switch(a.type){case"click":a.preventDefault(),b._onClick(a);break;case"rotarydetent":a.preventDefault(),b._onRotary(a);break;case"spinchange":b._onSpinChange(a)}},h._hideIndicator=function(){this._circleIndicator.element.querySelector(".ui-polar").style.visibility="hidden"},h._showIndicator=function(){this._circleIndicator.element.querySelector(".ui-polar").style.visibility="visible"},h._addIndicator=function(a){var c=this,d=c._ui,e=b.createElement("div"),f=b.createElement("input"),h=b.createElement("label"),i=b.createElement("div");return e.classList.add(g.classes.NUMBER),h.classList.add(g.classes.LABEL),"Hours"===a?(h.innerText="Hrs","H"===c.options.format?(f.min="0",f.max="24"):(f.min="1",f.max="12")):"Minutes"===a&&(h.innerText="Mins",f.min="0",f.max="60"),f.type="number",f.step="1",f.value="0",i.appendChild(h),i.appendChild(e),i.appendChild(f),d["number"+a]=e,d["label"+a]=h,d["numberPicker"+a+"Input"]=f,d["numberPicker"+a+"Container"]=i,i},h._buildNumberPicker=function(){var a,b=this,d=b._ui,e=["Hours","Minutes"];b._spins={},e.forEach(function(e){var f=d["number"+e],g=d["numberPicker"+e+"Input"];switch(e){case"Hours":a={min:parseInt(g.min,10),max:"H"===b.options.format?parseInt(g.max,10)-1:parseInt(g.max,10),loop:"enabled",rollHeight:"custom",itemHeight:50,duration:300,digits:2,scaleFactor:.6,moveFactor:.445,value:parseInt(g.value,10)};break;case"Minutes":a={min:0,max:59,loop:"enabled",rollHeight:"custom",itemHeight:50,duration:300,digits:2,scaleFactor:.6,moveFactor:.445,value:parseInt(g.value,10)}}b._spins[e]=c.widget.Spin(f,a)})},h._setDateValue=function(a){var b,c,d=this,e=d._ui;b=a.getHours(),c=a.getMinutes(),"h"===d.options.format&&(b>12?(b-=12,d.options.amOrPm="PM"):d.options.amOrPm="AM"),e.numberPickerHoursInput.setAttribute("value",b),e.numberPickerHoursInput.value=b,e.numberPickerMinutesInput.setAttribute("value",c),e.numberPickerMinutesInput.value=c,d._spins&&(d._spins.Hours.value(b),d._spins.Minutes.value((10>c?"0":"")+c)),d._actualMax=parseInt(e.numberPickerHoursInput.max,10)},h._setValue=function(a){var c,d,e,f=this;a instanceof Date?f._setDateValue(a):(a=parseInt(a,10),d=b.querySelector("."+j.ACTIVE_LABEL),d&&(c=d.parentElement.children[2],c.setAttribute("value",a),e=12===f._circleIndicator.options.to?(f._maxHour+a)%f._maxHour:(f._circleIndicator.options.to+a)%f._circleIndicator.options.to,"h"===f.options.format&&12===f._circleIndicator.options.to&&0===e&&(e=12),c.value=e,f._spins&&(60===f._circleIndicator.options.to?f._spins.Minutes.value((10>e?"0":"")+e):f._spins.Hours.value(e))))},h._toggleCircleIndicator=function(){var a=this;a.options.indicator?a._circleIndicator.element.classList.remove(j.HIDDEN):a._circleIndicator.element.classList.add(j.HIDDEN)},h._destroy=function(){var a=this,b=a._ui,c=a.element;for(a._circleIndicator.destroy();c.firstChild;)c.removeChild(c.firstChild);b.footer.classList.remove("ui-bottom-button"),b.footer.children.length&&b.footer.removeChild(b.buttonSet),a._unbindEvents()},h._bindEvents=function(){var a=this,c=a._ui;e.on(b,"rotarydetent",a,!0),e.on(b,"click",a,!0),e.on(c.numberMinutes,"spinchange",a,!0),e.on(c.numberHours,"spinchange",a,!0)},h._unbindEvents=function(){var a=this,c=a._ui;e.off(b,"rotarydetent",a,!0),e.off(b,"click",a,!0),e.on(c.numberMinutes,"spinchange",a,!0),e.on(c.numberHours,"spinchange",a,!0)},d.prototype=h,d.prototype.constructor=d,c.widget.wearable.TimePicker=d,c.engine.defineWidget("TimePicker",k,[],d,"")}(a,a.document,a.tau),function(a,b){var c,d=b.widget.wearable.Selector,e=b.engine,f=function(){var a=this;a.options={},d.call(a)},g={red:"#FE0030",darkorange:"#FE5E34",orange:"#FE8E38",yellow:"#FEEE43",yellowgreen:"#82C350",green:"#00B455",darkturquoise:"#00A99C",deepskyblue:"#00B0EA",darkblue:"#0058A1",purple:"#6A338D",grey:"#727272"},h="ui-colorpicker",i={WIDGET:h,SELECTOR:"ui-selector",ITEM:"ui-item",INDICATOR:"ui-selector-indicator-text",ITEM_ACTIVE:"ui-item-active"},j=new d;f.events={},j._build=function(a){var b=this;return b._createItems(a),d.prototype._build.call(b,a),a.classList.add(h,i.SELECTOR),a},j._createItems=function(b){var c,d=i.ITEM;Object.keys(g).forEach(function(e){c=a.createElement("div"),c.classList.add(d),c.style.backgroundColor=g[e],c.setAttribute("data-title",e),b.appendChild(c)})},j._setActiveItem=function(a){var b,e,f=this;d.prototype._setActiveItem.call(f,a),e=f.element.querySelector("."+i.INDICATOR),b=f.element.querySelector("."+i.ITEM_ACTIVE).getAttribute("data-title"),c=g[b],e.style.backgroundColor=c},j.getSelectedColor=function(){return c},j._destroy=function(){var a=this,b=a.element;d.prototype._destroy.call(a),b.innerHTML=""},f.prototype=j,b.widget.wearable.ColorPicker=f,e.defineWidget("ColorPicker",".ui-colorpicker",["getSelectedColor"],f)}(a.document,d),function(a,b){function e(){var a=this;a._ui={display:{},dayNameContainer:null,footer:null},a.options={min:0,max:12,step:1,disabled:!1},a._circleIndicatorSupporter=null,a._activeSelector=null,a._spins={}}var f=d.widget.BaseWidget,g=d.engine,h=d.event,i=d.widget.wearable.NumberPicker,j=new f,k=d.util.selectors.getClosestByClass,l="ui-date-picker",m={CONTAINER:l+"-container",CONTAINER_PREFIX:l+"-container-",DAYNAME_CONTAINER:l+"-containter-dayname",ACTIVE_LABEL_ANIMATION:l+"-active-label-animation",HIDDEN:l+"-hidden",LABEL_HIDDEN:"ui-number-picker-label-hidden"},n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],p="."+l,q={month:{to:12,bigTick:1,bigTickHeight:20,smallTick:0},year:{to:50,bigTickHeight:13,bigTick:5,smallTick:1},day:{to:30,bigTickHeight:13,bigTick:2,smallTick:1}},r=1900,s=2050,t=["month","day","year"];j._init=function(){this._setValue(new Date),this._setActiveSelector("month")},j._bindEvents=function(){var a=this;a.on("click",a,!0),h.on(a._ui.display.day,"spinchange",a,!1),h.on(a._ui.display.month,"spinchange",a,!1),h.on(a._ui.display.year,"spinchange",a,!1),h.on(b,"rotarydetent",a,!0)},j._unbindEvents=function(){var a=this;h.off(b,"rotarydetent",a,!0),a.off("click",a,!0)},j._build=function(a){var c=this,d=c._ui,e=b.createElement("footer"),f=b.createElement("button"),g=b.createElement("div");return f.innerHTML="SET",a.classList.add(i.classes.CONTAINER),f.classList.add("ui-btn",i.classes.BUTTON_SET),e.classList.add("ui-footer","ui-bottom-button","ui-fixed"),g.classList.add(m.DAYNAME_CONTAINER),t.forEach(function(b){a.appendChild(c._createContainer(b))}),a.appendChild(g),a.appendChild(e),e.appendChild(f),d.buttonSet=f,d.dayNameContainer=g,d.footer=e,c._buildNumberPicker(),a},j._buildNumberPicker=function(){var a=this,b=a._ui.display;Object.keys(b).forEach(function(c){var e;switch(c){case"month":e={min:1,max:o.length,loop:"enabled",labels:o.join(","),rollHeight:"custom",itemHeight:50,duration:300,value:2};break;case"day":e={min:1,max:31,loop:"enabled",rollHeight:"custom",itemHeight:50,duration:300,value:1};break;case"year":e={min:r,max:s,loop:"enabled",rollHeight:"custom",itemHeight:50,duration:300,value:1}}a._spins[c]=d.widget.Spin(b[c],e)})},j._setOptionsTo=function(a,b){var c=q[a];b&&(c.to=b)},j._createContainer=function(a){var c=this,d=c._ui,e=b.createElement("div"),f=b.createElement("label"),g=b.createElement("div");return e.classList.add(i.classes.NUMBER),g.classList.add(m.CONTAINER),f.classList.add(i.classes.LABEL),f.innerText=a[0].toUpperCase()+a.substr(1),g.appendChild(f),g.appendChild(e),g.classList.add(m.CONTAINER_PREFIX+a),d.display[a]=e,g},j._setValue=function(a){var b=this,c=b._ui,d=n[a.getDay()];b._value=a,Object.keys(c.display).forEach(function(a){b._spins[a].value(b._getValue(a))}),c.dayNameContainer.innerHTML=d},j._getValue=function(a){var b=this._value;switch(a){case"month":return b.getMonth()+1;case"day":return b.getDate();case"year":return b.getFullYear();default:return b}},j._getTextValue=function(a){var b=this._value;switch(a){case"month":return o[b.getMonth()];case"day":return b.getDate();case"year":return b.getFullYear();default:return b}},j._getIndicatorValue=function(a){var b=this._value;switch(a){case"month":return b.getMonth()+1;case"day":return b.getDate();case"year":return b.getFullYear()%50;default:return b}},j._daysInMonth=function(a,b){return a===c&&(a=this._getValue("year")),b===c&&(b=this._getValue("month")-1),new Date(a,b+1,0).getDate()},j.handleEvent=function(a){var b=this;"click"===a.type?(a.preventDefault(),b._onClick(a)):"rotarydetent"===a.type?(a.preventDefault(),b._onRotary(a)):"spinchange"===a.type&&b._onSpinChange(a.detail.value)},j._getMaxValue=function(a){switch(a){case"day":return this._daysInMonth();case"year":return 50;default:return 12}},j._setLabelVisible=function(a,b){var c=k(this._ui.display[a],m.CONTAINER),d=c.querySelector("."+i.classes.LABEL);b?d.classList.remove(m.LABEL_HIDDEN):d.classList.add(m.LABEL_HIDDEN)},j._setActiveSelector=function(a){var b=this,c=b._ui,d=b._getMaxValue(a),e=b._spins;b._activeSelector!==a&&(a&&b._setOptionsTo(a,d),Object.keys(c.display).forEach(function(a){e[a].option("enabled")&&(e[a].option("enabled",!1),b._setLabelVisible(a,!0))}),a&&e[a]&&(e[a].option("enabled",!0),b._setLabelVisible(a,!1))),b._activeSelector=a},j._onClick=function(a){var b=this,c=a.target,d=k(c,m.CONTAINER),e=d?d.className:"",f="";e&&(f=e.replace(m.CONTAINER_PREFIX,"").replace(m.CONTAINER,"").trim()),d&&f&&t.indexOf(f)>-1?b._setActiveSelector(f):c.classList.contains("ui-number-picker-set")?(b.trigger("change",{value:b.value()}),history.back()):b._setActiveSelector("")},j._destroy=function(){this._unbindEvents(),this.element.innerHTML=""},j._changeMonth=function(a){var b,c,d=this,e=d.value(),f=e.getMonth(),g=e.getDate(),h=e.getFullYear();b=f+a,e.setMonth(b),e.setFullYear(h),c=d._daysInMonth(h,b),g>c&&d._daysInMonth(h,f)>c&&(e=new Date(h,b,c)),d._changeValue(e)},j._changeDay=function(a){var b,c=this,d=c.value(),e=d.getMonth(),f=d.getDate(),g=d.getFullYear(),h=c._daysInMonth(g,e);b=f+a,0>a&&1===f?d.setDate(h):d.setDate(b),d.setMonth(e),d.setFullYear(g),c._changeValue(d)},j._changeYear=function(a){var b,c=this,d=c.value(),e=d.getMonth(),f=d.getFullYear(),g=f+a;g>s?g=r:r>g&&(g=s),d.setFullYear(g),b=c._daysInMonth(d.getFullYear(),1),1===e&&c._daysInMonth(f,1)>b&&(d.setMonth(1),d.setDate(b)),c._changeValue(d)},j._changeValue=function(a){var b=this;b._setValue(a)},j._onRotary=function(a){var b,c=this,d=a.detail.direction;switch(b="CW"===d?1:-1,c._activeSelector){case"month":c._changeMonth(b);break;case"day":c._changeDay(b);break;case"year":c._changeYear(b)}},j._onSpinChange=function(a){var b,c=this,d=c.value();switch(c._activeSelector){case"month":b=d.getMonth()+1,c._changeMonth(a-b);break;case"day":b=d.getDate(),c._changeDay(a-b);break;case"year":b=d.getFullYear(),c._changeYear(a-b)}},e.prototype=j,e.prototype.constructor=e,d.widget.wearable.DatePicker=e,g.defineWidget("DatePicker",p,[],e,"")}(a,a.document),function(b,c){var d=c.widget.BaseWidget,e=c.engine,f=c.event,g=c.util.selectors,h=function(){var a=this;a._initialWindowHeight=null,a._hasFocus=!1,a._isInputPaneVisible=!1,a._ui={}},i=new d;h.events={},i._build=function(c){var d,e,f=this,h=f._ui;return e=g.getClosestByClass(c,"ui-page"),e&&(d=g.getChildrenByClass(e,"ui-textinput-pane")[0],d||(d=b.createElement("div"),d.classList.add("ui-textinput-pane"),e.appendChild(d))),h.page=e,h.pane=d,this._initialWindowHeight=a.innerHeight,c},i._init=function(a){var b=this;return b._hideInputPaneBound=b._hideInputPane.bind(b),b._windowResizeBound=b._onWindowResize.bind(b),b._onHWKeyBound=b._onHWKey.bind(b),a},i._bindEvents=function(a){var b=this;f.on(a,"focus",b,!0),f.on(a,"blur",b,!0)},i._showInputPane=function(){var b=this,c=b._ui,d=c.pane,e=b.element,g=e.cloneNode(!0);d.appendChild(g),d.style.display="block",b._isInputPaneVisible=!0,g.focus(),f.on(g,"blur",b._hideInputPaneBound,!0),f.on(a,"resize",b._windowResizeBound,!0),f.on(a,"tizenhwkey",b._onHWKeyBound,!0)},i._hideInputPane=function(){var b,c=this,d=c._ui,e=d.pane,g=c.element;c._isInputPaneVisible&&(b=e.lastChild,g.value=b.value,f.off(b,"blur",c._hideInputPaneBound,!0),e.removeChild(b),e.style.display="none",f.off(a,"resize",c._windowResizeBound,!0),f.off(a,"tizenhwkey",c._onHWKeyBound,!0),c._isInputPaneVisible=!1)},i.handleEvent=function(a){var b=this;switch(a.type){case"focus":b._onFocus(a);break;case"blur":b._onBlur(a)}},i._onFocus=function(a){var b=this;a.preventDefault(),b.element.blur(),b._isInputPaneVisible||b._showInputPane()},i._onWindowResize=function(){var b=this,c=a.innerHeight;c===b._initialWindowHeight&&b._isInputPaneVisible&&b._hideInputPane()},i._onBlur=function(a){var b=this;a.preventDefault(),b._isInputPaneVisible&&b._hideInputPane()},i._onHWKey=function(a){"back"===a.keyName&&(a.preventDefault(),a.stopPropagation(),this._hideInputPane())},i.focus=function(){this.element.focus()},i.blur=function(){this.element.blur()},h.prototype=i,c.widget.wearable.TextInput=h,e.defineWidget("TextInput","input[type='text'], input[type='number'], input[type='password'], input[type='email'], input[type='url'], input[type='tel'], input[type='search']",[],h,"wearable")}(a.document,d),function(a){a.helper=a.helper||{}}(d),function(a,b,c){var d=c.engine,e=function(a,b){this._snapListviewWidget=d.instanceWidget(a,"SnapListview",b)},f=e.prototype;f.destroy=function(){var a=this;a._snapListviewWidget&&a._snapListviewWidget.destroy(),a._snapListviewWidget=null},f.getSnapList=function(){return this._snapListviewWidget},e.create=function(a,b){return new e(a,b)},c.helper.SnapListStyle=e}(b,a,d),function(a,b,c){var d=c.engine,e=c.helper,f=c.util.object,g={marqueeDelay:0,marqueeStyle:"slide",speed:60,iteration:1,timingFunction:"linear",ellipsisEffect:"gradient",runOnlyOnEllipsisText:!0,autoRun:!1,snapListview:!0},h=function(a,b){var c=this;c.options=f.fastMerge({},g),f.fastMerge(c.options,b),c._listviewWidget=null,c._selectedMarqueeWidget=null,c.element=a},i=h.prototype;i._instanceMarquee=function(){var a,b=this,c=b._marqueeElement;b._destroyMarqueeWidget(),c&&(a=d.instanceWidget(c,"Marquee",b.options),a.start(),b._marqueeElement=null,b._selectedMarqueeWidget=a)},i._clickHandlerForRectangular=function(a){var b=this,c=a.target,d=b._selectedMarqueeWidget;d&&c.parentElement===d.element?"running"===d._state?d.reset():d.start():c&&c.classList.contains("ui-marquee")&&(b._marqueeElement=c,requestAnimationFrame(b._instanceMarquee.bind(b)))},i._scrollHandlerForRectangular=function(){this._destroyMarqueeWidget()},i._destroyMarqueeWidget=function(){var a=this._selectedMarqueeWidget;a&&(a.stop(),a.reset(),a.destroy(),this._selectedMarqueeWidget=null)},i._touchStartHandler=function(){this._selectedMarqueeWidget&&this._selectedMarqueeWidget.reset()},i._scrollEndHandler=function(){this._destroyMarqueeWidget()},i._selectedHandler=function(a){var b=this,c=a.target.querySelector(".ui-marquee");c&&(b._marqueeElement=c,requestAnimationFrame(b._instanceMarquee.bind(b)))},i.handleEvent=function(a){var b=this;switch(a.type){case"click":b._clickHandlerForRectangular(a);break;case"scroll":b._scrollHandlerForRectangular(a);break;case"rotarydetent":case"touchstart":b._touchStartHandler(a);break;case"scrollend":b._scrollEndHandler(a);break;case"selected":b._selectedHandler(a)}},i.init=function(){var a,b=this,e=b.element,f=b.options;f.delay=f.delay||f.marqueeDelay,c.support.shape.circle?b._bindEventsForCircular():(b._bindEventsForRectangular(),f.snapListview=!1),a=f.snapListview?"SnapListview":"Listview",b._listviewWidget=d.instanceWidget(e,a,f)},i._bindEventsForRectangular=function(){a.addEventListener("click",this,!1),a.addEventListener("scroll",this,!0)},i._unbindEventsForRectangular=function(){a.removeEventListener("click",this,!1),a.removeEventListener("scroll",this,!0)},i._bindEventsForCircular=function(){var b=this;a.addEventListener("touchstart",b,!1),a.addEventListener("scrollend",b,!1),a.addEventListener("rotarydetent",b,!1),a.addEventListener("selected",b,!1)},i._unbindEventsForCircular=function(){var b=this;a.removeEventListener("touchstart",b,!1),a.removeEventListener("scrollend",b,!1),a.removeEventListener("rotarydetent",b,!1),a.removeEventListener("selected",b,!1)},i.destroy=function(){var a=this;c.support.shape.circle?a._unbindEventsForCircular():a._unbindEventsForRectangular(),a._destroyMarqueeWidget(),a._listviewWidget&&(a._listviewWidget.destroy(),a._listviewWidget=null),a.options=null},h.create=function(a,b){var c=new h(a,b);return c.init(),c},e.SnapListMarqueeStyle=h,e.ListMarqueeStyle=h}(b,a,d),function(a,b,c){function d(a){h.on(a,"touchstart touchend mousedown mouseup",this,!1)}function e(a){h.off(a,"touchstart touchend mousedown mouseup",this,!1)}var f=c.engine,g=c.util.object,h=c.event,i=c.util.selectors,j={more:".ui-more",selector:".ui-selector"},k={page:"ui-page"},l=function(a,b){var c=this;c.options=g.merge({},j),c._drawerWidget=null,c._handlerElement=null,c._selectorWidget=null,c.init(a,b)},m=l.prototype;m.handleEvent=function(a){var b=this;switch(a.type){case"touchstart":case"mousedown":b._onTouchStart(a);break;case"touchend":case"mouseup":b._onTouchEnd(a)}},m._onTouchStart=function(a){a.preventDefault(),a.stopPropagation()},m._onTouchEnd=function(){this._drawerWidget.close()},m.init=function(a,b){var c,d,e=this,h=i.getClosestByClass(a,k.page);g.fastMerge(e.options,b),c=h.querySelector(e.options.handler),d=a.querySelector(e.options.selector),e._drawerWidget=f.instanceWidget(a,"Drawer"),c&&(e._drawerWidget.setDragHandler(c),e._handlerElement=c,e._bindEvents()),d&&(e._selectorWidget=f.instanceWidget(d,"Selector"))},m._bindEvents=function(){var a=this;d.call(a,a._handlerElement)},m._unbindEvents=function(){var a=this;e.call(a,a._handlerElement)},m.destroy=function(){var a=this;a._handlerElement&&a._unbindEvents(),a._drawerWidget=null,a._handlerElement=null,a._selectorWidget=null},l.create=function(a,b){return new l(a,b)},c.helper.DrawerMoreStyle=l}(b,a,d),function(a,b,d){function e(a,b,c,d){return function(a){var c=1-a,e=3*c,f=a*a,g=f*a,h=e*a*c,i=e*f;return a>1?1:h*b+i*d+g}}function f(a,c,d,f){var g=e(.25,.46,.45,1),h=0,i=0,j=0,l=0,m=d-c,n=c;h=b.performance.now(),k=b.requestAnimationFrame(function o(){var c;i=b.performance.now(),j=(i-h)/f,l=g(j),c=m*l,a.scrollTop=n+c,k=1>j&&j>=0?b.requestAnimationFrame(o):null})}function g(a){b.addEdgeEffectONSCROLLTizenUIF&&("CW"===a?b.addEdgeEffectONSCROLLTizenUIF(!1,!0,!1,!1):b.addEdgeEffectONSCROLLTizenUIF(!0,!1,!1,!1))}function h(){null!==k&&(b.cancelAnimationFrame(k),k=null)}var i=d.util.object,j=d.util.selectors,k=null,l=function(a,b){var c=this;c._elScroller=null,c._scrollTop=0,c._dest=0,c._scrollMax=0,c._callbacks={},c.options={scrollDistance:119,scrollDuration:450},c.init(a,b)},m=l.prototype;m._rotaryDetentHandler=function(a){var b=this,c=b._elScroller,d=b.options,e=a.detail.direction;if("CW"===e){if(c.scrollTop===b._scrollMax)return void g(e);if(b._dest=b._scrollTop+d.scrollDistance>b._scrollMax?b._scrollMax:b._scrollTop+d.scrollDistance,b._scrollTop===b._scrollMax&&b._dest===b._scrollMax)return;h()}else if("CCW"===e){if(0===c.scrollTop)return void g(e);if(b._dest=b._scrollTop-d.scrollDistance<0?0:b._scrollTop-d.scrollDistance,0===b._scrollTop&&0===b._dest)return;h()}f(c,c.scrollTop,b._dest,d.scrollDuration),b._scrollTop=b._dest},m._scrollEndEventHandler=function(a){this._scrollTop=a.currentTarget.scrollTop},m.init=function(b,e){var f,g=this;return f=b instanceof HTMLElement?b:a.getElementById(b),null===f?(d.warn("Scrollable element parameter should be HTML element or id of the element."),c):(f=j.getScrollableParent(f),null===f?(d.warn("There is no scrollable element."),c):(g._elScroller=f,g._scrollTop=f.scrollTop,g._scrollMax=f.scrollHeight-f.offsetHeight,i.merge(g.options,e),void g.bindEvents()))},m.bindEvents=function(){var a,c,d=this;a=d._rotaryDetentHandler.bind(d),c=d._scrollEndEventHandler.bind(d),d._callbacks.rotarydetent=a,d._callbacks.scrollend=c,b.addEventListener("rotarydetent",a,!1),d._elScroller.addEventListener("scrollend",c,!1)},m.unbindEvents=function(){var a=this;b.removeEventListener("rotarydetent",a._callbacks.rotarydetent),a._elScroller.removeEventListener("scrollend",a._callbacks.scrollend),a._callbacks.rotarydetent=null},m.destroy=function(){var a=this;a.unbindEvents(),a._elScroller=null,a.options=null,a._callbacks=null},m.getScroller=function(){return this._elScroller},l.create=function(a,b){return new l(a,b)},d.helper.RotaryEventBinder=l}(b,a,d),function(a,b){var c=b.util,d=c.path,e=b.router.history,f={},g="circularindexscrollbar=true",h=/([&|\?]circularindexscrollbar=true)/,i=".ui-circularindexscrollbar";f.orderNumber=2e3,f.filter=i,f.option=function(){return null},f.open=function(){return null},f.find=function(a){var c,e=d.convertUrlToDataUrl(a),f=b.router.Router.getInstance().getContainer().getActivePage();return c=f.element.querySelector("#"+e)},f.parse=function(){return null},f.setActive=function(a){var b,c=d.getLocation(),f=c.replace(h,"");this._activeWidget=a,a?(b=d.addHashSearchParams(f,g),e.replace({},"",b)):c!==f&&e.back(),this.active=!0},f.onHashChange=function(a,b,c){var d=this,e=d._activeWidget,f=c.stateUrl;return e&&f.search(g)>0&&a.search(g)<0?(e.hide(b),d.active=!1,!0):null},b.router.route.circularindexscrollbar=f}(a.document,d),function(){var a=d.history,b={orderNumber:1e3,filter:".ui-grid",option:function(){return null},open:function(b,c){a.replace({url:c.url,
rel:c.rel},c.url,c.title)},onHashChange:function(){return null},find:function(){return null}};d.router.route.grid=b}(),function(a){a.addEventListener("beforerouterinit",function(){d.autoInitializePage!==c&&d.setConfig("autoInitializePage",d.autoInitializePage)},!1),a.addEventListener("routerinit",function(b){var e=b.detail,f=d.util.object,g=e.getRoute("page"),h=e.getRoute("popup"),i=d.history,j=i.back.bind(e),k=d.widget.core.Page.classes,l=k.uiPageActive;d.changePage=e.open.bind(e),a.addEventListener("pageshow",function(){d.activePage=a.querySelector("."+l)}),d.firstPage=g.getFirstElement(),d.getActivePage=g.getActiveElement.bind(g),d.back=j,d.initializePage=e.init.bind(e),d.pageContainer=e.container,d.openPopup=function(a,b){var d;d=a&&a.length!==c&&"object"==typeof a?a[0]:a,b=f.merge({},b,{rel:"popup"}),e.open(d,b)},d.closePopup=h.close.bind(h,null)},!1)}(a.document),function(a){var b=a.engine;a.IndexScrollbar=function(c,d){return a.warn("tau.IndexScrollbar is deprecated. you have to use tau.widget.IndexScrollbar."),b.instanceWidget(c,"IndexScrollbar",d)},a.SectionChanger=function(c,d){return a.warn("tau.SectionChanger is deprecated. you have to use tau.widget.SectionChanger."),b.instanceWidget(c,"SectionChanger",d)},a.SwipeList=function(c,d){return a.warn("tau.SwipeList is deprecated. you have to use tau.widget.SwipeList."),b.instanceWidget(c,"SwipeList",d)},a.VirtualListview=function(c,d){return a.warn("tau.VirtualListview is deprecated. you have to use tau.widget.VirtualListview."),b.instanceWidget(c,"VirtualListview",d)}}(d),function(a,b,c){var d=c.event,e=function(a){var b=a.target,c=!1,e={left:!1,right:!1,top:!1,bottom:!1};b.scrollHeight>b.clientHeight&&(0===b.scrollTop?(c=!0,e.top=!0):b.scrollTop===b.scrollHeight-b.clientHeight&&(c=!0,e.bottom=!0)),b.scrollWidth>b.clientWidth&&(0===b.scrollLeft?(c=!0,e.left=!0):b.scrollLeft===b.scrollWidth-b.clientWidth&&(c=!0,e.right=!0)),c&&d.trigger(b,"scrolledtoedge",e)},f={enable:function(){a.addEventListener("scroll",e,!0)},disable:function(){a.removeEventListener("scroll",e,!0)}};c.event.scrolledtoedge=f}(a,a.document,d),function(a,b,c){function d(a){var b="CCW";a.deltaY>0&&(b="CW"),f.trigger(a.target,"rotarydetent",{direction:b})}var e={enabled:!0,bind:function(){b.addEventListener("mousewheel",d,!0)},unbind:function(){b.removeEventListener("mousewheel",d,!0)}},f=c.event;e.bind(),c.event.pinch=e}(a,a.document,d),function(a){var b=a.event.gesture,c=b.Result,d=a.event.gesture.Detector,e={start:"pinchstart",move:"pinchmove",end:"pinchend",cancel:"pinchcancel","in":"pinchin",out:"pinchout"},f=d.plugin.create({name:"pinch",index:300,eventNames:e,defaults:{velocity:.6,timeThreshold:400},isTriggered:!1,handler:function(a,d,f){var g,h=c.PENDING;switch(a.eventType){case b.Event.MOVE:if(1===a.pointers.length&&a.distance>35)h=c.FINISHED;else if(!this.isTriggered&&a.pointers.length>=2)this.isTriggered=!0,d.sendEvent(e.start,a)===!1&&a.preventDefault(),h=c.RUNNING;else if(this.isTriggered){if(a.deltaTime<f.timeThreshold&&(a.velocityX>f.velocity||a.velocityY>f.velocity))return g=a.scale<1?d.sendEvent(e["in"],a):d.sendEvent(e.out,a),g===!1&&a.preventDefault(),this.isTriggered=!1,h=c.FINISHED|c.BLOCK;d.sendEvent(e.move,a)===!1&&a.preventDefault(),h=c.RUNNING}break;case b.Event.BLOCKED:case b.Event.END:this.isTriggered&&(d.sendEvent(e.end,a)===!1&&a.preventDefault(),this.isTriggered=!1,h=c.FINISHED);break;case b.Event.CANCEL:this.isTriggered&&(d.sendEvent(e.cancel,a)===!1&&a.preventDefault(),this.isTriggered=!1,h=c.FINISHED)}return h}});a.event.gesture.Pinch=f}(d),function(){function a(a,b,c){var d,e=c.target,f={};4===e.readyState&&(f.success=200===e.status||0===e.status&&e.responseXML,d=e.responseXML,b.fullDocument||(d=d.body.firstChild),a(f,d))}function b(b,c,d,e){var g,h=c,i=a.bind(null,e,d);d&&(h=f.addSearchParams(c,d)),g=new XMLHttpRequest,g.responseType="document",g.overrideMimeType("text/html"),g.open("GET",h),g.addEventListener("error",i),g.addEventListener("load",i),g.send()}var c=d.template,e=d.util,f=e.path;c.register("html",b)}(),function(a){a.getConfig("autorun",!0)===!0&&a.engine.run()}(d),d.info.profile="wearable"}(window,window.document);