!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self);t.sbjs=n()}}(function(){return function n(t,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!t[f]){if(h=typeof require=="function"&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};t[f][0].call(s.exports,function(n){var i=t[f][1][n];return u(i?i:n)},s,s.exports,n,t,i,r)}return i[f].exports}for(var e=typeof require=="function"&&require,f=0;f<r.length;f++)u(r[f]);return u}({1:[function(n,t){"use strict";var i=n("./init"),r={init:function(n){this.get=i(n);n&&n.callback&&typeof n.callback=="function"&&n.callback(this.get)}};t.exports=r},{"./init":6}],2:[function(n,t){"use strict";var u=n("./terms"),r=n("./helpers/utils"),i={containers:{current:"sbjs_current",current_extra:"sbjs_current_add",first:"sbjs_first",first_extra:"sbjs_first_add",session:"sbjs_session",udata:"sbjs_udata",promocode:"sbjs_promo"},service:{migrations:"sbjs_migrations"},delimiter:"|||",aliases:{main:{type:"typ",source:"src",medium:"mdm",campaign:"cmp",content:"cnt",term:"trm"},extra:{fire_date:"fd",entrance_point:"ep",referer:"rf"},session:{pages_seen:"pgs",current_page:"cpg"},udata:{visits:"vst",ip:"uip",agent:"uag"},promo:"code"},pack:{main:function(n){return i.aliases.main.type+"="+n.type+i.delimiter+i.aliases.main.source+"="+n.source+i.delimiter+i.aliases.main.medium+"="+n.medium+i.delimiter+i.aliases.main.campaign+"="+n.campaign+i.delimiter+i.aliases.main.content+"="+n.content+i.delimiter+i.aliases.main.term+"="+n.term},extra:function(n){return i.aliases.extra.fire_date+"="+r.setDate(new Date,n)+i.delimiter+i.aliases.extra.entrance_point+"="+document.location.href+i.delimiter+i.aliases.extra.referer+"="+(document.referrer||u.none)},user:function(n,t){return i.aliases.udata.visits+"="+n+i.delimiter+i.aliases.udata.ip+"="+t+i.delimiter+i.aliases.udata.agent+"="+navigator.userAgent},session:function(n){return i.aliases.session.pages_seen+"="+n+i.delimiter+i.aliases.session.current_page+"="+document.location.href},promo:function(n){return i.aliases.promo+"="+r.setLeadingZeroToInt(r.randomInt(n.min,n.max),n.max.toString().length)}}};t.exports=i},{"./helpers/utils":5,"./terms":9}],3:[function(n,t){"use strict";var i=n("../data").delimiter;t.exports={encodeData:function(n){return encodeURIComponent(n).replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")},decodeData:function(n){try{return decodeURIComponent(n).replace(/\%21/g,"!").replace(/\%7E/g,"~").replace(/\%2A/g,"*").replace(/\%27/g,"'").replace(/\%28/g,"(").replace(/\%29/g,")")}catch(t){try{return unescape(n)}catch(i){return""}}},set:function(n,t,i,r,u){var e,o,f;i?(f=new Date,f.setTime(f.getTime()+i*6e4),e="; expires="+f.toGMTString()):e="";o=r&&!u?";domain=."+r:"";document.cookie=this.encodeData(n)+"="+this.encodeData(t)+e+o+"; path=/"},get:function(n){for(var t,r=this.encodeData(n)+"=",u=document.cookie.split(";"),i=0;i<u.length;i++){for(t=u[i];t.charAt(0)===" ";)t=t.substring(1,t.length);if(t.indexOf(r)===0)return this.decodeData(t.substring(r.length,t.length))}return null},destroy:function(n,t,i){this.set(n,"",-1,t,i)},parse:function(n){var t=[],e={},o,r,s,u,h,f;if(typeof n=="string")t.push(n);else for(o in n)n.hasOwnProperty(o)&&t.push(n[o]);for(r=0;r<t.length;r++)for(e[this.unsbjs(t[r])]={},s=this.get(t[r])?this.get(t[r]).split(i):[],u=0;u<s.length;u++)h=s[u].split("="),f=h.splice(0,1),f.push(h.join("=")),e[this.unsbjs(t[r])][f[0]]=this.decodeData(f[1]);return e},unsbjs:function(n){return n.replace("sbjs_","")}}},{"../data":2}],4:[function(n,t){"use strict";t.exports={parse:function(n){for(var t=this.parseOptions,u=t.parser[t.strictMode?"strict":"loose"].exec(n),i={},r=14;r--;)i[t.key[r]]=u[r]||"";return i[t.q.name]={},i[t.key[12]].replace(t.q.parser,function(n,r,u){r&&(i[t.q.name][r]=u)}),i},parseOptions:{strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},getParam:function(n){for(var t,f,i={},e=n?n:window.location.search.substring(1),u=e.split("&"),r=0;r<u.length;r++)t=u[r].split("="),typeof i[t[0]]=="undefined"?i[t[0]]=t[1]:typeof i[t[0]]=="string"?(f=[i[t[0]],t[1]],i[t[0]]=f):i[t[0]].push(t[1]);return i},getHost:function(n){return this.parse(n).host.replace("www.","")}}},{}],5:[function(n,t){"use strict";t.exports={escapeRegexp:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},setDate:function(n,t){var i=n.getTimezoneOffset()/60,r=n.getHours(),u=t||t===0?t:-i;n.setHours(r+i+u);var f=n.getFullYear(),e=this.setLeadingZeroToInt(n.getMonth()+1,2),o=this.setLeadingZeroToInt(n.getDate(),2),s=this.setLeadingZeroToInt(n.getHours(),2),h=this.setLeadingZeroToInt(n.getMinutes(),2),c=this.setLeadingZeroToInt(n.getSeconds(),2);return f+"-"+e+"-"+o+" "+s+":"+h+":"+c},setLeadingZeroToInt:function(n,t){for(var i=n+"";i.length<t;)i="0"+i;return i},randomInt:function(n,t){return Math.floor(Math.random()*(t-n+1))+n}}},{}],6:[function(n,t){"use strict";var r=n("./data"),i=n("./terms"),u=n("./helpers/cookies"),f=n("./helpers/uri"),e=n("./helpers/utils"),o=n("./params"),s=n("./migrations");t.exports=function(n){function it(){var n;if(typeof h.utm_source!="undefined"||typeof h.utm_medium!="undefined"||typeof h.utm_campaign!="undefined"||typeof h.utm_content!="undefined"||typeof h.utm_term!="undefined"||typeof h.gclid!="undefined"||typeof h.yclid!="undefined"||typeof h[t.campaign_param]!="undefined")g(),n=d(i.traffic.utm);else if(nt(i.traffic.organic))g(),n=d(i.traffic.organic);else if(!u.get(r.containers.session)&&nt(i.traffic.referral))g(),n=d(i.traffic.referral);else{if(u.get(r.containers.first)||u.get(r.containers.current))return u.get(r.containers.current);g();n=d(i.traffic.typein)}return n}function d(n){switch(n){case i.traffic.utm:w=i.traffic.utm;c=typeof h.utm_source!="undefined"?h.utm_source:typeof h.gclid!="undefined"?"google":typeof h.yclid!="undefined"?"yandex":i.none;l=typeof h.utm_medium!="undefined"?h.utm_medium:typeof h.gclid!="undefined"?"cpc":typeof h.yclid!="undefined"?"cpc":i.none;v=typeof h.utm_campaign!="undefined"?h.utm_campaign:typeof h[t.campaign_param]!="undefined"?h[t.campaign_param]:typeof h.gclid!="undefined"?"google_cpc":typeof h.yclid!="undefined"?"yandex_cpc":i.none;b=h.utm_content||i.none;k=rt()||i.none;break;case i.traffic.organic:w=i.traffic.organic;c=c||f.getHost(document.referrer);l=i.referer.organic;v=i.none;b=i.none;k=i.none;break;case i.traffic.referral:w=i.traffic.referral;c=c||f.getHost(document.referrer);l=l||i.referer.referral;v=i.none;b=f.parse(document.referrer).path;k=i.none;break;case i.traffic.typein:w=i.traffic.typein;c=t.typein_attributes.source;l=t.typein_attributes.medium;v=i.none;b=i.none;k=i.none;break;default:w=i.oops;c=i.oops;l=i.oops;v=i.oops;b=i.oops;k=i.oops}var u={type:w,source:c,medium:l,campaign:v,content:b,term:k};return r.pack.main(u)}function rt(){var n=document.referrer;if(h.utm_term)return h.utm_term;if(n&&f.parse(n).host&&f.parse(n).host.match(/^(?:.*\.)?yandex\..{2,9}$/i))try{return f.getParam(f.parse(document.referrer).query).text}catch(t){return!1}else return!1}function nt(n){var t=document.referrer;switch(n){case i.traffic.organic:return!!t&&tt(t)&&ut(t);case i.traffic.referral:return!!t&&tt(t)&&ft(t);default:return!1}}function tt(n){if(t.domain){if(y)return f.getHost(n)!==f.getHost(a);var i=new RegExp("^(?:.*\\.)?"+e.escapeRegexp(a)+"$","i");return!f.getHost(n).match(i)}return f.getHost(n)!==f.getHost(document.location.href)}function ut(n){var r="yandex",u="google",o=new RegExp("^(?:.*\\.)?"+e.escapeRegexp(r)+"\\..{2,9}$"),s=new RegExp(".*"+e.escapeRegexp("text")+"=.*"),h=new RegExp("^(?:www\\.)?"+e.escapeRegexp(u)+"\\..{2,9}$"),i;if(!f.parse(n).query||!f.parse(n).host.match(o)||!f.parse(n).query.match(s))if(!f.parse(n).host.match(h)){if(!f.parse(n).query)return!1;for(i=0;i<t.organics.length;i++){if(f.parse(n).host.match(new RegExp("^(?:.*\\.)?"+e.escapeRegexp(t.organics[i].host)+"$","i"))&&f.parse(n).query.match(new RegExp(".*"+e.escapeRegexp(t.organics[i].param)+"=.*","i")))return c=t.organics[i].display||t.organics[i].host,!0;if(i+1===t.organics.length)return!1}}else return c=u,!0;else return c=r,!0}function ft(n){if(t.referrals.length>0)for(var r=0;r<t.referrals.length;r++){if(f.parse(n).host.match(new RegExp("^(?:.*\\.)?"+e.escapeRegexp(t.referrals[r].host)+"$","i")))return c=t.referrals[r].display||t.referrals[r].host,l=t.referrals[r].medium||i.referer.referral,!0;if(r+1===t.referrals.length)return c=f.getHost(n),!0}else return c=f.getHost(n),!0}function g(){u.set(r.containers.current_extra,r.pack.extra(t.timezone_offset),p,a,y);u.get(r.containers.first_extra)||u.set(r.containers.first_extra,r.pack.extra(t.timezone_offset),p,a,y)}var t=o.fetch(n),h=f.getParam(),a=t.domain.host,y=t.domain.isolate,p=t.lifetime,w,c,l,v,b,k;return s.go(p,a,y),function(){var n,i,f;u.set(r.containers.current,it(),p,a,y);u.get(r.containers.first)||u.set(r.containers.first,u.get(r.containers.current),p,a,y);u.get(r.containers.udata)?(n=parseInt(u.parse(r.containers.udata)[u.unsbjs(r.containers.udata)][r.aliases.udata.visits])||1,n=u.get(r.containers.session)?n:n+1,i=r.pack.user(n,t.user_ip)):(n=1,i=r.pack.user(n,t.user_ip));u.set(r.containers.udata,i,p,a,y);f=u.get(r.containers.session)?(parseInt(u.parse(r.containers.session)[u.unsbjs(r.containers.session)][r.aliases.session.pages_seen])||1)+1:1;u.set(r.containers.session,r.pack.session(f),t.session_length,a,y);t.promocode&&!u.get(r.containers.promocode)&&u.set(r.containers.promocode,r.pack.promo(t.promocode),p,a,y)}(),u.parse(r.containers)}},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(n,t){"use strict";var i=n("./data"),r=n("./helpers/cookies");t.exports={go:function(n,t,u){var e=this.migrations,s={l:n,d:t,i:u},f,o,h;if(r.get(i.containers.first)||r.get(i.service.migrations)){if(!r.get(i.service.migrations))for(f=0;f<e.length;f++)e[f].go(e[f].id,s)}else{for(o=[],f=0;f<e.length;f++)o.push(e[f].id);for(h="",f=0;f<o.length;f++)h+=o[f]+"=1",f<o.length-1&&(h+=i.delimiter);r.set(i.service.migrations,h,s.l,s.d,s.i)}},migrations:[{id:"1418474375998",version:"1.0.0-beta",go:function(n,t){var s=n+"=1",h=n+"=0",c=function(n,t,r){return t||r?n:i.delimiter},u,e,f,o;try{u=[];for(e in i.containers)i.containers.hasOwnProperty(e)&&u.push(i.containers[e]);for(f=0;f<u.length;f++)r.get(u[f])&&(o=r.get(u[f]).replace(/(\|)?\|(\|)?/g,c),r.destroy(u[f],t.d,t.i),r.destroy(u[f],t.d,!t.i),r.set(u[f],o,t.l,t.d,t.i));r.get(i.containers.session)&&r.set(i.containers.session,i.pack.session(0),t.l,t.d,t.i);r.set(i.service.migrations,s,t.l,t.d,t.i)}catch(l){r.set(i.service.migrations,h,t.l,t.d,t.i)}}}]}},{"./data":2,"./helpers/cookies":3}],8:[function(n,t){"use strict";var i=n("./terms"),r=n("./helpers/uri");t.exports={fetch:function(n){var u=n||{},t={},e,f;if(t.lifetime=this.validate.checkFloat(u.lifetime)||6,t.lifetime=parseInt(t.lifetime*43200),t.session_length=this.validate.checkInt(u.session_length)||30,t.timezone_offset=this.validate.checkInt(u.timezone_offset),t.campaign_param=u.campaign_param||!1,t.user_ip=u.user_ip||i.none,u.promocode?(t.promocode={},t.promocode.min=parseInt(u.promocode.min)||1e5,t.promocode.max=parseInt(u.promocode.max)||999999):t.promocode=!1,u.typein_attributes&&u.typein_attributes.source&&u.typein_attributes.medium?(t.typein_attributes={},t.typein_attributes.source=u.typein_attributes.source,t.typein_attributes.medium=u.typein_attributes.medium):t.typein_attributes={source:"(direct)",medium:"(none)"},t.domain=u.domain&&this.validate.isString(u.domain)?{host:u.domain,isolate:!1}:u.domain&&u.domain.host?u.domain:{host:r.getHost(document.location.hostname),isolate:!1},t.referrals=[],u.referrals&&u.referrals.length>0)for(e=0;e<u.referrals.length;e++)u.referrals[e].host&&t.referrals.push(u.referrals[e]);if(t.organics=[],u.organics&&u.organics.length>0)for(f=0;f<u.organics.length;f++)u.organics[f].host&&u.organics[f].param&&t.organics.push(u.organics[f]);return t.organics.push({host:"bing.com",param:"q",display:"bing"}),t.organics.push({host:"yahoo.com",param:"p",display:"yahoo"}),t.organics.push({host:"about.com",param:"q",display:"about"}),t.organics.push({host:"aol.com",param:"q",display:"aol"}),t.organics.push({host:"ask.com",param:"q",display:"ask"}),t.organics.push({host:"globososo.com",param:"q",display:"globo"}),t.organics.push({host:"go.mail.ru",param:"q",display:"go.mail.ru"}),t.organics.push({host:"rambler.ru",param:"query",display:"rambler"}),t.organics.push({host:"tut.by",param:"query",display:"tut.by"}),t.referrals.push({host:"t.co",display:"twitter.com"}),t.referrals.push({host:"plus.url.google.com",display:"plus.google.com"}),t},validate:{checkFloat:function(n){return n&&this.isNumeric(parseFloat(n))?parseFloat(n):!1},checkInt:function(n){return n&&this.isNumeric(parseInt(n))?parseInt(n):!1},isNumeric:function(n){return!isNaN(n)},isString:function(n){return Object.prototype.toString.call(n)==="[object String]"}}}},{"./helpers/uri":4,"./terms":9}],9:[function(n,t){"use strict";t.exports={traffic:{utm:"utm",organic:"organic",referral:"referral",typein:"typein"},referer:{referral:"referral",organic:"organic",social:"social"},none:"(none)",oops:"(Houston, we have a problem)"}},{}]},{},[1])(1)}),function(n,t){"use strict";typeof module=="object"&&module.exports?module.exports=t(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):n.URI=t(n.punycode,n.IPv6,n.SecondLevelDomains,n)}(this,function(n,t,i,r){"use strict";function u(n,t){var i=arguments.length>=1,r=arguments.length>=2;if(!(this instanceof u))return i?r?new u(n,t):new u(n):new u;if(n===undefined){if(i)throw new TypeError("undefined is not a valid argument for URI");n=typeof location!="undefined"?location.href+"":""}if(n===null&&i)throw new TypeError("null is not a valid argument for URI");return(this.href(n),t!==undefined)?this.absoluteTo(t):this}function s(n){return n.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function h(n){return n===undefined?"Undefined":String(Object.prototype.toString.call(n)).slice(8,-1)}function e(n){return h(n)==="Array"}function k(n,t){var r={},i,u,f;if(h(t)==="RegExp")r=null;else if(e(t))for(i=0,u=t.length;i<u;i++)r[t[i]]=!0;else r[t]=!0;for(i=0,u=n.length;i<u;i++)f=r&&r[n[i]]!==undefined||!r&&t.test(n[i]),f&&(n.splice(i,1),u--,i--);return n}function v(n,t){var i,r,u;if(e(t)){for(i=0,r=t.length;i<r;i++)if(!v(n,t[i]))return!1;return!0}for(u=h(t),i=0,r=n.length;i<r;i++)if(u==="RegExp"){if(typeof n[i]=="string"&&n[i].match(t))return!0}else if(n[i]===t)return!0;return!1}function d(n,t){if(!e(n)||!e(t)||n.length!==t.length)return!1;n.sort();t.sort();for(var i=0,r=n.length;i<r;i++)if(n[i]!==t[i])return!1;return!0}function w(n){return n.replace(/^\/+|\/+$/g,"")}function it(n){return escape(n)}function b(n){return encodeURIComponent(n).replace(/[!'()*]/g,it).replace(/\*/g,"%2A")}function a(n){return function(t,i){return t===undefined?this._parts[n]||"":(this._parts[n]=t||null,this.build(!i),this)}}function g(n,t){return function(i,r){return i===undefined?this._parts[n]||"":(i!==null&&(i=i+"",i.charAt(0)===t&&(i=i.substring(1))),this._parts[n]=i,this.build(!r),this)}}var tt=r&&r.URI,f,o,y,c,p,l,nt;u.version="1.18.10";f=u.prototype;o=Object.prototype.hasOwnProperty;u._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,duplicateQueryParameters:u.duplicateQueryParameters,escapeQuerySpace:u.escapeQuerySpace}};u.duplicateQueryParameters=!1;u.escapeQuerySpace=!0;u.protocol_expression=/^[a-z][a-z0-9.+-]*$/i;u.idn_expression=/[^a-z0-9\.-]/i;u.punycode_expression=/(xn--)/i;u.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;u.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;u.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig;u.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g};u.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"};u.invalid_hostname_characters=/[^a-zA-Z0-9\.-]/;u.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"};u.getDomAttribute=function(n){if(!n||!n.nodeName)return undefined;var t=n.nodeName.toLowerCase();return t==="input"&&n.type!=="image"?undefined:u.domAttributes[t]};u.encode=b;u.decode=decodeURIComponent;u.iso8859=function(){u.encode=escape;u.decode=unescape};u.unicode=function(){u.encode=b;u.decode=decodeURIComponent};u.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}};u.encodeQuery=function(n,t){var i=u.encode(n+"");return t===undefined&&(t=u.escapeQuerySpace),t?i.replace(/%20/g,"+"):i};u.decodeQuery=function(n,t){n+="";t===undefined&&(t=u.escapeQuerySpace);try{return u.decode(t?n.replace(/\+/g,"%20"):n)}catch(i){return n}};y={encode:"encode",decode:"decode"};p=function(n,t){return function(i){try{return u[t](i+"").replace(u.characters[n][t].expression,function(i){return u.characters[n][t].map[i]})}catch(r){return i}}};for(c in y)u[c+"PathSegment"]=p("pathname",y[c]),u[c+"UrnPathSegment"]=p("urnpath",y[c]);l=function(n,t,i){return function(r){var o,f,e,s;for(o=i?function(n){return u[t](u[i](n))}:u[t],f=(r+"").split(n),e=0,s=f.length;e<s;e++)f[e]=o(f[e]);return f.join(n)}};u.decodePath=l("/","decodePathSegment");u.decodeUrnPath=l(":","decodeUrnPathSegment");u.recodePath=l("/","encodePathSegment","decode");u.recodeUrnPath=l(":","encodeUrnPathSegment","decode");u.encodeReserved=p("reserved","encode");u.parse=function(n,t){var i;return t||(t={}),i=n.indexOf("#"),i>-1&&(t.fragment=n.substring(i+1)||null,n=n.substring(0,i)),i=n.indexOf("?"),i>-1&&(t.query=n.substring(i+1)||null,n=n.substring(0,i)),n.substring(0,2)==="//"?(t.protocol=null,n=n.substring(2),n=u.parseAuthority(n,t)):(i=n.indexOf(":"),i>-1&&(t.protocol=n.substring(0,i)||null,t.protocol&&!t.protocol.match(u.protocol_expression)?t.protocol=undefined:n.substring(i+1,i+3)==="//"?(n=n.substring(i+3),n=u.parseAuthority(n,t)):(n=n.substring(i+1),t.urn=!0))),t.path=n,t};u.parseHost=function(n,t){var i,r,u;if(n=n.replace(/\\/g,"/"),i=n.indexOf("/"),i===-1&&(i=n.length),n.charAt(0)==="[")r=n.indexOf("]"),t.hostname=n.substring(1,r)||null,t.port=n.substring(r+2,i)||null,t.port==="/"&&(t.port=null);else{var o=n.indexOf(":"),f=n.indexOf("/"),e=n.indexOf(":",o+1);e!==-1&&(f===-1||e<f)?(t.hostname=n.substring(0,i)||null,t.port=null):(u=n.substring(0,i).split(":"),t.hostname=u[0]||null,t.port=u[1]||null)}return t.hostname&&n.substring(i).charAt(0)!=="/"&&(i++,n="/"+n),n.substring(i)||"/"};u.parseAuthority=function(n,t){return n=u.parseUserinfo(n,t),u.parseHost(n,t)};u.parseUserinfo=function(n,t){var r=n.indexOf("/"),f=n.lastIndexOf("@",r>-1?r:n.length-1),i;return f>-1&&(r===-1||f<r)?(i=n.substring(0,f).split(":"),t.username=i[0]?u.decode(i[0]):null,i.shift(),t.password=i[0]?u.decode(i.join(":")):null,n=n.substring(f+1)):(t.username=null,t.password=null),n};u.parseQuery=function(n,t){var e;if(!n)return{};if(n=n.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!n)return{};var i={},h=n.split("&"),c=h.length,f,r,s;for(e=0;e<c;e++)f=h[e].split("="),r=u.decodeQuery(f.shift(),t),s=f.length?u.decodeQuery(f.join("="),t):null,o.call(i,r)?((typeof i[r]=="string"||i[r]===null)&&(i[r]=[i[r]]),i[r].push(s)):i[r]=s;return i};u.build=function(n){var t="";return n.protocol&&(t+=n.protocol+":"),!n.urn&&(t||n.hostname)&&(t+="//"),t+=u.buildAuthority(n)||"",typeof n.path=="string"&&(n.path.charAt(0)!=="/"&&typeof n.hostname=="string"&&(t+="/"),t+=n.path),typeof n.query=="string"&&n.query&&(t+="?"+n.query),typeof n.fragment=="string"&&n.fragment&&(t+="#"+n.fragment),t};u.buildHost=function(n){var t="";if(n.hostname)t+=u.ip6_expression.test(n.hostname)?"["+n.hostname+"]":n.hostname;else return"";return n.port&&(t+=":"+n.port),t};u.buildAuthority=function(n){return u.buildUserinfo(n)+u.buildHost(n)};u.buildUserinfo=function(n){var t="";return n.username&&(t+=u.encode(n.username)),n.password&&(t+=":"+u.encode(n.password)),t&&(t+="@"),t};u.buildQuery=function(n,t,i){var s="",h,r,f,c;for(r in n)if(o.call(n,r)&&r)if(e(n[r]))for(h={},f=0,c=n[r].length;f<c;f++)n[r][f]!==undefined&&h[n[r][f]+""]===undefined&&(s+="&"+u.buildQueryParameter(r,n[r][f],i),t!==!0&&(h[n[r][f]+""]=!0));else n[r]!==undefined&&(s+="&"+u.buildQueryParameter(r,n[r],i));return s.substring(1)};u.buildQueryParameter=function(n,t,i){return u.encodeQuery(n,i)+(t!==null?"="+u.encodeQuery(t,i):"")};u.addQuery=function(n,t,i){if(typeof t=="object")for(var r in t)o.call(t,r)&&u.addQuery(n,r,t[r]);else if(typeof t=="string"){if(n[t]===undefined){n[t]=i;return}typeof n[t]=="string"&&(n[t]=[n[t]]);e(i)||(i=[i]);n[t]=(n[t]||[]).concat(i)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");};u.removeQuery=function(n,t,i){var f,s,r;if(e(t))for(f=0,s=t.length;f<s;f++)n[t[f]]=undefined;else if(h(t)==="RegExp")for(r in n)t.test(r)&&(n[r]=undefined);else if(typeof t=="object")for(r in t)o.call(t,r)&&u.removeQuery(n,r,t[r]);else if(typeof t=="string")i!==undefined?h(i)==="RegExp"?n[t]=!e(n[t])&&i.test(n[t])?undefined:k(n[t],i):n[t]!==String(i)||e(i)&&i.length!==1?e(n[t])&&(n[t]=k(n[t],i)):n[t]=undefined:n[t]=undefined;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");};u.hasQuery=function(n,t,i,r){var f,s,c,l;switch(h(t)){case"String":break;case"RegExp":for(f in n)if(o.call(n,f)&&t.test(f)&&(i===undefined||u.hasQuery(n,f,i)))return!0;return!1;case"Object":for(s in t)if(o.call(t,s)&&!u.hasQuery(n,s,t[s]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter");}switch(h(i)){case"Undefined":return t in n;case"Boolean":return c=Boolean(e(n[t])?n[t].length:n[t]),i===c;case"Function":return!!i(n[t],t,n);case"Array":return e(n[t])?(l=r?v:d,l(n[t],i)):!1;case"RegExp":return e(n[t])?r?v(n[t],i):!1:Boolean(n[t]&&n[t].match(i));case"Number":i=String(i);case"String":return e(n[t])?r?v(n[t],i):!1:n[t]===i;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");}};u.joinPaths=function(){for(var o,t,n,i,r=[],f=[],s=0,e=0;e<arguments.length;e++)for(o=new u(arguments[e]),r.push(o),t=o.segment(),n=0;n<t.length;n++)typeof t[n]=="string"&&f.push(t[n]),t[n]&&s++;return!f.length||!s?new u(""):(i=new u("").segment(f),(r[0].path()===""||r[0].path().slice(0,1)==="/")&&i.path("/"+i.path()),i.normalize())};u.commonPath=function(n,t){for(var r=Math.min(n.length,t.length),i=0;i<r;i++)if(n.charAt(i)!==t.charAt(i)){i--;break}return i<1?n.charAt(0)===t.charAt(0)&&n.charAt(0)==="/"?"/":"":((n.charAt(i)!=="/"||t.charAt(i)!=="/")&&(i=n.substring(0,i).lastIndexOf("/")),n.substring(0,i+1))};u.withinString=function(n,t,i){var c,r,a,l,y,e;i||(i={});var o=i.start||u.findUri.start,p=i.end||u.findUri.end,v=i.trim||u.findUri.trim,w=i.parens||u.findUri.parens;for(o.lastIndex=0;;){if(c=o.exec(n),!c)break;if(r=c.index,!i.ignoreHtml||(a=n.slice(Math.max(r-3,0),r),!a||!/[a-z0-9-]=["']?$/i.test(a))){for(var s=r+n.slice(r).search(p),f=n.slice(r,s),h=-1;;){if(l=w.exec(f),!l)break;y=l.index+l[0].length;h=Math.max(h,y)}if((f=h>-1?f.slice(0,h)+f.slice(h).replace(v,""):f.replace(v,""),!(f.length<=c[0].length))&&(!i.ignore||!i.ignore.test(f))){if(s=r+f.length,e=t(f,r,s,n),e===undefined){o.lastIndex=s;continue}e=String(e);n=n.slice(0,r)+e+n.slice(s);o.lastIndex=r+e.length}}}return o.lastIndex=0,n};u.ensureValidHostname=function(t){if(t.match(u.invalid_hostname_characters)){if(!n)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-] and Punycode.js is not available');if(n.toASCII(t).match(u.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');}};u.noConflict=function(n){if(n){var t={URI:this.noConflict()};return r.URITemplate&&typeof r.URITemplate.noConflict=="function"&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&typeof r.IPv6.noConflict=="function"&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&typeof r.SecondLevelDomains.noConflict=="function"&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t}return r.URI===this&&(r.URI=tt),this};f.build=function(n){return n===!0?this._deferred_build=!0:(n===undefined||this._deferred_build)&&(this._string=u.build(this._parts),this._deferred_build=!1),this};f.clone=function(){return new u(this)};f.valueOf=f.toString=function(){return this.build(!1)._string};f.protocol=a("protocol");f.username=a("username");f.password=a("password");f.hostname=a("hostname");f.port=a("port");f.query=g("query","?");f.fragment=g("fragment","#");f.search=function(n,t){var i=this.query(n,t);return typeof i=="string"&&i.length?"?"+i:i};f.hash=function(n,t){var i=this.fragment(n,t);return typeof i=="string"&&i.length?"#"+i:i};f.pathname=function(n,t){if(n===undefined||n===!0){var i=this._parts.path||(this._parts.hostname?"/":"");return n?(this._parts.urn?u.decodeUrnPath:u.decodePath)(i):i}return this._parts.path=this._parts.urn?n?u.recodeUrnPath(n):"":n?u.recodePath(n):"/",this.build(!t),this};f.path=f.pathname;f.href=function(n,t){var i,r,f,s,e;if(n===undefined)return this.toString();if(this._string="",this._parts=u._parts(),r=n instanceof u,f=typeof n=="object"&&(n.hostname||n.path||n.pathname),n.nodeName&&(s=u.getDomAttribute(n),n=n[s]||"",f=!1),!r&&f&&n.pathname!==undefined&&(n=n.toString()),typeof n=="string"||n instanceof String)this._parts=u.parse(String(n),this._parts);else if(r||f){e=r?n._parts:n;for(i in e)o.call(this._parts,i)&&(this._parts[i]=e[i])}else throw new TypeError("invalid input");return this.build(!t),this};f.is=function(n){var r=!1,f=!1,e=!1,t=!1,s=!1,h=!1,c=!1,o=!this._parts.urn;this._parts.hostname&&(o=!1,f=u.ip4_expression.test(this._parts.hostname),e=u.ip6_expression.test(this._parts.hostname),r=f||e,t=!r,s=t&&i&&i.has(this._parts.hostname),h=t&&u.idn_expression.test(this._parts.hostname),c=t&&u.punycode_expression.test(this._parts.hostname));switch(n.toLowerCase()){case"relative":return o;case"absolute":return!o;case"domain":case"name":return t;case"sld":return s;case"ip":return r;case"ip4":case"ipv4":case"inet4":return f;case"ip6":case"ipv6":case"inet6":return e;case"idn":return h;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var rt=f.protocol,ut=f.port,ft=f.hostname;return f.protocol=function(n,t){if(n!==undefined&&n&&(n=n.replace(/:(\/\/)?$/,""),!n.match(u.protocol_expression)))throw new TypeError('Protocol "'+n+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return rt.call(this,n,t)},f.scheme=f.protocol,f.port=function(n,t){if(this._parts.urn)return n===undefined?"":this;if(n!==undefined&&(n===0&&(n=null),n&&(n+="",n.charAt(0)===":"&&(n=n.substring(1)),n.match(/[^0-9]/))))throw new TypeError('Port "'+n+'" contains characters other than [0-9]');return ut.call(this,n,t)},f.hostname=function(n,t){if(this._parts.urn)return n===undefined?"":this;if(n!==undefined){var i={},r=u.parseHost(n,i);if(r!=="/")throw new TypeError('Hostname "'+n+'" contains characters other than [A-Z0-9.-]');n=i.hostname}return ft.call(this,n,t)},f.origin=function(n,t){var i,f,r;return this._parts.urn?n===undefined?"":this:n===undefined?(i=this.protocol(),f=this.authority(),!f)?"":(i?i+"://":"")+this.authority():(r=u(n),this.protocol(r.protocol()).authority(r.authority()).build(!t),this)},f.host=function(n,t){if(this._parts.urn)return n===undefined?"":this;if(n===undefined)return this._parts.hostname?u.buildHost(this._parts):"";var i=u.parseHost(n,this._parts);if(i!=="/")throw new TypeError('Hostname "'+n+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},f.authority=function(n,t){if(this._parts.urn)return n===undefined?"":this;if(n===undefined)return this._parts.hostname?u.buildAuthority(this._parts):"";var i=u.parseAuthority(n,this._parts);if(i!=="/")throw new TypeError('Hostname "'+n+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},f.userinfo=function(n,t){if(this._parts.urn)return n===undefined?"":this;if(n===undefined){var i=u.buildUserinfo(this._parts);return i?i.substring(0,i.length-1):i}return n[n.length-1]!=="@"&&(n+="@"),u.parseUserinfo(n,this._parts),this.build(!t),this},f.resource=function(n,t){var i;return n===undefined?this.path()+this.search()+this.hash():(i=u.parse(n),this._parts.path=i.path,this._parts.query=i.query,this._parts.fragment=i.fragment,this.build(!t),this)},f.subdomain=function(n,t){var i;if(this._parts.urn)return n===undefined?"":this;if(n===undefined)return!this._parts.hostname||this.is("IP")?"":(i=this._parts.hostname.length-this.domain().length-1,this._parts.hostname.substring(0,i)||"");var r=this._parts.hostname.length-this.domain().length,f=this._parts.hostname.substring(0,r),e=new RegExp("^"+s(f));return n&&n.charAt(n.length-1)!=="."&&(n+="."),n&&u.ensureValidHostname(n),this._parts.hostname=this._parts.hostname.replace(e,n),this.build(!t),this},f.domain=function(n,t){var r,i,f;if(this._parts.urn)return n===undefined?"":this;if(typeof n=="boolean"&&(t=n,n=undefined),n===undefined)return!this._parts.hostname||this.is("IP")?"":(r=this._parts.hostname.match(/\./g),r&&r.length<2)?this._parts.hostname:(i=this._parts.hostname.length-this.tld(t).length-1,i=this._parts.hostname.lastIndexOf(".",i-1)+1,this._parts.hostname.substring(i)||"");if(!n)throw new TypeError("cannot set domain empty");return u.ensureValidHostname(n),!this._parts.hostname||this.is("IP")?this._parts.hostname=n:(f=new RegExp(s(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(f,n)),this.build(!t),this},f.tld=function(n,t){var f,r,u;if(this._parts.urn)return n===undefined?"":this;if(typeof n=="boolean"&&(t=n,n=undefined),n===undefined)return!this._parts.hostname||this.is("IP")?"":(f=this._parts.hostname.lastIndexOf("."),r=this._parts.hostname.substring(f+1),t!==!0&&i&&i.list[r.toLowerCase()])?i.get(this._parts.hostname)||r:r;if(n)if(n.match(/[^a-zA-Z0-9-]/))if(i&&i.is(n))u=new RegExp(s(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(u,n);else throw new TypeError('TLD "'+n+'" contains characters other than [A-Z0-9]');else if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");else u=new RegExp(s(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(u,n);else throw new TypeError("cannot set TLD empty");return this.build(!t),this},f.directory=function(n,t){var r,i;if(this._parts.urn)return n===undefined?"":this;if(n===undefined||n===!0)return!this._parts.path&&!this._parts.hostname?"":this._parts.path==="/"?"/":(r=this._parts.path.length-this.filename().length-1,i=this._parts.path.substring(0,r)||(this._parts.hostname?"/":""),n?u.decodePath(i):i);var f=this._parts.path.length-this.filename().length,e=this._parts.path.substring(0,f),o=new RegExp("^"+s(e));return this.is("relative")||(n||(n="/"),n.charAt(0)!=="/"&&(n="/"+n)),n&&n.charAt(n.length-1)!=="/"&&(n+="/"),n=u.recodePath(n),this._parts.path=this._parts.path.replace(o,n),this.build(!t),this},f.filename=function(n,t){var f,i,r,e;return this._parts.urn?n===undefined?"":this:typeof n!="string"?!this._parts.path||this._parts.path==="/"?"":(f=this._parts.path.lastIndexOf("/"),i=this._parts.path.substring(f+1),n?u.decodePathSegment(i):i):(r=!1,n.charAt(0)==="/"&&(n=n.substring(1)),n.match(/\.?\//)&&(r=!0),e=new RegExp(s(this.filename())+"$"),n=u.recodePath(n),this._parts.path=this._parts.path.replace(e,n),r?this.normalizePath(t):this.build(!t),this)},f.suffix=function(n,t){var r,f,e,o,i,h;if(this._parts.urn)return n===undefined?"":this;if(n===undefined||n===!0)return!this._parts.path||this._parts.path==="/"?"":(r=this.filename(),f=r.lastIndexOf("."),f===-1)?"":(e=r.substring(f+1),o=/^[a-z0-9%]+$/i.test(e)?e:"",n?u.decodePathSegment(o):o);if(n.charAt(0)==="."&&(n=n.substring(1)),i=this.suffix(),i)h=n?new RegExp(s(i)+"$"):new RegExp(s("."+i)+"$");else{if(!n)return this;this._parts.path+="."+u.recodePath(n)}return h&&(n=u.recodePath(n),this._parts.path=this._parts.path.replace(h,n)),this.build(!t),this},f.segment=function(n,t,i){var f=this._parts.urn?":":"/",o=this.path(),s=o.substring(0,1)==="/",r=o.split(f),u,h;if(n!==undefined&&typeof n!="number"&&(i=t,t=n,n=undefined),n!==undefined&&typeof n!="number")throw new Error('Bad segment "'+n+'", must be 0-based integer');if(s&&r.shift(),n<0&&(n=Math.max(r.length+n,0)),t===undefined)return n===undefined?r:r[n];if(n===null||r[n]===undefined)if(e(t))for(r=[],u=0,h=t.length;u<h;u++)(t[u].length||r.length&&r[r.length-1].length)&&(r.length&&!r[r.length-1].length&&r.pop(),r.push(w(t[u])));else(t||typeof t=="string")&&(t=w(t),r[r.length-1]===""?r[r.length-1]=t:r.push(t));else t?r[n]=w(t):r.splice(n,1);return s&&r.unshift(""),this.path(r.join(f),i)},f.segmentCoded=function(n,t,i){var f,r,o;if(typeof n!="number"&&(i=t,t=n,n=undefined),t===undefined){if(f=this.segment(n,t,i),e(f))for(r=0,o=f.length;r<o;r++)f[r]=u.decode(f[r]);else f=f!==undefined?u.decode(f):undefined;return f}if(e(t))for(r=0,o=t.length;r<o;r++)t[r]=u.encode(t[r]);else t=typeof t=="string"||t instanceof String?u.encode(t):t;return this.segment(n,t,i)},nt=f.query,f.query=function(n,t){if(n===!0)return u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof n=="function"){var i=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r=n.call(this,i);return this._parts.query=u.buildQuery(r||i,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return n!==undefined&&typeof n!="string"?(this._parts.query=u.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):nt.call(this,n,t)},f.setQuery=function(n,t,i){var f=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r;if(typeof n=="string"||n instanceof String)f[n]=t!==undefined?t:null;else if(typeof n=="object")for(r in n)o.call(n,r)&&(f[r]=n[r]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=u.buildQuery(f,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof n!="string"&&(i=t),this.build(!i),this},f.addQuery=function(n,t,i){var r=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return u.addQuery(r,n,t===undefined?null:t),this._parts.query=u.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof n!="string"&&(i=t),this.build(!i),this},f.removeQuery=function(n,t,i){var r=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return u.removeQuery(r,n,t),this._parts.query=u.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof n!="string"&&(i=t),this.build(!i),this},f.hasQuery=function(n,t,i){var r=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return u.hasQuery(r,n,t,i)},f.setSearch=f.setQuery,f.addSearch=f.addQuery,f.removeSearch=f.removeQuery,f.hasSearch=f.hasQuery,f.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},f.normalizeProtocol=function(n){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!n)),this},f.normalizeHostname=function(i){return this._parts.hostname&&(this.is("IDN")&&n?this._parts.hostname=n.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!i)),this},f.normalizePort=function(n){return typeof this._parts.protocol=="string"&&this._parts.port===u.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!n)),this},f.normalizePath=function(n){var t=this._parts.path,e,i,r,f;if(!t)return this;if(this._parts.urn)return this._parts.path=u.recodeUrnPath(this._parts.path),this.build(!n),this;if(this._parts.path==="/")return this;for(t=u.recodePath(t),i="",t.charAt(0)!=="/"&&(e=!0,t="/"+t),(t.slice(-3)==="/.."||t.slice(-2)==="/.")&&(t+="/"),t=t.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),e&&(i=t.substring(1).match(/^(\.\.\/)+/)||"",i&&(i=i[0]));;){if(r=t.search(/\/\.\.(\/|$)/),r===-1)break;else if(r===0){t=t.substring(3);continue}f=t.substring(0,r).lastIndexOf("/");f===-1&&(f=r);t=t.substring(0,f)+t.substring(r+3)}return e&&this.is("relative")&&(t=i+t.substring(1)),this._parts.path=t,this.build(!n),this},f.normalizePathname=f.normalizePath,f.normalizeQuery=function(n){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(u.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!n)),this},f.normalizeFragment=function(n){return this._parts.fragment||(this._parts.fragment=null,this.build(!n)),this},f.normalizeSearch=f.normalizeQuery,f.normalizeHash=f.normalizeFragment,f.iso8859=function(){var n=u.encode,t=u.decode;u.encode=escape;u.decode=decodeURIComponent;try{this.normalize()}finally{u.encode=n;u.decode=t}return this},f.unicode=function(){var n=u.encode,t=u.decode;u.encode=b;u.decode=unescape;try{this.normalize()}finally{u.encode=n;u.decode=t}return this},f.readable=function(){var t=this.clone(),i,r,f;if(t.username("").password("").normalize(),i="",t._parts.protocol&&(i+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&n?(i+=n.toUnicode(t._parts.hostname),t._parts.port&&(i+=":"+t._parts.port)):i+=t.host()),t._parts.hostname&&t._parts.path&&t._parts.path.charAt(0)!=="/"&&(i+="/"),i+=t.path(!0),t._parts.query){r="";for(var e=0,o=t._parts.query.split("&"),s=o.length;e<s;e++)f=(o[e]||"").split("="),r+="&"+u.decodeQuery(f[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),f[1]!==undefined&&(r+="="+u.decodeQuery(f[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"));i+="?"+r.substring(1)}return i+u.decodeQuery(t.hash(),!0)},f.absoluteTo=function(n){var t=this.clone(),e=["protocol","username","password","hostname","port"],i,r,f;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if((n instanceof u||(n=new u(n)),t._parts.protocol)||(t._parts.protocol=n._parts.protocol,this._parts.hostname))return t;for(r=0;f=e[r];r++)t._parts[f]=n._parts[f];return t._parts.path?(t._parts.path.substring(-2)===".."&&(t._parts.path+="/"),t.path().charAt(0)!=="/"&&(i=n.directory(),i=i?i:n.path().indexOf("/")===0?"/":"",t._parts.path=(i?i+"/":"")+t._parts.path,t.normalizePath())):(t._parts.path=n._parts.path,t._parts.query||(t._parts.query=n._parts.query)),t.build(),t},f.relativeTo=function(n){var i=this.clone().normalize(),t,r,f,e,o,s;if(i._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(n=new u(n).normalize(),t=i._parts,r=n._parts,e=i.path(),o=n.path(),e.charAt(0)!=="/")throw new Error("URI is already relative");if(o.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if((t.protocol===r.protocol&&(t.protocol=null),t.username!==r.username||t.password!==r.password)||t.protocol!==null||t.username!==null||t.password!==null)return i.build();if(t.hostname===r.hostname&&t.port===r.port)t.hostname=null,t.port=null;else return i.build();return e===o?(t.path="",i.build()):(f=u.commonPath(e,o),!f)?i.build():(s=r.path.substring(f.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../"),t.path=s+t.path.substring(f.length)||"./",i.build())},f.equals=function(n){var r=this.clone(),f=new u(n),i={},s={},l={},h,c,t;if(r.normalize(),f.normalize(),r.toString()===f.toString())return!0;if((h=r.query(),c=f.query(),r.query(""),f.query(""),r.toString()!==f.toString())||h.length!==c.length)return!1;i=u.parseQuery(h,this._parts.escapeQuerySpace);s=u.parseQuery(c,this._parts.escapeQuerySpace);for(t in i)if(o.call(i,t)){if(e(i[t])){if(!d(i[t],s[t]))return!1}else if(i[t]!==s[t])return!1;l[t]=!0}for(t in s)if(o.call(s,t)&&!l[t])return!1;return!0},f.duplicateQueryParameters=function(n){return this._parts.duplicateQueryParameters=!!n,this},f.escapeQuerySpace=function(n){return this._parts.escapeQuerySpace=!!n,this},u});sbjs.init();jQuery(document).ready(function(){function n(n,t){for(var r,i=0;i<t.length;i++)if(r=n[t[i]],r)return r}function r(){var o=["source","utm_source"],s=["medium","utm_medium"],h=["campaign","utm_campaign"],c=["term","utm_term","kw","p","keyword"],l=["content","utm_content"],a=["ad","adid"],v=new URI(sbjs.get.first_add.ep?sbjs.get.first_add.ep.toLowerCase():""),f=v.search(!0),t={domain:v.hostname(),source:n(f,o),medium:n(f,s),campaign:n(f,h),keywords:n(f,c),content:n(f,l),ad:n(f,a)},y=new URI(sbjs.get.first_add.rf?sbjs.get.first_add.rf.toLowerCase():""),e=y.search(!0),i={domain:y.hostname(),source:n(e,o),medium:n(e,s),campaign:n(e,h),keywords:n(e,c),content:n(e,l),ad:n(e,a)},r=sbjs.get.current.typ||"typein",u="?domain="+(i.domain||t.domain||location.hostname);return(t.source||i.source)&&(u+="&source="+(t.source||i.source),r="cpc"),(t.medium||i.medium)&&(u+="&medium="+(t.medium||i.medium),r="cpc"),(t.campaign||i.campaign)&&(u+="&campaign="+(t.campaign||i.campaign),r="cpc"),(t.keywords||i.keywords)&&(u+="&keyword="+(t.keywords||i.keywords),r="cpc"),(t.content||i.content)&&(u+="&content="+(t.content||i.content),r="cpc"),(t.ad||i.ad)&&(u+="&ad="+(t.ad||i.ad),r="cpc"),u+("&type="+(r==="utm"?"cpc":r))}function t(n,t){jQuery('a[href="'+n+'"]').each(function(n,i){i.href=i.href+t})}var i=r();t("https://be.exceptionless.io/signup",i);t("https://exceptionless.com",i)})