(function(w){var k=function(b,c){typeof c=="undefined"&&(c={});this.init(b,c)},a=k.prototype,o,p=["canvas","vml"],f=["oval","spiral","square","rect","roundRect"],x=/^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,v=navigator.appVersion.indexOf("MSIE")!==-1&&parseFloat(navigator.appVersion.split("MSIE")[1])===8?true:false,y=!!document.createElement("canvas").getContext,q=true,n=function(b,c,a){var b=document.createElement(b),d;for(d in a)b[d]=a[d];typeof c!=="undefined"&&c.appendChild(b);return b},m=function(b, c){for(var a in c)b.style[a]=c[a];return b},t=function(b,c){for(var a in c)b.setAttribute(a,c[a]);return b},u=function(b,c,a,d){b.save();b.translate(c,a);b.rotate(d);b.translate(-c,-a);b.beginPath()};a.init=function(b,c){if(typeof c.safeVML==="boolean")q=c.safeVML;try{this.mum=document.getElementById(b)!==void 0?document.getElementById(b):document.body}catch(a){this.mum=document.body}c.id=typeof c.id!=="undefined"?c.id:"canvasLoader";this.cont=n("div",this.mum,{id:c.id});if(y)o=p[0],this.can=n("canvas", this.cont),this.con=this.can.getContext("2d"),this.cCan=m(n("canvas",this.cont),{display:"none"}),this.cCon=this.cCan.getContext("2d");else{o=p[1];if(typeof k.vmlSheet==="undefined"){document.getElementsByTagName("head")[0].appendChild(n("style"));k.vmlSheet=document.styleSheets[document.styleSheets.length-1];var d=["group","oval","roundrect","fill"],e;for(e in d)k.vmlSheet.addRule(d[e],"behavior:url(#default#VML); position:absolute;")}this.vml=n("group",this.cont)}this.setColor(this.color);this.draw(); m(this.cont,{display:"none"})};a.cont={};a.can={};a.con={};a.cCan={};a.cCon={};a.timer={};a.activeId=0;a.diameter=40;a.setDiameter=function(b){this.diameter=Math.round(Math.abs(b));this.redraw()};a.getDiameter=function(){return this.diameter};a.cRGB={};a.color="#000000";a.setColor=function(b){this.color=x.test(b)?b:"#000000";this.cRGB=this.getRGB(this.color);this.redraw()};a.getColor=function(){return this.color};a.shape=f[0];a.setShape=function(b){for(var c in f)if(b===f[c]){this.shape=b;this.redraw(); break}};a.getShape=function(){return this.shape};a.density=40;a.setDensity=function(b){this.density=q&&o===p[1]?Math.round(Math.abs(b))<=40?Math.round(Math.abs(b)):40:Math.round(Math.abs(b));if(this.density>360)this.density=360;this.activeId=0;this.redraw()};a.getDensity=function(){return this.density};a.range=1.3;a.setRange=function(b){this.range=Math.abs(b);this.redraw()};a.getRange=function(){return this.range};a.speed=2;a.setSpeed=function(b){this.speed=Math.round(Math.abs(b))};a.getSpeed=function(){return this.speed}; a.fps=24;a.setFPS=function(b){this.fps=Math.round(Math.abs(b));this.reset()};a.getFPS=function(){return this.fps};a.getRGB=function(b){b=b.charAt(0)==="#"?b.substring(1,7):b;return{r:parseInt(b.substring(0,2),16),g:parseInt(b.substring(2,4),16),b:parseInt(b.substring(4,6),16)}};a.draw=function(){var b=0,c,a,d,e,h,k,j,r=this.density,s=Math.round(r*this.range),l,i,q=0;i=this.cCon;var g=this.diameter;if(o===p[0]){i.clearRect(0,0,1E3,1E3);t(this.can,{width:g,height:g});for(t(this.cCan,{width:g,height:g});b< r;){l=b<=s?1-1/s*b:l=0;k=270-360/r*b;j=k/180*Math.PI;i.fillStyle="rgba("+this.cRGB.r+","+this.cRGB.g+","+this.cRGB.b+","+l.toString()+")";switch(this.shape){case f[0]:case f[1]:c=g*0.07;e=g*0.47+Math.cos(j)*(g*0.47-c)-g*0.47;h=g*0.47+Math.sin(j)*(g*0.47-c)-g*0.47;i.beginPath();this.shape===f[1]?i.arc(g*0.5+e,g*0.5+h,c*l,0,Math.PI*2,false):i.arc(g*0.5+e,g*0.5+h,c,0,Math.PI*2,false);break;case f[2]:c=g*0.12;e=Math.cos(j)*(g*0.47-c)+g*0.5;h=Math.sin(j)*(g*0.47-c)+g*0.5;u(i,e,h,j);i.fillRect(e,h-c*0.5, c,c);break;case f[3]:case f[4]:a=g*0.3,d=a*0.27,e=Math.cos(j)*(d+(g-d)*0.13)+g*0.5,h=Math.sin(j)*(d+(g-d)*0.13)+g*0.5,u(i,e,h,j),this.shape===f[3]?i.fillRect(e,h-d*0.5,a,d):(c=d*0.55,i.moveTo(e+c,h-d*0.5),i.lineTo(e+a-c,h-d*0.5),i.quadraticCurveTo(e+a,h-d*0.5,e+a,h-d*0.5+c),i.lineTo(e+a,h-d*0.5+d-c),i.quadraticCurveTo(e+a,h-d*0.5+d,e+a-c,h-d*0.5+d),i.lineTo(e+c,h-d*0.5+d),i.quadraticCurveTo(e,h-d*0.5+d,e,h-d*0.5+d-c),i.lineTo(e,h-d*0.5+c),i.quadraticCurveTo(e,h-d*0.5,e+c,h-d*0.5))}i.closePath();i.fill(); i.restore();++b}}else{m(this.cont,{width:g,height:g});m(this.vml,{width:g,height:g});switch(this.shape){case f[0]:case f[1]:j="oval";c=140;break;case f[2]:j="roundrect";c=120;break;case f[3]:case f[4]:j="roundrect",c=300}a=d=c;e=500-d;for(h=-d*0.5;b=1;)b.removeChild(b.firstChild)}};a.redraw=function(){this.clean();this.draw()};a.reset=function(){typeof this.timer==="number"&&(this.hide(),this.show())};a.tick=function(b){var a=this.con,f=this.diameter;b||(this.activeId+=360/this.density*this.speed);o===p[0]?(a.clearRect(0,0,f,f),u(a,f*0.5,f*0.5,this.activeId/180*Math.PI),a.drawImage(this.cCan,0,0,f,f),a.restore()):(this.activeId>=360&&(this.activeId-=360),m(this.vml,{rotation:this.activeId}))};a.show=function(){if(typeof this.timer!=="number"){var a=this;this.timer=self.setInterval(function(){a.tick()},Math.round(1E3/this.fps));m(this.cont,{display:"block"})}}; a.hide=function(){typeof this.timer==="number"&&(clearInterval(this.timer),delete this.timer,m(this.cont,{display:"none"}))};a.kill=function(){var a=this.cont;typeof this.timer==="number"&&this.hide();o===p[0]?(a.removeChild(this.can),a.removeChild(this.cCan)):a.removeChild(this.vml);for(var c in this)delete this[c]};w.CanvasLoader=k})(window); !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?a<0?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;d0&&b-1 in a)}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=fa(),z=fa(),A=fa(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;c+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(xa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ea(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+pa(r[h]);s=r.join(","),w=_.test(a)&&na(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function fa(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ga(a){return a[u]=!0,a}function ha(a){var b=n.createElement("div");try{return!!a(b)}catch(xa){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ia(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ja(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ka(a){return function(b){return"input"===b.nodeName.toLowerCase()&&b.type===a}}function la(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ma(a){return ga(function(b){return b=+b,ga(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function na(a){return a&&void 0!==a.getElementsByTagName&&a}c=ea.support={},f=ea.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ea.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ha(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ha(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ha(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(void 0!==b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c=void 0!==a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return void 0!==b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if(void 0!==b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ha(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ha(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ha(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d||(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ja(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ja(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ea.matches=function(a,b){return ea(a,null,null,b)},ea.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(xa){}return ea(b,n,null,[a]).length>0},ea.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ea.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ea.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ea.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ea.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ea.selectors={cacheLength:50,createPseudo:ga,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ea.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ea.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||void 0!==a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ea.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),!1===t)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return(t-=e)===d||t%d==0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ea.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ga(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ga(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ga(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ga(function(a){return function(b){return ea(a,b).length>0}}),contains:ga(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ga(function(a){return V.test(a||"")||ea.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do{if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return(c=c.toLowerCase())===a||0===c.indexOf(a+"-")}while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return!1===a.disabled},disabled:function(a){return!0===a.disabled},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,!0===a.selected},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ma(function(){return[0]}),last:ma(function(a,b){return[b-1]}),eq:ma(function(a,b,c){return[c<0?c+b:c]}),even:ma(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:ma(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sa(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=ta(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function va(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=qa(function(a){return a===b},h,!0),l=qa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ra(m),i>1&&pa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ta(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ea.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ga(f):f}return h=ea.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=va(b[c]),f[u]?d.push(f):e.push(f);f=A(a,wa(e,d)),f.selector=a}return f},i=ea.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(!(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0]))return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&na(b.parentNode)||b))){if(j.splice(i,1),!(a=f.length&&pa(j)))return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&na(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ha(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ha(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ia("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ha(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ia("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ha(function(a){return null==a.getAttribute("disabled")})||ia(K,function(a,b,c){var d;if(!c)return!0===a[b]?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ea}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;b1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(!(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a))||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if((f=d.getElementById(e[2]))&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))}).prototype=n.fn,A=n(d);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;b-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do{a=a[b]}while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.uniqueSort(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g;function G(a){var b={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);b0||(H.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function I(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J)):(d.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(I(),n.ready())}n.ready.promise=function(b){if(!H)if(H=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J);else{d.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&function b(){if(!n.isReady){try{c.doScroll("left")}catch(e){return a.setTimeout(b,50)}I(),n.ready()}}()}return H.promise(b)},n.ready.promise();var K;for(K in n(l))break;l.ownFirst="0"===K,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;(c=d.getElementsByTagName("body")[0])&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),void 0!==b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var L=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return(1===c||9===c)&&(!b||!0!==b&&a.getAttribute("classid")===b)},M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if("string"==typeof(c=a.getAttribute(d))){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:M.test(c)?n.parseJSON(c):c)}catch(e){}n.data(a,b,c)}else c=void 0}return c}function P(a){var b ;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(L(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?null==(f=g[b])&&(f=g[n.camelCase(b)]):f=g,f}}function R(a,b,c){if(L(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return!!(a=a.nodeType?n.cache[a[n.expando]]:a[n.expando])&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),O(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?O(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length
a",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var ca={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:l.htmlSerialize?[0,"",""]:[1,"X
","
"]};ca.optgroup=ca.option,ca.tbody=ca.tfoot=ca.colgroup=ca.caption=ca.thead,ca.th=ca.td;function da(a,b){var c,d,e=0,f=void 0!==a.getElementsByTagName?a.getElementsByTagName(b||"*"):void 0!==a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,da(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function ea(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var fa=/<|&#?\w+;/,ga=/"!==m[1]||ga.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(da(q,"input"),ha),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=da(p.appendChild(g),"script"),h&&ea(i),c){f=0;while(g=i[f++])$.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=!1===e.attributes[c].expando);e=null}();var ja=/^(?:input|select|textarea)$/i,ka=/^key/,la=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ma=/^(?:focusinfocus|focusoutblur)$/,na=/^([^.]*)(?:\.(.+)|)/;function oa(){return!0}function pa(){return!1}function qa(){try{return d.activeElement}catch(a){}}function ra(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ra(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),!1===e)e=pa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return void 0===n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=na.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&!1!==j.setup.call(a,d,p,k)||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=na.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&!1!==l.teardown.call(a,p,r.handle)||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ma.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||!1!==l.trigger.apply(e,c))){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,ma.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),(g=h&&i[h])&&g.apply&&L(i)&&(b.result=g.apply(i,c),!1===b.result&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||!1===l._default.apply(p.pop(),c))&&L(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||!1!==k.preDispatch.call(this,a)){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,void 0!==(d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i))&&!1===(a.result=d)&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(!0!==i.disabled||"click"!==a.type)){for(d=[],c=0;c-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]","i"),ua=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,va=/\s*$/g,za=ba(d),Aa=za.appendChild(d.createElement("div"));function Ba(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Ca(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Da(a){var b=xa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ea(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d1&&"string"==typeof q&&!l.checkClone&&wa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ga(f,b,c,d)});if(o&&(k=ia(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(da(k,"script"),Ca),h=i.length;m")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ta.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Aa.innerHTML=a.outerHTML,Aa.removeChild(f=Aa.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=da(f),h=da(a),g=0;null!=(e=h[g]);++g)d[g]&&Fa(e,d[g]);if(b)if(c)for(h=h||da(a),d=d||da(f),g=0;null!=(e=h[g]);g++)Ea(e,d[g]);else Ea(a,f);return d=da(f,"script"),d.length>0&&ea(d,!i&&da(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||L(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||void 0===d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ga,detach:function(a){return Ha(this,a,!0)},remove:function(a){return Ha(this,a)},text:function(a){return X(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ga(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){Ba(this,a).appendChild(a)}})},prepend:function(){return Ga(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ba(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ga(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ga(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(da(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return X(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(sa,""):void 0;if("string"==typeof a&&!va.test(a)&&(l.htmlSerialize||!ta.test(a))&&(l.leadingWhitespace||!_.test(a))&&!ca[(Z.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;c")).appendTo(b.documentElement),b=(Ia[0].contentWindow||Ia[0].contentDocument).document,b.write(),b.close(),c=Ka(a,b),Ia.detach()),Ja[a]=c),c}var Ma=/^margin/,Na=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Oa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Pa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="
t
",j.childNodes[0].style.borderCollapse="separate",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",(f=0===k[0].offsetHeight)&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}j.style&&(j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}}))}();var Qa,Ra,Sa=/^(top|right|bottom|left)$/;a.getComputedStyle?(Qa=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Ra=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Qa(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Na.test(g)&&Ma.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0===g?g:g+""}):Pa.currentStyle&&(Qa=function(a){return a.currentStyle},Ra=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Qa(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Na.test(g)&&!Sa.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ta(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ua=/alpha\([^)]*\)/i,Va=/opacity\s*=\s*([^)]*)/i,Wa=/^(none|table(?!-c[ea]).+)/,Xa=new RegExp("^("+S+")(.*)$","i"),Ya={position:"absolute",visibility:"hidden",display:"block"},Za={letterSpacing:"0",fontWeight:"400"},$a=["Webkit","O","Moz","ms"],_a=d.createElement("div").style;function ab(a){if(a in _a)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=$a.length;while(c--)if((a=$a[c]+b)in _a)return a}function bb(a,b){for(var c,d,e,f=[],g=0,h=a.length;g=1||""===b)&&""===n.trim(f.replace(Ua,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Ua.test(f)?f.replace(Ua,e):f+" "+e)}}),n.cssHooks.marginRight=Ta(l.reliableMarginRight,function(a,b){if(b)return Oa(a,{display:"inline-block"},Ra,[a,"marginRight"])}),n.cssHooks.marginLeft=Ta(l.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Ra(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Oa(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px"}),n.each({ margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Ma.test(a)||(n.cssHooks[a+b].set=cb)}),n.fn.extend({css:function(a,b){return X(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Qa(a),e=b.length;g1)},show:function(){return bb(this,!0)},hide:function(){return bb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function fb(a,b,c,d,e){return new fb.prototype.init(a,b,c,d,e)}n.Tween=fb,fb.prototype={constructor:fb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=fb.propHooks[this.prop];return a&&a.get?a.get(this):fb.propHooks._default.get(this)},run:function(a){var b,c=fb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):fb.propHooks._default.set(this),this}},fb.prototype.init.prototype=fb.prototype,fb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},fb.propHooks.scrollTop=fb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=fb.prototype.init,n.fx.step={};var gb,hb,ib=/^(?:toggle|show|hide)$/,jb=/queueHooks$/;function kb(){return a.setTimeout(function(){gb=void 0}),gb=n.now()}function lb(a,b){var c,d={height:a},e=0;for(b=b?1:0;e<4;e+=2-b)c=U[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function mb(a,b,c){for(var d,e=(pb.tweeners[b]||[]).concat(pb.tweeners["*"]),f=0,g=e.length;f
a",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var qb=/\r/g,rb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),(b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()])&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return(b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()])&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(qb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(rb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||e<0,g=f?null:[],h=f?e+1:d.length,i=e<0?h:f?e:0;i-1)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){if(n.isArray(b))return a.checked=n.inArray(n(a).val(),b)>-1}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb,tb,ub=n.expr.attrHandle,vb=/^(?:checked|selected)$/i,wb=l.getSetAttribute,xb=l.input;n.fn.extend({attr:function(a,b){return X(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return void 0===a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?tb:sb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(F);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?xb&&wb||!vb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(wb?c:d)}}),tb={set:function(a,b,c){return!1===b?n.removeAttr(a,c):xb&&wb||!vb.test(c)?a.setAttribute(!wb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ub[b]||n.find.attr;xb&&wb||!vb.test(b)?ub[b]=function(a,b,d){var e,f;return d||(f=ub[b],ub[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ub[b]=f),e}:ub[b]=function(a,b,c){if(!c)return a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),xb&&wb||(n.attrHooks.value={set:function(a,b,c){if(!n.nodeName(a,"input"))return sb&&sb.set(a,b,c);a.defaultValue=b}}),wb||(sb={set:function(a,b,c){var d=a.getAttributeNode(c);if(d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c))return b}},ub.id=ub.name=ub.coords=function(a,b,c){var d;if(!c)return(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);if(c&&c.specified)return c.value},set:sb.set},n.attrHooks.contenteditable={set:function(a,b,c){sb.set(a,""!==b&&b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){if(""===c)return a.setAttribute(b,"auto"),c}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var yb=/^(?:input|select|textarea|button|object)$/i,zb=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return X(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):yb.test(a.nodeName)||zb.test(a.nodeName)&&a.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Ab=/[\t\r\n\f]/g;function Bb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Bb(this)))});if("string"==typeof a&&a){b=a.match(F)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Bb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(F)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Bb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(F)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=Bb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||!1===a?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Bb(c)+" ").replace(Ab," ").indexOf(b)>-1)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Cb=a.location,Db=n.now(),Eb=/\?/,Fb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Fb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Gb=/#.*$/,Hb=/([?&])_=[^&]*/,Ib=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Jb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Kb=/^(?:GET|HEAD)$/,Lb=/^\/\//,Mb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Nb={},Ob={},Pb="*/".concat("*"),Qb=Cb.href,Rb=Mb.exec(Qb.toLowerCase())||[];function Sb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(F)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Tb(a,b,c,d){var e={},f=a===Ob;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ub(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Vb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Wb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(!(g=j[i+" "+f]||j["* "+f]))for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){!0===g?g=j[e]:!0!==j[e]&&(f=h[0],k.unshift(h[1]));break}if(!0!==g)if(g&&a.throws)b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Qb,type:"GET",isLocal:Jb.test(Rb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ub(Ub(a,n.ajaxSettings),b):Ub(n.ajaxSettings,a)},ajaxPrefilter:Sb(Nb),ajaxTransport:Sb(Ob),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Ib.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(u<2)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),x(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Qb)+"").replace(Gb,"").replace(Lb,Rb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(F)||[""],null==l.crossDomain&&(d=Mb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Rb[1]&&d[2]===Rb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Rb[3]||("http:"===Rb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Tb(Nb,l,c,w),2===u)return w;i=n.event&&l.global,i&&0==n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Kb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Eb.test(f)?"&":"?")+l.data,delete l.data),!1===l.cache&&(l.url=Hb.test(f)?f.replace(Hb,"$1_="+Db++):f+(Eb.test(f)?"&":"?")+"_="+Db++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&!1!==l.contentType||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Pb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(!1===l.beforeSend.call(m,w,l)||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Tb(Ob,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,x)}catch(y){if(!(u<2))throw y;x(-1,y)}}else x(-1,"No Transport");function x(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&b<300||304===b,d&&(v=Vb(l,w,d)),v=Wb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),(x=w.getResponseHeader("etag"))&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,!b&&y||(y="error",b<0&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Xb(a){return a.style&&a.style.display||n.css(a,"display")}function Yb(a){if(!n.contains(a.ownerDocument||d,a))return!0;while(a&&1===a.nodeType){if("none"===Xb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Yb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Zb=/%20/g,$b=/\[\]$/,_b=/\r?\n/g,ac=/^(?:submit|button|image|reset|file)$/i,bc=/^(?:input|select|textarea|keygen)/i;function cc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||$b.test(a)?d(a,e):cc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)cc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)cc(c,a[c],b,e);return d.join("&").replace(Zb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&bc.test(this.nodeName)&&!ac.test(a)&&(this.checked||!Y.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(_b,"\r\n")}}):{name:b.name,value:c.replace(_b,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?hc():d.documentMode>8?gc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&gc()||hc()}:gc;var dc=0,ec={},fc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in ec)ec[a](void 0,!0)}),l.cors=!!fc&&"withCredentials"in fc,(fc=l.ajax=!!fc)&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++dc;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete ec[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=ec[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function gc(){try{return new a.XMLHttpRequest}catch(b){}}function hc(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ic=[],jc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ic.pop()||n.expando+"_"+Db++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=!1!==b.jsonp&&(jc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&jc.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(jc,"$1"+e):!1!==b.jsonp&&(b.url+=(Eb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ic.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ia([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var kc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&kc)return kc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("
").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function lc(a){return n.isWindow(a)?a:9===a.nodeType&&(a.defaultView||a.parentWindow)}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(void 0!==e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=lc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Pa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return X(this,function(a,d,e){var f=lc(a);if(void 0===e)return f?b in f?f[b]:f.document.documentElement[d]:a[d];f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ta(l.pixelPosition,function(a,c){if(c)return c=Ra(a,b),Na.test(c)?n(a).position()[b]+"px":c})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(!0===d||!0===e?"margin":"border") ;return X(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var mc=a.jQuery,nc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=nc),b&&a.jQuery===n&&(a.jQuery=mc),n},b||(a.jQuery=a.$=n),n}); jQuery.noConflict(); "undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(a,b,c){function d(c){var d=b.console;f[c]||(f[c]=!0,a.migrateWarnings.push(c),d&&d.warn&&!a.migrateMute&&(d.warn("JQMIGRATE: "+c),a.migrateTrace&&d.trace&&d.trace()))}function e(b,c,e,f){if(Object.defineProperty)try{return void Object.defineProperty(b,c,{configurable:!0,enumerable:!0,get:function(){return d(f),e},set:function(a){d(f),e=a}})}catch(g){}a._definePropertyBroken=!0,b[c]=e}a.migrateVersion="1.4.1";var f={};a.migrateWarnings=[],b.console&&b.console.log&&b.console.log("JQMIGRATE: Migrate is installed"+(a.migrateMute?"":" with logging active")+", version "+a.migrateVersion),a.migrateTrace===c&&(a.migrateTrace=!0),a.migrateReset=function(){f={},a.migrateWarnings.length=0},"BackCompat"===document.compatMode&&d("jQuery is not compatible with Quirks Mode");var g=a("",{size:1}).attr("size")&&a.attrFn,h=a.attr,i=a.attrHooks.value&&a.attrHooks.value.get||function(){return null},j=a.attrHooks.value&&a.attrHooks.value.set||function(){return c},k=/^(?:input|button)$/i,l=/^[238]$/,m=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,n=/^(?:checked|selected)$/i;e(a,"attrFn",g||{},"jQuery.attrFn is deprecated"),a.attr=function(b,e,f,i){var j=e.toLowerCase(),o=b&&b.nodeType;return i&&(h.length<4&&d("jQuery.fn.attr(props, pass) is deprecated"),b&&!l.test(o)&&(g?e in g:a.isFunction(a.fn[e])))?a(b)[e](f):("type"===e&&f!==c&&k.test(b.nodeName)&&b.parentNode&&d("Can't change the 'type' of an input or button in IE 6/7/8"),!a.attrHooks[j]&&m.test(j)&&(a.attrHooks[j]={get:function(b,d){var e,f=a.prop(b,d);return f===!0||"boolean"!=typeof f&&(e=b.getAttributeNode(d))&&e.nodeValue!==!1?d.toLowerCase():c},set:function(b,c,d){var e;return c===!1?a.removeAttr(b,d):(e=a.propFix[d]||d,e in b&&(b[e]=!0),b.setAttribute(d,d.toLowerCase())),d}},n.test(j)&&d("jQuery.fn.attr('"+j+"') might use property instead of attribute")),h.call(a,b,e,f))},a.attrHooks.value={get:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?i.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value') no longer gets properties"),b in a?a.value:null)},set:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?j.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value', val) no longer sets properties"),void(a.value=b))}};var o,p,q=a.fn.init,r=a.find,s=a.parseJSON,t=/^\s*)([^>]*)$/;a.fn.init=function(b,e,f){var g,h;return b&&"string"==typeof b&&!a.isPlainObject(e)&&(g=w.exec(a.trim(b)))&&g[0]&&(t.test(b)||d("$(html) HTML strings must start with '<' character"),g[3]&&d("$(html) HTML text after last tag is ignored"),"#"===g[0].charAt(0)&&(d("HTML string cannot start with a '#' character"),a.error("JQMIGRATE: Invalid selector string (XSS)")),e&&e.context&&e.context.nodeType&&(e=e.context),a.parseHTML)?q.call(this,a.parseHTML(g[2],e&&e.ownerDocument||e||document,!0),e,f):(h=q.apply(this,arguments),b&&b.selector!==c?(h.selector=b.selector,h.context=b.context):(h.selector="string"==typeof b?b:"",b&&(h.context=b.nodeType?b:e||document)),h)},a.fn.init.prototype=a.fn,a.find=function(a){var b=Array.prototype.slice.call(arguments);if("string"==typeof a&&u.test(a))try{document.querySelector(a)}catch(c){a=a.replace(v,function(a,b,c,d){return"["+b+c+'"'+d+'"]'});try{document.querySelector(a),d("Attribute selector with '#' must be quoted: "+b[0]),b[0]=a}catch(e){d("Attribute selector with '#' was not fixed: "+b[0])}}return r.apply(this,b)};var x;for(x in r)Object.prototype.hasOwnProperty.call(r,x)&&(a.find[x]=r[x]);a.parseJSON=function(a){return a?s.apply(this,arguments):(d("jQuery.parseJSON requires a valid JSON string"),null)},a.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a.browser||(o=a.uaMatch(navigator.userAgent),p={},o.browser&&(p[o.browser]=!0,p.version=o.version),p.chrome?p.webkit=!0:p.webkit&&(p.safari=!0),a.browser=p),e(a,"browser",a.browser,"jQuery.browser is deprecated"),a.boxModel=a.support.boxModel="CSS1Compat"===document.compatMode,e(a,"boxModel",a.boxModel,"jQuery.boxModel is deprecated"),e(a.support,"boxModel",a.support.boxModel,"jQuery.support.boxModel is deprecated"),a.sub=function(){function b(a,c){return new b.fn.init(a,c)}a.extend(!0,b,this),b.superclass=this,b.fn=b.prototype=this(),b.fn.constructor=b,b.sub=this.sub,b.fn.init=function(d,e){var f=a.fn.init.call(this,d,e,c);return f instanceof b?f:b(f)},b.fn.init.prototype=b.fn;var c=b(document);return d("jQuery.sub() is deprecated"),b},a.fn.size=function(){return d("jQuery.fn.size() is deprecated; use the .length property"),this.length};var y=!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 y=!0,a=d.apply(this,arguments),y=!1,a})}),a.swap=function(a,b,c,e){var f,g,h={};y||d("jQuery.swap() is undocumented and deprecated");for(g in b)h[g]=a.style[g],a.style[g]=b[g];f=c.apply(a,e||[]);for(g in b)a.style[g]=h[g];return f},a.ajaxSetup({converters:{"text json":a.parseJSON}});var z=a.fn.data;a.fn.data=function(b){var e,f,g=this[0];return!g||"events"!==b||1!==arguments.length||(e=a.data(g,b),f=a._data(g,b),e!==c&&e!==f||f===c)?z.apply(this,arguments):(d("Use of jQuery.fn.data('events') is deprecated"),f)};var A=/\/(java|ecma)script/i;a.clean||(a.clean=function(b,c,e,f){c=c||document,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,d("jQuery.clean() is deprecated");var g,h,i,j,k=[];if(a.merge(k,a.buildFragment(b,c).childNodes),e)for(i=function(a){return!a.type||A.test(a.type)?f?f.push(a.parentNode?a.parentNode.removeChild(a):a):e.appendChild(a):void 0},g=0;null!=(h=k[g]);g++)a.nodeName(h,"script")&&i(h)||(e.appendChild(h),"undefined"!=typeof h.getElementsByTagName&&(j=a.grep(a.merge([],h.getElementsByTagName("script")),i),k.splice.apply(k,[g+1,0].concat(j)),g+=j.length));return k});var B=a.event.add,C=a.event.remove,D=a.event.trigger,E=a.fn.toggle,F=a.fn.live,G=a.fn.die,H=a.fn.load,I="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",J=new RegExp("\\b(?:"+I+")\\b"),K=/(?:^|\s)hover(\.\S+|)\b/,L=function(b){return"string"!=typeof b||a.event.special.hover?b:(K.test(b)&&d("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),b&&b.replace(K,"mouseenter$1 mouseleave$1"))};a.event.props&&"attrChange"!==a.event.props[0]&&a.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),a.event.dispatch&&e(a.event,"handle",a.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),a.event.add=function(a,b,c,e,f){a!==document&&J.test(b)&&d("AJAX events should be attached to document: "+b),B.call(this,a,L(b||""),c,e,f)},a.event.remove=function(a,b,c,d,e){C.call(this,a,L(b)||"",c,d,e)},a.each(["load","unload","error"],function(b,c){a.fn[c]=function(){var a=Array.prototype.slice.call(arguments,0);return"load"===c&&"string"==typeof a[0]?H.apply(this,a):(d("jQuery.fn."+c+"() is deprecated"),a.splice(0,0,c),arguments.length?this.bind.apply(this,a):(this.triggerHandler.apply(this,a),this))}}),a.fn.toggle=function(b,c){if(!a.isFunction(b)||!a.isFunction(c))return E.apply(this,arguments);d("jQuery.fn.toggle(handler, handler...) is deprecated");var e=arguments,f=b.guid||a.guid++,g=0,h=function(c){var d=(a._data(this,"lastToggle"+b.guid)||0)%g;return a._data(this,"lastToggle"+b.guid,d+1),c.preventDefault(),e[d].apply(this,arguments)||!1};for(h.guid=f;g option'); var html=jQuery('html'); var select=jQuery('.dropdown_fields, #input-dropdown > option'); var lps_tag=jQuery('.lp-s-tag'); var lps_cat=jQuery('.lp-s-cat'); var length=myDropOption.length; inputField.on('click', function(event){ myDropDown.attr('size', length); myDropDown.css('display', 'block'); }); jQuery(document).on('click', '#input-dropdown ul li', function(event){ myDropDown.attr('size', 0); var dropValue=jQuery(this).text(); dropValue=dropValue.trim(); var tagVal=jQuery(this).data('tagid'); var catVal=jQuery(this).data('catid'); var moreVal=jQuery(this).data('moreval'); if(jQuery(this).hasClass('lp-wrap-title')){ inputField.val(''); jQuery(".lp-search-btn").prop('disabled', true); }else{ inputField.val(dropValue); } inputTagField.val(tagVal); inputCatField.val(catVal); if(tagVal==null&&catVal==null&&moreVal!=null){ inputField.val(moreVal); } jQuery("form i.cross-search-q").css("display","block"); myDropDown.css('display', 'none'); }); html.on('click', function(event){ myDropDown.attr('size', 0); myDropDown.css('display', 'none'); }); select.on('click', function(event){ event.stopPropagation(); }); var resArray=[]; var newResArray=[]; var bufferedResArray=[]; var prevQString='?'; function trimAttributes(node){ jQuery.each(node.attributes, function(){ var attrName=this.name; var attrValue=this.value; if(attrName.indexOf('on')==0||attrValue.indexOf('javascript:')==0){ jQuery(node).removeAttr(attrName); }}); } function sanitize(html){ var output=jQuery($.parseHTML('
' + html + '
', null, false)); output.find('*').each(function(){ trimAttributes(this); }); return output.html(); } var timer; inputField.on('keyup', function(){ clearInterval(timer); timer=setTimeout(function(){ var $this=inputField; var qString=$this.val(); var count=$this.val().length; lpsearchmode=jQuery('body').data('lpsearchmode'); noresultMSG=$this.data('noresult'); jQuery("#input-dropdown ul").empty(); jQuery("#input-dropdown ul li").remove(); prevQuery=$this.data('prev-value'); $this.data("prev-value", qString.length); jQuery.ajax({ type: "POST", dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'listingpro_suggested_search', 'tagID': qString, }, beforeSend: function(){ jQuery("form i.cross-search-q").css("display","none"); jQuery("img.loadinerSearch").css("display","block"); }, success: function(data){ if(data){ resArray=[]; if(data.suggestions.tag||data.suggestions.tagsncats||data.suggestions.cats||data.suggestions.titles){ if(data.suggestions.tag){ jQuery.each(data.suggestions.tag, function(i,v){ resArray.push(v); }); } if(data.suggestions.tagsncats){ jQuery.each(data.suggestions.tagsncats, function(i,v){ resArray.push(v); }); } if(data.suggestions.cats){ jQuery.each(data.suggestions.cats, function(i,v){ resArray.push(v); }); if(data.suggestions.tag==null&&data.suggestions.tagsncats==null&&data.suggestions.titles==null){ resArray=resArray; }else{ }} if(data.suggestions.titles){ jQuery.each(data.suggestions.titles, function(i,v){ resArray.push(v); }); }}else{ if(data.suggestions.more){ jQuery.each(data.suggestions.more, function(i,v){ resArray.push(v); }); }} prevQString=data.tagID; jQuery('img.loadinerSearch').css('display','none'); if(jQuery('form #select').val()==''){ jQuery("form i.cross-search-q").css("display","none"); }else{ jQuery("form i.cross-search-q").css("display","block"); } myDropDown.css('display', 'none'); jQuery("#input-dropdown ul").empty(); jQuery("#input-dropdown ul").append(resArray); myDropDown.css('display', 'block'); $this.data("prev-value", qString.length); } }, complete: function(){ jQuery("form i.cross-search-q").css("display","block"); jQuery("img.loadinerSearch").css("display","none"); }}); }, 700); }); }); jQuery(document).on('change', '.lp_extrafields_select', function(event){ $this=jQuery(this); $selectedFields=[]; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); var new_design_v2=false; var new_header_filters=false; var listStyle=''; if(jQuery('#list-grid-view-v2').length!=0){ if(jQuery('#list-grid-view-v2').hasClass('header-style-v2')){ var new_header_filters=true; } if(jQuery('#list-grid-view-v2').hasClass('list_view_v2')||jQuery('#list-grid-view-v2').hasClass('grid_view_v2')){ listStyle=get_list_style(); new_design_v2=true; }} if(new_header_filters==true){ get_filters_before_send(); var averageRate=get_filter_RRV('.filter-in-header .rated-filter.header-filter-wrap'), mostRewvied=get_filter_RRV('.filter-in-header .reviewed-filter.header-filter-wrap'), mostViewed=get_filter_RRV('.filter-in-header .viewed-filter.header-filter-wrap'), inexpensive=get_price_range_vals('#filter-in-header .price-filter ul li#n-one'), moderate=get_price_range_vals('#filter-in-header .price-filter ul li#n-two'), pricey=get_price_range_vals('#filter-in-header .price-filter ul li#n-three'), ultra=get_price_range_vals('#filter-in-header .price-filter ul li#n-four'), listing_openTime=get_open_now_val('#filter-in-header .open-now-filter'), listStyle=get_list_style(), skeyword=jQuery('input#skeyword-filter').val(); if(jQuery('#searchlocation').length!=0){ seracLoc=jQuery("#searchlocation").val(); }else if(jQuery('#lp_search_loc').length!=0){ seracLoc=jQuery("#lp_search_loc").val(); }}else{ var docHeight=jQuery(document).height(); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height', docHeight + 'px'); event.preventDefault(); jQuery(this).toggleClass('active'); jQuery('.lp-filter-pagination').hide(); jQuery('#content-grids').html(' '); jQuery('.lp-filter-pagination-ajx').remove(); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; listing_openTime=''; mostViewed=''; inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); if(jQuery('.search-filter-attr input[type="checkbox"]#listingRate').hasClass('active')){ averageRate=jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').val(); } if(jQuery('.search-filter-attr input[type="checkbox"]#listingRate').hasClass('active')){ mostRewvied=jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').val(); } if(jQuery('.search-filter-attr input[type="checkbox"]#mostviewed').hasClass('active')){ mostviewed=jQuery('.search-filter-attr input[type="checkbox"]#mostviewed').val(); } if(jQuery('.search-filter-attr input[type="checkbox"].listing_openTime').hasClass('active')){ listing_openTime=jQuery('.search-filter-attr input[type="checkbox"].listing_openTime').val(); } if(jQuery(this).hasClass('active')){ jQuery(this).parent('label').children('.app-filter-loader').addClass('app-filter-loader-active').show().html(''); }else{ jQuery(this).parent('label').children('.app-filter-loader').hide().html(''); }} var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(tags_name.length > 0){}else{ tags_name.push(jQuery('#check_featuretax').val()); } skeyword=jQuery('input#lp_current_query').val(); if(listStyle==null&&jQuery('#list-grid-view-v2').length!=0){ listStyle=jQuery('#list-grid-view-v2').data('layout-class'); } seracLoc=jQuery("#lp_search_loc").val(); if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'inexpensive': inexpensive, 'moderate': moderate, 'pricey': pricey, 'ultra': ultra, 'averageRate': averageRate, 'mostRewvied': mostRewvied, 'mostviewed': mostViewed, 'listing_openTime': listing_openTime, 'lpstag': jQuery("#lpstag").val(), 'tag_name': tags_name, 'cat_id': jQuery("#searchform select#searchcategory").val(), 'loc_id': seracLoc, 'list_style': listStyle, 'skeyword': skeyword, }, success: function(data){ jQuery('.app-filter-loader-active').html(''); jQuery('#full-overlay').remove(); if(data){ listing_update(data, new_design_v2, listStyle); lp_append_distance_div(); }} }); }); jQuery(document).ready(function($){ jQuery(".lp-search-cats-filter-dropdown").on('click', function(){ jQuery('.lp-tooltip-div').css({ 'opacity': '0', 'visibility': 'hidden', 'top': 'auto', 'z-index': '0' }); }); jQuery("select#searchcategory").change(function(){ $thiscat=jQuery(this); jQuery('.tags-area').remove(); jQuery('.lp-filter-pagination-ajx').remove(); jQuery(".chosen-select").val('').trigger('chosen:updated'); jQuery("#searchtags").prop('disabled', true).trigger('chosen:updated'); jQuery(".outer_all_page_overflow").html(''); jQuery(".lp-head-withfilter4").html(''); jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_term', 'term_id': $thiscat.val(), }, success: function(data){ if(data){ jQuery(".search-row .form-inline").after(data.html); jQuery(".header-more-filters.form-inline").prepend(data.html); jQuery(".lp-features-filter").css('opacity','1'); jQuery(".lp-head-withfilter4").html(data.htmlfilter); jQuery(".outer_all_page_overflow").html(data.htmlfilter); }} }); }); jQuery(".header-container.4 select#searchcategory").change(function(){ var $this=jQuery(this), thisVal=$this.val(), catsWrap=jQuery('.lp-child-cats-tax'); catsWrap.html(''); catsWrap.css('height', '0px'); jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_child_cats', 'parent_id': thisVal, }, success: function(data){ if(data.term_name==null){ data.term_name='All Categories'; } jQuery('.lp-header-search.archive-search h4.lp-title').find('em').text(data.term_name); if(data.status=='found'){ catsWrap.css('height', '132px'); if(jQuery('.lp-child-cats-tax').length > 0){ catsWrap.html(data.child_cats); }else{ jQuery('.listing-simple').before('
'+ data.child_cats +'
'); } var chilCatsLoc=jQuery('.lp-child-cats-tax-slider').data('child-loc'), childCatNum=3; jQuery('.lp-child-cats-tax').addClass('style-'+chilCatsLoc); if(chilCatsLoc=='fullwidth'){ childCatNum=5; } if(jQuery('.lp-child-cats-tax-wrap').length > childCatNum){ jQuery('.lp-child-cats-tax-slider').slick({ infinite: true, slidesToShow: childCatNum, slidesToScroll: 1, prevArrow:"", nextArrow:"" }); }} }}); }); jQuery("select#searchcategory, #filter-in-header #category-select, .lp-header-search-form #category-select, .lp-header-search-form #searchlocation").change(function(){ if(jQuery('body.home').length==0){ $selectedFields=[]; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); var listStyle; var $thiscat=jQuery('select#searchcategory'); var new_design_v2=false; var new_header_filters=false; var listStyle=''; if(jQuery('#list-grid-view-v2').length!=0){ if(jQuery('#list-grid-view-v2').hasClass('header-style-v2')){ var new_header_filters=true; } if(jQuery('#list-grid-view-v2').hasClass('list_view_v2')||jQuery('#list-grid-view-v2').hasClass('grid_view_v2')){ listStyle=get_list_style(); new_design_v2=true; }} if(new_header_filters==true){ get_filters_before_send(); var averageRate=get_filter_RRV('#filter-in-header .rated-filter.header-filter-wrap'), mostRewvied=get_filter_RRV('#filter-in-header .reviewed-filter.header-filter-wrap'), mostViewed=get_filter_RRV('#filter-in-header .viewed-filter.header-filter-wrap'), inexpensive=get_price_range_vals('#filter-in-header .price-filter ul li#n-one'), moderate=get_price_range_vals('#filter-in-header .price-filter ul li#n-two'), pricey=get_price_range_vals('#filter-in-header .price-filter ul li#n-three'), ultra=get_price_range_vals('#filter-in-header .price-filter ul li#n-four'), listing_openTime=get_open_now_val('#filter-in-header .open-now-filter'), listStyle=get_list_style(), skeyword=jQuery('input#skeyword-filter').val(); if(jQuery("#searchlocation").length!=0){ seracLoc=jQuery("#searchlocation").val(); }else if(jQuery('#lp_search_loc').length!=0){ seracLoc=jQuery("#lp_search_loc").val(); }}else{ var docHeight=jQuery(document).height(); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); jQuery('#content-grids').html(' '); jQuery('.lp-filter-pagination-ajx').remove(); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); jQuery('.lp-filter-pagination').hide(); var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; listing_openTime=''; mostViewed=''; seracLoc=''; inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); mostViewed=jQuery('.search-filters li#mostviewed').find('.active').data('value'); averageRate=jQuery('.search-filters li#listingRate').find('.active').data('value'); mostRewvied=jQuery('.search-filters li#listingReviewed').find('.active').data('value'); listing_openTime=jQuery('.search-filters li.listing_openTime').find('.active').data('value'); seracLoc=jQuery("#lp_search_loc").val(); skeyword=jQuery('input#lp_current_query').val(); } var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(tags_name.length > 0){ }else{ tags_name.push(jQuery('#check_featuretax').val()); } var clatval=jQuery('#searchform input[name=clat]').val(); var clongval=jQuery('#searchform input[name=clong]').val(); if(clatval&&clongval){ }else{ clatval=jQuery("#pac-input").attr('data-lat'); clongval=jQuery("#pac-input").attr('data-lng'); } if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'lpstag': jQuery("#lpstag").val(), 'cat_id': $thiscat.val(), 'loc_id': seracLoc, 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'mostviewed':mostViewed, 'listing_openTime':listing_openTime, 'tag_name':tags_name, 'list_style': listStyle, 'skeyword': skeyword, 'clat': clatval, 'clong': clongval, 'my_bounds_ne_lat':jQuery("#pac-input").attr('data-ne-lat'), 'my_bounds_ne_lng':jQuery("#pac-input").attr('data-ne-lng'), 'my_bounds_sw_lat':jQuery("#pac-input").attr('data-sw-lat'), 'my_bounds_sw_lng':jQuery("#pac-input").attr('data-sw-lng'), 'data_zoom':jQuery('#pac-input').attr('data-zoom'), 'distance_range':jQuery("#distance_range").val() }, success: function(data){ jQuery('#full-overlay').remove(); if(data){ listing_update(data, new_design_v2, listStyle); lp_append_distance_div(); }} }); }}); jQuery(document).on('click','body.search .city-autocomplete .help, body.archive .city-autocomplete .help', function(){ $selectedFields=[]; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); var $thiscat=jQuery('select#searchcategory'); var new_design_v2=false; var new_header_filters=false; var listStyle=''; if(jQuery('#list-grid-view-v2').length!=0){ if(jQuery('#list-grid-view-v2').hasClass('header-style-v2')){ var new_header_filters=true; } if(jQuery('#list-grid-view-v2').hasClass('list_view_v2')||jQuery('#list-grid-view-v2').hasClass('grid_view_v2')){ listStyle=get_list_style(); new_design_v2=true; }} if(new_header_filters==true){ get_filters_before_send(); var averageRate=get_filter_RRV('#filter-in-header .rated-filter.header-filter-wrap'), mostRewvied=get_filter_RRV('#filter-in-header .reviewed-filter.header-filter-wrap'), mostViewed=get_filter_RRV('#filter-in-header .viewed-filter.header-filter-wrap'), inexpensive=get_price_range_vals('#filter-in-header .price-filter ul li#n-one'), moderate=get_price_range_vals('#filter-in-header .price-filter ul li#n-two'), pricey=get_price_range_vals('#filter-in-header .price-filter ul li#n-three'), ultra=get_price_range_vals('#filter-in-header .price-filter ul li#n-four'), listing_openTime=get_open_now_val('#filter-in-header .open-now-filter'), listStyle=get_list_style(), skeyword=jQuery('input#skeyword-filter').val(); if(jQuery('#searchlocation').length!=0){ seracLoc=jQuery("#searchlocation").val(); }else if(jQuery('#lp_search_loc').length!=0){ seracLoc=jQuery("#lp_search_loc").val(); }}else{ var docHeight=jQuery(document).height(); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); jQuery('#content-grids').html(' '); jQuery('.lp-filter-pagination-ajx').remove(); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); jQuery('.lp-filter-pagination').hide(); var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; listing_openTime=''; mostViewed=''; seracLoc=''; inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); mostViewed=jQuery('.search-filters li#mostviewed').find('.active').data('value'); averageRate=jQuery('.search-filters li#listingRate').find('.active').data('value'); mostRewvied=jQuery('.search-filters li#listingReviewed').find('.active').data('value'); listing_openTime=jQuery('.search-filters li.listing_openTime').find('.active').data('value'); seracLoc=jQuery("#lp_search_loc").val(); skeyword=jQuery('input#lp_current_query').val(); } var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(tags_name.length > 0){ }else{ tags_name.push(jQuery('#check_featuretax').val()); } var clatval=jQuery('#searchform input[name=clat]').val(); var clongval=jQuery('#searchform input[name=clong]').val(); if(clatval&&clongval){ }else{ clatval=jQuery("#pac-input").attr('data-lat'); clongval=jQuery("#pac-input").attr('data-lng'); } if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'lpstag': jQuery("#lpstag").val(), 'cat_id': $thiscat.val(), 'loc_id': seracLoc, 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'mostviewed':mostViewed, 'listing_openTime':listing_openTime, 'tag_name':tags_name, 'list_style': listStyle, 'skeyword': skeyword, 'clat': clatval, 'clong': clongval, 'my_bounds_ne_lat':jQuery("#pac-input").attr('data-ne-lat'), 'my_bounds_ne_lng':jQuery("#pac-input").attr('data-ne-lng'), 'my_bounds_sw_lat':jQuery("#pac-input").attr('data-sw-lat'), 'my_bounds_sw_lng':jQuery("#pac-input").attr('data-sw-lng'), 'data_zoom':jQuery('#pac-input').attr('data-zoom'), 'distance_range':jQuery("#distance_range").val() }, success: function(data){ jQuery('#full-overlay').remove(); if(data){ listing_update(data, new_design_v2, listStyle); lp_append_distance_div(); }} }); }); jQuery(document).on('change','.tags-area input[type=checkbox]',function(e){ $selectedFields=[]; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); var skeyword=''; var new_design_v2=false; var new_header_filters=false; var listStyle=''; if(jQuery('#list-grid-view-v2').length!=0){ if(jQuery('#list-grid-view-v2').hasClass('header-style-v2')){ var new_header_filters=true; } if(jQuery('#list-grid-view-v2').hasClass('list_view_v2')||jQuery('#list-grid-view-v2').hasClass('grid_view_v2')){ listStyle=get_list_style(); new_design_v2=true; }} if(new_header_filters==true){ get_filters_before_send(); var averageRate=get_filter_RRV('#filter-in-header .rated-filter.header-filter-wrap'), mostRewvied=get_filter_RRV('#filter-in-header .reviewed-filter.header-filter-wrap'), mostViewed=get_filter_RRV('#filter-in-header .viewed-filter.header-filter-wrap'), inexpensive=get_price_range_vals('#filter-in-header .price-filter ul li#n-one'), moderate=get_price_range_vals('#filter-in-header .price-filter ul li#n-two'), pricey=get_price_range_vals('#filter-in-header .price-filter ul li#n-three'), ultra=get_price_range_vals('#filter-in-header .price-filter ul li#n-four'), listing_openTime=get_open_now_val('#filter-in-header .open-now-filter'), listStyle=get_list_style(); if(jQuery('#searchlocation').length!=0){ seracLoc=jQuery("#searchlocation").val(); }else if(jQuery('#lp_search_loc').length!=0){ seracLoc=jQuery("#lp_search_loc").val(); }}else{ var docHeight=jQuery(document).height(); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(tags_name.length > 0){ }else{ tags_name.push(jQuery('#check_featuretax').val()); } jQuery('.lp-filter-pagination').hide(); jQuery('#content-grids').html(' '); jQuery('.lp-filter-pagination-ajx').remove(); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; listing_openTime=''; mostViewed=''; inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); mostViewed=jQuery('.search-filters li#mostviewed').find('.active').data('value'); averageRate=jQuery('.search-filters li#listingRate').find('.active').data('value'); mostRewvied=jQuery('.search-filters li#listingReviewed').find('.active').data('value'); listing_openTime=jQuery('.search-filters li.listing_openTime').find('.active').data('value'); skeyword=jQuery('input#lp_current_query').val(); seracLoc=jQuery("#lp_search_loc").val(); } var clatval=jQuery('#searchform input[name=clat]').val(); var clongval=jQuery('#searchform input[name=clong]').val(); if(clatval&&clongval){ }else{ clatval=jQuery("#pac-input").attr('data-lat'); clongval=jQuery("#pac-input").attr('data-lng'); } var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'lpstag': jQuery("#lpstag").val(), 'cat_id': jQuery("#searchform select#searchcategory").val(), 'loc_id': seracLoc, 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'mostviewed':mostViewed, 'listing_openTime':listing_openTime, 'tag_name':tags_name, 'list_style': listStyle, 'skeyword': skeyword, 'clat': clatval, 'clong': clongval, 'my_bounds_ne_lat':jQuery("#pac-input").attr('data-ne-lat'), 'my_bounds_ne_lng':jQuery("#pac-input").attr('data-ne-lng'), 'my_bounds_sw_lat':jQuery("#pac-input").attr('data-sw-lat'), 'my_bounds_sw_lng':jQuery("#pac-input").attr('data-sw-lng'), 'data_zoom':jQuery('#pac-input').attr('data-zoom'), 'distance_range':jQuery("#distance_range").val() }, success: function(data){ jQuery('#full-overlay').remove(); if(data){ listing_update(data, new_design_v2, listStyle); lp_append_distance_div(); }} }); e.preventDefault(); }); jQuery("ul#select-lp-more-filter li a, .currency-signs ul li a, #filter-in-header .price-filter ul li, .keyword-ajax").on('click', function(event){ event.preventDefault(); $selectedFields=[]; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); var $this=jQuery(this); $this.toggleClass('active'); var new_design_v2=false; var new_header_filters=false; var listStyle=''; if(jQuery('#list-grid-view-v2').length!=0){ if(jQuery('#list-grid-view-v2').hasClass('header-style-v2')){ var new_header_filters=true; } if(jQuery('#list-grid-view-v2').hasClass('list_view_v2')||jQuery('#list-grid-view-v2').hasClass('grid_view_v2')){ listStyle=get_list_style(); new_design_v2=true; }} if(new_header_filters==true){ get_filters_before_send(); var averageRate=get_filter_RRV('.filter-in-header .rated-filter.header-filter-wrap'), mostRewvied=get_filter_RRV('.filter-in-header .reviewed-filter.header-filter-wrap'), mostViewed=get_filter_RRV('.filter-in-header .viewed-filter.header-filter-wrap'), inexpensive=get_price_range_vals('#filter-in-header .price-filter ul li#n-one'), moderate=get_price_range_vals('#filter-in-header .price-filter ul li#n-two'), pricey=get_price_range_vals('#filter-in-header .price-filter ul li#n-three'), ultra=get_price_range_vals('#filter-in-header .price-filter ul li#n-four'), listing_openTime=get_open_now_val('#filter-in-header .open-now-filter'), listStyle=get_list_style(), skeyword=jQuery('input#skeyword-filter').val(); if(jQuery('#searchlocation').length!=0){ seracLoc=jQuery("#searchlocation").val(); }else if(jQuery('#lp_search_loc').length!=0){ seracLoc=jQuery("#lp_search_loc").val(); }}else{ var docHeight=jQuery(document).height(); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); event.preventDefault(); jQuery('.lp-filter-pagination').hide(); jQuery('.lp-filter-pagination-ajx').remove(); jQuery('#content-grids').html(' '); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; listing_openTime=''; mostViewed=''; inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); mostViewed=jQuery('.search-filters li#mostviewed').find('.active').data('value'); averageRate=jQuery('.search-filters li#listingRate').find('.active').data('value'); mostRewvied=jQuery('.search-filters li#listingReviewed').find('.active').data('value'); listing_openTime=jQuery('.search-filters li.listing_openTime').find('.active').data('value'); skeyword=jQuery('input#lp_current_query').val(); seracLoc=jQuery("#lp_search_loc").val(); } var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(tags_name.length > 0){ }else{ tags_name.push(jQuery('#check_featuretax').val()); } var clatval=jQuery('#searchform input[name=clat]').val(); var clongval=jQuery('#searchform input[name=clong]').val(); if(clatval&&clongval){ }else{ clatval=jQuery("#pac-input").attr('data-lat'); clongval=jQuery("#pac-input").attr('data-lng'); } if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'mostviewed':mostViewed, 'listing_openTime':listing_openTime, 'lpstag': jQuery("#lpstag").val(), 'tag_name':tags_name, 'cat_id': jQuery("#searchform select#searchcategory").val(), 'loc_id': seracLoc, 'list_style': listStyle, 'skeyword': skeyword, 'clat': clatval, 'clong': clongval, 'my_bounds_ne_lat':jQuery("#pac-input").attr('data-ne-lat'), 'my_bounds_ne_lng':jQuery("#pac-input").attr('data-ne-lng'), 'my_bounds_sw_lat':jQuery("#pac-input").attr('data-sw-lat'), 'my_bounds_sw_lng':jQuery("#pac-input").attr('data-sw-lng'), 'data_zoom':jQuery('#pac-input').attr('data-zoom'), 'distance_range':jQuery("#distance_range").val() }, success: function(data){ jQuery('#full-overlay').remove(); if(data){ listing_update(data, new_design_v2, listStyle); lp_append_distance_div(); }} }); }); jQuery("li.lp-search-best-matches, #filter-in-header .best-match-filter").on('click', function(event){ var $this=jQuery(this); $selectedFields=[]; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); $this.toggleClass('active'); var new_design_v2=false; var new_header_filters=false; var listStyle=''; if(jQuery('#list-grid-view-v2').length!=0){ if(jQuery('#list-grid-view-v2').hasClass('header-style-v2')){ var new_header_filters=true; } if(jQuery('#list-grid-view-v2').hasClass('list_view_v2')||jQuery('#list-grid-view-v2').hasClass('grid_view_v2')){ listStyle=get_list_style(); new_design_v2=true; }} if(new_header_filters==true){ get_filters_before_send(); if($this.hasClass('active')){ jQuery('.rated-filter.header-filter-wrap').addClass("active"); jQuery('.reviewed-filter.header-filter-wrap').addClass("active"); jQuery('.viewed-filter.header-filter-wrap').addClass("active"); jQuery('.open-now-filter').addClass('active'); }else{ jQuery('.rated-filter.header-filter-wrap').removeClass("active"); jQuery('.reviewed-filter.header-filter-wrap').removeClass("active"); jQuery('.viewed-filter.header-filter-wrap').removeClass("active"); jQuery('.open-now-filter').removeClass('active'); } var averageRate=get_filter_RRV('.filter-in-header .rated-filter.header-filter-wrap'), mostRewvied=get_filter_RRV('.filter-in-header .reviewed-filter.header-filter-wrap'), mostViewed=get_filter_RRV('.filter-in-header .viewed-filter.header-filter-wrap'), inexpensive=get_price_range_vals('#filter-in-header .price-filter ul li#n-one'), moderate=get_price_range_vals('#filter-in-header .price-filter ul li#n-two'), pricey=get_price_range_vals('#filter-in-header .price-filter ul li#n-three'), ultra=get_price_range_vals('#filter-in-header .price-filter ul li#n-four'), listing_openTime=get_open_now_val('#filter-in-header .open-now-filter'), skeyword=jQuery('input#skeyword-filter').val(); if(jQuery('#searchlocation').length!=0){ seracLoc=jQuery("#searchlocation").val(); }else if(jQuery('#lp_search_loc').length!=0){ seracLoc=jQuery("#lp_search_loc").val(); }}else{ var docHeight=jQuery(document).height(); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); event.preventDefault(); jQuery('.lp-filter-pagination').hide(); jQuery('#content-grids').html(' '); jQuery('.lp-filter-pagination-ajx').remove(); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; listing_openTime=''; mostViewed=''; inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); $this.find('a').toggleClass('active'); if($this.find('a').hasClass('active')){ jQuery('.search-filters li#mostviewed a').addClass("active"); jQuery('.search-filters li#listingRate a').addClass("active"); jQuery('.search-filters li#listingReviewed a').addClass("active"); jQuery('.search-filters li.listing_openTime a').addClass("active"); jQuery('.search-filters li.listing_openTime').find('.active').data('value', 'open'); }else{ jQuery('.search-filters li#mostviewed a').removeClass("active"); jQuery('.search-filters li#listingRate a').removeClass("active"); jQuery('.search-filters li#listingReviewed a').removeClass("active"); jQuery('.search-filters li.listing_openTime a').removeClass("active"); jQuery('.search-filters li.listing_openTime a').data('value', 'close'); } mostViewed=jQuery('.search-filters li#mostviewed').find('.active').data('value'); averageRate=jQuery('.search-filters li#listingRate').find('.active').data('value'); mostRewvied=jQuery('.search-filters li#listingReviewed').find('.active').data('value'); listing_openTime=jQuery('.search-filters li.listing_openTime').find('.active').data('value'); skeyword=jQuery('input#lp_current_query').val(); seracLoc=jQuery("#lp_search_loc").val(); } var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(tags_name.length > 0){ }else{ tags_name.push(jQuery('#check_featuretax').val()); } var clatval=jQuery('#searchform input[name=clat]').val(); var clongval=jQuery('#searchform input[name=clong]').val(); if(clatval&&clongval){ }else{ clatval=jQuery("#pac-input").attr('data-lat'); clongval=jQuery("#pac-input").attr('data-lng'); } if(listStyle==null&&jQuery('#list-grid-view-v2').length!=0){ listStyle=jQuery('#list-grid-view-v2').data('layout-class'); } if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'listing_openTime':listing_openTime, 'mostviewed':mostViewed, 'lpstag': jQuery("#lpstag").val(), 'tag_name':tags_name, 'cat_id': jQuery("#searchform select#searchcategory").val(), 'loc_id': seracLoc, 'list_style': listStyle, 'skeyword': skeyword, 'clat': clatval, 'clong': clongval, 'my_bounds_ne_lat':jQuery("#pac-input").attr('data-ne-lat'), 'my_bounds_ne_lng':jQuery("#pac-input").attr('data-ne-lng'), 'my_bounds_sw_lat':jQuery("#pac-input").attr('data-sw-lat'), 'my_bounds_sw_lng':jQuery("#pac-input").attr('data-sw-lng'), 'data_zoom':jQuery('#pac-input').attr('data-zoom'), 'distance_range':jQuery("#distance_range").val() }, success: function(data){ jQuery('#full-overlay').remove(); if(data){ listing_update(data , new_design_v2, listStyle); lp_append_distance_div(); }} }); }); jQuery(document).on('change', '.search-filter-attr input[type="checkbox"]#bestmatch', function(e){ $selectedFields=[]; listStyle=''; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); if(jQuery('.search-filter-attr input[type="checkbox"]#bestmatch').is(':checked')){ jQuery('input[type="checkbox"].listing_openTime').addClass('active'); jQuery('.search-filter-attr input[type="checkbox"]#listingRate').addClass('active'); jQuery('.search-filter-attr input[type="checkbox"]#mostviewed').addClass('active'); jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').addClass('active'); jQuery('input[type="checkbox"].listing_openTime').prop('checked', true); jQuery('.search-filter-attr input[type="checkbox"]#listingRate').prop('checked', true); jQuery('.search-filter-attr input[type="checkbox"]#mostviewed').prop('checked', true); jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').prop('checked', true); }else{ jQuery('input[type="checkbox"].listing_openTime').removeClass('active'); jQuery('.search-filter-attr input[type="checkbox"]#listingRate').removeClass('active'); jQuery('.search-filter-attr input[type="checkbox"]#mostviewed').removeClass('active'); jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').removeClass('active'); jQuery('input[type="checkbox"].listing_openTime').prop('checked', false); jQuery('.search-filter-attr input[type="checkbox"]#listingRate').prop('checked', false); jQuery('.search-filter-attr input[type="checkbox"]#mostviewed').prop('checked', false); jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').prop('checked', false); } var docHeight=jQuery(document).height(); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); e.preventDefault(); jQuery(this).toggleClass('active'); jQuery('.lp-filter-pagination').hide(); jQuery('#content-grids').html(' '); jQuery('.lp-filter-pagination-ajx').remove(); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; listing_openTime=''; mostViewed=''; inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); if(jQuery('.search-filter-attr input[type="checkbox"]#listingRate').hasClass('active')){ averageRate=jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').val(); } if(jQuery('.search-filter-attr input[type="checkbox"]#listingRate').hasClass('active')){ mostRewvied=jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').val(); } if(jQuery('.search-filter-attr input[type="checkbox"]#mostviewed').hasClass('active')){ mostViewed='mostviewed'; } if(jQuery('.search-filter-attr input[type="checkbox"].listing_openTime').hasClass('active')){ listing_openTime='open'; } if(jQuery(this).hasClass('active')){ jQuery(this).parent('label').children('.app-filter-loader').addClass('app-filter-loader-active').show().html(''); }else{ jQuery(this).parent('label').children('.app-filter-loader').hide().html(''); } var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(tags_name.length > 0){ }else{ tags_name.push(jQuery('#check_featuretax').val()); } skeyword=jQuery('input#lp_current_query').val(); seracLoc=jQuery("#lp_search_loc").val(); if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'mostviewed':mostViewed, 'listing_openTime':listing_openTime, 'lpstag': jQuery("#lpstag").val(), 'tag_name':tags_name, 'cat_id': jQuery("#searchform select#searchcategory").val(), 'loc_id': seracLoc, 'list_style': listStyle, 'skeyword': skeyword, }, success: function(data){ jQuery('.app-filter-loader-active').html(''); jQuery('#full-overlay').remove(); if(data){ listing_update(data); lp_append_distance_div(); }} }); }) jQuery(document).on('change', '.search-filter-attr input[type="checkbox"]#listingRate, .search-filter-attr input[type="checkbox"]#listingReviewed, .search-filter-attr input[type="checkbox"]#mostviewed', function(event){ event.preventDefault(); $selectedFields=[]; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); var docHeight=jQuery(document).height(); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); event.preventDefault(); jQuery(this).toggleClass('active'); jQuery('.lp-filter-pagination').hide(); jQuery('#content-grids').html(' '); jQuery('.lp-filter-pagination-ajx').remove(); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; listing_openTime=''; mostviewed=''; inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); listStyle=''; if(jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').hasClass('active')){ mostRewvied=jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').val(); } if(jQuery('.search-filter-attr input[type="checkbox"]#listingRate').hasClass('active')){ averageRate=jQuery('.search-filter-attr input[type="checkbox"]#listingRate').val(); } if(jQuery('.search-filter-attr input[type="checkbox"]#mostviewed').hasClass('active')){ mostviewed=jQuery('.search-filter-attr input[type="checkbox"]#mostviewed').val(); } if(jQuery('.search-filter-attr input[type="checkbox"].listing_openTime').hasClass('active')){ listing_openTime=jQuery('.search-filter-attr input[type="checkbox"].listing_openTime').val(); } if(jQuery(this).hasClass('active')){ jQuery(this).parent('label').children('.app-filter-loader').addClass('app-filter-loader-active').show().html(''); }else{ jQuery(this).parent('label').children('.app-filter-loader').hide().html(''); } var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(tags_name.length > 0){ }else{ tags_name.push(jQuery('#check_featuretax').val()); } skeyword=jQuery('input#lp_current_query').val(); seracLoc=jQuery("#lp_search_loc").val(); if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'mostviewed':mostviewed, 'listing_openTime':listing_openTime, 'lpstag': jQuery("#lpstag").val(), 'tag_name':tags_name, 'cat_id': jQuery("#searchform select#searchcategory").val(), 'loc_id': seracLoc, 'list_style': listStyle, 'skeyword': skeyword, }, success: function(data){ jQuery('.app-filter-loader-active').html(''); jQuery('#full-overlay').remove(); if(data){ listing_update(data); lp_append_distance_div(); }} }); }); jQuery(document).on('click', '.lp-filter-pagination-ajx ul li span.haspaglink', function(event){ $selectedFields=[]; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); jQuery('#lp-pages-in-cats').hide(200); var $this=jQuery(this); var new_design_v2=false; var new_header_filters=false; var listStyle=''; if(jQuery('#list-grid-view-v2').length!=0){ if(jQuery('#list-grid-view-v2').hasClass('header-style-v2')){ var new_header_filters=true; } if(jQuery('#list-grid-view-v2').hasClass('list_view_v2')||jQuery('#list-grid-view-v2').hasClass('grid_view_v2')){ listStyle=get_list_style(); new_design_v2=true; }} if(new_header_filters==true){ get_filters_before_send(); var averageRate=get_filter_RRV('.filter-in-header .rated-filter.header-filter-wrap'), mostRewvied=get_filter_RRV('.filter-in-header .reviewed-filter.header-filter-wrap'), mostViewed=get_filter_RRV('.filter-in-header .viewed-filter.header-filter-wrap'), inexpensive=get_price_range_vals('#filter-in-header .price-filter ul li#n-one'), moderate=get_price_range_vals('#filter-in-header .price-filter ul li#n-two'), pricey=get_price_range_vals('#filter-in-header .price-filter ul li#n-three'), ultra=get_price_range_vals('#filter-in-header .price-filter ul li#n-four'), listing_openTime=get_open_now_val('#filter-in-header .open-now-filter'), listStyle=get_list_style(), skeyword=$this.data('skeyword'); if(jQuery('#searchlocation').length!=0){ seracLoc=jQuery("#searchlocation").val(); }else if(jQuery('#lp_search_loc').length!=0){ seracLoc=jQuery("#lp_search_loc").val(); }}else{ jQuery('.lp-filter-pagination-ajx ul li span').removeClass('active'); var docHeight=jQuery(document).height(); jQuery('html, body').animate({scrollTop:0},500); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); event.preventDefault(); jQuery(this).toggleClass('active'); jQuery('#content-grids').html(' '); jQuery('.lp-filter-pagination-ajx').remove(); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; listing_openTime=''; mostViewed=''; seracLoc=''; if(jQuery('#searchlocation').length!=0){ seracLoc=jQuery("#searchlocation").val(); }else if(jQuery('#lp_search_loc').length!=0){ seracLoc=jQuery("#lp_search_loc").val(); } inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); mostViewed=jQuery('.search-filters li#mostviewed').find('.active').data('value'); averageRate=jQuery('.search-filters li#listingRate').find('.active').data('value'); mostRewvied=jQuery('.search-filters li#listingReviewed').find('.active').data('value'); listing_openTime=jQuery('.search-filters li.listing_openTime').find('.active').data('value'); skeyword=jQuery('input#lp_current_query').val(); } pageno=jQuery(this).data('pageurl'); var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(tags_name.length > 0){ }else{ tags_name.push(jQuery('#check_featuretax').val()); } var clatval=jQuery('#searchform input[name=clat]').val(); var clongval=jQuery('#searchform input[name=clong]').val(); if(clatval&&clongval){ }else{ clatval=jQuery("#pac-input").attr('data-lat'); clongval=jQuery("#pac-input").attr('data-lng'); } if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'mostviewed':mostViewed, 'listing_openTime':listing_openTime, 'lpstag': jQuery("#lpstag").val(), 'tag_name':tags_name, 'cat_id': jQuery("#searchform select#searchcategory").val(), 'loc_id': seracLoc, 'list_style': listStyle, 'pageno': pageno, 'skeyword': skeyword, 'clat': clatval, 'clong': clongval, 'my_bounds_ne_lat':jQuery("#pac-input").attr('data-ne-lat'), 'my_bounds_ne_lng':jQuery("#pac-input").attr('data-ne-lng'), 'my_bounds_sw_lat':jQuery("#pac-input").attr('data-sw-lat'), 'my_bounds_sw_lng':jQuery("#pac-input").attr('data-sw-lng'), 'data_zoom':jQuery('#pac-input').attr('data-zoom'), 'distance_range':jQuery("#distance_range").val() }, success: function(data){ $this.addClass('active'); jQuery('#full-overlay').remove(); if(data){ listing_update(data, new_design_v2, listStyle); lp_append_distance_div(); }} }); }); jQuery(document).on('click', '#filter-in-header .sort-filter-inner .rated-filter, #filter-in-header .sort-filter-inner .reviewed-filter, #filter-in-header .sort-filter-inner .viewed-filter', function (e){ $selectedFields=[]; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); get_filters_before_send(); jQuery(this).toggleClass('active'); var new_design_v2=false; var listStyle=''; if(jQuery('#list-grid-view-v2').length!=0){ new_design_v2=true; } var averageRate=get_filter_RRV('.rated-filter.header-filter-wrap'), mostRewvied=get_filter_RRV('.reviewed-filter.header-filter-wrap'), mostViewed=get_filter_RRV('.viewed-filter.header-filter-wrap'), inexpensive=get_price_range_vals('.price-filter ul li#one'), moderate=get_price_range_vals('.price-filter ul li#two'), pricey=get_price_range_vals('.price-filter ul li#three'), ultra=get_price_range_vals('.price-filter ul li#four'), listing_openTime=get_open_now_val('.open-now-filter'), listStyle=get_list_style(), skeyword=jQuery('input#skeyword-filter').val(); if(jQuery('#searchlocation').length!=0){ seracLoc=jQuery("#searchlocation").val(); }else if(jQuery('#lp_search_loc').length!=0){ seracLoc=jQuery("#lp_search_loc").val(); } var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); skeyword=jQuery('input#lp_current_query').val(); var clatval=jQuery('#searchform input[name=clat]').val(); var clongval=jQuery('#searchform input[name=clong]').val(); if(clatval&&clongval){ }else{ clatval=jQuery("#pac-input").attr('data-lat'); clongval=jQuery("#pac-input").attr('data-lng'); } if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'mostviewed':mostViewed, 'listing_openTime':listing_openTime, 'tag_name':tags_name, 'cat_id': jQuery("#category-select").val(), 'loc_id': seracLoc, 'list_style': listStyle, 'skeyword': skeyword, 'clat': clatval, 'clong': clongval, 'my_bounds_ne_lat':jQuery("#pac-input").attr('data-ne-lat'), 'my_bounds_ne_lng':jQuery("#pac-input").attr('data-ne-lng'), 'my_bounds_sw_lat':jQuery("#pac-input").attr('data-sw-lat'), 'my_bounds_sw_lng':jQuery("#pac-input").attr('data-sw-lng'), 'data_zoom':jQuery('#pac-input').attr('data-zoom'), 'distance_range':jQuery("#distance_range").val() }, success: function(data){ jQuery('#full-overlay').remove(); if(data){ listing_update(data, new_design_v2, listStyle); lp_append_distance_div(); }} }); }) jQuery(document).on('click','.search-filters li.listing_openTime a, input[type="checkbox"].listing_openTime',function(event){ var new_design_v2=false; var listStyle=''; if(jQuery('#list-grid-view-v2').length!=0){ if(jQuery('#list-grid-view-v2').hasClass('list_view_v2')||jQuery('#list-grid-view-v2').hasClass('grid_view_v2')){ new_design_v2=true; listStyle=get_list_style(); }} var docHeight=jQuery(document).height(); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); jQuery('.lp-filter-pagination').hide(); jQuery('#content-grids').html(' '); jQuery('.lp-filter-pagination-ajx').remove(); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; var listing_openTime=''; mostViewed=''; inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); if(!jQuery('body').hasClass('listing-app-view')){ mostViewed=jQuery('.search-filters li#mostviewed').find('.active').data('value'); averageRate=jQuery('.search-filters li#listingRate').find('.active').data('value'); mostRewvied=jQuery('.search-filters li#listingReviewed').find('.active').data('value'); listing_openTime=jQuery('.search-filters li.listing_openTime').find('.active').data('value'); event.preventDefault(); }else{ if(jQuery('.search-filter-attr input[type="checkbox"]#listingRate').hasClass('active')){ averageRate=jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').val(); } if(jQuery('.search-filter-attr input[type="checkbox"]#listingRate').hasClass('active')){ mostRewvied=jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').val(); }} jQuery(this).toggleClass('active'); if(jQuery(this).hasClass("active")){ jQuery(this).parent('label').children('.app-filter-loader').addClass('app-filter-loader-active').show().html(''); jQuery(this).attr('data-value', 'open'); listing_openTime='open'; }else{ jQuery(this).parent('label').children('.app-filter-loader').hide().html(''); jQuery(this).attr('data-value', 'close'); listing_openTime='close'; } var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(tags_name.length > 0){ }else{ tags_name.push(jQuery('#check_featuretax').val()); } skeyword=jQuery('input#lp_current_query').val(); if(skeyword){}else{ skeyword=jQuery('input#lp_current_query').val(); } var clatval=jQuery('#searchform input[name=clat]').val(); var clongval=jQuery('#searchform input[name=clong]').val(); if(clatval&&clongval){ }else{ clatval=jQuery("#pac-input").attr('data-lat'); clongval=jQuery("#pac-input").attr('data-lng'); } seracLoc=jQuery("#lp_search_loc").val(); if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'mostviewed':mostViewed, 'listing_openTime':listing_openTime, 'lpstag': jQuery("#lpstag").val(), 'tag_name':tags_name, 'cat_id': jQuery("#searchform select#searchcategory").val(), 'loc_id': seracLoc, 'list_style': listStyle, 'skeyword': skeyword, 'clat': clatval, 'clong': clongval, 'my_bounds_ne_lat':jQuery("#pac-input").attr('data-ne-lat'), 'my_bounds_ne_lng':jQuery("#pac-input").attr('data-ne-lng'), 'my_bounds_sw_lat':jQuery("#pac-input").attr('data-sw-lat'), 'my_bounds_sw_lng':jQuery("#pac-input").attr('data-sw-lng'), 'data_zoom':jQuery('#pac-input').attr('data-zoom'), 'distance_range':jQuery("#distance_range").val() }, success: function(data){ jQuery('.app-filter-loader-active').html(''); jQuery('#full-overlay').remove(); if(data){ listing_update(data , new_design_v2, listStyle) lp_append_distance_div(); if(data.opentime!=''){ var timevalue=''; timevalue=data.opentime; }} }}); }); jQuery(document).on('click','#filter-in-header .open-now-filter, .search-filters li#listing_openTime a, input[type="checkbox"]#listing_openTime',function(event){ $selectedFields=[]; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); jQuery(this).toggleClass('active'); var new_design_v2=false; var new_header_filters=false; var listStyle=''; if(jQuery('#list-grid-view-v2').length!=0){ if(jQuery('#list-grid-view-v2').hasClass('header-style-v2')){ var new_header_filters=true; } if(jQuery('#list-grid-view-v2').hasClass('list_view_v2')||jQuery('#list-grid-view-v2').hasClass('grid_view_v2')){ listStyle=get_list_style(); new_design_v2=true; }} if(new_header_filters==true){ get_filters_before_send(); var averageRate=get_filter_RRV('.filter-in-header .rated-filter.header-filter-wrap'), mostRewvied=get_filter_RRV('.filter-in-header .reviewed-filter.header-filter-wrap'), mostViewed=get_filter_RRV('.filter-in-header .viewed-filter.header-filter-wrap'), inexpensive=get_price_range_vals('#filter-in-header .price-filter ul li#n-one'), moderate=get_price_range_vals('#filter-in-header .price-filter ul li#n-two'), pricey=get_price_range_vals('#filter-in-header .price-filter ul li#n-three'), ultra=get_price_range_vals('#filter-in-header .price-filter ul li#n-four'), listing_openTime=get_open_now_val('#filter-in-header .open-now-filter'), listStyle=get_list_style(), skeyword=jQuery('input#skeyword-filter').val(); if(jQuery('#searchlocation').length!=0){ seracLoc=jQuery("#searchlocation").val(); }else if(jQuery('#lp_search_loc').length!=0){ seracLoc=jQuery("#lp_search_loc").val(); }}else{ var docHeight=jQuery(document).height(); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); event.preventDefault(); jQuery('.lp-filter-pagination').hide(); jQuery('#content-grids').html(' '); jQuery('.lp-filter-pagination-ajx').remove(); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; var listing_openTime=''; mostViewed=''; inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); if(!jQuery('body').hasClass('listing-app-view')){ mostViewed=jQuery('.search-filters li#mostviewed').find('.active').data('value'); averageRate=jQuery('.search-filters li#listingRate').find('.active').data('value'); mostRewvied=jQuery('.search-filters li#listingReviewed').find('.active').data('value'); listing_openTime=jQuery('.search-filters li.listing_openTime').find('.active').data('value'); }else{ if(jQuery('.search-filter-attr input[type="checkbox"]#listingRate').hasClass('active')){ averageRate=jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').val(); } if(jQuery('.search-filter-attr input[type="checkbox"]#listingRate').hasClass('active')){ mostRewvied=jQuery('.search-filter-attr input[type="checkbox"]#listingReviewed').val(); }} if(jQuery(this).hasClass("active")){ jQuery(this).parent('label').children('.app-filter-loader').addClass('app-filter-loader-active').show().html(''); jQuery(this).attr('data-value', 'open'); listing_openTime='open'; }else{ jQuery(this).parent('label').children('.app-filter-loader').hide().html(''); jQuery(this).attr('data-value', 'close'); listing_openTime='close'; } skeyword=jQuery('input#lp_current_query').val(); skeyword=jQuery('input#lp_current_query').val(); seracLoc=jQuery("#lp_search_loc").val(); } var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(tags_name.length > 0){ }else{ tags_name.push(jQuery('#check_featuretax').val()); } var clatval=jQuery('#searchform input[name=clat]').val(); var clongval=jQuery('#searchform input[name=clong]').val(); if(clatval&&clongval){ }else{ clatval=jQuery("#pac-input").attr('data-lat'); clongval=jQuery("#pac-input").attr('data-lng'); } if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'mostviewed':mostViewed, 'listing_openTime':listing_openTime, 'lpstag': jQuery("#lpstag").val(), 'tag_name':tags_name, 'cat_id': jQuery("#searchform select#searchcategory").val(), 'loc_id': seracLoc, 'list_style': listStyle, 'skeyword': skeyword, 'clat': clatval, 'clong': clongval, 'my_bounds_ne_lat':jQuery("#pac-input").attr('data-ne-lat'), 'my_bounds_ne_lng':jQuery("#pac-input").attr('data-ne-lng'), 'my_bounds_sw_lat':jQuery("#pac-input").attr('data-sw-lat'), 'my_bounds_sw_lng':jQuery("#pac-input").attr('data-sw-lng'), 'data_zoom':jQuery('#pac-input').attr('data-zoom'), 'distance_range':jQuery("#distance_range").val() }, success: function(data){ jQuery('.app-filter-loader-active').html(''); jQuery('#full-overlay').remove(); if(data){ listing_update(data, new_design_v2, listStyle); lp_append_distance_div(); if(data.opentime!=''){ var timevalue=''; timevalue=data.opentime; }} }}); }); jQuery(document).on('click', '.add-to-fav',function(e){ e.preventDefault() $this=jQuery(this); $this.find('i').addClass('fa-spin fa-spinner'); var val=jQuery(this).data('post-id'); var type=jQuery(this).data('post-type'); jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'listingpro_add_favorite', 'post-id': val, 'type': type, }, success: function(data){ if(data){ if(data.active=='yes'){ $this.removeClass('add-to-fav'); $this.addClass('remove-fav'); $this.find('i').removeClass('fa-spin fa-spinner'); if(data.type=='grids'||data.type=='list'){ var successText=$this.data('success-text'); $this.find('span').text(successText); $this.find('.fa').removeClass('fa-bookmark-o'); $this.find('.fa').addClass('fa-bookmark'); }else{ var successText=$this.data('success-text'); $this.find('span').text(successText); $this.find('i').removeClass('fa-bookmark-o'); $this.find('i').addClass('fa-bookmark'); }} }} }); }); jQuery(document).on('click', '.remove-fav', function(e){ e.preventDefault() var val=jQuery(this).data('post-id'); jQuery(this).find('i').removeClass('fa-close'); jQuery(this).find('i').addClass('fa-spinner fa-spin'); $this=jQuery(this); jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'listingpro_remove_favorite', 'post-id': val, }, success: function(data){ if(data){ if(data.remove=='yes'){ $this.removeClass('remove-fav'); $this.find('span').text(data.remove_text); $this.addClass('add-to-fav'); $this.find('.fa').removeClass('fa-spinner fa-spin'); $this.find('.fa').addClass('fa-bookmark-o'); if(jQuery('.page-template-template-favourites').length!=0){ $this.closest(".lp-grid-box-contianer").fadeOut(); $this.closest(".lp-listing-outer-container").fadeOut(); }} }} }); }); }); jQuery(document).ready(function($){ jQuery('#lp-find-near-me a.near-me-btn, .lp-header-search-filters .near-me-filter').on('click', function(event){ $this=jQuery(this); $selectedFields=[]; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); event.preventDefault(); var docHeight=jQuery(document).height(); var clatval=''; var clongval=''; var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; listing_openTime=''; mostViewed=''; if($this.hasClass("active")){ showPositionResults('', ''); jQuery('.lp-tooltip-div-hidden').removeClass('active'); }else{ getLocation(); } function getLocation(){ if(navigator.geolocation){ navigator.geolocation.getCurrentPosition(showPosition, showError); }else{ x.innerHTML="Geolocation is not supported by this browser."; }} function showPosition(position){ var clat=position.coords.latitude; var clong=position.coords.longitude; jQuery('.lp-tooltip-div-hidden').addClass('active'); showPositionResults(clat, clong); } function showError(error){ alert('Sorry! nearme will not work untill you share your location'); } function showPositionResults(clat, clong){ $this.toggleClass("active"); jQuery('#searchform input[name=clat]').val(clat); jQuery('#searchform input[name=clong]').val(clong); clatval=clat; clongval=clong; var new_design_v2=false; var new_header_filters=false; var listStyle=''; if(jQuery('#list-grid-view-v2').length!=0){ if(jQuery('#list-grid-view-v2').hasClass('header-style-v2')){ var new_header_filters=true; } if(jQuery('#list-grid-view-v2').hasClass('list_view_v2')||jQuery('#list-grid-view-v2').hasClass('grid_view_v2')){ listStyle=get_list_style(); new_design_v2=true; }} if(new_header_filters==true){ get_filters_before_send(); var averageRate=get_filter_RRV('.filter-in-header .rated-filter.header-filter-wrap'), mostRewvied=get_filter_RRV('.filter-in-header .reviewed-filter.header-filter-wrap'), mostViewed=get_filter_RRV('.filter-in-header .viewed-filter.header-filter-wrap'), inexpensive=get_price_range_vals('#filter-in-header .price-filter ul li#n-one'), moderate=get_price_range_vals('#filter-in-header .price-filter ul li#n-two'), pricey=get_price_range_vals('#filter-in-header .price-filter ul li#n-three'), ultra=get_price_range_vals('#filter-in-header .price-filter ul li#n-four'), listing_openTime=get_open_now_val('#filter-in-header .open-now-filter'), listStyle=get_list_style(), skeyword=jQuery('input#skeyword-filter').val(); if(jQuery('#searchlocation').length!=0){ seracLoc=jQuery("#searchlocation").val(); }else if(jQuery('#lp_search_loc').length!=0){ seracLoc=jQuery("#lp_search_loc").val(); }}else{ jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); jQuery('.lp-filter-pagination').hide(); jQuery('.lp-filter-pagination-ajx').remove(); jQuery('#content-grids').html(' '); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); mostViewed=jQuery('.search-filters li#mostviewed').find('.active').data('value'); averageRate=jQuery('.search-filters li#listingRate').find('.active').data('value'); mostRewvied=jQuery('.search-filters li.listingReviewed').find('.active').data('value'); listing_openTime=jQuery('.search-filters li#listing_openTime, .search-filters li.listing_openTime').find('.active').data('value'); skeyword=jQuery('input#lp_current_query').val(); seracLoc=jQuery("#lp_search_loc").val(); } var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); seracLoc=jQuery("#lp_search_loc").val(); if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'lpstag': jQuery("#lpstag").val(), 'cat_id': jQuery("#searchform select#searchcategory").val(), 'loc_id': seracLoc, 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'mostviewed':mostViewed, 'listing_openTime':listing_openTime, 'tag_name':tags_name, 'list_style': listStyle, 'skeyword': skeyword, 'clat': clatval, 'clong': clongval, 'my_bounds_ne_lat':jQuery("#pac-input").attr('data-ne-lat'), 'my_bounds_ne_lng':jQuery("#pac-input").attr('data-ne-lng'), 'my_bounds_sw_lat':jQuery("#pac-input").attr('data-sw-lat'), 'my_bounds_sw_lng':jQuery("#pac-input").attr('data-sw-lng'), 'data_zoom':jQuery('#pac-input').attr('data-zoom'), 'distance_range':jQuery("#distance_range").val() }, success: function(data){ jQuery('#full-overlay').remove(); if(data){ listing_update(data, new_design_v2, listStyle); lp_append_distance_div(); }} }); }}); }); function lp_append_distance_div(){ if(jQuery(document).find('.lp-nearby-dist-data').length!=0){ jQuery(document).find(".lp-nearby-dist-data").each(function(){ var $this=jQuery(this); disdata=$this.data('lpnearbydist'); $this.next('.lp-grid-box-contianer').find('.lp-grid-box-bottom .pull-left').after('
'+disdata+'
'); $this.next('.lp-grid-box-contianer').find('.lp-grid-box-bottom-app-view .pull-left').after('
'+disdata+'
'); }); }} function decode_utf8(utf8String){ if(typeof utf8String!='string') throw new TypeError('parameter ‘utf8String’ is not a string'); const unicodeString=utf8String.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g, function(c){ var cc=((c.charCodeAt(0)&0x0f)<<12) | ((c.charCodeAt(1)&0x3f)<<6) |(c.charCodeAt(2)&0x3f); return String.fromCharCode(cc); } ).replace(/[\u00c0-\u00df][\u0080-\u00bf]/g, function(c){ var cc=(c.charCodeAt(0)&0x1f)<<6 | c.charCodeAt(1)&0x3f; return String.fromCharCode(cc); } ); return unicodeString; } function listing_update(data , new_design_v2, listStyle){ jQuery('.outer_all_page_overflow').slideUp(); var pars=decode_utf8(data.html); if(new_design_v2==true){ if(listStyle=='list'){ listStyle='list-style'; } if(listStyle=='grid'){ listStyle='grid-style'; } var parsHtml='
' + '
' + pars + '
' + '
' + '
' + '
'; jQuery('#content-grids').hide(); jQuery('#content-grids').html(parsHtml); if(listStyle=='grid-style'){ if(jQuery('.lp-sidebar').length!=0||jQuery('.sidemap-fixed').length!=0){ jQuery('.lp-listings-inner-wrap .loop-switch-class').removeClass('col-md-12').addClass('col-md-6'); }else{ jQuery('.lp-listings-inner-wrap .loop-switch-class').removeClass('col-md-12').addClass('col-md-4'); }} if(listStyle=='list-style'){ jQuery('.lp-listings-inner-wrap .loop-switch-class').removeClass('col-md-6').addClass('col-md-12'); } jQuery('.loop-switch-class:last').find('.lp-listing').addClass('last'); jQuery('#content-grids').fadeIn('slow'); jQuery('#content-grids').removeClass('content-loading'); if(jQuery('.lp-countdown').length!=0){ jQuery('.lp-countdown').each(function (i, obj){ var selector='#'+jQuery(this).attr('id'); init_countdown(selector); }) }}else{ jQuery('#content-grids').hide(); jQuery('#content-grids').html(pars); jQuery('#content-grids').fadeIn('slow'); jQuery('#content-grids').removeClass('content-loading'); } var taxonomy=jQuery('section.taxonomy').attr('id'); if(taxonomy=='location'){ if(data.cat!=''){ var CatName=data.cat; CatName=CatName.replace('&', '&'); jQuery('.filter-top-section .lp-title span.term-name').html(CatName+' Listings In '); jQuery('.filter-top-section .lp-title span.font-bold:last-child').text(data.city); }}else if(taxonomy=='listing-category'){ if(data.cat!=''){ var CatName=data.cat; CatName=CatName.replace('&', '&'); jQuery('.filter-top-section .lp-title span.term-name').text(CatName); }else{ CatName=''; jQuery('.filter-top-section .lp-title span.term-name').text(CatName); }}else if(taxonomy=='features'){ jQuery('.showbread').show(); jQuery('.fst-term').html(data.tags); if(data.keyword!=''){ jQuery('.s-term').html(', keyword "'+data.keyword+'"'); }else{ jQuery('.s-term').html(' '); } if(data.city!=''){ if(data.cat!=''){ jQuery('.sec-term').html('& '+data.city); }else{ jQuery('.sec-term').html(data.city); }}else{ jQuery('.sec-term').html(' '); } if(data.tags!=''){ jQuery('.tag-term').html(', tagged ('+data.tags+')'); } if(data.tags==null){ jQuery('.tag-term').html(''); }} else if(taxonomy=='keyword'){ jQuery('.showbread').show(); jQuery('.fst-term').html(data.cat); if(data.keyword!=''){ jQuery('.s-term').html(', keyword "'+data.keyword+'"'); }else{ jQuery('.s-term').html(' '); } if(data.city!=''){ if(data.cat!=''){ jQuery('.sec-term').html('& '+data.city); }else{ jQuery('.sec-term').html(data.city); }}else{ jQuery('.sec-term').html(' '); } if(data.tags!=''){ jQuery('.tag-term').html(', tagged ('+data.tags+')'); } if(data.tags==null){ jQuery('.tag-term').html(''); }}else{ if(data.cat!=''){ var CatName=data.cat; CatName=CatName.replace('&', '&'); jQuery('.filter-top-section .lp-title span.term-name').text(CatName); }} if(jQuery(this).width() > 781){ jQuery(".all-list-map").trigger('click'); } if(data.found > 0&&jQuery(window).width() < 781){ jQuery(".listing-app-view-bar .right-icons .map-view-icon").trigger('click'); jQuery(".open-app-view").trigger('click'); } jQuery(".v2-map-load .v2mapwrap").trigger('click'); } jQuery(document).ready(function(){ jQuery(document).on('click', '#distance_range_div', function(){ jQuery('#pac-input').attr('data-zoom', ''); listingproc_update_results(); }); jQuery(document).on('input', '#distance_range_div .slider', function(){ jQuery('#pac-input').attr('data-zoom', ''); listingproc_update_results(); }); }); function listingproc_update_results(){ $selectedFields=[]; jQuery('.lp_extrafields_select :checked').each(function(i, selectedElement){ $selectedFields[i]=jQuery(selectedElement).val(); }); var new_design_v2=false; var listStyle=''; if(jQuery('#list-grid-view-v2').length!=0){ if(jQuery('#list-grid-view-v2').hasClass('list_view_v2')||jQuery('#list-grid-view-v2').hasClass('grid_view_v2')){ new_design_v2=true; listStyle=get_list_style(); }} var docHeight=jQuery(document).height(); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); jQuery('#content-grids').html(' '); jQuery('.solitaire-infinite-scroll').remove(); jQuery('#content-grids').addClass('content-loading'); jQuery('.map-view-list-container').remove(); jQuery('.lp-filter-pagination-ajx').remove(); var inexpensive=''; moderate=''; pricey=''; ultra=''; averageRate=''; mostRewvied=''; listing_openTime=''; mostViewed=''; inexpensive=jQuery('.currency-signs #one').find('.active').data('price'); moderate=jQuery('.currency-signs #two').find('.active').data('price'); pricey=jQuery('.currency-signs #three').find('.active').data('price'); ultra=jQuery('.currency-signs #four').find('.active').data('price'); skeyword=jQuery('input#lp_current_query').val(); averageRate=jQuery('.search-filters li#listingRate').find('.active').data('value'); mostRewvied=jQuery('.search-filters li#listingReviewed').find('.active').data('value'); listing_openTime=jQuery('.search-filters li.listing_openTime').find('.active').data('value'); var clatval=jQuery('#searchform input[name=clat]').val(); var clongval=jQuery('#searchform input[name=clong]').val(); if(clatval&&clongval){ }else{ clatval=jQuery("#pac-input").attr('data-lat'); clongval=jQuery("#pac-input").attr('data-lng'); } var tags_name=[]; tags_name=jQuery('.tags-area input[type=checkbox]:checked').map(function(){ return jQuery(this).val(); }).get(); if(tags_name.length > 0){ }else{ tags_name.push(jQuery('#check_featuretax').val()); } seracLoc=jQuery("#lp_search_loc").val(); if(check_if_loc_disabled_fornearme()){ seracLoc=''; } jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_search_term_object.ajaxurl, data: { 'action': 'ajax_search_tags', 'formfields': $selectedFields, 'lpstag': jQuery("#lpstag").val(), 'cat_id': jQuery("#searchform select#searchcategory").val(), 'loc_id': seracLoc, 'sloc_address':jQuery("#pac-input").val(), 'clat':clatval, 'clong':clongval, 'my_bounds_ne_lat':jQuery("#pac-input").attr('data-ne-lat'), 'my_bounds_ne_lng':jQuery("#pac-input").attr('data-ne-lng'), 'my_bounds_sw_lat':jQuery("#pac-input").attr('data-sw-lat'), 'my_bounds_sw_lng':jQuery("#pac-input").attr('data-sw-lng'), 'data_zoom':jQuery('#pac-input').attr('data-zoom'), 'distance_range':jQuery("#distance_range").val(), 'skeyword': skeyword, 'inexpensive':inexpensive, 'moderate':moderate, 'pricey':pricey, 'ultra':ultra, 'averageRate':averageRate, 'mostRewvied':mostRewvied, 'listing_openTime':listing_openTime, 'tag_name':tags_name, 'list_style': listStyle }, success: function(data){ jQuery('#full-overlay').remove(); if(data){ listing_update(data, new_design_v2, listStyle); lp_append_distance_div(); }} }); } function initialize(){ if(jQuery('#pac-input').length){ var input=document.getElementById('pac-input'); var autocomplete=new google.maps.places.Autocomplete(input); autocomplete.addListener('place_changed', function (){ var place=autocomplete.getPlace(); jQuery('#pac-input').attr('data-zoom', ''); var loc_lat=place.geometry.location.lat(); var loc_lng=place.geometry.location.lng(); jQuery('#pac-input').attr('data-lat', loc_lat); jQuery('#pac-input').attr('data-lng', loc_lng); jQuery('#pac-input').attr('data-center-lat', place.geometry.viewport.getCenter().lat()); jQuery('#pac-input').attr('data-center-lng', place.geometry.viewport.getCenter().lng()); jQuery('#pac-input').attr('data-ne-lat', place.geometry.viewport.getNorthEast().lat()); jQuery('#pac-input').attr('data-ne-lng', place.geometry.viewport.getNorthEast().lng()); jQuery('#pac-input').attr('data-sw-lat', place.geometry.viewport.getSouthWest().lat()); jQuery('#pac-input').attr('data-sw-lng', place.geometry.viewport.getSouthWest().lng()); listingproc_update_results(); }); }} function listingproc_get_radius(center_lat, center_lng, ne_lat, ne_lng){ var r=6371.0; var lat1=center_lat / 57.2958; var lon1=center_lng / 57.2958; var lat2=ne_lat / 57.2958; var lon2=ne_lng / 57.2958; return r * Math.acos(Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) * Math.cos(lat2) * Math.cos(lon2 - lon1)); } function getLocation(){ if(navigator.geolocation){ navigator.geolocation.getCurrentPosition(initMap); }} function initMap(position){ var geocoder=new google.maps.Geocoder(); geocodeLatLng(geocoder, position.coords.latitude, position.coords.longitude); } function geocodeLatLng(geocoder, lat, lng){ var latlng={lat:lat, lng:lng}; geocoder.geocode({'location': latlng}, function(results, status){ if(status==='OK'){ if(results[1]){ jQuery('#pac-input').attr('data-zoom', ''); jQuery('#pac-input').val(results[1].formatted_address); jQuery('#pac-input').attr('data-lat', lat); jQuery('#pac-input').attr('data-lng', lng); listingproc_update_results(); }} }); } function listingproc_update_markers(map){ map.on('zoomend dragend', function(){ var bounds=map.getBounds(); window.bounds=bounds; console.log(window.bounds); jQuery('#pac-input').attr('data-zoom', 'yes'); jQuery('#pac-input').attr('data-ne-lat', bounds._northEast.lat); jQuery('#pac-input').attr('data-ne-lng', bounds._northEast.lng); jQuery('#pac-input').attr('data-sw-lat', bounds._southWest.lat); jQuery('#pac-input').attr('data-sw-lng', bounds._southWest.lng); listingproc_update_results(); }); } var hasOwnProperty=Object.prototype.hasOwnProperty; function listingproc_isEmpty(obj){ if(obj==null) return true; if(obj.length > 0) return false; if(obj.length===0) return true; if(typeof obj!=="object") return true; for (var key in obj){ if(hasOwnProperty.call(obj, key)) return false; } return true; } jQuery(document).ready(function($){ jQuery('.lp-radus-filter-wrap li.lp-tooltip-outer .lp-distancesearchbtn').on('click', function(){ $this=jQuery(this); $this.toggleClass('active'); if($this.hasClass('active')){ if(navigator.geolocation){ navigator.geolocation.getCurrentPosition(showPositionn); }else{ alert("Geolocation is not supported by this browser."); } function showPositionn(position){ var loc_lat=position.coords.latitude; var loc_lng=position.coords.longitude; var myLatlng=new google.maps.LatLng(loc_lat, loc_lng); var mapProp={ center: myLatlng, zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map=new google.maps.Map(document.getElementById("lp-hidden-map"), mapProp); var viewportBox; google.maps.event.addListener(map, 'idle', function(event){ var bounds=map.getBounds(); var ne=bounds.getNorthEast(); var sw=bounds.getSouthWest(); var viewportPoints=[ ne, new google.maps.LatLng(ne.lat(), sw.lng()), sw, new google.maps.LatLng(sw.lat(), ne.lng()), ne ]; if(viewportBox){ viewportBox.setPath(viewportPoints); }else{ viewportBox=new google.maps.Polyline({ path: viewportPoints, strokeColor: '#FF0000', strokeOpacity: 1.0, strokeWeight: 4 }); viewportBox.setMap(map); }; var geocoder=geocoder=new google.maps.Geocoder(); var faddress; geocoder.geocode({ 'latLng': myLatlng }, function (results, status){ if(status==google.maps.GeocoderStatus.OK){ if(results[1]){ faddress=results[1].formatted_address; jQuery('#pac-input').val(faddress); jQuery('#pac-input').attr('data-lat', loc_lat); jQuery('#pac-input').attr('data-lng', loc_lng); jQuery('#pac-input').attr('data-ne-lat', ne.lat()); jQuery('#pac-input').attr('data-ne-lng', ne.lng()); jQuery('#pac-input').attr('data-sw-lat', sw.lat()); jQuery('#pac-input').attr('data-sw-lng', sw.lng()); listingproc_update_results(); }} }); }); }}else{ jQuery('#pac-input').val(''); jQuery('#pac-input').attr('data-lat', ''); jQuery('#pac-input').attr('data-lng', ''); jQuery('#pac-input').attr('data-center-lat', ''); jQuery('#pac-input').attr('data-center-lng', ''); jQuery('#pac-input').attr('data-ne-lat', ''); jQuery('#pac-input').attr('data-ne-lng', ''); jQuery('#pac-input').attr('data-sw-lat', ''); jQuery('#pac-input').attr('data-sw-lng', ''); jQuery('#distance_range').val(''); listingproc_update_results(); }}); jQuery('input.lp-suggested-search').on('input', function(){ jQuery('input#lp_s_cat').val(''); jQuery('input#lp_s_tag').val(''); }); }); function get_list_style(){ var returnval='list'; if(jQuery('.lp-listings.grid-style').hasClass('active-view')){ returnval='grid'; } return returnval; } function get_filters_before_send(){ var docHeight=jQuery(document).height(); jQuery("body").prepend('
'); jQuery('#full-overlay').css('height',docHeight+'px'); jQuery('.lp-filter-pagination').hide(); if(jQuery('.search-filter-response').length!=0){ jQuery('.search-filter-response').html(' '); jQuery('.search-filter-response').addClass('content-loading'); }else{ jQuery('#content-grids').html(' '); jQuery('#content-grids').addClass('content-loading'); } jQuery('.lp-filter-pagination-ajx').remove(); jQuery('.map-view-list-container').remove(); } function get_filter_RRV(selector){ var $this=jQuery(selector); if($this.hasClass('active')){ return $this.data('value'); }else{ return ''; }} function get_open_now_val(selector){ var $this=jQuery(selector), returnval=''; if($this.hasClass('active')){ returnval='open'; } return returnval; } function get_price_range_vals(selector){ var $this=jQuery(selector); if($this.hasClass('active')){ return $this.data('price'); }else{ return ''; }} jQuery(document).ready(function(){ jQuery('.outer_filter_show_result_cancel #filter_result').on('click', function(){ jQuery('.outer_all_page_overflow').hide(300); }); }); function check_if_loc_disabled_fornearme(){ if(jQuery('body').data('locdisablefilter')=='yes'){ if(jQuery('.near-me-btn').hasClass('active')){ return true; }else{ return false; }}else{ return false; }}; jQuery(document).ready(function($){ jQuery('#claimform').on('submit', function(e){ $this=jQuery(this); $this.find('.statuss').html(''); jQuery(this).find('.formsubmitting').css('visibility','visible'); e.preventDefault(); var formData=$(this).serialize(); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'listingpro_claim_list', 'formData': formData, }, success: function(res){ if(jQuery("form#claimform .g-recaptcha-response").length){ lp_reset_grecaptcha(); } $this.find('.formsubmitting').css('visibility','hidden'); $this.find('.statuss').html(res.state); $this[0].reset(); }}); }); jQuery('#claimformmobile').on('submit', function(e){ $this=jQuery(this); $this.find('.statuss').html(''); jQuery(this).find('.formsubmitting').css('visibility','visible'); e.preventDefault(); var formData=$(this).serialize(); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'listingpro_claim_list', 'formData': formData, }, success: function(res){ if(jQuery("form#claimformmobile .g-recaptcha-response").length){ lp_reset_grecaptcha(); } $this.find('.formsubmitting').css('visibility','hidden'); $this.find('.statuss').html(res.state); $this[0].reset(); }}); }); jQuery('#contactOwner').on('submit', function(e){ $this=jQuery(this); e.preventDefault(); var lEmail=jQuery('#email7').val(), lName=jQuery('#name7').val(), lMsg=jQuery('#message7').val(), proceedIt=true; if(lEmail==''||lName==''||lMsg==''){ if(lEmail==''){ jQuery('#email7').addClass('error-msg'); }else{ jQuery('#email7').removeClass('error-msg'); } if(lName==''){ jQuery('#name7').addClass('error-msg'); }else{ jQuery('#name7').removeClass('error-msg'); } if(lMsg==''){ jQuery('#message7').addClass('error-msg'); }else{ jQuery('#message7').removeClass('error-msg'); } proceedIt=false; } if(jQuery('input:checkbox.lp-required-field').length > 0){ if(jQuery('input:checkbox.lp-required-field', this).is(':checked')){ jQuery('input:checkbox.lp-required-field').closest('label').removeClass('error-msg'); }else{ jQuery('input:checkbox.lp-required-field').closest('label').addClass('error-msg'); proceedIt=false; }} if(jQuery('input:radio.lp-required-field').length > 0){ if(jQuery('input:radio.lp-required-field', this).is(':checked')){ jQuery('input:radio.lp-required-field').closest('label').removeClass('error-msg'); }else{ jQuery('input:radio.lp-required-field').closest('label').addClass('error-msg'); proceedIt=false; }} if(jQuery('#contactOwner .lp-required-field').length > 0){ jQuery('#contactOwner .lp-required-field').each(function (index){ var $this=jQuery(this), $thisVal=$this.val(), $thisType=$this.attr('type'); if($this.prop('tagName')=='SELECT'){ if($thisVal==0){ proceedIt=false; $this.addClass('error-msg'); }else{ $this.removeClass('error-msg'); }}else{ if($thisVal==''){ proceedIt=false; $this.addClass('error-msg'); alert('5'); }else{ $this.removeClass('error-msg'); }} }); } if(proceedIt===false){ return proceedIt; } var formData=$(this).serialize(); $this.find('.lp-search-icon').removeClass('fa-send'); $this.find('.lp-search-icon').addClass('fa-spinner fa-spin'); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'listingpro_contactowner', 'formData': formData, }, success: function(res){ if(jQuery("form#contactOwner .g-recaptcha-response").length){ lp_reset_grecaptcha(); } if(res.result==="fail"){ jQuery.each(res.errors, function (k, v){ if(k==="email"){ jQuery("input[name='email7']").addClass('error-msg'); } if(k==="message"){ jQuery("textarea[name='message7']").addClass('error-msg'); } if(k==="name7"){ jQuery("input[name='name7']").addClass('error-msg'); } $this.find('.lp-search-icon').removeClass('fa-spinner fa-spin'); $this.find('.lp-search-icon').addClass('fa-cross'); }); }else{ $this.find('.lp-search-icon').removeClass('fa-spinner fa-spin'); $this.find('.lp-search-icon').addClass('fa-check'); jQuery('.lp-lead-success-msg-outer').fadeIn('700'); $this[0].reset(); }} }); }); jQuery('.lp-change-proceed-link').on('click', function(e){ jQuery('div.lp-existing-plane-container').slideToggle(700); jQuery('div.lp-new-plane-container').slideToggle(700); e.preventDefault(); }) jQuery('.lp-role-back-to-current-plan').on('click', function(e){ jQuery('div.lp-existing-plane-container').slideToggle(700); jQuery('div.lp-new-plane-container').slideToggle(700); e.preventDefault(); }) jQuery('.lp-change-plan-btn').on('click', function(e){ var listing_id=''; var listing_status=''; var plan_title=''; var plan_price=''; var haveplan=''; listing_id=jQuery(this).data('listingid'); plan_title=jQuery(this).data('plantitle'); plan_price=jQuery(this).data('planprice'); haveplan=jQuery(this).data('haveplan'); listing_status=jQuery(this).data('listingstatus'); jQuery('.lp-selected-plan-price h3').html(''); jQuery('.lp-selected-plan-price h3').text(plan_title); jQuery('.lp-selected-plan-price h4').html(''); jQuery('.lp-selected-plan-price h4').html(plan_price); jQuery('#select-plan-form input#listing_id').val(listing_id); jQuery('#select-plan-form input#listing_statuss').val(listing_status); e.preventDefault(); }); jQuery('#select-plan-form').submit(function(event){ var plan_id=''; $this=jQuery(this); listing_idd=''; listing_status=''; listing_idd=jQuery("input[name='plans-posts']:checked").val(); listing_id=jQuery("input[name='listing-id']").val(); listing_status=jQuery("input[name='listing_status']").val(); jQuery('.lp-change-plane-status .lp-action-div').html(''); if(typeof(listing_idd)!=="undefined"){ jQuery("div.lp-expire-update-status").html(''); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'listingpro_change_plan', 'ch_plan_id': listing_idd, 'ch_listing_id': listing_id, 'ch_listing_status': listing_status, }, success: function(data){ if(data.subscribed){ if(data.subscribed=="yes"){ alert(data.alertmsg); }} jQuery("div.lp-expire-update-status").html(''); jQuery('.lp-change-plane-status .lp-action-div').html(''); jQuery('.lp-change-plane-status .lp-action-div').html(data.action); }}); } event.preventDefault(); }) }); jQuery(document).on('click', '.lp_change_plan_action', function(e){ var planid=jQuery('.lp-action-div input[name="planid"]').val(); var listingid=jQuery('.lp-action-div input[name="listingid"]').val(); jQuery('.lp-action-div').html(''); jQuery("div.lp-expire-update-status").html(''); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'listingpro_change_plan_proceeding', 'plan_iddd': planid, 'listing_iddd': listingid, }, success: function(data){ jQuery("div.lp-expire-update-status").html(''); jQuery("div.lp-expire-update-status").html(data.message); }}); e.preventDefault(); }) jQuery(document).on('click', 'a.delete-subsc-btn', function(e){ e.preventDefault(); var $this=jQuery(this), cMsg=$this.data('cmsg'); var r=confirm(cMsg); if(r==true){ jQuery('body').addClass('listingpro-loading'); var subscript_id=jQuery(this).attr('href'); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'listingpro_cancel_subscription_proceeding', 'subscript_id': subscript_id, }, success: function(data){ jQuery('body').removeClass('listingpro-loading'); alert(data.msg); if(data.status=="success"){ $this.closest('tr').slideToggle(); }}, error: function(jqXHR, textStatus, errorThrown){ jQuery('body').removeClass('listingpro-loading'); console.log(textStatus, errorThrown); }}); }}); jQuery(document).on('click', '#lp-report-listing a#lp-report-this-listing, #lp-report-review a#lp-report-this-review, .lp-review-right-bottom a#lp-report-this-review', function(e){ var $this=jQuery(this); var $posttype=$this.data('posttype'); var $postid=$this.data('postid'); var $reportedby=$this.data('reportedby'); jQuery('body').addClass('listingpro-loading'); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'listingpro_report_this_post', 'posttype': $posttype, 'postid': $postid, 'reportedby': $reportedby }, success: function(data){ jQuery('body').removeClass('listingpro-loading'); jQuery('div.lp-top-notification-bar').html(''); var alertmsgs=''; if(data.status==="success"){ alertmsgs='
'+data.msg+'
'; jQuery('div.lp-top-notification-bar').html(alertmsgs); }else{ alertmsgs='
'+data.msg+'
'; jQuery('div.lp-top-notification-bar').html(alertmsgs); } jQuery('div.lp-top-notification-bar').slideDown('slow').delay(2000).slideUp('slow'); }, error: function(jqXHR, textStatus, errorThrown){ jQuery('body').removeClass('listingpro-loading'); console.log(textStatus, errorThrown); }}); e.preventDefault(); }) jQuery(document).on('click', 'div.lp_user_stats_btn, ul li .lp_stats_duratonBtn', function(e){ $this=jQuery(this); if($this.hasClass('active')&&($this.hasClass('lp_user_stats_btn'))){}else{ jQuery('div.lp_user_stats_btn').removeClass('active'); jQuery("#lpgraph").empty(); $duration=jQuery('ul li .lp_stats_duratonBtn.active').data('chartduration'); $type=$this.data('type'); jQuery('ul.lp_stats_duration_filter li button').data('type', $type); jQuery('body').addClass('listingpro-loading'); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'listingpro_show_bar_chart', 'type': $type, 'duration': $duration, }, success: function(data){ jQuery('body').removeClass('listingpro-loading'); jQuery('ul.lp_stats_duration_filter').show(); showthischart(data.data, $type); jQuery('.lp_user_stats_btn.active p.lpstatsnumber').text(''); jQuery('.lp_user_stats_btn.active p.lpstatsnumber').text(data.counts); jQuery('.lp_user_stats_btn.active').find('.lp_status_duration_counter').text(''); jQuery('.lp_user_stats_btn.active').find('.lp_status_duration_counter').text(data.resp); }, error: function(jqXHR, textStatus, errorThrown){ jQuery('body').removeClass('listingpro-loading'); console.log(textStatus, errorThrown); }}); }}); function showthischart($datarray, $type){ Morris.Bar({ element: 'lpgraph', data:$datarray, xkey: 'x', ykeys: ['y'], labels: [$type] }); if($type=="view"){ jQuery('div.lpviewchart').addClass('active'); }else if($type=="leads"){ jQuery('div.lpviewleads').addClass('active'); }else if($type=="reviews"){ jQuery('div.lpviewreviews').addClass('active'); }} jQuery(document).on('click', 'button.coupon-apply-bt', function(){ var couponcode=jQuery('input[name=coupon-text-field]').val(); var $price=jQuery('input[name=listing_id]:checked').data('planprice'); var $listingID=jQuery('input[name=listing_id]:checked').val(); var $post_title=jQuery('input[name=listing_id]:checked').data('title'); var $planID=jQuery('input[name=listing_id]:checked').data('planid'); var $tax=jQuery('input[name=listing_id]:checked').data('taxenable'); var $taxRate=jQuery('input[name=listing_id]:checked').data('taxrate'); if(couponcode===''){}else{ jQuery('body').addClass('listingpro-loading'); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'listingpro_apply_coupon_code', 'coupon': couponcode, 'listingid': $listingID, 'taxrate': $taxRate, 'price': $price, }, success: function(data){ jQuery('body').removeClass('listingpro-loading'); if(data.status=="success"){ $discount=data.discount; $newprice=$discount/100; $newprice=$newprice*$price; $newprice=$price-$newprice; $newprice=parseFloat($newprice).toFixed(2); lp_add_checkout_data_fields_in_form($listingID, $post_title, $planID, $newprice, $tax, $taxRate); if(jQuery('li').hasClass('checkout_discount_val')){}else{ jQuery('span.lp-subtotal-p-price').parent().after('
  • Discounted'+$discount+'%
  • '); }} }, error: function(jqXHR, textStatus, errorThrown){ jQuery('body').removeClass('listingpro-loading'); console.log(textStatus, errorThrown); }}); }}); jQuery(document).on('click', 'input[name="lp_checkbox_coupon"]', function(){ if(jQuery(this).hasClass('active')){}else{ var couponcode=''; var $price=jQuery('input[name=listing_id]:checked').data('planprice'); var $listingID=jQuery('input[name=listing_id]:checked').val(); var $post_title=jQuery('input[name=listing_id]:checked').data('title'); var $planID=jQuery('input[name=listing_id]:checked').data('planid'); var $tax=jQuery('input[name=listing_id]:checked').data('taxenable'); var $taxRate=jQuery('input[name=listing_id]:checked').data('taxrate'); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'listingpro_apply_coupon_code', 'coupon': couponcode, 'listingid': $listingID, 'taxrate': $taxRate, 'price': $price, }, success: function(data){ jQuery('body').removeClass('listingpro-loading'); if(data.status=="success"){ $discount=data.discount; $newprice=$discount/100; $newprice=$newprice*$price; $newprice=$price-$newprice; $newprice=parseFloat($newprice).toFixed(2); lp_add_checkout_data_fields_in_form($listingID, $post_title, $planID, $newprice, $tax, $taxRate); if(jQuery('li').hasClass('checkout_discount_val')){}else{ jQuery('span.lp-subtotal-p-price').parent().after('
  • Discounted'+$discount+'%
  • '); }} }, error: function(jqXHR, textStatus, errorThrown){ jQuery('body').removeClass('listingpro-loading'); console.log(textStatus, errorThrown); }}); }}); jQuery(document).on('submit', 'form[name=lp_leadReply]', function(e){ $this=jQuery(this); $this.find('.lpthisloading').show(); var fd=new FormData(this); fd.append('action', 'lp_reply_to_lead_msg'); jQuery.ajax({ type: 'POST', url: single_ajax_object.ajaxurl, data:fd, contentType: false, processData: false, success: function(res){ $this.find('.lpthisloading').removeClass('fa-spinner fa-spin'); $this.find('.lpthisloading').addClass('fa-check'); window.location.href=window.location.href $this[0].reset(); }, error: function(request, error){ $this.find('.lpthisloading').removeClass('fa-spinner fa-spin'); $this.find('.lpthisloading').addClass('fa-check'); window.location.href=window.location.href }}); e.preventDefault(); return false; }); jQuery(document).on('click', '.lp-read-messages .lp-read-message-inner', function(e){ $this=jQuery(this); $loaderImg=$this.data('loader'); $listingid=$this.data('listingid'); $useremail=$this.data('email'); if($listingid){ jQuery('.lpinboxmiddlepart').html(''); jQuery('.lpinboxrightpart').html(''); jQuery('.lpinboxmiddlepart').html('
    '); jQuery('.lpinboxrightpart').html('
    '); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'lp_preview_this_message_thread', 'listindid': $listingid, 'useremail': $useremail, }, success: function(data){ jQuery('.lpinboxmiddlepart').html(''); jQuery('.lpinboxrightpart').html(''); jQuery('.lpinboxmiddlepart').html(data.outputcenter); jQuery('.lpinboxrightpart').html(data.outputright); }, error: function(jqXHR, textStatus, errorThrown){ jQuery('.lpinboxmiddlepart').html(''); jQuery('.lpinboxrightpart').html(''); jQuery('.lpinboxmiddlepart').html(data.outputcenter); jQuery('.lpinboxrightpart').html(data.outputright); }}); }}); jQuery(document).on('click', 'body.home .listingcampaings .lp-grid-box-contianer .lp-grid-box .lp-h4 a, body.home .listingcampaings .lp-grid-box .lp-grid-box-thumb-container .lp-grid-box-thumb a, body.search .promoted-listings .lp-grid-box .lp-grid-box-thumb-container .lp-grid-box-thumb a, body.search .promoted-listings .lp-grid-box-contianer .lp-grid-box .lp-h4 a, body.archive .promoted-listings .lp-grid-box .lp-grid-box-thumb-container .lp-grid-box-thumb a, body.archive .promoted-listings .lp-grid-box-contianer .lp-grid-box .lp-h4 a, .promoted-listings .lp-grid-app-view .lp-grid-box .lp-grid-box-thumb .show-img a, .promoted-listings .lp-grid-app-view .lp-grid-box .lp-h4 a, .listingcampaings .lp-grid-app-view .lp-grid-box .lp-grid-box-thumb .show-img a, .single-listing .widget_listingpro_ads_widget .listing-post article figure a, .single-listing .widget_listingpro_ads_widget .listing-post article figure figcaption a.overlay-link, .single-listing .widget_listingpro_ads_widget .listing-post article figure figcaption h4 a,.single .widget_listingpro_ads_widget .listing-post article figure figcaption a.overlay-link,.single .widget_listingpro_ads_widget .listing-post article figure figcaption h4 a, body.home .listingcampaings .lp-listing .lp-listing-bottom h4 a, body.home .listingcampaings .lp-listing .lp-listing-top-thumb a', function(){ $listingURL=jQuery(this).attr('href'); $type=''; if(jQuery('body').hasClass('search')||jQuery('body').hasClass('archive')){ $type='lp_top_in_search_page_ads_pc'; } if(jQuery('body').hasClass('home')){ $type='lp_random_ads_pc'; } if(jQuery('body').hasClass('single-listing')){ $type='lp_detail_page_ads_pc'; } jQuery.ajax({ type: 'POST', dataType: 'json', async:false, url: single_ajax_object.ajaxurl, data: { 'action': 'lp_count_clicks_for_campaigns', 'listingURL': $listingURL, 'type': $type, }, success: function(data){ console.log(data); window.location.href=$listingURL; }, error: function(jqXHR, textStatus, errorThrown){ console.log(errorThrown); }}); }); jQuery(document).on('click', 'a.lp-pay-publish-btn, a.lp-listing-pay-button, input.lp-listing-pay-button', function(){ $listingID=jQuery(this).data('lpthisid'); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'lp_save_thisid_in_session', 'listing_id': $listingID, }, success: function(data){ console.log(data); }, error: function(jqXHR, textStatus, errorThrown){ console.log(errorThrown); }}); }); jQuery(document).on('click', 'button.lp-delte-conv', function(){ $this=jQuery(jQuery(this)); $emailid=jQuery(this).data('emailid'); $listingid=jQuery(this).data('listingid'); $this.closest('#lp-ad-click-inner').find('.lpthisloading').show(); jQuery.ajax({ type: 'POST', dataType: 'json', url: single_ajax_object.ajaxurl, data: { 'action': 'lp_delete_this_conversation', 'listingid': $listingid, 'emailid': $emailid, }, success: function(data){ $this.closest('#lp-ad-click-inner').find('.lpthisloading').removeClass('fa-spinner fa-spin'); $this.closest('#lp-ad-click-inner').find('.lpthisloading').addClass('fa-check'); window.location.href=window.location.href }, error: function(jqXHR, textStatus, errorThrown){ console.log(errorThrown); }}); }); jQuery(document).ready(function($){ jQuery('.change_review_status').on('click', function(e){ e.preventDefault(); $this=jQuery(this); var statuss, id; statusss=$this.data("active"); passivee=$this.data("passive"); id=$this.data("id"); info=[]; info[0]=id; info[1]=statusss; info[2]=passivee; var formData=JSON.stringify(info); jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_approvereview_object.ajaxurl, data: { 'action': 'listingpro_review_status', 'formData': formData, }, success: function(res){ if(res.statuss="success"){ var current=res.current_status; var passive=res.passive_status; $this.data('active', current); $this.data('passive', passive); $this.text(passive); }} }); }); }); jQuery(window).load(function($){ if(jQuery(".lp_home").is("#homeMap")){ jQuery('#homeMap').empty(); $defLat=jQuery('body').data('defaultmaplat'); $defLong=jQuery('body').data('defaultmaplot'); L.Google=L.Class.extend({ includes: L.Mixin.Events, options: { minZoom: 0, maxZoom: 18, tileSize: 256, subdomains: 'abc', errorTileUrl: '', attribution: '', opacity: 1, continuousWorld: false, noWrap: false, }, initialize: function(type, options){ L.Util.setOptions(this, options); this._type=google.maps.MapTypeId[type||'SATELLITE']; }, onAdd: function(map, insertAtTheBottom){ this._map=map; this._insertAtTheBottom=insertAtTheBottom; this._initContainer(); this._initMapObject(); map.on('viewreset', this._resetCallback, this); this._limitedUpdate=L.Util.limitExecByInterval(this._update, 150, this); map.on('move', this._update, this); this._reset(); this._update(); }, onRemove: function(map){ this._map._container.removeChild(this._container); this._map.off('viewreset', this._resetCallback, this); this._map.off('move', this._update, this); }, getAttribution: function(){ return this.options.attribution; }, setOpacity: function(opacity){ this.options.opacity=opacity; if(opacity < 1){ L.DomUtil.setOpacity(this._container, opacity); }}, _initContainer: function(){ var tilePane=this._map._container first=tilePane.firstChild; if(!this._container){ this._container=L.DomUtil.create('div', 'leaflet-google-layer leaflet-top leaflet-left'); this._container.id="_GMapContainer"; } if(true){ tilePane.insertBefore(this._container, first); this.setOpacity(this.options.opacity); var size=this._map.getSize(); this._container.style.width=size.x + 'px'; this._container.style.height=size.y + 'px'; }}, _initMapObject: function(){ this._google_center=new google.maps.LatLng(0, 0); var map=new google.maps.Map(this._container, { center: this._google_center, zoom: 0, mapTypeId: this._type, disableDefaultUI: true, keyboardShortcuts: false, draggable: false, disableDoubleClickZoom: true, scrollwheel: false, streetViewControl: false }); var _this=this; this._reposition=google.maps.event.addListenerOnce(map, "center_changed", function(){ _this.onReposition(); }); map.backgroundColor='#ff0000'; this._google=map; }, _resetCallback: function(e){ this._reset(e.hard); }, _reset: function(clearOldContainer){ this._initContainer(); }, _update: function(){ this._resize(); var bounds=this._map.getBounds(); var ne=bounds.getNorthEast(); var sw=bounds.getSouthWest(); var google_bounds=new google.maps.LatLngBounds(new google.maps.LatLng(sw.lat, sw.lng), new google.maps.LatLng(ne.lat, ne.lng) ); var center=this._map.getCenter(); var _center=new google.maps.LatLng(center.lat, center.lng); this._google.setCenter(_center); this._google.setZoom(this._map.getZoom()); this._google.fitBounds(google_bounds); }, _resize: function(){ var size=this._map.getSize(); if(this._container.style.width==size.x && this._container.style.height==size.y) return; this._container.style.width=size.x + 'px'; this._container.style.height=size.y + 'px'; google.maps.event.trigger(this._google, "resize"); }, onReposition: function(){ }}); L.HtmlIcon=L.Icon.extend({ options: { }, initialize: function(options){ L.Util.setOptions(this, options); }, createIcon: function(){ var div=document.createElement('div'); div.innerHTML=this.options.html; if(div.classList) div.classList.add('leaflet-marker-icon'); else div.className +=' ' + 'leaflet-marker-icon'; return div; }, createShadow: function(){ return null; }}); var maplistingby=jQuery('body').data('maplistingby'); if(maplistingby==null||maplistingby==""||maplistingby=="geolocaion"){ lpGetGpsLocName(function (lpgetcurrentcityvalue){ lpgpsclocation=lpgetcurrentcityvalue; console.log(lpgpsclocation); callhomemapajax(lpgpsclocation, maplistingby); }); }else{ callhomemapajax('', maplistingby); } function callhomemapajax(lpcity, maplistingby){ jQuery('#homeMap').addClass('loading'); jQuery.ajax({ type: 'POST', dataType: 'json', url: listingpro_home_map_object.ajaxurl, data: { 'action': 'listingpro_home_map_content', 'listingby': maplistingby, 'lpcity': lpcity, 'trig': 'home_map', }, success: function(data){ if(data){ jQuery('#homeMap').removeClass('loading'); var map=null $mtoken=jQuery('#page').data("mtoken"); $mapboxDesign=jQuery('#page').data("mstyle"); if($mtoken!=''){ L.mapbox.accessToken=$mtoken; map=L.mapbox.map('homeMap', 'mapbox.streets'); L.tileLayer('https://api.tiles.mapbox.com/v4/'+$mapboxDesign+'/{z}/{x}/{y}.png?access_token='+$mtoken+'', { maxZoom: 18, attribution: 'Map data © OpenStreetMap contributors, ' + 'CC-BY-SA, ' + 'Imagery © Mapbox', id: 'mapbox.light' }).addTo(map); var markers=new L.MarkerClusterGroup(); hasgetbouts=false; jQuery.each(data, function(i,v){ $vlatitude=v.latitude; $vlongitude=v.longitude; if($vlatitude!=null&&$vlongitude!=null){ hasgetbouts=true; var markerLocation=new L.LatLng($vlatitude, $vlongitude); var CustomHtmlIcon=L.HtmlIcon.extend({ options:{ html:"
    ", }}); var customHtmlIcon=new CustomHtmlIcon(); markers.addLayer(marker); map.addLayer(markers); }}); if(hasgetbouts){ map.fitBounds(markers.getBounds()); }else{ map.fitBounds([[$defLat, $defLong],[$defLat, $defLong]]); } map.scrollWheelZoom.disable(); }else{ var map=new L.Map('homeMap', { dragging: true, tap: false }); var googleLayer=new L.Google('ROADMAP'); map.addLayer(googleLayer); var markers=new L.MarkerClusterGroup(); hasgetbouts=false; jQuery.each(data, function(i,v){ console.log(v); $vlatitude=v.latitude; $vlongitude=v.longitude; if(($vlatitude!=''||$vlatitude!=0)&&($vlongitude!=''||$vlongitude!=0)){ hasgetbouts=true; var markerLocation=new L.LatLng($vlatitude, $vlongitude); var CustomHtmlIcon=L.HtmlIcon.extend({ options:{ html:"
    ", }}); var customHtmlIcon=new CustomHtmlIcon(); markers.addLayer(marker); map.addLayer(markers); }}); if(hasgetbouts){ map.fitBounds(markers.getBounds()); }else{ map.fitBounds([[$defLat, $defLong],[$defLat, $defLong]]); } map.scrollWheelZoom.disable(); map.invalidateSize(); }} }, error: function (request, status, error){ jQuery('#homeMap').removeClass('loading'); console.log(request.responseText); }}); };}}); if(typeof JSON!=="object"){JSON={}}(function(){"use strict";function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var cx,escapable,gap,indent,meta,rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;ij;i=f<=j?++_i:--_i){if(this[i]===obj){return i}}return-1}}}).call(this);StripeCheckout.require.define({"lib/helpers":function(exports,require,module){(function(){var delurkWinPhone,helpers,uaVersionFn;uaVersionFn=function(re){return function(){var uaMatch;uaMatch=helpers.userAgent.match(re);return uaMatch&&parseInt(uaMatch[1])}};delurkWinPhone=function(fn){return function(){return fn()&&!helpers.isWindowsPhone()}};helpers={userAgent:window.navigator.userAgent,escape:function(value){return value&&(""+value).replace(/&/g,"&").replace(//g,">").replace(/\"/g,""")},trim:function(value){return value.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},sanitizeURL:function(value){var SCHEME_WHITELIST,allowed,scheme,_i,_len;if(!value){return}value=helpers.trim(value);SCHEME_WHITELIST=["data:","http:","https:"];allowed=false;for(_i=0,_len=SCHEME_WHITELIST.length;_i<_len;_i++){scheme=SCHEME_WHITELIST[_i];if(value.indexOf(scheme)===0){allowed=true;break}}if(!allowed){return null}return encodeURI(value)},iOSVersion:uaVersionFn(/(?:iPhone OS |iPad; CPU OS)(\d+)_\d+/),iOSMinorVersion:uaVersionFn(/(?:iPhone OS |iPad; CPU OS)\d+_(\d+)/),iOSBuildVersion:uaVersionFn(/(?:iPhone OS |iPad; CPU OS)\d+_\d+_(\d+)/),androidWebkitVersion:uaVersionFn(/Mozilla\/5\.0.*Android.*AppleWebKit\/([\d]+)/),androidVersion:uaVersionFn(/Android (\d+)\.\d+/),firefoxVersion:uaVersionFn(/Firefox\/(\d+)\.\d+/),chromeVersion:uaVersionFn(/Chrome\/(\d+)\.\d+/),safariVersion:uaVersionFn(/Version\/(\d+)\.\d+ Safari/),iOSChromeVersion:uaVersionFn(/CriOS\/(\d+)\.\d+/),iOSNativeVersion:uaVersionFn(/Stripe\/(\d+)\.\d+/),ieVersion:uaVersionFn(/(?:MSIE |Trident\/.*rv:)(\d{1,2})\./),isiOSChrome:function(){return/CriOS/.test(helpers.userAgent)},isiOSWebView:function(){return/(iPhone|iPod|iPad).*AppleWebKit((?!.*Safari)|(.*\([^)]*like[^)]*Safari[^)]*\)))/i.test(helpers.userAgent)},getiOSWebViewType:function(){if(helpers.isiOSWebView()){if(window.indexedDB){return"WKWebView"}else{return"UIWebView"}}},isiOS:delurkWinPhone(function(){return/(iPhone|iPad|iPod)/i.test(helpers.userAgent)}),isiOSNative:function(){return this.isiOS()&&this.iOSNativeVersion()>=3},isiPad:function(){return/(iPad)/i.test(helpers.userAgent)},isMac:delurkWinPhone(function(){return/mac/i.test(helpers.userAgent)}),isWindowsPhone:function(){return/(Windows\sPhone|IEMobile)/i.test(helpers.userAgent)},isWindowsOS:function(){return/(Windows NT \d\.\d)/i.test(helpers.userAgent)},isIE:function(){return/(MSIE ([0-9]{1,}[\.0-9]{0,})|Trident\/)/i.test(helpers.userAgent)},isChrome:function(){return"chrome"in window},isSafari:delurkWinPhone(function(){var userAgent;userAgent=helpers.userAgent;return/Safari/i.test(userAgent)&&!/Chrome/i.test(userAgent)}),isFirefox:delurkWinPhone(function(){return helpers.firefoxVersion()!=null}),isAndroidBrowser:function(){var version;version=helpers.androidWebkitVersion();return version&&version<537},isAndroidChrome:function(){var version;version=helpers.androidWebkitVersion();return version&&version>=537},isAndroidDevice:delurkWinPhone(function(){return/Android/.test(helpers.userAgent)}),isAndroidWebView:function(){return helpers.isAndroidChrome()&&/Version\/\d+\.\d+/.test(helpers.userAgent)},isAndroidFacebookApp:function(){return helpers.isAndroidChrome()&&/FBAV\/\d+\.\d+/.test(helpers.userAgent)},isNativeWebContainer:function(){return window.cordova!=null||/GSA\/\d+\.\d+/.test(helpers.userAgent)},isSupportedMobileOS:function(){return helpers.isiOS()||helpers.isAndroidDevice()},isAndroidWebapp:function(){var metaTag;if(!helpers.isAndroidChrome()){return false}metaTag=document.getElementsByName("apple-mobile-web-app-capable")[0]||document.getElementsByName("mobile-web-app-capable")[0];return metaTag&&metaTag.content==="yes"},isiOSBroken:function(){var chromeVersion;chromeVersion=helpers.iOSChromeVersion();if(helpers.iOSVersion()===9&&helpers.iOSMinorVersion()>=2&&chromeVersion&&chromeVersion<=47){return true}if(helpers.isiPad()&&helpers.iOSVersion()===8){switch(helpers.iOSMinorVersion()){case 0:return true;case 1:return helpers.iOSBuildVersion()<1}}return false},iOSChromeTabViewWillFail:function(){var isUserGesture,_ref,_ref1;isUserGesture=(_ref=(_ref1=window.event)!=null?_ref1.type:void 0)==="click"||_ref==="touchstart"||_ref==="touchend";return helpers.iOSChromeVersion()<48&&!isUserGesture},isInsideFrame:function(){return window.top!==window.self},isFallback:function(){var androidVersion,criosVersion,ffVersion,iOSVersion;if(!("postMessage"in window)||window.postMessageDisabled||document.documentMode&&document.documentMode<8){return true}androidVersion=helpers.androidVersion();if(androidVersion&&androidVersion<4){return true}iOSVersion=helpers.iOSVersion();if(iOSVersion&&iOSVersion<6){return true}ffVersion=helpers.firefoxVersion();if(ffVersion&&ffVersion<11){return true}criosVersion=helpers.iOSChromeVersion();if(criosVersion&&criosVersion<36){return true}return false},isSmallScreen:function(){return Math.min(window.screen.availHeight,window.screen.availWidth)<=640||/FakeCheckoutMobile/.test(helpers.userAgent)},pad:function(number,width,padding){var leading;if(width==null){width=2}if(padding==null){padding="0"}number=number+"";if(number.length>width){return number}leading=new Array(width-number.length+1).join(padding);return leading+number},requestAnimationFrame:function(callback){return(typeof window.requestAnimationFrame==="function"?window.requestAnimationFrame(callback):void 0)||(typeof window.webkitRequestAnimationFrame==="function"?window.webkitRequestAnimationFrame(callback):void 0)||window.setTimeout(callback,100)},requestAnimationInterval:function(func,interval){var callback,previous;previous=new Date;callback=function(){var frame,now,remaining;frame=helpers.requestAnimationFrame(callback);now=new Date;remaining=interval-(now-previous);if(remaining<=0){previous=now;func()}return frame};return callback()},getQueryParameterByName:function(name){var match;match=RegExp("[?&]"+name+"=([^&]*)").exec(window.location.search);return match&&decodeURIComponent(match[1].replace(/\+/g," "))},addQueryParameter:function(url,name,value){var hashParts,query;query=encodeURIComponent(name)+"="+encodeURIComponent(value);hashParts=new String(url).split("#");hashParts[0]+=hashParts[0].indexOf("?")!==-1?"&":"?";hashParts[0]+=query;return hashParts.join("#")},bind:function(element,name,callback){if(element.addEventListener){return element.addEventListener(name,callback,false)}else{return element.attachEvent("on"+name,callback)}},unbind:function(element,name,callback){if(element.removeEventListener){return element.removeEventListener(name,callback,false)}else{return element.detachEvent("on"+name,callback)}},host:function(url){var parent,parser;parent=document.createElement("div");parent.innerHTML='x';parser=parent.firstChild;return""+parser.protocol+"//"+parser.host},strip:function(html){var tmp,_ref,_ref1;tmp=document.createElement("div");tmp.innerHTML=html;return(_ref=(_ref1=tmp.textContent)!=null?_ref1:tmp.innerText)!=null?_ref:""},replaceFullWidthNumbers:function(el){var char,fullWidth,halfWidth,idx,original,replaced,_i,_len,_ref;fullWidth="0123456789";halfWidth="0123456789";original=el.value;replaced="";_ref=original.split("");for(_i=0,_len=_ref.length;_i<_len;_i++){char=_ref[_i];idx=fullWidth.indexOf(char);if(idx>-1){char=halfWidth[idx]}replaced+=char}if(original!==replaced){return el.value=replaced}},setAutocomplete:function(el,type){var secureCCFill;secureCCFill=helpers.chromeVersion()>14||helpers.safariVersion()>7;if(type!=="cc-csc"&&(!/^cc-/.test(type)||secureCCFill)){el.setAttribute("x-autocompletetype",type);el.setAttribute("autocompletetype",type)}else{el.setAttribute("autocomplete","off")}if(!(type==="country-name"||type==="language"||type==="sex"||type==="gender-identity")){el.setAttribute("autocorrect","off");el.setAttribute("spellcheck","off")}if(!(/name|honorific/.test(type)||(type==="locality"||type==="city"||type==="adminstrative-area"||type==="state"||type==="province"||type==="region"||type==="language"||type==="org"||type==="organization-title"||type==="sex"||type==="gender-identity"))){return el.setAttribute("autocapitalize","off")}},hashCode:function(str){var hash,i,_i,_ref;hash=5381;for(i=_i=0,_ref=str.length;_i<_ref;i=_i+=1){hash=(hash<<5)+hash+str.charCodeAt(i)}return(hash>>>0)%65535},stripeUrlPrefix:function(){var match;match=window.location.hostname.match("^([a-z-]*)checkout.");if(match){return match[1]}else{return""}},clientLocale:function(){return(window.navigator.languages||[])[0]||window.navigator.userLanguage||window.navigator.language},dashToCamelCase:function(dashed){return dashed.replace(/-(\w)/g,function(match,char){return char.toUpperCase()})},camelToDashCase:function(cameled){return cameled.replace(/([A-Z])/g,function(g){return"-"+g.toLowerCase()})},isArray:Array.isArray||function(val){return{}.toString.call(val)==="[object Array]"}};module.exports=helpers}).call(this)}});StripeCheckout.require.define({"lib/spellChecker":function(exports,require,module){(function(){var levenshtein;module.exports={levenshtein:levenshtein=function(str1,str2){var d,i,j,m,n,_i,_j,_k,_l;m=str1.length;n=str2.length;d=[];if(!m){return n}if(!n){return m}for(i=_i=0;0<=m?_i<=m:_i>=m;i=0<=m?++_i:--_i){d[i]=[i]}for(j=_j=1;1<=n?_j<=n:_j>=n;j=1<=n?++_j:--_j){d[0][j]=j}for(i=_k=1;1<=m?_k<=m:_k>=m;i=1<=m?++_k:--_k){for(j=_l=1;1<=n?_l<=n:_l>=n;j=1<=n?++_l:--_l){if(str1[i-1]===str2[j-1]){d[i][j]=d[i-1][j-1]}else{d[i][j]=Math.min(d[i-1][j],d[i][j-1],d[i-1][j-1])+1}}}return d[m][n]},suggest:function(dictionary,badword,threshold){var dist,maxDist,suggestion,word,_i,_len;if(threshold==null){threshold=Infinity}maxDist=Infinity;suggestion=null;for(_i=0,_len=dictionary.length;_i<_len;_i++){word=dictionary[_i];dist=levenshtein(word,badword);if(distcap){return val.slice(0,cap-3)+"..."}else{return val}};dumpObject=function(obj){return truncate(repr(obj),50)};prettyPrint=function(key,rawOptions){var original,_ref;original=(_ref=rawOptions.__originals)!=null?_ref[key]:void 0;if(original){return original}else if(rawOptions.buttonIntegration){return"data-"+helpers.camelToDashCase(key)}else{return key}};toBoolean=function(val){return val!=="false"&&val!==false&&val!=null};toNumber=function(val){if(typeof val==="number"){return val}else if(typeof val==="string"){return parseInt(val)}};toString=function(val){if(val==null){return""}else{return""+val}};identity=function(val){return val};module.exports={prettyPrint:prettyPrint,flatten:flatten,repr:repr,truncate:truncate,dumpObject:dumpObject,toBoolean:toBoolean,toNumber:toNumber,toString:toString,identity:identity}}).call(this)}});StripeCheckout.require.define({"lib/paymentMethods":function(exports,require,module){(function(){var ERROR,METHODS,OPTIONAL,PRETTY_METHODS,PRIVATE,REQUIRED,WARNING,alipayEnabled,alipayToCanonical,canonicalize,checkContext,checkNoDuplicates,checkNoOldAPI,coerceDefaults,deepMethodTypeCheck,helpers,isValidMethod,methodName,methodsArrayToDict,optionHelpers,optionValidator,simpleMethodTypeCheck,simpleToCanonical,singleMethodTypeCheck,spec,transformMethods,_exports,_ref,_ref1,__hasProp={}.hasOwnProperty,__indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i0){return{type:ERROR,message:"Error when checking the '"+methodSettings.method+"' method:\n"+errors[0].toString()}}else{return null}};singleMethodTypeCheck=function(method,idx){var methodSettings,pretty;if(typeof method==="string"){return simpleMethodTypeCheck(method)}else if((method!=null?method.method:void 0)!=null){methodSettings=method;return deepMethodTypeCheck(methodSettings)}else{pretty=optionHelpers.dumpObject(methodSettings);return{type:ERROR,message:"All elements of paymentMethods need to be either an object with a 'method' property or one of these strings: "+PRETTY_METHODS+".\n At index "+idx+" we found '"+pretty+"' which was neither."}}};spec=function(key,val,options){var actualType,error,idx,method,_i,_len;if(val===null){return null}if(!helpers.isArray(val)){actualType=val===null?"null":typeof val;return{type:ERROR,message:"Looking for an Array, but instead we found '"+actualType+"'."}}for(idx=_i=0,_len=val.length;_i<_len;idx=++_i){method=val[idx];error=singleMethodTypeCheck(method,idx);if(error!=null){return error}}return null};checkNoDuplicates=function(val){var idx,method,sortedMethods,usedMethods,_i,_len,_ref2;usedMethods=function(){var _i,_len,_results;_results=[];for(_i=0,_len=val.length;_i<_len;_i++){method=val[_i];if(typeof method==="string"){_results.push(method)}else if((method!=null?method.method:void 0)!=null){_results.push(method.method)}else{_results.push(null)}}return _results}();sortedMethods=usedMethods.concat().sort();_ref2=sortedMethods.slice(1);for(idx=_i=0,_len=_ref2.length;_i<_len;idx=++_i){method=_ref2[idx];if(method===sortedMethods[idx]){return{type:ERROR,message:"You've configured the payment method '"+method+"' multiple times."}}}return null};checkNoOldAPI=function(options){var alipay,alipayReusable,bitcoin,paymentMethods;if(options.alipay!=null||options.bitcoin!=null||options.alipayReusable!=null){alipay=optionHelpers.prettyPrint("alipay",options);alipayReusable=optionHelpers.prettyPrint("alipayReusable",options);bitcoin=optionHelpers.prettyPrint("bitcoin",options);paymentMethods=optionHelpers.prettyPrint("paymentMethods",options);return{type:ERROR,message:"Setting any of the the '"+alipay+"', '"+alipayReusable+"', or '"+bitcoin+"' options is disallowed if you are using '"+paymentMethods+"'."}}else{return null}};checkContext=function(key,val,options){var error;error=checkNoOldAPI(options);if(error!=null){return error}if(val==null){return}return checkNoDuplicates(val)};coerceDefaults=function(methodSpec,methodSettings){var setting,_results;_results=[];for(setting in methodSpec){if(methodSettings[setting]==null){_results.push(methodSettings[setting]=methodSpec[setting]["default"])}else{_results.push(void 0)}}return _results};simpleToCanonical=function(method,enabled){var methodSettings;methodSettings={method:method,enabled:enabled};coerceDefaults(METHODS[method],methodSettings);return methodSettings};alipayToCanonical=function(enabled,reusable){var methodSettings;methodSettings={method:"alipay",enabled:enabled,reusable:reusable};coerceDefaults(METHODS.alipay,methodSettings);return methodSettings};transformMethods=function(paymentMethods){var has,hasMethod,method,methodSettings,result,_i,_len;result=[];has={};for(method in METHODS){has[method]=false}for(_i=0,_len=paymentMethods.length;_i<_len;_i++){method=paymentMethods[_i];if(typeof method==="string"){result.push(simpleToCanonical(method,true));has[method]=true}else{methodSettings=method;if(methodSettings["enabled"]==null){methodSettings["enabled"]=true}coerceDefaults(METHODS[methodSettings.method],methodSettings);has[methodSettings.method]=true;result.push(methodSettings)}}for(method in has){hasMethod=has[method];if(!hasMethod){result.push(simpleToCanonical(method,false))}}return result};methodsArrayToDict=function(paymentMethods){var enabled,methodSettings,settings,_i,_len;settings={};enabled=[];for(_i=0,_len=paymentMethods.length;_i<_len;_i++){methodSettings=paymentMethods[_i];settings[methodSettings.method]=methodSettings;if(methodSettings.enabled!==false){enabled.push(methodSettings.method)}}return{settings:settings,enabled:enabled}};canonicalize=function(rawOptions){var blacklist,hasAlipay,option,result,val;result={};blacklist=["bitcoin","alipay","alipayReusable"];for(option in rawOptions){if(!__hasProp.call(rawOptions,option))continue;val=rawOptions[option];if(__indexOf.call(blacklist,option)<0){result[option]=val}}if(rawOptions.paymentMethods!=null){result.paymentMethods=methodsArrayToDict(transformMethods(rawOptions.paymentMethods))}else{hasAlipay=rawOptions.alipay||rawOptions.alipayReusable||false;result.paymentMethods=methodsArrayToDict([simpleToCanonical("card",true),simpleToCanonical("bitcoin",rawOptions.bitcoin||false),alipayToCanonical(hasAlipay,rawOptions.alipayReusable)])}return result};_exports={alipayEnabled:alipayEnabled,spec:spec,checkContext:checkContext,canonicalize:canonicalize,methods:function(){var _results;_results=[];for(methodName in METHODS){_results.push(methodName)}return _results}()};for(methodName in METHODS){_exports[methodName]=methodName}module.exports=_exports}).call(this)}});StripeCheckout.require.define({"lib/optionSpecs":function(exports,require,module){(function(){var BOOLEAN,BUTTON,BUTTON_CONFIGURE_OPTIONS,BUTTON_OPEN_OPTIONS,CUSTOM,CUSTOM_CONFIGURE_OPTIONS,CUSTOM_OPEN_OPTIONS,ERROR,EVENTUALLY_REQUIRED,NULLABLE_BOOLEAN,NULLABLE_NUMBER,NULLABLE_STRING,NULLABLE_URL,NUMBER,OPTIONAL,OPTIONS,OTHER,PRIVATE,REQUIRED,STRING,URL,WARNING,generateOptions,helpers,option,optionHelpers,optionValidator,optsettings,paymentMethods,_ref,_ref1;helpers=require("lib/helpers");optionHelpers=require("lib/optionHelpers");paymentMethods=require("lib/paymentMethods");optionValidator=require("lib/optionValidator");_ref=optionValidator.severities,ERROR=_ref.ERROR,WARNING=_ref.WARNING;_ref1=optionValidator.importances,OPTIONAL=_ref1.OPTIONAL,REQUIRED=_ref1.REQUIRED,EVENTUALLY_REQUIRED=_ref1.EVENTUALLY_REQUIRED,PRIVATE=_ref1.PRIVATE;BUTTON="button";CUSTOM="custom";STRING="string";URL="url";BOOLEAN="boolean";NUMBER="number";NULLABLE_STRING="null-string";NULLABLE_URL="null-url";NULLABLE_BOOLEAN="null-boolean";NULLABLE_NUMBER="null-number";OTHER="other";OPTIONS={address:{importance:PRIVATE,type:OTHER,checkContext:function(key,val,options){var prettyAddress,prettyBilling;prettyAddress=optionHelpers.prettyPrint("address",options);prettyBilling=optionHelpers.prettyPrint("billingAddress",options);return{type:WARNING,message:"'"+prettyAddress+"' is deprecated. Use '"+prettyBilling+"' instead."}}},alipay:{importance:OPTIONAL,type:OTHER,coerceTo:function(val){if(val==="auto"){return val}return optionHelpers.toBoolean(val)},spec:function(key,val,options){if(val===null){return null}else{return paymentMethods.alipayEnabled(key,val,options)}}},alipayReusable:{importance:OPTIONAL,type:NULLABLE_BOOLEAN,checkContext:optionValidator.xRequiresY("alipayReusable","alipay")},allowRememberMe:{importance:OPTIONAL,type:NULLABLE_BOOLEAN,"default":true},amount:{importance:OPTIONAL,type:NULLABLE_NUMBER},billingAddress:{importance:OPTIONAL,type:NULLABLE_BOOLEAN},bitcoin:{importance:OPTIONAL,type:NULLABLE_BOOLEAN},buttonIntegration:{importance:PRIVATE,type:BOOLEAN,"default":false},closed:{only:CUSTOM,importance:OPTIONAL,type:OTHER},color:{importance:PRIVATE,type:STRING},currency:{importance:OPTIONAL,type:NULLABLE_STRING,"default":"usd"},description:{importance:OPTIONAL,type:NULLABLE_STRING},email:{importance:OPTIONAL,type:NULLABLE_STRING},image:{importance:OPTIONAL,type:NULLABLE_URL},key:{importance:REQUIRED,type:STRING},label:{only:BUTTON,importance:OPTIONAL,type:NULLABLE_STRING},locale:{importance:OPTIONAL,type:NULLABLE_STRING},name:{importance:OPTIONAL,type:NULLABLE_STRING},nostyle:{importance:PRIVATE,type:BOOLEAN},notrack:{importance:PRIVATE,type:BOOLEAN},opened:{only:CUSTOM,importance:OPTIONAL,type:OTHER},panelLabel:{importance:OPTIONAL,type:NULLABLE_STRING},paymentMethods:{only:CUSTOM,importance:OPTIONAL,type:OTHER,spec:paymentMethods.spec,checkContext:paymentMethods.checkContext},referrer:{importance:PRIVATE,type:URL},shippingAddress:{importance:OPTIONAL,type:NULLABLE_BOOLEAN,checkContext:optionValidator.xRequiresY("shippingAddress","billingAddress")},supportsTokenCallback:{importance:PRIVATE,type:BOOLEAN},timeLoaded:{importance:PRIVATE,type:OTHER},token:{importance:EVENTUALLY_REQUIRED,type:OTHER},trace:{importance:PRIVATE,type:BOOLEAN},url:{importance:PRIVATE,type:URL},zipCode:{importance:OPTIONAL,type:NULLABLE_BOOLEAN},__originals:{importance:PRIVATE,type:OTHER}};for(option in OPTIONS){optsettings=OPTIONS[option];if(optsettings.coerceTo==null){optsettings.coerceTo=function(){switch(optsettings.type){case STRING:case NULLABLE_STRING:return optionHelpers.toString;case BOOLEAN:case NULLABLE_BOOLEAN:return optionHelpers.toBoolean;case NUMBER:case NULLABLE_NUMBER:return optionHelpers.toNumber;case URL:case NULLABLE_URL:return helpers.sanitizeURL;case OTHER:return optionHelpers.identity}}()}if(optsettings.spec==null){optsettings.spec=function(){switch(optsettings.type){case STRING:case URL:return optionValidator.isString;case BOOLEAN:return optionValidator.isBoolean;case NUMBER:return optionValidator.isNumber;case NULLABLE_STRING:case NULLABLE_URL:return optionValidator.isNullableString;case NULLABLE_BOOLEAN:return optionValidator.isNullableBoolean;case NULLABLE_NUMBER:return optionValidator.isNullableNumber;case OTHER:return optionValidator.ignore}}()}if(optsettings.checkContext==null){optsettings.checkContext=optionValidator.ignore}}generateOptions=function(_arg){var isConfigure,only,result,setting,val,_optsettings;only=_arg.only,isConfigure=_arg.isConfigure;result={};for(option in OPTIONS){_optsettings=OPTIONS[option];if(_optsettings.only!=null&&_optsettings.only!==only){continue}optsettings={};for(setting in _optsettings){val=_optsettings[setting];if(setting==="importance"&&val===EVENTUALLY_REQUIRED){if(isConfigure){optsettings[setting]=OPTIONAL}else{optsettings[setting]=REQUIRED}}else{optsettings[setting]=val}}result[option]=optsettings }return result};BUTTON_CONFIGURE_OPTIONS=generateOptions({only:BUTTON,isConfigure:true});BUTTON_OPEN_OPTIONS=generateOptions({only:BUTTON,isConfigure:false});CUSTOM_CONFIGURE_OPTIONS=generateOptions({only:CUSTOM,isConfigure:true});CUSTOM_OPEN_OPTIONS=generateOptions({only:CUSTOM,isConfigure:false});module.exports={_OPTIONS:OPTIONS,types:{STRING:STRING,BOOLEAN:BOOLEAN,NUMBER:NUMBER,NULLABLE_STRING:NULLABLE_STRING,NULLABLE_URL:NULLABLE_URL,NULLABLE_BOOLEAN:NULLABLE_BOOLEAN,NULLABLE_NUMBER:NULLABLE_NUMBER,URL:URL,OTHER:OTHER},buttonConfigureOptions:BUTTON_CONFIGURE_OPTIONS,buttonOpenOptions:BUTTON_OPEN_OPTIONS,customConfigureOptions:CUSTOM_CONFIGURE_OPTIONS,customOpenOptions:CUSTOM_OPEN_OPTIONS,all:[BUTTON_CONFIGURE_OPTIONS,BUTTON_OPEN_OPTIONS,CUSTOM_CONFIGURE_OPTIONS,CUSTOM_OPEN_OPTIONS]}}).call(this)}});StripeCheckout.require.define({"lib/optionValidator":function(exports,require,module){(function(){var ERROR,EVENTUALLY_REQUIRED,ErrorMissingRequired,ErrorMisspelledRequired,OPTIONAL,PRIVATE,REQUIRED,WARNING,WarnBadContext,WarnMisspelledOptional,WarnOptionTypeError,WarnUnrecognized,checkOptionContexts,checkOptionTypes,checkRequiredOptions,checkUnrecognizedOptions,coerceOption,fromSpec,ignore,isBoolean,isNullableBoolean,isNullableNumber,isNullableString,isNumber,isRequired,isString,optionHelpers,simpleNullableTypeCheck,simpleTypeCheck,spellChecker,validate,xRequiresY,__indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i=0){missingRequiredErrors=function(){var _i,_len,_results;_results=[];for(idx=_i=0,_len=errors.length;_i<_len;idx=++_i){err=errors[idx];if(err instanceof ErrorMissingRequired&&err.key===suggestion){_results.push(idx)}}return _results}();if(missingRequiredErrors.length>0){idx=missingRequiredErrors[0];errors[idx]=new ErrorMisspelledRequired(rawOptions,suggestion,option)}else{warnings.push(new WarnUnrecognized(option))}}else if(suggestion!=null){warnings.push(new WarnMisspelledOptional(rawOptions,suggestion,option))}else{warnings.push(new WarnUnrecognized(rawOptions,option))}}}};checkOptionTypes=function(OPTIONS,_arg,rawOptions){var error,errors,filtered,message,option,type,val,warnings;errors=_arg.errors,warnings=_arg.warnings;filtered={};for(option in rawOptions){val=rawOptions[option];if(option in OPTIONS.all){filtered[option]=val}}for(option in filtered){val=filtered[option];error=OPTIONS.all[option].spec(option,val,rawOptions);if(!error){continue}type=error.type,message=error.message;if(type===ERROR){errors.push(new WarnOptionTypeError(rawOptions,option,message))}else{warnings.push(new WarnOptionTypeError(rawOptions,option,message))}}};checkOptionContexts=function(OPTIONS,_arg,rawOptions){var error,errors,filtered,message,option,type,val,warnings;errors=_arg.errors,warnings=_arg.warnings;filtered={};for(option in rawOptions){val=rawOptions[option];if(option in OPTIONS.all){filtered[option]=val}}for(option in filtered){val=filtered[option];error=OPTIONS.all[option].checkContext(option,val,rawOptions);if(!error){continue}type=error.type,message=error.message;if(type===ERROR){errors.push(new WarnBadContext(rawOptions,option,message))}else{warnings.push(new WarnBadContext(rawOptions,option,message))}}};validate=function(optionSpec,rawOptions){var OPTIONS,errors,warnings;OPTIONS=fromSpec(optionSpec);errors=[];warnings=[];checkRequiredOptions(OPTIONS,{errors:errors,warnings:warnings},rawOptions);checkUnrecognizedOptions(OPTIONS,{errors:errors,warnings:warnings},rawOptions);checkOptionTypes(OPTIONS,{errors:errors,warnings:warnings},rawOptions);checkOptionContexts(OPTIONS,{errors:errors,warnings:warnings},rawOptions);return{errors:errors,warnings:warnings}};module.exports={ErrorMissingRequired:ErrorMissingRequired,ErrorMisspelledRequired:ErrorMisspelledRequired,WarnMisspelledOptional:WarnMisspelledOptional,WarnUnrecognized:WarnUnrecognized,WarnOptionTypeError:WarnOptionTypeError,WarnBadContext:WarnBadContext,severities:{ERROR:ERROR,WARNING:WARNING},importances:{OPTIONAL:OPTIONAL,REQUIRED:REQUIRED,EVENTUALLY_REQUIRED:EVENTUALLY_REQUIRED,PRIVATE:PRIVATE},simpleTypeCheck:simpleTypeCheck,simpleNullableTypeCheck:simpleNullableTypeCheck,isString:isString,isBoolean:isBoolean,isNumber:isNumber,isNullableString:isNullableString,isNullableBoolean:isNullableBoolean,isNullableNumber:isNullableNumber,ignore:ignore,xRequiresY:xRequiresY,coerceOption:coerceOption,validate:validate}}).call(this)}});StripeCheckout.require.define({"lib/optionParser":function(exports,require,module){(function(){var CHECKOUT_DOCS_URL,extractValue,formatMessage,helpers,isLiveModeFromKey,optionSpecs,optionValidator,trackError,trackSummary,trackWarning,tracker,_trackIndividual;tracker=require("lib/tracker");helpers=require("lib/helpers");optionValidator=require("lib/optionValidator");optionSpecs=require("lib/optionSpecs");CHECKOUT_DOCS_URL="https://stripe.com/docs/checkout";extractValue=function(rawOptions,key){var dashed,downcased;if(rawOptions[key]!=null){return rawOptions[key]}downcased=key.toLowerCase();if(rawOptions[downcased]!=null){return rawOptions[downcased]}dashed=helpers.camelToDashCase(key);if(rawOptions[dashed]!=null){return rawOptions[dashed]}};isLiveModeFromKey=function(key){if(!(typeof key==="string"||key instanceof String)){return false}return!/^pk_test_.*$/.test(key)};formatMessage=function(origin,message){return"StripeCheckout."+origin+": "+message+"\nYou can learn about the available configuration options in the Checkout docs:\n"+CHECKOUT_DOCS_URL};_trackIndividual=function(level,origin,rawOptions,error){var k,parameters,v,_ref;parameters={"optchecker-origin":origin};_ref=error.trackedInfo();for(k in _ref){v=_ref[k];parameters["optchecker-"+k]=v}switch(level){case"error":tracker.track.configError(parameters,rawOptions);break;case"warning":tracker.track.configWarning(parameters,rawOptions)}};trackSummary=function(parameters,rawOptions){var k,prefixedParams,v;prefixedParams={};for(k in parameters){v=parameters[k];prefixedParams["optchecker-"+k]=v}return tracker.track.configSummary(prefixedParams,rawOptions)};trackError=function(origin,rawOptions,error){return _trackIndividual("error",origin,rawOptions,error)};trackWarning=function(origin,rawOptions,error){return _trackIndividual("warning",origin,rawOptions,error)};module.exports={coerceButtonOption:function(option,val){return optionValidator.coerceOption(optionSpecs.buttonConfigureOptions,option,val)},parse:function(rawOptions){var OPTIONS,opt,optsettings,parsed,val;if(rawOptions==null){rawOptions={}}parsed={};if(rawOptions.buttonIntegration){OPTIONS=optionSpecs.buttonOpenOptions}else{OPTIONS=optionSpecs.customOpenOptions}for(opt in OPTIONS){optsettings=OPTIONS[opt];val=extractValue(rawOptions,opt);if(val==null&&optsettings["default"]!=null){val=optsettings["default"]}parsed[opt]=optionValidator.coerceOption(OPTIONS,opt,val)}if(parsed.shippingAddress){parsed.billingAddress=true}if(rawOptions.address!=null&&rawOptions.address!=="false"&&rawOptions.address!==false){parsed.billingAddress=true}if(parsed.billingAddress){parsed.zipCode=false}return parsed},checkUsage:function(origin,rawOptions,isDarkMode){var OPTIONS,error,errors,isConfigure,isLiveMode,numErrors,numWarnings,quiet,warning,warnings,_i,_j,_len,_len1,_ref;if(isDarkMode==null){isDarkMode=false}isLiveMode=isLiveModeFromKey(rawOptions.key);quiet=isLiveMode||isDarkMode;isConfigure=origin==="configure";if(rawOptions.buttonIntegration){if(isConfigure){OPTIONS=optionSpecs.buttonConfigureOptions}else{OPTIONS=optionSpecs.buttonOpenOptions}}else{if(isConfigure){OPTIONS=optionSpecs.customConfigureOptions}else{OPTIONS=optionSpecs.customOpenOptions}}_ref=optionValidator.validate(OPTIONS,rawOptions),errors=_ref.errors,warnings=_ref.warnings;numErrors=errors.length;numWarnings=warnings.length;trackSummary({origin:origin,numErrors:numErrors,numWarnings:numWarnings},rawOptions);for(_i=0,_len=errors.length;_i<_len;_i++){error=errors[_i];if(!quiet){if(typeof console!=="undefined"&&console!==null){console.error(formatMessage(origin,error.toString()))}}trackError(origin,rawOptions,error)}quiet||(quiet=numErrors>0);for(_j=0,_len1=warnings.length;_j<_len1;_j++){warning=warnings[_j];if(!quiet){if(typeof console!=="undefined"&&console!==null){console.warn(formatMessage(origin,warning.toString()))}}trackWarning(origin,rawOptions,warning)}}}}).call(this)}});StripeCheckout.require.define({"lib/rpc":function(exports,require,module){(function(){var RPC,helpers,tracker,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__slice=[].slice;helpers=require("lib/helpers");tracker=require("lib/tracker");RPC=function(){function RPC(target,options){if(options==null){options={}}this.processMessage=__bind(this.processMessage,this);this.sendMessage=__bind(this.sendMessage,this);this.invoke=__bind(this.invoke,this);this.startSession=__bind(this.startSession,this);this.rpcID=0;this.target=target;this.callbacks={};this.readyQueue=[];this.readyStatus=false;this.methods={};helpers.bind(window,"message",function(_this){return function(){var args;args=1<=arguments.length?__slice.call(arguments,0):[];return _this.message.apply(_this,args)}}(this))}RPC.prototype.startSession=function(){this.sendMessage("frameReady");return this.frameReady()};RPC.prototype.invoke=function(){var args,method;method=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[];tracker.trace.rpcInvoke(method);return this.ready(function(_this){return function(){return _this.sendMessage(method,args)}}(this))};RPC.prototype.message=function(e){var shouldProcess;shouldProcess=false;try{shouldProcess=e.source===this.target}catch(_error){}if(shouldProcess){return this.processMessage(e.data)}};RPC.prototype.ready=function(fn){if(this.readyStatus){return fn()}else{return this.readyQueue.push(fn)}};RPC.prototype.frameCallback=function(id,result){var _base;if(typeof(_base=this.callbacks)[id]==="function"){_base[id](result)}delete this.callbacks[id];return true};RPC.prototype.frameReady=function(){var callbacks,cb,_i,_len;this.readyStatus=true;callbacks=this.readyQueue.slice(0);for(_i=0,_len=callbacks.length;_i<_len;_i++){cb=callbacks[_i];cb()}return false};RPC.prototype.isAlive=function(){return true};RPC.prototype.sendMessage=function(method,args){var err,id,message,_ref;if(args==null){args=[]}id=++this.rpcID;if(typeof args[args.length-1]==="function"){this.callbacks[id]=args.pop()}message=JSON.stringify({method:method,args:args,id:id});if(((_ref=this.target)!=null?_ref.postMessage:void 0)==null){err=new Error("Unable to communicate with Checkout. Please contact support@stripe.com if the problem persists.");if(this.methods.rpcError!=null){this.methods.rpcError(err)}else{throw err}return}this.target.postMessage(message,"*");return tracker.trace.rpcPostMessage(method,args,id)};RPC.prototype.processMessage=function(data){var method,result,_base,_name;try{data=JSON.parse(data)}catch(_error){return}if(["frameReady","frameCallback","isAlive"].indexOf(data.method)!==-1){result=null;method=this[data.method];if(method!=null){result=method.apply(this,data.args)}}else{result=typeof(_base=this.methods)[_name=data.method]==="function"?_base[_name].apply(_base,data.args):void 0}if(data.method!=="frameCallback"){return this.invoke("frameCallback",data.id,result)}};return RPC}();module.exports=RPC}).call(this)}});StripeCheckout.require.define({"lib/uuid":function(exports,require,module){(function(){var S4;S4=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};module.exports.generate=function(){var delim;delim="-";return S4()+S4()+delim+S4()+delim+S4()+delim+S4()+delim+S4()+S4()+S4()}}).call(this)}});StripeCheckout.require.define({"lib/pixel":function(exports,require,module){(function(){var canTrack,encode,generateID,getCookie,getCookieID,getLocalStorageID,request,setCookie,track;generateID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r,v;r=Math.random()*16|0;v=c==="x"?r:r&3|8;return v.toString(16)})};setCookie=function(name,value,options){var cookie,expires;if(options==null){options={}}if(options.expires===true){options.expires=-1}if(typeof options.expires==="number"){expires=new Date;expires.setTime(expires.getTime()+options.expires*24*60*60*1e3);options.expires=expires}if(options.path==null){options.path="/"}value=(value+"").replace(/[^!#-+\--:<-\[\]-~]/g,encodeURIComponent);cookie=encodeURIComponent(name)+"="+value;if(options.expires){cookie+=";expires="+options.expires.toGMTString()}if(options.path){cookie+=";path="+options.path}if(options.domain){cookie+=";domain="+options.domain}return document.cookie=cookie};getCookie=function(name){var cookie,cookies,index,key,value,_i,_len;cookies=document.cookie.split("; ");for(_i=0,_len=cookies.length;_i<_len;_i++){cookie=cookies[_i];index=cookie.indexOf("=");key=decodeURIComponent(cookie.substr(0,index));value=decodeURIComponent(cookie.substr(index+1));if(key===name){return value}}return null};encode=function(param){if(typeof param==="string"){return encodeURIComponent(param)}else{return encodeURIComponent(JSON.stringify(param))}};request=function(url,params,callback){var image,k,v;if(params==null){params={}}params.i=(new Date).getTime();params=function(){var _results;_results=[];for(k in params){v=params[k];_results.push(""+k+"="+encode(v))}return _results}().join("&");image=new Image;if(callback){image.onload=callback}image.src=""+url+"?"+params;return true};canTrack=function(){var dnt,_ref;dnt=(_ref=window.navigator.doNotTrack)!=null?_ref.toString().toLowerCase():void 0;switch(dnt){case"1":case"yes":case"true":return false;default:return true}};getLocalStorageID=function(){var err,lsid;if(!canTrack()){return"DNT"}try{lsid=localStorage.getItem("lsid");if(!lsid){lsid=generateID();localStorage.setItem("lsid",lsid)}return lsid}catch(_error){err=_error;return"NA"}};getCookieID=function(){var err,id;if(!canTrack()){return"DNT"}try{id=getCookie("cid")||generateID();setCookie("cid",id,{expires:360*20,domain:".stripe.com"});return id}catch(_error){err=_error;return"NA"}};track=function(event,params,callback){var k,referrer,request_params,search,v;if(params==null){params={}}referrer=document.referrer;search=window.location.search;request_params={event:event,rf:referrer,sc:search};for(k in params){v=params[k];request_params[k]=v}request_params.lsid||(request_params.lsid=getLocalStorageID());request_params.cid||(request_params.cid=getCookieID());return request("https://q.stripe.com",request_params,callback)};module.exports.track=track;module.exports.getLocalStorageID=getLocalStorageID;module.exports.getCookieID=getCookieID}).call(this)}});StripeCheckout.require.define({"vendor/base64":function(exports,require,module){var utf8Encode=function(string){string=(string+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n");var utftext="",start,end;var stringl=0,n;start=end=0;stringl=string.length;for(n=0;n127&&c1<2048){enc=String.fromCharCode(c1>>6|192,c1&63|128)}else{enc=String.fromCharCode(c1>>12|224,c1>>6&63|128,c1&63|128)}if(enc!==null){if(end>start){utftext+=string.substring(start,end)}utftext+=enc;start=end=n+1}}if(end>start){utftext+=string.substring(start,string.length)}return utftext};module.exports.encode=function(data){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o1,o2,o3,h1,h2,h3,h4,bits,i=0,ac=0,enc="",tmp_arr=[];if(!data){return data}data=utf8Encode(data);do{o1=data.charCodeAt(i++);o2=data.charCodeAt(i++);o3=data.charCodeAt(i++);bits=o1<<16|o2<<8|o3;h1=bits>>18&63;h2=bits>>12&63;h3=bits>>6&63;h4=bits&63;tmp_arr[ac++]=b64.charAt(h1)+b64.charAt(h2)+b64.charAt(h3)+b64.charAt(h4)}while(i0){throw new Error("Missing required data ("+missingKeys.join(", ")+") for tracking "+eventName+".")}parameters.distinct_id=config.distinctId;parameters.eventId=uuid.generate();if(options.appendStateParameters==null){options.appendStateParameters=true}if(options.appendStateParameters){for(k in stateParameters){v=stateParameters[k];parameters[k]=v}}parameters.h=screen.height;parameters.w=screen.width;for(v=_i=0,_len=parameters.length;_i<_len;v=++_i){k=parameters[v];if(v instanceof Array){v.sort()}}fullEventName=""+config.eventNamePrefix+eventName;if(!options.excludeMixpanel){mixpanel.track(fullEventName,parameters)}return pixel.track(fullEventName,parameters)};mixpanel={};mixpanel.track=function(eventName,options){var dataStr,properties;if(options==null){options={}}if(!(typeof $!=="undefined"&&$!==null&&config.mixpanelKey!=null)){return}properties=$.extend({token:config.mixpanelKey,userAgent:window.navigator.userAgent},options);delete properties["stripe_token"];dataStr=base64.encode(JSON.stringify({event:eventName,properties:properties}));return(new Image).src="https://api.mixpanel.com/track/?ip=1&img=1&data="+dataStr};traceSerialize=function(value){var k,obj,v;if(value instanceof Array){return JSON.stringify(function(){var _i,_len,_results;_results=[];for(_i=0,_len=value.length;_i<_len;_i++){v=value[_i];_results.push(traceSerialize(v))}return _results}())}else if(value!=null&&value.target!=null&&value.type!=null){return traceSerialize({type:value.type,target_id:value.target.id})}else if(value instanceof Object){if(value.constructor===Object){obj={};for(k in value){v=value[k];obj[k]=traceSerialize(v)}return JSON.stringify(obj)}else{return value.toString()}}else{return value}};module.exports=tracker}).call(this)}});StripeCheckout.require.define({"outer/lib/fallbackRpc":function(exports,require,module){(function(){var FallbackRPC,cacheBust,interval,lastHash,re,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};cacheBust=1;interval=null;lastHash=null;re=/^#?\d+&/;FallbackRPC=function(){function FallbackRPC(target,host){this.invokeTarget=__bind(this.invokeTarget,this);this.target=target;this.host=host}FallbackRPC.prototype.invokeTarget=function(message){var url;message=+new Date+cacheBust++ +"&"+encodeURIComponent(message);url=this.host+"";return this.target.location=url.replace(/#.*$/,"")+"#"+message};FallbackRPC.prototype.receiveMessage=function(callback,delay){if(delay==null){delay=100}interval&&clearInterval(interval);return interval=setInterval(function(){var hash;hash=decodeURIComponent(window.location.hash);if(hash!==lastHash&&re.test(hash)){window.location.hash="";lastHash=hash;return callback({data:hash.replace(re,"")})}},delay)};return FallbackRPC}();module.exports=FallbackRPC }).call(this)}});StripeCheckout.require.define({"outer/lib/utils":function(exports,require,module){(function(){var $,$$,addClass,append,css,hasAttr,hasClass,insertAfter,insertBefore,parents,remove,resolve,text,trigger,__indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i=0};css=function(element,css){return element.style.cssText+=";"+css};insertBefore=function(element,child){return element.parentNode.insertBefore(child,element)};insertAfter=function(element,child){return element.parentNode.insertBefore(child,element.nextSibling)};append=function(element,child){return element.appendChild(child)};remove=function(element){var _ref;return(_ref=element.parentNode)!=null?_ref.removeChild(element):void 0};parents=function(node){var ancestors;ancestors=[];while((node=node.parentNode)&&node!==document&&__indexOf.call(ancestors,node)<0){ancestors.push(node)}return ancestors};resolve=function(url){var parser;parser=document.createElement("a");parser.href=url;return""+parser.href};text=function(element,value){if("innerText"in element){element.innerText=value}else{element.textContent=value}return value};module.exports={$:$,$$:$$,hasAttr:hasAttr,trigger:trigger,addClass:addClass,hasClass:hasClass,css:css,insertBefore:insertBefore,insertAfter:insertAfter,append:append,remove:remove,parents:parents,resolve:resolve,text:text}}).call(this)}});StripeCheckout.require.define({"outer/controllers/app":function(exports,require,module){(function(){var App,Checkout,RPC,TokenCallback,optionParser,tracker,utils,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};Checkout=require("outer/controllers/checkout");TokenCallback=require("outer/controllers/tokenCallback");RPC=require("lib/rpc");optionParser=require("lib/optionParser");tracker=require("lib/tracker");utils=require("outer/lib/utils");App=function(){function App(options){var _ref,_ref1;if(options==null){options={}}this.setForceAppType=__bind(this.setForceAppType,this);this.setForceView=__bind(this.setForceView,this);this.setForceManhattan=__bind(this.setForceManhattan,this);this.getHost=__bind(this.getHost,this);this.setHost=__bind(this.setHost,this);this.configure=__bind(this.configure,this);this.close=__bind(this.close,this);this.open=__bind(this.open,this);this.configurations={};this.checkouts={};this.constructorOptions={host:"https://checkout.stripe.com",forceManhattan:false,forceView:false,forceAppType:false};this.timeLoaded=Math.floor((new Date).getTime()/1e3);this.totalButtons=0;if(((_ref=window.Prototype)!=null?(_ref1=_ref.Version)!=null?_ref1.indexOf("1.6"):void 0:void 0)===0){console.error("Stripe Checkout is not compatible with your version of Prototype.js. Please upgrade to version 1.7 or greater.")}}App.prototype.open=function(options,buttonId){var checkout,k,mergedOptions,v,_ref;if(options==null){options={}}if(buttonId==null){buttonId=null}mergedOptions={referrer:document.referrer,url:document.URL,timeLoaded:this.timeLoaded};if(buttonId&&this.configurations[buttonId]){_ref=this.configurations[buttonId];for(k in _ref){v=_ref[k];mergedOptions[k]=v}}for(k in options){v=options[k];mergedOptions[k]=v}if(mergedOptions.image){mergedOptions.image=utils.resolve(mergedOptions.image)}optionParser.checkUsage("open",mergedOptions);this.validateOptions(options,"open");if(buttonId){checkout=this.checkouts[buttonId];if(options.token!=null||options.onToken!=null){checkout.setOnToken(new TokenCallback(options))}}else{checkout=new Checkout(new TokenCallback(options),this.constructorOptions,options)}this.trackOpen(checkout,mergedOptions);this.trackViewport();return checkout.open(mergedOptions)};App.prototype.close=function(buttonId){var _ref;return(_ref=this.checkouts[buttonId])!=null?_ref.close():void 0};App.prototype.configure=function(buttonId,options){if(options==null){options={}}if(buttonId instanceof Object){options=buttonId;buttonId="button"+this.totalButtons++}this.enableTracker(options);optionParser.checkUsage("configure",options);if(options.image){options.image=utils.resolve(options.image)}this.validateOptions(options,"configure");this.configurations[buttonId]=options;this.checkouts[buttonId]=new Checkout(new TokenCallback(options),this.constructorOptions,options);this.checkouts[buttonId].preload(options);return{open:function(_this){return function(options){return _this.open(options,buttonId)}}(this),close:function(_this){return function(){return _this.close(buttonId)}}(this)}};App.prototype.validateOptions=function(options,which){var url;try{return JSON.stringify(options)}catch(_error){url="https://stripe.com/docs/checkout#integration-custom";throw new Error("Stripe Checkout was unable to serialize the options passed to StripeCheckout."+which+"(). Please consult the doumentation to confirm that you're supplying values of the expected type: "+url)}};App.prototype.setHost=function(host){return this.constructorOptions.host=host};App.prototype.getHost=function(){return this.constructorOptions.host};App.prototype.setForceManhattan=function(force){return this.constructorOptions.forceManhattan=!!force};App.prototype.setForceView=function(force){return this.constructorOptions.forceView=force};App.prototype.setForceAppType=function(force){return this.constructorOptions.forceAppType=force};App.prototype.enableTracker=function(options){return tracker.setEnabled(!options.notrack)};App.prototype.trackOpen=function(checkout,options){this.enableTracker(options);return tracker.track.outerOpen({key:options.key,lsid:"NA",cid:"NA"})};App.prototype.trackViewport=function(checkout,options){var metaTags,tag,viewport,viewportContent;metaTags=document.getElementsByTagName("meta");viewportContent=function(){var _i,_len,_results;_results=[];for(_i=0,_len=metaTags.length;_i<_len;_i++){tag=metaTags[_i];if(tag.name==="viewport"&&!!tag.content){_results.push(tag.content)}}return _results}().join(",");try{viewport=viewportContent.split(",").map(function(t){return t.trim().toLowerCase()}).sort().join(", ");return tracker.track.viewport(viewport)}catch(_error){}};return App}();module.exports=App}).call(this)}});StripeCheckout.require.define({"outer/controllers/button":function(exports,require,module){(function(){var $$,Button,addClass,append,hasAttr,hasClass,helpers,insertAfter,optionParser,parents,resolve,text,trigger,_ref,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};_ref=require("outer/lib/utils"),$$=_ref.$$,hasClass=_ref.hasClass,addClass=_ref.addClass,trigger=_ref.trigger,append=_ref.append,text=_ref.text,parents=_ref.parents,insertAfter=_ref.insertAfter,hasAttr=_ref.hasAttr,resolve=_ref.resolve;helpers=require("lib/helpers");optionParser=require("lib/optionParser");Button=function(){Button.totalButtonId=0;Button.load=function(app){var button,el,element;element=$$("stripe-button");element=function(){var _i,_len,_results;_results=[];for(_i=0,_len=element.length;_i<_len;_i++){el=element[_i];if(!hasClass(el,"active")){_results.push(el)}}return _results}();element=element[element.length-1];if(!element){return}addClass(element,"active");button=new Button(element,app);return button.append()};function Button(scriptEl,app){this.parseOptions=__bind(this.parseOptions,this);this.parentHead=__bind(this.parentHead,this);this.parentForm=__bind(this.parentForm,this);this.onToken=__bind(this.onToken,this);this.open=__bind(this.open,this);this.submit=__bind(this.submit,this);this.append=__bind(this.append,this);this.render=__bind(this.render,this);var _base;this.scriptEl=scriptEl;this.app=app;this.document=this.scriptEl.ownerDocument;this.nostyle=helpers.isFallback();this.options=this.parseOptions();(_base=this.options).label||(_base.label="Pay with Card");this.options.token=this.onToken;this.options.buttonIntegration=true;this.$el=document.createElement("button");this.$el.setAttribute("type","submit");this.$el.className="stripe-button-el";helpers.bind(this.$el,"click",this.submit);helpers.bind(this.$el,"touchstart",function(){});this.render()}Button.prototype.render=function(){this.$el.innerHTML="";this.$span=document.createElement("span");text(this.$span,this.options.label);if(!this.nostyle){this.$el.style.visibility="hidden";this.$span.style.display="block";this.$span.style.minHeight="30px"}this.$style=document.createElement("link");this.$style.setAttribute("type","text/css");this.$style.setAttribute("rel","stylesheet");this.$style.setAttribute("href",this.app.getHost()+"/v3/checkout/button-qpwW2WfkB0oGWVWIASjIOQ.css");return append(this.$el,this.$span)};Button.prototype.append=function(){var head;if(this.scriptEl){insertAfter(this.scriptEl,this.$el)}if(!this.nostyle){head=this.parentHead();if(head){append(head,this.$style)}}if(this.$form=this.parentForm()){helpers.unbind(this.$form,"submit",this.submit);helpers.bind(this.$form,"submit",this.submit)}if(!this.nostyle){setTimeout(function(_this){return function(){return _this.$el.style.visibility="visible"}}(this),1e3)}this.app.setHost(helpers.host(this.scriptEl.src));return this.appHandler=this.app.configure(this.options,{form:this.$form})};Button.prototype.disable=function(){return this.$el.setAttribute("disabled",true)};Button.prototype.enable=function(){return this.$el.removeAttribute("disabled")};Button.prototype.isDisabled=function(){return hasAttr(this.$el,"disabled")};Button.prototype.submit=function(e){if(typeof e.preventDefault==="function"){e.preventDefault()}if(!this.isDisabled()){this.open()}return false};Button.prototype.open=function(){return this.appHandler.open(this.options)};Button.prototype.onToken=function(token,args){var $input,$tokenInput,$tokenTypeInput,key,value;trigger(this.scriptEl,"token",token);if(this.$form){$tokenInput=this.renderInput("stripeToken",token.id);append(this.$form,$tokenInput);$tokenTypeInput=this.renderInput("stripeTokenType",token.type);append(this.$form,$tokenTypeInput);if(token.email){append(this.$form,this.renderInput("stripeEmail",token.email))}if(args){for(key in args){value=args[key];$input=this.renderInput(this.formatKey(key),value);append(this.$form,$input)}}this.$form.submit()}return this.disable()};Button.prototype.formatKey=function(key){var arg,args,_i,_len;args=key.split("_");key="";for(_i=0,_len=args.length;_i<_len;_i++){arg=args[_i];if(arg.length>0){key=key+arg.substr(0,1).toUpperCase()+arg.substr(1).toLowerCase()}}return"stripe"+key};Button.prototype.renderInput=function(name,value){var input;input=document.createElement("input");input.type="hidden";input.name=name;input.value=value;return input};Button.prototype.parentForm=function(){var el,elements,_i,_len,_ref1;elements=parents(this.$el);for(_i=0,_len=elements.length;_i<_len;_i++){el=elements[_i];if(((_ref1=el.tagName)!=null?_ref1.toLowerCase():void 0)==="form"){return el}}return null};Button.prototype.parentHead=function(){var _ref1,_ref2;return((_ref1=this.document)!=null?_ref1.head:void 0)||((_ref2=this.document)!=null?_ref2.getElementsByTagName("head")[0]:void 0)||this.document.body};Button.prototype.parseOptions=function(){var attr,camelOption,coercedValue,match,options,val,_i,_len,_ref1;options={};_ref1=this.scriptEl.attributes;for(_i=0,_len=_ref1.length;_i<_len;_i++){attr=_ref1[_i];match=attr.name.match(/^data-(.+)$/);if(match!=null?match[1]:void 0){camelOption=helpers.dashToCamelCase(match[1]);if(camelOption==="image"){if(attr.value){val=resolve(attr.value)}}else{val=attr.value}coercedValue=optionParser.coerceButtonOption(camelOption,val);options[camelOption]=coercedValue;if(options.__originals==null){options.__originals={}}options.__originals[camelOption]=match[0]}}return options};return Button}();module.exports=Button}).call(this)}});StripeCheckout.require.define({"outer/controllers/checkout":function(exports,require,module){(function(){var Checkout,FallbackView,IframeView,TabView,helpers,tracker,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};helpers=require("lib/helpers");IframeView=require("outer/views/iframeView");TabView=require("outer/views/tabView");FallbackView=require("outer/views/fallbackView");tracker=require("lib/tracker");Checkout=function(){Checkout.activeView=null;function Checkout(tokenCallback,options,configOptions){this.shouldUseManhattan=__bind(this.shouldUseManhattan,this);this.isLegacyIe=__bind(this.isLegacyIe,this);this.invokeCallbacks=__bind(this.invokeCallbacks,this);this.onTokenCallback=__bind(this.onTokenCallback,this);this.preload=__bind(this.preload,this);this.open=__bind(this.open,this);this.createView=__bind(this.createView,this);this.setOnToken=__bind(this.setOnToken,this);this.host=options.host;this.forceManhattan=options.forceManhattan;this.forceView=options.forceView;this.forceAppType=options.forceAppType;this.opened=false;this.setOnToken(tokenCallback);this.isMobileWebView=helpers.isNativeWebContainer()||helpers.isAndroidWebapp()||helpers.isAndroidFacebookApp()||helpers.isiOSWebView()||helpers.isiOSBroken();this.shouldPopup=helpers.isSupportedMobileOS()&&!this.isMobileWebView;this.manhattanPending=false;this.manhattanCallbacks=[];this.shouldUseManhattan(this.createView,configOptions)}Checkout.prototype.setOnToken=function(tokenCallback){var _ref;this.tokenCallback=tokenCallback;this.onToken=function(_this){return function(data){return tokenCallback.trigger(data.token,data.args,_this.onTokenCallback)}}(this);return(_ref=this.view)!=null?_ref.onToken=this.onToken:void 0};Checkout.prototype.createView=function(useManhattan){var forceViewClass,path,viewClass,views;if(useManhattan==null){useManhattan=false}if(this.view!=null){return}tracker.track.manhattanStatusSet(useManhattan);views={FallbackView:FallbackView,IframeView:IframeView,TabView:TabView};forceViewClass=views[this.forceView];viewClass=function(){switch(false){case!forceViewClass:return forceViewClass;case!helpers.isFallback():return FallbackView;case!this.shouldPopup:return TabView;default:return IframeView}}.call(this);path=function(){switch(false){case viewClass!==FallbackView:return"/v3/fallback/YdGLG09wdP9PlOPQYj60A.html";case!useManhattan:return"/m/v3/index-39ade45d85cb02ab2f091aa97e4382ff.html";default:return"/v3/ZQdHTgQQb08RG01SxL4MA.html"}}();path=""+path+"?distinct_id="+tracker.getDistinctID();if(this.forceAppType){path=""+path+"?force_app_type="+this.forceAppType}this.view=new viewClass(this.onToken,this.host,path);if(this.preloadOptions!=null){this.view.preload(this.preloadOptions);return this.preloadOptions=null}};Checkout.prototype.open=function(options){var cb;if(options==null){options={}}cb=function(_this){return function(){var iframeFallback;_this.opened=true;if(Checkout.activeView&&Checkout.activeView!==_this.view){Checkout.activeView.close()}Checkout.activeView=_this.view;options.supportsTokenCallback=_this.tokenCallback.supportsTokenCallback();iframeFallback=function(){if(!(this.view instanceof TabView)){return}this.view=new IframeView(this.onToken,this.host,"/v3/ZQdHTgQQb08RG01SxL4MA.html");return this.open(options)};if(helpers.isiOSChrome()&&helpers.iOSChromeTabViewWillFail()){return iframeFallback()}return _this.view.open(options,function(status){if(!status){return iframeFallback()}})}}(this);if(this.manhattanPending){if(!this.shouldPopup){return this.manhattanCallbacks.push(cb)}else{this.createView();return cb()}}else{return cb()}};Checkout.prototype.close=function(){var _ref;return(_ref=this.view)!=null?_ref.close():void 0};Checkout.prototype.preload=function(options){if(this.view!=null){return this.view.preload(options)}else{return this.preloadOptions=options}};Checkout.prototype.onTokenCallback=function(){return this.view.triggerTokenCallback.apply(this.view,arguments)};Checkout.prototype.invokeCallbacks=function(){var callback,_i,_len,_ref;_ref=this.manhattanCallbacks;for(_i=0,_len=_ref.length;_i<_len;_i++){callback=_ref[_i];callback()}this.manhattanCallbacks=[];return this.manhattanPending=false};Checkout.prototype.isLegacyIe=function(){return!(window.XMLHttpRequest!=null&&(new XMLHttpRequest).withCredentials!=null)};Checkout.prototype.shouldUseManhattan=function(cb,options){var handleResponseText,key,req,url,value;this.manhattanPending=true;setTimeout(function(_this){return function(){_this.createView();return _this.invokeCallbacks()}}(this),3e3);if(helpers.isFallback()||this.isMobileWebView){cb(this.forceManhattan);this.invokeCallbacks();return}if(this.manhattanFlagState!=null){cb(this.manhattanFlagState);this.invokeCallbacks()}handleResponseText=function(_this){return function(rt){var data;try{data=JSON.parse(rt);if(_this.forceManhattan===true){return _this.manhattanFlagState=_this.forceManhattan}else{return _this.manhattanFlagState=!!data.is_on}}catch(_error){return _this.manhattanFlagState=false}}}(this);if(this.isLegacyIe()){if(window.location.protocol!=="https:"){cb();return}req=new window.XDomainRequest;req.onload=function(_this){return function(){try{handleResponseText(req.responseText);cb(_this.manhattanFlagState)}catch(_error){cb()}return _this.invokeCallbacks()}}(this)}else{req=new XMLHttpRequest;req.onreadystatechange=function(_this){return function(){if(req.readyState!==4){return}if(req.status===200){handleResponseText(req.responseText)}else{_this.manhattanFlagState=false}cb(_this.manhattanFlagState);return _this.invokeCallbacks()}}(this)}url=this.host+"/api/outer/manhattan";for(key in options){value=options[key];if(key!=="token"&&key!=="opened"&&key!=="closed"){url=helpers.addQueryParameter(url,key,value)}}req.open("GET",url,true);return req.send()};return Checkout}();module.exports=Checkout}).call(this)}});StripeCheckout.require.define({"outer/controllers/tokenCallback":function(exports,require,module){(function(){var TokenCallback,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};TokenCallback=function(){function TokenCallback(options){this.supportsTokenCallback=__bind(this.supportsTokenCallback,this);this.trigger=__bind(this.trigger,this);if(options.token){this.fn=options.token;this.version=1}else if(options.onToken){this.fn=options.onToken;this.version=2}}TokenCallback.prototype.trigger=function(token,addresses,callback){var data,k,shipping,v;if(this.version===2){data={token:token};shipping=null;for(k in addresses){v=addresses[k];if(/^shipping_/.test(k)){if(shipping==null){shipping={}}shipping[k.replace(/^shipping_/,"")]=v}}if(shipping!=null){data.shipping=shipping}return this.fn(data,callback)}else{return this.fn(token,addresses)}};TokenCallback.prototype.supportsTokenCallback=function(){return this.version>1};return TokenCallback}();module.exports=TokenCallback}).call(this)}});StripeCheckout.require.define({"outer/views/fallbackView":function(exports,require,module){(function(){var FallbackRPC,FallbackView,View,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};FallbackRPC=require("outer/lib/fallbackRpc");View=require("outer/views/view");FallbackView=function(_super){__extends(FallbackView,_super);function FallbackView(){this.triggerTokenCallback=__bind(this.triggerTokenCallback,this);this.close=__bind(this.close,this);this.open=__bind(this.open,this);FallbackView.__super__.constructor.apply(this,arguments)}FallbackView.prototype.open=function(options,callback){var message,url;FallbackView.__super__.open.apply(this,arguments);url=this.host+this.path;this.frame=window.open(url,"stripe_checkout_app","width=400,height=400,location=yes,resizable=yes,scrollbars=yes");if(this.frame==null){alert("Disable your popup blocker to proceed with checkout.");url="https://stripe.com/docs/checkout#integration-more-runloop";throw new Error("To learn how to prevent the Stripe Checkout popup from being blocked, please visit "+url)}this.rpc=new FallbackRPC(this.frame,url);this.rpc.receiveMessage(function(_this){return function(e){var data;try{data=JSON.parse(e.data)}catch(_error){return}return _this.onToken(data)}}(this));message=JSON.stringify(this.options);this.rpc.invokeTarget(message);return callback(true)};FallbackView.prototype.close=function(){var _ref;return(_ref=this.frame)!=null?_ref.close():void 0};FallbackView.prototype.triggerTokenCallback=function(err){if(err){return alert(err)}};return FallbackView}(View);module.exports=FallbackView}).call(this)}});StripeCheckout.require.define({"outer/views/iframeView":function(exports,require,module){(function(){var IframeView,RPC,View,helpers,ready,utils,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};utils=require("outer/lib/utils");helpers=require("lib/helpers");RPC=require("lib/rpc");View=require("outer/views/view");ready=require("vendor/ready");IframeView=function(_super){__extends(IframeView,_super);function IframeView(){this.configure=__bind(this.configure,this);this.removeFrame=__bind(this.removeFrame,this);this.removeTouchOverlay=__bind(this.removeTouchOverlay,this);this.showTouchOverlay=__bind(this.showTouchOverlay,this);this.attachIframe=__bind(this.attachIframe,this);this.setToken=__bind(this.setToken,this);this.closed=__bind(this.closed,this);this.close=__bind(this.close,this);this.preload=__bind(this.preload,this);this.opened=__bind(this.opened,this);this.open=__bind(this.open,this);return IframeView.__super__.constructor.apply(this,arguments)}IframeView.prototype.open=function(options,callback){IframeView.__super__.open.apply(this,arguments);return ready(function(_this){return function(){var left,loaded,_ref;_this.originalOverflowValue=document.body.style.overflow;if(_this.frame==null){_this.configure()}if(typeof $!=="undefined"&&$!==null?(_ref=$.fn)!=null?_ref.modal:void 0:void 0){$(document).off("focusin.bs.modal").off("focusin.modal")}_this.frame.style.display="block";if(_this.shouldShowTouchOverlay()){_this.showTouchOverlay();left=window.scrollX||window.pageXOffset;if(_this.iframeWidth()0&&this.main_link.hasClass('cli-minimize-bar')){ this.hideHeader(); cliBlocker.cookieBar(false); this.showagain_elm.slideDown(this.settings.animate_speed_show); return true; } return false; }, attachEvents:function(){ jQuery('.cli_action_button').click(function(e){ e.preventDefault(); var elm=jQuery(this); var button_action=elm.attr('data-cli_action'); var open_link=elm[0].hasAttribute("href")&&elm.attr("href")!='#' ? true:false; var new_window=false; if(button_action=='accept'){ CLI.accept_close(); new_window=Boolean(CLI.settings.button_1_new_win) ? true:false; }else if(button_action=='reject'){ CLI.reject_close(); new_window=Boolean(CLI.settings.button_3_new_win) ? true:false; } if(open_link){ if(new_window){ window.open(elm.attr("href"),'_blank'); }else{ window.location.href=elm.attr("href"); }} }); this.settingsPopUp(); this.settingsTabbedAccordion(); this.toggleUserPreferenceCheckBox(); this.hideCookieBarOnClose(); this.cookieLawInfoRunCallBacks(); }, toggleUserPreferenceCheckBox:function(){ jQuery('.cli-user-preference-checkbox').each(function(){ categoryCookie='cookielawinfo-'+jQuery(this).attr('data-id'); categoryCookieValue=CLI_Cookie.read(categoryCookie); if(categoryCookieValue==null){ if(jQuery(this).is(':checked')){ CLI_Cookie.set(categoryCookie,'yes',CLI_ACCEPT_COOKIE_EXPIRE); }else{ CLI_Cookie.set(categoryCookie,'no',CLI_ACCEPT_COOKIE_EXPIRE); }}else{ if(categoryCookieValue=="yes"){ jQuery(this).prop("checked",true); }else{ jQuery(this).prop("checked",false); }} }); jQuery('.cli-user-preference-checkbox').click(function(){ var dataID=jQuery(this).attr('data-id'); var currentToggleElm=jQuery('.cli-user-preference-checkbox[data-id='+dataID+']'); if(jQuery(this).is(':checked')){ CLI_Cookie.set('cookielawinfo-'+dataID,'yes',CLI_ACCEPT_COOKIE_EXPIRE); currentToggleElm.prop('checked',true); }else{ CLI_Cookie.set('cookielawinfo-'+dataID,'no',CLI_ACCEPT_COOKIE_EXPIRE); currentToggleElm.prop('checked',false); } CLI.checkCategories(); CLI.generateConsent(); }); }, settingsPopUp:function(){ jQuery(document).on('click','.cli_settings_button',function(e){ e.preventDefault(); CLI.settingsModal.addClass("cli-show").css({'opacity':0}).animate({'opacity':1}); CLI.settingsModal.removeClass('cli-blowup cli-out').addClass("cli-blowup"); jQuery('body').addClass("cli-modal-open"); jQuery(".cli-settings-overlay").addClass("cli-show"); jQuery("#cookie-law-info-bar").css({'opacity':.1}); if(!jQuery('.cli-settings-mobile').is(':visible')){ CLI.settingsModal.find('.cli-nav-link:eq(0)').click(); }}); jQuery('#cliModalClose').click(function(){ CLI.settingsPopUpClose(); }); CLI.settingsModal.click(function(e){ if(!(document.getElementsByClassName('cli-modal-dialog')[0].contains(e.target))){ CLI.settingsPopUpClose(); }}); jQuery('.cli_enable_all_btn').click(function(){ var cli_toggle_btn=jQuery(this); var enable_text=cli_toggle_btn.attr('data-enable-text'); var disable_text=cli_toggle_btn.attr('data-disable-text'); if(cli_toggle_btn.hasClass('cli-enabled')){ CLI.disableAllCookies(); cli_toggle_btn.html(enable_text); }else{ CLI.enableAllCookies(); cli_toggle_btn.html(disable_text); } jQuery(this).toggleClass('cli-enabled'); }); this.privacyReadmore(); }, settingsTabbedAccordion:function(){ jQuery(".cli-tab-header").on("click", function(e){ if(!(jQuery(e.target).hasClass('cli-slider')||jQuery(e.target).hasClass('cli-user-preference-checkbox'))){ if(jQuery(this).hasClass("cli-tab-active")){ jQuery(this).removeClass("cli-tab-active"); jQuery(this) .siblings(".cli-tab-content") .slideUp(200); }else{ jQuery(".cli-tab-header").removeClass("cli-tab-active"); jQuery(this).addClass("cli-tab-active"); jQuery(".cli-tab-content").slideUp(200); jQuery(this) .siblings(".cli-tab-content") .slideDown(200); }} }); }, settingsPopUpClose:function(){ this.settingsModal.removeClass('cli-show'); this.settingsModal.addClass('cli-out'); jQuery('body').removeClass("cli-modal-open"); jQuery(".cli-settings-overlay").removeClass("cli-show"); jQuery("#cookie-law-info-bar").css({'opacity':1}); }, privacyReadmore:function(){ var el=jQuery('.cli-privacy-content .cli-privacy-content-text'); if(el.length > 0){ var clone=el.clone(), originalHtml=clone.html(), originalHeight=el.outerHeight(), Trunc={ addReadmore:function(textBlock){ if(textBlock.html().length > 250){ jQuery('.cli-privacy-readmore').show(); }else{ jQuery('.cli-privacy-readmore').hide(); }}, truncateText:function(textBlock){ var strippedText=jQuery('
    ').html(textBlock.html()); strippedText.find('table').remove(); textBlock.html(strippedText.html()); currentText=textBlock.text(); if(currentText.trim().length > 250){ var newStr=currentText.substring(0, 250); textBlock.empty().html(newStr).append('...'); }}, replaceText: function(textBlock, original){ return textBlock.html(original); }}; Trunc.addReadmore(el); Trunc.truncateText(el); jQuery('a.cli-privacy-readmore').click(function(e){ e.preventDefault(); if(jQuery('.cli-privacy-overview').hasClass('cli-collapsed')){ Trunc.truncateText(el); jQuery('.cli-privacy-overview').removeClass('cli-collapsed'); el.css('height', '100%'); }else{ jQuery('.cli-privacy-overview').addClass('cli-collapsed'); Trunc.replaceText(el, originalHtml); }}); }}, attachDelete:function(){ this.delete_link.click(function (){ CLI_Cookie.erase(CLI_ACCEPT_COOKIE_NAME); for(var k in Cli_Data.nn_cookie_ids){ CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]); } CLI.generateConsent(); return false; }); }, configButtons:function(){ this.main_button.css('color',this.settings.button_1_link_colour); if(Boolean(this.settings.button_1_as_button)){ this.main_button.css('background-color',this.settings.button_1_button_colour); this.main_button.hover(function (){ jQuery(this).css('background-color',CLI.settings.button_1_button_hover); },function (){ jQuery(this).css('background-color',CLI.settings.button_1_button_colour); }); } this.main_link.css('color',this.settings.button_2_link_colour); if(Boolean(this.settings.button_2_as_button)){ this.main_link.css('background-color',this.settings.button_2_button_colour); this.main_link.hover(function (){ jQuery(this).css('background-color',CLI.settings.button_2_button_hover); },function (){ jQuery(this).css('background-color',CLI.settings.button_2_button_colour); }); } this.reject_link.css('color',this.settings.button_3_link_colour); if(Boolean(this.settings.button_3_as_button)){ this.reject_link.css('background-color',this.settings.button_3_button_colour); this.reject_link.hover(function (){ jQuery(this).css('background-color',CLI.settings.button_3_button_hover); },function (){ jQuery(this).css('background-color',CLI.settings.button_3_button_colour); }); } this.settings_button.css('color',this.settings.button_4_link_colour); if(Boolean(this.settings.button_4_as_button)){ this.settings_button.css('background-color',this.settings.button_4_button_colour); this.settings_button.hover(function (){ jQuery(this).css('background-color',CLI.settings.button_4_button_hover); },function (){ jQuery(this).css('background-color',CLI.settings.button_4_button_colour); }); }}, toggleBar:function(){ if(CLI_COOKIEBAR_AS_POPUP){ this.barAsPopUp(1); } if(CLI.settings.cookie_bar_as=='widget'){ this.barAsWidget(1); } if(!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)){ this.displayHeader(); }else{ this.hideHeader(); } if(Boolean(this.settings.show_once_yn)){ setTimeout(function(){ CLI.close_header(); },CLI.settings.show_once); } if(CLI.js_blocking_enabled===false){ if(Boolean(Cli_Data.ccpaEnabled)===true){ if(Cli_Data.ccpaType==='ccpa'&&Boolean(Cli_Data.ccpaBarEnabled)===false){ cliBlocker.cookieBar(false); }}else{ jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove(); }} this.showagain_elm.click(function (e){ e.preventDefault(); CLI.showagain_elm.slideUp(CLI.settings.animate_speed_hide,function(){ CLI.bar_elm.slideDown(CLI.settings.animate_speed_show); if(CLI_COOKIEBAR_AS_POPUP){ CLI.showPopupOverlay(); }}); }); }, configShowAgain:function(){ this.showagain_config={ 'background-color': this.settings.background, 'color':this.l1hs(this.settings.text), 'position': 'fixed', 'font-family': this.settings.font_family }; if(Boolean(this.settings.border_on)){ var border_to_hide='border-' + this.settings.notify_position_vertical; this.showagain_config['border']='1px solid ' + this.l1hs(this.settings.border); this.showagain_config[border_to_hide]='none'; } var cli_win=jQuery(window); var cli_winw=cli_win.width(); var showagain_x_pos=this.settings.showagain_x_position; if(cli_winw<300){ showagain_x_pos=10; this.showagain_config.width=cli_winw-20; }else{ this.showagain_config.width='auto'; } var cli_defw=cli_winw>400 ? 500:cli_winw-20; if(CLI_COOKIEBAR_AS_POPUP) { var sa_pos=this.settings.popup_showagain_position; var sa_pos_arr=sa_pos.split('-'); if(sa_pos_arr[1]=='left'){ this.showagain_config.left=showagain_x_pos; }else if(sa_pos_arr[1]=='right'){ this.showagain_config.right=showagain_x_pos; } if(sa_pos_arr[0]=='top'){ this.showagain_config.top=0; }else if(sa_pos_arr[0]=='bottom'){ this.showagain_config.bottom=0; } this.bar_config['position']='fixed'; }else if(this.settings.cookie_bar_as=='widget'){ this.showagain_config.bottom=0; if(this.settings.widget_position=='left'){ this.showagain_config.left=showagain_x_pos; }else if(this.settings.widget_position=='right'){ this.showagain_config.right=showagain_x_pos; }}else{ if(this.settings.notify_position_vertical=="top"){ this.showagain_config.top='0'; } else if(this.settings.notify_position_vertical=="bottom"){ this.bar_config['position']='fixed'; this.bar_config['bottom']='0'; this.showagain_config.bottom='0'; } if(this.settings.notify_position_horizontal=="left"){ this.showagain_config.left=showagain_x_pos; }else if(this.settings.notify_position_horizontal=="right"){ this.showagain_config.right=showagain_x_pos; }} this.showagain_elm.css(this.showagain_config); }, configBar:function(){ this.bar_config={ 'background-color':this.settings.background, 'color':this.settings.text, 'font-family':this.settings.font_family }; if(this.settings.notify_position_vertical=="top"){ this.bar_config['top']='0'; if(Boolean(this.settings.header_fix)===true){ this.bar_config['position']='fixed'; }}else{ this.bar_config['bottom']='0'; } this.configShowAgain(); this.bar_elm.css(this.bar_config).hide(); }, l1hs:function(str){ if(str.charAt(0)=="#"){ str=str.substring(1, str.length); }else{ return "#" + str; } return this.l1hs(str); }, close_header:function(){ CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'yes',CLI_ACCEPT_COOKIE_EXPIRE); this.hideHeader(); }, accept_close:function(){ this.hidePopupOverlay(); this.generateConsent(); this.cookieLawInfoRunCallBacks(); CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'yes',CLI_ACCEPT_COOKIE_EXPIRE); if(Boolean(this.settings.notify_animate_hide)){ if(CLI.js_blocking_enabled===true){ this.bar_elm.slideUp(this.settings.animate_speed_hide, cliBlocker.runScripts); }else{ this.bar_elm.slideUp(this.settings.animate_speed_hide); }}else{ if(CLI.js_blocking_enabled===true){ this.bar_elm.hide(cliBlocker.runScripts); }else{ this.bar_elm.hide(); }} if(Boolean(this.settings.showagain_tab)){ this.showagain_elm.slideDown(this.settings.animate_speed_show); } if(Boolean(this.settings.accept_close_reload)===true){ this.reload_current_page(); } return false; }, reject_close:function(){ this.hidePopupOverlay(); this.generateConsent(); this.cookieLawInfoRunCallBacks(); for(var k in Cli_Data.nn_cookie_ids){ CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]); } CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'no',CLI_ACCEPT_COOKIE_EXPIRE); if(Boolean(this.settings.notify_animate_hide)){ if(CLI.js_blocking_enabled===true){ this.bar_elm.slideUp(this.settings.animate_speed_hide, cliBlocker.runScripts); }else{ this.bar_elm.slideUp(this.settings.animate_speed_hide); }}else{ if(CLI.js_blocking_enabled===true){ this.bar_elm.hide(cliBlocker.runScripts); }else{ this.bar_elm.hide(); }} if(Boolean(this.settings.showagain_tab)){ this.showagain_elm.slideDown(this.settings.animate_speed_show); } if(Boolean(this.settings.reject_close_reload)===true){ this.reload_current_page(); } return false; }, reload_current_page:function(){ if(typeof cli_flush_cache!=='undefined'&&cli_flush_cache===true){ window.location.href=this.add_clear_cache_url_query(); }else{ window.location.reload(true); }}, add_clear_cache_url_query:function(){ var cli_rand=new Date().getTime()/1000; var cli_url=window.location.href; var cli_hash_arr=cli_url.split('#'); var cli_urlparts=cli_hash_arr[0].split('?'); if(cli_urlparts.length>=2){ var cli_url_arr=cli_urlparts[1].split('&'); cli_url_temp_arr=new Array(); for(var cli_i=0; cli_i0 ? '&': '')+'cli_action='; }else{ cli_url=cli_hash_arr[0]+'?cli_action='; } cli_url+=cli_rand; if(cli_hash_arr.length>1){ cli_url+='#'+cli_hash_arr[1]; } return cli_url; }, closeOnScroll:function(){ if(window.pageYOffset > 100&&!CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)){ CLI.accept_close(); if(Boolean(CLI.settings.scroll_close_reload)===true){ window.location.reload(); } window.removeEventListener("scroll",CLI.closeOnScroll,false); }}, displayHeader:function(){ if(Boolean(this.settings.notify_animate_show)){ this.bar_elm.slideDown(this.settings.animate_speed_show); }else{ this.bar_elm.show(); } this.showagain_elm.hide(); if(CLI_COOKIEBAR_AS_POPUP){ this.showPopupOverlay(); }}, hideHeader:function(){ if(Boolean(this.settings.showagain_tab)){ if(Boolean(this.settings.notify_animate_show)){ this.showagain_elm.slideDown(this.settings.animate_speed_show); }else{ this.showagain_elm.show(); }}else{ this.showagain_elm.hide(); } this.bar_elm.slideUp(this.settings.animate_speed_show); this.hidePopupOverlay(); }, hidePopupOverlay:function(){ jQuery('body').removeClass("cli-barmodal-open"); jQuery(".cli-popupbar-overlay").removeClass("cli-show"); }, showPopupOverlay:function(){ if(this.bar_elm.length){ if(Boolean(this.settings.popup_overlay)){ jQuery('body').addClass("cli-barmodal-open"); jQuery(".cli-popupbar-overlay").addClass("cli-show"); }} }, barAsWidget:function(a){ var cli_elm=this.bar_elm; cli_elm.attr('data-cli-type','widget'); var cli_win=jQuery(window); var cli_winh=cli_win.height()-40; var cli_winw=cli_win.width(); var cli_defw=cli_winw>400 ? 300:cli_winw-30; cli_elm.css({ 'width':cli_defw,'height':'auto','max-height':cli_winh,'overflow':'auto','position':'fixed','box-sizing':'border-box' }); if(this.checkifStyleAttributeExist()===false){ cli_elm.css({'padding':'25px 15px'}); } if(this.settings.widget_position=='left'){ cli_elm.css({ 'left':'15px','right':'auto','bottom':'15px','top':'auto' }); }else{ cli_elm.css({ 'left':'auto','right':'15px','bottom':'15px','top':'auto' }); } if(a){ this.setResize(); }}, barAsPopUp:function(a){ if(typeof cookie_law_info_bar_as_popup==='function'){ return false; } var cli_elm=this.bar_elm; cli_elm.attr('data-cli-type','popup'); var cli_win=jQuery(window); var cli_winh=cli_win.height()-40; var cli_winw=cli_win.width(); var cli_defw=cli_winw>700 ? 500:cli_winw-20; cli_elm.css({ 'width':cli_defw,'height':'auto','max-height':cli_winh,'bottom':'','top':'50%','left':'50%','margin-left':(cli_defw/2)*-1,'margin-top':'-100px','overflow':'auto' }).addClass('cli-bar-popup cli-modal-content'); if(this.checkifStyleAttributeExist()===false){ cli_elm.css({'padding':'25px 15px'}); } cli_h=cli_elm.height(); li_h=cli_h<200 ? 200:cli_h; cli_elm.css({'top':'50%','margin-top':((cli_h/2)+30)*-1}); setTimeout(function(){ cli_elm.css({ 'bottom':'' }); },100); if(a){ this.setResize(); }}, setResize:function(){ var resizeTmr=null; jQuery(window).resize(function(){ clearTimeout(resizeTmr); resizeTmr=setTimeout(function(){ if(CLI_COOKIEBAR_AS_POPUP){ CLI.barAsPopUp(); } if(CLI.settings.cookie_bar_as=='widget'){ CLI.barAsWidget(); } CLI.configShowAgain(); },500); }); }, enableAllCookies:function(){ jQuery('.cli-user-preference-checkbox').each(function(){ var cli_chkbox_elm=jQuery(this); var cli_chkbox_data_id=cli_chkbox_elm.attr('data-id'); if(cli_chkbox_data_id!='checkbox-necessary'){ cli_chkbox_elm.prop('checked',true); CLI_Cookie.set('cookielawinfo-'+cli_chkbox_data_id,'yes',CLI_ACCEPT_COOKIE_EXPIRE); }}); }, hideCookieBarOnClose: function(){ jQuery(document).on('click','.cli_cookie_close_button',function(e){ e.preventDefault(); var elm=jQuery(this); var button_action=elm.attr('data-cli_action'); if(Cli_Data.ccpaType==='ccpa'){ CLI.enableAllCookies(); } CLI.accept_close(); }); }, checkCategories:function(){ var cliAllowedCategories=[]; var cli_categories={}; jQuery('.cli-user-preference-checkbox').each(function(){ var status=false; cli_chkbox_elm=jQuery(this); cli_chkbox_data_id=cli_chkbox_elm.attr('data-id'); cli_chkbox_data_id=cli_chkbox_data_id.replace('checkbox-',''); cli_chkbox_data_id_trimmed=cli_chkbox_data_id.replace('-','_') if(jQuery(cli_chkbox_elm).is(':checked')){ status=true; cliAllowedCategories.push(cli_chkbox_data_id); } cli_categories[cli_chkbox_data_id_trimmed]=status; }); CLI.allowedCategories=cliAllowedCategories; }, cookieLawInfoRunCallBacks:function(){ this.checkCategories(); if(CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)=='yes'){ if("function"==typeof CookieLawInfo_Accept_Callback){ CookieLawInfo_Accept_Callback(); }} }, generateConsent:function(){ var preferenceCookie=CLI_Cookie.read(CLI_PREFERNCE_COOKIE); cliConsent={}; if(preferenceCookie!==null){ cliConsent=window.atob(preferenceCookie); cliConsent=JSON.parse(cliConsent); } cliConsent.ver=Cli_Data.consentVersion; categories=[]; jQuery('.cli-user-preference-checkbox').each(function(){ categoryVal=''; cli_chkbox_data_id=jQuery(this).attr('data-id'); cli_chkbox_data_id=cli_chkbox_data_id.replace('checkbox-',''); if(jQuery(this).is(':checked')){ categoryVal=true; }else{ categoryVal=false; } cliConsent[cli_chkbox_data_id]=categoryVal; }); cliConsent=JSON.stringify(cliConsent); cliConsent=window.btoa(cliConsent); CLI_Cookie.set(CLI_PREFERNCE_COOKIE,cliConsent,CLI_ACCEPT_COOKIE_EXPIRE); }, addStyleAttribute:function(){ var bar=this.bar_elm; var styleClass=''; if(jQuery(bar).find('.cli-bar-container').length > 0){ styleClass=jQuery('.cli-bar-container').attr('class'); styleClass=jQuery.trim(styleClass.replace('cli-bar-container','')); jQuery(bar).attr('data-cli-style',styleClass); }}, CookieLawInfo_Callback: function(enableBar, enableBlocking){ enableBar=typeof enableBar!=='undefined' ? enableBar:true; enableBlocking=typeof enableBlocking!=='undefined' ? enableBlocking:true; if(CLI.js_blocking_enabled===true&&Boolean(Cli_Data.custom_integration)===true){ cliBlocker.cookieBar(enableBar); cliBlocker.runScripts(enableBlocking); }}, checkifStyleAttributeExist: function(){ var exist=false; var attr=this.bar_elm.attr('data-cli-style'); if(typeof attr!==typeof undefined&&attr!==false){ exist=true; } return exist; }, reviewConsent:function(){ jQuery(document).on('click','.cli_manage_current_consent,.wt-cli-manage-consent-link',function(){ CLI.displayHeader(); }); }} var cliBlocker = { blockingStatus: true, scriptsLoaded: false, ccpaEnabled:false, ccpaRegionBased:false, ccpaApplicable:false, ccpaBarEnabled: false, cliShowBar: true , checkPluginStatus: function(callbackA , callbackB){ this.ccpaEnabled=Boolean(Cli_Data.ccpaEnabled); this.ccpaRegionBased=Boolean(Cli_Data.ccpaRegionBased); this.ccpaBarEnabled=Boolean(Cli_Data.ccpaBarEnabled); if(Boolean(Cli_Data.custom_integration)===true){ callbackA(false); }else{ if(this.ccpaEnabled===true){ this.ccpaApplicable=true; if(Cli_Data.ccpaType==='ccpa'){ if(this.ccpaBarEnabled!==true){ this.cliShowBar=false; this.blockingStatus=false; }} }else{ jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove(); } callbackA(this.cliShowBar); callbackB(this.blockingStatus); }}, cookieBar: function(showbar){ showbar=typeof showbar!=='undefined' ? showbar:true; cliBlocker.cliShowBar=showbar; if(cliBlocker.cliShowBar===false){ CLI.bar_elm.hide(); CLI.showagain_elm.hide(); CLI.settingsModal.removeClass('cli-blowup cli-out'); CLI.hidePopupOverlay(); jQuery(".cli-settings-overlay").removeClass("cli-show"); }else{ if(!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)){ CLI.displayHeader(); }else{ CLI.hideHeader(); } CLI.settingsModal.show(); jQuery('.cli-modal-backdrop').show(); }}, runScripts:function(blocking){ blocking=typeof blocking!=='undefined' ? blocking:true; cliBlocker.blockingStatus=blocking; srcReplaceableElms=['iframe','IFRAME','EMBED','embed','OBJECT','object','IMG','img']; var genericFuncs = { renderByElement: function(){ cliScriptFuncs.renderScripts(); cliBlocker.scriptsLoaded=true; }, }; var cliScriptFuncs = { scriptsDone:function(){ if(typeof Cli_Data.triggerDomRefresh!=='undefined'){ if(Boolean(Cli_Data.triggerDomRefresh)===true){ var DOMContentLoadedEvent=document.createEvent('Event') DOMContentLoadedEvent.initEvent('DOMContentLoaded', true, true) window.document.dispatchEvent(DOMContentLoadedEvent); }} }, seq :function(arr, callback, index){ if(typeof index==='undefined'){ index=0 } arr[index](function (){ index++ if(index===arr.length){ callback() }else{ cliScriptFuncs.seq(arr, callback, index) }}) }, insertScript:function($script,callback){ var s=''; var scriptType=$script.getAttribute('data-cli-script-type'); var elementPosition=$script.getAttribute('data-cli-element-position'); var isBlock=$script.getAttribute('data-cli-block'); var s=document.createElement('script'); var ccpaOptedOut=cliBlocker.ccpaOptedOut(); s.type='text/plain'; if($script.async){ s.async=$script.async; } if($script.defer){ s.defer=$script.defer; } if($script.src){ s.onload=callback s.onerror=callback s.src=$script.src }else{ s.textContent=$script.innerText } var attrs=jQuery($script).prop("attributes"); for (var ii=0; ii < attrs.length; ++ii){ if(attrs[ii].nodeName!=='id'){ s.setAttribute(attrs[ii].nodeName,attrs[ii].value); }} if(cliBlocker.blockingStatus===true){ if((CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)=='yes'&&CLI.allowedCategories.indexOf(scriptType)!==-1)){ s.setAttribute('data-cli-consent','accepted'); s.type='text/javascript'; } if(cliBlocker.ccpaApplicable===true){ if(ccpaOptedOut===true||CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)==null){ s.type='text/plain'; }} }else{ s.type='text/javascript'; } if($script.type!=s.type){ if(elementPosition==='head'){ document.head.appendChild(s); }else{ document.body.appendChild(s); } if(!$script.src){ callback() } $script.parentNode.removeChild($script); }else{ callback(); }}, renderScripts:function(){ var $scripts=document.querySelectorAll('script[data-cli-class="cli-blocker-script"]'); if($scripts.length > 0){ var runList=[] var typeAttr Array.prototype.forEach.call($scripts, function ($script){ typeAttr=$script.getAttribute('type') runList.push(function (callback){ cliScriptFuncs.insertScript($script, callback) }) }) cliScriptFuncs.seq(runList, cliScriptFuncs.scriptsDone); }} }; genericFuncs.renderByElement(); }, ccpaOptedOut:function (){ var ccpaOptedOut=false; var preferenceCookie=CLI_Cookie.read(CLI_PREFERNCE_COOKIE); if(preferenceCookie!==null){ cliConsent=window.atob(preferenceCookie); cliConsent=JSON.parse(cliConsent); if(typeof cliConsent.ccpaOptout!=='undefined'){ ccpaOptedOut=cliConsent.ccpaOptout; }} return ccpaOptedOut; }} jQuery(document).ready(function(){ if(typeof cli_cookiebar_settings!='undefined'){ CLI.set({ settings:cli_cookiebar_settings }); if(CLI.js_blocking_enabled===true){ cliBlocker.checkPluginStatus(cliBlocker.cookieBar,cliBlocker.runScripts); }} }); jQuery(function(){ var tabs=jQuery("#tabs").tabs(); jQuery('#tabsbtn').click(function(){ var ul=tabs.find("ul"); var list=Number(ul.find("li").length) + 1; var place1=jQuery('#tabs-1').find('input').attr('placeholder'); var place2=jQuery('#tabs-1').find('textarea').attr('placeholder'); var FAQMain=jQuery('div#tabs').data('faqtitle'); var FaqTItle=jQuery('.faq-btns').find('li').children('a').data('faq-text'); var FaqTItle=FaqTItle.replace(/[^A-Za-z]+/g, ''); jQuery("
  • " + FaqTItle + " " + list + "
  • ").appendTo(ul); if(jQuery(this).hasClass('style2-tabsbtn')){ var content="
    "; }else{ var content="
    "; } jQuery("
    " + content + "
    ").appendTo(tabs); tabs.tabs("refresh") }); jQuery(".jFiler-input-dragDrop").click(function(){ jQuery("#filer_input").click() }); jQuery(document).on('click', '.jFiler-item-trash-action', function(){ $this=jQuery(this); if($this.hasClass('lpsavedcrossgall')){ $selectedImagesCount1=jQuery('.lplistgallery').attr('data-savedgallerysize'); $selectedImagesCount1=$selectedImagesCount1-1; jQuery('.lplistgallery').attr('data-savedgallerysize', $selectedImagesCount1); jQuery('.filediv').attr('data-savedgallerysize', $selectedImagesCount1); $selectedImagesWeight=jQuery('.lplistgallery').attr('data-savedgallweight'); $selectedImagesWeight=parseFloat($selectedImagesWeight); $selectedImagesWeight=$selectedImagesWeight.toFixed(3); $thisweight=$this.closest('.filediv').attr('data-savedgallweight'); $thisweight=parseFloat($thisweight) $thisweight=$thisweight.toFixed(3); $selectedImagesWeight=$selectedImagesWeight - $thisweight; jQuery('.lplistgallery').attr('data-savedgallweight', $selectedImagesWeight); } jQuery(this).parent().find('.jFiler-item-container').fadeOut(); jQuery(this).closest('ul.jFiler-items-grid').fadeOut(); jQuery(this).fadeOut(); jQuery(this).next('input').attr('name', 'listImg_remove[]'); jQuery(this).parent().parent().parent().remove(); }); jQuery(document).on('change', 'input#already-account', function(e){ if(jQuery(this).is(':checked')){ jQuery('.lp-submit-no-account').fadeOut(500, function(e){ jQuery('.lp-submit-have-account').fadeIn(500) }) }else{ jQuery('.lp-submit-have-account').fadeOut(500, function(e){ jQuery('.lp-submit-no-account').fadeIn(500) }) }}) }) jQuery(document).on('click','#add-new-social-url', function (e){ var get_media_url=jQuery('#get_media_url').val(), get_media=jQuery('#get_media').val(); if(get_media_url==''){ jQuery('#get_media_url').addClass('error'); }else{ jQuery('#get_media_url').removeClass('error'); } if(get_media=='Please Select'){ jQuery('#select2-get_media-container').addClass('error'); }else{ jQuery('#select2-get_media-container').removeClass('error'); } if(get_media_url==''||get_media=='Please Select'){ return false; } if(get_media=='Twitter'){ jQuery('#inputTwitter').val(get_media_url);} if(get_media=='Facebook'){jQuery('#inputFacebook').val(get_media_url);} if(get_media=='LinkedIn'){jQuery('#inputLinkedIn').val(get_media_url);} if(get_media=='Google Plus'){jQuery('#inputGooglePlus').val(get_media_url);} if(get_media=='Youtube'){jQuery('#inputYoutube').val(get_media_url);} if(get_media=='Instagram'){jQuery('#inputInstagram').val(get_media_url);} if(jQuery('.social-row-'+get_media.replace(' ', '-')).length!=0){ jQuery('.social-row-'+get_media.replace(' ', '-')).find('span').text(get_media_url); }else{ var content=''; jQuery('.style2-social-list-section').append(content); } jQuery('#get_media_url').val(''); jQuery('#get_media').val(''); }); jQuery(document).on('click', '.remove-social-type', function (e){ e.preventDefault(); var targetType=jQuery(this).data('social'); if(targetType=='Twitter'){ jQuery('#inputTwitter').val(''); } if(targetType=='Facebook'){ jQuery('#inputFacebook').val(''); } if(targetType=='LinkedIn'){ jQuery('#inputLinkedIn').val(''); } if(targetType=='Google Plus'){ jQuery('#inputGooglePlus').val(''); } if(targetType=='Youtube'){ jQuery('#inputYoutube').val(''); } if(targetType=='Instagram'){ jQuery('#inputInstagram').val(''); } jQuery('.social-row-'+targetType).remove(); }); (function($){ 'use strict'; $(document).ready(function(){ $('form[id^="easyform_"]').on("submit", function (){ event.preventDefault(); var fname=$(this).find('input[name^="fname_"]').val(); var lname=$(this).find('input[name^="lname_"]').val(); var email=$(this).find('input[name^="email_"]').val(); var form_action=$(this).attr('action'); var form_data=$(this).serialize(); var data={ 'action':'smsnf_save_advanced_form_subscriber', 'form_data': form_data, 'url': form_action, 'form_id': this.id, 'fname':fname, 'lname':lname, 'email':email }; $.post(ajax_object.ajax_url, data, function(response){ console.log(response); alert(response); }); }); }); })(jQuery); advads={supports_localstorage:function(){"use strict";try{if(!window||window.localStorage===undefined){return false}window.localStorage.setItem("x","x");window.localStorage.removeItem("x");return true}catch(e){return false}},max_per_session:function(name,max){var num=1;if(max===undefined||parseInt(max)===0){max=1}if(this.cookie_exists(name)){if(this.get_cookie(name)>=max){return true}num=num+parseInt(this.get_cookie(name))}this.set_cookie(name,num);return false},count_up:function(name,exdays){var num=1;if(this.cookie_exists(name)){num=num+parseInt(this.get_cookie(name))}this.set_cookie(name,num)},set_cookie_exists:function(name){if(get_cookie(name)){return true}set_cookie(name,"",0);return false},get_cookie:function(name){var i,x,y,ADVcookies=document.cookie.split(";");for(i=0;i1){console.log("Advanced Ads: element '"+target_string+"' found "+target.length+" times.")}switch(options.method){case"insertBefore":el.insertBefore(target);break;case"insertAfter":el.insertAfter(target);break;case"appendTo":el.appendTo(target);break;case"prependTo":el.prependTo(target);break;default:el.prependTo(target)}},set_parent_relative:function(element,options){var options=typeof options!=="undefined"?options:{};var el=jQuery(element);var parent=el.parent();if(options.use_grandparent){parent=parent.parent()}if(parent.css("position")==="static"||parent.css("position")===""){parent.css("position","relative")}},fix_element:function(element,options){var options=typeof options!=="undefined"?options:{};var el=jQuery(element);if(options.use_grandparent){this.set_parent_relative(el.parent())}else{this.set_parent_relative(el)}if(options.is_invisible){el.show()}var topoffset=parseInt(el.offset().top);var leftoffset=parseInt(el.offset().left);if(options.is_invisible){el.hide()}if("left"===options.offset){var rightoffset=jQuery(window).width()-leftoffset-el.outerWidth();el.css("position","fixed").css("top",topoffset+"px").css("right",rightoffset+"px").css("left","")}else{el.css("position","fixed").css("top",topoffset+"px").css("left",leftoffset+"px").css("right","")}},find_wrapper:function(element,offset){var returnValue;jQuery("body").children().each(function(key,value){if(value.id!==element.substring(1)){var checkedelement=jQuery(value);if(offset==="right"&&checkedelement.offset().left+jQuery(checkedelement).width()0){if(checkedelement.css("position")==="static"||checkedelement.css("position")===""){checkedelement.css("position","relative")}returnValue=value;return false}}});return returnValue},center_fixed_element:function(element){var el=jQuery(element);var left=jQuery(window).width()/2-parseInt(el.css("width"))/2;el.css("left",left+"px")},center_vertically:function(element){var el=jQuery(element);var left=jQuery(window).height()/2-parseInt(el.css("height"))/2;if(el.css("position")!=="fixed"){left-=topoffset=parseInt(el.offset().top)}el.css("top",left+"px")},close:function(element){var wrapper=jQuery(element);wrapper.remove()},wait_for_images:function($el,ready_callback){var loaded_count=0;var srcs=[];$el.find('img[src][src!=""]').each(function(){srcs.push(this.src)});if(srcs.length===0){ready_callback.call($el)}jQuery.each(srcs,function(i,src){var image=new Image;image.src=src;var events="load error";jQuery(image).one(events,function me(event){jQuery(this).off(events,me);loaded_count++;if(loaded_count==srcs.length){ready_callback.call($el[0]);return false}})})},privacy:{get_state:function(){if(!window.advads_options||!window.advads_options.privacy){return"not_needed"}var options=window.advads_options.privacy;if(!options.enabled){return"not_needed"}var method=options["consent-method"]?options["consent-method"]:"0";switch(method){case"0":return"not_needed";break;case"custom":if(options["custom-cookie-value"===undefined]||options["custom-cookie-value"]===undefined){return"not_needed"}var found=advads.get_cookie(options["custom-cookie-name"]);if(typeof found!=="string"){return"unknown"}if(options["custom-cookie-value"]===""&&found===""||options["custom-cookie-value"]!==""&&found.indexOf(options["custom-cookie-value"])!==-1){return"accepted"}return"unknown";break;default:return advads.cookie_exists(method)?"accepted":"unknown"}},is_adsense_npa_enabled:function(){if(!window.advads_options||!window.advads_options.privacy){return true}var options=window.advads_options.privacy;return!!options["show-non-personalized-adsense"]}}};jQuery(document).ready(function(){if(advads.supports_localstorage()&&localStorage.getItem("advads_frontend_picker")){var advads_picker_cur,advads_picker_overlay=jQuery("
    "),advads_picker_no=[document.body,document.documentElement,document];advads_picker_overlay.css({position:"absolute",border:"solid 2px #428bca",backgroundColor:"rgba(66,139,202,0.5)",boxSizing:"border-box",zIndex:1e6,pointerEvents:"none"}).prependTo("body");jQuery(document).mousemove(function(e){if(e.target===advads_picker_cur){return}if(~advads_picker_no.indexOf(e.target)){advads_picker_cur=null;advads_picker_overlay.hide();return}var target=jQuery(e.target),offset=target.offset(),width=target.outerWidth(),height=target.outerHeight();advads_picker_cur=e.target;advads_picker_overlay.css({top:offset.top,left:offset.left,width:width,height:height}).show();console.log(jQuery(advads_picker_cur).getPath())});jQuery(document).click(function(e){var path=jQuery(advads_picker_cur).getPath();localStorage.setItem("advads_frontend_element",path);window.location=localStorage.getItem("advads_prev_url")})}});jQuery.fn.extend({getPath:function(path,depth){if(typeof path==="undefined")path="";if(typeof depth==="undefined")depth=0;if(this.is("html")){return"html > "+path}else if(3===depth){return path}var cur=this.get(0).nodeName.toLowerCase();var el_id=this.attr("id"),el_class=this.attr("class");depth=depth+1;if(typeof el_id!=="undefined"&&!/\d/.test(el_id)){cur+="#"+el_id}else if(typeof el_class!=="undefined"){el_class=el_class.split(/[\s\n]+/);el_class=jQuery.grep(el_class,function(element,index){return!/\d/.test(element)});if(el_class.length){cur+="."+el_class.slice(0,2).join(".")}}if(this.siblings(cur).length){cur+=":eq("+this.siblings(cur).addBack().not("#advads-picker-overlay").index(this)+")"}if(path===""){return this.parent().getPath(cur,depth)}else{return this.parent().getPath(cur+" > "+path,depth)}}}); var advanced_ads_resizetimeout=1000; var advanced_ads_cookieexpires=30; var advanced_ads_browser_width=advanced_ads_get_browser_width(); if(window.advads!==undefined&&! advads.get_cookie('advanced_ads_browser_width') || advads.get_cookie('advanced_ads_browser_width')!==advanced_ads_browser_width){ advanced_ads_save_width(advanced_ads_browser_width); } if(window.addEventListener){ window.addEventListener("resize", advanced_ads_resize_window, false); }else if(window.attachEvent){ window.attachEvent("onresize", advanced_ads_resize_window); } function advanced_ads_resize_window (){ advads_resize_delay(function(){ var previous_width=advanced_ads_browser_width; advanced_ads_browser_width=advanced_ads_get_browser_width(); if(previous_width===advanced_ads_browser_width){ return; } advanced_ads_save_width(advanced_ads_browser_width); var advanced_ads_responsive=window.advanced_ads_responsive||{} if(window.jQuery&&parseInt(advanced_ads_responsive.reload_on_resize, 10)){ jQuery(document).triggerHandler('advanced-ads-resize-window'); }}, advanced_ads_resizetimeout); } function advanced_ads_save_width(width){ if(window.advads!==undefined){ advads.set_cookie('advanced_ads_browser_width', width, advanced_ads_cookieexpires); }} var advads_resize_delay=(function(){ var timer=0; return function (callback, ms){ clearTimeout(timer); timer=setTimeout(callback, ms); };})(); function advanced_ads_get_browser_width(){ if(window.jQuery){ return jQuery(window).width(); }else{ var browserWidth=0; if(typeof(window.innerWidth)=='number'){ browserWidth=window.innerWidth; }else if(document.documentElement&&document.documentElement.clientWidth){ browserWidth=document.documentElement.clientWidth; }else if(document.body&&document.body.clientWidth){ browserWidth=document.body.clientWidth; } return browserWidth; }}; jQuery(document).ready(function($){ if(jQuery('body').hasClass('logged-in')){}else{ jQuery('.reviewformwithnotice input, .reviewformwithnotice textarea').keyup(function (e){ jQuery('#modal-3').modal(); jQuery('#modal-3').addClass('md-show'); }); } jQuery('#rewies_formm').on('submit', function(e){ e.preventDefault(); }); jQuery('#rewies_form').on('submit', function(e){ $this=jQuery(this); var multiState=$this.data('multi-rating'); $this.find('.review_status').text(''); $this.find(':input[type=submit]').prop('disabled', true); errorMSG=$this.find(":input[name='errormessage']").val(); $title=jQuery('#post_title').val(); if(multiState=='1'){ var $rating=''; var multiFieldsCount=jQuery('.lp-multi-rating-val').length-1; var multiRatingSum=0; jQuery('.lp-multi-rating-val').each(function(index){ var field_val=jQuery(this).val(), fieldID=jQuery(this).data('mrf'); multiRatingSum +=Number(field_val); if(index!=multiFieldsCount){ var cSep=','; }else{ var cSep=''; } var ratingVal=fieldID+':'+field_val+cSep; $rating +=ratingVal; }); }else{ $rating=jQuery('#review-rating').val(); } var ratingCheck=$rating; if(multiState=='1'){ ratingCheck=multiRatingSum; } $description=jQuery('#post_description').val(); var $umail=''; $umail=$this.find(":input[type=email]").val(); if($umail!==undefined){ $this.find('.loadinerSearch').css('display', 'block'); e.preventDefault(); if($title==''||ratingCheck==''||ratingCheck==0||$description==''||$umail==''){ $this.find('.review_status').text(errorMSG); $this.find('.review_status').addClass('error-msg'); $this.find(':input[type=submit]').prop('disabled', false); $this.find('.loadinerSearch').css('display', 'none'); }else{ var fd=new FormData(this); if(!jQuery('input#filer_input2').val()){ if(detectIE()==false){ fd.delete('post_gallery[]'); }} fd.append('action', 'ajax_review_submit'); fd.append('multiState', multiState); if(multiState=='1'){ fd.append('multirating', $rating); } jQuery.ajax({ type: 'POST', url: ajax_review_object.ajaxurl, data:fd, contentType: false, processData: false, success: function(res){ if(jQuery("form#rewies_form .g-recaptcha-response").length){ lp_reset_grecaptcha(); } var res=jQuery.parseJSON(res); $this.find('.loadinerSearch').css('display', 'none'); $this.find(':input[type=submit]').prop('disabled', false); if(res.error){ $this.find('.review_status').addClass('error-msg'); $this.find('.review_status').text(res.status); }else{ $this.find('.review_status').text(res.status); $this.find('.review_status').removeClass('error-msg'); $this.find('.review_status').addClass('success-msg'); $this[0].reset(); var timer=''; function redirectPageNow(){ location.reload(true); clearTimeout(timer); } timer=setTimeout(redirectPageNow, 100); }}, error: function(request, error){ if(jQuery("form#rewies_form .g-recaptcha-response").length){ lp_reset_grecaptcha(); } alert(error); }}); }} else if($title==''||ratingCheck==''||ratingCheck==0||$description==''){ $this.find('.review_status').text(errorMSG); $this.find('.review_status').addClass('error-msg'); $this.find(':input[type=submit]').prop('disabled', false); }else{ $this.find('.loadinerSearch').css('display', 'block'); e.preventDefault(); var fd=new FormData(this); if(!jQuery('input#filer_input2').val()){ if(detectIE()==false){ fd.delete('post_gallery[]'); }} fd.append('multiState', multiState); if(multiState=='1'){ fd.append('multirating', $rating); } fd.append('action', 'ajax_review_submit'); jQuery.ajax({ type: 'POST', url: ajax_review_object.ajaxurl, data:fd, contentType: false, processData: false, success: function(res){ if(jQuery("form#rewies_form .g-recaptcha-response").length){ lp_reset_grecaptcha(); } $this.find('.loadinerSearch').css('display', 'none'); $this.find(':input[type=submit]').prop('disabled', false); var res=jQuery.parseJSON(res); if(res.error){ $this.find('.review_status').addClass('error-msg'); $this.find('.review_status').text(res.status); }else{ $this.find('.review_status').text(res.status); $this.find('.review_status').removeClass('error-msg'); $this.find('.review_status').addClass('success-msg'); $this[0].reset(); var timer=''; function redirectPageNow(){ location.reload(true); clearTimeout(timer); } timer=setTimeout(redirectPageNow, 100); }}, error: function(request, error){ alert(error); if(jQuery("form#rewies_form .g-recaptcha-response").length){ lp_reset_grecaptcha(); }} }); } return false; }); jQuery('.reviews-section a.review_actv').tooltip(); jQuery(document).on('click' , '.reviews-section a.reviewRes',function(e){ reviewID=''; ajaxResErr=''; var $this=jQuery(this); if($this.hasClass('review_actv')){ $this.find('.lp_state').text($this.data('reacted')); $this.find('.lp_state').slideToggle('slow'); var showStatDiv=function(){ $this.find('.lp_state').slideToggle('slow'); }; timVar=setTimeout(showStatDiv, 3000); e.preventDefault(); }else{ $this.find('.lp_state').hide(); $this.find('span.interests-score').text(''); $this.find('span.interests-score').append(''); reviewID=$this.data('id'); var currentVal=$this.data('score'); var restype=$this.data('restype'); jQuery.ajax({ type: 'POST', dataType: 'json', url: ajax_review_object.ajaxurl, data:{ action:'lp_reviews_interests', interest:currentVal, restype:restype, id:reviewID, }, success: function(res){ if(res.errors=="no"){ ajaxResErr='no'; var newscore=res.newScore; $this.data('score', newscore); $this.find('span.interests-score').empty(''); $this.find('span.interests-score').text(newscore); if(restype=='interesting'){ $this.css({'background-color': '#417cdf', 'color': '#fff'}); $this.find('.interests-score').css({'color': '#fff'}); } else if(restype=='lol'){ $this.css({'background-color': '#ff8e29', 'color': '#fff'}); $this.find('.interests-score').css({'color': '#fff'}); } else if(restype=='love'){ $this.css({'background-color': '#ff2357', 'color': '#fff'}); $this.find('.interests-score').css({'color': '#fff'}); } currentVal=false; $this.find('.lp_state').text(res.statuss); $this.find('.lp_state').slideToggle('slow'); var showStatDiv=function(){ $this.find('.lp_state').slideToggle('slow'); }; timVar=setTimeout(showStatDiv, 3000); $this.addClass('review_actv'); }else{ ajaxResErr='yes'; var newscore=res.newScore; $this.find('span.interests-score').empty(''); $this.find('span.interests-score').empty(''); $this.find('span.interests-score').text(newscore); $this.find('.lp_state').text(res.statuss); $this.find('.lp_state').slideToggle('slow'); var showStatDiv=function(){ $this.find('.lp_state').slideToggle('slow'); $this.addClass('review_actv'); }; timVar=setTimeout(showStatDiv, 3000); }}, error: function(request, error){ alert(error); }}); } e.preventDefault(); }); jQuery('.reviews-section a.lol').click(function(e){ var currentVal=''; currentVal=jQuery(this).data('score'); }); jQuery('.reviews-section a.love').click(function(e){ var currentVal=''; currentVal=jQuery(this).data('score'); }); $("body").on('change', '#filer_input2', function(event){ var $this=jQuery(this); if($this.hasClass('dashboard-edit-filter-input2')){ jQuery('.dashboard-edit-filter-input2').removeClass('active_filter_input2'); $this.addClass('active_filter_input2'); var files=event.target.files; var outputt=document.getElementsByClassName('filediv'); var output=outputt[0]; var allowedimgz=$('#rewies_edit-form').data('imgcount'); var allowedsize=$('#rewies_edit-form').data('imgsize'); var noticecount=$('#rewies_edit-form').data('countnotice'); var noticesize=$('#rewies_edit-form').data('sizenotice'); var fp=$(".active_filter_input2"); var lg=fp[0].files.length; var items=fp[0].files; var fileSize=0; if(lg > 0){ if(lg <=allowedimgz){ for (var i=0; i < lg; i++){ fileSize=fileSize+items[i].size; } if(fileSize > allowedsize){ alert(noticesize); $this.val(''); $this.text(''); }}else{ alert(noticecount); $this.val(''); $this.text(''); }} }else{ var files=event.target.files; var outputt=document.getElementsByClassName('filediv'); var output=outputt[0]; var allowedimgz=$('#rewies_form').data('imgcount'); var allowedsize=$('#rewies_form').data('imgsize'); var noticecount=$('#rewies_form').data('countnotice'); var noticesize=$('#rewies_form').data('sizenotice'); var fp=$("#filer_input2"); var lg=fp[0].files.length; var items=fp[0].files; var fileSize=0; if(lg > 0){ if(lg <=allowedimgz){ for (var i=0; i < lg; i++){ fileSize=fileSize+items[i].size; } if(fileSize > allowedsize){ alert(noticesize); $('#filer_input2').val(''); $('.submit-images label').text(''); }}else{ alert(noticecount); $('#filer_input2').val(''); $('.submit-images label').text(''); }} }}); }); (function (root, factory){ if(typeof define==='function'&&define.amd){ define(['exports'], factory); }else if(typeof exports==='object'&&typeof exports.nodeName!=='string'){ factory(exports); }else{ factory((root.commonJsStrict={})); }}(this, function (exports){ if(typeof Promise!=='function'){ !function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void k(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j=setTimeout,k="function"==typeof setImmediate&&setImmediate||function(a){j(a,1)},l=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&l(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){k=a},"undefined"!=typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this); } if(typeof window.CustomEvent!=="function"){ (function(){ function CustomEvent(event, params){ params=params||{ bubbles: false, cancelable: false, detail: undefined }; var evt=document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype=window.Event.prototype; window.CustomEvent=CustomEvent; }()); } var cssPrefixes=['Webkit', 'Moz', 'ms'], emptyStyles=document.createElement('div').style, CSS_TRANS_ORG, CSS_TRANSFORM, CSS_USERSELECT; function vendorPrefix(prop){ if(prop in emptyStyles){ return prop; } var capProp=prop[0].toUpperCase() + prop.slice(1), i=cssPrefixes.length; while (i--){ prop=cssPrefixes[i] + capProp; if(prop in emptyStyles){ return prop; }} } CSS_TRANSFORM=vendorPrefix('transform'); CSS_TRANS_ORG=vendorPrefix('transformOrigin'); CSS_USERSELECT=vendorPrefix('userSelect'); function deepExtend(destination, source){ destination=destination||{}; for (var property in source){ if(source[property]&&source[property].constructor&&source[property].constructor===Object){ destination[property]=destination[property]||{}; deepExtend(destination[property], source[property]); }else{ destination[property]=source[property]; }} return destination; } function debounce(func, wait, immediate){ var timeout; return function (){ var context=this, args=arguments; var later=function (){ timeout=null; if(!immediate) func.apply(context, args); }; var callNow=immediate&&!timeout; clearTimeout(timeout); timeout=setTimeout(later, wait); if(callNow) func.apply(context, args); };} function dispatchChange(element){ if("createEvent" in document){ var evt=document.createEvent("HTMLEvents"); evt.initEvent("change", false, true); element.dispatchEvent(evt); }else{ element.fireEvent("onchange"); }} function css(el, styles, val){ if(typeof (styles)==='string'){ var tmp=styles; styles={}; styles[tmp]=val; } for (var prop in styles){ el.style[prop]=styles[prop]; }} function addClass(el, c){ if(el.classList){ el.classList.add(c); }else{ el.className +=' ' + c; }} function removeClass(el, c){ if(el.classList){ el.classList.remove(c); }else{ el.className=el.className.replace(c, ''); }} function loadImage(src, imageEl){ var img=imageEl||new Image(), prom; if(img.src===src){ prom=new Promise(function (resolve, reject){ resolve(img); }); }else{ prom=new Promise(function (resolve, reject){ if(src.substring(0,4).toLowerCase()==='http'){ img.setAttribute('crossOrigin', 'anonymous'); } img.onload=function (){ setTimeout(function (){ resolve(img); }, 1); };}); img.src=src; } img.style.opacity=0; return prom; } var _TRANSLATE='translate3d', _TRANSLATE_SUFFIX=', 0px'; var Transform=function (x, y, scale){ this.x=parseFloat(x); this.y=parseFloat(y); this.scale=parseFloat(scale); }; Transform.parse=function (v){ if(v.style){ return Transform.parse(v.style[CSS_TRANSFORM]); } else if(v.indexOf('matrix') > -1||v.indexOf('none') > -1){ return Transform.fromMatrix(v); }else{ return Transform.fromString(v); }}; Transform.fromMatrix=function (v){ var vals=v.substring(7).split(','); if(!vals.length||v==='none'){ vals=[1, 0, 0, 1, 0, 0]; } return new Transform(parseInt(vals[4], 10), parseInt(vals[5], 10), parseFloat(vals[0])); }; Transform.fromString=function (v){ var values=v.split(') '), translate=values[0].substring(_TRANSLATE.length + 1).split(','), scale=values.length > 1 ? values[1].substring(6):1, x=translate.length > 1 ? translate[0]:0, y=translate.length > 1 ? translate[1]:0; return new Transform(x, y, scale); }; Transform.prototype.toString=function (){ return _TRANSLATE + '(' + this.x + 'px, ' + this.y + 'px' + _TRANSLATE_SUFFIX + ') scale(' + this.scale + ')'; }; var TransformOrigin=function (el){ if(!el||!el.style[CSS_TRANS_ORG]){ this.x=0; this.y=0; return; } var css=el.style[CSS_TRANS_ORG].split(' '); this.x=parseFloat(css[0]); this.y=parseFloat(css[1]); }; TransformOrigin.prototype.toString=function (){ return this.x + 'px ' + this.y + 'px'; }; function getExifOrientation (img, cb){ if(!window.EXIF){ cb(0); } EXIF.getData(img, function (){ var orientation=EXIF.getTag(this, 'Orientation'); cb(orientation); }); } function drawCanvas(canvas, img, orientation){ var width=img.width, height=img.height, ctx=canvas.getContext('2d'); canvas.width=img.width; canvas.height=img.height; ctx.save(); switch (orientation){ case 2: ctx.translate(width, 0); ctx.scale(-1, 1); break; case 3: ctx.translate(width, height); ctx.rotate(180*Math.PI/180); break; case 4: ctx.translate(0, height); ctx.scale(1, -1); break; case 5: canvas.width=height; canvas.height=width; ctx.rotate(90*Math.PI/180); ctx.scale(1, -1); break; case 6: canvas.width=height; canvas.height=width; ctx.rotate(90*Math.PI/180); ctx.translate(0, -height); break; case 7: canvas.width=height; canvas.height=width; ctx.rotate(-90*Math.PI/180); ctx.translate(-width, height); ctx.scale(1, -1); break; case 8: canvas.width=height; canvas.height=width; ctx.translate(0, width); ctx.rotate(-90*Math.PI/180); break; } ctx.drawImage(img, 0,0, width, height); ctx.restore(); } function _create(){ var self=this, contClass='croppie-container', customViewportClass=self.options.viewport.type ? 'cr-vp-' + self.options.viewport.type:null, boundary, img, viewport, overlay, canvas; self.options.useCanvas=self.options.enableOrientation||_hasExif.call(self); self.data={}; self.elements={}; boundary=self.elements.boundary=document.createElement('div'); viewport=self.elements.viewport=document.createElement('div'); img=self.elements.img=document.createElement('img'); overlay=self.elements.overlay=document.createElement('div'); if(self.options.useCanvas){ self.elements.canvas=document.createElement('canvas'); self.elements.preview=self.elements.canvas; }else{ self.elements.preview=self.elements.img; } addClass(boundary, 'cr-boundary'); css(boundary, { width: self.options.boundary.width + 'px', height: self.options.boundary.height + 'px' }); addClass(viewport, 'cr-viewport'); if(customViewportClass){ addClass(viewport, customViewportClass); } css(viewport, { width: self.options.viewport.width + 'px', height: self.options.viewport.height + 'px' }); viewport.setAttribute('tabindex', 0); addClass(self.elements.preview, 'cr-image'); addClass(overlay, 'cr-overlay'); self.element.appendChild(boundary); boundary.appendChild(self.elements.preview); boundary.appendChild(viewport); boundary.appendChild(overlay); addClass(self.element, contClass); if(self.options.customClass){ addClass(self.element, self.options.customClass); } _initDraggable.call(this); if(self.options.enableZoom){ _initializeZoom.call(self); }} function _initRotationControls (){ return; var self=this, wrap, btnLeft, btnRight, iLeft, iRight; wrap=document.createElement('div'); self.elements.orientationBtnLeft=btnLeft=document.createElement('button'); self.elements.orientationBtnRight=btnRight=document.createElement('button'); wrap.appendChild(btnLeft); wrap.appendChild(btnRight); iLeft=document.createElement('i'); iRight=document.createElement('i'); btnLeft.appendChild(iLeft); btnRight.appendChild(iRight); addClass(wrap, 'cr-rotate-controls'); addClass(btnLeft, 'cr-rotate-l'); addClass(btnRight, 'cr-rotate-r'); self.elements.boundary.appendChild(wrap); btnLeft.addEventListener('click', function (){ self.rotate(-90); }); btnRight.addEventListener('click', function (){ self.rotate(90); }); } function _hasExif(){ return this.options.enableExif&&window.EXIF; } function _setZoomerVal(v){ if(this.options.enableZoom){ var z=this.elements.zoomer, val=fix(v, 4); z.value=Math.max(z.min, Math.min(z.max, val)); }} function _initializeZoom(){ var self=this, wrap=self.elements.zoomerWrap=document.createElement('div'), zoomer=self.elements.zoomer=document.createElement('input'); addClass(wrap, 'cr-slider-wrap'); addClass(zoomer, 'cr-slider'); zoomer.type='range'; zoomer.step='0.0001'; zoomer.value=1; zoomer.style.display=self.options.showZoomer ? '':'none'; self.element.appendChild(wrap); wrap.appendChild(zoomer); self._currentZoom=1; function change(){ _onZoom.call(self, { value: parseFloat(zoomer.value), origin: new TransformOrigin(self.elements.preview), viewportRect: self.elements.viewport.getBoundingClientRect(), transform: Transform.parse(self.elements.preview) }); } function scroll(ev){ var delta, targetZoom; if(ev.wheelDelta){ delta=ev.wheelDelta / 1200; }else if(ev.deltaY){ delta=ev.deltaY / 1060; }else if(ev.detail){ delta=ev.detail / -60; }else{ delta=0; } targetZoom=self._currentZoom + delta; ev.preventDefault(); _setZoomerVal.call(self, targetZoom); change.call(self); } self.elements.zoomer.addEventListener('input', change); self.elements.zoomer.addEventListener('change', change); if(self.options.mouseWheelZoom){ self.elements.boundary.addEventListener('mousewheel', scroll); self.elements.boundary.addEventListener('DOMMouseScroll', scroll); }} function _onZoom(ui){ var self=this, transform=ui ? ui.transform:Transform.parse(self.elements.preview), vpRect=ui ? ui.viewportRect:self.elements.viewport.getBoundingClientRect(), origin=ui ? ui.origin:new TransformOrigin(self.elements.preview), transCss={}; function applyCss(){ var transCss={}; transCss[CSS_TRANSFORM]=transform.toString(); transCss[CSS_TRANS_ORG]=origin.toString(); css(self.elements.preview, transCss); } self._currentZoom=ui ? ui.value:self._currentZoom; transform.scale=self._currentZoom; applyCss(); if(self.options.enforceBoundary){ var boundaries=_getVirtualBoundaries.call(self, vpRect), transBoundaries=boundaries.translate, oBoundaries=boundaries.origin; if(transform.x >=transBoundaries.maxX){ origin.x=oBoundaries.minX; transform.x=transBoundaries.maxX; } if(transform.x <=transBoundaries.minX){ origin.x=oBoundaries.maxX; transform.x=transBoundaries.minX; } if(transform.y >=transBoundaries.maxY){ origin.y=oBoundaries.minY; transform.y=transBoundaries.maxY; } if(transform.y <=transBoundaries.minY){ origin.y=oBoundaries.maxY; transform.y=transBoundaries.minY; }} applyCss(); _debouncedOverlay.call(self); _triggerUpdate.call(self); } function _getVirtualBoundaries(viewport){ var self=this, scale=self._currentZoom, vpWidth=viewport.width, vpHeight=viewport.height, centerFromBoundaryX=self.options.boundary.width / 2, centerFromBoundaryY=self.options.boundary.height / 2, imgRect=self.elements.preview.getBoundingClientRect(), curImgWidth=imgRect.width, curImgHeight=imgRect.height, halfWidth=vpWidth / 2, halfHeight=vpHeight / 2; var maxX=((halfWidth / scale) - centerFromBoundaryX) * -1; var minX=maxX - ((curImgWidth * (1 / scale)) - (vpWidth * (1 / scale))); var maxY=((halfHeight / scale) - centerFromBoundaryY) * -1; var minY=maxY - ((curImgHeight * (1 / scale)) - (vpHeight * (1 / scale))); var originMinX=(1 / scale) * halfWidth; var originMaxX=(curImgWidth * (1 / scale)) - originMinX; var originMinY=(1 / scale) * halfHeight; var originMaxY=(curImgHeight * (1 / scale)) - originMinY; return { translate: { maxX: maxX, minX: minX, maxY: maxY, minY: minY }, origin: { maxX: originMaxX, minX: originMinX, maxY: originMaxY, minY: originMinY }};} function _updateCenterPoint(){ var self=this, scale=self._currentZoom, data=self.elements.preview.getBoundingClientRect(), vpData=self.elements.viewport.getBoundingClientRect(), transform=Transform.parse(self.elements.preview.style[CSS_TRANSFORM]), pc=new TransformOrigin(self.elements.preview), top=(vpData.top - data.top) + (vpData.height / 2), left=(vpData.left - data.left) + (vpData.width / 2), center={}, adj={}; center.y=top / scale; center.x=left / scale; adj.y=(center.y - pc.y) * (1 - scale); adj.x=(center.x - pc.x) * (1 - scale); transform.x -=adj.x; transform.y -=adj.y; var newCss={}; newCss[CSS_TRANS_ORG]=center.x + 'px ' + center.y + 'px'; newCss[CSS_TRANSFORM]=transform.toString(); css(self.elements.preview, newCss); } function _initDraggable(){ var self=this, isDragging=false, originalX, originalY, originalDistance, vpRect, transform; function assignTransformCoordinates(deltaX, deltaY){ var imgRect=self.elements.preview.getBoundingClientRect(), top=transform.y + deltaY, left=transform.x + deltaX; if(self.options.enforceBoundary){ if(vpRect.top > imgRect.top + deltaY&&vpRect.bottom < imgRect.bottom + deltaY){ transform.y=top; } if(vpRect.left > imgRect.left + deltaX&&vpRect.right < imgRect.right + deltaX){ transform.x=left; }}else{ transform.y=top; transform.x=left; }} function keyDown(ev){ var LEFT_ARROW=37, UP_ARROW=38, RIGHT_ARROW=39, DOWN_ARROW=40; if(ev.shiftKey&&(ev.keyCode==UP_ARROW||ev.keyCode==DOWN_ARROW)){ var zoom=0.0; if(ev.keyCode==UP_ARROW){ zoom=parseFloat(self.elements.zoomer.value, 10) + parseFloat(self.elements.zoomer.step, 10) }else{ zoom=parseFloat(self.elements.zoomer.value, 10) - parseFloat(self.elements.zoomer.step, 10) } self.setZoom(zoom); } else if(ev.keyCode >=37&&ev.keyCode <=40){ ev.preventDefault(); var movement=parseKeyDown(ev.keyCode); transform=Transform.parse(self.elements.preview); document.body.style[CSS_USERSELECT]='none'; vpRect=self.elements.viewport.getBoundingClientRect(); keyMove(movement); }; function parseKeyDown(key){ switch (key){ case LEFT_ARROW: return [1, 0]; case UP_ARROW: return [0, 1]; case RIGHT_ARROW: return [-1, 0]; case DOWN_ARROW: return [0, -1]; };}; } function keyMove(movement){ var deltaX=movement[0], deltaY=movement[1], newCss={}; assignTransformCoordinates(deltaX, deltaY); newCss[CSS_TRANSFORM]=transform.toString(); css(self.elements.preview, newCss); _updateOverlay.call(self); document.body.style[CSS_USERSELECT]=''; _updateCenterPoint.call(self); _triggerUpdate.call(self); originalDistance=0; } function mouseDown(ev){ ev.preventDefault(); if(isDragging) return; isDragging=true; originalX=ev.pageX; originalY=ev.pageY; if(ev.touches){ var touches=ev.touches[0]; originalX=touches.pageX; originalY=touches.pageY; } transform=Transform.parse(self.elements.preview); window.addEventListener('mousemove', mouseMove); window.addEventListener('touchmove', mouseMove); window.addEventListener('mouseup', mouseUp); window.addEventListener('touchend', mouseUp); document.body.style[CSS_USERSELECT]='none'; vpRect=self.elements.viewport.getBoundingClientRect(); } function mouseMove(ev){ ev.preventDefault(); var pageX=ev.pageX, pageY=ev.pageY; if(ev.touches){ var touches=ev.touches[0]; pageX=touches.pageX; pageY=touches.pageY; } var deltaX=pageX - originalX, deltaY=pageY - originalY, newCss={}; if(ev.type=='touchmove'){ if(ev.touches.length > 1){ var touch1=ev.touches[0]; var touch2=ev.touches[1]; var dist=Math.sqrt((touch1.pageX - touch2.pageX) * (touch1.pageX - touch2.pageX) + (touch1.pageY - touch2.pageY) * (touch1.pageY - touch2.pageY)); if(!originalDistance){ originalDistance=dist / self._currentZoom; } var scale=dist / originalDistance; _setZoomerVal.call(self, scale); dispatchChange(self.elements.zoomer); return; }} assignTransformCoordinates(deltaX, deltaY); newCss[CSS_TRANSFORM]=transform.toString(); css(self.elements.preview, newCss); _updateOverlay.call(self); originalY=pageY; originalX=pageX; } function mouseUp(){ isDragging=false; window.removeEventListener('mousemove', mouseMove); window.removeEventListener('touchmove', mouseMove); window.removeEventListener('mouseup', mouseUp); window.removeEventListener('touchend', mouseUp); document.body.style[CSS_USERSELECT]=''; _updateCenterPoint.call(self); _triggerUpdate.call(self); originalDistance=0; } self.elements.overlay.addEventListener('mousedown', mouseDown); self.elements.viewport.addEventListener('keydown', keyDown); self.elements.overlay.addEventListener('touchstart', mouseDown); } function _updateOverlay(){ var self=this, boundRect=self.elements.boundary.getBoundingClientRect(), imgData=self.elements.preview.getBoundingClientRect(); css(self.elements.overlay, { width: imgData.width + 'px', height: imgData.height + 'px', top: (imgData.top - boundRect.top) + 'px', left: (imgData.left - boundRect.left) + 'px' }); } var _debouncedOverlay=debounce(_updateOverlay, 500); function _triggerUpdate(){ var self=this, data=self.get(), ev; if(!_isVisible.call(self)){ return; } self.options.update.call(self, data); if(self.$){ self.$(self.element).trigger('update', data) }else{ var ev; if(window.CustomEvent){ ev=new CustomEvent('update', { detail: data }); }else{ ev=document.createEvent('CustomEvent'); ev.initCustomEvent('update', true, true, data); } self.element.dispatchEvent(ev); }} function _isVisible(){ return this.elements.preview.offsetHeight > 0&&this.elements.preview.offsetWidth > 0; } function _updatePropertiesFromImage(){ var self=this, minZoom=0, maxZoom=1.5, initialZoom=1, cssReset={}, img=self.elements.preview, zoomer=self.elements.zoomer, transformReset=new Transform(0, 0, initialZoom), originReset=new TransformOrigin(), isVisible=_isVisible.call(self), imgData, vpData, boundaryData, minW, minH; if(!isVisible||self.data.bound){ return; } self.data.bound=true; cssReset[CSS_TRANSFORM]=transformReset.toString(); cssReset[CSS_TRANS_ORG]=originReset.toString(); cssReset['opacity']=1; css(img, cssReset); imgData=img.getBoundingClientRect(); vpData=self.elements.viewport.getBoundingClientRect(); boundaryData=self.elements.boundary.getBoundingClientRect(); self._originalImageWidth=imgData.width; self._originalImageHeight=imgData.height; if(self.options.enableZoom){ if(self.options.enforceBoundary){ minW=vpData.width / imgData.width; minH=vpData.height / imgData.height; minZoom=Math.max(minW, minH); } if(minZoom >=maxZoom){ maxZoom=minZoom + 1; } zoomer.min=fix(minZoom, 4); zoomer.max=fix(maxZoom, 4); var defaultInitialZoom=Math.max((boundaryData.width / imgData.width), (boundaryData.height / imgData.height)); initialZoom=self.data.boundZoom!==null ? self.data.boundZoom:defaultInitialZoom; _setZoomerVal.call(self, initialZoom); dispatchChange(zoomer); }else{ self._currentZoom=initialZoom; } transformReset.scale=self._currentZoom; cssReset[CSS_TRANSFORM]=transformReset.toString(); css(img, cssReset); if(self.data.points.length){ _bindPoints.call(self, self.data.points); }else{ _centerImage.call(self); } _updateCenterPoint.call(self); _updateOverlay.call(self); } function _bindPoints(points){ if(points.length!=4){ throw "Croppie - Invalid number of points supplied: " + points; } var self=this, pointsWidth=points[2] - points[0], vpData=self.elements.viewport.getBoundingClientRect(), boundRect=self.elements.boundary.getBoundingClientRect(), vpOffset={ left: vpData.left - boundRect.left, top: vpData.top - boundRect.top }, scale=vpData.width / pointsWidth, originTop=points[1], originLeft=points[0], transformTop=(-1 * points[1]) + vpOffset.top, transformLeft=(-1 * points[0]) + vpOffset.left, newCss={}; newCss[CSS_TRANS_ORG]=originLeft + 'px ' + originTop + 'px'; newCss[CSS_TRANSFORM]=new Transform(transformLeft, transformTop, scale).toString(); css(self.elements.preview, newCss); _setZoomerVal.call(self, scale); self._currentZoom=scale; } function _centerImage(){ var self=this, imgDim=self.elements.preview.getBoundingClientRect(), vpDim=self.elements.viewport.getBoundingClientRect(), boundDim=self.elements.boundary.getBoundingClientRect(), vpLeft=vpDim.left - boundDim.left, vpTop=vpDim.top - boundDim.top, w=vpLeft - ((imgDim.width - vpDim.width) / 2), h=vpTop - ((imgDim.height - vpDim.height) / 2), transform=new Transform(w, h, self._currentZoom); css(self.elements.preview, CSS_TRANSFORM, transform.toString()); } function _transferImageToCanvas(customOrientation){ var self=this, canvas=self.elements.canvas, img=self.elements.img, ctx=canvas.getContext('2d'), exif=_hasExif.call(self), customOrientation=self.options.enableOrientation&&customOrientation; ctx.clearRect(0, 0, canvas.width, canvas.height); canvas.width=img.width; canvas.height=img.height; if(exif){ getExifOrientation(img, function (orientation){ drawCanvas(canvas, img, parseInt(orientation)); if(customOrientation){ drawCanvas(canvas, img, customOrientation); }}); }else if(customOrientation){ drawCanvas(canvas, img, customOrientation); }} function _getHtmlResult(data){ var points=data.points, div=document.createElement('div'), img=document.createElement('img'), width=points[2] - points[0], height=points[3] - points[1]; addClass(div, 'croppie-result'); div.appendChild(img); css(img, { left: (-1 * points[0]) + 'px', top: (-1 * points[1]) + 'px' }); img.src=data.url; css(div, { width: width + 'px', height: height + 'px' }); return div; } function _getCanvasResult(img, data){ var points=data.points, left=points[0], top=points[1], width=(points[2] - points[0]), height=(points[3] - points[1]), circle=data.circle, canvas=document.createElement('canvas'), ctx=canvas.getContext('2d'), outWidth=width, outHeight=height; if(data.outputWidth&&data.outputHeight){ outWidth=data.outputWidth; outHeight=data.outputHeight; } canvas.width=outWidth; canvas.height=outHeight; if(data.backgroundColor){ ctx.fillStyle=data.backgroundColor; ctx.fillRect(0, 0, outWidth, outHeight); } ctx.drawImage(img, left, top, width, height, 0, 0, outWidth, outHeight); if(circle){ ctx.fillStyle='#fff'; ctx.globalCompositeOperation='destination-in'; ctx.beginPath(); ctx.arc(outWidth / 2, outHeight / 2, outWidth / 2, 0, Math.PI * 2, true); ctx.closePath(); ctx.fill(); } return canvas.toDataURL(data.format, data.quality); } function _bind(options, cb){ var self=this, url, points=[], zoom=null; if(typeof (options)==='string'){ url=options; options={};} else if(Array.isArray(options)){ points=options.slice(); } else if(typeof (options)=='undefined'&&self.data.url){ _updatePropertiesFromImage.call(self); _triggerUpdate.call(self); return null; }else{ url=options.url; points=options.points||[]; zoom=typeof(options.zoom)==='undefined' ? null:options.zoom; } self.data.bound=false; self.data.url=url||self.data.url; self.data.points=(points||self.data.points).map(function (p){ return parseFloat(p); }); self.data.boundZoom=zoom; var prom=loadImage(url, self.elements.img); prom.then(function (){ if(self.options.useCanvas){ self.elements.img.exifdata=null; _transferImageToCanvas.call(self, options.orientation||1); } _updatePropertiesFromImage.call(self); _triggerUpdate.call(self); if(cb){ cb(); }}); return prom; } function fix(v, decimalPoints){ return parseFloat(v).toFixed(decimalPoints||0); } function _get(){ var self=this, imgData=self.elements.preview.getBoundingClientRect(), vpData=self.elements.viewport.getBoundingClientRect(), x1=vpData.left - imgData.left, y1=vpData.top - imgData.top, widthDiff=(vpData.width - self.elements.viewport.offsetWidth) / 2, heightDiff=(vpData.height - self.elements.viewport.offsetHeight) / 2, x2=x1 + self.elements.viewport.offsetWidth + widthDiff, y2=y1 + self.elements.viewport.offsetHeight + heightDiff, scale=self._currentZoom; if(scale===Infinity||isNaN(scale)){ scale=1; } var max=self.options.enforceBoundary ? 0:Number.NEGATIVE_INFINITY; x1=Math.max(max, x1 / scale); y1=Math.max(max, y1 / scale); x2=Math.max(max, x2 / scale); y2=Math.max(max, y2 / scale); return { points: [fix(x1), fix(y1), fix(x2), fix(y2)], zoom: scale };} var RESULT_DEFAULTS={ type: 'canvas', format: 'png', quality: 1 }, RESULT_FORMATS=['jpeg', 'webp', 'png']; function _result(options){ var self=this, data=_get.call(self), opts=deepExtend(RESULT_DEFAULTS, deepExtend({}, options)), type=(typeof (options)==='string' ? options:(opts.type||'viewport')), size=opts.size, format=opts.format, quality=opts.quality, backgroundColor=opts.backgroundColor, circle=typeof opts.circle==='boolean' ? opts.circle:(self.options.viewport.type==='circle'), vpRect=self.elements.viewport.getBoundingClientRect(), ratio=vpRect.width / vpRect.height, prom; if(size==='viewport'){ data.outputWidth=vpRect.width; data.outputHeight=vpRect.height; }else if(typeof size==='object'){ if(size.width&&size.height){ data.outputWidth=size.width; data.outputHeight=size.height; }else if(size.width){ data.outputWidth=size.width; data.outputHeight=size.width / ratio; }else if(size.height){ data.outputWidth=size.height * ratio; data.outputHeight=size.height; }} if(RESULT_FORMATS.indexOf(format) > -1){ data.format='image/' + format; data.quality=quality; } data.circle=circle; data.url=self.data.url; data.backgroundColor=backgroundColor; prom=new Promise(function (resolve, reject){ if(type==='canvas'){ resolve(_getCanvasResult.call(self, self.elements.preview, data)); }else{ resolve(_getHtmlResult.call(self, data)); }}); return prom; } function _refresh(){ _updatePropertiesFromImage.call(this); } function _rotate(deg){ if(!this.options.useCanvas){ throw 'Croppie: Cannot rotate without enableOrientation'; } var self=this, canvas=self.elements.canvas, img=self.elements.img, copy=document.createElement('canvas'), ornt=1; copy.width=canvas.width; copy.height=canvas.height; var ctx=copy.getContext('2d'); ctx.drawImage(canvas, 0, 0); if(deg===90||deg===-270) ornt=6; if(deg===-90||deg===270) ornt=8; if(deg===180||deg===-180) ornt=3; drawCanvas(canvas, copy, ornt); _onZoom.call(self); } function _destroy(){ var self=this; self.element.removeChild(self.elements.boundary); removeClass(self.element, 'croppie-container'); if(self.options.enableZoom){ self.element.removeChild(self.elements.zoomerWrap); } delete self.elements; } if(window.jQuery){ var $=window.jQuery; $.fn.croppie=function (opts){ var ot=typeof opts; if(ot==='string'){ var args=Array.prototype.slice.call(arguments, 1); var singleInst=$(this).data('croppie'); if(opts==='get'){ return singleInst.get(); } else if(opts==='result'){ return singleInst.result.apply(singleInst, args); } else if(opts==='bind'){ return singleInst.bind.apply(singleInst, args); } return this.each(function (){ var i=$(this).data('croppie'); if(!i) return; var method=i[opts]; if($.isFunction(method)){ method.apply(i, args); if(opts==='destroy'){ $(this).removeData('croppie'); }}else{ throw 'Croppie ' + opts + ' method not found'; }}); }else{ return this.each(function (){ var i=new Croppie(this, opts); i.$=$; $(this).data('croppie', i); }); }};} function Croppie(element, opts){ this.element=element; this.options=deepExtend(deepExtend({}, Croppie.defaults), opts); _create.call(this); if(this.options.url){ var bindOpts={ url: this.options.url, points: this.options.points }; delete this.options['url']; delete this.options['points']; _bind.call(this, bindOpts); }} Croppie.defaults={ viewport: { width: 100, height: 100, type: 'square' }, boundary: { width: 300, height: 300 }, orientationControls: { enabled: true, leftClass: '', rightClass: '' }, customClass: '', showZoomer: true, enableZoom: true, mouseWheelZoom: true, enableExif: false, enforceBoundary: true, enableOrientation: false, update: function (){ }}; deepExtend(Croppie.prototype, { bind: function (options, cb){ return _bind.call(this, options, cb); }, get: function (){ return _get.call(this); }, result: function (type){ return _result.call(this, type); }, refresh: function (){ return _refresh.call(this); }, setZoom: function (v){ _setZoomerVal.call(this, v); dispatchChange(this.elements.zoomer); }, rotate: function (deg){ _rotate.call(this, deg); }, destroy: function (){ return _destroy.call(this); }}); exports.Croppie=window.Croppie=Croppie; if(typeof module==='object'&&!!module.exports){ module.exports=Croppie; }}));