-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui-lib.min.js
4 lines (4 loc) · 85.7 KB
/
ui-lib.min.js
1
2
3
4
/*! ui-lib 2014-02-12 */
!function(){for(var a,b=function(){},c=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],d=c.length,e=window.console=window.console||{};d--;)a=c[d],e[a]||(e[a]=b)}(),function(a){function b(c,d,e){"use strict";var f=new Function("return "+b.tpl.replace(/\$\$\$/gm,c))();return f.prototype=d(a),e||b.validate(f,c),b.installMandatoryFunctions(f,c),b.registerAsJqueryPlugin(f,c),b.save(f,c),f}if(!a)throw"jQuery is not defined";b.validate=function(a,b){var c=["triggerChangeEvent","destroy","whenDestroy","getParamKey","getModelKey","UI"].filter(function(b){return a.prototype.hasOwnProperty(b)});if(c.length)throw new Error("Plugin: "+b+' must NOT implement: "'+c.join(", ")+'"');var d=["getValue","setValue","init","getDefaults","bindEvents","markup"].filter(function(b){return"function"!=typeof a.prototype[b]});if(d.length)throw new Error("Plugin: "+b+' must implement: "'+d.join(", ")+'"')},b.registerAsJqueryPlugin=function(b,c){window.jQuery&&window.jQuery.fn&&(window.jQuery.fn[c]=function(d){if("string"==typeof d){var e=a(this).data("plugin_"+c);if(e&&"function"==typeof e[d])return e[d].apply(e,Array.prototype.slice.call(arguments,1))}return this.each(function(){a.data(this,"plugin_"+c)||a.data(this,"plugin_"+c,new b(this,d))})})},b.installMandatoryFunctions=function(a,b){a.name||(a.name=b),a.prototype.constructor=a,a.unique_id_counter=0,a.prototype.UI=function(){return window.Wix.UI||window.UI},a.prototype.triggerChangeEvent=function(a){this.$el.trigger(b+".change",a)},a.prototype.getParamKey=function(){return this.$el.attr("wix-param")||this.$el.attr("data-wix-param")},a.prototype.getModelKey=function(){return this.$el.attr("wix-model")||this.$el.attr("data-wix-model")},a.prototype.destroy=function(){this.$el.off(),this.$el.find("*").off(),this.destroyHandlers.forEach(function(a){try{a.call(this)}catch(c){setTimeout(function(){throw b+":"+c.message},0)}},this),this.$el.remove()},a.prototype.whenDestroy=function(a){if("function"!=typeof a)throw new Error("Destroy handler must be a function");this.destroyHandlers.push(a)}},b.save=function(a,c){b.store=b.store||{},b.store[c]=a},b.tpl="function $$$(el, options) { 'use strict';if (!(this instanceof $$$)) {throw new Error('Plugin: $$$ must called with the \"new\" keyword');}this.$el = window.jQuery(el);this.options = window.jQuery.extend({}, this.getDefaults(), options);this.pluginName = '$$$';el.$uiLibPluginName = '$$$';this.destroyHandlers = [];this.GUID = '$$$_' + ($$$.unique_id_counter++);this.init();return this;}",a.fn.definePlugin=b,a.fn.getCtrl=function(){return this[0]?this.data("plugin_"+this[0].$uiLibPluginName):null}}(jQuery);var createColorBox=function(){function a(a){function b(a){f.className="simple-color-node",f=a,f.className+=" color-node-selected"}function c(a,b){var c=document.createElement("div");return c.className=b,c.style.background=a.value,c.$dataColor=a,c}function d(){return f.$dataColor}function e(a,b){for(var c,d=[],e=0;e<h.children.length;e++)if(c=h.children[e],-1!==c.className.indexOf("simple-color-node")&&a(c)){if(b)return c;d.push(c)}return b?null:d}var f={},g={elm:j,hide:function(){j.style.display="none"},show:function(){j.style.display="block"},getColor:d,setColor:function(a){var c=e(function(b){var c=b.$dataColor.reference;return c&&(c===a.reference||c===a||a===b.$dataColor.value)},!0);g.removeSelection(),c&&b(c)},removeSelection:function(){f.className="simple-color-node",f={}}},h=document.createElement("div");h.className="colorpicker-wrapper";var i=document.createElement("div");i.className="change-picker-label",i.innerHTML="All colors";var j=document.createElement("div");j.className="colorpicker simple-color-palete",j.style.width=a.width||"auto",j.style.height=a.height||"auto";for(var k=-1,l=0,m=0;m<a.paleteColors.length;m++)l=m%5,l=5*l,k+=0===l?1:0,h.appendChild(c(a.paleteColors[l+k],"simple-color-node"));return a.primColors.forEach(function(a){h.appendChild(c(a,"simple-color-node prim-color"))}),h.appendChild(i),j.appendChild(h),a.parent.appendChild(j),j.onclick=function(c){c.target!==j&&-1!==c.target.className.indexOf("simple-color-node")&&-1===c.target.className.indexOf("color-node-selected")&&(b(c.target),a.onchange&&a.onchange.call(null,d()))},a.selected&&g.setColor(a.selected),i.onclick=function(){a.onchangepicker&&a.onchangepicker.call()},g}function b(d){function e(){f();var e=g(d.color);return r.colorPicker=c(r.colorBoxPicker,e?e.value:d.color,k),r.colorPicker.on("oncolorpickerchange",function(a){r.colorPalete.removeSelection(),o(a,!1),d.onchange&&d.onchange(a)}),r.colorPalete=a({width:"182px",parent:r.popup.content,selected:e,onchangepicker:function(){l()},onchange:function(a){r.colorPicker.setColor(a.value),o(a.value,a),d.onchange&&d.onchange(a)},paleteColors:d.paleteColors||[],primColors:d.primColors||[]}),k(),e?o(e.value,e):o(d.color,!1),m(),h(),b.instances.push(s),s}function f(){r.colorBox=d.element||document.createElement("div"),r.popup=$("<div>").Popup({appendTo:r.colorBox,title:"ColorPicker",buttonSet:"okCancel",height:"auto",width:"auto",onclose:function(){s.hidePickers()},oncancel:function(){(s.getColorObject()||s.getColor()!==r.openedColor)&&(s.setColor(r.openedColor),d.onchange&&d.onchange(r.openedColor)),s.hidePickers()},onopen:function(){r.colorBox.appendChild(this.arrow)},onposition:function(){}}).getCtrl(),r.popup.setRelativeElement(r.colorBox),r.colorBoxPicker=document.createElement("div"),r.colorBoxInner=document.createElement("div"),r.colorBoxInnerArrow=document.createElement("div"),r.colorBoxPicker.className="colorpicker",r.colorBox.className="color-box",r.colorBoxInner.className="color-box-inner",r.colorBoxInnerArrow.className="color-box-inner-arrow",r.popup.content.appendChild(r.colorBoxPicker),r.colorBox.appendChild(r.colorBoxInner),r.colorBox.appendChild(r.colorBoxInnerArrow),d.parent&&d.parent.appendChild(r.colorBox)}function g(a){if(!a)return!1;if(a.reference)return a;for(var b=0;b<d.primColors.length;b++)if(d.primColors[b].reference===a)return d.primColors[b];for(var b=0;b<d.paleteColors.length;b++)if(d.paleteColors[b].reference===a)return d.paleteColors[b];return!1}function h(){window.addEventListener("click",function(){m()},!1),r.colorBox.onclick=function(a){return a.stopPropagation&&a.stopPropagation(),a.prevetDefault&&a.prevetDefault(),(a.target===r.colorBox||a.target===r.colorBoxInner||a.target===r.colorBoxInnerArrow)&&(r.popup.isOpen()?m():n()),!1}}function i(){b.instances.forEach(function(a){a.hidePickers()})}function j(){r.openedColor=d.isParamConected?s.getColorObject()||s.getColor():s.getColor()}function k(){r.popup.setTitle("Site Colors"),r.colorPicker.hide(),r.colorPalete.show()}function l(){r.popup.setTitle("All Colors"),r.colorPalete.hide(),r.colorPicker.show()}function m(){q(),r.popup.close()}function n(){j(),i(),p(),r.popup.open()}function o(a,b){-1!==a.indexOf("rgba")&&(a=a.replace(/,\s*\d+\.?\d*\s*\)/,")").replace("rgba","rgb")),r.colorBoxInner.style.background=a,d.isParamConected&&(b?k():l()),r.colorObject=b}function p(){p.onselectstart=document.onselectstart||null,p.onmousedown=document.onmousedown||null,document.onmousedown=document.onselectstart=function(a){return a.target.tagName&&("textarea"===a.target.tagName.toLowerCase()||"input"===a.target.tagName.toLowerCase())||a.ctrlKey?!0:!1}}function q(){document.onselectstart=p.onselectstart||null,document.onmousedown=p.onmousedown||null,p.onselectstart=null,p.onmousedown=null}var r={};b.instances=b.instances||[];var s={showSimplePicker:k,showAdvancePicker:l,hidePickers:m,showPickers:n,setColor:function(a){var b=g(a);b?(r.colorPalete.setColor(b.reference),r.colorPicker.setColor(b.value),o(b.value,b)):(r.colorPalete.setColor(a),r.colorPicker.setColor(a),o(a,!1))},getColor:function(){return r.colorPicker.getColor()},getColorObject:function(){return r.colorObject}};return e()}var c=function(){"use strict";function a(a,b,c){return"#"+((1<<24)+(a<<16)+(b<<8)+c).toString(16).slice(1)}function b(a){var b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(a),c=parseInt(b[4],16);return c=isNaN(c)?1:c/255,b?[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16),c]:null}function c(a,b,c,d){a/=255,b/=255,c/=255;var e,f,g=Math.max(a,b,c),h=Math.min(a,b,c),i=(g+h)/2;if(g===h)e=f=0;else{var j=g-h;switch(f=i>.5?j/(2-g-h):j/(g+h),g){case a:e=(b-c)/j+(c>b?6:0);break;case b:e=(c-a)/j+2;break;case c:e=(a-b)/j+4}e/=6}return d=isNaN(+d)?1:+d,[e,f,i,d]}function d(a,b,c){return 0>c&&(c+=1),c>1&&(c-=1),1/6>c?a+6*(b-a)*c:.5>c?b:2/3>c?a+(b-a)*(2/3-c)*6:a}function e(a,b,c,e){var f,g,h;if(0===b)f=g=h=c;else{var i=.5>c?c*(1+b):c+b-c*b,j=2*c-i;f=d(j,i,a+1/3),g=d(j,i,a),h=d(j,i,a-1/3)}return e=void 0===e?1:e,[255*f,255*g,255*h,e]}function f(a){var b=a.match(/\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?([^)]+)?\s*/);return b?b.slice(1,5):void 0}function g(a){var b=a.match(/hsla?\(([^,]+)\s*,\s*([^%]+)%\s*,\s*([^%]+)%\s*,?\s*([^)]+)?\s*/);return b?(b=b.slice(1,5),b[0]=b[0]/360,b[1]=b[1]/100,b[2]=b[2]/100,b[3]=isNaN(+b[3])?1:+b[3],b):[0,0,0,0]}function h(b){var c=i(b),d=e.apply(null,c);d[0]=d[0]<<0,d[1]=d[1]<<0,d[2]=d[2]<<0;var f=a.apply(null,d);return f}function i(a){var d;if("l"===a.charAt(2))return g(a);var e=f(a);if(e)d=c.apply(null,e);else{if((3===a.length||6===a.length&&"#"!==a.charAt(0))&&(a="#"+a),4===a.length){var h=a.split("#").pop();a+=h}d=c.apply(null,b(a))}return d}function j(a){var b='<div class="colorpicker-wrapper"><div class="colorpicker-pickers"><div class="colorpicker-lightsat-palete"></div><div class="colorpicker-color-palete"></div><div class="colorpicker-opacity-palete colorpicker-opacity-back" style="display:none"></div></div><div class="colorpicker-picker-inputs"><label>H</label><label class="deg-label">°</label><input type="text" class="colorpicker-hue"/><label>S</label><label>%</label><input type="text" class="colorpicker-saturation"/><label>L</label><label>%</label><input type="text" class="colorpicker-lightness"/><label style="display:none">Opacity</label><input style="display:none" type="text" class="colorpicker-opacity"/></div><div class="colorpicker-picker-inputs-extra"><label>#</label><input type="text" class="colorpicker-color"/><div class="change-picker-label">Site colors</div></div></div><div class="colorpicker-picker-selected"><div class="colorpicker-priveuse colorpicker-opacity-back"></div><div class="colorpicker-current colorpicker-opacity-back"></div></div>';-1===a.className.indexOf("colorpicker")&&(0===a.className.length?a.className="colorpicker":a.className+=" colorpicker"),a.innerHTML=b}function k(a,b){return b=b||{},b.call=function(c){var d=Array.prototype.slice.call(arguments,1);b[c].forEach(function(b){b.apply(a,d)})},b.on=function(a,c){return b[a].push(c),function(){var d=b[a].indexOf(c);~d&&b[a].splice(d,1)}},b}function l(a){for(var b=0,c=0;a&&!isNaN(a.offsetLeft)&&!isNaN(a.offsetTop);)b+=a.offsetLeft-a.scrollLeft,c+=a.offsetTop-a.scrollTop,a=a.offsetParent;return{top:c,left:b}}function m(a,b){var c=l(b),d=(a.clientX-c.left)/(b.clientWidth-1),e=(a.clientY-c.top)/(b.clientHeight-1);return{x:Math.min(Math.max(d,0),1),y:Math.min(Math.max(e,0),1)}}function n(a,b,c){var d=document.createElement("div");return d.style.cssText="width:"+a+";height:"+b+";",c&&c.appendChild(d),d}var o=!0,p=function(){var a={open:'<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" version="1.0" width="100%" height="100%" xmlns:xlink="http://www.w3.org/1999/xlink"><defs>',close:'</linearGradient></defs><rect width="100%" height="100%" style="fill:url(#g);" /></svg>',dirs:{left:'x1="0%" y1="0%" x2="100%" y2="0%"',right:'x1="100%" y1="0%" x2="0%" y2="0%"',top:'x1="0%" y1="0%" x2="0%" y2="100%"',bottom:'x1="0%" y1="100%" x2="0%" y2="0%"'}};return function(b,c){var d='<linearGradient id="g" '+a.dirs[b]+' spreadMethod="pad">';return c.forEach(function(a){d+='<stop offset="'+a.offset+'" stop-color="'+a.color+'" stop-opacity="'+a.opacity+'"/>'}),d="data:image/svg+xml;base64,"+btoa(a.open+d+a.close)}}();!function(){var a="undefined"!=typeof window?window:exports,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=function(){try{document.createElement("$")}catch(a){return a}}();a.btoa||(a.btoa=function(a){for(var d,e,f=0,g=b,h="";a.charAt(0|f)||(g="=",f%1);h+=g.charAt(63&d>>8-f%1*8)){if(e=a.charCodeAt(f+=.75),e>255)throw c;d=d<<8|e}return h}),a.atob||(a.atob=function(a){if(a=a.replace(/=+$/,""),a.length%4==1)throw c;for(var d,e,f=0,g=0,h="";e=a.charAt(g++);~e&&(d=f%4?64*d+e:e,f++%4)?h+=String.fromCharCode(255&d>>(-2*f&6)):0)e=b.indexOf(e);return h})}();var q=p("bottom",[{offset:"0%",color:"black",opacity:"1"},{offset:"100%",color:"black",opacity:"0"}]),r=(p("top",[{offset:"0%",color:"black",opacity:"1"},{offset:"100%",color:"white",opacity:"1"}]),p("top",[{offset:"0%",color:"#FF0000",opacity:"1"},{offset:"16.666666666666668%",color:"#FFFF00",opacity:"1"},{offset:"33.333333333333336%",color:"#00FF00",opacity:"1"},{offset:"50%",color:"#00FFFF",opacity:"1"},{offset:"66.66666666666667%",color:"#0000FF",opacity:"1"},{offset:"83.33333333333334%",color:"#FF00FF",opacity:"1"},{offset:"100%",color:"#FF0000",opacity:"1"}])),s={photoshop:{pickerBoxHeight:148,setElement:function(a,b,c){this.elm=a,this.elm.className+=" ColorPickerPicker ColorPickerPhotoshop",this.posIndecator=document.createElement("div"),this.posIndecator.style.cssText="position:absolute;border-radius:50%;width:9px;height:9px;background:transparent;border:2px solid #eee;pointer-events:none;position:relative;",this.elm.appendChild(this.posIndecator),this.photoshoptIEGradSetup=[{offset:"0%",color:c,opacity:"1"},{offset:"100%",color:"white",opacity:"1"}],this.render(c)},render:function(a,b){if(!b){var c=this.posFromColor(a);this.setPos(c);var d=[c.hue];d[0]*=360,d[1]="100%",d[2]="50%",a="hsl("+d.join()+")"}if(p){this.photoshoptIEGradSetup[0].color=a;var e=p("left",this.photoshoptIEGradSetup);this.elm.style.backgroundImage='url("'+q+'"),url("'+e+'")'}else this.elm.style.backgroundImage="-webkit-linear-gradient(bottom, black, rgba(0,0,0,0)),-webkit-linear-gradient(left, "+a+", white)",this.elm.style.backgroundImage="-moz-linear-gradient(bottom, black, rgba(0,0,0,0)),-moz-linear-gradient(left, "+a+", white)"},setPos:function(a){this.pos=a,setTimeout(function(){var b=parseFloat(getComputedStyle(this.elm).height||this.pickerBoxHeight),c=parseFloat(getComputedStyle(this.elm).width||this.pickerBoxHeight);this.posIndecator.style.left=-6+a.x*c+"px",this.posIndecator.style.top=-6+a.y*b+"px"}.bind(this),0)},posFromColor:function(a){var b,c,d,e=i(a);return b=1-e[1],d=(100*e[2]+50*b+50)/50,c=d/(b+1),c=1-(c-1),0>c&&(b-=c,c=0),{x:b,y:c,hue:e[0]}},colorFromPos:function(a,b,c){this.setPos(a);var d=360*b,e=100-100*a.x,f=-50*a.y+50*a.x+50-a.y*a.x*50;return"hsla("+d+", "+e+"% , "+f+"%, "+c+")"}},single:{setElement:function(a,b){this.elm=a,this.elm.className+=" ColorPickerPicker ColorPickerSingle",this.render(b)},render:function(a){this.elm.style.backgroundColor=a},colorFromPos:function(){return this.elm.style.backgroundColor.replace(/\s/g,"")}},palete:{setElement:function(a,b){this.elm=a,this.elm.className+=" ColorPickerPicker ColorPickerPalete",this.elm.style.position="relative",this.posIndecator=document.createElement("div"),this.posIndecator.style.cssText='position:absolute;width:19px;height:12px;top:0;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAMCAYAAAH317YUAAABXUlEQVQokY2SPUiCURSGn2sukqRBSwb9EEU/hF9OESQ1RSH9LK06NgS5WYgYktXW0g+0fC7tBtISmAZBkwoNEg1ORU0mTU23wU/5flR84XDgnPe89773HqijCkgBEClIiQ7SBlQjBYkAEItBeXqZaraFnqrltABcZ0X50+gczAvsQK1q0DaOw8SSLOczmDHtcSGAOBD2Z6TbwtDwFBAmRahGS9aBpGKmwbnmQB8VPU09ybyGtn3DhqmL7FvzyOLOg1R8A9Z7ZT/BDsQnw6ry9Qf3H60NNJS860dqaW4j1JLUo+Xv99xdun9odNczpWATGMLqT2eEwZnQfuwYt9PRgQa5lwL5mwR2U90FpFE2l/eS16yM9XYUaaDsmIWraP0htNqW0x9UVmMpRpz1wnOtKy1+nX2A0aYXyC0cqu7xtVB3Kjrc+q2r0xQNJFS3t81vtEKr9TKLVrCuW7t4/Ac4FWWuJ2UyAAAAAABJRU5ErkJggg==");border:0;left:1px;pointer-events:none;',this.elm.appendChild(this.posIndecator);var c=i(b);this.setPos(c[0]),this.render(b)},setPos:function(a){this.paletePosY=a,setTimeout(function(){var b=parseFloat(getComputedStyle(this.elm).height);this.posIndecator.style.top=a*(b-1)-6+"px"}.bind(this),0)},render:function(){p?this.elm.style.backgroundImage='url("'+r+'")':(this.elm.style.backgroundImage="-webkit-linear-gradient(top, #FF0000, #FFFF00, #00FF00, #00FFFF, #0000FF, #FF00FF, #FF0000)",this.elm.style.backgroundImage="-moz-linear-gradient(top, #FF0000, #FFFF00, #00FF00, #00FFFF, #0000FF, #FF00FF, #FF0000)")},posFromColor:function(a){var b=i(a);return b[0]},colorFromPos:function(a){return this.setPos(a.y),"hsla("+360*a.y+",100%,50%, 1)"},hueFormPos:function(a){return this.setPos(a.y),360*a.y}},opacity:{setElement:function(a,b){this.elm=a,this.elm.className+=" ColorPickerPicker ColorPickerOpacityPalete",this.elm.style.position="relative",this.posIndecator=document.createElement("div"),this.posIndecator.style.cssText="position:absolute;width:100%;height:4px;top:0;left:-1px;background:black;border:1px solid #eee;pointer-events:none;",this.elm.appendChild(this.posIndecator),this.ieGOpacityGradSetup=[{offset:"0%",color:b,opacity:"1"},{offset:"100%",color:b,opacity:"0"}],this.setColor(b)},setPos:function(a){this.paletePosY=a,setTimeout(function(){var b=parseFloat(getComputedStyle(this.elm).height);this.posIndecator.style.top=a*(b-1)-3+"px"}.bind(this),0)},getOpacity:function(){return 1-this.paletePosY},setColor:function(a){var b=i(a);this.setPos(1-b[3]),this.render(b)},render:function(a){var b="hsla("+360*a[0]+","+100*a[1]+"%,"+100*a[2]+"%,1)",c="hsla("+360*a[0]+","+100*a[1]+"%,"+100*a[2]+"%,0)";p?(this.ieGOpacityGradSetup[0].color=b,this.ieGOpacityGradSetup[1].color=b,this.elm.style.backgroundImage='url("'+p("top",this.ieGOpacityGradSetup)+'")'):(this.elm.style.backgroundImage="-webkit-linear-gradient(top, "+b+", "+c+")",this.elm.style.backgroundImage="-moz-linear-gradient(top, "+b+", "+c+")")},posFromColor:function(a){var b=i(a);return 1-b[3]}}};return function(b,c,d){function f(a,b,c){var d;return a===x.elm&&(x.hueFormPos(b),d=y.colorFromPos(y.pos,x.paletePosY,B.getOpacity()),B.setColor(d),y.render(x.colorFromPos(b),!0),w.call("onpalete"+c,d)),a===B.elm&&(B.setPos(b.y),d=y.colorFromPos(y.pos,x.paletePosY,B.getOpacity()),w.call("onopacity"+c,d)),a===y.elm&&(d=y.colorFromPos(b,x.paletePosY,B.getOpacity()),B.setColor(d),w.call("onpicker"+c,d)),d&&w.call("oncolorpickerchange",o?h(d):d),d}function g(a){y.render(a),x.setPos(y.pos.hue),A.render(a),z.render(a),B.setColor(a)}function l(b,c,f){function h(b){s.value=o?a(b[0],b[1],b[2]).substr(1):"rgba("+b[0]+","+b[1]+","+b[2]+","+b[3]+")"}function j(){return o?"#"+s.value:s.value}function k(a){if(a.target===s)try{return g(s.value),A.render(j()),z.render(j()),w.call("oncolorpickerchange",j())}catch(b){}var c=("hsla("+n.value+","+p.value+"%,"+q.value+"%,"+r.value+")",e.apply(null,[n.value/360,p.value/100,q.value/100,r.value]));c[0]=c[0]<<0,c[1]=c[1]<<0,c[2]=c[2]<<0,h(c),g(s.value),A.render(j()),z.render(j()),w.call("oncolorpickerchange",j())}function l(a){a.target===n&&(a.target.value=Math.max(Math.min(a.target.value,360),0)||0),(a.target===p||a.target===q)&&(a.target.value=Math.max(Math.min(a.target.value,100),0)||0),a.target===r&&(a.target.value=Math.max(Math.min(a.target.value,1),0)||1)}function m(a){var b=i(a);n.value=360*b[0]<<0,p.value=100*b[1]<<0,q.value=100*b[2]<<0,r.value=Number.prototype.toFixed.call(+b[3],4);var c=e.apply(null,b);c[0]=c[0]<<0,c[1]=c[1]<<0,c[2]=c[2]<<0,h(c)}var n=b.querySelector(".colorpicker-hue"),p=b.querySelector(".colorpicker-saturation"),q=b.querySelector(".colorpicker-lightness"),r=b.querySelector(".colorpicker-opacity"),s=v.querySelector(".colorpicker-color");return v.querySelector(".change-picker-label").onclick=function(){d&&d(null)},m(f),w.on("oncolorpickerchange",m),b.addEventListener("change",l,!1),b.addEventListener("change",k,!1),c.addEventListener("change",l,!1),c.addEventListener("change",k,!1),m}function p(a){t&&z.render(f(t,m(a,t),"move"))}function q(a){if(t){document.body.onselectstart=u;var b=t;t=!1;var c=f(b,m(a,b),"click");A.render(c),z.render(c)}}function r(a){u=document.body.onselectstart||null,document.body.onselectstart=function(){return!1},t=a.target;var b=f(t,m(a,t),"click");z.render(b)}var t=!1,u=null,v=b,w=k(v,{oncolorpickerchange:[],onpickerclick:[],onpaleteclick:[],onopacityclick:[],onpickermove:[],onpaletemove:[],onopacitymove:[]}),x=Object.create(s.palete),y=Object.create(s.photoshop),z=Object.create(s.single),A=Object.create(s.single),B=Object.create(s.opacity);j(v),x.setElement(v.querySelector(".colorpicker-color-palete"),c),y.setElement(v.querySelector(".colorpicker-lightsat-palete"),x,c),B.setElement(n("100%","100%",v.querySelector(".colorpicker-opacity-palete")),c),z.setElement(n("100%","100%",v.querySelector(".colorpicker-current")),c),A.setElement(n("100%","100%",v.querySelector(".colorpicker-priveuse")),c);var C=l(v.querySelector(".colorpicker-picker-inputs"),v.querySelector(".colorpicker-picker-inputs-extra"),c);return v.addEventListener("mousedown",r,!1),window.addEventListener("mouseup",q,!1),window.addEventListener("mousemove",p,!1),{on:w.on,elm:v,setColor:function(a){return g(a),C(a),this},getColor:function(){return A.colorFromPos()},isVisible:function(){return"none"!==v.style.display},hide:function(){return v.style.display="none",this},show:function(a){return v.style.display="block",a&&a.appendChild(v),this}}}}();return b}();!function(a){function b(a){var b=$("<div>");return a.id&&b.prop("id",a.id),b.attr("wix-ctrl",a.ctrl),a.model&&b.attr("wix-model",a.model),a.param&&b.attr("wix-param",a.param),a.html&&b.html(a.html),a.appendTo&&b.appendTo(a.appendTo),b[a.ctrl](a.options||{}),Wix.UI.initializePlugin(b),b}function c(){var a=["<ui-lib>"];a.push.apply(a,arguments)}function d(a,b){if(!d.isInitialized){d.isInitialized=!0,d.retry=++d.retry||1;var c=$("body");if(c.length>1)throw new Error("You have more then one wix-uilib element in the DOM.");g(c),x.setInitialValues(a),b&&x.onChange("*",b),u();for(var e=c.andSelf().find("[data-wix-controller], [wix-controller], [wix-ctrl], [data-wix-ctrl], [wix-tooltip], [wix-scroll]"),f=0;f<e.length;f++)try{i(e[f])}catch(h){if(console.log){var j=function(a){return a.stack?a.stack:a};console.log(j(h).replace("Error:","Plugin Initialization Error:"),e[f])}}y.applyStyleMigration&&y.applyStyleMigration(),c.fadeIn(140,function(){$(document.body).trigger("uilib-update-scroll-bars")})}}function e(){function b(a){window.jQuery&&window.jQuery.holdReady&&window.jQuery.holdReady(a)}var c;window.Wix&&("standalone"===Wix.Utils.getViewMode()?setTimeout(function(){if(!a.__disableStandaloneError__)throw new Error('Standalone mode: Wix style params are not available outside of the "wix editor"')},0):(b(!0),c=setTimeout(function(){if(b(!1),!a.__disableStandaloneError__)throw new Error('Style params are not available outside of the "wix editor", if you are in the editor ')},3333),(Wix.Styles||Wix).getStyleParams(function(){clearTimeout(c),b(!1)})))}function f(){try{var a=window.location.search.match(/instance=([^&]+)/);return JSON.parse(atob(a[1].split(".")[1])).vendorProductId||null}catch(b){return null}}function g(a){var b=a.find("[wix-premium],[data-wix-premium]"),c=a.find("[wix-not-premium], [data-wix-not-premium]"),d=f();d?(b.show(),c.remove()):(b.remove(),c.show())}function h(a,b){var c=a.getAttribute(b);return c||(c=a.getAttribute("data-"+b)),c}function i(a,b){if(a instanceof jQuery)return a.each(function(){i(this,b)});var c=j(a);if(c){var d=s(c),e=q(a,c);l(a,d,b||e)}var f=h(a,"wix-tooltip");f&&l(a,"Tooltip",o(f)||{});var g=h(a,"wix-scroll");g&&l(a,"Scrollbar",o(g)||{})}function j(a){return h(a,"wix-controller")||h(a,"wix-ctrl")}function k(a,b){if(a instanceof jQuery)return a.each(function(){k(this,b)});var c=j(a),d=s(c),e=h(a,"wix-model"),f=$(a),g=f.data("plugin_"+d);e&&(g.destroy?g.destroy():(f.off(),f.find("*").off(),f.remove()),b&&x.removeKey(e))}function l(a,b,d){b=p(b),$.fn[b]?(c("initializing "+b,d),$(a)[b](d)):console.error("Plugin "+b+" does not exist");var e=m(a,b),f=n(a,b);if(e&&f)throw new Error("You cannot use wix-param in conjunction with wix-model, only one of them can be used per component.")}function m(a,b){var c=h(a,"wix-param");return c&&y.bindKeyToPlugin(a,b,c),c}function n(a,b){var c=h(a,"wix-model");return c&&x.bindKeyToPlugin(a,b,c),c}function o(a){try{return new Function("return "+a+";")()}catch(b){throw new Error("Options for plugin are not valid: "+a)}}function p(a){return a}function q(a,b){var c=r(b);return c||(c=h(a,"wix-options")),o(c)||{}}function r(a){var b=a.indexOf(":");return-1!==b?a.substr(b+1):!1}function s(a){var b=a.indexOf(":");return $.trim(-1!==b?a.substr(0,b):a)}function t(){var a={props:{},handlers:[],reporters:{},isReporting:!0,get:function(b){if(!a.props.hasOwnProperty(b))throw new Error('There is no "'+b+'" in this model. try to define "wix-model" in your markup.');return a.props[b]},set:function(b,c,d,e,f){var g=!1;if(!a.props.hasOwnProperty(b))throw new Error('There is no "'+b+'" in this model. try to define "wix-model" in your markup.');c&&c._model_ignore_set_&&(delete c._model_ignore_set_,g=!0);var h=a.props[b];if(h!==c){if(a.props[b]=c,d||a.trigger(b,c),g)return;a.triggerReporters(b,c,f)}},removeKey:function(b){a.handlers=a.handlers.filter(function(a){return a.key!==b}),delete a.reporters[b],delete a.props[b]},setAndReport:function(b,c,d){a.set(b,c,!!d||!1,!0)},setInitialValues:function(b){$.extend(a.props,b)},bindKeyToPlugin:function(b,c,d){function e(a){g.setValue&&g.setValue(a)}var f=$(b),g=f.data("plugin_"+c);if(!g)throw new Error('wix-model is not supported in this plugin "'+c+'"');var h=a.props[d];void 0!==h?(g.setValue&&g.setValue(h),a.props[d]=g.getValue?g.getValue():h):(h=g.getValue?g.getValue():void 0,a.props[d]=h),f.on(c+".change",function(b,c){a.set(d,c,!1,!1,g)}),a.reporters[d]=a.reporters[d]||[],e.plugin=g,a.reporters[d].push(e)},onChange:function(b,c){if("function"!=typeof c)throw new Error(b+": You must provide fn as handler to the Model change event.");a.handlers.push({fn:c,key:b})},trigger:function(b,c){for(var d=0;d<a.handlers.length;d++)try{var e=a.handlers[d];("*"===e.key||e.key===b)&&e.fn.call(a,c,b)}catch(f){setTimeout(function(){throw f},0)}},triggerReporters:function(b,c,d){if(a.isReporting)for(var e=this.reporters[b],f=0;f<e.length;f++){var g=e[f];if(g.plugin!==d)try{g.call(a,c,b)}catch(h){setTimeout(function(){throw h},0)}}},toJSON:function(){return $.extend({},a.props)}};return a}function u(){function a(a){return a.fontStyleParam===!0?!0:!1}function b(a){return c(a)&&a.fontParam===!0?!0:!1}function c(a){return a instanceof Number||"number"==typeof a||!isNaN(+a.index)&&a.value?!0:!1}function d(a){return a.index||0===a.index?a.index:a}if(window.Wix){var e=(Wix.Styles||Wix).getStyleParams();if(!y.applyStyleMigration){var f;try{f=w(e)}catch(g){setTimeout(function(){throw g},0),f={}}y.setInitialValues(f)}y.onChange("*",function(e,f){var g=Wix.Styles||Wix.Settings;b(e)||a(e)?Wix.Styles.setFontParam(f,{value:e}):c(e)?g.setNumberParam(f,{value:d(e)}):Object.prototype.toString.call(e).match("Boolean")?g.setBooleanParam(f,{value:e}):e&&(e.hasOwnProperty("color")||e.cssColor||e.rgba)&&g.setColorParam(f,{value:e})})}}function v(a){y.applyStyleMigration=function(){for(var b in a)a.hasOwnProperty(b)&&y.set(b,a[b])}}function w(a){a=a||{};var b={};for(var c in a.colors)if(a.colors.hasOwnProperty(c))if(a.colors[c].themeName&&0===a.colors[c].value.indexOf("rgba")){var d=a.colors[c].value.match(/,([^),]+)\)/);d=d?+d[1]:1,b[c]={color:{reference:a.colors[c].themeName,value:a.colors[c].value},rgba:a.colors[c].value,opacity:d}}else b[c]=a.colors[c].themeName||a.colors[c].value;for(var c in a.numbers)a.numbers.hasOwnProperty(c)&&(b[c]=a.numbers[c]);for(var c in a.booleans)a.booleans.hasOwnProperty(c)&&(b[c]=a.booleans[c]);for(var c in a.fonts)a.fonts.hasOwnProperty(c)&&(b[c]=a.fonts[c]);return b}e(a.__disableStandaloneError__);var x=t(),y=t();a.UI={initialize:d,initializePlugin:i,create:b,destroy:k,initStyleMigration:v,set:x.setAndReport,get:x.get,toJSON:x.toJSON,onChange:x.onChange}}(window.Wix||window),jQuery.fn.definePlugin("Accordion",function(a){return{init:function(){this.markup(),this.showFirst(),this.bindEvents(),this.applyCSS()},markup:function(){this.$el.hasClass("accordion")||this.$el.addClass("accordion")},getDefaults:function(){return{triggerClass:"acc-pane",triggerCSS:{},contentClass:"acc-content",contentCSS:{},animationTime:150,activeClass:"acc-active",ease:"linear",openByDeafult:"acc-open",value:0,toggleOpen:!0}},showFirst:function(){var a=this.options;this.$el.find("."+a.contentClass).hide();var b,c=this.$el.find("."+a.triggerClass);b="string"==typeof this.options.value?c.filter(this.options.value):c.eq(this.options.value||0);var d=this.$el.find("."+a.triggerClass+"."+a.openByDeafult);b=b.add(d),b.addClass(a.activeClass+" "+a.openByDeafult).find("."+a.contentClass).css("display","block")},getValue:function(){for(var a=this.$el.find("."+this.options.triggerClass),b=0;b<a.length;b++)if(a.eq(b).hasClass(this.options.activeClass))return b;return-1},setValue:function(a){var b=this.options;"number"==typeof a&&(a=this.$el.find("."+b.triggerClass).eq(a)),a.find("."+b.contentClass).is(":hidden")?this.openElementContent(a):b.toggleOpen&&this.closeElementContent(a)},closeElementContent:function(){var a=this.options;this.$el.find("."+a.triggerClass).removeClass(a.openByDeafult).removeClass(a.activeClass).find("."+a.contentClass).slideUp(a.animationTime,a.ease)},openElementContent:function(b){var c=this.options;this.closeElementContent(b);var d=b.toggleClass(c.activeClass).find("."+c.contentClass);d.slideDown(c.animationTime,c.ease,function(){d.css("overflow","visible"),a(document.body).trigger("uilib-update-scroll-bars")})},applyCSS:function(){this.$el.find("."+this.options.contentClass).css(this.options.contentCSS),this.$el.find("."+this.options.triggerClass).css(this.options.triggerCSS)},bindEvents:function(){var b=this;this.$el.on("click","."+this.options.triggerClass,function(c){0===a(c.target).parents("."+b.options.contentClass).length&&(c.preventDefault(),b.setValue(a(this)),b.triggerChangeEvent(b.getValue()))})}}}),jQuery.fn.definePlugin("ButtonGroup",function(a){"use strict";var b={btnGroupClass:"btn-group",valueAttrName:"data-value",indexAttrName:"data-index",selectedClass:"btn-selected",btnBaseClass:"uilib-btn",btnClass:"uilib-btn btn-secondary btn-small",btnClassToDeprecate:"btn",btnSelectedClassToDeprecate:"active",types:{single:"single",toggle:"toggle"}};return{init:function(){this.$selected=null,this.markup(),this.setValue(this.options.value),this.bindEvents()},getDefaults:function(){return{value:0,mode:"single"}},markup:function(){this.$el.addClass(b.btnGroupClass),this.getOptionsButtons().addClass(b.btnClass+" "+b.btnClassToDeprecate)},getOptionsButtons:function(){return this.$el.find("button")},setValueSingleMode:function(c){var d,e=this.getOptionsButtons();"number"==typeof c?d=e.eq(c):"string"==typeof c?d=e.filter('[value="'+c+'"], ['+b.valueAttrName+'="'+c+'"]').eq(0):a(c).hasClass(b.btnClass)?d=c:c&&"object"==typeof c&&(d=e.eq(c.index)),d.length&&(e.removeClass(b.selectedClass+" "+b.btnSelectedClassToDeprecate),d.addClass(b.selectedClass+" "+b.btnSelectedClassToDeprecate),this.$selected=d)},toggleActiveClass:function(a){a.toggleClass(b.selectedClass+" "+b.btnSelectedClassToDeprecate)},setValueToggleMode:function(a){var c=this.getOptionsButtons(),d=b.selectedClass+" "+b.btnSelectedClassToDeprecate;for(var e in a)if(a.hasOwnProperty(e)){var f=c.filter('[value="'+e+'"], ['+b.valueAttrName+'="'+e+'"]').eq(0);a[e]?f.addClass(d):f.removeClass(d)}},setValue:function(a){this.isSingleMode()?this.setValueSingleMode(a):this.setValueToggleMode(a)},getValueFromEl:function(a){return a.attr(b.valueAttrName)||a.val()},getValue:function(){if(this.isSingleMode())return{index:this.getIndex(this.$selected),value:this.getValueFromEl(this.$selected)};
var c={},d=this.getOptionsButtons(),e=this;return d.each(function(){var d=a(this);c[e.getValueFromEl(d)]=d.hasClass(b.selectedClass+" "+b.btnSelectedClassToDeprecate)}),c},getIndex:function(a){return+this.getOptionsButtons().index(a)},isSingleMode:function(){return this.options.mode===b.types.single},bindEvents:function(){function c(a){e.toggleActiveClass(a),e.triggerChangeEvent(e.getValue())}function d(a){var b=e.getValueFromEl(a);e.getValueFromEl(e.$selected)!==b&&(e.setValue(b),e.triggerChangeEvent(e.getValue()))}var e=this;this.$el.on("click","."+b.btnBaseClass,function(){e.isSingleMode()?d(a(this)):c(a(this))})}}}),jQuery.fn.definePlugin("ToggleButtonGroup",function(){"use strict";return{init:function(){this.options.mode="toggle",this.buttonGroup=this.$el.ButtonGroup(this.options).getCtrl()},getDefaults:function(){return{value:0}},setValue:function(a){return this.buttonGroup.setValue(a)},getValue:function(){return this.buttonGroup.getValue()},bindEvents:function(){},markup:function(){}}}),jQuery.fn.definePlugin("Checkbox",function(){"use strict";var a={checkboxClass:"uilib-checkbox",checkedClass:"checked"};return{init:function(){this.options.value=void 0!==this.options.value?this.options.value:this.options.checked,this.markup(),this.bindEvents(),this.setValue(this.options.checked)},getDefaults:function(){return{checked:!1,preLabel:"",postLabel:"",value:void 0}},markup:function(){this.$el.hasClass(a.checkboxClass)||this.$el.addClass(a.checkboxClass),this.$el.append('<span class="uilib-checkbox-check"></span>'),this.options.preLabel&&this.$el.prepend('<span class="uilib-text uilib-checkbox-preLabel">'+this.options.preLabel+"</span>"),this.options.postLabel&&this.$el.append('<span class="uilib-text uilib-checkbox-postLabel">'+this.options.postLabel+"</span>")},bindEvents:function(){this.$el.on("click",this.toggleChecked.bind(this))},getValue:function(){return this.$el.hasClass(a.checkedClass)},setValue:function(b){b?this.$el.addClass(a.checkedClass):this.$el.removeClass(a.checkedClass)},toggleChecked:function(){this.$el.toggleClass(a.checkedClass),this.triggerChangeEvent(this.getValue())}}}),jQuery.fn.definePlugin("ColorPicker",function(){"use strict";var a=["#50FAFE","#FFFFFF","#0088CB","#ED1C24","#FFCB05","#CECECE","#9C9C9C","#6C6C6C","#484848","#242424","#C4EEF6","#A5E1ED","#59CEE5","#3B8999","#1D444C","#FFFDFD","#999999","#666666","#444444","#000000","#E4A3B8","#CA748F","#AF1A49","#751131","#3A0818","#D5E7A6","#B8CF78","#8EB71D","#5E7A13","#2F3D09"].map(function(a,b){return{value:a,reference:"color-"+b}});return{init:function(){this.options.value=void 0!==this.options.value?this.options.value:this.options.startWithColor,this.isParamConected=this.options.isParamConected||this.$el.attr("wix-param")||this.$el.attr("data-wix-param"),this.siteColors=(Wix.Styles||Wix.Settings).getSiteColors()||a,this.markup()},getDefaults:function(){return{startWithColor:"color-1",value:void 0}},markup:function(){this.picker=createColorBox({element:this.$el[0],color:this.options.value,isParamConected:this.isParamConected,primColors:this.siteColors.slice(0,5),paleteColors:this.siteColors.slice(5),onchange:this.changeEventHandler.bind(this)})},getValue:function(){return this.picker.getColor()},setValue:function(a){var b;try{this.isParamConected&&"string"==typeof a?b=(Wix.Styles||Wix.Settings).getColorByRefrence(a):this.isParamConected&&a.color.reference&&(b=a.color),b=b.reference}catch(c){}this.picker.setColor(b||a.cssColor||a.rgba||a)},changeEventHandler:function(a){var b=this;clearTimeout(this.$timeoutTicket),this.$timeoutTicket=setTimeout(function(){var c={cssColor:a};"string"==typeof a||a&&"object"==typeof a&&(c.color=a,c.cssColor=a.value,b.isParamConected||delete c.color),b.triggerChangeEvent(c)},10)},getColorObject:function(){return this.picker.getColorObject()},bindEvents:function(){}}}),jQuery.fn.definePlugin("ColorPickerWithOpacity",function(a){"use strict";function b(b){var c=1;return b=a.trim(b),"#"===b.charAt(0)?c=1:0===b.indexOf("rgba")||0===b.indexOf("hsla")?(c=b.match(/,([^),]+)\)/),c=c?+c[1]:1):0===b.indexOf("rgb")&&(c=1),c}function c(b){var c;return b=a.trim(b),c="#"===b.charAt(0)?b:0===b.indexOf("rgba")?b.replace("rgba","rgb").replace(/,([^),]+)\)/,")"):0===b.indexOf("rgb")?b:b}return{init:function(){this.options.value=void 0!==this.options.value?this.options.value:this.options.startWithColor,this.options.isParamConected=this.$el.attr("wix-param")||this.$el.attr("data-wix-param"),this.markup(),this.setValue(this.options.value),this.setOpacity(this.options.startWithOpacity),this.bindEvents()},markup:function(){this.$el.addClass("picker-with-opacity"),this.$ColorPicker=a("<div>").ColorPicker(this.options),this.$Slider=a("<div>").Slider({preLabel:"0",postLabel:"100",value:100,toolTip:!1}),this.options.divider?this.$el.append(this.$ColorPicker,a('<span class="uilib-text" style="margin: 0 0 0 10px">').text(this.options.divider),this.$Slider):this.$el.append(this.$ColorPicker,this.$Slider)},bindEvents:function(){this.$ColorPicker.on("ColorPicker.change",this.colorChangedInInnerPlugins.bind(this,"color")),this.$Slider.on("Slider.change",this.colorChangedInInnerPlugins.bind(this,"opacity"))},getValue:function(){var a=this.getPlugins(),b=a.colorPicker.getValue(),c=a.slider.getValue()/100;return 0===b.indexOf("rgba")?b.replace(/,\s*([\d\.]+)\s*\)/,","+c+")"):b.replace(/rgb/,"rgba").replace(")",","+c+")")},setValue:function(a){var d=100,e="#000",f=this.getPlugins();a&&"object"==typeof a?(e=a.color&&a.color.reference?a.color.reference:a.rgba||a.cssColor,d=100*(a.opacity||b(e))):"string"==typeof a&&(e=c(a),d=100*b(a)),f.slider.setValue(d),f.colorPicker.setValue(e)},setOpacity:function(a){(a||0===a)&&this.getPlugins().slider.setValue(100*a)},getPlugins:function(){return{colorPicker:this.$ColorPicker.data("plugin_ColorPicker"),slider:this.$Slider.data("plugin_Slider")}},colorChangedInInnerPlugins:function(a,b){b.stopPropagation(),this.triggerChangeEvent({color:this.getPlugins().colorPicker.getColorObject(),opacity:this.getPlugins().slider.getValue()/100,rgba:this.getValue()})},getDefaults:function(){return{startWithColor:"rgba(255,0,0,1)"}}}}),jQuery.fn.definePlugin("Dropdown",function(a){"use strict";var b={extendedValueName:"data-value-extended",valueAttrName:"data-value",indexAttrName:"data-index",dropDownClassName:"dropdown",activeClassName:"focus-active",optionInitValueAttrName:"value",optionClassName:"option",optionsClassName:"options",selectedClassName:"selected",selectedOptionsClassName:"option-selected",highlightClassName:"dropdown-highlight",iconClassName:"dropdown-icon",hideTextClass:"dropdown-hideText"},c={width:"100%",position:"absolute",top:"100%",zIndex:"999999"},d={down:'<span class="dropdown-arrow dropdown-arrow-down"></span>',up:'<span class="dropdown-arrow dropdown-arrow-up"></span>',left:'<span class="dropdown-arrow dropdown-arrow-left"></span>',right:'<span class="dropdown-arrow dropdown-arrow-right"></span>'};return{init:function(){this.options.value=void 0!==this.options.value?this.options.value:this.options.selected,this.$selected=null,this.$options=null,this.isParamMode=this.$el.attr("wix-param")||this.$el.attr("data-wix-param"),this.isOpen=!1,this.isActive=!1,this.markup(),this.setValue(this.options.value),this.bindEvents(),this.hideOptions(0)},getDefaults:function(){return{slideTime:150,selected:0,value:void 0,autoCloseTime:5e4,optionSelector:"[value]",spriteMap:"",hideText:!1,width:"",optionsWidth:"",height:"",style:"dropdown-style-1",modifier:function(a){return a}}},markup:function(){var e=this,f=this.$el.addClass(b.dropDownClassName+" "+this.options.style),g=this.$el.find(this.options.optionSelector).map(function(c){var d=this.getAttribute("style"),f=this.getAttribute(b.extendedValueName),g=a("<div>").attr(b.valueAttrName,this.getAttribute(b.optionInitValueAttrName)).attr(b.indexAttrName,c).addClass(b.optionClassName).addClass(this.className).text(this.textContent);f&&g.attr(b.extendedValueName,f),d&&g.attr("style",d),e.options.hideText&&g.addClass(b.hideTextClass);var h=this.getAttribute("data-icon");return h&&g.prepend('<img src="'+h+'" class="'+b.iconClassName+'"/>'),e.options.spriteMap&&g.addClass(e.options.spriteMap+c),g}).toArray();this.$selected=a("<div>").addClass(b.selectedClassName),this.$options=a("<div>").addClass(b.optionsClassName).append(g).css(c),this.options.width&&(this.$options.css("width",this.options.width),f.css("width",this.options.width)),this.options.optionsWidth&&this.$options.css("width",this.options.optionsWidth),this.options.height&&this.$options.css("height",this.options.height),this.$options.addClass("uilib-scrollbar"),this.$el.empty(),this.$el.append(d.down,this.$selected,this.$options)},setValue:function(a){var c;return a&&"object"==typeof a&&a.hasOwnProperty("value")&&(a=a.value),"number"==typeof a?c=this.$options.find("["+b.indexAttrName+'="'+a+'"]').eq(0):"string"==typeof a?c=this.$options.find("["+b.valueAttrName+'="'+a+'"]').eq(0):a instanceof jQuery&&(c=a),c.length&&this.getIndex()!==c.attr(b.indexAttrName)?(this.$options.find("."+b.selectedOptionsClassName).removeClass(b.selectedOptionsClassName),this.$selected.empty(),this.$selected.append(this.options.modifier(c.clone(!0).addClass("current-item").removeClass(b.highlightClassName))),c.addClass(b.selectedOptionsClassName),!0):!1},setValueFromEl:function(a){var c=+a.attr(b.indexAttrName);this.setValue(c)&&this.triggerChangeEvent(this.getValue())},setActiveMode:function(a){this.isActive=a,a?this.$el.addClass(b.activeClassName):this.$el.removeClass(b.activeClassName)},getIndex:function(){return+this.$selected.find("."+b.optionClassName).attr(b.indexAttrName)},getVal:function(){return this.$selected.find("."+b.optionClassName).attr(b.valueAttrName)},getValue:function(){return this.getFullValue()},getExtendedValue:function(){return this.$selected.find("."+b.optionClassName).attr(b.extendedValueName)},getFullValue:function(){return{value:this.getVal(),index:this.getIndex()}},hideOptions:function(a){this.$el.trigger("uilib-dropdown-close",this),this.isOpen=!1,this.$options.slideUp(void 0!==a?a:this.options.slideTime)},showOptions:function(a){var c=this.$options,d=c.find("["+b.indexAttrName+'="'+this.getIndex()+'"]').eq(0);this.isOpen=!0,this.highlightOption(d),c.slideDown(void 0!==a?a:this.options.slideTime,function(){c.css("overflow","auto")}),this.$el.trigger("uilib-dropdown-open",this)},toggleOptions:function(a){return this.isOpen?this.hideOptions(a):this.showOptions(a)},highlightOption:function(a){a.length&&(this.$options.find("."+b.highlightClassName).removeClass(b.highlightClassName),a.addClass(b.highlightClassName))},bindAutoClose:function(a){var b,c=this;this.$el.hover(function(){clearTimeout(b)},function(){clearTimeout(b),c.isOpen&&(b=setTimeout(function(){c.isOpen&&(c.setActiveMode(!1),c.hideOptions())},a))})},bindEvents:function(){function c(a,b){b!==e&&b.isOpen&&(e.hideOptions(),e.setActiveMode(!1))}function d(){e.hideOptions(),e.setActiveMode(!1)}var e=this;this.options.autoCloseTime&&this.bindAutoClose(this.options.autoCloseTime),a(document).on("uilib-dropdown-open",c),a(window).on("mousedown",d),this.whenDestroy(function(){a(document).off("uilib-dropdown-open",c),a(window).off("mousedown",d)}),this.$options.mousewheel&&this.$options.mousewheel(function(a){a.stopPropagation()}),this.$options.on("mouseenter","."+b.optionClassName,function(){e.highlightOption(a(this))}),this.$options.on("click","."+b.optionClassName,function(){e.setValueFromEl(a(this))}),this.$el.on("click",function(a){a.stopPropagation(),e.setActiveMode(!0),e.toggleOptions()}),this.$el.on("mousedown",function(a){a.stopPropagation()});var f=13,g=32,h=27,i=9,j=38,k=40,l=33,m=34,n=5,o=1;a(window).on("keydown",function(a){var c,d,p;if(e.isActive&&((a.which===f||a.which===g)&&(e.toggleOptions(),a.preventDefault()),(a.which===h||a.which===i)&&(e.hideOptions(),e.setActiveMode(!1),a.preventDefault()),a.which===j||a.which===k||a.which===l||a.which===m)){c=e.$options.find("["+b.indexAttrName+'="'+e.getIndex()+'"]').eq(0),d=a.which===j||a.which===l?"prev":"next",p=a.which===j||a.which===k?o:e.$options.height()/c.height()<<0||n;for(var q;p--;)q=c,c=c[d]("."+b.optionClassName),0===c.length&&(c=q);e.highlightOption(c),e.setValueFromEl(c),c.length&&e.$options.clearQueue().animate({scrollTop:e.$options.scrollTop()+c.position().top},200),a.preventDefault()}})}}}),jQuery.fn.definePlugin("FixedPositionControl",function(a){"use strict";function b(a){Wix.Settings.setWindowPlacement(Wix.Utils.getOrigCompId(),a.placement,a.verticalMargin,a.horizontalMargin)}function c(a,b,c){b.enable(),b.$el.removeClass(d(a)),a.placement=c,b.setValue(0,!0),"other"===d(a)?b.disable():b.$el.addClass(d(a))}function d(a){return"TOP_CENTER"===a.placement||"BOTTOM_CENTER"===a.placement?"horizontalMargin":"CENTER_RIGHT"===a.placement||"CENTER_LEFT"===a.placement?"verticalMargin":"other"}function e(a){Wix.Settings.getWindowPlacement(Wix.Utils.getOrigCompId(),a)}function f(){return{placements:["TOP_LEFT","TOP_CENTER","TOP_RIGHT","CENTER_LEFT","CENTER_RIGHT","BOTTOM_LEFT","BOTTOM_CENTER","BOTTOM_RIGHT"],slider:{width:158,className:"",minValue:-2,maxValue:2,value:0,supportClick:!1},dropdown:{visibleRows:8,on:{}}}}function g(a,d){return{on:{create:function(){this.setIndexByValue(a.placement)},change:function(e){c(a,d,e.value),b(a)}}}}function h(b){var c=b.$el.width();b.$center=a('<div class="uilib-slider-back">'),b.$leftLine=a('<div class="uilib-slider-back">'),b.$rightLine=a('<div class="uilib-slider-back">'),b.$leftLine.css({left:c/4,background:"rgba(0,0,0,0.13)",width:1}).prependTo(b.$el),b.$center.css({left:c/2-1,background:"rgba(0,0,0,0.2)"}).prependTo(b.$el),b.$rightLine.css({left:c/4*3,background:"rgba(0,0,0,0.13)",width:1}).prependTo(b.$el),b.$ribbon=a('<div class="uilib-slider-back">').prependTo(b.$el)}function i(a,b){var c,d,e=a.$pin.width()/2,f=a.$el.width()/4;b>1&&(d=b-1,c=f*d,a.$ribbon.css({width:f-c+d*e,right:0,left:"auto",borderRadius:"0 8px 8px 0"})),b>=0&&1>=b&&(c=f*b,a.$ribbon.css({width:c,right:"auto",left:2*f,borderRadius:0})),-1>b&&(d=-1*b-1,c=f*d,a.$ribbon.css({width:f-c+d*e,left:0,right:"auto",borderRadius:"8px 0 0 8px"})),0>b&&b>=-1&&(c=-1*f*b,a.$ribbon.css({width:c,right:2*f,left:"auto",borderRadius:0}))}function j(a){return{create:function(){h(this),this.$el.addClass("other"===d(a)?"disabled":d(a))},slide:function(c){a[d(a)]=c,b(a),i(this,c)}}}function k(a,b){a.slider.create=function(){h(this),"function"==typeof b.sliderCreate&&b.sliderCreate.apply(this,arguments)},a.slider.slide=function(a){i(this,a),"function"==typeof b.sliderChange&&b.sliderChange.apply(this,arguments)},"function"==typeof b.dropDownChange&&(a.dropdown.on.change=b.dropDownChange),"function"==typeof b.dropDownCreate&&(a.dropdown.on.create=b.dropDownCreate)}return{init:function(b,c){c=this.options,b=this.$el[0],this.state={horizontalMargin:0,verticalMargin:0,placement:"TOP_LEFT"};var d=f();this.$el=a(b),this.createControlHTML(),Wix&&Wix.Utils&&"standalone"===Wix.Utils.getViewMode()&&(c.bindToWidget=!1),c.bindToWidget?this.initWithBinding(d,c):this._init(d,c)},_init:function(b,c){k(b,c),this.options=a.extend({},b,c),this.slider=this.createSlider(this.options.slider),this.dropdown=this.createDropDown(this.options.dropdown)},initWithBinding:function(b,c){var d=this;e(function(e){a.extend(d.state,e),a.extend(b.slider,j(d.state)),d.options=a.extend({},b,c),d.slider=d.createSlider(d.options.slider),a.extend(d.options.dropdown,g(d.state,d.slider)),d.dropdown=d.createDropDown(d.options.dropdown)})},createSlider:function(a){return a.value=this.state[d(this.state)]||0,this.$slider=this.$el.find(".glued-slider"),this.$slider.Slider(a).data("plugin_Slider")},getDefaults:function(){return{bindToWidget:!0}},markup:function(){},setValue:function(){},getValue:function(){},bindEvents:function(){},createDropDown:function(d){var e=this,f=a("<div>"),g=this.$el.find(".glued-dropdown").html(this.dropdownHTML()).find("select").replaceWith(f).find("option");return g.attr("data-icon","data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"),this.options.bindToWidget&&this.$el.on("Dropdown.change",function(a,d){c(e.state,e.slider,d.value),b(e.state)}),d.width=180,d.value=e.state.placement,f.append(g).Dropdown(d).getCtrl()},createControlHTML:function(){this.$el.append('<div class="glued-dropdown"></div><div class="divider gluedDivider"></div><div class="slider-wrapper"><div class="glued-slider"></div></div>')},dropdownHTML:function(){function a(a,b,c){return'<option value="'+a+'" data-image="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-imagecss="positionIcons '+b+'" selected="selected">'+c+"</option>"}var b=this.options.placements;0===b.length&&(b=["TOP_LEFT","TOP_CENTER","TOP_RIGHT","CENTER_LEFT","CENTER_RIGHT","BOTTOM_LEFT","BOTTOM_CENTER","BOTTOM_RIGHT"]);var c=b.map(function(b){var c,d;switch(b){case"TOP_LEFT":c="topLeft",d="Top Left";break;case"TOP_RIGHT":c="topRight",d="Top Right";break;case"BOTTOM_RIGHT":c="bottomRight",d="Bottom Right";break;case"BOTTOM_LEFT":c="bottomLeft",d="Bottom Left";break;case"TOP_CENTER":c="top",d="Top";break;case"CENTER_RIGHT":c="right",d="Right";break;case"BOTTOM_CENTER":c="bottom",d="Bottom";break;case"CENTER_LEFT":c="left",d="Left"}return a(b,c,d)}).join("\n");return'<p>Select the position for your widget</p><select name="positionSelection" class="positionSelection">'+c+"</select>"}}}),jQuery.fn.definePlugin("FontPicker",function(){"use strict";function a(){return window.Wix&&Wix.Styles&&Wix.Styles.getFontsSpriteUrl()||d}function b(){return window.Wix&&Wix.Styles&&Wix.Styles.getEditorFonts()||[{lang:"",fonts:[{displayName:"Arial",fontFamily:"arial",cdnName:"",genericFamily:"sans-serif",provider:"system",characterSets:["latin","latin-ext","cyrillic"],permissions:"all",fallbacks:"helvetica",spriteIndex:5,cssFontFamily:"arial,helvetica,sans-serif"},{displayName:"Arial Black",fontFamily:"arial black",cdnName:"",genericFamily:"sans-serif",provider:"system",characterSets:["latin","cyrillic"],permissions:"all",fallbacks:"gadget",spriteIndex:8,cssFontFamily:"arial black,gadget,sans-serif"},{displayName:"Comic Sans MS",fontFamily:"comic sans ms",cdnName:"",genericFamily:"cursive",provider:"system",characterSets:["latin","latin-ext","cyrillic"],permissions:"all",fallbacks:"comic-sans-w01-regular,comic-sans-w02-regular,comic-sans-w10-regular",spriteIndex:22,cssFontFamily:"comic sans ms,comic-sans-w01-regular,comic-sans-w02-regular,comic-sans-w10-regular,cursive"},{displayName:"Courier New",fontFamily:"courier new",cdnName:"",genericFamily:"monospace",provider:"system",characterSets:["latin","latin-ext","cyrillic"],permissions:"all",fallbacks:"courier-ps-w01,courier-ps-w02,courier-ps-w10",spriteIndex:30,cssFontFamily:"courier new,courier-ps-w01,courier-ps-w02,courier-ps-w10,monospace"},{displayName:"Georgia",fontFamily:"georgia",cdnName:"",genericFamily:"serif",provider:"system",characterSets:["latin","latin-ext","cyrillic"],permissions:"all",fallbacks:"palatino,book antiqua,palatino linotype",spriteIndex:48,cssFontFamily:"georgia,palatino,book antiqua,palatino linotype,serif"},{displayName:"Impact",fontFamily:"impact",cdnName:"",genericFamily:"sans-serif",provider:"system",characterSets:["latin","latin-ext","cyrillic"],permissions:"all",fallbacks:"impact-w01-2010,impact-w02-2010,impact-w10-2010",spriteIndex:79,cssFontFamily:"impact,impact-w01-2010,impact-w02-2010,impact-w10-2010,sans-serif"},{displayName:"Lucida Console",fontFamily:"lucida console",cdnName:"",genericFamily:"monospace",provider:"system",characterSets:["latin","latin-ext"],permissions:"all",fallbacks:"lucida-console-w01",spriteIndex:94,cssFontFamily:"lucida console,lucida-console-w01,monospace"},{displayName:"Lucida Sans Unicode",fontFamily:"lucida sans unicode",cdnName:"",genericFamily:"sans-serif",provider:"system",characterSets:["latin"],permissions:"all",fallbacks:"lucida grande",spriteIndex:96,cssFontFamily:"lucida sans unicode,lucida grande,sans-serif"},{displayName:"Palatino Linotype",fontFamily:"palatino linotype",cdnName:"",genericFamily:"serif",provider:"system",characterSets:["latin","latin-ext"],permissions:"all",fallbacks:"",spriteIndex:119,cssFontFamily:"palatino linotype,serif"},{displayName:"Tahoma",fontFamily:"tahoma",cdnName:"",genericFamily:"sans-serif",provider:"system",characterSets:["latin","latin-ext"],permissions:"all",fallbacks:"tahoma-w01-regular,tahoma-w02-regular,tahoma-w10-regular,tahoma-w15--regular,tahoma-w99-regular",spriteIndex:141,cssFontFamily:"tahoma,tahoma-w01-regular,tahoma-w02-regular,tahoma-w10-regular,tahoma-w15--regular,tahoma-w99-regular,sans-serif"},{displayName:"Times New Roman",fontFamily:"times new roman",cdnName:"",genericFamily:"serif",provider:"system",characterSets:["latin","latin-ext","cyrillic"],permissions:"all",fallbacks:"times",spriteIndex:143,cssFontFamily:"times new roman,times,serif"},{displayName:"Verdana",fontFamily:"verdana",cdnName:"",genericFamily:"sans-serif",provider:"system",characterSets:["latin","latin-ext","cyrillic"],permissions:"all",fallbacks:"geneva",spriteIndex:146,cssFontFamily:"verdana,geneva,sans-serif"}]}]}function c(a,c){if(!a)throw new Error("Could not found sprite map url");var d=b(),e=document.createDocumentFragment();d.forEach(function(b){var c=b.fonts;for(var d in c){var f=c[d],g=f.characterSets.indexOf(b.lang),h=f.spriteIndex+g,i=$('<div data-value-extended="'+f.cssFontFamily+'" value="'+f.fontFamily+'">'+f.displayName+"</div>").css({backgroundImage:'url("'+a+'")',backgroundRepeat:"no-repeat",backgroundPosition:"4px "+(-24*h+3)+"px"})[0];e.appendChild(i)}}),c.html(""),c.append(e)}var d="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";return{init:function(){this.isParamMode=this.getParamKey(),this.markup(),this.bindEvents(),this.setValue(this.options.value)},markup:function(){var a=$("<div>");c(this.options.spriteUrl,a),this.$el.append(a),this.dropdown=a.Dropdown({hideText:this.options.spriteUrl!==d,width:265,height:200,value:this.options.value}).data("plugin_Dropdown")},bindEvents:function(){var a=this;this.$el.on("Dropdown.change",function(b,c){b.stopPropagation(),a.triggerChangeEvent(a.extendedValue(c))})},extendedValue:function(a){return this.isParamMode&&(a.fontParam=!0),$.extend(a,{cssFontFamily:this.dropdown.getExtendedValue()})},getDefaults:function(){return{value:"arial",spriteUrl:a()}},getValue:function(){return this.extendedValue(this.dropdown.getFullValue())},setValue:function(a){return a&&a.fontParam&&(a=a.family||a.value),this.dropdown.setValue(a)}}}),jQuery.fn.definePlugin("FontStylePicker",function(){"use strict";var a={fontStylePickerClass:"font-style-picker",presetSelectClass:"font-style-picker-preset-select",fontPickerClass:"font-style-picker-font-picker",fontSizeClass:"font-style-picker-font-size",textStyleClass:"font-style-picker-text-style"},b='<div class="box-like-drop"><span class="box-like-drop-content">Font Picker</span><span class="box-like-arrow box-like-arrow-down"></span></div>',c='<div class="uilib-divider-row"><span class="font-picker-label">Style:</span><span class="style-place-holder"></span></div>';c+='<div class="uilib-divider-row"><span class="font-picker-label">Font:</span><span class="font-place-holder"></span></div>',c+='<div class="uilib-divider-row"><span class="font-picker-label"> </span><span class="props-place-holder"></span></div>';var d="";return d+='<button value="bold" class="grad-1" style="font-family: serif;font-weight: bold;">B</button>',d+='<button value="italic" class="grad-1" style="font-family: serif;font-style: italic;">I</button>',d+='<button value="underline" class="grad-1" style="font-family: serif;text-decoration: underline;">U</button>',{init:function(){this.isParamMode=this.getParamKey(),this.currentValue=null,this.popup=null,this.fontSizePicker=null,this.textStylePicker=null,this.fontPicker=null,this.presetSelectPicker=null,this.markup(),this.setValue(this.options.value),this.bindEvents()},getDefaults:function(){return{value:"Body-L"}},markup:function(){this.$el.html(b),this.$el.addClass(a.fontStylePickerClass),this.createPopup(),this.createPresetPicker(),this.createFontPicker(),this.createTextStylePicker(),this.createFontSizePicker(),this.popup.content.innerHTML=c,$(this.popup.content).find(".style-place-holder").append(this.presetSelectPicker.$el.addClass(a.presetSelectClass)),$(this.popup.content).find(".font-place-holder").append(this.fontPicker.$el.addClass(a.fontPickerClass)),$(this.popup.content).find(".props-place-holder").append(this.fontSizePicker.$el.addClass(a.fontSizeClass),this.textStylePicker.$el.addClass(a.textStyleClass))},createFontSizePicker:function(){this.fontSizePicker=this.UI().create({ctrl:"Spinner",options:{size:"medium"},appendTo:this.$el}).getCtrl()},createTextStylePicker:function(){this.textStylePicker=this.UI().create({ctrl:"ToggleButtonGroup",html:d,appendTo:this.$el}).getCtrl()},createFontPicker:function(){this.fontPicker=this.UI().create({ctrl:"FontPicker",appendTo:this.$el}).getCtrl()},createPresetPicker:function(){var a="",b=this.getSiteTextPresets();Object.keys(b).sort().forEach(function(b){a+='<div value="'+b+'">'+b.replace(/-/g," ")+"</div>"}),a+='<div value="Custom">Custom</div>',this.presetSelectPicker=this.UI().create({ctrl:"Dropdown",appendTo:this.$el,html:a,options:{width:265,height:180,value:1,modifier:function(a){return a}}}).getCtrl()},createPopup:function(){var a=this;this.popup=this.UI().create({ctrl:"Popup",options:{appendTo:this.$el,title:"Font Settings",content:"",footer:"",buttonSet:"okCancel",modal:!1,modalBackground:"rgba(0,0,0,0.5)",height:"auto",width:287,onopen:function(){a.$el.append(this.arrow),a.currentValue=a.getValue()},onclose:function(){a.updateText()},oncancel:function(){a.setValue(a.currentValue),a.triggerChangeEvent(a.getValue())},onposition:function(){}}}).getCtrl(),this.popup.setRelativeElement(a.$el.find(".box-like-drop")[0])},hideArrow:function(){$(this.popup.arrow).hide(50)},showArrow:function(){$(this.popup.arrow).show(50)},bindEvents:function(){var a=this;this.$el.on("click",".box-like-drop",function(b){b.stopPropagation(),a.popup.toggle()}),this.registerToChangeEventAndDelegate(this.fontSizePicker,this),this.registerToChangeEventAndDelegate(this.textStylePicker,this),this.registerToChangeEventAndDelegate(this.fontPicker,this),this.registerToChangeEventAndDelegate(this.presetSelectPicker,this),this.$el.on("uilib-dropdown-close",function(b,c){c.isOpen&&$(a.popup.arrow).hasClass("popup-arrow-top")&&setTimeout(function(){a.showArrow()},50)}),this.$el.on("uilib-dropdown-open",function(){$(a.popup.arrow).hasClass("popup-arrow-top")&&a.hideArrow()}),this.whenDestroy(function(){this.fontSizePicker.destroy(),this.textStylePicker.destroy(),this.fontPicker.destroy(),this.presetSelectPicker.destroy()})},getSiteTextPresets:function(){var a={Title:{editorKey:"font_0",lineHeight:"1.1em",style:"normal",weight:"bold",size:"35px",fontFamily:"arial black",value:"font: normal normal bold 35px/1.1em arial black,gadget,sans-serif ; color: #333333;"},Menu:{editorKey:"font_1",lineHeight:"1.2em",style:"normal",weight:"bold",size:"17px",fontFamily:"arial",value:"font: normal normal bold 17px/1.2em arial,helvetica,sans-serif ; color: #FFE899;"},"Page-title":{editorKey:"font_2",lineHeight:"1.2em",style:"normal",weight:"bold",size:"50px",fontFamily:"arial",value:"font: normal normal bold 50px/1.2em arial,helvetica,sans-serif ; color: #133C2A;"},"Heading-XL":{editorKey:"font_3",lineHeight:"1.2em",style:"normal",weight:"bold",size:"80px",fontFamily:"arial",value:"font: normal normal bold 80px/1.2em arial,helvetica,sans-serif ; color: #133C2A;"},"Heading-L":{editorKey:"font_4",lineHeight:"1.2em",style:"normal",weight:"bold",size:"50px",fontFamily:"arial",value:"font: normal normal bold 50px/1.2em arial,helvetica,sans-serif ; color: #FFE899;"},"Heading-M":{editorKey:"font_5",lineHeight:"1.3em",style:"normal",weight:"normal",size:"25px",fontFamily:"arial",value:"font: normal normal normal 25px/1.3em arial,helvetica,sans-serif ; color: #EF6C6C;"},"Heading-S":{editorKey:"font_6",lineHeight:"1.2em",style:"normal",weight:"normal",size:"18px",fontFamily:"arial",value:"font: normal normal normal 18px/1.2em arial,helvetica,sans-serif ; color: #EF6C6C;"},"Body-L":{editorKey:"font_7",lineHeight:"1.2em",style:"normal",weight:"normal",size:"16px",fontFamily:"arial",value:"font: normal normal normal 16px/1.2em arial,helvetica,sans-serif ; color: #4D3613;"},"Body-M":{editorKey:"font_8",lineHeight:"1.2em",style:"normal",weight:"normal",size:"14px",fontFamily:"arial",value:"font: normal normal normal 14px/1.2em arial,helvetica,sans-serif ; color: #4D3613;"},"Body-S":{editorKey:"font_9",lineHeight:"1.2em",style:"normal",weight:"normal",size:"12px",fontFamily:"arial",value:"font: normal small-caps normal 12px/1.2em arial,helvetica,sans-serif ; color: #4D3613;"},"Body-XS":{editorKey:"font_10",lineHeight:"1.2em",style:"normal",weight:"normal",size:"10px",fontFamily:"arial",value:"font: normal small-caps normal 10px/1.2em arial,helvetica,sans-serif ; color: #4D3613;"}};return(Wix&&Wix.Styles?Wix.Styles.getSiteTextPresets():a)||a},getTextPreset:function(a){var b=this.getSiteTextPresets(),c=b[a];return c},handlePluginPresetSelectChange:function(){var a=this.getSiteTextPresets(),b=this.presetSelectPicker.getValue().value,c=a[b];c&&this.setValueFromPreset(b,c)},checkPresetAgainstState:function(a,b){if(b.style.underline)return!1;var c=b.style.bold?"bold":"normal";if(c!==a.weight)return!1;var d=b.style.italic?"italic":"normal";return d!==a.style?!1:b.family!==a.fontFamily?!1:b.size!==parseInt(a.size,10)?!1:!0},getSimilarPresetName:function(){var a=this.getSiteTextPresets(),b=this.getValue();for(var c in a)if(a.hasOwnProperty(c)&&this.checkPresetAgainstState(a[c],b))return c;return null},handleNonPluginPresetSelectChange:function(){var a=this.getSimilarPresetName();this.presetSelectPicker.setValue(a?a:"Custom"),this.updateText()},innerChangeHandler:function(b,c){b.$el.hasClass(a.presetSelectClass)?this.handlePluginPresetSelectChange(b,c):this.handleNonPluginPresetSelectChange(b,c),this.triggerChangeEvent(this.getValue())},registerToChangeEventAndDelegate:function(a,b){a.$el.on(a.pluginName+".change",function(c){c.stopPropagation(),b.innerChangeHandler(a,c)})},updateText:function(){var a=this.presetSelectPicker.getValue().value;this.$el.find(".box-like-drop-content").text(a)},getValue:function(){var a=this.fontPicker.getValue(),b={size:this.fontSizePicker.getValue(),style:this.textStylePicker.getValue(),family:a.value,cssFontFamily:a.cssFontFamily,preset:this.presetSelectPicker.getValue().value};return this.getParamKey()&&(b.fontStyleParam=!0),b},setValueFromPreset:function(a,b){this.setValueWithKnownPreset({size:parseInt(b.size,10),family:b.fontFamily,preset:a,style:{bold:"bold"===b.weight,italic:"italic"===b.style,underline:!1}})},validateValue:function(a){if(a&&"object"==typeof a){var b="number"==typeof a.size||a.size instanceof Number,c=a.style&&"object"==typeof a.style,d=a.family&&"string"==typeof a.family,e=a.preset&&"string"==typeof a.preset;if(b&&c&&d&&e)return!0}return!1},setValueWithKnownPreset:function(a){if(!this.validateValue(a))throw new Error("Unknown Preset "+JSON.stringify(a,null,4));this.fontSizePicker.setValue(a.size),this.textStylePicker.setValue(a.style),this.fontPicker.setValue(a.family),this.presetSelectPicker.setValue(a.preset),this.updateText()},setValue:function(a){"string"==typeof a&&(a={preset:a});var b=this.getTextPreset(a.preset);b?this.setValueFromPreset(a.preset,b):this.setValueWithKnownPreset(a)}}}),jQuery.fn.definePlugin("Input",function(a){"use strict";var b={inputClass:"uilib-input",validInputClass:"valid-input",invalidInputClass:"invalid-input",disabledClass:"disabled",largeClass:"large",mediumClass:"medium",xLargeClass:"x-large",bigClass:"big"};return{init:function(){this.markup(),this.setValue(this.options.value),this.bindEvents()},setValidationFunction:function(a){if("function"!=typeof a)throw new Error("You must provide a valid validation function.");
this.options.validate=!0,this.options.validation=a},getDefaults:function(){return{value:"",validate:!1,required:!1,type:"text",placeholder:"Text input",disabled:!1,size:"default",validation:function(){return!0}}},markup:function(){switch(this.$input=a("<input>").attr("type",this.options.type).attr("placeholder",this.options.placeholder).addClass(b.inputClass),this.options.disabled&&this.disable(),this.options.size){case"large":this.$input.addClass(b.largeClass);break;case"medium":this.$input.addClass(b.mediumClass);break;case"x-large":this.$input.addClass(b.xLargeClass);break;case"big":this.$input.addClass(b.bigClass)}this.$el.append(this.$input)},bindEvents:function(){var a=this;a.$input.change(function(){a.setValue(a.$input.val()),a.triggerChangeEvent(a.getValue())}),a.$input.on("keyup",function(){a.setValue(a.$input.val())})},getValue:function(){return this.value},setValue:function(a){var c=this.options.required?!!a.length:!0,d=this.$input.val()!==this.value||a!==this.value;c&&this.options.validation(a)&&d?(!isNaN(parseFloat(a))&&isFinite(a)&&(a=Math.round(a)),this.lastValue=this.getValue(),this.$input.val(a),this.value=a,this.options.validate&&this.$input.removeClass(b.invalidInputClass).addClass(b.validInputClass)):this.$input.val()!==this.value?(this.value="",this.options.validate&&this.$input.removeClass(b.validInputClass).addClass(b.invalidInputClass)):""===this.$input.val()&&this.$input.removeClass(b.invalidInputClass)},disable:function(){this.$input.addClass(b.disabledClass),this.$input.attr("disabled","disabled")},enable:function(){this.$input.removeClass(b.disabledClass),this.$input.removeAttr("disabled","disabled")},isDisabled:function(){return this.$input.hasClass(b.disabledClass)}}}),jQuery.fn.definePlugin("LanguagePicker",function(){"use strict";function a(a){return $(a.map(function(a){return'<div value="'+a+'">'+c[a]+"</div>"}).join(""))}var b={className:"uilib-languagePicker"},c={En:"English",De:"Deutsch",Es:"Español",Fr:"Français",It:"Italiano",Po:"Polski",Pt:"Português",Ru:"Русский",Ja:"日本語",Ko:"한국어",Tr:"Türkçe"};return{init:function(){this.markup(),this.bindEvents()},markup:function(){var c=a(this.options.languages);this.$el.append(c);var d=this.options.height;if("auto"===this.options.height){var e=c.length%2;d=c.length<=4?26*c.length:(c.length-e)/2*26}this.dropdown=this.$el.Dropdown({width:62,height:d,optionsWidth:105,modifier:function(a){var b=$("<span class='globe'></span>");return a.text(a.attr("data-value")),a.prepend(b),a}}).data("plugin_Dropdown"),this.$el.hasClass(b.className)||this.$el.addClass(b.className)},bindEvents:function(){var a=this;this.$el.on("Dropdown.change",function(b){b.stopPropagation(),a.triggerChangeEvent(a.getValue())})},getDefaults:function(){return{languages:["En","De","Es","Fr","It","Po","Pt","Ru","Ja","Ko","Tr"],height:"auto"}},getValue:function(){return this.dropdown.getFullValue()},setValue:function(a){return this.dropdown.setValue(a)}}}),jQuery.fn.definePlugin("Popup",function(a){"use strict";function b(a){a=a||"left";var b=document.createElement("div"),c=document.createElement("div"),d=document.createElement("div");return b.className="popup-arrow popup-arrow-"+a,c.className="popup-arrow-one",d.className="popup-arrow-two",b.appendChild(c),b.appendChild(d),b}function c(a,b){var c="left",e="auto",f=15,g=0;a.style.top="0px",a.style.bottom="auto",a.style.left="0px",a.style.right="auto",a.style.margin="0";var h=a.clientWidth,i=a.clientHeight,j=i/2,k=b.clientWidth,l=b.clientHeight,m=l/2-j,n=k+f,o=d(b);k+h+o.left+f+1>window.innerWidth&&(e=k+f+1,c="right");var p=o.left-(h+f+1);return"right"===c&&0>p&&(m=0-(i+f),e=k/2-h/2,c="top"),o.top-j<0&&(m-=o.top-j-g),"top"!==c&&l+o.top+j>window.innerHeight&&(m-=l+o.top+j-window.innerHeight),a.style.top=m+"px",a.style.left="right"===c||"top"===c?"auto":n+"px",a.style.right="right"===c||"top"===c?e+"px":"auto",a.style.margin="",c}function d(a){for(var b=0,c=0;a&&!isNaN(a.offsetLeft)&&!isNaN(a.offsetTop);)a===document.body?(b+=a.offsetLeft-document.documentElement.scrollLeft,c+=a.offsetTop-document.documentElement.scrollTop):(b+=a.offsetLeft-a.scrollLeft,c+=a.offsetTop-a.scrollTop),a=a.offsetParent;return{top:c,left:b}}var e={okCancel:'<button class="uilib-btn btn-secondary btn-small x-close-popup">Cancel</button><button style="float:right" class="uilib-btn btn-small close-popup">OK</button>',none:""};return{init:function(){this.state="open",this.popup=this.$el[0],this.transclude(),this.markup(),this.close(),this.setContent(this.options.content),this.setFooter(this.options.footer),this.setTitle(this.options.title),this.setPosition(),this.bindEvents()},getDefaults:function(){return{appendTo:"body",title:"Popup",content:"",footer:"",modal:!1,modalBackground:"rgba(0,0,0,0.5)",height:"auto",width:300,buttonSet:"",fixed:!1,onclose:function(){},oncancel:function(){},onopen:function(){},onposition:function(){}}},markup:function(){this.modal=document.createElement("div"),this.header=document.createElement("header"),this.headerTitle=document.createElement("span"),this.closeBtn=document.createElement("div"),this.content=document.createElement("div"),this.footer=document.createElement("div"),this.modal.className="popup-modal",this.closeBtn.className="popup-close-btn x-close-popup",this.popup.className="popup",this.header.className="popup-header",this.content.className="popup-content",this.footer.className="popup-footer",this.popup.appendChild(this.header),this.popup.appendChild(this.content),this.popup.appendChild(this.footer),this.header.appendChild(this.headerTitle),this.header.appendChild(this.closeBtn),this.arrow=this.createArrowElement()},transclude:function(){var b=this.$el;b.remove();var c=b.find(".popup-header").text(),d=b.find(".popup-content").html(),e=b.find(".popup-footer").html();a.trim(c)&&(this.options.title=c),a.trim(d)&&(this.options.content=d),a.trim(e)&&(this.options.footer=e),b.empty()},bindEvents:function(){function b(a){27===a.which&&c.isOpen()&&!c.options.modal&&d("cancel")}var c=this,d=function(a){c.setValue("close");var b=c.options["on"+a];"string"==typeof b&&"function"==typeof window[b]?window[b].call(c,{type:a}):"function"==typeof b&&b.call(c,{type:a})},e=function(b){var e=a(b.target).parents(".popup")[0];e&&e===c.popup||!c.isOpen()||c.options.modal||(c.setValue("close"),d("cancel"))};a(window).on("keyup",b),a(this.popup).on("click",".close-popup",d.bind(null,"close")),a(this.popup).on("click",".x-close-popup",d.bind(null,"cancel")),a(window).on("click",e),this.whenDestroy(function(){a(window).off("click",e),a(window).off("keyup",b)})},getValue:function(){return this.isOpen()},setValue:function(a){"open"===a?this.open():this.close(),this.triggerChangeEvent("close")},setRelativeElement:function(b){this.relativeElement=a(b)[0]},setPosition:function(){return this.$el.css({position:this.options.fixed?"fixed":"absolute",width:this.options.width,height:this.options.height,left:"50%",top:"50%",marginLeft:0-this.options.width/2,marginTop:0-this.$el.height()/2}),this.relativeElement&&this.setBestPosition(this.relativeElement),"function"==typeof this.options.onposition?this.options.onposition.call(this):void 0},setBestPosition:function(a){a instanceof jQuery&&(a=a[0]);var b=c(this.$el[0],a);return this.setArrowDir(b),b},createArrowElement:function(){return b()},setArrowDir:function(a){return a=a||"left",this.arrow.className="popup-arrow popup-arrow-"+a},setContent:function(b){a(this.content).empty().append(b)},setFooter:function(b){a(this.footer).empty().append(e[this.options.buttonSet],b)},setTitle:function(b){a(this.headerTitle).text(b)},isOpen:function(){return"open"===this.state},toggle:function(){this.isOpen()?this.close():this.open()},open:function(){this.isOpen()||(this.state="open",setTimeout(function(){return this.options.modal&&document.body.appendChild(this.modal),a(this.options.appendTo).append(this.popup),this.popup.style.display="block",this.modal.style.display="block",this.arrow.style.display="block",this.modal.style.backgroundColor=this.options.modalBackground,this.setPosition(),this.options.onopen?this.options.onopen.call(this):void 0}.bind(this),0))},close:function(){this.isOpen()&&(this.state="close",setTimeout(function(){this.modal.style.display="none",this.popup.style.display="none",this.arrow.style.display="none"}.bind(this),0))}}}),jQuery.fn.definePlugin("Radio",function(a){"use strict";return{init:function(){this.options.value=void 0!==this.options.value?this.options.value:this.options.checked,this.markup(),this.setValue(this.options.value),this.bindEvents()},getDefaults:function(){return{radioBtnGroupClassName:"rb-radio-group",radioBtnClassName:"rb-radio",checkClassName:"rb-radio-check",checkedClassName:"rb-radio-checked",radioValueAttrName:"data-radio-value",inline:!1,checked:0,value:void 0}},markup:function(){this.$el.hasClass(this.options.radioBtnGroupClassName)||this.$el.addClass(this.options.radioBtnGroupClassName),this.radioGroup=this.$el.find("["+this.options.radioValueAttrName+"]").addClass("uilib-text").addClass(this.options.radioBtnClassName).addClass(this.options.inline?"uilib-inline":"").prepend('<span class="'+this.options.checkClassName+'"></span>')},bindEvents:function(){var b=this;this.$el.on("click","."+this.options.radioBtnClassName,function(){b.checkRadio(a(this))})},getValue:function(){var a=this.$el.find("."+this.options.checkedClassName);return{value:a.attr(this.options.radioValueAttrName),index:this.radioGroup.index(a)}},setValue:function(a){var b;"object"==typeof a&&(a=a.index),"string"==typeof a?b=this.$el.find("["+this.options.radioValueAttrName+'="'+a+'"]').eq(0):+a>=0&&(b=this.radioGroup.eq(+a)),b.length&&this.checkRadio(b,!0)},checkRadio:function(a,b){a.hasClass(this.options.checkedClassName)||(this.radioGroup.removeClass(this.options.checkedClassName),a.addClass(this.options.checkedClassName),b||this.triggerChangeEvent(this.getValue()))}}}),function(a,b,c,d){"use strict";function e(b,c){this.$el=a(b),this.options=a.extend({},g,c),this.percentScroll=0,this.lastScroll=d,this.markup(),this.registerEvents(),this.updateDisplay()}var f="Scrollbar",g={width:"auto",height:"250px",size:"8px",radius:"4px",color:"#a4d9fc",hoverColor:"#35aeff",hoverOpacity:1,position:"right",distance:"1px",opacity:1,railVisible:!0,railColor:"#333",railOpacity:0,railClass:"uilib-scrollRail",barClass:"uilib-scrollBar",wrapperClass:"uilib-scrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,minBarHeight:30};e.prototype.scrollContent=function(a,b,c){var d=a,e=this.$el.outerHeight()-this.$bar.outerHeight();if(b&&(d=parseInt(this.$bar.css("top"))+a*parseInt(this.options.wheelStep)/100*this.$bar.outerHeight(),d=Math.min(Math.max(d,0),e),d=a>0?Math.ceil(d):Math.floor(d),this.$bar.css({top:d+"px"})),this.percentScroll=parseInt(this.$bar.css("top"))/(this.$el.outerHeight()-this.$bar.outerHeight()),d=this.percentScroll*(this.$el[0].scrollHeight-this.$el.outerHeight()),c){d=a;var f=d/this.$el[0].scrollHeight*this.$el.outerHeight();f=Math.min(Math.max(f,0),e),this.$bar.css({top:f+"px"})}this.$el.scrollTop(d),this.$el.trigger("slimscrolling",~~d)},e.prototype.markup=function(){var b="<div></div>",c=a(b).addClass(this.options.wrapperClass).css({position:"relative",overflow:"hidden",width:this.options.width,height:this.options.height,padding:"0 0 2px 0"});this.$el.css({overflow:"hidden",width:this.options.width,height:this.options.height}),this.$rail=a(b).addClass(this.options.railClass).css({width:this.options.size,height:"100%",position:"absolute",top:0,display:"block","border-radius":this.options.radius,background:this.options.railColor,opacity:this.options.railOpacity,zIndex:999998});var d=this.$bar=a(b).addClass(this.options.barClass).css({background:this.options.color,width:this.options.size,position:"absolute",top:0,opacity:this.options.opacity,display:"block","border-radius":this.options.radius,BorderRadius:this.options.radius,MozBorderRadius:this.options.radius,WebkitBorderRadius:this.options.radius,zIndex:999999,transition:"background-color 200ms "}),e=this;c.hover(function(){d.css({background:e.options.hoverColor,opacity:e.options.hoverOpacity})},function(){d.css({background:e.options.color,opacity:e.options.opacity})});var f="right"==this.options.position?{right:this.options.distance}:{left:this.options.distance};this.$rail.css(f),this.$bar.css(f),this.$el.wrap(c),this.$el.parent().append(this.$bar),this.$el.parent().append(this.$rail)},e.prototype.updateDisplay=function(){var a,b=Math.max(this.$el.outerHeight()/this.$el[0].scrollHeight*this.$el.outerHeight(),this.options.minBarHeight);b=isFinite(b)?b:parseInt(this.options.height,10),a=b>=this.$el.outerHeight()?"none":"block",this.$bar.css({height:b,display:a}),this.$rail.css({display:a})},e.prototype.registerEvents=function(){function d(a){clearTimeout(f),f=setTimeout(function(){g.$el.trigger("stopscrolling")},a)}function e(){return!1}var f,g=this,h=this.$bar,i=this.$rail;a(c.body).on("uilib-update-scroll-bars",function(){g.updateDisplay()}),this.$el.mousewheel(function(a,b){if("none"!==h.css("display")){a.preventDefault();var c=10,e=h.position().top,f=e-b*c,j=i.height(),k=h.height();f=Math.min(f,j-k),f=Math.max(0,f),h.css({top:f}),g.scrollContent(0,h.position().top,!1),d(200)}}),this.$rail.on("click",function(a){var b,c=i.height(),e=h.height(),f=h.position().top;b=f>a.offsetY?Math.max(0,a.offsetY):Math.min(a.offsetY-e,c-e),h.css({top:b}),g.scrollContent(0,h.position().top,!1),d(200)}),this.$bar.on("mousedown",function(f){function j(a){var b=a.clientY-l+m,c=Math.min(b,n-o);c=Math.max(0,c),h.css({top:c}),g.scrollContent(0,h.position().top,!1)}function k(){a(b).off("mousemove",j),a(b).off("mouseup",k),a(c).off("selectstart",e),d(200)}c.body.focus(),a(c).on("selectstart",e);var l=f.clientY,m=h.position().top,n=i.height(),o=h.height();a(b).on("mousemove",j),a(b).on("mouseup",k)}),this.$el.bind("touchstart",function(a){a.originalEvent.touches.length&&(this._touchDif=a.originalEvent.touches[0].pageY)}),this.$el.bind("touchmove",function(a){if(a.originalEvent.preventDefault(),a.originalEvent.touches.length){var b=(this._touchDif-a.originalEvent.touches[0].pageY)/this.options.touchScrollStep;this.scrollContent(b,!0)}})},a.fn[f]=function(b){return this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))})}}(jQuery,window,document),function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var e,f=b||window.event,g=[].slice.call(arguments,1),h=0,i=0,j=0,k=0,l=0;return b=a.event.fix(f),b.type="mousewheel",f.wheelDelta&&(h=f.wheelDelta),f.detail&&(h=-1*f.detail),f.deltaY&&(j=-1*f.deltaY,h=j),f.deltaX&&(i=f.deltaX,h=-1*i),void 0!==f.wheelDeltaY&&(j=f.wheelDeltaY),void 0!==f.wheelDeltaX&&(i=-1*f.wheelDeltaX),k=Math.abs(h),(!c||c>k)&&(c=k),l=Math.max(Math.abs(j),Math.abs(i)),(!d||d>l)&&(d=l),e=h>0?"floor":"ceil",h=Math[e](h/c),i=Math[e](i/d),j=Math[e](j/d),g.unshift(b,h,i,j),(a.event.dispatch||a.event.handle).apply(this,g)}var c,d,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],f="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"];if(a.event.fixHooks)for(var g=e.length;g;)a.event.fixHooks[e[--g]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=f.length;a;)this.addEventListener(f[--a],b,!1);else this.onmousewheel=b},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],b,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),jQuery.fn.definePlugin("Slider",function(a){"use strict";function b(){return'<div class="uilib-slider-tooltip uilib-slider-tooltip-wrapper"><div class="picker-arrow-top"><div class="picker-arrow-one"></div><div class="picker-arrow-two"></div></div><div class="uilib-text"></div></div>'}var c={sliderClass:"uilib-slider",pinClass:"uilib-slider-pin",disabledClass:"disabled",textClass:"uilib-text"};return{init:function(){this.markup(),this.bindEvents(),this.options.create.call(this),this.setValue(this.options.value)},getDefaults:function(){return{minValue:0,maxValue:100,value:0,width:80,preLabel:"",postLabel:"",className:"default-uilib-slider-ui",toolTip:!1,supportClick:!0,slide:function(){},create:function(){}}},markup:function(){var d=(this.$el.css("left"),{width:this.options.width});this.$el.hasClass(c.sliderClass)||this.$el.addClass(c.sliderClass),this.options.preLabel&&(this.$el.prepend('<span class="uilib-text uilib-slider-preLabel">'+this.options.preLabel+"</span>"),d.left=14),this.$pin=a("<div>"),this.$el.append(this.$pin),this.options.postLabel&&this.$el.append('<span class="uilib-text uilib-slider-postLabel">'+this.options.postLabel+"</span>"),this.$el.addClass(c.sliderClass).css(d).addClass(this.options.className),this.$pin.addClass(c.pinClass),this.$pin.width(19),this.options.toolTip&&(this.$toolTip=a(b()),this.$pin.append(this.$toolTip.hide()))},getXFromEvent:function(a){return a.offsetX/this.$el.width()},bindEvents:function(){var b=a(window),c=this;c.options.supportClick&&this.$el.on("click",function(a){if(a.target===c.$el[0]){var b=c.getXFromEvent(a);c.setValue(c.transform(b)),c.triggerChangeEvent(c.getValue())}}),this.$pin.on("mousedown",function(a){function d(a){c.setPosition(a)}function e(){c.$toolTip&&c.$toolTip.hide(),c.enableTextSelection(),b.off("mousemove",d),b.off("mouseup",e),c.triggerChangeEvent(c.getValue())}c.$toolTip&&!c.$toolTip.is(":visible")&&c.$toolTip.show(),c.currentPos=c.$pin.position().left,c.startDragPos=a.pageX,c.disableTextSelection(a),b.on("mousemove",d),b.on("mouseup",e)})},getValue:function(){return this.transform(this.options.value)},setValue:function(a){var b;return this.options.value=this.valueInRangeToInnerRange(a),this.options.value!==this.last_value&&(this.last_value=this.options.value,b=this.getValue(),this.$el.trigger("slide",b),this.options.toolTip&&this.$toolTip.find("."+c.textClass).text(Math.round(b)),this.options.slide.call(this,b)),this.update()},transform:function(a){return this.options.minValue+a*(this.options.maxValue-this.options.minValue)},valueInRangeToInnerRange:function(a){return a=a<this.options.minValue?this.options.minValue:a,a=a>this.options.maxValue?this.options.maxValue:a,(a-this.options.minValue)/(this.options.maxValue-this.options.minValue)},disableTextSelection:function(){document.body.focus(),document.onselectstart=function(){return!1}},enableTextSelection:function(){document.onselectstart=null},setPosition:function(a){if(!this.isDisabled()){var b=a.pageX-this.startDragPos,c=this.currentPos+b,d=this.$el.width()-this.$pin.width();0>c&&(c=0),c>d&&(c=d),this.options.value=this.transform(c/d),this.setValue(this.options.value),this.startDragPos=a.pageX,this.currentPos=c}},update:function(){return this.$pin.css({left:this.options.value*(this.$el.width()-this.$pin.width())}),this},disable:function(){this.$el.addClass(c.disabledClass)},enable:function(){this.$el.removeClass(c.disabledClass)},isDisabled:function(){return this.$el.hasClass(c.disabledClass)}}}),jQuery.fn.definePlugin("Spinner",function(){"use strict";function a(){return"<div class="+c.upArrow+"></div><div class="+c.downArrow+"></span>"}function b(a){return"string"==typeof a&&""!==a&&(a=parseFloat(a)),""===a||isNaN(a)?null:a}var c={className:"uilib-spinner",defaultSize:"default",mediumSize:"medium",largeSize:"large",upArrow:"up-arrow",downArrow:"down-arrow"},d={mouseDown:"mousedown",mouseUp:"mouseup",mouseLeave:"mouseleave",focusOut:"focusout",keypress:"keypress"};return{init:function(){this.markup(),this.bindEvents(),this.setValue(this.options.value)},getDefaults:function(){return{minValue:0,maxValue:1e3,value:0,step:1,precision:0}},markup:function(){switch(this.$el.append("<input autocomplete='off'>").append(a()),this.$el.hasClass(c.className)||this.$el.addClass(c.className),this.options.size){case c.mediumSize:this.$el.addClass(c.mediumSize);break;case c.largeSize:this.$el.addClass(c.largeSize);break;default:this.$el.addClass(c.defaultSize)}},bindEvents:function(){var a,e=this,f=0,g=function(){clearTimeout(a),a=setTimeout(function(){e.setValue(b(e.getValue())+e.options.step*f),g()},100)};this.$el.on(d.mouseUp+" "+d.mouseLeave,function(b){clearTimeout(a),f=0,"mouseleave"!==b.type&&e.triggerChangeEvent(e.getValue())}),this.$el.on(d.mouseDown,"."+c.upArrow,function(){e.setValue(b(e.getValue())+e.options.step),e.triggerChangeEvent(e.getValue()),f=1,clearTimeout(a),a=setTimeout(g,500)}),this.$el.on(d.mouseDown,"."+c.downArrow,function(){e.setValue(b(e.getValue())-e.options.step),e.triggerChangeEvent(e.getValue()),f=-1,clearTimeout(a),a=setTimeout(g,500)}),this.$el.on(d.focusOut,"input",function(){e.setValue(b(e.getValue()))&&e.triggerChangeEvent(e.getValue())}),this.$el.on(d.keypress,"input",function(a){13==a.which&&e.setValue(b(e.getValue()))&&e.triggerChangeEvent(e.getValue())})},getValue:function(){return+this.$el.find("input").val()},setValue:function(a){return this.options.value=this.valueInRangeToInnerRange(a),this.options.value!==this.last_value?(this.last_value=this.options.value,this.update(),!0):void 0},update:function(){return this.$el.find("input").val(this.options.value),this},valueInRangeToInnerRange:function(a){return a=+(+a).toFixed(this.options.precision),a=a<this.options.minValue?this.options.minValue:a,a=a>this.options.maxValue?this.options.maxValue:a}}}),jQuery.fn.definePlugin("Tooltip",function(a){"use strict";var b={className:"uilib-tooltip",textClassName:"uilib-text",arrowClassName:"arrow_box",arrowHeight:12},c={mouseEnter:"mouseenter",mouseLeave:"mouseleave"},d=["top","right","left","bottom"];return{init:function(){this.markup(),this.bindEvents()},getDefaults:function(){return{placement:d[0],text:"",html:!1,template:"<div class="+b.className+"><div class="+b.arrowClassName+"><div class="+b.textClassName+"></div></div></div>",animation:!0}},markup:function(){},bindEvents:function(){function e(a){a.find("."+b.arrowClassName).addClass("down"),a.css("left",l.position().left+i(a)),a.css("top",l.position().top-(a.outerHeight()+b.arrowHeight))}function f(a){a.find("."+b.arrowClassName).addClass("up"),a.css("left",l.position().left+i(a)),a.css("top",l.position().top+l.outerHeight()+b.arrowHeight)}function g(a){a.find("."+b.arrowClassName).addClass("left"),a.css("left",l.position().left+l.outerWidth()+b.arrowHeight),a.css("top",l.position().top+j(a))}function h(a){a.find("."+b.arrowClassName).addClass("right"),a.css("left",l.position().left-(a.outerWidth()+b.arrowHeight)),a.css("top",l.position().top+j(a))}function i(a){if(l.outerWidth()>a.outerWidth()){var b=l.outerWidth()-a.outerWidth();return b/2}var b=a.outerWidth()-l.outerWidth();return-b/2}function j(a){if(l.outerHeight()>a.outerHeight()){var b=l.outerHeight()-a.outerHeight();return b/2}var b=a.outerHeight()-l.outerHeight();return-b/2}var k=this,l=k.$el;l.on(c.mouseEnter,function(){k.remove();var b=a(k.options.template);if(k.setText(l,b),l.after(b),a.inArray(k.options.placement,d)>-1)switch(k.options.placement){case"top":e(b);break;case"right":g(b);break;case"left":h(b);break;case"bottom":f(b);break;default:e(b)}else e(b)}),l.on(c.mouseLeave,function(){k.options.animation?a("."+b.className).fadeOut(function(){k.remove()}):k.remove()})},getValue:function(){return""},setValue:function(){""},update:function(){return this},remove:function(){a("."+b.className).remove()},setText:function(a,c){var d=c.find("."+b.textClassName),e=this.options.text||a.attr("wix-tooltip");this.options.html?d.html(e):d.text(e)}}});