!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=V(e||this.defaultElement||this)[0],this.element=V(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=V(),this.hoverable=V(),this.focusable=V(),this.classesElementLookup={},e!==this&&(V.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=V(e.style?e.ownerDocument:e.document||e),this.window=V(this.document[0].defaultView||this.document[0].parentWindow)),this.options=V.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:V.noop,_create:V.noop,_init:V.noop,destroy:function(){var i=this;this._destroy(),V.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:V.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return V.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=V.widget.extend({},this.options[t]),n=0;n
"),i=e.children()[0];return V("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(k(s),k(n))?o.important="horizontal":o.important="vertical",u.using.call(this,t,o)}),a.offset(V.extend(h,{using:t}))})},V.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,a=s-o,r=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),V.ui.plugin={add:function(t,e,i){var s,n=V.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=V.ui.safeActiveElement(this.document[0]);V(t.target).closest(e).length||V.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),V.ui.ddmanager&&(V.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0i[2]&&(o=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(a=i[3]+this.offset.click.top)),s.grid&&(t=s.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,a=!i||t-this.offset.click.top>=i[1]||t-this.offset.click.top>i[3]?t:t-this.offset.click.top>=i[1]?t-s.grid[1]:t+s.grid[1],t=s.grid[0]?this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,o=!i||t-this.offset.click.left>=i[0]||t-this.offset.click.left>i[2]?t:t-this.offset.click.left>=i[0]?t-s.grid[0]:t+s.grid[0]),"y"===s.axis&&(o=this.originalPageX),"x"===s.axis&&(a=this.originalPageY)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),V.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),V.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),V.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=V.extend({},t,{item:i.element});i.sortables=[],V(i.options.connectToSortable).each(function(){var t=V(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=V.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,V.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,n){V.each(n.sortables,function(){var t=!1,e=this;e.positionAbs=n.positionAbs,e.helperProportions=n.helperProportions,e.offset.click=n.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,V.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,t=this!==e&&this._intersectsWith(this.containerCache)&&V.contains(e.element[0],this.element[0])?!1:t})),t?(e.isOver||(e.isOver=1,n._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=n.offset.click.top,e.offset.click.left=n.offset.click.left,e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top,n._trigger("toSortable",i),n.dropped=e.element,V.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,e.fromOutside=n),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(n._parent),n._refreshOffsets(i),s.position=n._generatePosition(i,!0),n._trigger("fromSortable",i),n.dropped=!1,V.each(n.sortables,function(){this.refreshPositions()}))})}}),V.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=V("body"),i=i.options;s.css("cursor")&&(i._cursor=s.css("cursor")),s.css("cursor",i.cursor)},stop:function(t,e,i){i=i.options;i._cursor&&V("body").css("cursor",i._cursor)}}),V.ui.plugin.add("draggable","opacity",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("opacity")&&(i._opacity=e.css("opacity")),e.css("opacity",i.opacity)},stop:function(t,e,i){i=i.options;i._opacity&&V(e.helper).css("opacity",i._opacity)}}),V.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,n=!1,o=i.scrollParentNotHidden[0],a=i.document[0];o!==a&&"HTML"!==o.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+o.offsetHeight-t.pageY").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&V(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){V(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,a=this;if(this.handles=o.handles||(V(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=V(),this._addedHandles=V(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=V(this.handles[e]),this._on(this.handles[e],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=V(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=V(this.handles[e])[0])!==t.target&&!V.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=V(s.containment).scrollLeft()||0,i+=V(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=V(".ui-resizable-"+this.axis).css("cursor"),V("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),V.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(V.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),V("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),a&&i&&(t.top=l-e.minHeight),n&&i&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){V.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),V.ui.plugin.add("resizable","animate",{stop:function(e){var i=V(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,a=n?0:i.sizeDiff.width,n={width:i.size.width-a,height:i.size.height-o},a=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(V.extend(n,o&&a?{top:o,left:a}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&V(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),V.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=V(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,a=o instanceof V?o.get(0):/parent/.test(o)?e.parent().get(0):o;a&&(n.containerElement=V(a),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:V(document),left:0,top:0,width:V(document).width(),height:V(document).height()||document.body.parentNode.scrollHeight}):(i=V(a),s=[],V(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(a,"left")?a.scrollWidth:o,e=n._hasScroll(a)?a.scrollHeight:e,n.parentData={element:a,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=V(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,a={top:0,left:0},r=e.containerElement,t=!0;r[0]!==document&&/static/.test(r.css("position"))&&(a=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-a.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-a.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-a.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=V(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=V(t.helper),a=o.offset(),r=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o})}}),V.ui.plugin.add("resizable","alsoResize",{start:function(){var t=V(this).resizable("instance").options;V(t.alsoResize).each(function(){var t=V(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=V(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,a={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};V(s.alsoResize).each(function(){var t=V(this),s=V(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];V.each(e,function(t,e){var i=(s[e]||0)+(a[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){V(this).removeData("ui-resizable-alsoresize")}}),V.ui.plugin.add("resizable","ghost",{start:function(){var t=V(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==V.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=V(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=V(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),V.ui.plugin.add("resizable","grid",{resize:function(){var t,e=V(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,l=r[0]||1,h=r[1]||1,c=Math.round((s.width-n.width)/l)*l,u=Math.round((s.height-n.height)/h)*h,d=n.width+c,p=n.height+u,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=l),s&&(p+=h),f&&(d-=l),g&&(p-=h),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):((p-h<=0||d-l<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(i){var s=this,t=this.options;this.opos=[i.pageX,i.pageY],this.elementPos=V(this.element[0]).offset(),this.options.disabled||(this.selectees=V(t.filter,this.element[0]),this._trigger("start",i),V(t.appendTo).append(this.helper),this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0}),t.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var t=V.data(this,"selectable-item");t.startselected=!0,i.metaKey||i.ctrlKey||(s._removeClass(t.$element,"ui-selected"),t.selected=!1,s._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,s._trigger("unselecting",i,{unselecting:t.element}))}),V(i.target).parents().addBack().each(function(){var t,e=V.data(this,"selectable-item");if(e)return t=!i.metaKey&&!i.ctrlKey||!e.$element.hasClass("ui-selected"),s._removeClass(e.$element,t?"ui-unselecting":"ui-selected")._addClass(e.$element,t?"ui-selecting":"ui-unselecting"),e.unselecting=!t,e.selecting=t,(e.selected=t)?s._trigger("selecting",i,{selecting:e.element}):s._trigger("unselecting",i,{unselecting:e.element}),!1}))},_mouseDrag:function(s){if(this.dragged=!0,!this.options.disabled){var t,n=this,o=this.options,a=this.opos[0],r=this.opos[1],l=s.pageX,h=s.pageY;return ll||i.righth||i.bottoma&&i.rightr&&i.bottom *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t*{ cursor: "+o.cursor+" !important; }").appendTo(n)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return V.ui.ddmanager&&(V.ui.ddmanager.current=this),V.ui.ddmanager&&!o.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(t),!0},_scroll:function(t){var e=this.options,i=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageYt[this.floating?"width":"height"]?h&&c:o",i.document[0]);return i._addClass(t,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(t,"ui-sortable-helper"),"tbody"===n?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),V("",i.document[0]).appendTo(t)):"tr"===n?i._createTrPlaceholder(i.currentItem,t):"img"===n&&t.attr("src",i.currentItem.attr("src")),s||t.css("visibility","hidden"),t},update:function(t,e){s&&!o.forcePlaceholderSize||(e.height()&&(!o.forcePlaceholderSize||"tbody"!==n&&"tr"!==n)||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=V(o.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),o.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){V(" ",i.document[0]).attr("colspan",V(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,n,o,a,r,l,h,c=null,u=null,d=this.containers.length-1;0<=d;d--)V.contains(this.currentItem[0],this.containers[d].element[0])||(this._intersectsWith(this.containers[d].containerCache)?c&&V.contains(this.containers[d].element[0],c.element[0])||(c=this.containers[d],u=d):this.containers[d].containerCache.over&&(this.containers[d]._trigger("out",t,this._uiHash(this)),this.containers[d].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[u].containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1);else{for(i=1e4,s=null,n=(l=c.floating||this._isFloating(this.currentItem))?"left":"top",o=l?"width":"height",h=l?"pageX":"pageY",e=this.items.length-1;0<=e;e--)V.contains(this.containers[u].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(a=this.items[e].item.offset()[n],r=!1,t[h]-a>this.items[e][o]/2&&(r=!0),Math.abs(t[h]-a)this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0])),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function n(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i li > :first-child").add(t.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=V(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():V()}},_createIcons:function(){var t,e=this.options.icons;e&&(t=V(""),this._addClass(t,"ui-accordion-header-icon","ui-icon "+e.header),t.prependTo(this.headers),t=this.active.children(".ui-accordion-header-icon"),this._removeClass(t,e.header)._addClass(t,null,e.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons())):this._activate(e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var e=V.ui.keyCode,i=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case e.RIGHT:case e.DOWN:n=this.headers[(s+1)%i];break;case e.LEFT:case e.UP:n=this.headers[(s-1+i)%i];break;case e.SPACE:case e.ENTER:this._eventHandler(t);break;case e.HOME:n=this.headers[0];break;case e.END:n=this.headers[i-1]}n&&(V(t.target).attr("tabIndex",-1),V(n).attr("tabIndex",0),V(n).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===V.ui.keyCode.UP&&t.ctrlKey&&V(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=V()):!1===t.active?this._activate(0):this.active.length&&!V.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=V()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var i,t=this.options,e=t.heightStyle,s=this.element.parent();this.active=this._findActive(t.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=V(this),e=t.uniqueId().attr("id"),i=t.next(),s=i.uniqueId().attr("id");t.attr("aria-controls",s),i.attr("aria-labelledby",e)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(t.event),"fill"===e?(i=s.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=V(this).outerHeight(!0)}),this.headers.next().each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.headers.next().each(function(){var t=V(this).is(":visible");t||V(this).show(),i=Math.max(i,V(this).css("height","").height()),t||V(this).hide()}).height(i))},_activate:function(t){t=this._findActive(t)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):V()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():s.next(),r=i.next(),a={oldHeader:i,oldPanel:r,newHeader:o?V():s,newPanel:a};t.preventDefault(),n&&!e.collapsible||!1===this._trigger("beforeActivate",t,a)||(e.active=!o&&this.headers.index(s),this.active=n?V():s,this._toggle(a),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),e.icons&&(i=i.children(".ui-accordion-header-icon"),this._removeClass(i,null,e.icons.activeHeader)._addClass(i,null,e.icons.header)),n||(this._removeClass(s,"ui-accordion-header-collapsed")._addClass(s,"ui-accordion-header-active","ui-state-active"),e.icons&&(n=s.children(".ui-accordion-header-icon"),this._removeClass(n,null,e.icons.header)._addClass(n,null,e.icons.activeHeader)),this._addClass(s.next(),"ui-accordion-content-active")))},_toggle:function(t){var e=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=e,this.prevHide=i,this.options.animate?this._animate(e,i,t):(i.hide(),e.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),e.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):e.length&&this.headers.filter(function(){return 0===parseInt(V(this).attr("tabIndex"),10)}).attr("tabIndex",-1),e.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,i,e){var s,n,o,a=this,r=0,l=t.css("box-sizing"),h=t.length&&(!i.length||t.index()",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault(),this._activateItem(t)},"click .ui-menu-item":function(t){var e=V(t.target),i=V(V.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this._menuItems().first();e||this.focus(t,i)},blur:function(t){this._delay(function(){V.contains(this.element[0],V.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t,!0),this.mouseHandled=!1}})},_activateItem:function(t){var e,i;this.previousFilter||t.clientX===this.lastMousePosition.x&&t.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:t.clientX,y:t.clientY},e=V(t.target).closest(".ui-menu-item"),i=V(t.currentTarget),e[0]===i[0]&&(i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))))},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=V(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case V.ui.keyCode.PAGE_UP:this.previousPage(t);break;case V.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case V.ui.keyCode.HOME:this._move("first","first",t);break;case V.ui.keyCode.END:this._move("last","last",t);break;case V.ui.keyCode.UP:this.previous(t);break;case V.ui.keyCode.DOWN:this.next(t);break;case V.ui.keyCode.LEFT:this.collapse(t);break;case V.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case V.ui.keyCode.ENTER:case V.ui.keyCode.SPACE:this._activate(t);break;case V.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=this.previousFilter||"",s=n=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=V(this),e=t.prev(),i=V("").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=V(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),i=(e=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(e,"ui-menu-item")._addClass(i,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!V.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(i=parseFloat(V.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(V.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-i-s,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){clearTimeout(this.searching),this.close(t),this._change(t)}}),this._initSource(),this.menu=V("
    ").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault()},menufocus:function(t,e){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){V(t.target).trigger(t.originalEvent)});s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("
    ").text(i))},100))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==V.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=V("
    ",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||V.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(V.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=V.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length").append(V("
    ").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),V.extend(V.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(V.ui.autocomplete.escapeRegex(e),"i");return V.grep(t,function(t){return i.test(t.label||t.value||t)})}}),V.widget("ui.autocomplete",V.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1").text(e))},100))}});V.ui.autocomplete;var m=/ui-corner-([a-z]){2,6}/g;V.widget("ui.controlgroup",{version:"1.13.2",defaultElement:"
    ",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var o=this,a=[];V.each(this.options.items,function(s,t){var e,n={};if(t)return"controlgroupLabel"===s?((e=o.element.find(t)).each(function(){var t=V(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("")}),o._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(a=a.concat(e.get()))):void(V.fn[s]&&(n=o["_"+s+"Options"]?o["_"+s+"Options"]("middle"):{classes:{}},o.element.find(t).each(function(){var t=V(this),e=t[s]("instance"),i=V.widget.extend({},n);"button"===s&&t.parent(".ui-spinner").length||((e=e||t[s]()[s]("instance"))&&(i.classes=o._resolveClassesValues(i.classes,e)),t[s](i),i=t[s]("widget"),V.data(i[0],"ui-controlgroup-data",e||t[s]("instance")),a.push(i[0]))})))}),this.childWidgets=V(V.uniqueSort(a)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=V(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){e=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,e)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){t=this._buildSimpleOptions(t,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return V.each(i,function(t){var e=s.options.classes[t]||"",e=String.prototype.trim.call(e.replace(m,""));n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,(n=this.options.onlyVisible?n.filter(":visible"):n).length&&(V.each(["first","last"],function(t,e){var i,s=n[e]().data("ui-controlgroup-data");s&&o["_"+s.widgetName+"Options"]?((i=o["_"+s.widgetName+"Options"](1===n.length?"only":e)).classes=o._resolveClassesValues(i.classes,s),s.element[s.widgetName](i)):o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}});V.widget("ui.checkboxradio",[V.ui.formResetMixin,{version:"1.13.2",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e=this._super()||{};return this._readType(),t=this.element.labels(),this.label=V(t[t.length-1]),this.label.length||V.error("No label found for checkboxradio widget"),this.originalLabel="",(t=this.label.contents().not(this.element[0])).length&&(this.originalLabel+=t.clone().wrapAll("
    ").parent().html()),this.originalLabel&&(e.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(e.disabled=t),e},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||V.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+V.escapeSelector(t)+"']";return t?(this.form.length?V(this.form[0].elements).filter(e):V(e).filter(function(){return 0===V(this)._form().length})).not(this.element):V([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=V(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=V(""),this.iconSpace=V(" "),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),(t=this.iconSpace?t.not(this.iconSpace[0]):t).remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);var _;V.ui.checkboxradio;V.widget("ui.button",{version:"1.13.2",defaultElement:"
    "+(0
    ":""):"")}f+=_}return f+=F,t._keyEvent=!1,f},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var l,h,c,u,d,p,f=this._get(t,"changeMonth"),g=this._get(t,"changeYear"),m=this._get(t,"showMonthAfterYear"),_=this._get(t,"selectMonthLabel"),v=this._get(t,"selectYearLabel"),b="
    ",y="";if(o||!f)y+=""+a[e]+"";else{for(l=s&&s.getFullYear()===i,h=n&&n.getFullYear()===i,y+=""}if(m||(b+=y+(!o&&f&&g?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!g)b+=""+i+"";else{for(a=this._get(t,"yearRange").split(":"),u=(new Date).getFullYear(),d=(_=function(t){t=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?u+parseInt(t,10):parseInt(t,10);return isNaN(t)?u:t})(a[0]),p=Math.max(d,_(a[1]||"")),d=s?Math.max(d,s.getFullYear()):d,p=n?Math.min(p,n.getFullYear()):p,t.yearshtml+="",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),m&&(b+=(!o&&f&&g?"":" ")+y),b+="
    "},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),e=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),e=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,e)));t.selectedDay=e.getDate(),t.drawMonth=t.selectedMonth=e.getMonth(),t.drawYear=t.selectedYear=e.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),t=this._getMinMaxDate(t,"max"),e=i&&e=i.getTime())&&(!s||e.getTime()<=s.getTime())&&(!n||e.getFullYear()>=n)&&(!o||e.getFullYear()<=o)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);e=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),e,this._getFormatConfig(t))}}),V.fn.datepicker=function(t){if(!this.length)return this;V.datepicker.initialized||(V(document).on("mousedown",V.datepicker._checkExternalClick),V.datepicker.initialized=!0),0===V("#"+V.datepicker._mainDivId).length&&V("body").append(V.datepicker.dpDiv);var e=Array.prototype.slice.call(arguments,1);return"string"==typeof t&&("isDisabled"===t||"getDate"===t||"widget"===t)||"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this].concat(e)):V.datepicker._attachDatepicker(this,t)})},V.datepicker=new b,V.datepicker.initialized=!1,V.datepicker.uuid=(new Date).getTime(),V.datepicker.version="1.13.2";V.datepicker;V.widget("ui.dialog",{version:"1.13.2",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var e=V(this).css(t).offset().top;e<0&&V(this).css("top",t.top-e)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&V.fn.draggable&&this._makeDraggable(),this.options.resizable&&V.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?V(t):this.document.find(t||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:V.noop,enable:V.noop,close:function(t){var e=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||V.ui.safeBlur(V.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){e._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+V(this).css("z-index")}).get(),s=Math.max.apply(null,s);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),i=!0),i&&!e&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=V(V.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;(t=!(t=!(t=!(t=!(t=t||this.element.find("[autofocus]")).length?this.element.find(":tabbable"):t).length?this.uiDialogButtonPane.find(":tabbable"):t).length?this.uiDialogTitlebarClose.filter(":tabbable"):t).length?this.uiDialog:t).eq(0).trigger("focus")},_restoreTabbableFocus:function(){var t=V.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||V.contains(this.uiDialog[0],t)||this._focusTabbable()},_keepFocus:function(t){t.preventDefault(),this._restoreTabbableFocus(),this._delay(this._restoreTabbableFocus)},_createWrapper:function(){this.uiDialog=V("
    ").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===V.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);var e,i,s;t.keyCode!==V.ui.keyCode.TAB||t.isDefaultPrevented()||(e=this.uiDialog.find(":tabbable"),i=e.first(),s=e.last(),t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){i.trigger("focus")}),t.preventDefault()))},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=V("
    "),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){V(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=V("").button({label:V("").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),t=V("").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=V("
    "),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=V("
    ").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var s=this,t=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),V.isEmptyObject(t)||Array.isArray(t)&&!t.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(V.each(t,function(t,e){var i;e=V.extend({type:"button"},e="function"==typeof e?{click:e,text:t}:e),i=e.click,t={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text},delete e.click,delete e.icon,delete e.iconPosition,delete e.showLabel,delete e.icons,"boolean"==typeof e.text&&delete e.text,V("",e).button(t).appendTo(s.uiButtonSet).on("click",function(){i.apply(s.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var n=this,o=this.options;function a(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(t,e){n._addClass(V(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",t,a(e))},drag:function(t,e){n._trigger("drag",t,a(e))},stop:function(t,e){var i=e.offset.left-n.document.scrollLeft(),s=e.offset.top-n.document.scrollTop();o.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=s?"+":"")+s,of:n.window},n._removeClass(V(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",t,a(e))}})},_makeResizable:function(){var n=this,o=this.options,t=o.resizable,e=this.uiDialog.css("position"),t="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";function a(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:this._minHeight(),handles:t,start:function(t,e){n._addClass(V(this),"ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",t,a(e))},resize:function(t,e){n._trigger("resize",t,a(e))},stop:function(t,e){var i=n.uiDialog.offset(),s=i.left-n.document.scrollLeft(),i=i.top-n.document.scrollTop();o.height=n.uiDialog.height(),o.width=n.uiDialog.width(),o.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=i?"+":"")+i,of:n.window},n._removeClass(V(this),"ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",t,a(e))}}).css("position",e)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=V(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),e=V.inArray(this,t);-1!==e&&t.splice(e,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||this.document.data("ui-dialog-instances",t=[]),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};V.each(t,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(t,e){var i,s=this.uiDialog;"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:V("").text(""+this.options.closeText).html()}),"draggable"===t&&((i=s.is(":data(ui-draggable)"))&&!e&&s.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((i=s.is(":data(ui-resizable)"))&&!e&&s.resizable("destroy"),i&&"string"==typeof e&&s.resizable("option","handles",e),i||!1===e||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=V(this);return V("
    ").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!V(t.target).closest(".ui-dialog").length||!!V(t.target).closest(".ui-datepicker").length},_createOverlay:function(){var i,s;this.options.modal&&(i=V.fn.jquery.substring(0,4),s=!0,this._delay(function(){s=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",function(t){var e;s||((e=this._trackingInstances()[0])._allowInteraction(t)||(t.preventDefault(),e._focusTabbable(),"3.4."!==i&&"3.5."!==i||e._delay(e._restoreTabbableFocus)))}.bind(this)),this.overlay=V("
    ").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var t;this.options.modal&&this.overlay&&((t=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",t):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!1!==V.uiBackCompat&&V.widget("ui.dialog",V.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});V.ui.dialog,V.widget("ui.progressbar",{version:"1.13.2",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=V("
    ").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,e=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(e.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=V("
    ").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),V.widget("ui.selectmenu",[V.ui.formResetMixin,{version:"1.13.2",defaultElement:"",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var s=this._super(),n=this.element;return V.each(["min","max","step"],function(t,e){var i=n.attr(e);null!=i&&i.length&&(s[e]=i)}),s},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){var i=V.ui.safeActiveElement(this.document[0]);if(this.element[0]===i&&e){if(!this.spinning&&!this._start(t))return!1;this._spin((0").parent().append("")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0e.max?e.max:null!==e.min&&t"},_buttonHtml:function(){return""}});var S;V.ui.spinner;V.widget("ui.tabs",{version:"1.13.2",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(S=/#.*$/,function(t){var e=t.href.replace(S,""),i=location.href.replace(S,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=V.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!V.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=V()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=V()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var l=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){V(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){V(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return V("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=V(),this.anchors.each(function(t,e){var i,s,n,o=V(e).uniqueId().attr("id"),a=V(e).closest("li"),r=a.attr("aria-controls");l._isLocal(e)?(n=(i=e.hash).substring(1),s=l.element.find(l._sanitizeSelector(i))):(n=a.attr("aria-controls")||V({}).uniqueId()[0].id,(s=l.element.find(i="#"+n)).length||(s=l._createPanel(n)).insertAfter(l.panels[t-1]||l.tablist),s.attr("aria-live","polite")),s.length&&(l.panels=l.panels.add(s)),r&&a.data("ui-tabs-aria-controls",r),a.attr({"aria-controls":n,"aria-labelledby":o}),s.attr("aria-labelledby",o)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return V("
    ").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=V(e),!0===t||-1!==V.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=V(this).outerHeight(!0)}),this.panels.each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,V(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget).closest("li"),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):V(),i={oldTab:i,oldPanel:r,newTab:o?V():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||n&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!o&&this.tabs.index(s),this.active=n?V():s,this.xhr&&this.xhr.abort(),r.length||a.length||V.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,s=e.newPanel,n=e.oldPanel;function o(){i.running=!1,i._trigger("activate",t,e)}function a(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,o):(s.show(),o())}this.running=!0,n.length&&this.options.hide?this._hide(n,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n.hide(),a()),n.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&n.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===V(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=!t.length?this.active:t).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return!1===t?V():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+V.escapeSelector(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){V.data(this,"ui-tabs-destroy")?V(this).remove():V(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=V(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),Array.isArray(t)?V.map(t,function(t){return t!==i?t:null}):V.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==V.inArray(t,e))return;e=Array.isArray(e)?V.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);function n(t,e){"abort"===e&&o.panels.stop(!1,!0),o._removeClass(i,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===o.xhr&&delete o.xhr}var o=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),a=this._getPanelForTab(i),r={tab:i,panel:a};this._isLocal(t[0])||(this.xhr=V.ajax(this._ajaxSettings(t,s,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){a.html(t),o._trigger("load",s,r),n(i,e)},1)}).fail(function(t,e){setTimeout(function(){n(t,e)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return n._trigger("beforeLoad",i,V.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){t=V(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}}),!1!==V.uiBackCompat&&V.widget("ui.tabs",V.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});V.ui.tabs;V.widget("ui.tooltip",{version:"1.13.2",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=V(this).attr("title");return V("").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,e){var i=(t.attr("aria-describedby")||"").split(/\s+/);i.push(e),t.data("ui-tooltip-id",e).attr("aria-describedby",String.prototype.trim.call(i.join(" ")))},_removeDescribedBy:function(t){var e=t.data("ui-tooltip-id"),i=(t.attr("aria-describedby")||"").split(/\s+/),e=V.inArray(e,i);-1!==e&&i.splice(e,1),t.removeData("ui-tooltip-id"),(i=String.prototype.trim.call(i.join(" ")))?t.attr("aria-describedby",i):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=V("
    ").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=V([])},_setOption:function(t,e){var i=this;this._super(t,e),"content"===t&&V.each(this.tooltips,function(t,e){i._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur");i.target=i.currentTarget=e.element[0],s.close(i,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=V(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=V(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=V([])},open:function(t){var i=this,e=V(t?t.target:this.element).closest(this.options.items);e.length&&!e.data("ui-tooltip-id")&&(e.attr("title")&&e.data("ui-tooltip-title",e.attr("title")),e.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&e.parents().each(function(){var t,e=V(this);e.data("ui-tooltip-open")&&((t=V.Event("blur")).target=t.currentTarget=this,i.close(t,!0)),e.attr("title")&&(e.uniqueId(),i.parents[this.id]={element:this,title:e.attr("title")},e.attr("title",""))}),this._registerCloseHandlers(t,e),this._updateContent(e,t))},_updateContent:function(e,i){var t=this.options.content,s=this,n=i?i.type:null;if("string"==typeof t||t.nodeType||t.jquery)return this._open(i,e,t);(t=t.call(e[0],function(t){s._delay(function(){e.data("ui-tooltip-open")&&(i&&(i.type=n),this._open(i,e,t))})}))&&this._open(i,e,t)},_open:function(t,e,i){var s,n,o,a=V.extend({},this.options.position);function r(t){a.of=t,n.is(":hidden")||n.position(a)}i&&((s=this._find(e))?s.tooltip.find(".ui-tooltip-content").html(i):(e.is("[title]")&&(t&&"mouseover"===t.type?e.attr("title",""):e.removeAttr("title")),s=this._tooltip(e),n=s.tooltip,this._addDescribedBy(e,n.attr("id")),n.find(".ui-tooltip-content").html(i),this.liveRegion.children().hide(),(i=V("
    ").html(n.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),i.removeAttr("id").find("[id]").removeAttr("id"),i.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:r}),r(t)):n.position(V.extend({of:e},this.options.position)),n.hide(),this._show(n,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(o=this.delayedShow=setInterval(function(){n.is(":visible")&&(r(a.of),clearInterval(o))},13)),this._trigger("open",t,{tooltip:n})))},_registerCloseHandlers:function(t,e){var i={keyup:function(t){t.keyCode===V.ui.keyCode.ESCAPE&&((t=V.Event(t)).currentTarget=e[0],this.close(t,!0))}};e[0]!==this.element[0]&&(i.remove=function(){var t=this._find(e);t&&this._removeTooltip(t.tooltip)}),t&&"mouseover"!==t.type||(i.mouseleave="close"),t&&"focusin"!==t.type||(i.focusout="close"),this._on(!0,e,i)},close:function(t){var e,i=this,s=V(t?t.currentTarget:this.element),n=this._find(s);n?(e=n.tooltip,n.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.hiding=!0,e.stop(!0),this._hide(e,this.options.hide,function(){i._removeTooltip(V(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&V.each(this.parents,function(t,e){V(e.element).attr("title",e.title),delete i.parents[t]}),n.closing=!0,this._trigger("close",t,{tooltip:e}),n.hiding||(n.closing=!1))):s.removeData("ui-tooltip-open")},_tooltip:function(t){var e=V("
    ").attr("role","tooltip"),i=V("
    ").appendTo(e),s=e.uniqueId().attr("id");return this._addClass(i,"ui-tooltip-content"),this._addClass(e,"ui-tooltip","ui-widget ui-widget-content"),e.appendTo(this._appendTo(t)),this.tooltips[s]={element:t,tooltip:e}},_find:function(t){t=t.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(t){clearInterval(this.delayedShow),t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){t=t.closest(".ui-front, dialog");return t=!t.length?this.document[0].body:t},_destroy:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur"),e=e.element;i.target=i.currentTarget=e[0],s.close(i,!0),V("#"+t).remove(),e.data("ui-tooltip-title")&&(e.attr("title")||e.attr("title",e.data("ui-tooltip-title")),e.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==V.uiBackCompat&&V.widget("ui.tooltip",V.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}});V.ui.tooltip;var H=V,z={},A=z.toString,O=/^([\-+])=\s*(\d+\.?\d*)/,N=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),t[4]?(parseInt(t[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),t[4]?(parseInt(t[4]+t[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],E=H.Color=function(t,e,i,s){return new H.Color.fn.parse(t,e,i,s)},W={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},F={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},L=E.support={},R=H("

    ")[0],Y=H.each;function B(t){return null==t?t+"":"object"==typeof t?z[A.call(t)]||"object":typeof t}function j(t,e,i){var s=F[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:Math.min(s.max,Math.max(0,t)))}function q(s){var n=E(),o=n._rgba=[];return s=s.toLowerCase(),Y(N,function(t,e){var i=e.re.exec(s),i=i&&e.parse(i),e=e.space||"rgba";if(i)return i=n[e](i),n[W[e].cache]=i[W[e].cache],o=n._rgba=i._rgba,!1}),o.length?("0,0,0,0"===o.join()&&H.extend(o,st.transparent),n):st[s]}function K(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}R.style.cssText="background-color:rgba(1,1,1,.5)",L.rgba=-1o.mod/2?s+=o.mod:s-n>o.mod/2&&(s-=o.mod)),l[i]=j((n-s)*a+s,e)))}),this[e](l)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),i=e.pop(),s=E(t)._rgba;return E(H.map(e,function(t,e){return(1-i)*s[e]+i*t}))},toRgbaString:function(){var t="rgba(",e=H.map(this._rgba,function(t,e){return null!=t?t:2

    ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:i.width(),height:i.height()},n=document.activeElement;try{n.id}catch(t){n=document.body}return i.wrap(t),i[0]!==n&&!V.contains(i[0],n)||V(n).trigger("focus"),t=i.parent(),"static"===i.css("position")?(t.css({position:"relative"}),i.css({position:"relative"})):(V.extend(s,{position:i.css("position"),zIndex:i.css("z-index")}),V.each(["top","left","bottom","right"],function(t,e){s[e]=i.css(e),isNaN(parseInt(s[e],10))&&(s[e]="auto")}),i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(e),t.css(s).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!V.contains(t[0],e)||V(e).trigger("focus")),t}}),V.extend(V.effects,{version:"1.13.2",define:function(t,e,i){return i||(i=e,e="effect"),V.effects.effect[t]=i,V.effects.effect[t].mode=e,i},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,e="vertical"!==i?(e||100)/100:1;return{height:t.height()*e,width:t.width()*s,outerHeight:t.outerHeight()*e,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();1").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(nt+"placeholder",e)),t.css({position:i,left:s.left,top:s.top}),e},removePlaceholder:function(t){var e=nt+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(t){V.effects.restoreStyle(t),V.effects.removePlaceholder(t)},setTransition:function(s,t,n,o){return o=o||{},V.each(t,function(t,e){var i=s.cssUnit(e);0
    ");l.appendTo("body").addClass(t.className).css({top:s.top-a,left:s.left-r,height:i.innerHeight(),width:i.innerWidth(),position:n?"fixed":"absolute"}).animate(o,t.duration,t.easing,function(){l.remove(),"function"==typeof e&&e()})}}),V.fx.step.clip=function(t){t.clipInit||(t.start=V(t.elem).cssClip(),"string"==typeof t.end&&(t.end=ct(t.end,t.elem)),t.clipInit=!0),V(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},it={},V.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){it[t]=function(t){return Math.pow(t,e+2)}}),V.extend(it,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),V.each(it,function(t,e){V.easing["easeIn"+t]=e,V.easing["easeOut"+t]=function(t){return 1-e(1-t)},V.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}});R=V.effects,V.effects.define("blind","hide",function(t,e){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=V(this),n=t.direction||"up",o=s.cssClip(),a={clip:V.extend({},o)},r=V.effects.createPlaceholder(s);a.clip[i[n][0]]=a.clip[i[n][1]],"show"===t.mode&&(s.cssClip(a.clip),r&&r.css(V.effects.clipToBox(a)),a.clip=o),r&&r.animate(V.effects.clipToBox(a),t.duration,t.easing),s.animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("bounce",function(t,e){var i,s,n=V(this),o=t.mode,a="hide"===o,r="show"===o,l=t.direction||"up",h=t.distance,c=t.times||5,o=2*c+(r||a?1:0),u=t.duration/o,d=t.easing,p="up"===l||"down"===l?"top":"left",f="up"===l||"left"===l,g=0,t=n.queue().length;for(V.effects.createPlaceholder(n),l=n.css(p),h=h||n["top"==p?"outerHeight":"outerWidth"]()/3,r&&((s={opacity:1})[p]=l,n.css("opacity",0).css(p,f?2*-h:2*h).animate(s,u,d)),a&&(h/=Math.pow(2,c-1)),(s={})[p]=l;g
    ").css({position:"absolute",visibility:"visible",left:-s*p,top:-i*f}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:p,height:f,left:n+(u?a*p:0),top:o+(u?r*f:0),opacity:u?0:1}).animate({left:n+(u?0:a*p),top:o+(u?0:r*f),opacity:u?1:0},t.duration||500,t.easing,m)}),V.effects.define("fade","toggle",function(t,e){var i="show"===t.mode;V(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("fold","hide",function(e,t){var i=V(this),s=e.mode,n="show"===s,o="hide"===s,a=e.size||15,r=/([0-9]+)%/.exec(a),l=!!e.horizFirst?["right","bottom"]:["bottom","right"],h=e.duration/2,c=V.effects.createPlaceholder(i),u=i.cssClip(),d={clip:V.extend({},u)},p={clip:V.extend({},u)},f=[u[l[0]],u[l[1]]],s=i.queue().length;r&&(a=parseInt(r[1],10)/100*f[o?0:1]),d.clip[l[0]]=a,p.clip[l[0]]=a,p.clip[l[1]]=0,n&&(i.cssClip(p.clip),c&&c.css(V.effects.clipToBox(p)),p.clip=u),i.queue(function(t){c&&c.animate(V.effects.clipToBox(d),h,e.easing).animate(V.effects.clipToBox(p),h,e.easing),t()}).animate(d,h,e.easing).animate(p,h,e.easing).queue(t),V.effects.unshift(i,s,4)}),V.effects.define("highlight","show",function(t,e){var i=V(this),s={backgroundColor:i.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),V.effects.saveStyle(i),i.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("size",function(s,e){var n,i=V(this),t=["fontSize"],o=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=s.mode,l="effect"!==r,h=s.scale||"both",c=s.origin||["middle","center"],u=i.css("position"),d=i.position(),p=V.effects.scaledDimensions(i),f=s.from||p,g=s.to||V.effects.scaledDimensions(i,0);V.effects.createPlaceholder(i),"show"===r&&(r=f,f=g,g=r),n={from:{y:f.height/p.height,x:f.width/p.width},to:{y:g.height/p.height,x:g.width/p.width}},"box"!==h&&"both"!==h||(n.from.y!==n.to.y&&(f=V.effects.setTransition(i,o,n.from.y,f),g=V.effects.setTransition(i,o,n.to.y,g)),n.from.x!==n.to.x&&(f=V.effects.setTransition(i,a,n.from.x,f),g=V.effects.setTransition(i,a,n.to.x,g))),"content"!==h&&"both"!==h||n.from.y!==n.to.y&&(f=V.effects.setTransition(i,t,n.from.y,f),g=V.effects.setTransition(i,t,n.to.y,g)),c&&(c=V.effects.getBaseline(c,p),f.top=(p.outerHeight-f.outerHeight)*c.y+d.top,f.left=(p.outerWidth-f.outerWidth)*c.x+d.left,g.top=(p.outerHeight-g.outerHeight)*c.y+d.top,g.left=(p.outerWidth-g.outerWidth)*c.x+d.left),delete f.outerHeight,delete f.outerWidth,i.css(f),"content"!==h&&"both"!==h||(o=o.concat(["marginTop","marginBottom"]).concat(t),a=a.concat(["marginLeft","marginRight"]),i.find("*[width]").each(function(){var t=V(this),e=V.effects.scaledDimensions(t),i={height:e.height*n.from.y,width:e.width*n.from.x,outerHeight:e.outerHeight*n.from.y,outerWidth:e.outerWidth*n.from.x},e={height:e.height*n.to.y,width:e.width*n.to.x,outerHeight:e.height*n.to.y,outerWidth:e.width*n.to.x};n.from.y!==n.to.y&&(i=V.effects.setTransition(t,o,n.from.y,i),e=V.effects.setTransition(t,o,n.to.y,e)),n.from.x!==n.to.x&&(i=V.effects.setTransition(t,a,n.from.x,i),e=V.effects.setTransition(t,a,n.to.x,e)),l&&V.effects.saveStyle(t),t.css(i),t.animate(e,s.duration,s.easing,function(){l&&V.effects.restoreStyle(t)})})),i.animate(g,{queue:!1,duration:s.duration,easing:s.easing,complete:function(){var t=i.offset();0===g.opacity&&i.css("opacity",f.opacity),l||(i.css("position","static"===u?"relative":u).offset(t),V.effects.saveStyle(i)),e()}})}),V.effects.define("scale",function(t,e){var i=V(this),s=t.mode,s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)||"effect"!==s?0:100),s=V.extend(!0,{from:V.effects.scaledDimensions(i),to:V.effects.scaledDimensions(i,s,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(s.from.opacity=1,s.to.opacity=0),V.effects.effect.size.call(this,s,e)}),V.effects.define("puff","hide",function(t,e){t=V.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});V.effects.effect.scale.call(this,t,e)}),V.effects.define("pulsate","show",function(t,e){var i=V(this),s=t.mode,n="show"===s,o=2*(t.times||5)+(n||"hide"===s?1:0),a=t.duration/o,r=0,l=1,s=i.queue().length;for(!n&&i.is(":visible")||(i.css("opacity",0).show(),r=1);l=0}var e=g(b),f=d(b);return e!==f&&c("jQuery.isNumeric() should not be called on constructed objects"),f},d(a,"unique",a.uniqueSort,"jQuery.unique is deprecated, use jQuery.uniqueSort"),d(a.expr,"filters",a.expr.pseudos,"jQuery.expr.filters is now jQuery.expr.pseudos"),d(a.expr,":",a.expr.pseudos,'jQuery.expr[":"] is now jQuery.expr.pseudos');var l=a.ajax;a.ajax=function(){var a=l.apply(this,arguments);return a.promise&&(d(a,"success",a.done,"jQXHR.success is deprecated and removed"),d(a,"error",a.fail,"jQXHR.error is deprecated and removed"),d(a,"complete",a.always,"jQXHR.complete is deprecated and removed")),a};var m=a.fn.removeAttr,n=a.fn.toggleClass,o=/\S+/g;a.fn.removeAttr=function(b){var d=this;return a.each(b.match(o),function(b,e){a.expr.match.bool.test(e)&&(c("jQuery.fn.removeAttr no longer sets boolean properties: "+e),d.prop(e,!1))}),m.apply(this,arguments)},a.fn.toggleClass=function(b){return void 0!==b&&"boolean"!=typeof b?n.apply(this,arguments):(c("jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var c=this.getAttribute&&this.getAttribute("class")||"";c&&a.data(this,"__className__",c),this.setAttribute&&this.setAttribute("class",c||b===!1?"":a.data(this,"__className__")||"")}))};var p=!1;a.swap&&a.each(["height","width","reliableMarginRight"],function(b,c){var d=a.cssHooks[c]&&a.cssHooks[c].get;d&&(a.cssHooks[c].get=function(){var a;return p=!0,a=d.apply(this,arguments),p=!1,a})}),a.swap=function(a,b,d,e){var f,g,h={};p||c("jQuery.swap() is undocumented and deprecated");for(g in b)h[g]=a.style[g],a.style[g]=b[g];f=d.apply(a,e||[]);for(g in b)a.style[g]=h[g];return f};var q=a.data;a.data=function(b,d,e){var f;return d&&d!==a.camelCase(d)&&(f=a.hasData(b)&&q.call(this,b),f&&d in f)?(c("jQuery.data() always sets/gets camelCased names: "+d),arguments.length>2&&(f[d]=e),f[d]):q.apply(this,arguments)};var r=a.Tween.prototype.run;a.Tween.prototype.run=function(b){a.easing[this.easing].length>1&&(c('easing function "jQuery.easing.'+this.easing.toString()+'" should use only first argument'),a.easing[this.easing]=a.easing[this.easing].bind(a.easing,b,this.options.duration*b,0,1,this.options.duration)),r.apply(this,arguments)};var s=a.fn.load,t=a.event.fix;a.event.props=[],a.event.fixHooks={},a.event.fix=function(b){var d,e=b.type,f=this.fixHooks[e],g=a.event.props;if(g.length)for(c("jQuery.event.props are deprecated and removed: "+g.join());g.length;)a.event.addProp(g.pop());if(f&&!f._migrated_&&(f._migrated_=!0,c("jQuery.event.fixHooks are deprecated and removed: "+e),(g=f.props)&&g.length))for(;g.length;)a.event.addProp(g.pop());return d=t.call(this,b),f&&f.filter?f.filter(d,b):d},a.each(["load","unload","error"],function(b,d){a.fn[d]=function(){var a=Array.prototype.slice.call(arguments,0);return"load"===d&&"string"==typeof a[0]?s.apply(this,a):(c("jQuery.fn."+d+"() is deprecated"),a.splice(0,0,d),arguments.length?this.on.apply(this,a):(this.triggerHandler.apply(this,a),this))}}),a(function(){a(document).triggerHandler("ready")}),a.event.special.ready={setup:function(){this===document&&c("'ready' event is deprecated")}},a.fn.extend({bind:function(a,b,d){return c("jQuery.fn.bind() is deprecated"),this.on(a,null,b,d)},unbind:function(a,b){return c("jQuery.fn.unbind() is deprecated"),this.off(a,null,b)},delegate:function(a,b,d,e){return c("jQuery.fn.delegate() is deprecated"),this.on(b,a,d,e)},undelegate:function(a,b,d){return c("jQuery.fn.undelegate() is deprecated"),1===arguments.length?this.off(a,"**"):this.off(b,a||"**",d)}});var u=a.fn.offset;a.fn.offset=function(){var b,d=this[0],e={top:0,left:0};return d&&d.nodeType?(b=(d.ownerDocument||document).documentElement,a.contains(b,d)?u.apply(this,arguments):(c("jQuery.fn.offset() requires an element connected to a document"),e)):(c("jQuery.fn.offset() requires a valid DOM element"),e)};var v=a.param;a.param=function(b,d){var e=a.ajaxSettings&&a.ajaxSettings.traditional;return void 0===d&&e&&(c("jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),d=e),v.call(this,b,d)};var w=a.fn.andSelf||a.fn.addBack;a.fn.andSelf=function(){return c("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)};var x=a.Deferred,y=[["resolve","done",a.Callbacks("once memory"),a.Callbacks("once memory"),"resolved"],["reject","fail",a.Callbacks("once memory"),a.Callbacks("once memory"),"rejected"],["notify","progress",a.Callbacks("memory"),a.Callbacks("memory")]];a.Deferred=function(b){var d=x(),e=d.promise();return d.pipe=e.pipe=function(){var b=arguments;return c("deferred.pipe() is deprecated"),a.Deferred(function(c){a.each(y,function(f,g){var h=a.isFunction(b[f])&&b[f];d[g[1]](function(){var b=h&&h.apply(this,arguments);b&&a.isFunction(b.promise)?b.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[g[0]+"With"](this===e?c.promise():this,h?[b]:arguments)})}),b=null}).promise()},b&&b.call(d,d),d}}(jQuery,window); function vat(p, vat) { if (p > 0 && p <= 0.0000001) { return 0; } var priceParam = isNaN(p) ? 0.0 : parseFloat(p); var vatParam = isNaN(vat) > 0 ? 0 : parseInt(vat); priceParam = priceParam * (100 + vatParam) / 100; return format(priceParam); } function format(p, d) { var decimals = typeof d != "undefined" ? d : typeof DECIMAL_LENGTH !== 'undefined' ? DECIMAL_LENGTH : 2; var n = !isFinite(+p) ? 0 : +p, prec = !isFinite(+decimals) ? 2 : Math.abs(decimals), sep = (typeof SEP_THO === 'undefined') ? '.' : SEP_THO, dec = (typeof SEP_DEC === 'undefined') ? ',' : SEP_DEC, s = '', toFixedFix = function (n, prec) { var k = Math.pow(10, prec); return '' + Math.round(n * k) / k; }; s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.'); if (s[0].length > 3) { s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); } if ((s[1] || '').length < prec) { s[1] = s[1] || ''; s[1] += new Array(prec - s[1].length + 1).join('0'); } return s.join(dec); } function moneyExchange(price, from, to) { var k = from + '_TO_' + to; if (typeof RATE === 'object' && typeof RATE[k] !== 'undefined') { return price * RATE[k]; } else { return price; } } function Template(options) { var counter = 900; Template.ready = function (fn) { Template.instance.activeTemplate.set('ready', fn); }; Template.htmlObject = Template.htmlObject || {}; var opt = { 'content': '', 'source': '#page-html', 'destination': '#page-content', 'assign': {}, 'routes': {}, 'id': 'last', callback: 'callbackFn', ready: function () { } }; var filters = { 'default': function (p, defaultVal) { return (typeof p === 'undefined' || p === '') ? defaultVal : p; }, limitTo: function (p, limit, begin) { p = p + ""; limit = limit > 0 ? limit : 10; begin = begin > 0 ? begin : 0; return p.substring(begin, limit); }, format: function (p, dec) { return window.format(p, dec); }, exchange: function (p, from, to) { return format(window.moneyExchange(p, from, to)); }, vat: function (p, vat) { return window.vat(p, vat); }, currency: function (n, c) { c = isNaN(c = Math.abs(c)) ? 2 : c, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; return s + (j ? i.substr(0, j) + ',' : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + ',') + (c ? '.' + Math.abs(n - i).toFixed(c).slice(2) : ""); }, date: function (p, format) { p = parseInt(p); if (isNaN(p) || p < 1000000000) { p = 1000000000; } else if (p < 9000000000) { p = p * 1000; } format = format.replace(/["']/g, ''); function pad(s) { return (s < 10) ? '0' + s : s; } var d = new Date(p); format = format.replace(/y+/ig, d.getFullYear()); format = format.replace(/d+/ig, pad(d.getDate())); format = format.replace(/m+/ig, pad(d.getMonth() + 1)); format = format.replace(/h+/ig, pad(d.getHours())); format = format.replace(/i+/ig, pad(d.getMinutes())); format = format.replace(/s+/ig, pad(d.getSeconds())); return format; }, filter: function (p) { }, lowercase: function (p) { return typeof p === 'string' ? p.toLowerCase() : p; }, number: function (p) { }, uppercase: function (p) { return typeof p === 'string' ? p.toUpperCase() : p; }, indexOf: function (p, key) { return p.indexOf(key); }, test: function (p, rgxStr) { var rgx = new RegExp(rgxStr, "ig"); var r = rgx.test(p); return r ? 1 : 0; }, replace: function (p, oldVal, newVal) { oldVal = oldVal.toString().replace(/-OR-/ig, '|').replace(/-AND-/ig, '&').trim(); var re = new RegExp(oldVal, "ig"); if (p === null) { p = ''; } return p.toString().replace(re, newVal); }, reverse: function (p) { return p.reverse(); } }; for (var i in options) { opt[i] = options[i]; } var _this = this; this.assign = function (key, val) { if (typeof key === 'object') { for (var i in key) { opt.assign[i] = key[i]; } } else { opt.assign[key] = val; } }; this.getVar = function (key) { return opt.assign[key]; }; this.get = function (key) { return opt[key]; }; this.set = function (key, val) { opt[key] = val; }; this.display = function () { var navs = typeof navigation === 'undefined' ? [] : navigation; if ($("[ng-app]").length > 0) { opt.source = "[ng-app]"; opt.destination = "[ng-app]"; } if (typeof Template.htmlObject[opt.id] === 'undefined') { opt.content = $(opt.source).is('textarea') ? $(opt.source).val() : $(opt.source).html(); opt.content = opt.content.replace(/\r?\n|\r/ig, ' '); opt.content = opt.content.replace(/\s+/g, ' '); Template.htmlObject[opt.id] = opt.content; } else { opt.content = Template.htmlObject[opt.id]; $(opt.source).html(opt.content); } var insideHtml = []; $('
    ').html(opt.content).find('.angularTemplate,.angularNotRender').each(function () { insideHtml.push($(this).html()); }); $(opt.source).css('visibility', 'hidden'); replaceForeach(); replaceIf(); opt.content = $(opt.source).is('textarea') ? $(opt.source).val() : $(opt.source).html(); opt.content = opt.content || ""; replaceShortIf(); replaceObject(); replaceVariable(); opt.content = opt.content.replace(/\s+ng-(\w+?)\s*=/ig, " $1="); opt.content = opt.content.replace(/\{\{[\w.]+\}\}/ig, ''); $(opt.destination).html(opt.content); if (typeof navs === 'object' && navs.length > 0) { var str = '' + main_page + ''; //anasayfa if ($(document).width() <= 640) { str = ''; $(".Navigate").css('right', 10); } for (var i = 0; i < navs.length; i++) { str += '' + navs[i].text + ''; } $('.Navigate:first').append(str); } else { $('.Navigate:first').remove(); } for (var i = 0; i < insideHtml.length; i++) { $(opt.source).find('.angularTemplate,.angularNotRender').eq(i).html(insideHtml[i]); } $(opt.destination).show(); $(opt.destination).css('visibility', 'visible'); opt.ready(opt.assign); var fn = opt['callback']; if (typeof fn === 'string' && typeof window[fn] === 'function') { window[fn](opt.assign); } else { } }; Template.instance = Template.instance || {}; Template.instance['activeTemplate'] = this; Template.instance[_this.get('id')] = this; function getVal(str) { str = str || ''; str = str.trim(); var val = ''; if (str[0] === "'") { val = str.replace(/'/g, ''); } else if (str.match(/^WINDOW\./g)) { var exp = str.replace('WINDOW.', '').split('.'); var obj = window[exp[0]]; if (typeof obj === 'object' && obj !== null) { if (obj[exp[1]] != null && typeof obj[exp[1]] === 'object' && typeof exp[2] === 'string') { val = obj[exp[1]][exp[2]] || ''; } else { val = typeof obj[exp[1]] === 'undefined' ? '' : obj[exp[1]]; } } else { val = typeof obj === 'undefined' ? '' : obj; } } else if (str.match(/\./g)) { var exp = str.split('.'); var obj = _this.getVar(exp[0]); if (typeof obj === 'object' && obj !== null) { if (obj[exp[1]] != null && typeof obj[exp[1]] === 'object' && typeof exp[2] === 'string') { val = obj[exp[1]][exp[2]] || ''; } else { val = typeof obj[exp[1]] === 'undefined' ? '' : obj[exp[1]]; } } } else if (str.match(/^-?(\d+)$/g)) { val = parseInt(str); } else if (str.match(/^(\w+)$/g)) { val = _this.getVar(str); } return val; } function replaceAngularTags(content, find, newVal) { var r = /\{\{([^\{\}]+?)\}\}/g; var m; var str = ''; while ((m = r.exec(content)) !== null) { str = m[0].replace(find, newVal); content = content.replace(m[0], str); } return content; } function childReplace(content, regex, oldStr, newStr) { var m, str; var r = new RegExp(oldStr, "g"); while ((m = regex.exec(content)) !== null) { str = m[1].replace(r, newStr); content = content.replace(m[1], str); } return content; } function replaceForeach() { var exist = false; var indexCounter = 0; $(opt.source).find('[ng-repeat]').each(function () { exist = true; var str = $(this).attr('ng-repeat'); $(this).removeAttr('ng-repeat'); var re = /(\w+)\s+in\s+([\w.\|:']+)/i; var content = $('
    ').append($(this).clone()).html(); var newVar = 'VARS' + counter++; var contentAll = ''; if (str.match(re)) { var arr = re.exec(str); var obj = afterFnVal(arr[2]); if (typeof obj !== 'object') { $(this).html(arr[2] + " Değişkeni Bulunamadı!"); $(this).remove(); return false; } var mArr = []; for (var obji of obj) { var newVar = 'VARS' + counter++; var fContent = content; fContent = fContent.replace(/\{\{([^\r\n\{\}]*?)\$index([^\r\n\{\}]*?)\}\}/g, "{{$1" + i + "$2}}"); var fRe1 = new RegExp("(\\W)" + arr[1] + '(\\W)', "g"); var fRe2 = new RegExp('(ng-if=".*?)' + arr[1] + '(.*?")', "g"); var fRe3 = new RegExp('(ng-repeat=".*?)' + arr[1] + '(.*?")', "g"); _this.assign(newVar, obji); fContent = replaceAngularTags(fContent, fRe1, '$1' + newVar + '$2'); var findStr = arr[1] + "\\."; fContent = childReplace(fContent, /ng-if="(.*?)"/g, findStr, newVar + "."); fContent = childReplace(fContent, /ng-repeat="(.*?)"/g, findStr, newVar + "."); fContent = childReplace(fContent, /\{\{(.*?)\}\}/g, '\$index', indexCounter); contentAll += fContent; } $(this).after(contentAll); $(this).remove(); } indexCounter++; }); if (exist) { replaceForeach(); } return true; } function compareVars(val1, val2, operator) { var result = false; switch (operator) { case '==': result = val1 == val2; break; case '!=': result = val1 !== val2; break; case '<': result = val1 < val2; break; case '>': result = val1 > val2; break; case '>=': result = val1 >= val2; break; case '<=': result = val1 <= val2; break; } return result; } function operateVars(val1, val2, operator) { var result = 0; val1 = parseFloat(val1); val2 = parseFloat(val2); switch (operator) { case '-': result = val1 - val2; break; case '+': result = val1 + val2; break; case '*': result = val1 * val2; break; case '/': result = val1 / val2; break; } return result; } function replaceIf() { $(opt.source).find("[ng-if]").each(function () { var str = $(this).attr('ng-if'); $(this).removeAttr('ng-if'); var ifCondition = 'and'; var strArr = []; // || str.indexOf('||') if (str.indexOf('&&') > 0) { strArr = str.split('&&'); } else if (str.indexOf('||') > 0) { strArr = str.split('||'); ifCondition = 'or'; } else { strArr = [str]; } var resultStr = 'if: '; for (var i = 0; i < strArr.length; i++) { str = strArr[i]; var re = /\s*(.+?)\s*([<>=!]{1,2})\s*(.+)\s*/i; var content = $(this).html(); var contentAll = ''; if (str.match(re)) { var arr = re.exec(str); var val1 = afterFnVal(arr[1]); var val2 = afterFnVal(arr[3]); resultStr += compareVars(val1, val2, arr[2]) == true ? 'true' : 'false'; } } if (ifCondition === 'and' && resultStr.indexOf('false') > 0) { $(this).remove(); } if (ifCondition === 'or' && resultStr.indexOf('true') < 0) { $(this).remove(); } }); return true; } function afterFnVal(str) { if (str.indexOf('|') < 1) { return getVal(str); } var exp = str.split('|'); var params = [exp[0]]; var fn = exp[1]; if (exp[1].indexOf(':') > 0) { fn = exp[1].replace(/^\s*(\w+):.*?$/ig, '$1'); var arr = exp[1].replace(/^.*?:/ig, '').split(':'); for (var i = 0; i < arr.length; i++) { params.push(arr[i]); } } for (var i = 0; i < params.length; i++) { params[i] = getVal(params[i]); } var result = params[0]; if (fn.length > 2 && typeof filters[fn] === 'function') { result = filters[fn].apply(this, params); } else if (typeof window[fn] === 'function') { result = window[fn].apply(this, params); } return result; } function replaceShortIf() { var oldContent = opt.content; var r = /\{\{\s*([^\r\n\t\|\{\}]+?)\s*([><=\!]+)\s*([^\{\}]+?)\s+\?\s+(.*?)\s*:\s*(.*?)\s*\}\}/gi; var m; while ((m = r.exec(oldContent)) !== null) { var val1 = getVal(m[1]); var val2 = getVal(m[3]); var result = compareVars(val1, val2, m[2]); var newVal = result ? getVal(m[4]) : getVal(m[5]); opt.content = opt.content.replace(m[0], newVal); } } function replaceObject() { var oldContent = opt.content; var r = /\{\{\s*(\w+)\.(\w+)\s*\}\}/gi; var m; while ((m = r.exec(oldContent)) !== null) { var obj = _this.getVar(m[1]); if (typeof obj !== 'object' || obj === null) { continue; } var key = m[2]; if (typeof obj[key] === 'undefined' || obj[key] === null) { obj[key] = ''; } opt.content = opt.content.replace(m[0], obj[key]); } } function replaceVariable() { var oldContent = opt.content; var arr = []; var newVal = ''; var operator = ''; var child = ""; var fn = ""; var r = /\{\{(\s*[^\r\n\t]+?\s*)\}\}/gi; var m; while ((m = r.exec(oldContent)) !== null) { if (/[\+\*\/\-]/g.test(m[1]) && m[1].indexOf("'") < 0) { fn = m[1].indexOf('(') > -1 && m[1].indexOf('|') > -1 ? m[1].replace(/^.*?\|/ig, '|') : ''; m[1] = m[1].replace(fn, '').replace(/[\(\)]/g, ''); arr = m[1].split(/[\+\*\/\-]/g); operator = m[1].replace(/^.*?([\+\*\/\-]).*?$/ig, "$1"); newVal = operateVars(afterFnVal(arr[0]), afterFnVal(arr[1]), operator); newVal = fn == '' ? newVal : afterFnVal(newVal + fn); } else { newVal = afterFnVal(m[1]); } opt.content = opt.content.replace(m[0], newVal); continue; } } } (function(window, document, exportName, undefined) { 'use strict'; var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o']; var TEST_ELEMENT = document.createElement('div'); var TYPE_FUNCTION = 'function'; var round = Math.round; var abs = Math.abs; var now = Date.now; function setTimeoutContext(fn, timeout, context) { return setTimeout(bindFn(fn, context), timeout); } function invokeArrayArg(arg, fn, context) { if (Array.isArray(arg)) { each(arg, context[fn], context); return true; } return false; } function each(obj, iterator, context) { var i; if (!obj) { return; } if (obj.forEach) { obj.forEach(iterator, context); } else if (obj.length !== undefined) { i = 0; while (i < obj.length) { iterator.call(context, obj[i], i, obj); i++; } } else { for (i in obj) { obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj); } } } function deprecate(method, name, message) { var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n'; return function() { var e = new Error('get-stack-trace'); var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '') .replace(/^\s+at\s+/gm, '') .replace(/^Object.\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace'; var log = window.console && (window.console.warn || window.console.log); if (log) { log.call(window.console, deprecationMessage, stack); } return method.apply(this, arguments); }; } var assign; if (typeof Object.assign !== 'function') { assign = function assign(target) { if (target === undefined || target === null) { throw new TypeError('Cannot convert undefined or null to object'); } var output = Object(target); for (var index = 1; index < arguments.length; index++) { var source = arguments[index]; if (source !== undefined && source !== null) { for (var nextKey in source) { if (source.hasOwnProperty(nextKey)) { output[nextKey] = source[nextKey]; } } } } return output; }; } else { assign = Object.assign; } var extend = deprecate(function extend(dest, src, merge) { var keys = Object.keys(src); var i = 0; while (i < keys.length) { if (!merge || (merge && dest[keys[i]] === undefined)) { dest[keys[i]] = src[keys[i]]; } i++; } return dest; }, 'extend', 'Use `assign`.'); var merge = deprecate(function merge(dest, src) { return extend(dest, src, true); }, 'merge', 'Use `assign`.'); function inherit(child, base, properties) { var baseP = base.prototype, childP; childP = child.prototype = Object.create(baseP); childP.constructor = child; childP._super = baseP; if (properties) { assign(childP, properties); } } function bindFn(fn, context) { return function boundFn() { return fn.apply(context, arguments); }; } function boolOrFn(val, args) { if (typeof val == TYPE_FUNCTION) { return val.apply(args ? args[0] || undefined : undefined, args); } return val; } function ifUndefined(val1, val2) { return (val1 === undefined) ? val2 : val1; } function addEventListeners(target, types, handler) { each(splitStr(types), function(type) { target.addEventListener(type, handler, false); }); } function removeEventListeners(target, types, handler) { each(splitStr(types), function(type) { target.removeEventListener(type, handler, false); }); } function hasParent(node, parent) { while (node) { if (node == parent) { return true; } node = node.parentNode; } return false; } function inStr(str, find) { return str.indexOf(find) > -1; } function splitStr(str) { return str.trim().split(/\s+/g); } function inArray(src, find, findByKey) { if (src.indexOf && !findByKey) { return src.indexOf(find); } else { var i = 0; while (i < src.length) { if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) { return i; } i++; } return -1; } } function toArray(obj) { return Array.prototype.slice.call(obj, 0); } function uniqueArray(src, key, sort) { var results = []; var values = []; var i = 0; while (i < src.length) { var val = key ? src[i][key] : src[i]; if (inArray(values, val) < 0) { results.push(src[i]); } values[i] = val; i++; } if (sort) { if (!key) { results = results.sort(); } else { results = results.sort(function sortUniqueArray(a, b) { return a[key] > b[key]; }); } } return results; } function prefixed(obj, property) { var prefix, prop; var camelProp = property[0].toUpperCase() + property.slice(1); var i = 0; while (i < VENDOR_PREFIXES.length) { prefix = VENDOR_PREFIXES[i]; prop = (prefix) ? prefix + camelProp : property; if (prop in obj) { return prop; } i++; } return undefined; } var _uniqueId = 1; function uniqueId() { return _uniqueId++; } function getWindowForElement(element) { var doc = element.ownerDocument || element; return (doc.defaultView || doc.parentWindow || window); } var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i; var SUPPORT_TOUCH = ('ontouchstart' in window); var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined; var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent); var INPUT_TYPE_TOUCH = 'touch'; var INPUT_TYPE_PEN = 'pen'; var INPUT_TYPE_MOUSE = 'mouse'; var INPUT_TYPE_KINECT = 'kinect'; var COMPUTE_INTERVAL = 25; var INPUT_START = 1; var INPUT_MOVE = 2; var INPUT_END = 4; var INPUT_CANCEL = 8; var DIRECTION_NONE = 1; var DIRECTION_LEFT = 2; var DIRECTION_RIGHT = 4; var DIRECTION_UP = 8; var DIRECTION_DOWN = 16; var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT; var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN; var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL; var PROPS_XY = ['x', 'y']; var PROPS_CLIENT_XY = ['clientX', 'clientY']; function Input(manager, callback) { var self = this; this.manager = manager; this.callback = callback; this.element = manager.element; this.target = manager.options.inputTarget; this.domHandler = function(ev) { if (boolOrFn(manager.options.enable, [manager])) { self.handler(ev); } }; this.init(); } Input.prototype = { handler: function() { }, init: function() { this.evEl && addEventListeners(this.element, this.evEl, this.domHandler); this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler); this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler); }, destroy: function() { this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler); this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler); this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler); } }; function createInputInstance(manager) { var Type; var inputClass = manager.options.inputClass; if (inputClass) { Type = inputClass; } else if (SUPPORT_POINTER_EVENTS) { Type = PointerEventInput; } else if (SUPPORT_ONLY_TOUCH) { Type = TouchInput; } else if (!SUPPORT_TOUCH) { Type = MouseInput; } else { Type = TouchMouseInput; } return new (Type)(manager, inputHandler); } function inputHandler(manager, eventType, input) { var pointersLen = input.pointers.length; var changedPointersLen = input.changedPointers.length; var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0)); var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0)); input.isFirst = !!isFirst; input.isFinal = !!isFinal; if (isFirst) { manager.session = {}; } input.eventType = eventType; computeInputData(manager, input); manager.emit('hammer.input', input); manager.recognize(input); manager.session.prevInput = input; } function computeInputData(manager, input) { var session = manager.session; var pointers = input.pointers; var pointersLength = pointers.length; if (!session.firstInput) { session.firstInput = simpleCloneInputData(input); } if (pointersLength > 1 && !session.firstMultiple) { session.firstMultiple = simpleCloneInputData(input); } else if (pointersLength === 1) { session.firstMultiple = false; } var firstInput = session.firstInput; var firstMultiple = session.firstMultiple; var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center; var center = input.center = getCenter(pointers); input.timeStamp = now(); input.deltaTime = input.timeStamp - firstInput.timeStamp; input.angle = getAngle(offsetCenter, center); input.distance = getDistance(offsetCenter, center); computeDeltaXY(session, input); input.offsetDirection = getDirection(input.deltaX, input.deltaY); var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY); input.overallVelocityX = overallVelocity.x; input.overallVelocityY = overallVelocity.y; input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y; input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1; input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0; input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length > session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers); computeIntervalInputData(session, input); var target = manager.element; if (hasParent(input.srcEvent.target, target)) { target = input.srcEvent.target; } input.target = target; } function computeDeltaXY(session, input) { var center = input.center; var offset = session.offsetDelta || {}; var prevDelta = session.prevDelta || {}; var prevInput = session.prevInput || {}; if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) { prevDelta = session.prevDelta = { x: prevInput.deltaX || 0, y: prevInput.deltaY || 0 }; offset = session.offsetDelta = { x: center.x, y: center.y }; } input.deltaX = prevDelta.x + (center.x - offset.x); input.deltaY = prevDelta.y + (center.y - offset.y); } function computeIntervalInputData(session, input) { var last = session.lastInterval || input, deltaTime = input.timeStamp - last.timeStamp, velocity, velocityX, velocityY, direction; if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) { var deltaX = input.deltaX - last.deltaX; var deltaY = input.deltaY - last.deltaY; var v = getVelocity(deltaTime, deltaX, deltaY); velocityX = v.x; velocityY = v.y; velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y; direction = getDirection(deltaX, deltaY); session.lastInterval = input; } else { velocity = last.velocity; velocityX = last.velocityX; velocityY = last.velocityY; direction = last.direction; } input.velocity = velocity; input.velocityX = velocityX; input.velocityY = velocityY; input.direction = direction; } function simpleCloneInputData(input) { var pointers = []; var i = 0; while (i < input.pointers.length) { pointers[i] = { clientX: round(input.pointers[i].clientX), clientY: round(input.pointers[i].clientY) }; i++; } return { timeStamp: now(), pointers: pointers, center: getCenter(pointers), deltaX: input.deltaX, deltaY: input.deltaY }; } function getCenter(pointers) { var pointersLength = pointers.length; if (pointersLength === 1) { return { x: round(pointers[0].clientX), y: round(pointers[0].clientY) }; } var x = 0, y = 0, i = 0; while (i < pointersLength) { x += pointers[i].clientX; y += pointers[i].clientY; i++; } return { x: round(x / pointersLength), y: round(y / pointersLength) }; } function getVelocity(deltaTime, x, y) { return { x: x / deltaTime || 0, y: y / deltaTime || 0 }; } function getDirection(x, y) { if (x === y) { return DIRECTION_NONE; } if (abs(x) >= abs(y)) { return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT; } return y < 0 ? DIRECTION_UP : DIRECTION_DOWN; } function getDistance(p1, p2, props) { if (!props) { props = PROPS_XY; } var x = p2[props[0]] - p1[props[0]], y = p2[props[1]] - p1[props[1]]; return Math.sqrt((x * x) + (y * y)); } function getAngle(p1, p2, props) { if (!props) { props = PROPS_XY; } var x = p2[props[0]] - p1[props[0]], y = p2[props[1]] - p1[props[1]]; return Math.atan2(y, x) * 180 / Math.PI; } function getRotation(start, end) { return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY); } function getScale(start, end) { return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY); } var MOUSE_INPUT_MAP = { mousedown: INPUT_START, mousemove: INPUT_MOVE, mouseup: INPUT_END }; var MOUSE_ELEMENT_EVENTS = 'mousedown'; var MOUSE_WINDOW_EVENTS = 'mousemove mouseup'; function MouseInput() { this.evEl = MOUSE_ELEMENT_EVENTS; this.evWin = MOUSE_WINDOW_EVENTS; this.pressed = false; // mousedown state Input.apply(this, arguments); } inherit(MouseInput, Input, { handler: function MEhandler(ev) { var eventType = MOUSE_INPUT_MAP[ev.type]; if (eventType & INPUT_START && ev.button === 0) { this.pressed = true; } if (eventType & INPUT_MOVE && ev.which !== 1) { eventType = INPUT_END; } if (!this.pressed) { return; } if (eventType & INPUT_END) { this.pressed = false; } this.callback(this.manager, eventType, { pointers: [ev], changedPointers: [ev], pointerType: INPUT_TYPE_MOUSE, srcEvent: ev }); } }); var POINTER_INPUT_MAP = { pointerdown: INPUT_START, pointermove: INPUT_MOVE, pointerup: INPUT_END, pointercancel: INPUT_CANCEL, pointerout: INPUT_CANCEL }; var IE10_POINTER_TYPE_ENUM = { 2: INPUT_TYPE_TOUCH, 3: INPUT_TYPE_PEN, 4: INPUT_TYPE_MOUSE, 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816 }; var POINTER_ELEMENT_EVENTS = 'pointerdown'; var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel'; if (window.MSPointerEvent && !window.PointerEvent) { POINTER_ELEMENT_EVENTS = 'MSPointerDown'; POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel'; } function PointerEventInput() { this.evEl = POINTER_ELEMENT_EVENTS; this.evWin = POINTER_WINDOW_EVENTS; Input.apply(this, arguments); this.store = (this.manager.session.pointerEvents = []); } inherit(PointerEventInput, Input, { handler: function PEhandler(ev) { var store = this.store; var removePointer = false; var eventTypeNormalized = ev.type.toLowerCase().replace('ms', ''); var eventType = POINTER_INPUT_MAP[eventTypeNormalized]; var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType; var isTouch = (pointerType == INPUT_TYPE_TOUCH); var storeIndex = inArray(store, ev.pointerId, 'pointerId'); if (eventType & INPUT_START && (ev.button === 0 || isTouch)) { if (storeIndex < 0) { store.push(ev); storeIndex = store.length - 1; } } else if (eventType & (INPUT_END | INPUT_CANCEL)) { removePointer = true; } if (storeIndex < 0) { return; } store[storeIndex] = ev; this.callback(this.manager, eventType, { pointers: store, changedPointers: [ev], pointerType: pointerType, srcEvent: ev }); if (removePointer) { store.splice(storeIndex, 1); } } }); var SINGLE_TOUCH_INPUT_MAP = { touchstart: INPUT_START, touchmove: INPUT_MOVE, touchend: INPUT_END, touchcancel: INPUT_CANCEL }; var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart'; var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel'; function SingleTouchInput() { this.evTarget = SINGLE_TOUCH_TARGET_EVENTS; this.evWin = SINGLE_TOUCH_WINDOW_EVENTS; this.started = false; Input.apply(this, arguments); } inherit(SingleTouchInput, Input, { handler: function TEhandler(ev) { var type = SINGLE_TOUCH_INPUT_MAP[ev.type]; if (type === INPUT_START) { this.started = true; } if (!this.started) { return; } var touches = normalizeSingleTouches.call(this, ev, type); if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) { this.started = false; } this.callback(this.manager, type, { pointers: touches[0], changedPointers: touches[1], pointerType: INPUT_TYPE_TOUCH, srcEvent: ev }); } }); function normalizeSingleTouches(ev, type) { var all = toArray(ev.touches); var changed = toArray(ev.changedTouches); if (type & (INPUT_END | INPUT_CANCEL)) { all = uniqueArray(all.concat(changed), 'identifier', true); } return [all, changed]; } var TOUCH_INPUT_MAP = { touchstart: INPUT_START, touchmove: INPUT_MOVE, touchend: INPUT_END, touchcancel: INPUT_CANCEL }; var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel'; function TouchInput() { this.evTarget = TOUCH_TARGET_EVENTS; this.targetIds = {}; Input.apply(this, arguments); } inherit(TouchInput, Input, { handler: function MTEhandler(ev) { var type = TOUCH_INPUT_MAP[ev.type]; var touches = getTouches.call(this, ev, type); if (!touches) { return; } this.callback(this.manager, type, { pointers: touches[0], changedPointers: touches[1], pointerType: INPUT_TYPE_TOUCH, srcEvent: ev }); } }); function getTouches(ev, type) { var allTouches = toArray(ev.touches); var targetIds = this.targetIds; if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) { targetIds[allTouches[0].identifier] = true; return [allTouches, allTouches]; } var i, targetTouches, changedTouches = toArray(ev.changedTouches), changedTargetTouches = [], target = this.target; targetTouches = allTouches.filter(function(touch) { return hasParent(touch.target, target); }); if (type === INPUT_START) { i = 0; while (i < targetTouches.length) { targetIds[targetTouches[i].identifier] = true; i++; } } i = 0; while (i < changedTouches.length) { if (targetIds[changedTouches[i].identifier]) { changedTargetTouches.push(changedTouches[i]); } if (type & (INPUT_END | INPUT_CANCEL)) { delete targetIds[changedTouches[i].identifier]; } i++; } if (!changedTargetTouches.length) { return; } return [ uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true), changedTargetTouches ]; } var DEDUP_TIMEOUT = 2500; var DEDUP_DISTANCE = 25; function TouchMouseInput() { Input.apply(this, arguments); var handler = bindFn(this.handler, this); this.touch = new TouchInput(this.manager, handler); this.mouse = new MouseInput(this.manager, handler); this.primaryTouch = null; this.lastTouches = []; } inherit(TouchMouseInput, Input, { handler: function TMEhandler(manager, inputEvent, inputData) { var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH), isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE); if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) { return; } if (isTouch) { recordTouches.call(this, inputEvent, inputData); } else if (isMouse && isSyntheticEvent.call(this, inputData)) { return; } this.callback(manager, inputEvent, inputData); }, destroy: function destroy() { this.touch.destroy(); this.mouse.destroy(); } }); function recordTouches(eventType, eventData) { if (eventType & INPUT_START) { this.primaryTouch = eventData.changedPointers[0].identifier; setLastTouch.call(this, eventData); } else if (eventType & (INPUT_END | INPUT_CANCEL)) { setLastTouch.call(this, eventData); } } function setLastTouch(eventData) { var touch = eventData.changedPointers[0]; if (touch.identifier === this.primaryTouch) { var lastTouch = {x: touch.clientX, y: touch.clientY}; this.lastTouches.push(lastTouch); var lts = this.lastTouches; var removeLastTouch = function() { var i = lts.indexOf(lastTouch); if (i > -1) { lts.splice(i, 1); } }; setTimeout(removeLastTouch, DEDUP_TIMEOUT); } } function isSyntheticEvent(eventData) { var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY; for (var i = 0; i < this.lastTouches.length; i++) { var t = this.lastTouches[i]; var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y); if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) { return true; } } return false; } var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction'); var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined; var TOUCH_ACTION_COMPUTE = 'compute'; var TOUCH_ACTION_AUTO = 'auto'; var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented var TOUCH_ACTION_NONE = 'none'; var TOUCH_ACTION_PAN_X = 'pan-x'; var TOUCH_ACTION_PAN_Y = 'pan-y'; var TOUCH_ACTION_MAP = getTouchActionProps(); function TouchAction(manager, value) { this.manager = manager; this.set(value); } TouchAction.prototype = { set: function(value) { if (value == TOUCH_ACTION_COMPUTE) { value = this.compute(); } if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) { this.manager.element.style[PREFIXED_TOUCH_ACTION] = value; } this.actions = value.toLowerCase().trim(); }, update: function() { this.set(this.manager.options.touchAction); }, compute: function() { var actions = []; each(this.manager.recognizers, function(recognizer) { if (boolOrFn(recognizer.options.enable, [recognizer])) { actions = actions.concat(recognizer.getTouchAction()); } }); return cleanTouchActions(actions.join(' ')); }, preventDefaults: function(input) { var srcEvent = input.srcEvent; var direction = input.offsetDirection; if (this.manager.session.prevented) { srcEvent.preventDefault(); return; } var actions = this.actions; var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE]; var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y]; var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X]; if (hasNone) { var isTapPointer = input.pointers.length === 1; var isTapMovement = input.distance < 2; var isTapTouchTime = input.deltaTime < 250; if (isTapPointer && isTapMovement && isTapTouchTime) { return; } } if (hasPanX && hasPanY) { return; } if (hasNone || (hasPanY && direction & DIRECTION_HORIZONTAL) || (hasPanX && direction & DIRECTION_VERTICAL)) { return this.preventSrc(srcEvent); } }, preventSrc: function(srcEvent) { this.manager.session.prevented = true; srcEvent.preventDefault(); } }; function cleanTouchActions(actions) { if (inStr(actions, TOUCH_ACTION_NONE)) { return TOUCH_ACTION_NONE; } var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X); var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); if (hasPanX && hasPanY) { return TOUCH_ACTION_NONE; } if (hasPanX || hasPanY) { return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y; } if (inStr(actions, TOUCH_ACTION_MANIPULATION)) { return TOUCH_ACTION_MANIPULATION; } return TOUCH_ACTION_AUTO; } function getTouchActionProps() { if (!NATIVE_TOUCH_ACTION) { return false; } var touchMap = {}; var cssSupports = window.CSS && window.CSS.supports; ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) { touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true; }); return touchMap; } var STATE_POSSIBLE = 1; var STATE_BEGAN = 2; var STATE_CHANGED = 4; var STATE_ENDED = 8; var STATE_RECOGNIZED = STATE_ENDED; var STATE_CANCELLED = 16; var STATE_FAILED = 32; function Recognizer(options) { this.options = assign({}, this.defaults, options || {}); this.id = uniqueId(); this.manager = null; this.options.enable = ifUndefined(this.options.enable, true); this.state = STATE_POSSIBLE; this.simultaneous = {}; this.requireFail = []; } Recognizer.prototype = { defaults: {}, set: function(options) { assign(this.options, options); this.manager && this.manager.touchAction.update(); return this; }, recognizeWith: function(otherRecognizer) { if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) { return this; } var simultaneous = this.simultaneous; otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); if (!simultaneous[otherRecognizer.id]) { simultaneous[otherRecognizer.id] = otherRecognizer; otherRecognizer.recognizeWith(this); } return this; }, dropRecognizeWith: function(otherRecognizer) { if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) { return this; } otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); delete this.simultaneous[otherRecognizer.id]; return this; }, requireFailure: function(otherRecognizer) { if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) { return this; } var requireFail = this.requireFail; otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); if (inArray(requireFail, otherRecognizer) === -1) { requireFail.push(otherRecognizer); otherRecognizer.requireFailure(this); } return this; }, dropRequireFailure: function(otherRecognizer) { if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) { return this; } otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); var index = inArray(this.requireFail, otherRecognizer); if (index > -1) { this.requireFail.splice(index, 1); } return this; }, hasRequireFailures: function() { return this.requireFail.length > 0; }, canRecognizeWith: function(otherRecognizer) { return !!this.simultaneous[otherRecognizer.id]; }, emit: function(input) { var self = this; var state = this.state; function emit(event) { self.manager.emit(event, input); } if (state < STATE_ENDED) { emit(self.options.event + stateStr(state)); } emit(self.options.event); // simple 'eventName' events if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...) emit(input.additionalEvent); } if (state >= STATE_ENDED) { emit(self.options.event + stateStr(state)); } }, tryEmit: function(input) { if (this.canEmit()) { return this.emit(input); } this.state = STATE_FAILED; }, canEmit: function() { var i = 0; while (i < this.requireFail.length) { if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) { return false; } i++; } return true; }, recognize: function(inputData) { var inputDataClone = assign({}, inputData); if (!boolOrFn(this.options.enable, [this, inputDataClone])) { this.reset(); this.state = STATE_FAILED; return; } if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) { this.state = STATE_POSSIBLE; } this.state = this.process(inputDataClone); if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) { this.tryEmit(inputDataClone); } }, process: function(inputData) { }, // jshint ignore:line getTouchAction: function() { }, reset: function() { } }; function stateStr(state) { if (state & STATE_CANCELLED) { return 'cancel'; } else if (state & STATE_ENDED) { return 'end'; } else if (state & STATE_CHANGED) { return 'move'; } else if (state & STATE_BEGAN) { return 'start'; } return ''; } function directionStr(direction) { if (direction == DIRECTION_DOWN) { return 'down'; } else if (direction == DIRECTION_UP) { return 'up'; } else if (direction == DIRECTION_LEFT) { return 'left'; } else if (direction == DIRECTION_RIGHT) { return 'right'; } return ''; } function getRecognizerByNameIfManager(otherRecognizer, recognizer) { var manager = recognizer.manager; if (manager) { return manager.get(otherRecognizer); } return otherRecognizer; } function AttrRecognizer() { Recognizer.apply(this, arguments); } inherit(AttrRecognizer, Recognizer, { defaults: { pointers: 1 }, attrTest: function(input) { var optionPointers = this.options.pointers; return optionPointers === 0 || input.pointers.length === optionPointers; }, process: function(input) { var state = this.state; var eventType = input.eventType; var isRecognized = state & (STATE_BEGAN | STATE_CHANGED); var isValid = this.attrTest(input); if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) { return state | STATE_CANCELLED; } else if (isRecognized || isValid) { if (eventType & INPUT_END) { return state | STATE_ENDED; } else if (!(state & STATE_BEGAN)) { return STATE_BEGAN; } return state | STATE_CHANGED; } return STATE_FAILED; } }); function PanRecognizer() { AttrRecognizer.apply(this, arguments); this.pX = null; this.pY = null; } inherit(PanRecognizer, AttrRecognizer, { defaults: { event: 'pan', threshold: 10, pointers: 1, direction: DIRECTION_ALL }, getTouchAction: function() { var direction = this.options.direction; var actions = []; if (direction & DIRECTION_HORIZONTAL) { actions.push(TOUCH_ACTION_PAN_Y); } if (direction & DIRECTION_VERTICAL) { actions.push(TOUCH_ACTION_PAN_X); } return actions; }, directionTest: function(input) { var options = this.options; var hasMoved = true; var distance = input.distance; var direction = input.direction; var x = input.deltaX; var y = input.deltaY; if (!(direction & options.direction)) { if (options.direction & DIRECTION_HORIZONTAL) { direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT; hasMoved = x != this.pX; distance = Math.abs(input.deltaX); } else { direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN; hasMoved = y != this.pY; distance = Math.abs(input.deltaY); } } input.direction = direction; return hasMoved && distance > options.threshold && direction & options.direction; }, attrTest: function(input) { return AttrRecognizer.prototype.attrTest.call(this, input) && (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input))); }, emit: function(input) { this.pX = input.deltaX; this.pY = input.deltaY; var direction = directionStr(input.direction); if (direction) { input.additionalEvent = this.options.event + direction; } this._super.emit.call(this, input); } }); function PinchRecognizer() { AttrRecognizer.apply(this, arguments); } inherit(PinchRecognizer, AttrRecognizer, { defaults: { event: 'pinch', threshold: 0, pointers: 2 }, getTouchAction: function() { return [TOUCH_ACTION_NONE]; }, attrTest: function(input) { return this._super.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN); }, emit: function(input) { if (input.scale !== 1) { var inOut = input.scale < 1 ? 'in' : 'out'; input.additionalEvent = this.options.event + inOut; } this._super.emit.call(this, input); } }); function PressRecognizer() { Recognizer.apply(this, arguments); this._timer = null; this._input = null; } inherit(PressRecognizer, Recognizer, { defaults: { event: 'press', pointers: 1, time: 251, // minimal time of the pointer to be pressed threshold: 9 // a minimal movement is ok, but keep it low }, getTouchAction: function() { return [TOUCH_ACTION_AUTO]; }, process: function(input) { var options = this.options; var validPointers = input.pointers.length === options.pointers; var validMovement = input.distance < options.threshold; var validTime = input.deltaTime > options.time; this._input = input; if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) { this.reset(); } else if (input.eventType & INPUT_START) { this.reset(); this._timer = setTimeoutContext(function() { this.state = STATE_RECOGNIZED; this.tryEmit(); }, options.time, this); } else if (input.eventType & INPUT_END) { return STATE_RECOGNIZED; } return STATE_FAILED; }, reset: function() { clearTimeout(this._timer); }, emit: function(input) { if (this.state !== STATE_RECOGNIZED) { return; } if (input && (input.eventType & INPUT_END)) { this.manager.emit(this.options.event + 'up', input); } else { this._input.timeStamp = now(); this.manager.emit(this.options.event, this._input); } } }); function RotateRecognizer() { AttrRecognizer.apply(this, arguments); } inherit(RotateRecognizer, AttrRecognizer, { defaults: { event: 'rotate', threshold: 0, pointers: 2 }, getTouchAction: function() { return [TOUCH_ACTION_NONE]; }, attrTest: function(input) { return this._super.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN); } }); function SwipeRecognizer() { AttrRecognizer.apply(this, arguments); } inherit(SwipeRecognizer, AttrRecognizer, { defaults: { event: 'swipe', threshold: 10, velocity: 0.3, direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL, pointers: 1 }, getTouchAction: function() { return PanRecognizer.prototype.getTouchAction.call(this); }, attrTest: function(input) { var direction = this.options.direction; var velocity; if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) { velocity = input.overallVelocity; } else if (direction & DIRECTION_HORIZONTAL) { velocity = input.overallVelocityX; } else if (direction & DIRECTION_VERTICAL) { velocity = input.overallVelocityY; } return this._super.attrTest.call(this, input) && direction & input.offsetDirection && input.distance > this.options.threshold && input.maxPointers == this.options.pointers && abs(velocity) > this.options.velocity && input.eventType & INPUT_END; }, emit: function(input) { var direction = directionStr(input.offsetDirection); if (direction) { this.manager.emit(this.options.event + direction, input); } this.manager.emit(this.options.event, input); } }); function TapRecognizer() { Recognizer.apply(this, arguments); this.pTime = false; this.pCenter = false; this._timer = null; this._input = null; this.count = 0; } inherit(TapRecognizer, Recognizer, { defaults: { event: 'tap', pointers: 1, taps: 1, interval: 300, // max time between the multi-tap taps time: 250, // max time of the pointer to be down (like finger on the screen) threshold: 9, // a minimal movement is ok, but keep it low posThreshold: 10 // a multi-tap can be a bit off the initial position }, getTouchAction: function() { return [TOUCH_ACTION_MANIPULATION]; }, process: function(input) { var options = this.options; var validPointers = input.pointers.length === options.pointers; var validMovement = input.distance < options.threshold; var validTouchTime = input.deltaTime < options.time; this.reset(); if ((input.eventType & INPUT_START) && (this.count === 0)) { return this.failTimeout(); } if (validMovement && validTouchTime && validPointers) { if (input.eventType != INPUT_END) { return this.failTimeout(); } var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true; var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold; this.pTime = input.timeStamp; this.pCenter = input.center; if (!validMultiTap || !validInterval) { this.count = 1; } else { this.count += 1; } this._input = input; var tapCount = this.count % options.taps; if (tapCount === 0) { if (!this.hasRequireFailures()) { return STATE_RECOGNIZED; } else { this._timer = setTimeoutContext(function() { this.state = STATE_RECOGNIZED; this.tryEmit(); }, options.interval, this); return STATE_BEGAN; } } } return STATE_FAILED; }, failTimeout: function() { this._timer = setTimeoutContext(function() { this.state = STATE_FAILED; }, this.options.interval, this); return STATE_FAILED; }, reset: function() { clearTimeout(this._timer); }, emit: function() { if (this.state == STATE_RECOGNIZED) { this._input.tapCount = this.count; this.manager.emit(this.options.event, this._input); } } }); function Hammer(element, options) { options = options || {}; options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset); return new Manager(element, options); } Hammer.VERSION = '2.0.8'; Hammer.defaults = { domEvents: false, touchAction: TOUCH_ACTION_COMPUTE, enable: true, inputTarget: null, inputClass: null, preset: [ [RotateRecognizer, {enable: false}], [PinchRecognizer, {enable: false}, ['rotate']], [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}], [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']], [TapRecognizer], [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']], [PressRecognizer] ], cssProps: { userSelect: 'none', touchSelect: 'none', touchCallout: 'none', contentZooming: 'none', userDrag: 'none', tapHighlightColor: 'rgba(0,0,0,0)' } }; var STOP = 1; var FORCED_STOP = 2; function Manager(element, options) { this.options = assign({}, Hammer.defaults, options || {}); this.options.inputTarget = this.options.inputTarget || element; this.handlers = {}; this.session = {}; this.recognizers = []; this.oldCssProps = {}; this.element = element; this.input = createInputInstance(this); this.touchAction = new TouchAction(this, this.options.touchAction); toggleCssProps(this, true); each(this.options.recognizers, function(item) { var recognizer = this.add(new (item[0])(item[1])); item[2] && recognizer.recognizeWith(item[2]); item[3] && recognizer.requireFailure(item[3]); }, this); } Manager.prototype = { set: function(options) { assign(this.options, options); if (options.touchAction) { this.touchAction.update(); } if (options.inputTarget) { this.input.destroy(); this.input.target = options.inputTarget; this.input.init(); } return this; }, stop: function(force) { this.session.stopped = force ? FORCED_STOP : STOP; }, recognize: function(inputData) { var session = this.session; if (session.stopped) { return; } this.touchAction.preventDefaults(inputData); var recognizer; var recognizers = this.recognizers; var curRecognizer = session.curRecognizer; if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) { curRecognizer = session.curRecognizer = null; } var i = 0; while (i < recognizers.length) { recognizer = recognizers[i]; if (session.stopped !== FORCED_STOP && ( // 1 !curRecognizer || recognizer == curRecognizer || // 2 recognizer.canRecognizeWith(curRecognizer))) { // 3 recognizer.recognize(inputData); } else { recognizer.reset(); } if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) { curRecognizer = session.curRecognizer = recognizer; } i++; } }, get: function(recognizer) { if (recognizer instanceof Recognizer) { return recognizer; } var recognizers = this.recognizers; for (var i = 0; i < recognizers.length; i++) { if (recognizers[i].options.event == recognizer) { return recognizers[i]; } } return null; }, add: function(recognizer) { if (invokeArrayArg(recognizer, 'add', this)) { return this; } var existing = this.get(recognizer.options.event); if (existing) { this.remove(existing); } this.recognizers.push(recognizer); recognizer.manager = this; this.touchAction.update(); return recognizer; }, remove: function(recognizer) { if (invokeArrayArg(recognizer, 'remove', this)) { return this; } recognizer = this.get(recognizer); if (recognizer) { var recognizers = this.recognizers; var index = inArray(recognizers, recognizer); if (index !== -1) { recognizers.splice(index, 1); this.touchAction.update(); } } return this; }, on: function(events, handler) { if (events === undefined) { return; } if (handler === undefined) { return; } var handlers = this.handlers; each(splitStr(events), function(event) { handlers[event] = handlers[event] || []; handlers[event].push(handler); }); return this; }, off: function(events, handler) { if (events === undefined) { return; } var handlers = this.handlers; each(splitStr(events), function(event) { if (!handler) { delete handlers[event]; } else { handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1); } }); return this; }, emit: function(event, data) { if (this.options.domEvents) { triggerDomEvent(event, data); } var handlers = this.handlers[event] && this.handlers[event].slice(); if (!handlers || !handlers.length) { return; } data.type = event; data.preventDefault = function() { data.srcEvent.preventDefault(); }; var i = 0; while (i < handlers.length) { handlers[i](data); i++; } }, destroy: function() { this.element && toggleCssProps(this, false); this.handlers = {}; this.session = {}; this.input.destroy(); this.element = null; } }; function toggleCssProps(manager, add) { var element = manager.element; if (!element.style) { return; } var prop; each(manager.options.cssProps, function(value, name) { prop = prefixed(element.style, name); if (add) { manager.oldCssProps[prop] = element.style[prop]; element.style[prop] = value; } else { element.style[prop] = manager.oldCssProps[prop] || ''; } }); if (!add) { manager.oldCssProps = {}; } } function triggerDomEvent(event, data) { var gestureEvent = document.createEvent('Event'); gestureEvent.initEvent(event, true, true); gestureEvent.gesture = data; data.target.dispatchEvent(gestureEvent); } assign(Hammer, { INPUT_START: INPUT_START, INPUT_MOVE: INPUT_MOVE, INPUT_END: INPUT_END, INPUT_CANCEL: INPUT_CANCEL, STATE_POSSIBLE: STATE_POSSIBLE, STATE_BEGAN: STATE_BEGAN, STATE_CHANGED: STATE_CHANGED, STATE_ENDED: STATE_ENDED, STATE_RECOGNIZED: STATE_RECOGNIZED, STATE_CANCELLED: STATE_CANCELLED, STATE_FAILED: STATE_FAILED, DIRECTION_NONE: DIRECTION_NONE, DIRECTION_LEFT: DIRECTION_LEFT, DIRECTION_RIGHT: DIRECTION_RIGHT, DIRECTION_UP: DIRECTION_UP, DIRECTION_DOWN: DIRECTION_DOWN, DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL, DIRECTION_VERTICAL: DIRECTION_VERTICAL, DIRECTION_ALL: DIRECTION_ALL, Manager: Manager, Input: Input, TouchAction: TouchAction, TouchInput: TouchInput, MouseInput: MouseInput, PointerEventInput: PointerEventInput, TouchMouseInput: TouchMouseInput, SingleTouchInput: SingleTouchInput, Recognizer: Recognizer, AttrRecognizer: AttrRecognizer, Tap: TapRecognizer, Pan: PanRecognizer, Swipe: SwipeRecognizer, Pinch: PinchRecognizer, Rotate: RotateRecognizer, Press: PressRecognizer, on: addEventListeners, off: removeEventListeners, each: each, merge: merge, extend: extend, assign: assign, inherit: inherit, bindFn: bindFn, prefixed: prefixed }); var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line freeGlobal.Hammer = Hammer; if (typeof define === 'function' && define.amd) { define(function() { return Hammer; }); } else if (typeof module != 'undefined' && module.exports) { module.exports = Hammer; } else { window[exportName] = Hammer; } })(window, document, 'Hammer'); (function(factory) { if (typeof define === 'function' && define.amd) { define(['jquery', 'hammerjs'], factory); } else if (typeof exports === 'object') { factory(require('jquery'), require('hammerjs')); } else { factory(jQuery, Hammer); } }(function($, Hammer) { function hammerify(el, options) { var $el = $(el); if(!$el.data("hammer")) { $el.data("hammer", new Hammer($el[0], options)); } } $.fn.hammer = function(options) { return this.each(function() { hammerify(this, options); }); }; Hammer.Manager.prototype.emit = (function(originalEmit) { return function(type, data) { originalEmit.call(this, type, data); $(this.element).trigger({ type: type, gesture: data }); }; })(Hammer.Manager.prototype.emit); })); $.fn.angularTemplate = function(execute) { var callback = this.attr('data-callback'); var id = $(this).attr('id'); execute = execute || false; if (execute === true) { var template = new Template({ id: id, source: '#' + id, destination: '#' + id, assign: {}, callback: callback }).display(); return false; } var url = this.attr('data-url'); if (typeof url === 'undefined') { return false; } var linkParam = window.location.href.replace(location.origin + '/', '').replace('?', '&'); if (typeof id === 'undefined') { console.log("id is not defined for .angularTemplate element"); return true; } $.ajax({ url: url + '?link=' + linkParam, dataType: 'json', success: function(data) { for (var key in data) { if (key.length > 2) { window[key.toUpperCase()] = data[key]; } } var template = new Template({ id: id, source: '#' + id, destination: '#' + id, assign: data, callback: callback }).display(); } }); }; $.fn.urlFinder = function(attr, fn) { var myUrl = window.location.href.replace(/^.*?[^:\/]\//ig, ''); this.each(function() { var v = $(this).attr(attr) || ''; v = v.replace(/^\//g, ''); if (v === myUrl) { fn($(this)); } }); }; $.fn.slide = function(options) { return this.each(function() { var defaults = $.extend({ slideType: 'fade', slideMove: { /* sadece dikey kullanım için */ slideDirection: 'horizontal', visibleItem: 5 }, isFullWidth: { status: false, picRatio: 20 / 5 }, isAuto: true, stopOnMouse: true, changeOnMouse: false, slideCtrl: { showCtrl: false, wrapCtrl: '', nextBtn: '', prevBtn: '' }, slidePaging: { showPaging: false, wrapPaging: '' }, sliderWidth: 0, sliderHeight: 0, currentIndex: 0, totalSlide: 0, slideSpeed: 5000, isMobile: false, touchEnabled: true, changeFn: null }, options); var o = defaults; var slideParent; var slideWrapper = $(this); var slideItems = $('li', slideWrapper); var itemWidth = 0; var slidesWidth = 0; var slideWidth = 0; var slideLeft = 0; var parentWidth = 0; var slidesHeight = 0; var slideHeight = 0; var slideTop = 0; var parentHeight = 0; var findCurrent = true; var moveSize = 1; var pagingResult = false; var winWidth = $(window).width(); slideParent = slideWrapper.parent().parent(); slideParent.addClass('slide-wrapper'); if (o.isFullWidth.status) { slideWrapper.parent().addClass('responsive'); if (o.slideType === 'fade') { slideItems.each(function() { $(this).attr('style', 'background:url("' + $(this).find('img').attr('src') + '") no-repeat'); $(this).find('img').remove(); }); } } if ($('body').find(slideWrapper)) { slideWrapper.addClass(o.slideType); o.totalSlide = $('li', slideWrapper).length; $('li:eq(' + o.currentIndex + ')', slideWrapper).addClass('current'); $('.current', slideWrapper).fadeIn(); if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) { o.isMobile = true; } if (o.isFullWidth.status || o.slideType === 'carousel') { slideResizerCaller(); } if (o.slideType === 'carousel') { $('li', slideWrapper).each(function() { itemWidth += $(this).width(); }); if (itemWidth <= slideParent.width()) { $(o.slideCtrl.wrapCtrl).remove(); return false; } slideWrapper.parent().addClass('carousel-wrapper'); if (o.slideMove.slideDirection === 'vertical') { if (o.slideMove.visibleItem > o.totalSlide) { o.totalSlide = 1; $(o.slideCtrl.wrapCtrl).remove(); } else { $(o.slideCtrl.wrapCtrl).addClass('vertical'); } } } if (o.totalSlide > 1) { if (o.isAuto) { var interval = setInterval(nextSlide, o.slideSpeed); slideParent.hover(function() { clearInterval(interval); }, function() { interval = setInterval(nextSlide, o.slideSpeed); }); document.addEventListener('visibilitychange', function() { if (document.hidden) { clearInterval(interval); } else { interval = setInterval(nextSlide, o.slideSpeed); } }, false); } if (o.slideCtrl.showCtrl) { slideParent.find(o.slideCtrl.nextBtn).click(function() { nextSlide(); }); slideParent.find(o.slideCtrl.prevBtn).click(function() { prevSlide(); }); } else { $(o.slideCtrl.wrapCtrl).remove(); } if (o.isMobile && o.touchEnabled) { var myOptions = { velocity: 0.1 } slideWrapper.hammer(myOptions).on("swipeleft", function(ev) { clearInterval(interval); nextSlide(); interval = setInterval(nextSlide, o.slideSpeed); }); slideWrapper.hammer(myOptions).on("swiperight", function(ev) { clearInterval(interval); prevSlide(); interval = setInterval(nextSlide, o.slideSpeed); }); } if (pagingDetector()) { if ($('li', $(o.slidePaging.wrapPaging)).length === 0) { $('li', slideWrapper).each(function() { $(o.slidePaging.wrapPaging).append('
  • ' + ($(this).index() + 1) + '
  • '); }); } $('li:eq(0)', $(o.slidePaging.wrapPaging)).addClass('active'); if (o.isAuto) { $('li', $(o.slidePaging.wrapPaging)).hover(function() { if (o.changeOnMouse) { if (o.currentIndex !== $(this).index()) { o.currentIndex = $(this).index(); changeSlide(o.currentIndex); } } }, function() { }); } else { $('li', $(o.slidePaging.wrapPaging)).mouseenter(function() { if (o.changeOnMouse) { if (o.currentIndex !== $(this).index()) { o.currentIndex = $(this).index(); changeSlide(o.currentIndex); } } }); } $('li', $(o.slidePaging.wrapPaging)).click(function() { if (o.slideType === 'carousel') { if ($(this).index() !== o.currentIndex) { if ($(this).index() < o.currentIndex) { moveSize = o.currentIndex - $(this).index(); o.currentIndex = $(this).index(); if ($(this).index() === 0) { firstSlide(); } else { carouselSlide('back'); } } else { moveSize = $(this).index() - o.currentIndex; o.currentIndex = $(this).index(); if ($(this).index() === $('li', $(o.slidePaging.wrapPaging)).length - 1) { lastSlide(); } else { carouselSlide('forward'); } } slideWrapper.css({ 'left': slideWidth }); $('.active', $(o.slidePaging.wrapPaging)).removeClass('active'); $('li:eq(' + o.currentIndex + ')', $(o.slidePaging.wrapPaging)).addClass('active'); } } else { if (o.currentIndex !== $(this).index()) { o.currentIndex = $(this).index(); changeSlide(o.currentIndex); } } }); } else { $(o.slidePaging.wrapPaging).remove(); } } else if (o.totalSlide === 1) { $(o.slideCtrl.wrapCtrl).remove(); $(o.slidePaging.wrapPaging).remove(); } else { slideWrapper.closest('.slide-wrapper').remove(); } } function nextSlide() { if (o.slideCtrl.showCtrl) { slideParent.find(o.slideCtrl.nextBtn).unbind('click'); setTimeout(function() { slideParent.find(o.slideCtrl.nextBtn).bind('click', function() { nextSlide(); }); }, 500); } if ($('li:last-child', slideWrapper).hasClass('current')) { o.currentIndex = 0; } else { o.currentIndex++; } if (o.slideType === 'carousel') { if (o.slideMove.slideDirection === 'horizontal') { carouselSlide('forward'); } else { carouselSlide('down'); } } else { changeSlide(o.currentIndex); } } function prevSlide() { if (o.slideCtrl.showCtrl) { slideParent.find(o.slideCtrl.prevBtn).unbind('click'); setTimeout(function() { slideParent.find(o.slideCtrl.prevBtn).bind('click', function() { prevSlide(); }); }, 500); } if ($('li:first-child', slideWrapper).hasClass('current')) { o.currentIndex = o.totalSlide - 1; } else { o.currentIndex--; } if (o.slideType === 'carousel') { if (o.slideMove.slideDirection === 'horizontal') { carouselSlide('back'); } else { carouselSlide('up'); } } else { changeSlide(o.currentIndex); } } function pagingDetector() { if (o.slidePaging.showPaging) { if (o.slideType === 'fade') { pagingResult = true; } else { if (o.isFullWidth.status) { pagingResult = true; } } } return pagingResult; } function changeSlide(slideIndex) { $('.current', slideWrapper).removeClass('current').fadeOut(); slideWrapper.children('li:eq(' + slideIndex + ')').addClass('current').fadeIn(); $('.active', $(o.slidePaging.wrapPaging)).removeClass('active'); $('li:eq(' + slideIndex + ')', $(o.slidePaging.wrapPaging)).addClass('active'); if (o.changeFn !== null && typeof o.changeFn === 'function') { o.changeFn.call(this, slideIndex); } } function carouselSlide(direction) { if (o.slideMove.slideDirection === 'horizontal') { if (direction === 'forward') { if (Math.floor(slideLeft + $('.current', slideWrapper).width()) > Math.floor(slideWrapper.width() - parentWidth)) { firstSlide(); } else { $('.current', slideWrapper).removeClass('current').next().addClass('current'); slideWidth = '-=' + $('.current', slideWrapper).width(); slideLeft += $('.current', slideWrapper).width(); } } else { if (slideLeft - $('.current', slideWrapper).width() < 0) { lastSlide(); } else { $('.current', slideWrapper).removeClass('current').prev().addClass('current'); slideWidth = '+=' + $('.current', slideWrapper).width(); slideLeft -= $('.current', slideWrapper).width(); } } slideWrapper.css({ 'left': slideWidth }); } else { if (direction === 'up') { if ($('.current', slideWrapper).index() > 0) { slideHeight += Math.ceil($('.current', slideWrapper).prev()[0].getBoundingClientRect().height); $('.current', slideWrapper).removeClass('current').prev().addClass('current'); slidesHeight = 0; for (var i = $('.current', slideWrapper).index(); i < ($('.current', slideWrapper).index() + o.slideMove.visibleItem); i++) { slidesHeight += Math.ceil($('li:eq(' + i + ')', slideWrapper)[0].getBoundingClientRect().height); } } else { $('.current', slideWrapper).removeClass('current'); $('li:eq(' + (o.totalSlide - o.slideMove.visibleItem) + ')', slideWrapper).addClass('current'); slideHeight = 0; slidesHeight = 0; for (var i = $('.current', slideWrapper).index(); i <= (o.totalSlide - 1); i++) { slidesHeight += Math.ceil($('li:eq(' + i + ')', slideWrapper)[0].getBoundingClientRect().height); } for (var i = 0; i < $('.current', slideWrapper).index(); i++) { slideHeight -= Math.ceil($('li:eq(' + i + ')', slideWrapper)[0].getBoundingClientRect().height); } } } else { if (($('.current', slideWrapper).index() + o.slideMove.visibleItem) <= (o.totalSlide - 1)) { slideHeight -= Math.ceil($('.current', slideWrapper)[0].getBoundingClientRect().height); $('.current', slideWrapper).removeClass('current').next().addClass('current'); slidesHeight = 0; for (var i = $('.current', slideWrapper).index(); i < ($('.current', slideWrapper).index() + o.slideMove.visibleItem); i++) { slidesHeight += Math.ceil($('li:eq(' + i + ')', slideWrapper)[0].getBoundingClientRect().height); } } else { $('.current', slideWrapper).removeClass('current'); $('li:first-child', slideWrapper).addClass('current'); slideHeight = 0; slidesHeight = 0; for (var i = $('.current', slideWrapper).index(); i < ($('.current', slideWrapper).index() + o.slideMove.visibleItem); i++) { slidesHeight += Math.ceil($('li:eq(' + i + ')', slideWrapper)[0].getBoundingClientRect().height); } } } slideWrapper.css({ 'top': slideHeight }).parent().css({ 'height': slidesHeight }); } $('.active', $(o.slidePaging.wrapPaging)).removeClass('active'); $('li:eq(' + o.currentIndex + ')', $(o.slidePaging.wrapPaging)).addClass('active'); if (o.changeFn !== null && typeof o.changeFn === 'function') { o.changeFn.call(this, o.currentIndex); } } function firstSlide() { $('.current', slideWrapper).removeClass('current'); $('li:first-child', slideWrapper).addClass('current'); slideWidth = 0; slideLeft = 0; } function lastSlide() { $('.current', slideWrapper).removeClass('current'); $('li:last-child', slideWrapper).addClass('current'); slideWidth = '-' + (slideWrapper.width() - parentWidth) + 'px'; slideLeft = slideWrapper.width() - parentWidth; } function slideResizerCaller() { slideResizer('firstLoad'); $(window).resize(function() { if (winWidth !== $(window).width()) { slideResizer('winResize'); winWidth = $(window).width(); } }); } function slideResizer(clbkType) { if (o.isFullWidth.status) { if (o.slideType === 'fade') { o.sliderWidth = $(window).width() + 'px'; o.sliderHeight = ($(window).width() / o.isFullWidth.picRatio) + 'px'; slideWrapper.css({ 'width': o.sliderWidth, 'height': o.sliderHeight }); } } if (o.slideType === 'carousel') { if (clbkType === 'firstLoad') { carouselResizer(); } else { carouselResizer(); } } } function carouselResizer() { slideWrapper.removeClass('ease'); parentWidth = slideWrapper.parent().width(); slideWrapper.removeAttr('style'); slideItems.removeAttr('style'); if (o.slideMove.slideDirection === 'horizontal') { slidesWidth = 0; slideLeft = 0; slideItems.each(function() { if (isIE) { $(this).width(Math.ceil($(this)[0].getBoundingClientRect().width)); slidesWidth += Math.ceil($(this)[0].getBoundingClientRect().width); } else { $(this).width($(this)[0].getBoundingClientRect().width); slidesWidth += $(this)[0].getBoundingClientRect().width; } if (findCurrent) { if ($(this).hasClass('current')) { findCurrent = false; } else { slideLeft += $(this)[0].getBoundingClientRect().width; } } if (slideWidth !== 0) { slideWidth = '-' + slideLeft; } }); slideWrapper.css({ 'width': slidesWidth, 'left': slideWidth }); } else { if (o.totalSlide > o.slideMove.visibleItem) { slidesHeight = 0; slideHeight = 0; for (var i = o.currentIndex; i < (o.currentIndex + o.slideMove.visibleItem); i++) { slidesHeight += Math.ceil(slideItems[i].getBoundingClientRect().height); } slideWrapper.css({ 'top': slideHeight }).parent().css({ 'height': slidesHeight }); } } slideWrapper.addClass('ease'); findCurrent = true; } }); }; $.fn.equalizer = function(options) { return this.each(function() { var defaults = $.extend({ equalItem: '.productDetails' }, options); var o = defaults; var equalWrapper = '#' + $(this).attr('id'); var maxHeight = 0; if ($('body').find(equalWrapper)) { heightEqualizeCaller(); } function heightEqualize(wrapper, item) { if ($(wrapper).find('.showcase').length > 0) { $(wrapper).find('.showcase').each(function() { $(this).find(item).each(function() { if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } }).promise().done(function() { $(this).parents('.showcase').find(item).each(function() { $(this).height(maxHeight); }); }); maxHeight = 0; }); } else { $(wrapper).find(item).each(function() { if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } }).promise().done(function() { $(this).parents(wrapper).find(item).each(function() { $(this).height(maxHeight); }); }); maxHeight = 0; } } function heightEqualizeCaller() { heightEqualize(equalWrapper, o.equalItem); $(window).resize(function() { if ($(window).width() <= 1200) { maxHeight = 0; $(equalWrapper).find(o.equalItem).removeAttr('style'); heightEqualize(equalWrapper, o.equalItem); } }); } }); }; $.fn.popup = function(options) { return this.each(function() { var defaults = $.extend({ popupBtn: '.popupBtn', popupTitle: true, popupBtns: true }, options); var o = defaults; var popupWrapper = $(this); var popupTitleDiv = $('#popupTitle'); var popupTextDiv = $('#popupInner'); var popupBtnsDiv = $('#popupCustomBtns'); var wWidth; var wHeight; var pTrueWidth; var pWidth; var pHeight; var mLeft; var mTop; $(o.popupBtn).on('click', function() { popupFill(popupWrapper); }); $('#popupClose').on('click', function() { popupClose(); }); $('#closeBtn').on('click', function() { popupClose(); }); $('#popupShadow').on('click', function() { popupClose(); }); $('body').on('keyup', function(e) { if (e.keyCode === 27) { popupClose(); } }); function popupFill(popupWrapper) { if (o.popupTitle) { hideBlock(popupTitleDiv); popupTitleDiv.html(popupWrapper.find('.popupTitle').html()); } else { showBlock(popupTitleDiv); } popupTextDiv.html(popupWrapper.find('.popupText').html()); if (o.popupBtns) { hideBlock($('#popupBtns')); popupBtnsDiv.html(popupWrapper.find('.popupBtns').html()); } else { showBlock($('#popupBtns')); } setTimeout(function() { popupOpen(); }, 250); } function hideBlock(block) { if (block.hasClass('hideThis')) { block.removeClass('hideThis'); } } function showBlock(block) { if (!block.hasClass('hideThis')) { block.addClass('hideThis'); } } function popupOpen() { popupWrapper.find('.popupTitle').empty(); popupWrapper.find('.popupText').empty(); popupWrapper.find('.popupBtns').empty(); $('#popup').fadeIn().addClass('active'); resizePopupCaller(); } function resizePopupCaller() { pTrueWidth = $('#popupWrap').width(); resizePopup('firstOpen'); popupTextDiv.bind('DOMSubtreeModified', function() { $('#popupWrap').stop(); if ($('#popup').hasClass('active')) { resizePopup('opened'); } }); $(window).resize(function() { if ($('#popup').hasClass('active')) { resizePopup('opened'); } }); } function resizePopup(clbkType) { $('#popupWrap').css({ 'width': 'auto' }); wWidth = $(window).width(); wHeight = $(window).height(); pWidth = $('#popupWrap').width(); pHeight = $('#popupWrap').height(); mLeft = (wWidth - pWidth) / 2; mTop = pHeight / 2; mBottom = 0; if ($(window).width() < 1200) { if (pWidth >= (wWidth - 100)) { pWidth = wWidth - 100; mLeft = 50; } } if ($(window).width() > 769) { if (pHeight > (wHeight - 100)) { mTop = mBottom = 50; } else { mTop = (wHeight - pHeight) / 2; mBottom = 0; } } else { mTop = mBottom = 50; } $('#popupWrap').css({ 'width': pWidth + 'px', 'marginLeft': mLeft + 'px' }); if (clbkType === 'opened') { $('#popupWrap').css({ 'marginTop': mTop + 'px', 'marginBottom': mBottom + 'px', 'top': 0 }); } else { setTimeout(function() { $('#popupWrap').css({ 'marginTop': mTop + 'px', 'marginBottom': mBottom + 'px', 'top': 0 }); }, 250); } } function popupClose() { $('#popup').fadeOut().removeClass('active'); setTimeout(function() { clearPopup(); popupTitleDiv.empty(); popupTextDiv.empty(); popupBtnsDiv.empty(); }, 250); } function clearPopup() { $('#popupWrap').removeAttr('style'); } }); }; jQuery.cookie = function(name, value, options) { if (typeof value !== 'undefined') { options = options || {}; if (value === null) { value = ''; options.expires = -1; } var expires = ''; if (options.expires && (typeof options.expires === 'number' || options.expires.toUTCString)) { var date; if (typeof options.expires === 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); } else { date = options.expires; } expires = '; expires=' + date.toUTCString(); } var path = options.path ? '; path=' + (options.path) : ''; var domain = options.domain ? '; domain=' + (options.domain) : ''; var secure = options.secure ? '; secure' : ''; document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); } else { var cookieValue = null; if (document.cookie && document.cookie !== '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); if (cookie.substring(0, name.length + 1) === (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; } }; function ajaxPost(form) { $.ajax({ type: 'POST', url: form.attr('action'), data: form.serialize(), success: function(msg) { location.reload(); } }); } function loadScripts(pageUrl, scriptWrapper, targetObj, callbackFn) { $.ajax({ url: pageUrl, cache: false, success: function(response) { $(targetObj).append($(response).find(scriptWrapper)); if (callbackFn !== 'undefined' && callbackFn !== '' && typeof callbackFn === 'function') { callbackFn(); } } }); } var tooltip = { show: function(item, message, duration, classes) { var tooltipWrapper = item.closest('.tooltipWrapper'); if (tooltipWrapper.find('.tooltip').length == 0) { if (classes !== '' && classes !== 'undefined') { tooltipWrapper.append('' + message + ''); } else { tooltipWrapper.append('' + message + ''); } tooltipWrapper.find('.tooltip').fadeIn(); var offTop = (tooltipWrapper.find('.tooltip').offset().top + (tooltipWrapper.height() / 2)) - ($(window).height() / 2); if ($('body').hasClass('popupActive')) { var offTopPwin = tooltipWrapper.closest('.pWin')[0].offsetTop; offTop = tooltipWrapper[0].offsetTop; $('.pWrapper .pWin.overflow .pText').animate({ scrollTop: (offTopPwin - offTop) }, 800); } else { $('html, body').animate({ scrollTop: offTop }, 800); } if (duration !== false && duration === 'undefined') { duration = 3000; } if (duration !== false && duration !== 'undefined') { setTimeout(function() { tooltip.hide(item); }, duration + 250); } } }, hide: function(item) { item.closest('.tooltipWrapper').find('.tooltip').fadeOut(); setTimeout(function() { item.closest('.tooltipWrapper').find('.tooltip').remove(); }, 250); }, hideAll: function() { $('.tooltip').remove(); } }; var notify = { position: 'top right', show: function(message, duration, classes) { if ($('body').find('#notify').length === 0) { var notifyWrap = $('
    '); notifyWrap.attr({ 'id': 'notify', 'class': notify.position }); $('body').append(notifyWrap); } var notifyId = $('.notify').length > 0 ? parseInt($('.notify').last().attr('data-order')) + 1 : 0; var currentNotify = $(''); currentNotify.attr({ 'class': 'notify', 'data-order': notifyId }); if (duration === false) { message = '' + message; } currentNotify.html(message); if (classes !== '' && classes !== 'undefined') { currentNotify.addClass(classes); } currentNotify.appendTo('#notify').fadeIn(); if (duration !== false && duration === 'undefined') { duration = 3250; } if (duration !== false && duration !== 'undefined') { setTimeout(function() { notify.hide(notifyId); }, duration + 250); } $('.notifyClose').on('click', function() { notify.hide($(this).attr('data-order')); }); }, hide: function(notifyId) { $('#notify').find('.notify[data-order="' + notifyId + '"]').fadeOut(); setTimeout(function() { $('#notify').find('.notify[data-order="' + notifyId + '"]').remove(); if ($('.notify').length < 1) { notify.hideAll(); } }, 250); }, hideAll: function() { $('#notify').remove(); } }; var loading = { show: function(item) { item.closest('.loaderWrapper').append(''); item.closest('.loaderWrapper').find('.loading').fadeIn(); }, hide: function(item) { item.closest('.loaderWrapper').find('.loading').finish().fadeOut(); setTimeout(function() { item.closest('.loaderWrapper').find('.loading').remove(); }, 250); } }; $.fn.lightbox = function() { var slideWrapper = $(this); var imgList = []; var imgIndex = 0; var lightContent = ''; slideWrapper.each(function() { imgList.push($(this).attr('href')); }); slideWrapper.click(function(e) { e.preventDefault(); imgIndex = $(this).attr('data-index'); lightContent = ''; if (imgList.length > 1) { lightContent += '
    ' + '
    ' + '' + '' + '
    ' + '
    '; } var lightPopup = new Message({ id: 'light-box', html: '
    ' + lightContent + '
    ', openingCallback: function popupCallback() { lightCallback(); } }); lightPopup.show(); }); if (imgList.length > 1) { $(document).on('click', '#nextLight', function() { if (imgIndex < imgList.length - 1) { imgIndex++; } else { imgIndex = 0; } changeImg(); }); $(document).on('click', '#prevLight', function() { if (imgIndex > 0) { imgIndex--; } else { imgIndex = imgList.length - 1; } changeImg(); }); } function changeImg() { loading.show($('#lightContent')); $('#lightBox').attr('src', imgList[imgIndex]); loading.hide($('#lightContent')); var maxH = $('.pWin:last').height(); var contentHeight = $('#lightContent').height(); var contentWidth = $('#lightContent').width(); if (contentHeight > maxH) { $('.pWin:last').addClass('overflow').width(contentWidth + 10); } else { $('.pWin:last').removeClass('overflow'); } } }; var basketStatus = { success: function(item, duration) { $('a[data-parent="' + item + '"]').addClass('success'); if (duration !== false && duration !== 'undefined') { setTimeout(function() { basketStatus.clear(item); }, duration); } }, error: function(item, duration) { $('a[data-parent="' + item + '"]').addClass('error'); if (duration !== false && duration !== 'undefined') { setTimeout(function() { basketStatus.clear(item); }, duration); } }, clear: function(item) { $('a[data-parent="' + item + '"]').removeClass('error success'); } }; function childFinder(wrapper) { var tagName = wrapper.prop('tagName') || 'A'; console.log(tagName); return tagName.toLowerCase(); } var windowTop; var windowHeight; var itemTop; var currentItem; function lazy(item) { $(window).on('load', function() { lazyControl(item); }); $(window).scroll(function() { lazyControl(item); }); $(window).resize(function() { lazyControl(item); }); } function lazyControl(item) { windowTop = $(window).scrollTop(); windowHeight = $(window).height(); $('.' + item).each(function() { currentItem = $(this); itemTop = currentItem.parent().offset().top; if ((windowTop + windowHeight) >= itemTop) { loadImage(currentItem, item); } }); } function loadImage(item, lazyClass) { $(item).fadeOut(250); setTimeout(function() { $(item).removeClass(lazyClass).attr('src', $(item).attr('data-src')); $(item).on('load', function() { $(item).fadeIn().removeAttr('data-src'); }); setTimeout(() => { $(item).removeAttr('style'); }, 500); }, 250); } function inputControl() { $('.form-control').each(function() { var input = $(this).find('input'); var inputType = input.attr('type'); var inputWrap = $(this).find('.input-wrap'); if (inputType === 'radio' || inputType === 'checkbox') { inputWrap.addClass(inputType); } if (input.is(':checked')) { inputWrap.addClass('active'); if ($(this).hasClass('lightBg')) { $(this).removeClass('lightBg').addClass('darkBg'); } } else { inputWrap.removeClass('active'); if ($(this).hasClass('darkBg')) { $(this).removeClass('darkBg').addClass('lightBg'); } } }); } var discounts = []; function qtyControl() { var qty; var qtyId; var qtyWrap; $(document).on('click', '.qtyBtns a', function() { qtyWrap = $(this).parent(); var incStr = qtyWrap.attr('data-increment') || '1'; var inc = parseFloat(incStr); var a = 0; if (incStr.indexOf('.') > -1) { a = incStr.replace(/^.*?\./g, '').trim().length; } qtyId = $(this).attr('data-id'); var domBtn = $('#Adet' + qtyId + '[type="text"],#Adet' + qtyId + '[type="number"]'); qty = parseFloat(domBtn.val() || '1'); switch ($(this).attr('title')) { case '+': qty += inc; var qtyStock = qtyWrap.find('input').data('stock'); if(qtyStock && qty > qtyStock) { qty = qtyStock; } break; case '-': qty -= inc; var min = parseInt((domBtn.attr('min')) ? domBtn.attr('min') : 1); if (qty < min) { qty = min; } break; default: } domBtn.val(qty.toFixed(a)).trigger('input'); if (!qtyWrap.hasClass('detected')) { qtyWrap.addClass('detected'); $('.discounts').each(function() { discounts.push({ index: $(this).index(), min: $(this).attr('data-min'), max: $(this).attr('data-max'), percent: $(this).attr('data-percent') }); }); } if (qtyWrap.attr('data-multiple-disc')) { multipleDiscount(qty.toFixed(a)); } var cb = $(this).attr('data-callback'); if (typeof cb !== 'undefined' && typeof window[cb] === 'function') { window[cb](qtyId, qty.toFixed(a)); } }); $(document).on('change', '.qtyBtns input', function() { var self = $(this); var min = (self.attr('min')) ? self.attr('min') : 1; var qtyWrap = self.parent(); if (!qtyWrap.hasClass('detected') && discounts.length < 1) { qtyWrap.addClass('detected'); $('.discounts').each(function() { discounts.push({ index: $(this).index(), min: $(this).attr('data-min'), max: $(this).attr('data-max'), percent: $(this).attr('data-percent') }); }); } if (parseInt(self.val()) < parseInt(min)) { self.val(min); } if (qtyWrap.attr('data-multiple-disc')) { multipleDiscount(self.val()); } }); } function multipleDiscount(quantity) { $('.currentDiscount').removeClass('currentDiscount'); $('.discountPrice').find('span').text($('.discountPrice').data('old')); var oldPrice = $('.discountPrice').data('old'); $.each(discounts, function() { if (parseFloat(this.min) <= parseFloat(quantity) && parseFloat(this.max) >= parseFloat(quantity)) { $('.discounts').eq(this.index).addClass('currentDiscount'); var parsePrice = SEP_THO === ',' ? parseFloat(oldPrice.replace(',', '')) : SEP_DEC == "," ? parseFloat(oldPrice.replace('.', '').replace(',', '.')) : parseFloat(oldPrice); var groupPrice = (parsePrice * (100 - parseFloat(this.percent)) / 100); $('.discountPrice').find('span').text(format(groupPrice)); } }); } function placeholder() { $('input').each(function() { if ($(this).attr('placeholder') && !$(this).hasClass('phone') && !$(this).hasClass('withPlace') && !$(this).hasClass('loadedPlace')) { $(this).addClass('withHolder loadedPlace').parent().append('' + $(this).attr('placeholder') + ''); if ($(this).val() === '') { $(this).parent().find('.placeholder').removeClass('hideThis'); } } }).promise().done(function() { $('textarea').each(function() { if ($(this).attr('placeholder') && !$(this).hasClass('withPlace') && !$(this).hasClass('loadedPlace')) { $(this).addClass('withHolder loadedPlace').parent().append('' + $(this).attr('placeholder') + ''); if ($(this).val() === '') { $(this).parent().find('.placeholder').removeClass('hideThis'); } } }).promise().done(function() { $('select').each(function() { console.log($(this)); if ($(this).attr('data-holder') && !$(this).hasClass('loadedPlace')) { $(this).addClass('withHolder loadedPlace').parent().append('' + $(this).attr('data-holder') + ''); } }).promise().done(function() { $('.placeholder').bind('click', function() { $(this).addClass('hideThis').parent().find('.withHolder').focus(); }); $('.withHolder').bind('focus', function() { $(this).parent().find('.placeholder').addClass('hideThis'); }); $('.withHolder').bind('blur', function() { if ($(this).val() === '' && $(this)[0].nodeName.toLowerCase() != 'select') { $(this).parent().find('.placeholder').removeClass('hideThis'); } }); }); }); }); } function flexPlace() { $('input').each(function() { var placeholderText = ($(this).attr('data-placeholder2') && $(this).attr('data-placeholder2') != '') ? $(this).attr('data-placeholder2') : $(this).attr('placeholder'); if (typeof placeholderText != 'undefined' && !$(this).hasClass('withPlace') && !$(this).hasClass('loadedPlace')) { $(this).addClass('withHolder loadedPlace').parent().append('' + placeholderText + ''); if ($(this).val() === '') { $(this).parent().find('.placeholder').removeClass('focus'); } } }).promise().done(function() { $('textarea').each(function() { var placeholderText = ($(this).attr('data-placeholder2') && $(this).attr('data-placeholder2') != '') ? $(this).attr('data-placeholder2') : $(this).attr('placeholder'); if (typeof placeholderText != 'undefined' && !$(this).hasClass('withPlace') && !$(this).hasClass('loadedPlace')) { $(this).addClass('withHolder loadedPlace').parent().append('' + placeholderText + ''); if ($(this).val() === '') { $(this).parent().find('.placeholder').removeClass('focus'); } } }).promise().done(function() { $('select').each(function() { if ($(this).attr('data-holder') && !$(this).hasClass('loadedPlace')) { $(this).addClass('withHolder loadedPlace').parent().append('' + $(this).attr('data-holder') + ''); } }).promise().done(function() { $('.placeholder').bind('click', function() { $(this).addClass('focus').parent().find('.withHolder').focus(); }); $('.withHolder').bind('focus', function() { $(this).parent().find('.placeholder').addClass('focus'); }); $('.withHolder').bind('blur', function() { if ($(this).val() === '' && $(this)[0].nodeName.toLowerCase() != 'select') { $(this).parent().find('.placeholder').removeClass('focus'); } }); }); }); }); } function colToggle(col) { if ($(window).width() < 769) { col.toggleClass('active'); col.next('div').slideToggle(); } } function productComparison(item) { item.toggleClass('active'); item.prev('.karsilastirma').attr('checked', !item.prev('.karsilastirma').attr('checked')); sendCompareProductId(item.prev('.karsilastirma').val()); return false; } function karsilastirmaKontrol() { return true; } function sendCompareProductId(proId) { $.ajax({ type: "POST", url: "./conn/product/compare/addId", data: { productId: proId }, success: function(msg) { } }); } function urunKarsilastir() { var width = 0; $.each($('input.karsilastirma:checked'), function() { $(this).attr("checked", false); $(this).next('.comparisonBtn').removeClass('active'); width += 300; }).promise().done(function() { var url = './conn/product/compare/product'; $.get(url, function(msg) { var _instance = new Message({ id: 'myPopupWin', title: 'Dialog', url: url, param: url.replace(/^.*\//g, ''), html: msg, width: width }); _instance.show(); }); $.get("./conn/product/compare/product", function(data, status) { $('#productPopup .popupText').html(data); }).done(function() { $('#productPopup').popup({ popupBtn: '#productPopupBtn' }); $('#productPopupBtn').trigger('click'); }); }); } function addAll() { if ($('input.karsilastirma:checked').length > 0) { var prIds = []; var subIds = []; var prQty = []; $('input.karsilastirma:checked').each(function() { productComparison($(this).parent().find('.comparisonBtn')); prIds.push($(this).val()); subIds.push($('#subPro' + $(this).val()).val()); prQty.push($('#Adet' + $(this).val()).val()); }); multiCart = true; Add2Cart(prIds, subIds, prQty); } else { var _instance = new Message({ title: LANG.get('dikkat'), html: 'Seçili ürün bulunamadı', width: 300 }); _instance.show(); } } function cLog(str) { if (typeof console === 'undefined' || typeof console.log === 'undefined') { return false; } console.log(str); } function setCookie(c_name, value, exdays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value = escape(value) + ((exdays === null) ? "" : "; expires=" + exdate.toUTCString()); if(location.protocol == 'https:'){ c_value += "; secure"; } document.cookie = c_name + "=" + c_value; } function getCookie(c_name) { var i, x, y, ARRcookies = document.cookie.split(";"); for (i = 0; i < ARRcookies.length; i++) { x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1); x = x.replace(/^\s+|\s+$/g, ""); if (x === c_name) { return unescape(y); } } } function getRootPath() { var scripts = document.getElementsByTagName("script"); var root, src, idx; for (var i = 0; i < scripts.length; i++) { src = scripts[i].src; idx = src.indexOf('js/general'); if (idx > 0) { root = src.substr(0, idx); break; } } return root; } function empty(mixed_var) { var key; if (mixed_var === "" || mixed_var === 0 || mixed_var === "0" || mixed_var === null || mixed_var === false || typeof mixed_var === 'undefined') { return true; } if (typeof mixed_var === 'object') { for (key in mixed_var) { return false; } return true; } return false; } function selCopy(target) { var el = document.createElement('textarea'); el.value = $(target).text().trim(); document.body.appendChild(el); el.select(); document.execCommand('copy'); document.body.removeChild(el); } var isIE = false; var isSafari = false; $(document).ready(function() { lazy('lazy'); qtyControl(); inputControl(); if (typeof showHeaderCart !== 'undefined' && showHeaderCart === true) { if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) { $.get('/srv/service/cart/show-header-cart', function(result) { $('#mobileBasketList').html(result); }); } else { $('#cart-soft-count').mouseenter(function() { if ($('body').find('#basketList').length < 1) { $.get('/srv/service/cart/show-header-cart', function(result) { $('#cart-soft-count').parent().append(result); setTimeout(function() { $('#basketList').stop(true, true).delay(50).fadeIn(); }, 250); }); } else { $('#basketList').angularTemplate(); $('#basketList').stop(true, true).delay(50).fadeIn(); } }); $('#cart-soft-count').parent().mouseleave(function() { $('#basketList').stop(true, true).delay(50).fadeOut(250); }); } } if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) { if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { $('body').addClass('safari'); isSafari = true; } if (navigator.appVersion.indexOf('Trident') > -1 && navigator.appVersion.indexOf('Edge') == -1) { isIE = true; } } $(document).on('click', '.formBtn', function() { ajaxPost($(this).closest('form')); }); $('[data-target="blank"]').click(function(e) { e.preventDefault(); window.open($(this).attr('href')); }); $(".karsilastirma").on('click', function(e) { e.preventDefault(); e.stopPropagation(); karsilastirmaKontrol(); sendCompareProductId($(this).attr("value")); return false; }); $(document).on('click', '.zoomBtn', function(e) { e.preventDefault(); var proUrl = $(this).data('url'); $.ajax({ url: proUrl, cache: false, success: function(response) { var quickView = new Message({ id: 'quickview', html: '', width: 1100, openingCallback: function() { var quickWrapper = Message.instance.activePopup.get('selector'); $(quickWrapper).find('.row.oh').load(proUrl + ' #pageContent', function() { $(quickWrapper).find('.row.oh').append($(response).find('#pageScripts')); zoomCallback(); var maxH = $('.pWin:last').height(); var contentHeight = $('.pText:last').height(); var contentWidth = $('.pText:last').width(); if (contentHeight > maxH) { $('.pWin:last').addClass('overflow').width(contentWidth); } if (typeof QuickViewObj != 'undefined') { for (var i = 0; i < QuickViewObj.callback.open.length; i++) { if (typeof QuickViewObj.callback.open[i] == 'function') { QuickViewObj.callback.open[i](); } } } }); } }); quickView.show(); } }); }); $('.col-title').click(function() { colToggle($(this)); }); $(document).on('click', '.accordeon', function() { $(this).toggleClass('active'); $(this).next('div').slideToggle(); }); if (CSRF_TOKEN) { $(".csrf_token-control").val(CSRF_TOKEN); } if (PAGE_TYPE == 'product' && $('.qtyBtns[data-multiple-disc="true"]').length > 0) { $('.qtyBtns[data-multiple-disc="true"] input').trigger('change'); } }); $(document).on('click', '.compare', function() { $.ajax({ type: "POST", url: "/conn/product/compare/getId", dataType: 'json', success: function(msg) { if (msg.status) { if (msg.data.length == 0) { Message.showDialog(LANG.get("no_products_on_comparison", "Kaşılaştırılacak ürün yok"), 400); } else if (msg.data.length == 1) { Message.showDialog(LANG.get("must_select_least_2_items_to_compare", "Karşılaştırmak için en az 2 ürün seçmelisiniz"), 400); } else if (msg.data.length > 4) { Message.showDialog(LANG.get("must_select_least_2_items_to_compare", "Karşılaştırmak için en az 2 ürün seçmelisiniz"), 400); } else { $.get('/srv/service/content/get/1003/compare/' + msg.data.join('-'), function(result) { var ComparePopup = new Message({ width: msg.data.length * 300, html: result }); ComparePopup.show(); }); } } } }); }); if (!window.console) { var console = { log: function() {} } } var LocalApi = { get: function(key, def = false) { try { var obj = JSON.parse(localStorage.getItem(key)); let now = new Date().getTime(); if (obj.timemout && obj.timemout > now) { return def; } return typeof obj.value !== 'undefined' ? obj.value : def; } catch (ex) { return def; } }, set: function(key, val, timeout) { try { timeout = parseInt(timeout) > 0 ? timeout : 365 * 24 * 3600; let obj = { value: val, timeout: new Date().getTime() + (1000 * timeout) }; localStorage.setItem(key, JSON.stringify(obj)); return true; } catch (ex) { return false; } }, remove: function(key) { try { localStorage.removeItem(key); return true; } catch (ex) { return false; } } }; var FavouriteApi = { ids: null, add: function(subId, productId, $ref = null) { //1 adet ürün ekler productId = parseInt(productId) > 0 ? parseInt(productId) : 0; if (FavouriteApi.ids === null) { FavouriteApi.ids = LocalApi.get(IS_FAV == 1 ? 'fav-collection' : 'favourite', []); } if (FavouriteApi.isExist(productId)) { FavouriteApi.remove(productId, $ref); return; } if (IS_FAV == 1) { $.ajax({ url: '/srv/service/collection/set-item', type: 'POST', data: { 'collection_id': 0, 'products[]': productId + '_' + subId }, dataType: 'json', success: function(msg) { if (msg.status) { const product = Array.from(msg.data).find(e => e.product_id == productId); FavouriteApi.ids.push({ id : product.item_id, pid : parseInt(productId) }); LocalApi.set('fav-collection', FavouriteApi.ids); notify.show(LANG.get('add_to_favourite'), 3000, 'btn btn-success fav-added-notify'); if ($ref != null) $ref.classList.add('fav-added-btn'); } else { notify.show('Hata oluştu.', 3000, 'btn btn-danger'); } } }); } else { FavouriteApi.ids.push(productId); $.ajax({ url: '/srv/service/profile/add-to-shopping-list', type: 'POST', data: { ids: [productId], fetch: true, cat_id: LocalApi.get('favourite_category').id || 1, }, dataType: 'json', success: function(msg) { if (msg.status) { if (typeof AddToWishListCallback === 'function') { if (typeof msg.data !== 'undefined') { AddToWishListCallback(productId, msg.data); } else { AddToWishListCallback(productId); } } LocalApi.set('favourite', FavouriteApi.ids); notify.show(LANG.get('add_to_favourite'), 3000, 'btn btn-success fav-added-notify'); if ($ref != null) $ref.classList.add('fav-added-btn'); } else if (msg.statusText == 'NO_MEMBER_SESSION') { setTimeout(function() { window.location.reload(); }, 2500); } else { notify.show('Hata oluştu.', 3000, 'btn btn-danger'); } } }); } }, remove: function(productId, $ref) { //1 adet ürün siler productId = parseInt(productId) > 0 ? parseInt(productId) : 0; if (FavouriteApi.ids === null) { FavouriteApi.ids = LocalApi.get(IS_FAV == 1 ? 'fav-collection' : 'favourite', []); } var index, collectionPid; if (IS_FAV == 1) { collectionPid = Array.from(FavouriteApi.ids).find(e => e.pid == productId); index = FavouriteApi.ids.map(e => e.pid).indexOf(productId); } else { index = FavouriteApi.ids.indexOf(productId); } if (index > -1) { if (IS_FAV == 1) { $.ajax({ url: '/srv/service/collection/remove-item/', type: 'POST', data: { 'collection_id' : 0, 'item_id[]' : collectionPid.id }, dataType: 'json', success: function(msg) { if (msg.status) { FavouriteApi.ids.splice(index, 1); LocalApi.set('fav-collection', FavouriteApi.ids); notify.show(LANG.get('remove_to_favourite'), 3000, 'btn btn-danger fav-delete-notify'); if ($ref != null) $ref.classList.remove('fav-added-btn'); } else { notify.show('Hata oluştu.', 3000, 'btn btn-danger'); } } }); } else { $.ajax({ url: '/srv/service/profile/delete-shopping-products-by-product-id', type: 'POST', data: { products: [productId] }, dataType: 'json', success: function(r) { if (typeof DeleteWishListCallback === 'function') { if (typeof r.data !== 'undefined') { DeleteWishListCallback(r.ids, r.data); } else { DeleteWishListCallback(r.ids); } } FavouriteApi.ids.splice(index, 1); LocalApi.set('favourite', FavouriteApi.ids); notify.show(LANG.get('remove_to_favourite'), 3000, 'btn btn-danger fav-delete-notify'); if ($ref != null) $ref.classList.remove('fav-added-btn'); } }); } } }, isExist: function(productId) { productId = parseInt(productId) > 0 ? parseInt(productId) : 0; if (FavouriteApi.ids === null) { FavouriteApi.ids = LocalApi.get(IS_FAV == 1 ? 'fav-collection' : 'favourite', []); } if (IS_FAV == 1) { return FavouriteApi.ids.map(e => e.pid).indexOf(productId) > -1 ? true : false; } else { return FavouriteApi.ids.indexOf(productId) > -1 ? true : false; } }, setButtons: function() { var btns = document.querySelectorAll('[onclick^="AddToShoppingList"]'); if (FavouriteApi.ids === null) { FavouriteApi.ids = LocalApi.get(IS_FAV == 1 ? 'fav-collection' : 'favourite', []); } if (MEMBER_INFO.ID > 0 && FavouriteApi.ids.length == 0) { if (IS_FAV == 1) { $.ajax({ url: 'srv/service/collection/get/0', type: 'GET', dataType: 'json', success: function(response) { if (response.status && response.data[0] && response.data[0].items.length > 0) { const items = response.data[0].items; items.map(function(item) { const product = { id : item._id, pid : parseInt(item.ID) }; FavouriteApi.ids.push(product); LocalApi.set('fav-collection', FavouriteApi.ids); }); FavouriteApi.setButtons(); return; } } }); } else { } } if (Array.isArray(FavouriteApi.ids)) { Array.from(btns).forEach(function(item) { var attr = item.getAttribute('onclick'); var splitAttr = attr.replace(' ', '').split(','); var pId = splitAttr[1] || 'none'; var index = IS_FAV == 1 ? FavouriteApi.ids.map(e => e.pid).indexOf(parseInt(pId)) > -1 : FavouriteApi.ids.indexOf(parseInt(pId)) > -1; if (index) item.classList.add('fav-added-btn'); }); } } }; if ($.fn.checkboxStyle === undefined) { $.fn.checkboxStyle = function(arr) { var aktif = 'AKTİF'; var pasif = 'PASİF'; if (arr !== undefined) { if (arr.yes !== undefined) { aktif = arr.yes; } if (arr.no !== undefined) { pasif = arr.no; } } var html = '
    AKTİF
    PASİF
    '; this.each(function() { var name = $(this).attr('name'); var id = $(this).attr('id'); var val = $(this).is(':checked') ? 1 : 0; $(this).after(html); $(this).parent().find('.iphoneStyle:last input').attr('name', name); $(this).parent().find('.iphoneStyle:last input').attr('id', id); $(this).parent().find('.iphoneStyle:last input').val(val); $(this).remove(); if (name !== undefined) $(this).parent().find('.iphoneStyle:last .iChecked span').text(aktif); if (id !== undefined) $(this).parent().find('.iphoneStyle:last .iUnChecked span').text(pasif); }); $('.iphoneStyle').unbind('click').click(function() { var ml = parseInt($(this).find('.iphoneBoruHat').css('margin-left')); if (ml === 0) { ml = -40; $('.sliderLeft').css('visibility', 'hidden'); $(this).find('input').val(0); } else { ml = 0; $('.sliderRight').css('visibility', 'visible'); $(this).find('input').val(1); } $(this).parent().find('.iphoneStyle:last input').trigger('change'); $(this).find('.iphoneBoruHat').animate({ marginLeft: ml }, 300); }); }; } function getLink(param, value, link) { var re = new RegExp('[\?\&]' + param + '=', 'g'); var url = link || window.location.href; if (re.test(url)) { re = new RegExp('([\?\&]' + param + '=)(.*?)&', 'g'); if (re.test(url)) { url = url.replace(re, '$1' + value + '&'); } else { re = new RegExp('([\?\&]' + param + '=)(.*?)$', 'g'); url = url.replace(re, '$1' + value); } } else if (/\?/g.test(url)) { url += '&' + param + '=' + value; } else { url += '?' + param + '=' + value; } if (value === '') { re = new RegExp('([\?\&])' + param + '=[^?&]*&?', 'g'); url = url.replace(re, '$1'); } url = url.replace(/[?&]$/g, ''); if (param !== 'pg') url = url.replace(/(\?|\&)pg=\d+/ig, "$1pg=1"); if (param !== 'ps') url = url.replace(/(\?|\&)ps=\d+/ig, "$1ps=1"); return url; } function setLanguage(language) { $.ajax({ url: '/srv/service/language/change/' + language + '/' + $('#link_type').val() + '/' + $('#link_table_id').val(), dataType: 'json', success: function(msg) { if (msg.link.length > 1 || ('page' == $('#link_type').val() && "1" == $('#link_table_id').val())) { var add = window.location.search || ''; window.location.href = '/' + msg.link + add; } else { window.location.reload(); } } }); } function setCurrency(currency) { $.post("/srv/shopping/shopping/set-currency/" + currency, {}, function(r) { if (r == 1) { window.location.reload(); } }); } function closeVariant() { autoCart = false; cartControl = false; tooltip.hide($('.variantWrapper')); $('.variantOverlay').fadeOut(250); setTimeout(function() { $('.variantOverlay').parent().removeClass('error'); }, 300); } function stockShowHide(isStockAvailable) { if (typeof cnf_negative_stock !== 'undefined' && cnf_negative_stock == 1) { isStockAvailable = true; } var outOfStockDom = $("#productDetail .out-of-stock"); if (isStockAvailable) { $('.inStock').show(); $('.outStock').hide(); outOfStockDom.hide(); } else { $('.inStock').hide(); $('.outStock').show(); if (outOfStockDom.length > 0) { outOfStockDom.show(); } } } var autoCart = false; var cartControl = false; function subProChangeButtons(prId, variantId) { var link = $('[data-type="price"]').attr('data-url') || ''; link = link.replace(/\/[\d-]*?$/g, '/' + prId + '-' + variantId); $('[data-type="price"]').attr('data-url', link); var link = $('[data-type="shoplist"]').attr('data-url') || ''; link = link.replace(/\/[\d-]*?$/g, '/' + prId + '-' + variantId); $('[data-type="shoplist"]').attr('data-url', link); var link = $('[data-type="stock"]').attr('data-url') || ''; link = link.replace(/\/[\d-]*?$/g, '/' + prId + '-' + variantId); $('[data-type="stock"]').attr('data-url', link); } function subProChange(element, parentClass) { if (!cartControl) { closeVariant(); } var id = element.attr('data-id') || ''; var prId = element.attr('data-target') || ''; var otherClass = parentClass === '.subOne' ? '.subTwo' : '.subOne'; var variantContainer = element.parents('.variantWrapper'); var json = variantContainer.find('#json' + prId).val() || '{"variant_ids":[],"variant_prices":[],"variant_price_raws":[],"buying_prices":[],"active_ids":[],"vat":0,"m_o_p":0}'; var arr = JSON.parse(json); var key = parentClass === '.subOne' ? 'one_' + id : 'two_' + id; var callBackFn = element.parents(parentClass).attr('data-callback') || ''; arr.active_ids[key] = typeof arr.active_ids[key] === 'object' ? arr.active_ids[key] : []; element.parent().find('[data-id]').removeClass('selected'); element.addClass('selected'); var others = variantContainer.find(otherClass).find('[data-id]'); var otherTag = variantContainer.find(otherClass).find('select[id*="subPro"]').length ? variantContainer.find(otherClass).find('select[id*="subPro"] option:selected').data('id') : others.parent().find('.selected').attr('data-id'); var otherSelected = String(otherTag) == 'undefined' ? "0" : String(otherTag); var v1 = parentClass === '.subOne' ? element.attr('data-id') : otherSelected; var v2 = parentClass === '.subOne' ? otherSelected : element.attr('data-id'); var searchItem = parentClass === '.subOne' ? v2 : v1; var variantKey = v1 + "_" + v2; var variantId = arr.variant_ids[variantKey] || "0"; if (others.length > 0) { if (key.indexOf('two') === -1) { others.addClass('passive'); for (var i = 0; i < arr.active_ids[key].length; i++) { others.parent().find('[data-id="' + arr.active_ids[key][i] + '"]').removeClass('passive'); } } if (otherSelected !== '0') { if (variantId !== '0' && arr.active_ids[key].indexOf(searchItem) > -1) { stockShowHide(true); } else { stockShowHide(false); } } } else { //tek variant ise if (element.hasClass('passive')) { stockShowHide(false); } else { stockShowHide(true); } } var selector = element.parents('.variantWrapper').parent(); var priceKey = variantKey; if (typeof arr.variant_prices[variantKey] === 'undefined' && ("0" === v1 || "0" === v2)) { var counter = 0; var re = ("0" === v1) ? new RegExp("_" + v2 + "$", "ig") : new RegExp("^" + v1 + "_", "ig"); for (var pKey in arr.variant_prices) { if (re.test(pKey) && counter == 0) { counter = 1; priceKey = pKey; } } } if ($('#productRight').length && $('.productDiscount span').length) { if ($('.product-price-not-discounted-not-vat').length) { var productDiscountCalc = Math.round((parseFloat($('.product-price-not-discounted-not-vat').text().replace('.', '').replace(',', '.')) - parseFloat($('.product-price-not-vat').text().replace('.', '').replace(',', '.'))) / parseFloat($('.product-price-not-discounted-not-vat').text().replace('.', '').replace(',', '.')) * 100); } else { var productDiscountCalc = Math.round((parseFloat($('.product-price-not-discounted').text().replace('.', '').replace(',', '.')) - parseFloat($('.product-price').text().replace('.', '').replace(',', '.'))) / parseFloat($('.product-price-not-discounted').text().replace('.', '').replace(',', '.')) * 100); } } if (typeof arr.variant_prices[priceKey] !== 'undefined') { var p = parseFloat(arr.variant_prices[priceKey]); //.toFixed(2); var b = parseFloat(arr.buying_prices[priceKey]); //.toFixed(2); var mop = (1 + arr.m_o_p / 100) * p; var noDiscount = parseFloat(arr.not_discounted_prices[priceKey] || 0); selector.find('.money-order-price').text(vat(mop, arr.vat)).attr('data-price', vat(mop, arr.vat)); selector.find('.money-order-price-not-vat').text(format(mop)).attr('data-price', format(mop)); selector.find('.product-price').text(vat(p, arr.vat)).attr('data-price', vat(p, arr.vat)); selector.find('.product-price').parents(".discountPrice").attr("data-old", vat(p, arr.vat)).data("old", vat(p, arr.vat)); b = selector.find('.buying-price').attr('data-numeric') == "1" ? b : format(b); selector.find('.buying-price').text(b).attr('data-price', b); selector.find('.product-price-not-vat').text(format(p)).attr('data-price', format(p)); selector.find('.product-price-not-vat').parents(".discountPrice").attr("data-old", format(p)).data("old", format(p)); if ($("#katalog").length > 0 || $(".catalogWrapper").length > 0) { var dom = selector.closest('.productDetails').find(".productPrice .currentPrice"); var current = dom.html(); if (current != undefined) { var rightPane = current.substr(current.match(/[a-z]/i)['index']); dom.text((rightPane.indexOf('+') > -1 ? format(p) : vat(p, arr.vat).toString()) + ' ' + rightPane); } } if ($("#link_type").val() === 'combination') { var dom = selector.find(".productPrice .currentPrice"); var current = dom.html(); } if (noDiscount > p) { selector.find('.product-price-not-discounted').parent().show(); selector.find('.product-price-not-discounted').text(vat(noDiscount, arr.vat)).attr('data-price', vat(noDiscount, arr.vat)); selector.find('.product-price-not-discounted-not-vat').text(format(noDiscount)).attr('data-price', format(noDiscount)); } else { selector.find('.product-price-not-discounted').parent().hide(); } if ($('#productRight').length && $('.productDiscount span').length) { if ($('.product-price-not-discounted-not-vat').length) { productDiscountCalc = Math.round((parseFloat(format(noDiscount).replace('.', '').replace(',', '.')) - parseFloat(format(p).replace('.', '').replace(',', '.'))) / parseFloat(format(noDiscount).replace('.', '').replace(',', '.')) * 100); } else { productDiscountCalc = Math.round((parseFloat(vat(noDiscount, arr.vat).replace('.', '').replace(',', '.')) - parseFloat(vat(p, arr.vat).replace('.', '').replace(',', '.'))) / parseFloat(vat(noDiscount, arr.vat).replace('.', '').replace(',', '.')) * 100); } } } else if (typeof PRODUCT_DATA !== 'undefined' && PRODUCT_DATA.length > 0) { selector.find('.product-price').text(format(PRODUCT_DATA[0].total_sale_price)).attr('data-price', format(PRODUCT_DATA[0].total_sale_price)); selector.find('.product-price').parents(".discountPrice").attr("data-old", format(PRODUCT_DATA[0].total_sale_price)).data('old', format(PRODUCT_DATA[0].total_sale_price)); } if ($('#productRight').length && $('.productDiscount span').length) { if (productDiscountCalc < 1) { $('#productRight .productDiscount').hide(); } else { $('#productRight .productDiscount').show(); } $('#productRight .productDiscount span').text('%' + (productDiscountCalc < 1 ? productDiscountCalc * -1 : productDiscountCalc)); } if (typeof arr.variant_price_raws[priceKey] !== 'undefined') { var p = parseFloat(arr.variant_price_raws[priceKey]); var b = parseFloat(arr.buying_prices[priceKey]); var mop = (1 + arr.m_o_p / 100) * p; var noDiscount = parseFloat(arr.not_discounted_prices[priceKey] || 0); selector.find('.money-order-price-raw').text(vat(mop, arr.vat)).attr('data-price', vat(mop, arr.vat)); selector.find('.money-order-price-not-vat-raw').text(format(mop)).attr('data-price', format(mop)); selector.find('.product-price-raw').text(vat(p, arr.vat)).attr('data-price', vat(p, arr.vat)); b = selector.find('.buying-price-raw').attr('data-numeric') == "1" ? b : format(b); selector.find('.buying-price-raw').text(b).attr('data-price', b); selector.find('.product-price-not-vat-raw').text(format(p)).attr('data-price', format(p)); if (noDiscount > 0) { selector.find('.product-price-not-discounted-raw').text(vat(noDiscount, arr.vat)).attr('data-price', vat(noDiscount, arr.vat)); selector.find('.product-price-not-discounted-not-vat-raw').text(format(noDiscount)).attr('data-price', format(noDiscount)); } } else if (typeof PRODUCT_DATA !== 'undefined' && PRODUCT_DATA.length > 0) { selector.find('.product-price-raw').text(format(PRODUCT_DATA[0].total_sale_price)).attr('data-price', format(PRODUCT_DATA[0].total_sale_price)); } var supplierProductCode = arr.variant_supplier_codes[variantKey] != '' ? arr.variant_supplier_codes[variantKey] : ''; if (supplierProductCode != '') { selector.find('.supplier_product_code').text(supplierProductCode); } if (typeof window[callBackFn] === 'function') { window[callBackFn](element); } $('#subPro' + prId).val(variantId); if (autoCart && cartControl) { $('#addCartBtn').trigger('click'); } subProChangeButtons(prId, variantId); if (parentClass === '.subOne' || parentClass === '.subTwo') { if ($("#katalog").length > 0) { if ($('.pWrapper').length > 0) { if ($('li[data-type="' + id + '"]').length > 0) { $('#productThumbs').css('left', 0); $('li[data-type="' + id + '"]').fadeIn(); $('li[data-type="' + id + '"]:eq(0)').trigger('click'); $('#productThumbs').addClass('filtered'); $('#productThumbs li').not('[data-type="' + id + '"]').fadeOut(); $('#thumbControl').fadeOut(); $('#imageControl').fadeOut(); } else { if ($('#productThumbs').hasClass('filtered')) { $('#productThumbs').css('left', 0); $('#productThumbs li').fadeIn(); $('#productThumbs li:eq(0)').trigger('click'); $('#thumbControl').fadeIn(); $('#imageControl').fadeIn(); } } } else { var productId = element.attr('data-product'); if (id == '') { $('.productItem' + productId + ' img').css('opacity', 0); $('.productItem' + productId + ' img:first').css('opacity', 1); } else { var dom = $('.productItem' + productId + ' img[data-type="' + id + '"]'); if (dom.length > 0) { dom.parent().parent().find('img').css('opacity', 0); dom.eq(0).css('opacity', 1); } } } } else { var elDataId = id; if (parentClass === '.subTwo' && element.parents('.variantWrapper').find('.subOne .selected').length > 0 && $('li[data-type="' + id + '"]').length > 0) { elDataId = id; } else if (parentClass === '.subTwo' && element.parents('.variantWrapper').find('.subOne .selected').length > 0) { elDataId = element.parents('.variantWrapper').find('.subOne .selected').attr('data-id'); } if (document.getElementById('productThumbs') != null) { if ($('li[data-type="' + elDataId + '"]').length > 0) { $('#productThumbs').css('left', 0); $('#productThumbs').addClass('filtered'); $('#productThumbs li[data-type="' + elDataId + '"]').fadeIn(); $('#productThumbs li[data-type="' + elDataId + '"]:eq(0)').trigger('click'); $('#productThumbs li').not('[data-type="' + elDataId + '"]').fadeOut(); $('#thumbControl').fadeOut(); $('#imageControl').fadeOut(); } else { if ($('#productThumbs').hasClass('filtered')) { $('#productImage li').not($('#productImage li').first()).fadeOut(); $('#productThumbs').css('left', 0); $('#productThumbs li').fadeIn(); $('#productThumbs li:eq(0)').trigger('click'); $('#thumbControl').fadeIn(); $('#imageControl').fadeIn(); } } } else { if ($('#productImage li[data-type="' + elDataId + '"]').length > 0) { $('#productImage li[data-type="' + elDataId + '"]').first().fadeIn().siblings('li').fadeOut(); $('#productImage li[data-type="' + elDataId + '"]').first().addClass('current').siblings('li').removeClass('current'); } } } } var sart1 = element.parents('.variantWrapper').find(otherClass).find('.selected[data-id]').length < 1; var findElement = element.parents('.variantWrapper').find(otherClass).find('[data-id]:not(.passive)'); if (sart1 && findElement.length === 1) { if (findElement.is('option')) { findElement.parent().val(findElement.attr('data-id')); findElement.parent().trigger('change'); } else { findElement.trigger('click'); } } if (variantId > 0) { var href = $('#paymentTab').attr('data-href') || ''; href = href.replace(/\/[\d\s]*?$/g, '/' + variantId); $('#paymentTab').attr('data-href', href); if ($('#paymentTab').hasClass('loaded') && parseFloat(arr.variant_prices[priceKey]) > 0) { $('#paymentTab').removeClass('loaded').trigger('click'); } } if (typeof PersonalizationForm != 'undefined' && PersonalizationForm.instance) { var pistance = PersonalizationForm.instance['p' + prId] || PersonalizationForm.instance.productDetail; pistance.calculate(); } if(typeof multipleDiscount == "function"){ $(".qtyBtns input").change(); } } $(document).ready(function() { if (window.location.href.indexOf('?activation=') > 0) { var activationType = window.location.href.replace(/^.*?activation=(\w+).*?$/ig, '$1'); switch (activationType) { case 'newsletter': var token = window.location.href.replace(/^.*&token=(\w+).*?$/ig, '$1'); $.ajax({ url: '/srv/service/guest/activateSubscription/' + token, type: 'POST', dataType: 'json', success: function(result) { if (result.status === 1) { var msgPopup = new Message({ id: 'msgPopup', html: result.statusText, width: 500, openingCallback: function() { }, closingCallback: function() { if (typeof TSOFT_APPS.other.subscribe !== 'undefined' && TSOFT_APPS.other.subscribe.length > 0) { for(let i=0; i < TSOFT_APPS.other.subscribe.length; i++){ if(typeof TSOFT_APPS.other.subscribe[i] === 'function'){ try { TSOFT_APPS.other.subscribe[i](result); } catch (error) { console.log(`Err => ${error}`); } } } }else { console.log('subscribe function'); } } }); msgPopup.flexbox(); msgPopup.show(); } } }); break; case 'membership': var memberId = window.location.href.replace(/^.*&id=(\w+).*?$/ig, '$1'); var token = window.location.href.replace(/^.*&token=(\w+).*?$/ig, '$1'); $.ajax({ url: '/srv/service/customer/activateMembership/' + memberId + '/' + token, type: 'POST', dataType: 'json', success: function(result) { if (result.status === 1) { Message.showDialog(result.statusText, 350); history.pushState('', '', '/'); } } }); break; case 'facebook': $.get('/srv/service/content/get/1008/facebook-email', function(content) { Message.showDialog(content, 400); }); break; case 'facebookphone': $.get('/srv/service/content/get/1008/facebook-phone', function(content) { Message.showDialog(content, 400); }); break; case 'twitter': $.get('/srv/service/content/get/1008/twitter-email', function(content) { Message.showDialog(content, 400); }); break; case 'googlephone': $.get('/srv/service/content/get/1008/google-phone', function(content) { Message.showDialog(content, 400); }); break; case 'social': let params = new URLSearchParams(window.location.search); let platform = params.get('platform'); let fields = params.get('fields'); $.get('/srv/service/content/get/1008/social?platform='+platform+'&fields='+fields, function(content) { Message.showDialog(content, 400); }); break; } } if ($('#mainMenu').length) { var offset = $('#mainMenu').offset(); var windowScroll; $(window).scroll(function() { windowScroll = $(window).scrollTop(); if (windowScroll > offset.top) { $('#backToTop').fadeIn(); if (typeof scrollShowCallback === 'function') { scrollShowCallback(); } } else { $('#backToTop').fadeOut(); if (typeof scrollHideCallback === 'function') { scrollHideCallback(); } } }); } $('#backToTop').click(function() { $('html, body').animate({ scrollTop: 0 }, 500); }); $('.language').change(function() { var val = $(this).val(); setLanguage(val); }); $('.currency').change(function() { var val = $(this).val(); setCurrency(val); }); $('#menuBtn').click(function() { $('#mainWrapper').addClass('menuShow animate'); $('#mobileMenu').addClass('animate'); }); $('#pageOverlay, #closeMobileMenu').click(function() { $('#mainWrapper').removeClass('menuShow'); setTimeout(function() { $('#mainWrapper').removeClass('animate'); $('#mobileMenu').removeClass('animate'); }, 500); }); $('#mobileMenu span').click(function() { $(this).toggleClass('active'); $(this).next('ul').slideToggle(); }); $('.angularTemplate').each(function() { $(this).angularTemplate(); }); $('.newsletterMain').keydown(function(e, c, t) { if (e.keyCode == 13) saveMaillist(e); }); $('.subscribe').on('click', saveMaillist); var saveMaillist; saveMaillist.callBack = undefined; function saveMaillist(btn) { btn = btn ? $(btn.target) : (btn != undefined ? $(btn) : $('.subscribe')); var ct = btn.parents('.newsletterMain'); var data = {}; if (ct.find('.sub-name').length > 0) { data['name'] = ct.find('.sub-name').val() ? ct.find('.sub-name').val() : $('.sub-name').val(); } if (ct.find('.sub-surname').length > 0) { data['surname'] = ct.find('.sub-surname').val() ? ct.find('.sub-surname').val() : $('.sub-surname').val(); } if (ct.find('.sub-phone').length > 0) { data['phone'] = ct.find('.sub-phone').val() ? ct.find('.sub-phone').val() : $('.sub-phone').val(); } if (ct.find('.sub-email').length > 0) { data['email'] = ct.find('.sub-email').val() ? ct.find('.sub-email').val() : $('.sub-email').val(); } if (ct.find('.sub-gender').length > 0) { data['gender'] = ct.find('.sub-gender').val() ? ct.find('.sub-gender').val() : $('.sub-gender').val(); } if (ct.find('.sub-kvkk').length > 0) { data['kvkk'] = 0; if (ct.find('.sub-kvkk').is(':checked')) { data['kvkk'] = 1; } else if ($(".sub-kvkk").is(":checked")) { data['kvkk'] = 1; } } $(".newsletter .subscribe img").remove(); $(".newsletter .subscribe").append(''); if ($("#newsletter_captcha_active").val() != 1) { return saveMailAjax(data, ct); } var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; if (re.test(data['email']) === false) { tooltip.show(ct.find('.sub-email'), LANG.get('check_mail'), 2000, 'btn-danger'); return false; } var _instance = new Message({ id: 'nw_c', html: $("#newsletter_hidden_captcha").clone().prop('style', '').prop('id', 'newsletter_captcha')[0].outerHTML, width: 375, buttons: [{ text: LANG.get('send'), click: function() { if ($("#newsletter_captcha #security_code").val().trim() == '') { return false; } data['security_code'] = $("#newsletter_captcha #security_code").val(); saveMailAjax(data, ct); return false; } }] }); _instance.show(); } function saveMailAjax(data, form) { $.ajax({ type: 'POST', url: '/srv/service/guest/subscribeNewsletter', data: data, dataType: 'json', success: function(result) { if (result.status === 0 && result.key != '') { if (result.key == 'security_code') { return alert(result.statusText); } var element = form.find('.' + result.key); if (element.length > 0) { tooltip.show(element, result.statusText, 2000, 'btn-danger'); var pos = element.offset().top - 100; $('html, body').animate({ scrollTop: pos }, 800); } else { Message.debug(result.statusText + '(' + result.key + ')'); } return false; } else { Message.instance.activePopup.close(); Message.showDialog(result.statusText, 360); } } }); } $(document).on('click', '.popupWin', function(e) { e.preventDefault(); e.stopPropagation(); var _self = $(this); var width = parseInt(_self.attr('data-width')) > 0 ? parseInt(_self.attr('data-width')) : 'auto'; var id = typeof _self.attr('data-id') === 'undefined' ? 'myPopupWin' : _self.attr('data-id'); var url = _self.attr('data-url') || ''; var focus = _self.attr('data-focus') || ''; var buttonText = _self.html(); var waitingText = typeof _self.attr('data-waiting-text') === 'undefined' ? buttonText : _self.attr('data-waiting-text'); var dataCallback = typeof _self.attr('data-callback') === 'undefined' ? false : _self.attr('data-callback'); T_Button.dom = $(e.target); T_Button.loadingText = LANG.get('waiting', 'Bekleyiniz..'); T_Button.lock(); $.get(_self.attr('data-url'), function(msg) { var response = {}; if (msg.length > 0 && msg[0] === '{') { try { response = JSON.parse(msg); } catch (err) { console.log(err); } } var _instance = new Message({ id: id, focus: focus, title: 'Dialog', url: url, param: url.replace(/^.*\//g, ''), html: response.statusText || msg || '', width: width, openingCallback: function () { if (dataCallback && typeof window[dataCallback] == 'function') { window[dataCallback](); } } }); _instance.show(); _self.html(buttonText); T_Button.unlock(); }); return false; }); $(document).on('click', '.close', function(e) { e.preventDefault(); var parent = $(this).parents('.pWin'); var id = $(this).parents('.pWrapper').find('.pWin').attr('id') || 'activePopup'; if (typeof Message.instance[id] === 'object') { Message.instance[id].close(); } else { $('body').css({ 'overflow': 'visible', 'position': 'static' }).removeClass('popupActive'); $(this).parents('.pWrapper').remove(); } }); $(document).on('click', '.logout', function(e) { e.preventDefault(); $.get('/srv/service/customer/logout', function() { window.location.href = '/'; }); }); $(document).on('click', '.login', function(e) { e.preventDefault(); var loginType = 'email'; var prefix = $(this).attr('data-prefix') || ''; var vendor = $(this).attr('data-vendor') || 0; var cb = $(this).attr('data-callback') || 'rastgelebirfonksionadi'; var selectedLoginType = (prefix != '') ? ($('#' + prefix + 'login-type').length == 1 ? $('#' + prefix + 'login-type') : $('#login-type')) : $('#login-type'); if (selectedLoginType.length == 1) { loginType = $(selectedLoginType).find('li.active').attr('data-type'); } if ($(this).attr('data-vendorcode') == "1") { loginType = 'vendor-code'; } var options = { type: loginType, prefix: prefix, vendor: vendor, callback: typeof window[cb] === 'function' ? window[cb] : function() { console.log('data-callback tanımlı değil'); } }; MemberLogin(options); }); $(document).on('click', '.Add2Cart', function(e) { e.preventDefault(); var attrs = { productId: 'data-product-id', variantId: 'data-variant-id', quantity: 'data-quantity', buyNow: 'data-buy-now', relatedProductId: 'data-related-product-id', callbackFn: 'data-callback' }; var options = {}; for (var key in attrs) { options[key] = $(this).attr(attrs[key]) || 0; } if (options.productId < 1) { return Message.debug('Add2Cart elementine data-product-id="{$P.ID}" vs.. şeklinde parametreler veriniz.'); } Add2Cart(options); }); $(document).on('click', '.form-control', function(e) { e.preventDefault(); if (e.target.localName != 'a') { var inputWrap = $(this).find('.input-wrap'); var input = $(this).find('input'); if ($(input).prop("disabled")) { return; } if (inputWrap.hasClass('radio')) { var iname = input.attr('name'); $('input[name="' + iname + '"]').prop('checked', false).closest('.input-wrap').removeClass('active'); input.prop('checked', true); inputWrap.addClass('active'); if ($(this).hasClass('lightBg')) { $('input[name="' + iname + '"]').closest('.form-control').removeClass('darkBg').addClass('lightBg'); $(this).removeClass('lightBg').addClass('darkBg'); } input.trigger('change'); } else if (inputWrap.hasClass('checkbox')) { var newVal = inputWrap.hasClass('active') ? false : true; if (true === newVal) { inputWrap.addClass('active'); if ($(this).hasClass('lightBg')) { $(this).removeClass('lightBg').addClass('darkBg'); } } else { inputWrap.removeClass('active'); if ($(this).hasClass('darkBg')) { $(this).removeClass('darkBg').addClass('lightBg'); } } input.prop('checked', newVal); input.trigger('change'); } } if (e.target.type === 'submit') { $(this).submit(); } }); }); $(document).on('click', '.subOne a[data-id],.subTwo a[data-id]', function(e) { e.preventDefault(); var parentClass = $(this).parents('.subOne').length > 0 ? '.subOne' : '.subTwo'; subProChange($(this), parentClass); }); $(document).on('change', '.subOne select,.subTwo select', function(e) { e.preventDefault(); var parentClass = $(this).parents('.subOne').length > 0 ? '.subOne' : '.subTwo'; subProChange($(this).find('option:selected'), parentClass); }); function HtmlRender(options) { var opt = { selector: '#angular', url: '', callback: function() { }, data: {} }; if (typeof options === 'object' && typeof options.productId !== 'undefined') { for (var i in options) { opt[i] = options[i]; } } else if (arguments.length > 1) { var i = 0; for (var key in opt) { if (i >= arguments.length) { break; } opt[key] = arguments[i]; i++; } } if (Object.keys(opt.data).length > 0) { var template = new Template({ source: opt.selector, destination: opt.selector, assign: opt.data, callback: opt.callback }).display(); } else { $.ajax({ url: opt.url, dataType: 'json', success: function(data) { opt.data = data; var template = new Template({ source: opt.selector, destination: opt.selector, assign: opt.data, callback: opt.callback }).display(); } }); } } var Cart = { callback: { update: null, updateAll: null, delete: null, deleteAll: null, load: [], add: [], }, storageKey : 'Cart' , 'update': function(sessIndex, count, callback) { $.ajax({ url: '/srv/service/cart/update-item/' + sessIndex + '/' + count, dataType: 'json', success: function(result) { if (typeof mobileApp !== 'undefined') { try { mobileApp.changedCartCount(result.totalQuantity); } catch (err) {} } if (typeof webkit !== 'undefined') { try { webkit.messageHandlers.callbackHandler.postMessage(result.totalQuantity); } catch (err) {} } Cart.setStorage('update',result,sessIndex); if (typeof callback === 'function') { callback(result); if (typeof Cart.callback.update === 'function') { Cart.callback.update(result); } } else { Message.showDialog(result.statusText, 500, 300); setTimeout(function() { window.location.reload(); }, 2500); } } }); }, 'updateAll': function(countList, callback) { var param = typeof countList === 'object' ? countList.join('-') : countList; $.ajax({ url: '/srv/service/cart/update/' + param, dataType: 'json', success: function(result) { if (typeof mobileApp !== 'undefined') { try { mobileApp.changedCartCount(result.totalQuantity); } catch (err) {} } if (typeof webkit !== 'undefined') { try { webkit.messageHandlers.callbackHandler.postMessage(result.totalQuantity); } catch (err) {} } if (typeof callback === 'function') { callback(result); if (typeof Cart.callback.updateAll === 'function') { Cart.callback.updateAll(result); } } else { window.location.reload(); } } }); }, 'delete': function(sessIndex, callback) { $.ajax({ url: '/srv/service/cart/delete/' + sessIndex, dataType: 'json', success: function(result) { if (typeof mobileApp !== 'undefined') { try { mobileApp.changedCartCount(result.totalQuantity); } catch (err) {} } if (typeof webkit !== 'undefined') { try { webkit.messageHandlers.callbackHandler.postMessage(result.totalQuantity); } catch (err) {} } Cart.setStorage('delete',result,sessIndex); if (typeof callback === 'function') { callback(result); if (typeof Cart.callback.delete === 'function') { Cart.callback.delete(result); } } else if (typeof window[callback] === 'function') { window[callback](result); if (typeof Cart.callback.delete === 'function') { Cart.callback.delete(result); } } else { window.location.reload(); } } }); }, 'deleteAll': function(callback) { $.ajax({ url: '/srv/service/cart/delete-all/', dataType: 'json', success: function(result) { if (typeof mobileApp !== 'undefined') { try { mobileApp.changedCartCount(0); } catch (err) {} } if (typeof webkit !== 'undefined') { try { webkit.messageHandlers.callbackHandler.postMessage(0); } catch (err) {} } Cart.setStorage('deleteAll'); if (typeof Cart.callback.deleteAll === 'function') { Cart.callback.deleteAll(result); } if (typeof callback === 'function') { callback(result); } else { setTimeout(function() { window.location.reload(); }, 750); } } }); }, setStorage : function(action,response,index){ return false; if(typeof window.localStorage === 'undefined'){ return false; } let storage = window.localStorage.getItem(Cart.storageKey); if(storage === null){ storage = { summary : { }, items : [] }; }else{ storage = JSON.parse(storage); } switch(action) { case 'update': case 'add': if(response.cartProducts === null){ return false; } storage.items = response.cartProducts; storage.summary = { total : response.totalPrice}; break; case 'delete': if(storage.items.length === 0){ return false; } storage.items.splice(index,1); storage.summary.total = response.priceCart; break; case 'deleteAll': storage.items = []; storage.summary = { total : 0}; break; } window.localStorage.setItem(Cart.storageKey,JSON.stringify(storage)); return true; }, getStorage : function(){ let storage = window.localStorage.getItem(Cart.storageKey); if(storage === null){ storage = []; }else{ storage = JSON.parse(storage); } return storage; } }; var QuickViewObj = { callback: { open: [] } }; var PaymentMethods = { callback: { change: [] }, } var customerOrder = { callback: { return: [], cancel: [], } }; function MemberLogin(options) { $.cookie('nocache', 1, { expires: 15 }); MemberLogin.instance = MemberLogin.instance || {}; var opt = { type: 'email', prefix: '', vendor: 0, callback: function() { } }; for (var i in options) { opt[i] = options[i]; } if (opt.type == 'phone') { opt.phone = '#' + opt.prefix + 'phone'; } else { opt.email = '#' + opt.prefix + 'email'; } opt.password = '#' + opt.prefix + 'password'; opt.remember = '#' + opt.prefix + 'remember'; opt.security = '#' + opt.prefix + 'security'; opt.code = '#' + opt.prefix + 'code'; var _this = this; opt.prefix = opt.prefix === '' ? 'deneme' : opt.prefix; MemberLogin.instance[opt.prefix] = _this; MemberLogin.instance[opt.prefix].disabled = MemberLogin.instance[opt.prefix].disabled || 0; if (MemberLogin.instance[opt.prefix].disabled == 1) { return; } MemberLogin.instance[opt.prefix].disabled = 1; var data = { password: $(opt.password).val(), vendor: opt.vendor, security: $(opt.security).val() }; if (typeof $("[name='g-recaptcha-response']").val() !== 'undefined') { data.security = $("[name='g-recaptcha-response']").val(); } var httpsUri = $('.is_https_active:last').val() === 1 ? 'https://' + window.location.host : ''; if (opt.type == 'phone') { var postUrl = httpsUri + '/srv/customer/signin/phone/' + encodeURI($(opt.phone).val().replace(/\ /g, '').replace(/\(/g, '').replace(/\)/g, '')); } else if (opt.type == "vendor-code") { var postUrl = httpsUri + '/srv/customer/signin/vendor-code/' + encodeURI($(opt.email).val()); } else { var postUrl = httpsUri + '/srv/customer/signin/email/' + encodeURI($(opt.email).val()); } $.ajax({ url: postUrl, type: 'POST', data: data, dataType: 'json', success: function(result) { if (result.status == 1) { if (result.favourite) { LocalApi.set('favourite', result.favourite, 30 * 24 * 3600); LocalApi.set('favourite_category', result.favourite_default_category, 30 * 24 * 3600); } if ($(opt.remember).is(':checked')) { if (opt.type == 'phone') { $.cookie('phone', $(opt.phone).val(), { expires: 15 }); } else { $.cookie('email', $(opt.email).val(), { expires: 15 }); } } else { $.cookie('email', "", { expires: 15 }); $.cookie('phone', "", { expires: 15 }); $.cookie('password', "", { expires: 15 }); } } else if ($(opt.code).length > 0) { var s = $(opt.code).attr('src'); s = s.replace(/\?.*?$/g, '?' + new Date().getTime()); $(opt.code).attr('src', s); if (result.counter >= parseInt($(opt.code).attr('data-limit'))) { $(opt.code).parents('.form-control:first').show(); } } var options = opt; opt.callback(result, options); setTimeout(function() { MemberLogin.instance[opt.prefix].disabled = 0; }, 50); }, error: function() { MemberLogin.instance[opt.prefix].disabled = 0; } }); } function getLanguage() { var allowedLang = ['tr', 'en', 'az', 'ru', 'de', 'bs', 'ar', 'el', 'fa', 'fr']; var lang = 'tr'; if (typeof window.LANGUAGE === 'string' && allowedLang.indexOf(window.LANGUAGE) > 0) { lang = window.LANGUAGE; } else { $.ajax({ url: '/conn/user/language/getLanguage', async: false, success: function(msg) { msg = msg.replace(/\W/ig, ''); if (msg.length > 1 || msg.length < 4) { lang = msg; } } }); if (allowedLang.indexOf(lang) < 0) { lang = 'tr'; } } return lang; } function RegionLoader(options) { var selectedCountry = ''; var opt = { country: { selector: '.country:last', value: 'TR' }, city: { selector: '.city:last', value: '' }, town: { selector: '.town:last', value: '' }, district: { selector: '.district:last', value: '' }, countryLimit: true }; for (var i in options) { opt[i] = options[i]; } opt.country.value = opt.country.value || ''; opt.city.value = opt.city.value || ''; opt.town.value = opt.town.value || ''; opt.district.value = opt.district.value || ''; this.get = function(key) { return opt[key]; }; this.set = function(key, val) { opt[key] = val; return true; }; function loadCountries() { if ($(opt.country.selector).length < 1) { var v = opt.country.value; loadCities(); return false; } $.ajax({ url: getEndpoint('COUNTRY', opt.countryLimit ? '0' : '1'), dataType: 'json', success: function(result) { var options = ''; for (var i = 0; i < result.countries.length; i++) { var row = result.countries[i]; options += ''; } $(opt.country.selector).find('option:not(:first)').remove(); $(opt.country.selector).append(options); if (result.countries.length == 1) { opt.country.value = result.countries[0].code; } if (opt.country.value === '') { opt.country.value = result.selected || 'TR'; } if ($(opt.country.selector).find('option[value="' + opt.country.value + '"]').length > 0) { $(opt.country.selector).val(opt.country.value); } $(opt.country.selector).trigger('change'); } }); } function loadCities(parentCode) { parentCode = parentCode || 'TR'; if ($(opt.city.selector).length < 1) { return false; } $.ajax({ url: getEndpoint('REGION_V4', 'get-cities/' + parentCode), dataType: 'json', success: function(result) { if (result.cities.length > 0) { $('[name=city]').parent().hide(); $(opt.city.selector).parent().show(); } else { $('[name=city]').parent().show(); $('[name=city]').val(''); $(opt.city.selector).parent().hide(); loadTowns(""); } var smallCode = parentCode.toLowerCase(); if (['us', 'cn', 'de', 'ru', 'gb', 'in', 'es'].indexOf(smallCode) < 0) { $('[name=province]').parents('.form-control:first').hide(); } else { $('[name=province]').parents('.form-control:first').show(); } var options = ''; for (var i = 0; i < result.cities.length; i++) { var row = result.cities[i]; options += ''; } $(opt.city.selector).find('option:not(:first)').remove(); $(opt.city.selector).append(options); if ($(opt.city.selector).find('option[value="' + opt.city.value + '"]').length > 0) { $(opt.city.selector).val(opt.city.value); $(opt.city.selector).trigger('change'); opt.city.value = ''; } } }); } function loadTowns(parentCode) { if ($(opt.town.selector).length < 1) { return false; } $.ajax({ url: getEndpoint('REGION_V4', 'get-towns/' + parentCode), dataType: 'json', success: function(result) { var options = ''; for (var i = 0; i < result.towns.length; i++) { var row = result.towns[i]; options += ''; } $(opt.town.selector).find('option:not(:first)').remove(); $(opt.town.selector).append(options); if ($(opt.town.selector).find('option[value="' + opt.town.value + '"]').length > 0) { $(opt.town.selector).val(opt.town.value); opt.town.value = ''; } if (result.towns.length > 0) { $('[name=town]').parent().hide(); $(opt.town.selector).parent().show(); loadDistricts($(opt.town.selector).val()); } else { $('[name=town]').parent().show(); $('[name=town]').val(''); $(opt.town.selector).parent().hide(); } } }); } function loadDistricts(parentCode, cb) { if ($(opt.district.selector).length < 1) { return false; } $.ajax({ url: getEndpoint('REGION_V4', 'get-districts/' + parentCode), dataType: 'json', success: function(result) { if (result.districts.length > 0) { if (opt.district.selector.indexOf('_code') === -1) { opt.district.selector += '_code'; } } else { opt.district.selector = opt.district.selector.replace('_code', ''); } if (result.districts.length > 0) { var options = ''; for (var i = 0; i < result.districts.length; i++) { var row = result.districts[i]; options += ''; } $(opt.district.selector).find('option:not(:first)').remove(); $(opt.district.selector).append(options); if ($(opt.district.selector).find('option[value="' + opt.district.value + '"]').length > 0) { $(opt.district.selector).val(opt.district.value); opt.district.value = ''; } $(opt.district.selector).change(function() { $('#post_code').val($(this).find(':selected').data('postalcode')); }); $('[name=district]').parent().hide(); $(opt.district.selector).parent().show(); } else { $('[name=district_code]').parent().hide(); $('[name=district]').val(''); $(opt.district.selector).parent().show(); } } }); } $(opt.country.selector).change(function() { var v = $(this).val(); loadCities(v); }); $(opt.city.selector).change(function() { var city = $(this).val(); if (city !== '') { loadTowns($(this).val()); } else { $(opt.town.selector).find('option').not(':first').remove(); $('[name=town]').parent().hide(); $(opt.town.selector).parent().show(); } }); $(opt.town.selector).change(function() { loadDistricts($(this).val()); }); loadCountries(); } var tsRegion = function(options) { var opt = { container: '.regions', countryLimit: 1, storeLimit: 0, regionLimit: null, country: { container: '.country-container', select: '.country-select', value: '', caption: '' }, state: { container: '.state-container', select: '.state-select', selectContainer: '.state-select-container', input: '.state-input', inputContainer: '.state-input-container', value: '', caption: '' }, city: { container: '.city-container', select: '.city-select', selectContainer: '.city-select-container', input: '.city-input', inputContainer: '.city-input-container', value: '', caption: '' }, town: { container: '.town-container', select: '.town-select', selectContainer: '.town-select-container', input: '.town-input', inputContainer: '.town-input-container', value: '', caption: '' }, district: { container: '.district-container', select: '.district-select', selectContainer: '.district-select-container', input: '.district-input', inputContainer: '.district-input-container', value: '', caption: '' } }; if (typeof options == "object") { for (var i in options) { if (typeof options[i] == "object") { for (var j in options[i]) { opt[i][j] = options[i][j]; } } else { opt[i] = options[i]; } } } $('.district-select').on('change', function () { let postalCode = $(this).find(':selected').data('postalcode'); $('#post_code').val(postalCode); }); this.c = opt; this.l = { country: [], state: [], city: [], town: [], district: [] }; this.v = { country: opt.country.value || "", state: opt.state.value || "", city: opt.city.value || "", town: opt.town.value || "", district: opt.district.value || "" }; this.vc = { country: opt.country.caption || "", state: opt.state.caption || "", city: opt.city.caption || "", town: opt.town.caption || "", district: opt.district.caption || "" }; this.mapSTypes = { country: 'U', state: 'E', city: 'S', town: 'I', district: 'M' }; var that = this; this.ajax = function(url, rf, data) { $.ajax({ url: url, method: 'POST', data: data, success: rf, dataType: "json", error: rf }); }; this.getCountry = function(code) { for (var i in that.l.country) { if (that.l.country[i].code == code) { var item = that.l.country[i]; item.has_state = item.has_state == 1; return item; } } }; this.loadCountries = function() { var rf = function(result) { if (result.countries) { if(opt.countryLimit){ result.countries = result.countries.filter(function(item){ return !MEMBER_INFO.E_COUNTRY || item.code == MEMBER_INFO.E_COUNTRY }); } that.l.country = result.countries; var ob = $(that.c.country.select, $(that.c.container)), cExists = false; ob.html(""); $.each(result.countries, function(i, item) { ob.append(""); if (item.code == that.v.country) { cExists = true; } }); if (that.v.country == "" || !cExists) { if (result.countries && result.countries.length && result.countries.length == 1) { that.v.country = result.countries[0].code; } else if (result.selected && that.getCountry(result.selected)) { that.v.country = result.selected; } else if (that.getCountry("TR")) { that.v.country = "TR"; } else if (result.countries.length > 0) { that.v.country = result.countries[0].code; } } ob.val(that.v.country); that.loadStates(); } else { } }; that.ajax(getEndpoint('COUNTRY', '1'), rf); }; this._loadRegion = function(what, parent) { that._reset(what); var rf = function(result) { var items = result && result.data ? result.data : []; that.l[what] = items; that._render(what, items); }; if (!parent) { rf(); } else { var data = { storeLimit: opt.storeLimit }; switch (what) { case 'country': break; case 'state': data.U = that.v.country; break; case 'city': data.U = that.v.country; data.E = that.v.state; break; case 'town': data.U = that.v.country; data.E = that.v.state; data.S = that.v.city; break; case 'district': data.U = that.v.country; data.E = that.v.state; data.S = that.v.city; data.I = that.v.town; break; } var lmt = opt.regionLimit != null ? opt.regionLimit : (opt.countryLimit ? "1" : "0"); that.ajax(getEndpoint('REGION', this.mapSTypes[what] + '/' + parent + '/' + lmt), rf, data); } }; this.loadStates = function() { $(that.c.state.container, $(that.c.container)).hide(); that._reset("state"); var c = that.getCountry(that.v.country) || {}; if (!c.has_state) { that.loadCities(); return; } $(that.c.state.container, $(that.c.container)).show(); that._loadRegion("state", that.v.country); }; this.loadCities = function() { var c = that.getCountry(that.v.country) || {}; var pc = c.has_state ? that.v.state : that.v.country; that._loadRegion("city", pc); }; this.loadTowns = function() { that._loadRegion("town", that.v.city); }; this.loadDistricts = function() { that._loadRegion("district", that.v.town); }; this._render = function(what, data) { if (data.length == 0) { $(that.c[what].selectContainer, $(that.c.container)).hide(); $(that.c[what].inputContainer, $(that.c.container)).show(); $(that.c[what].input, $(that.c.container)).val(that.vc[what]); } else { $(that.c[what].selectContainer, $(that.c.container)).show(); $(that.c[what].inputContainer, $(that.c.container)).hide(); var ob = $(that.c[what].select, $(that.c.container)); var rCodes = []; ob.html(""); $.each(data, function(i, item) { ob.append(''); rCodes.push(item.code); }); if (rCodes.indexOf(that.v[what]) == -1) { that.v[what] = ''; switch (what) { case 'state': that.v.city = ''; that.v.town = ''; that.v.district = ''; break; case 'city': that.v.town = ''; that.v.district = ''; break; case 'town': that.v.district = ''; break; } if (rCodes.length == 1) { ob.val(rCodes[0]).change(); return; } } else { ob.val(that.v[what]); } } switch (what) { case 'state': that.loadCities(); break; case 'city': that.loadTowns(); break; case 'town': that.loadDistricts(); break; } }; this._reset = function(type) { var obs = {}, $typeIdx = 0, $totalIdx = 4; obs[1] = that.c.state; obs[2] = that.c.city; obs[3] = that.c.town; obs[4] = that.c.district; switch (type) { case 'state': $typeIdx = 1; break; case 'city': $typeIdx = 2; break; case 'town': $typeIdx = 3; break; case 'district': $typeIdx = 4; break; } for (var i = $typeIdx; i <= $totalIdx; i++) { $(obs[i].select, $(that.c.container)).html(""); $(obs[i].input, $(that.c.container)).val(""); $(obs[i].selectContainer, $(that.c.container)).hide(); $(obs[i].inputContainer, $(that.c.container)).show(); } }; this._listener = function() { var rs = ["state", "city", "town", "district"]; $(that.c.country.select, $(that.c.container)).change(function() { that.v.country = $(this).val(); for (i = 0; i < rs.length; i++) { that.vc[rs[i]] = ''; that.v[rs[i]] = ''; } that.loadStates(); }); $(that.c.state.select, $(that.c.container)).change(function() { that.v.state = $(this).val(); for (i = 1; i < rs.length; i++) { that.vc[rs[i]] = ''; that.v[rs[i]] = ''; } that.loadCities(); }); $(that.c.city.select, $(that.c.container)).change(function() { that.v.city = $(this).val(); for (i = 2; i < rs.length; i++) { that.vc[rs[i]] = ''; that.v[rs[i]] = ''; } that.loadTowns(); }); $(that.c.town.select, $(that.c.container)).change(function() { that.v.town = $(this).val(); for (i = 3; i < rs.length; i++) { that.vc[rs[i]] = ''; that.v[rs[i]] = ''; } that.loadDistricts(); }); $(that.c.district.select, $(that.c.container)).change(function() { that.v.district = $(this).val(); }); $(that.c.state.input, $(that.c.container)).keyup(function() { that.vc.state = $(this).val(); }); $(that.c.city.input, $(that.c.container)).keyup(function() { that.vc.city = $(this).val(); }); $(that.c.town.input, $(that.c.container)).keyup(function() { that.vc.town = $(this).val(); }); $(that.c.district.input, $(that.c.container)).keyup(function() { that.vc.district = $(this).val(); }); }; this._listener(); this.loadCountries(); }; var multiCart = false; var errorMessages = []; var errorHtml = ''; var multiCartItem = null; function showCartError(errorHtml) { setTimeout(function() { Message.showDialog(errorHtml); }, 1000); } function AddToShoppingList(subId = 0, key, e) { if (subId == 1) subId = 0; FavouriteApi.add(subId, key, e); } function AddToCollectionList(subId = 0, key, e) { if (subId == 1) subId = 0; if (IS_FAV == 1) { $.get('/srv/service/content/get/1014/collection/' + key + '-' + subId, function(content) { Message.showDialog(content, 580); }); } else { $.get('/srv/service/content/get/1014/popup/' + key + '-' + subId, function(content) { Message.showDialog(content, 580); }); } }; function Add2Cart(options) { $.cookie('nocache', 1, { expires: 15 }); //varnish Add2Cart.instance = this; Add2Cart.callBack = Add2Cart.callBack || function(row) {}; var opt = { productId: 0, variantId: 0, quantity: 0, buyNow: 0, relatedProductId: '', multi: 0, beforeHtml: '', afterHtml: '', callbackFn: null }; if (typeof options === 'object' && typeof options.productId !== 'undefined') { for (var i in options) { opt[i] = options[i]; } } else if (arguments.length > 1) { var i = 0; for (var key in opt) { if (i >= arguments.length) { break; } opt[key] = arguments[i]; i++; } } this.get = function(key) { return opt[key]; }; this.set = function(key, val) { opt[key] = val; return true; }; var post = { productId: opt.productId, variantId: opt.variantId, quantity: opt.quantity, relatedProductId: opt.relatedProductId, orderNotes: $("#order-note" + opt.productId).length > 0 ? $("#order-note" + opt.productId).val() : '', subscribe: $("#product-subscribe-" + opt.productId + ":checked").length == 1 ? 1 : 0, subscribeFrequency: $("#product-subscribe-" + opt.productId + ":checked").length == 1 ? $("#product-subscribe-frequency-" + opt.productId).val() : "", csrfToken: window.CART_CSRF_TOKEN || '' }; if (typeof PersonalizationForm !== 'undefined' && PersonalizationForm.active === true) { var p = PersonalizationForm.instance['p' + opt.productId] || PersonalizationForm.instance.productDetail || PersonalizationForm.instance.activeForm; if (parseInt(p.get('product_id')) === parseInt(opt.productId)) { if (p.validate() === false) { return false; } post.formData = p.getFormData(); } } var addToCartDom = $("#addCartBtn"); if (addToCartDom.length > 0) { var addToCartEvent = addToCartDom.attr('onclick'); addToCartDom.prop('onclick', null).off('click'); } var releatedPopup = false; if (typeof getVar === 'function' && getVar('releated') !== '') { var refProduct = atob(getVar('releated')).split('-'); try { var refProductId = parseInt(refProduct[0]); if (refProductId > 0) { var refSubProductId = refProduct[1] ? refProduct[1] : 0; post.relatedProductId = refProductId + "+':'+" + refSubProductId; releatedPopup = true; } } catch (e) { console.log(e); } } $.ajax({ url: '/srv/service/cart/add-to-cart', type: 'POST', data: post, dataType: 'json', success: function(obj) { Add2Cart.callBack(obj); if (obj.status > 0 || (Array.isArray(obj) && obj[0].status > 0)) { if (Array.isArray(obj)) { $('.cart-soft-count').text(obj[obj.length - 1].totalQuantity); $('.cart-soft-price').text(obj[obj.length - 1].totalPrice); } else { $('.cart-soft-count').text(obj.totalQuantity); $('.cart-soft-price').text(obj.totalPrice); } Cart.setStorage('add',obj); $('#basketList').remove(); if (typeof options.callbackFn === 'string' && typeof window[options.callbackFn] === 'function') { return window[options.callbackFn](); } } if (multiCart) { $.each(obj, function() { if (this.status < 1) { errorMessages.push(this); } else { multiCartItem = this; if (multiCartItem.status > 0) { for (var i = 0; i < Cart.callback.add.length; i++) { if (typeof Cart.callback.add[i] === 'function') { Cart.callback.add[i](multiCartItem); } } } } }); if (multiCartItem != null) { switch (multiCartItem.status) { case 1: closeVariant(); autoCart = false; break; case 2: closeVariant(); autoCart = false; window.location.href = multiCartItem.url; break; case 3: closeVariant(); autoCart = false; var cartPopup = new Message({ id: 'cartPopup', html: multiCartItem.content, width: 1000, openingCallback: function() { if (typeof openingCartCallback === 'function') { openingCartCallback(); } }, closingCallback: function() { if (typeof openingCartCallback === 'function') { closingCartCallback(); } } }); cartPopup.flexbox(); cartPopup.show(); break; } multiCartItem = null; } if (errorMessages.length > 0) { $.each(errorMessages, function() { errorHtml = errorHtml + this.statusText + ': ' + this.title + '
    '; }); showCartError(errorHtml); } errorMessages = []; errorHtml = ''; } else { if (obj.status > 0 || (Array.isArray(obj) && obj[0].status > 0)) { for (var i = 0; i < Cart.callback.add.length; i++) { if (typeof Cart.callback.add[i] === 'function') { Cart.callback.add[i](obj); } } } switch (obj.status) { case -1: //Hatalı alt ürün seçimi autoCart = true; var vOverlay = $('.variantOverlay[data-id="' + opt.productId + '"]'); var vBox = vOverlay.parent().find('.variantBox'); var oBox = vOverlay.parent().find('.optionBox'); if (vBox.length === 0 && oBox.length === 0 && obj.url != '') { if (PAGE_TYPE !== 'product') { window.location.href = "/" + obj.url; return false; } else if ($('#link_table_id').val() != opt.productId) { window.location.href = "/" + obj.url; return false; } } $('.variantOverlay[data-id="' + opt.productId + '"]').parent().addClass('error'); $('.variantOverlay[data-id="' + opt.productId + '"]').eq(0).fadeIn(250); tooltip.show($('.error .variantWrapper'), obj.statusText, false, 'btn-danger'); $('body').keydown(function(e) { if (e.keyCode == 27) { closeVariant(); } }); $('.variantOverlay').click(function() { closeVariant(); }); break; case 0: closeVariant(); autoCart = false; Message.showDialog(obj.statusText, 600); break; case -2: autoCart = false; $.get('/srv/service/content/get/1110/set-location/' + opt.productId + '-' + opt.variantId + '-' + opt.quantity, function(content) { Message.showDialog(content, 500); $("#setLocationContainer .warning-message").text(obj.statusText).show(); }); break; case 1: closeVariant(); autoCart = false; if (opt.buyNow === 0) { $('[data-buy-id="' + options.productId + '"]').fadeOut(100); setTimeout(function() { $('[data-buy-id="' + options.productId + '"]').html(options.beforeHtml).fadeIn(100); setTimeout(function() { $('[data-buy-id="' + options.productId + '"]').fadeOut(100); setTimeout(function() { $('[data-buy-id="' + options.productId + '"]').html(options.afterHtml).fadeIn(100); }, 100); }, 3000); }, 100); } else { location.href = '/' + PAGE_LINK.CART; } break; case 2: closeVariant(); autoCart = false; window.location.href = obj.url; break; case 3: closeVariant(); autoCart = false; if (opt.buyNow === 0) { if (parseInt(post.relatedProductId) > 0 && releatedPopup === false && $('#basketWin').length > 0) { $('#basketWin').angularTemplate(); } else { $('[data-buy-id="' + options.productId + '"]').fadeOut(100); setTimeout(function() { $('[data-buy-id="' + options.productId + '"]').html(options.beforeHtml).fadeIn(100); var cartPopup = new Message({ id: 'cartPopup', html: obj.content, width: 1000, openingCallback: function() { if (typeof openingCartCallback === 'function') { openingCartCallback(); } }, closingCallback: function() { if (typeof openingCartCallback === 'function') { closingCartCallback(); } } }); cartPopup.flexbox(); cartPopup.show() setTimeout(function() { $('[data-buy-id="' + options.productId + '"]').fadeOut(100); setTimeout(function() { $('[data-buy-id="' + options.productId + '"]').html(options.afterHtml).fadeIn(100); }, 100); }, 3000); }, 100); } } else { location.href = '/' + PAGE_LINK.CART; } break; } } }, complete: function() { if (addToCartDom.length > 0) { setTimeout(function() { addToCartDom.on('click', function() { if (typeof addToCartEvent !== 'undefined') { eval(addToCartEvent); } }); }, 1000); } $('#cartDetail.angularTemplate').angularTemplate(); } }); } function FormLoader(options) { var opt = { selector: 'form:last', url: '', callback: function() { } }; for (var i in options) { opt[i] = options[i]; } $.ajax({ url: opt.url, dataType: 'json', success: function(result) { var myForm = $(opt.selector); for (var key in result) { var val = result[key]; if (val === null) { continue; } var input = myForm.find('[name="' + key + '"]'); if (input.length > 0) { if (input.attr('type') === 'checkbox' || input.attr('type') === 'radio') { var propVal = (result[key] == input.val() || parseInt(result[key]) === 1) ? false : true; if (!propVal) { input.prop('checked', propVal); input.parents('.form-control:first').trigger('click'); } } else { if (input.val() === '' || typeof input.val() === "undefined") { if (typeof result[key] !== 'undefined' || result[key] !== '' || result[key] !== null) { input.next('.placeholder').addClass('focus'); } input.val(result[key]); } } } } opt.callback(result); } }); } function Message(options) { Message.instance = Message.instance || {}; Message.counter = Message.counter || 0; var opt = { id: 'popup' + Message.counter, param: '', url: '', html: '', timeout: 3500, width: 'auto', height: 'auto', handler: '', openingCallback: function() { }, closingCallback: function() { }, buttons: [], openingEffect: 'drop', openingEffectTime: 600, openingEasing: 'easeOutBack', closingEffect: 'tsoftBottom', closingEffectTime: 600, closingEasing: 'swing', selector: '#popup' + Message.counter, disableClose: false, }; for (var i in options) { opt[i] = options[i]; } opt.selector = '#' + opt.id; this.get = function(key) { return opt[key]; }; this.set = function(key, val) { opt[key] = val; return true; }; var _this = this; if (typeof Message.instance[_this.get('id')] !== 'undefined') { $(_this.get('selector')).parents('.pWrapper').remove(); } Message.instance[_this.get('id')] = _this; Message.instance.activePopup = _this; Message.showDialog = function(html, width, height, disableClose) { var count = Object.keys(Message.instance).length + 1; var _setting = { id: 'myPopup' + count, selector: '#myPopup' + count, html: html, width: width > 100 ? width : 'auto', height: height > 0 ? height : 'auto', openingCallback: function() { $('body').addClass('flexPopup'); }, closingCallback: function() { $('body').removeClass('flexPopup'); }, disableClose: disableClose, }; var _instance = new Message(_setting); _instance.show(); }; Message.debug = function(html, width, timeout) { var count = Object.keys(Message.instance).length + 1; var t = timeout > 1000 ? timeout : 3500; var _setting = { id: 'myPopup' + count, selector: '#myPopup' + count, html: html, width: width > 100 ? width : 400 }; var _instance = new Message(_setting); _instance.show(true); setTimeout(function() { _instance.close(); $('body').removeClass('flexPopup'); }, t); }; function getButtonsHtml() { if (opt.buttons.length < 1) { return ''; } var returnHtml = ''; for (var i = 0; i < opt.buttons.length; i++) { var b = opt.buttons[i]; var cls = b['class'] || 'btn-success fr'; var text = b['text'] || 'Kapat'; var attr = b['attr'] || ''; returnHtml += ''; } return returnHtml; } this.fixHeight = function() { var maxH = $('.pWin:last').innerHeight(); var contentHeight = $('.pText:last').innerHeight(); var contentWidth = $('.pText:last').width(); if (contentHeight > maxH) { $('.pWin:last').addClass('overflow').width(contentWidth); } }; this.close = function(selector) { if (opt.disableClose == true) return; var selector = $(_this.get('selector')).parents('.pWrapper'); selector.fadeOut(400, function() { selector.remove(); $('body').css({ 'overflow': 'visible', 'position': 'static' }).removeClass('popupActive'); opt.closingCallback(); }); }; var overflowStatus = ''; this.overflow = function() { overflowStatus = ' overflow '; }; var flexboxCls = ''; this.flexbox = function() { flexboxCls = ' flexbox '; }; this.show = function(debugActive) { var debugClass = debugActive === true ? 'debugActive' : ''; var id = _this.get('id'); var h = _this.get('height') + 'px'; var w = parseInt(_this.get('width')) > 0 ? _this.get('width') + 'px' : 'auto'; var l = 'margin:0 auto;'; var content = _this.get('html'); var div = $('
    ').html(content); content = content.replace(/\{\{param\}\}/g, _this.get('param')); var z = Message.counter * 3 + 9980; var html = ''; $('body').append(html); var focus = _this.get('focus') || ''; if (focus !== '') { setTimeout(function() { $('#' + focus).focus(); }, 1000); } if (content.indexOf('angularTemplate') === -1) { var maxW = Math.max($(window).width(), $('body').width()); var maxH = $('.pWin:last').height(); var contentHeight = $('.pText:last').height(); var contentWidth = $('.pText:last').width(); if (contentHeight > maxH) { $('.pWin:last').addClass('overflow').width(contentWidth); } } var buttonsHtml = getButtonsHtml(); buttonsHtml = buttonsHtml === '' ? '' : '
    ' + buttonsHtml + '
    '; if (buttonsHtml !== '') { $('.pWin:last').addClass('withBtn').append(buttonsHtml); $('.pWin:last .pButtons button').click(function() { var number = parseInt($(this).attr('data-id')); var buttons = _this.get('buttons'); var b = buttons[number]; var close = true; T_Button.dom = $(this); T_Button.loadingText = LANG.get('waiting'); T_Button.lock(); if (typeof b.click === 'function') { close = b.click(_this); } setTimeout(function() { T_Button.unlock(); }, 400); if (close === false) { return false; } _this.close(); }); } $('.pWrapper:last').css({ visibility: 'visible', display: 'block' }); if (debugActive !== true) { $('body').css({ 'width': '100%', 'overflow': 'hidden', }).addClass('popupActive'); } $('.pWrapper:last').fadeIn(); if (navigator.appVersion.indexOf('Trident') > -1 && navigator.appVersion.indexOf('Edge') == -1) { $('body').addClass('ie'); if (typeof placeCaller === 'function') { placeCaller(); } } opt.openingCallback(); return false; }; }; var Message1 = new Message({}); var LANG = { prefix: 'LANG_', selected_lang: '', cookie_name: 'lang', last_lang_arr: new Array(), lang: {}, run: function(selectedKey) { if (typeof selectedKey !== 'undefined') { LANG.insert([selectedKey]); return true; } for (var key in LANG.last_lang_arr) { if ($('.' + LANG.prefix + key).length > 0) { $('span[class^=' + LANG.prefix + ']').css('color', 'inherit'); $('.' + LANG.prefix + key).addClass('reset'); var replaceArr = LANG.last_lang_arr[key].match(/\|(.*?)\|/ig); if (replaceArr) { //%x% içinde değer varsa, data-x içindeki değeri oraya replace et $('.' + LANG.prefix + key).each(function() { var newText = LANG.last_lang_arr[key]; for (var i = 0; i < replaceArr.length; i++) { var replaceKey = replaceArr[i].replace(/\|/g, ''); if ($('.' + LANG.prefix + key).attr('data-' + replaceKey)) { newText = newText.replace(replaceArr[i], $(this).attr('data-' + replaceKey)); } } $(this).text(newText); }); } else { $('.' + LANG.prefix + key).text(LANG.last_lang_arr[key]); } } } setTimeout(function() { $('span[class^=' + LANG.prefix + ']').css('color', 'inherit'); }, 3000); }, getLang: function(is_load, callback) { if (is_load === true && typeof getCookie(LANG.cookie_name) !== 'undefined' && getCookie(LANG.cookie_name).length === 2) { LANG.selected_lang = getCookie(LANG.cookie_name); if (typeof callback === 'function') { callback(); } } else { $.get('/srv/admin/settings/language/selected-lang', function(msg) { msg = msg.replace(/\W/ig, ''); if (msg.length > 1 && msg.length < 4) { LANG.selected_lang = msg; } else { LANG.selected_lang = 'tr'; } setCookie(LANG.cookie_name, LANG.selected_lang, 1); if (typeof callback === "function") callback(); }); } return LANG.selected_lang; }, load: function(lang_path, callback) { var path = lang_path.replace(/\.js.*$/g, ''); path += lang_path.replace(/^.*(\.js)?(\?.*)?$/g, '.js$2'); try { if (typeof getCookie('cacheTag') !== 'undefined') path += '?cacheTag=' + getCookie('cacheTag'); } catch (ex) { } LANG.selected_lang = LANG.selected_lang.replace(/\W/i, ''); if (LANG.selected_lang.length !== 2) { LANG.getLang(true, function() { var url = '/lang_content/' + LANG.selected_lang + '/' + path; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; $("head").append(script); setTimeout(function() { LANG.run(); if (typeof callback !== 'undefined') callback(); }, 1000); }); } else { var url = '/lang_content/' + LANG.selected_lang + '/' + path; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; $("head").append(script); setTimeout(function() { LANG.run(); if (typeof callback !== 'undefined') callback(); }, 1000); } return true; }, get: function(key, _default) { var _defaultValue = _default || '' + key + ''; return typeof LANG.lang[key] !== 'undefined' ? LANG.lang[key] : _defaultValue; }, set: function(arr) { LANG.last_lang_arr = arr; for (var key in arr) { LANG.lang[key] = arr[key]; } LANG.run(); }, insert: function(arr, iframe) { for (var i = 0; i < arr.length; i++) { var val = typeof LANG.lang[arr[i]] !== 'undefined' ? LANG.lang[arr[i]] : '' + arr[i] + ''; var element; if (typeof iframe === 'undefined') { element = $('.' + arr[i] + ', .' + LANG.prefix + arr[i]); } else { element = $(iframe).contents().find('.' + arr[i] + ', .' + LANG.prefix + arr[i]); } $(element).html(val); element.each(function() { val = typeof LANG.lang[arr[i]] !== 'undefined' ? LANG.lang[arr[i]] : '' + arr[i] + ''; $.each(this.attributes, function() { if (this.specified) { var attrVal = decodeURIComponent(this.value); attrVal = attrVal.replace(/\+/g, ' '); val = val.replace('{' + this.name + '}', attrVal); } }); $(this).html(val); }); } } }; $('.subscribe').click(saveMaillist); var saveMaillist; saveMaillist.callBack = undefined; function saveMaillist(btn) { btn = btn ? $(btn.target) : (btn !== undefined ? $(btn) : $('.subscribe')); var ct = btn.parents('.newsletterMain'); var data = {}; if (ct.find('.sub-name').length > 0) { data['name'] = ct.find('.sub-name').val() ? ct.find('.sub-name').val() : $('.sub-name').val(); } if (ct.find('.sub-surname').length > 0) { data['surname'] = ct.find('.sub-surname').val() ? ct.find('.sub-surname').val() : $('.sub-surname').val(); } if (ct.find('.sub-phone').length > 0) { data['phone'] = ct.find('.sub-phone').val() ? ct.find('.sub-phone').val() : $('.sub-phone').val(); } if (ct.find('.sub-email').length > 0) { data['email'] = ct.find('.sub-email').val() ? ct.find('.sub-email').val() : $('.sub-email').val(); } if (ct.find('.sub-gender').length > 0) { data['gender'] = ct.find('.sub-gender').val() ? ct.find('.sub-gender').val() : $('.sub-gender').val(); } $(".newsletter .subscribe img").remove(); $(".newsletter .subscribe").append(''); $.ajax({ type: 'POST', url: '/srv/service/guest/subscribeNewsletter', data: data, dataType: 'json', success: function(result) { if (result.status === 0) { var element = ct.find('.' + result.key); if (element.length > 0) { tooltip.show(element, result.statusText, 2000, 'btn-danger'); var pos = element.offset().top - 100; $('html, body').animate({ scrollTop: pos }, 800); } else { Message.debug(result.statusText + '(' + result.key + ')'); } return false; } else if (result.status === 1) { Message.instance.activePopup.close(); Message.showDialog(result.statusText, 500); } } }); return false; } function siteAdvice(prId) { $.ajax({ type: 'POST', url: '/srv/service/site/advice', data: { 'email': $("#advice-email").val(), "GonderenAdi": $("#site-tasiye-isim").val(), "GonderenEposta": $("#site-tavsiye-eposta").val(), "AliciAdi": $("#site-alici-adi").val(), "AliciEposta": $("#site-alici-eposta").val(), "Mesaj": $("#site-tavsiye-mesaj").val() }, dataType: 'json', success: function(r) { Message.debug(r.statusText); } }); return false; } var ProductDynamicLoad = { pageNo: 2, pageNoParam: 'Baslan', baseUrl: '.BASE_URL:last', parentDiv: '.UrunKatalogDivIc', productDiv: '.UrunKatalog', loadMoreButton: '.LoadMoreButton', heightEqualDiv: '#katalog', loadMoreStatus: true, scrollLoadStatus: true, loadingStatus: false, loadMore: function() { var p = ProductDynamicLoad; if (p.loadMoreStatus === false) { cLog('Daha fazla ürün yok.";'); $(p.loadMoreButton).hide('slow'); return false; } var params = $(p.baseUrl).val().replace(/.*\?/ig, ''); params = params.replace(/^\&/gi, '').replace(/\&$/gi, ''); var requestLink = window.location.pathname.replace(/^\//ig, ''); params = params + '&' + p.pageNoParam + '=' + p.pageNo + '&link=' + requestLink; p.pageNo++; $.ajax({ url: '/Diger/product_dynamic_load.php?' + params, success: function(data) { var dom = $('
    ').html(data).contents(); var totalProduct = $(dom).find(p.productDiv).length; if (totalProduct === 0) p.loadMoreStatus = false; $(dom).find(p.productDiv).hide().addClass('loadedProduct'); $(p.parentDiv).append($(dom).find(p.productDiv)); $(p.parentDiv).find('.loadedProduct').fadeIn(1000); if (typeof $.fn.lazyload === 'function') $(p.parentDiv).find('.loadedProduct img.lazy').lazyload(); $('.loadedProduct').removeClass('loadedProduct'); $(p.heightEqualDiv).equalizer(); /* dinamik yükleme sonrası boyut eşitleme */ subProListener(); /* dinamik yükleme sonrası altürün */ p.loadingStatus = false; } }); }, check: function() { var p = ProductDynamicLoad; var baseUrl = $(p.baseUrl).val(); if (typeof baseUrl === 'undefined') { cLog('Sayfada BASE_URL bulunamadı. Örnek Kullanım: '); return false; } if ($(p.parentDiv).length < 1) { if (typeof $(p.productDiv).parent().attr('class') === 'undefined') $(p.productDiv).parent().attr('class', 'productDivParent'); p.parentDiv = '.' + $(p.productDiv).parent().attr('class').replace(/^\s*(\w+)\s.*/ig, '$1'); } if ($(p.productDiv).length < 1) { cLog('Parametreler boş bırakılamaz. Örnek Kullanım: '); cLog('ProductDynamicLoad.parentDiv=".UrunKatalogDivIc";'); cLog('ProductDynamicLoad.productDiv=".UrunKatalog";'); cLog('ProductDynamicLoad.run();'); return false; } $(p.heightEqualDiv).equalizer(); if (typeof p.loadMoreButton === 'undefined') cLog('Sayfada "Daha Fazla Yükle" butonu bulunamadı.'); return true; }, scrollLoad: function() { var p = ProductDynamicLoad; var scrollFunc = function(pageY) { var lastProductTop = $(p.productDiv + ':last').offset().top; var scrollTop = $(document).scrollTop(); var diff = 600 + pageY; if (scrollTop + diff > lastProductTop && p.loadingStatus === false) { p.loadingStatus = true; p.loadMore(); } }; $(window).scroll(function() { scrollFunc(0); }); document.body.addEventListener('touchend', function(e) { scrollFunc(parseInt(e.changedTouches[0].pageY)); }, false); }, run: function() { $(document).ready(function() { var p = ProductDynamicLoad; if (p.check() === false) return false; if (p.scrollLoadStatus) p.scrollLoad(); $(p.loadMoreButton).click(p.loadMore); }); } }; function GetCount(ddate, iid) { var _this = this; GetCount.counter = GetCount.counter || 0; if (GetCount.counter == 0) { $.getScript('/srv/service/conf/load/', function() {}); } GetCount.counter++; var get = function() { dateNow = new Date(); //grab current date amount = ddate.getTime() - dateNow.getTime(); //calc milliseconds between dates delete dateNow; if (amount < 0) { document.getElementById(iid).innerHTML = "" + LANG.get('deal_expired') + ""; if (document.getElementById('tsoft_counter_label')) document.getElementById('tsoft_counter_label').innerHTML = ""; } else { days = 0; hours = 0; mins = 0; secs = 0; out = '' + LANG.get('remaining_time') + ' :'; amount = Math.floor(amount / 1000); //kill the "milliseconds" so just secs days = Math.floor(amount / 86400); //days if ($('#' + iid).find('.days')) { $('#' + iid).find('.days').html(days); } amount = amount % 86400; hours = intToClockDigit(Math.floor(amount / 3600)); //hours if ($('#' + iid).find('.hours')) { $('#' + iid).find('.hours').html(hours); } amount = amount % 3600; mins = intToClockDigit(Math.floor(amount / 60)); //minutes if ($('#' + iid).find('.mins')) { $('#' + iid).find('.mins').html(mins); } amount = amount % 60; secs = intToClockDigit(Math.floor(amount)); //seconds if ($('#' + iid).find('.secs')) { $('#' + iid).find('.secs').html(secs); } if (!$('#' + iid).hasClass('splitted') && document.getElementById(iid) != null) { out += '' + days + '' + LANG.get('days') + ''; out += '' + hours + '' + LANG.get('hours') + ''; out += '' + mins + '' + LANG.get('mins') + ''; out += ''; document.getElementById(iid).innerHTML = out; } var x = setTimeout(function() { get(); }, 1000); } }; setTimeout(function() { get(); }, 400); } function intToClockDigit(val) { return (val.toString().length === 1) ? ('0' + val) : val; } function RefreshImage(ImageId, NewImageSrc) { var img = document.getElementById(ImageId); img.src = NewImageSrc + '?' + Math.random(); } function getVar(v) { var q = window.location.search.substring(1); var vs; if (q == "" && (v == "Kid" || v == "Uid" || v == "MarkaId" || v == "ModelId")) { q = window.location.toString(); vs = q.split("/"); q = vs[vs.length - 1]; vs = q.split(","); var regs = new Array(); regs["Kid"] = /\K\d+$/; regs["Uid"] = /\U\d+$/; regs["MarkaId"] = /\M\d+$/; regs["ModelId"] = /\Y\d+$/; for (var i = 0; i < vs.length; i++) { if (regs[v].test(vs[i])) { return vs[i].substr(1); } } } else { vs = q.split("&"); for (var i = 0; i < vs.length; i++) { var p = vs[i].split("="); if (p[0] == v) { return p[1]; } } } return ''; } var baseUrl = getHostUrl(); function getHostUrl() { var scripts = document.getElementsByTagName('script'), path, i, scriptSrc, match; for (i = 0, ln = scripts.length; i < ln; i++) { scriptSrc = scripts[i].src; match = scriptSrc.match(/general\.js$/); if (match) { path = scriptSrc.substring(0, scriptSrc.length - 13); break; } } return path; } var CookieBar = { isActive: false, cookie: 'CookieLaw', titleDom: '.cookieLawTitle', bodyDom: '.cookieLawBody', load: function(cb) { CookieBar.isActive = $("#cookie-law").val() === "1" || false; if (CookieBar.isActive === true && CookieBar.getCookie() !== "1") { CookieBar.getContent(function(r) { if (typeof cb === 'function') { cb(r); } }); } }, setCookie: function(state) { setCookie(CookieBar.cookie, state, 15); }, getCookie: function() { return getCookie(CookieBar.cookie); }, getContent: function(cb) { var tmp; $.ajax({ type: 'GET', url: '/srv/service/site/get-cookie-law', data: {}, success: function(r) { try { tmp = JSON.parse(r); $(CookieBar.titleDom).html(tmp.Title); $(CookieBar.bodyDom).html(tmp.Content); CookieBar.setCookie(1); if (typeof cb === 'function') { cb(tmp); return false; } } catch (e) { console.log(e); return false; } }, }); } }; $(function() { CookieBar.load(function(r) { console.log(r); }); }); var ReturnFormMsgCallback = null; var ApprovePageTracking = { callbackArray: [] }; var LoginPageTracking = { Callback: {}, callbackArray: [] }; var SignPageTracking = { Callback: {} }; var T_Button = {}; T_Button.dom = null; setTimeout(() => { T_Button.loadingText = LANG.get('waiting', 'Bekleyiniz...'); }, 500); T_Button.tmpText = ''; T_Button.lock = function() { if (T_Button.dom.is('input')) { T_Button.tmpText = T_Button.dom.val(); T_Button.dom.attr('disabled', true); T_Button.dom.val(T_Button.loadingText); } else { T_Button.tmpText = T_Button.dom.html(); T_Button.dom.attr('disabled', true); T_Button.dom.html(T_Button.loadingText); } }; T_Button.unlock = function() { T_Button.dom.attr('disabled', false); if (T_Button.dom.is('input')) { T_Button.dom.val(T_Button.tmpText); } else { T_Button.dom.html(T_Button.tmpText); } }; var referererStorage = { hasLocal: 'localStorage' in window && window['localStorage'] !== null, addItem: function() { if (this.hasLocal) { this.addItemStorage(); } else { this.addItemCookie(); } }, hasQueryString: function() { var ref = document.referrer || ""; if (ref == '') { return false; } var a = document.createElement("a"); a.href = ref; var q = ''; var queryString = a.search; var pairs = (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&'); for (var i = 0; i < pairs.length; i++) { var pair = pairs[i].split('='); if (pair[0] == 'q') { q = pair[1]; } } return q != ''; }, addItemStorage: function() { var cReferrer = localStorage.getItem("cReferrer"); var items = []; if (cReferrer !== null) { try { var obj = JSON.parse(cReferrer); } catch (err) { var obj = {}; } if (typeof obj.schedule != "undefined" && Date.now() < obj.schedule && !this.hasQueryString()) { return; } items = obj.items || []; } items.push({ time: parseInt(Date.now() / 1000), uri: document.referrer, page: window.location.href }); this.setItems(items); }, addItemCookie: function() { try { var cReferrer = $.cookie("cReferrer"); } catch (err) { return; } var items = []; if (cReferrer !== null) { try { var obj = JSON.parse(cReferrer); } catch (err) { var obj = {}; } if (typeof obj.schedule != "undefined" && Date.now() < obj.schedule && !this.hasQueryString()) { return; } items = obj.items || []; } items.push({ time: parseInt(Date.now() / 1000), uri: document.referrer }); this.setItems(items); }, getObj: function() { var cReferrer = null; var cReferrerObj = {}; if (this.hasLocal) { cReferrer = localStorage.getItem("cReferrer"); } else { try { cReferrer = $.cookie("cReferrer"); } catch (err) {} } try { cReferrerObj = JSON.parse(cReferrer); } catch (err) {} return cReferrerObj; }, getItems: function() { return this.getObj().items || []; }, setItems: function(items) { var obj = { schedule: Date.now() + (24 * 60 * 60 * 1000), items: items || [] }; this.save(obj); }, save: function(sObj) { if (this.hasLocal) { this.saveStorage(sObj); } else { this.saveCookie(sObj); } }, saveStorage: function(sObj) { localStorage.setItem("cReferrer", JSON.stringify(sObj)); }, saveCookie: function(sObj) { try { $.cookie("cReferrer", JSON.stringify(sObj), { path: '/', expires: 30 }); } catch (err) {} } }; function passwordStrengthControl() { if(window.location.pathname.indexOf('/Y/') > -1 || window.location.pathname.indexOf('/srv/admin') > -1) return; if(typeof MEMBER_INFO.PASSWORD_STRENGTH == 'undefined') return; if(Number(MEMBER_INFO.ID) < 1) return; if(Number(MEMBER_INFO.PASSWORD_STRENGTH) > 6) return; var a = document.createElement('a'); a.href = '#'; a.dataset.url = '/srv/service/content/get-block/1058'; a.dataset.width = '500'; a.dataset.id = 'strength-password'; a.dataset.callback = 'passwordStrengthCallback'; a.className = 'popupWin'; document.body.appendChild(a); a.click(); } function passwordStrengthCallback() { $('#strength-password .pageTitle').next('div').html('
      Lütfen şifrenizi değiştirin.
    • Minimum 10 karakter,
    • 1 Küçük harf,
    • 1 Büyük harf,
    • 0-9 Arasında 1 sayı,
    • .#?!@$%^&*- özel karakter, olmasına dikkat ediniz.
    '); flexPlace(); } $(document).ready(function() { referererStorage.addItem(); FavouriteApi.setButtons(); passwordStrengthControl(); }); $(document).on('click', '.variantList a', function() { if ($(".subProductAlert").length > 0) { $(".subProductAlert").attr('data-url', $(".subProductAlert").attr('data-url') + '-' + $(this).attr('data-subproduct-id')); } }); $(document).on('click', '#signinGoogle', function() { if (typeof auth2 !== 'undefined') { auth2.grantOfflineAccess().then(signInGoogleCallback); } }); function signInGoogleCallback(authResult) { if (authResult['code']) { location.href = location.origin + '/srv/service/social/google/login?code=' + authResult['code']; } else { } } window.APP = window.APP || {}; window.APP.Instagram = { url: '/srv/service/social/instagram/feed/', count: 20, get: function(callback) { $.ajax({ type: "GET", dataType: "json", url: this.url + this.count, success: function(result) { if (typeof callback === 'function') { callback(result); } } }); }, toHtml: function(callback) { this.get(function(r) { var li = ''; for (var i = 0; i < r.response.data.length; i++) { li += '
  • ' } var str = '
      ' + li + '
    ' if (typeof callback === 'function') { callback(str); } }); }, toJson: function(callback) { this.get(function(r) { if (typeof callback === 'function') { callback(r); } }); } } ;(function($){var $scrollTo=$.scrollTo=function(target,duration,settings){$(window).scrollTo(target,duration,settings);};$scrollTo.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};$scrollTo.window=function(scope){return $(window)._scrollable();};$.fn._scrollable=function(){return this.map(function(){var elem=this,isWin=!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin) return elem;var doc=(elem.contentWindow||elem).document||elem.ownerDocument||elem;return $.browser.safari||doc.compatMode=='BackCompat'?doc.body:doc.documentElement;});};$.fn.scrollTo=function(target,duration,settings){if(typeof duration=='object'){settings=duration;duration=0;} if(typeof settings=='function') settings={onAfter:settings};if(target=='max') target=9e9;settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.speed||settings.duration;settings.queue=settings.queue&&settings.axis.length>1;if(settings.queue) duration/=2;settings.offset=both(settings.offset);settings.over=both(settings.over);return this._scrollable().each(function(){var elem=this,$elem=$(elem),targ=target,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break;} targ=$(targ,this);case'object':if(targ.is||targ.style) toff=(targ=$(targ)).offset();} $.each(settings.axis.split(''),function(i,axis){var Pos=axis=='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,old=elem[key],max=$scrollTo.max(elem,axis);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos))||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'))||0;} attr[key]+=settings.offset[pos]||0;if(settings.over[pos]) attr[key]+=targ[axis=='x'?'width':'height']()*settings.over[pos];}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)=='%'?parseFloat(val)/100*max :val;} if(/^\d+$/.test(attr[key])) attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&settings.queue){if(old!=attr[key]) animate(settings.onAfterFirst);delete attr[key];}});animate(settings.onAfter);function animate(callback){$elem.animate(attr,duration,settings.easing,callback&&function(){callback.call(this,target,settings);});};}).end();};$scrollTo.max=function(elem,axis){var Dim=axis=='x'?'Width':'Height',scroll='scroll'+Dim;if(!$(elem).is('html,body')) return elem[scroll]-$(elem)[Dim.toLowerCase()]();var size='client'+Dim,html=elem.ownerDocument.documentElement,body=elem.ownerDocument.body;return Math.max(html[scroll],body[scroll]) -Math.min(html[size],body[size]);};function both(val){return typeof val=='object'?val:{top:val,left:val};};})(jQuery); (function($) { $.fn.easySlider = function(options){ var defaults = { prevId: 'prevBtn', prevText: '', nextId: 'nextBtn', nextText: '', controlsShow: true, controlsBefore: '', controlsAfter: '', controlsFade: true, firstId: 'firstBtn', firstText: '', firstShow: false, lastId: 'lastBtn', lastText: '', lastShow: false, vertical: false, speed: 1500, auto: false, pause: 3000, continuous: false }; var options = $.extend(defaults, options); this.each(function() { var obj = $(this); var s = $("li", obj).length; var w = $("li", obj).width(); var h = $("li", obj).height(); obj.width(w); obj.height(h); obj.css("overflow","hidden"); var ts = s-1; var t = 0; $("ul", obj).css('width',s*w); if(!options.vertical) $("li", obj).css('float','left'); if(options.controlsShow){ var html = options.controlsBefore; if(options.firstShow) html += ''+ options.firstText +''; html += ' '+ options.prevText +''; html += ' '+ options.nextText +''; if(options.lastShow) html += ' '+ options.lastText +''; html += options.controlsAfter; $(obj).after(html); }; $("a","."+options.nextId).click(function(){ animate("next",true); }); $("a","."+options.prevId).click(function(){ animate("prev",true); }); $("a","."+options.firstId).click(function(){ animate("first",true); }); $("a","."+options.lastId).click(function(){ animate("last",true); }); function animate(dir,clicked){ var ot = t; switch(dir){ case "next": t = (ot>=ts) ? (options.continuous ? 0 : ts) : t+1; break; case "prev": t = (t<=0) ? (options.continuous ? ts : 0) : t-1; break; case "first": t = 0; break; case "last": t = ts; break; default: break; }; var diff = Math.abs(ot-t); var speed = diff*options.speed; if(!options.vertical) { p = (t*w*-1); $("ul",obj).animate( { marginLeft: p }, speed ); } else { p = (t*h*-1); $("ul",obj).animate( { marginTop: p }, speed ); }; if(!options.continuous && options.controlsFade){ if(t==ts){ $("a","."+options.nextId).hide(); $("a","."+options.lastId).hide(); } else { $("a","."+options.nextId).show(); $("a","."+options.lastId).show(); }; if(t==0){ $("a","."+options.prevId).hide(); $("a","."+options.firstId).hide(); } else { $("a","."+options.prevId).show(); $("a","."+options.firstId).show(); }; }; if(clicked) clearTimeout(timeout); if(options.auto && dir=="next" && !clicked){; timeout = setTimeout(function(){ animate("next",false); },diff*options.speed+options.pause); }; }; var timeout; if(options.auto){; timeout = setTimeout(function(){ animate("next",false); },options.pause); }; if(!options.continuous && options.controlsFade){ $("a","."+options.prevId).hide(); $("a","."+options.firstId).hide(); }; }); }; })(jQuery); function SendProductNewsForm(productId) { window.open('SendProductNewsForm.aspx?productId=' + productId, '_blank', 'width=500,height=200,left=100,top=100'); } function ShowModalPortalLogs(page) { window.showModalDialog(page, null, "dialogWidth:470px;dialogHeight:280px;edge:raised;resizable:yes;scroll:no;status:no"); } function SendNewsForm(filePath, itemId) { window.open(filePath + itemId, '_blank', 'width=500,height=200,left=100,top=100', 'false'); } function OpenProductDetails(filePath, itemId) { var PrdPopUp = window.open(filePath + itemId, 'PrdPopUp', 'scrollbars=yes,width=700,height=550,left=1,top=1', 'true'); if (PrdPopUp != null) { PrdPopUp.focus(); } } function openInstallments(price, height, width) { var x, y; x = (self.screen.availHeight - height) / 2; y = (self.screen.availWidth - width) / 2; var winAtts = 'width=' + width + ' , height=' + height + ', toolbar=no, scrollbars=yes, directories=no, left=' + y + ',top=' + x + ' '; var chidPopUp = window.open('/Store/ProductInstallments.aspx?price=' + price, 'installments', winAtts); if (chidPopUp != null) { chidPopUp.focus(); } } function OpenSelectionWindow(idname, url, postBack, wName, width, height, hasParam, sbars, status) { var x, y; x = (self.screen.availHeight - height) / 2; y = (self.screen.availWidth - width) / 2; var _strUrl if (hasParam == 1) { url += '&'; } else { url += '?'; } popUpSelectionWindow = window.open(url + 'formname=' + document.forms[0].name + '&id=' + idname + '&postBack=' + postBack, wName, 'width=' + width + ',height=' + height + ',left=' + y + ',top=' + x + ',scrollbars=' + sbars + ',status=' + status); if (popUpSelectionWindow != null) { popUpSelectionWindow.focus(); } } function SetFieldData(formName, id, data, postBack) { window.opener.document.forms[0].elements[id].value = data; ; window.close(); if (postBack) window.opener.__doPostBack(id, ''); } function openChild(_file, wName, width, height, sbar) { var x, y; x = (self.screen.availHeight - height) / 2; y = (self.screen.availWidth - width) / 2; if (sbar == null) { sbar = 0 } winAtts = 'width=' + width + ', height=' + height + ', toolbar=no, scrollbars=' + sbar + ', directories=no, top=' + x + ', left=' + y; var ChidPopUp = window.open(_file, wName, winAtts); if (ChidPopUp != null) { ChidPopUp.focus(); } } function CloseMe() { eval('var theform = document.' + formName + ';'); popUp.close(); } function Print() { window.print(); } function SearchProduct(e, txtsearchid) { if (e == null || e.keyCode == 13) { var bt = document.getElementById(txtsearchid); window.location = "/store/Search.aspx?search=true&srchtxt=" + encodeURI(bt.value); return false; } } function clickButton(e, buttonid) { var bt = document.getElementById(buttonid); if (typeof bt == 'object') { if (navigator.appName.indexOf("Netscape") > (-1)) { if (e.keyCode == 13) { bt.click(); return false; } } if (navigator.appName.indexOf("Microsoft Internet Explorer") > (-1)) { if (event.keyCode == 13) { bt.click(); return false; } } } } function checkMaxLength(e, el) { switch (e.keyCode) { case 37: // left return true; case 38: // up return true; case 39: // right return true; case 40: // down return true; case 8: // backspace return true; case 46: // delete return true; case 27: // escape el.value = ''; return true; } return (el.value.length < el.getAttribute("txtmaxlength")); } function SetUniqueRadioButton(nameregex, current, hdnElementid, elementValue) { re = new RegExp(nameregex); for(i = 0; i < document.forms[0].elements.length; i++) { elm = document.forms[0].elements[i] if (elm.type == 'radio') { if (re.test(elm.name)) { elm.checked = false; } } } current.checked = true; if(hdnElementid != null && elementValue != null) { var frmElement = document.getElementById(hdnElementid); if(frmElement != null) { frmElement.value = elementValue; } } __doPostBack(hdnElementid,''); } PositionX = 100; PositionY = 100; defaultWidth = 500; defaultHeight = 500; var AutoClose = true; if (parseInt(navigator.appVersion.charAt(0)) >= 4) { var isNN = (navigator.appName == "Netscape") ? 1 : 0; var isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0; } var optNN = 'scrollbars=yes,width=' + defaultWidth + ',height=' + defaultHeight + ',left=' + PositionX + ',top=' + PositionY; var optIE = 'scrollbars=yes,width=100,height=100,left=' + PositionX + ',top=' + PositionY; function popImage(imageURL, imageTitle) { if (isNN) { imgWin = window.open('about:blank', '', optNN); } if (isIE) { imgWin = window.open('about:blank', '', optIE); } with (imgWin.document) { writeln('Loading...'); writeln(''); writeln('var isNN,isIE;'); writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){'); writeln('isNN=(navigator.appName=="Netscape")?1:0;'); writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}'); writeln('function reSizeToImage(){'); writeln('if (isIE){'); writeln('window.resizeTo(100,100);'); writeln('width=(document.images[0].width)+25;'); writeln('height=(document.images[0].height)+90;'); writeln('window.resizeTo(width,height);}'); writeln('if (isNN){'); writeln('window.innerWidth=document.images["George"].width;'); writeln('window.innerHeight=document.images["George"].height;}}'); writeln('function doTitle(){document.title="' + imageTitle + '";}'); writeln(''); if (!AutoClose) writeln('') else writeln(''); writeln(''); close(); } } (function($) { // Compliant with jquery.noConflict() $.fn.jCarouselLite = function(o) { o = $.extend({ btnPrev: null, btnNext: null, btnGo: null, mouseWheel: true, auto: 3000, speed: 500, easing: null, vertical: false, circular: true, visible: 4, start: 0, scroll: 1, beforeStart: null, afterEnd: null }, o || {}); return this.each(function() { // Returns the element collection. Chainable. var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width"; var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible; if(o.circular) { ul.prepend(tLi.slice(tl-v-1+1).clone()) .append(tLi.slice(0,v).clone()); o.start += v; } var li = $("li", ul), itemLength = li.size(), curr = o.start; div.css("visibility", "visible"); li.css({overflow: "hidden", float: o.vertical ? "none" : "left"}); ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"}); div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"}); var liSize = o.vertical ? height(li) : width(li); // Full li size(incl margin)-Used for animation var ulSize = liSize * itemLength; // size of full ul(total length, not just for the visible items) var divSize = liSize * v; // size of entire div(total length for just the visible items) li.css({width: li.width(), height: li.height()}); ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize)); div.css(sizeCss, divSize+"px"); // Width of the DIV. length of visible images if(o.btnPrev) $(o.btnPrev).click(function() { return go(curr-o.scroll); }); if(o.btnNext) $(o.btnNext).click(function() { return go(curr+o.scroll); }); if(o.btnGo) $.each(o.btnGo, function(i, val) { $(val).click(function() { return go(o.circular ? o.visible+i : i); }); }); if(o.mouseWheel && div.mousewheel) div.mousewheel(function(e, d) { return d>0 ? go(curr-o.scroll) : go(curr+o.scroll); }); if(o.auto) setInterval(function() { go(curr+o.scroll); }, o.auto+o.speed); function vis() { return li.slice(curr).slice(0,v); }; function go(to) { if(!running) { if(o.beforeStart) o.beforeStart.call(this, vis()); if(o.circular) { // If circular we are in first or last, then goto the other end if(to<=o.start-v-1) { // If first, then goto last ul.css(animCss, -((itemLength-(v*2))*liSize)+"px"); curr = to==o.start-v-1 ? itemLength-(v*2)-1 : itemLength-(v*2)-o.scroll; } else if(to>=itemLength-v+1) { // If last, then goto first ul.css(animCss, -( (v) * liSize ) + "px" ); curr = to==itemLength-v+1 ? v+1 : v+o.scroll; } else curr = to; } else { // If non-circular and to points to first or last, we just return. if(to<0 || to>itemLength-v) return; else curr = to; } // If neither overrides it, the curr will still be "to" and we can proceed. running = true; ul.animate( animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing, function() { if(o.afterEnd) o.afterEnd.call(this, vis()); running = false; } ); if(!o.circular) { $(o.btnPrev + "," + o.btnNext).removeClass("disabled"); $( (curr-o.scroll<0 && o.btnPrev) || (curr+o.scroll > itemLength-v && o.btnNext) || [] ).addClass("disabled"); } } return false; }; }); }; function css(el, prop) { return parseInt($.css(el[0], prop)) || 0; }; function width(el) { if(typeof el[0]==='undefined'){ console.log('jcarousel.js offsetWidth is undefined'); return 100; } return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight'); }; function height(el) { return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom'); }; })(jQuery); function getEndpoint(key, params = []) { let paramStr = typeof params === 'object' ? params.join('/') : (params || ''); paramStr = String(paramStr); paramStr += paramStr.indexOf('?')>-1 ? '&' : '?'; paramStr += 'language=' + (typeof LANGUAGE == "undefined" ? "" : LANGUAGE); let allowCurrency = ['FILTER', 'VARIANT', 'PRODUCT_LOADER', 'SUB_FOLDER']; if (allowCurrency.indexOf(key)>-1) paramStr += allowCurrency.indexOf(key)>-1 ? '¤cy=' + CURRENCY : ''; paramStr = paramStr.replace('?&','?').replace('&?','&').replace('/?','?'); if (key == 'STATIC_FLAGS') paramStr = ''; var ENDPOINT = { REGION_V4: '/srv/service/region/', CATEGORY: '/srv/service/category/get/', REGION_COUNTRIES: '/srv/service/region/get-countries/', REGION_CITIES: '/srv/service/region/get-cities/', REGION_TOWN: '/srv/service/region/get-towns/', REGION_DISTRICTS: '/srv/service/region/get-districts/', COUNTRY: '/srv/service/region/get-countries/', FILTER: '/srv/service/filter/get/', PRODUCT_DETAIL_COMMENTS: '/srv/service/product-detail/comments/', PRODUCT_DETAIL_COMMENT_AVERAGE: '/srv/service/product-detail/comment-average/', REGION: '/srv/service/region/get-list/', VARIANT: '/srv/service/variant/', CUSTOMER_REGISTER: '/api/v1/block/customer-register/', SUB_FOLDER: '/srv/service/content-v5/sub-folder/', PRODUCT_LOADER: '/srv/service/content-v5/product-loader/', DEPARTMENT: '/srv/service/profile/get-message-department-list/', TAX_OFFICE_LIST: '/Diger/tax-office.txt', MAP_COUNTRIES: '/Diger/countries.txt', PRODUCT_RELATED: '/srv/service/product/get-related-products/', STATIC_FLAGS: '/static/theme-flags/', SEARCH_ALL: '/srv/service/product/searchAll/', SEARCH: '/srv/service/product/search/', STORE_LIST: '/srv/service/store/store-list/', }; var ENDPOINT2 = { LOGIN: '/api/v1/authentication/login/', REGISTER: '/api/v1/authentication/register/', CUSTOMER_REGISTER_QUICK: '/api/v1/authentication/register/quick/', CUSTOMER_REGISTER_NOMEMBERSHIP: '/api/v1/authentication/login-nomembership/', CUSTOMER_REGISTER_UPDATE: '/api/v1/block/customer-register/', CUSTOMER_UPDATE: '/api/v1/customer/update/', CUSTOMER_UPDATE_PASSWORD: '/api/v1/customer/update/password/', CAPTCHA: '/api/v1/security/captcha/', ADDRESS: '/api/v1/public/address/', GET_PAGE_REQUIREMENTS : '/api/v1/block/get-page-requirement/', MESSAGE: '/srv/service/profile/get-message-list/', SEND_MESSAGE: '/api/v1/public/send-message/department/', VERIFY_SMS: '/api/v1/public/services/verify-sms/', ERP_STORE: '/Diger/Erp/store.php', }; var prefix = ENDPOINT_PREFIX ? atob(ENDPOINT_PREFIX) : ''; if (MEMBER_INFO.GROUP > 0) { if (['FILTER', 'INSTALLMENT', 'PRODUCT_LOADER'].indexOf(key) > -1) prefix = ''; } if (typeof E_EXPORT_ACTIVE != 'undefined' && E_EXPORT_ACTIVE == 1) { if (['PRODUCT_LOADER'].indexOf(key) > -1) prefix = ''; } if (typeof getUrlParam == 'function' && getUrlParam('q')) { if (['FILTER'].indexOf(key) > -1) prefix = ''; } let LINK = prefix + paramStr; if (ENDPOINT[key]) { LINK = prefix + ENDPOINT[key] + paramStr; } else if (ENDPOINT2[key]) { LINK = ENDPOINT2[key] + paramStr; } return LINK; } LANG.set({'enter_name_and_mail' : 'Lütfen adınızı ve e-posta giriniz.', 'enter_name' : 'Lütfen adınızı giriniz.', 'select_subproduct' : 'Alt Ürün Seçiniz', 'caution' : 'dikkat', 'newsletter_success' : 'bültenimize kayıt olduğunuz için teşekkür ederiz.', 'check_mail' : 'Lütfen e-posta adresinizi kontrol ediniz.', 'registered_mail' : 'Bu e-posta adresi ile daha önceden e-bültene kayıt olunmuş. Lütfen e-posta adresinizi kontrol ediniz.', 'waiting' : 'Bekleyiniz...', 'no_products_on_comparison' : 'Karşılaştırılacak ürün yok', 'must_select_least_2_items_to_compare' : 'Karşılaştırmak için en az 2 ürün seçmelisiniz', 'up_4_items_comparable' : 'en fazla 4 adet ürün karşılaştırılabilir', 'send' : 'Gönder', 'show_more_products' : 'Daha fazla ürün göster', 'x' : '' }); LANG.set({'January' : 'Ocak', 'February' : 'Şubat', 'March' : 'Mart', 'April' : 'Nisan', 'May' : 'Mayıs', 'June' : 'Haziran', 'July' : 'Temmuz', 'August' : 'Ağustos', 'September' : 'Eylül', 'October' : 'Ekim', 'November' : 'Kasım', 'December' : 'Aralık', 'x' : '' });