function localStorageSupport(){return"localStorage"in window&&window.localStorage!==null}function animationHover(n,t){n=$(n);n.hover(function(){n.addClass("animated "+t)},function(){window.setTimeout(function(){n.removeClass("animated "+t)},2e3)})}function SmoothlyMenu(){!$("body").hasClass("mini-navbar")||$("body").hasClass("body-small")?($("#side-menu").hide(),setTimeout(function(){$("#side-menu").fadeIn(400)},200)):$("body").hasClass("fixed-sidebar")?($("#side-menu").hide(),setTimeout(function(){$("#side-menu").fadeIn(400)},100)):$("#side-menu").removeAttr("style")}function WinMove(){$("[class*=col]").sortable({handle:".ibox-title",connectWith:"connectedSortable",tolerance:"pointer",forcePlaceholderSize:!0,opacity:.7,stop:function(){var n=$(".connectedSortable").sortable("toArray");$.post("/user/sortresume/?sorted="+n,function(){})}})}$(document).ready(function(){function n(){var i=$("body > #wrapper").height()-61,n,t;$(".sidebard-panel").css("min-height",i+"px");n=$("nav.navbar-default").height();t=$("#page-wrapper").height();n>t&&$("#page-wrapper").css("min-height",n+"px");n<t&&$("#page-wrapper").css("min-height",$(window).height()+"px");$("body").hasClass("fixed-nav")&&(n>t?$("#page-wrapper").css("min-height",n-60+"px"):$("#page-wrapper").css("min-height",$(window).height()-60+"px"))}$(this).width()<769?$("body").addClass("body-small"):$("body").removeClass("body-small");$("#side-menu").metisMenu();$(".collapse-link").click(function(){var n=$(this).closest("div.ibox"),t=$(this).find("i"),i=n.find("div.ibox-content");i.slideToggle(200);t.toggleClass("fa-chevron-up").toggleClass("fa-chevron-down");n.toggleClass("").toggleClass("border-bottom");setTimeout(function(){n.resize();n.find("[id^=map-]").resize()},50)});$(".close-link").click(function(){var n=$(this).closest("div.ibox");n.remove()});$(".fullscreen-link").click(function(){var n=$(this).closest("div.ibox"),t=$(this).find("i");$("body").toggleClass("fullscreen-ibox-mode");t.toggleClass("fa-expand").toggleClass("fa-compress");n.toggleClass("fullscreen");setTimeout(function(){$(window).trigger("resize")},100)});$(".close-canvas-menu").click(function(){$("body").toggleClass("mini-navbar");SmoothlyMenu()});$("body.canvas-menu .sidebar-collapse").slimScroll({height:"100%",railOpacity:.9});$(".right-sidebar-toggle").click(function(){$("#right-sidebar").toggleClass("sidebar-open")});$(".sidebar-container").slimScroll({height:"100%",railOpacity:.4,wheelStep:10});$(".open-small-chat").click(function(){$(this).children().toggleClass("fa-comments").toggleClass("fa-remove");$(".small-chat-box").toggleClass("active")});$(".small-chat-box .content").slimScroll({height:"234px",railOpacity:.4});$(".check-link").click(function(){var n=$(this).find("i"),t=$(this).next("span");return n.toggleClass("fa-check-square").toggleClass("fa-square-o"),t.toggleClass("todo-completed"),!1});$(".navbar-minimalize").click(function(){$("body").toggleClass("mini-navbar");SmoothlyMenu()});$(".tooltip-demo").tooltip({selector:"[data-toggle=tooltip]",container:"body"});$(".modal").appendTo("body");n();$(window).bind("load",function(){$("body").hasClass("fixed-sidebar")&&$(".sidebar-collapse").slimScroll({height:"100%",railOpacity:.9})});$(window).scroll(function(){$(window).scrollTop()>0&&!$("body").hasClass("fixed-nav")?$("#right-sidebar").addClass("sidebar-top"):$("#right-sidebar").removeClass("sidebar-top")});$(window).bind("load resize scroll",function(){$("body").hasClass("body-small")||n()});$("[data-toggle=popover]").popover();$(".full-height-scroll").slimscroll({height:"100%",alwaysVisible:!0})});$(window).bind("resize",function(){$(this).width()<769?$("body").addClass("body-small"):$("body").removeClass("body-small")});$(document).ready(function(){if(localStorageSupport){var t=localStorage.getItem("collapse_menu"),i=localStorage.getItem("fixedsidebar"),r=localStorage.getItem("fixednavbar"),u=localStorage.getItem("boxedlayout"),f=localStorage.getItem("fixedfooter"),n=$("body");i=="on"&&(n.addClass("fixed-sidebar"),$(".sidebar-collapse").slimScroll({height:"100%",railOpacity:.9}));t=="on"&&(n.hasClass("fixed-sidebar")?n.hasClass("body-small")||n.addClass("mini-navbar"):n.hasClass("body-small")||n.addClass("mini-navbar"));r=="on"&&($(".navbar-static-top").removeClass("navbar-static-top").addClass("navbar-fixed-top"),n.addClass("fixed-nav"));u=="on"&&n.addClass("boxed-layout");f=="on"&&$(".footer").addClass("fixed")}}),function(){var nt,ct,lt,at,vt,yt,pt,wt,a,n,bt,kt,tt,dt,gt,o,ni,r,v,y,it,s,p,ti,rt,ut,f,ii,u,t,w,ft,ri,h,et,b,i,e,ot,c,k,st,d,g,ui,fi,ht,hi,ei,l=[].slice,oi={}.hasOwnProperty,si=function(n,t){function r(){this.constructor=n}for(var i in t)oi.call(t,i)&&(n[i]=t[i]);return r.prototype=t.prototype,n.prototype=new r,n.__super__=t.prototype,n},ci=[].indexOf||function(n){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===n)return t;return-1};for(it={catchupTime:100,initialRate:.03,minTime:250,ghostTime:100,maxProgressPerFrame:20,easeFactor:1.25,startOnPageLoad:!0,restartOnPushState:!0,restartOnRequestAfter:500,target:"body",elements:{checkInterval:100,selectors:["body"]},eventLag:{minSamples:10,sampleCount:3,lagThreshold:3},ajax:{trackMethods:["GET"],trackWebSockets:!0,ignoreURLs:[]}},u=function(){var n;return null!=(n="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?n:+new Date},w=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,y=window.cancelAnimationFrame||window.mozCancelAnimationFrame,null==w&&(w=function(n){return setTimeout(n,50)},y=function(n){return clearTimeout(n)}),ri=function(n){var t,i;return t=u(),(i=function(){var r;return r=u()-t,r>=33?(t=u(),n(r,function(){return w(i)})):setTimeout(i,33-r)})()},ft=function(){var i,t,n;return n=arguments[0],t=arguments[1],i=3<=arguments.length?l.call(arguments,2):[],"function"==typeof n[t]?n[t].apply(n,i):n[t]},s=function(){var n,t,r,f,i,u,e;for(t=arguments[0],f=2<=arguments.length?l.call(arguments,1):[],u=0,e=f.length;e>u;u++)if(r=f[u])for(n in r)oi.call(r,n)&&(i=r[n],null!=t[n]&&"object"==typeof t[n]&&null!=i&&"object"==typeof i?s(t[n],i):t[n]=i);return t},ni=function(n){var i,r,u,t,f;for(r=i=0,t=0,f=n.length;f>t;t++)u=n[t],r+=Math.abs(u),i++;return r/i},ti=function(n,t){var i,r,u;if(null==n&&(n="options"),null==t&&(t=!0),u=document.querySelector("[data-pace-"+n+"]")){if(i=u.getAttribute("data-pace-"+n),!t)return i;try{return JSON.parse(i)}catch(f){return r=f,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",r):void 0}}},pt=function(){function n(){}return n.prototype.on=function(n,t,i,r){var u;return null==r&&(r=!1),null==this.bindings&&(this.bindings={}),null==(u=this.bindings)[n]&&(u[n]=[]),this.bindings[n].push({handler:t,ctx:i,once:r})},n.prototype.once=function(n,t,i){return this.on(n,t,i,!0)},n.prototype.off=function(n,t){var i,u,r;if(null!=(null!=(u=this.bindings)?u[n]:void 0)){if(null==t)return delete this.bindings[n];for(i=0,r=[];i<this.bindings[n].length;)r.push(this.bindings[n][i].handler===t?this.bindings[n].splice(i,1):i++);return r}},n.prototype.trigger=function(){var f,r,n,e,t,o,s,i,u;if(n=arguments[0],f=2<=arguments.length?l.call(arguments,1):[],null!=(s=this.bindings)?s[n]:void 0){for(t=0,u=[];t<this.bindings[n].length;)i=this.bindings[n][t],e=i.handler,r=i.ctx,o=i.once,e.apply(null!=r?r:this,f),u.push(o?this.bindings[n].splice(t,1):t++);return u}},n}(),n=window.Pace||{},window.Pace=n,s(n,pt.prototype),t=n.options=s({},it,window.paceOptions,ti()),ht=["ajax","document","eventLag","elements"],d=0,ui=ht.length;ui>d;d++)i=ht[d],t[i]===!0&&(t[i]=it[i]);a=function(n){function t(){return hi=t.__super__.constructor.apply(this,arguments)}return si(t,n),t}(Error);ct=function(){function n(){this.progress=0}return n.prototype.getElement=function(){var n;if(null==this.el){if(n=document.querySelector(t.target),!n)throw new a;this.el=document.createElement("div");this.el.className="pace pace-active";document.body.className=document.body.className.replace(/pace-done/g,"");document.body.className+=" pace-running";this.el.innerHTML='<div class="pace-progress">\n  <div class="pace-progress-inner"><\/div>\n<\/div>\n<div class="pace-activity"><\/div>';null!=n.firstChild?n.insertBefore(this.el,n.firstChild):n.appendChild(this.el)}return this.el},n.prototype.finish=function(){var n;return n=this.getElement(),n.className=n.className.replace("pace-active",""),n.className+=" pace-inactive",document.body.className=document.body.className.replace("pace-running",""),document.body.className+=" pace-done"},n.prototype.update=function(n){return this.progress=n,this.render()},n.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(n){a=n}return this.el=void 0},n.prototype.render=function(){var n,f,i,e,r,o,u;if(null==document.querySelector(t.target))return!1;for(n=this.getElement(),e="translate3d("+this.progress+"%, 0, 0)",u=["webkitTransform","msTransform","transform"],r=0,o=u.length;o>r;r++)f=u[r],n.children[0].style[f]=e;return(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(n.children[0].setAttribute("data-progress-text",""+(0|this.progress)+"%"),this.progress>=100?i="99":(i=this.progress<10?"0":"",i+=0|this.progress),n.children[0].setAttribute("data-progress",""+i)),this.lastRenderedProgress=this.progress},n.prototype.done=function(){return this.progress>=100},n}();wt=function(){function n(){this.bindings={}}return n.prototype.trigger=function(n,t){var f,i,e,r,u;if(null!=this.bindings[n]){for(r=this.bindings[n],u=[],i=0,e=r.length;e>i;i++)f=r[i],u.push(f.call(this,t));return u}},n.prototype.on=function(n,t){var i;return null==(i=this.bindings)[n]&&(i[n]=[]),this.bindings[n].push(t)},n}();st=window.XMLHttpRequest;k=window.XDomainRequest;c=window.WebSocket;p=function(n,t){var u,i,r=[];for(i in t.prototype)try{r.push(null==n[i]&&"function"!=typeof t[i]?"function"==typeof Object.defineProperty?Object.defineProperty(n,i,{get:function(){return t.prototype[i]},configurable:!0,enumerable:!0}):n[i]=t.prototype[i]:void 0)}catch(f){u=f}return r};f=[];n.ignore=function(){var n,t,i;return t=arguments[0],n=2<=arguments.length?l.call(arguments,1):[],f.unshift("ignore"),i=t.apply(null,n),f.shift(),i};n.track=function(){var n,t,i;return t=arguments[0],n=2<=arguments.length?l.call(arguments,1):[],f.unshift("track"),i=t.apply(null,n),f.shift(),i};b=function(n){var i;return(null==n&&(n="GET"),"track"===f[0])?"force":!f.length&&t.ajax&&("socket"===n&&t.ajax.trackWebSockets||(i=n.toUpperCase(),ci.call(t.ajax.trackMethods,i)>=0))?!0:!1};bt=function(n){function i(){var n,r=this;i.__super__.constructor.apply(this,arguments);n=function(n){var t;return t=n.open,n.open=function(i,u){return b(i)&&r.trigger("request",{type:i,url:u,request:n}),t.apply(n,arguments)}};window.XMLHttpRequest=function(t){var i;return i=new st(t),n(i),i};try{p(window.XMLHttpRequest,st)}catch(u){}if(null!=k){window.XDomainRequest=function(){var t;return t=new k,n(t),t};try{p(window.XDomainRequest,k)}catch(u){}}if(null!=c&&t.ajax.trackWebSockets){window.WebSocket=function(n,t){var i;return i=null!=t?new c(n,t):new c(n),b("socket")&&r.trigger("request",{type:"socket",url:n,protocols:t,request:i}),i};try{p(window.WebSocket,c)}catch(u){}}}return si(i,n),i}(wt);g=null;rt=function(){return null==g&&(g=new bt),g};et=function(n){var i,r,f,u;for(u=t.ajax.ignoreURLs,r=0,f=u.length;f>r;r++)if(i=u[r],"string"==typeof i){if(-1!==n.indexOf(i))return!0}else if(i.test(n))return!0;return!1};rt().on("request",function(r){var u,o,f,e,s;return e=r.type,f=r.request,s=r.url,et(s)?void 0:n.running||t.restartOnRequestAfter===!1&&"force"!==b(e)?void 0:(o=arguments,u=t.restartOnRequestAfter||0,"boolean"==typeof u&&(u=0),setTimeout(function(){var c,t,s,h,r,u;if(c="socket"===e?f.readyState<2:0<(h=f.readyState)&&4>h){for(n.restart(),r=n.sources,u=[],t=0,s=r.length;s>t;t++){if(i=r[t],i instanceof nt){i.watch.apply(i,o);break}u.push(void 0)}return u}},u))});nt=function(){function n(){var n=this;this.elements=[];rt().on("request",function(){return n.watch.apply(n,arguments)})}return n.prototype.watch=function(n){var t,i,r,u;return r=n.type,t=n.request,u=n.url,et(u)?void 0:(i="socket"===r?new dt(t):new gt(t),this.elements.push(i))},n}();gt=function(){function n(n){var f,o,i,e,r,u,t=this;if(this.progress=0,null!=window.ProgressEvent)for(o=null,n.addEventListener("progress",function(n){return t.progress=n.lengthComputable?100*n.loaded/n.total:t.progress+(100-t.progress)/2},!1),u=["load","abort","timeout","error"],i=0,e=u.length;e>i;i++)f=u[i],n.addEventListener(f,function(){return t.progress=100},!1);else r=n.onreadystatechange,n.onreadystatechange=function(){var i;return 0===(i=n.readyState)||4===i?t.progress=100:3===n.readyState&&(t.progress=50),"function"==typeof r?r.apply(null,arguments):void 0}}return n}();dt=function(){function n(n){var r,t,u,i,f=this;for(this.progress=0,i=["error","open"],t=0,u=i.length;u>t;t++)r=i[t],n.addEventListener(r,function(){return f.progress=100},!1)}return n}();at=function(){function n(n){var r,t,u,i;for(null==n&&(n={}),this.elements=[],null==n.selectors&&(n.selectors=[]),i=n.selectors,t=0,u=i.length;u>t;t++)r=i[t],this.elements.push(new vt(r))}return n}();vt=function(){function n(n){this.selector=n;this.progress=0;this.check()}return n.prototype.check=function(){var n=this;return document.querySelector(this.selector)?this.done():setTimeout(function(){return n.check()},t.elements.checkInterval)},n.prototype.done=function(){return this.progress=100},n}();lt=function(){function n(){var n,i,t=this;this.progress=null!=(i=this.states[document.readyState])?i:100;n=document.onreadystatechange;document.onreadystatechange=function(){return null!=t.states[document.readyState]&&(t.progress=t.states[document.readyState]),"function"==typeof n?n.apply(null,arguments):void 0}}return n.prototype.states={loading:0,interactive:50,complete:100},n}();yt=function(){function n(){var i,f,r,e,n,o=this;this.progress=0;i=0;n=[];e=0;r=u();f=setInterval(function(){var s;return s=u()-r-50,r=u(),n.push(s),n.length>t.eventLag.sampleCount&&n.shift(),i=ni(n),++e>=t.eventLag.minSamples&&i<t.eventLag.lagThreshold?(o.progress=100,clearInterval(f)):o.progress=300/(i+3)},50)}return n}();tt=function(){function n(n){this.source=n;this.last=this.sinceLastUpdate=0;this.rate=t.initialRate;this.catchup=0;this.progress=this.lastProgress=0;null!=this.source&&(this.progress=ft(this.source,"progress"))}return n.prototype.tick=function(n,i){var r;return null==i&&(i=ft(this.source,"progress")),i>=100&&(this.done=!0),i===this.last?this.sinceLastUpdate+=n:(this.sinceLastUpdate&&(this.rate=(i-this.last)/this.sinceLastUpdate),this.catchup=(i-this.progress)/t.catchupTime,this.sinceLastUpdate=0,this.last=i),i>this.progress&&(this.progress+=this.catchup*n),r=1-Math.pow(this.progress/100,t.easeFactor),this.progress+=r*this.rate*n,this.progress=Math.min(this.lastProgress+t.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},n}();e=null;h=null;r=null;ot=null;o=null;v=null;n.running=!1;ut=function(){if(t.restartOnPushState)return n.restart()};null!=window.history.pushState&&(fi=window.history.pushState,window.history.pushState=function(){return ut(),fi.apply(window.history,arguments)});null!=window.history.replaceState&&(ei=window.history.replaceState,window.history.replaceState=function(){return ut(),ei.apply(window.history,arguments)});kt={ajax:nt,elements:at,document:lt,eventLag:yt};(ii=function(){var u,f,o,l,a,s,v,c;for(n.sources=e=[],s=["ajax","elements","document","eventLag"],f=0,l=s.length;l>f;f++)u=s[f],t[u]!==!1&&e.push(new kt[u](t[u]));for(c=null!=(v=t.extraSources)?v:[],o=0,a=c.length;a>o;o++)i=c[o],e.push(new i(t));return n.bar=r=new ct,h=[],ot=new tt})();n.stop=function(){return n.trigger("stop"),n.running=!1,r.destroy(),v=!0,null!=o&&("function"==typeof y&&y(o),o=null),ii()};n.restart=function(){return n.trigger("restart"),n.stop(),n.start()};n.go=function(){var f;return n.running=!0,r.render(),f=u(),v=!1,o=ri(function(o,s){var nt,p,w,it,b,c,l,et,a,y,k,d,g,rt,ut,ft;for(et=100-r.progress,p=k=0,w=!0,c=d=0,rt=e.length;rt>d;c=++d)for(i=e[c],y=null!=h[c]?h[c]:h[c]=[],b=null!=(ft=i.elements)?ft:[i],l=g=0,ut=b.length;ut>g;l=++g)it=b[l],a=null!=y[l]?y[l]:y[l]=new tt(it),w&=a.done,a.done||(p++,k+=a.tick(o));return nt=k/p,r.update(ot.tick(o,nt)),r.done()||w||v?(r.update(100),n.trigger("done"),setTimeout(function(){return r.finish(),n.running=!1,n.trigger("hide")},Math.max(t.ghostTime,Math.max(t.minTime-(u()-f),0)))):s()})};n.start=function(i){s(t,i);n.running=!0;try{r.render()}catch(u){a=u}return document.querySelector(".pace")?(n.trigger("start"),n.go()):setTimeout(n.start,50)};"function"==typeof define&&define.amd?define(["pace"],function(){return n}):"object"==typeof exports?module.exports=n:t.startOnPageLoad&&n.start()}.call(this),function(){var n=function(n){"use strict";function tt(n){if(n.paused||n.ended||w)return!1;try{i.clearRect(0,0,f,u);i.drawImage(n,0,0,f,u)}catch(t){}ut=setTimeout(function(){tt(n)},r.duration);p.setIcon(l)}function it(n){var t;return n=n.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(n,t,i,r){return t+t+i+i+r+r}),t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n),t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:!1}function et(n,t){var r={};for(var i in n)r[i]=n[i];for(i in t)r[i]=t[i];return r}function lt(){return h.hidden||h.msHidden||h.webkitHidden||h.mozHidden}var k,t,c,u,f,l,i,o,y,d,g,v,w,e,rt,ut,h,a,ft,s,b,nt,p,r;n=n?n:{};k={bgColor:"#d00",textColor:"#fff",fontFamily:"sans-serif",fontStyle:"bold",type:"circle",position:"down",animation:"slide",elementId:!1,element:null,dataUrl:!1,win:window};e={};e.ff=typeof InstallTrigger!="undefined";e.chrome=!!window.chrome;e.opera=!!window.opera||navigator.userAgent.indexOf("Opera")>=0;e.ie=/*@cc_on!@*/!1;e.safari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0;e.supported=e.chrome||e.ff||e.opera;a=[];v=function(){};y=w=!1;ft=function(){var y,w,v,a,e;if(t=et(k,n),t.bgColor=it(t.bgColor),t.textColor=it(t.textColor),t.position=t.position.toLowerCase(),t.animation=r.types[""+t.animation]?t.animation:k.animation,h=t.win.document,y=t.position.indexOf("up")>-1,w=t.position.indexOf("left")>-1,y||w)for(v in r.types)for(a=0;a<r.types[v].length;a++)e=r.types[v][a],y&&(e.y=e.y<.6?e.y-.4:e.y-2*e.y+(1-e.w)),w&&(e.x=e.x<.6?e.x-.4:e.x-2*e.x+(1-e.h)),r.types[v][a]=e;t.type=b[""+t.type]?t.type:k.type;c=p.getIcon();l=document.createElement("canvas");o=document.createElement("img");c.hasAttribute("href")?(o.setAttribute("crossOrigin","anonymous"),o.onload=function(){u=o.height>0?o.height:32;f=o.width>0?o.width:32;l.height=u;l.width=f;i=l.getContext("2d");s.ready()},o.setAttribute("src",c.getAttribute("href"))):(u=32,f=32,o.height=u,o.width=f,l.height=u,l.width=f,i=l.getContext("2d"),s.ready())};s={};s.ready=function(){y=!0;s.reset();v()};s.reset=function(){y&&(a=[],d=!1,g=!1,i.clearRect(0,0,f,u),i.drawImage(o,0,0,f,u),p.setIcon(l),window.clearTimeout(rt),window.clearTimeout(ut))};s.start=function(){var i,n;y&&!g&&(i=function(){d=a[0];g=!1;a.length>0&&(a.shift(),s.start())},a.length>0&&(g=!0,n=function(){["type","animation","bgColor","textColor","fontFamily","fontStyle"].forEach(function(n){n in a[0].options&&(t[n]=a[0].options[n])});r.run(a[0].options,function(){i()},!1)},d?r.run(d.options,function(){n()},!0):n()))};b={};nt=function(n){return n.n=typeof n.n=="number"?Math.abs(n.n|0):n.n,n.x=f*n.x,n.y=u*n.y,n.w=f*n.w,n.h=u*n.h,n.len=(""+n.n).length,n};b.circle=function(n){n=nt(n);var r=!1;n.len===2?(n.x=n.x-n.w*.4,n.w=n.w*1.4,r=!0):n.len>=3&&(n.x=n.x-n.w*.65,n.w=n.w*1.65,r=!0);i.clearRect(0,0,f,u);i.drawImage(o,0,0,f,u);i.beginPath();i.font=t.fontStyle+" "+Math.floor(n.h*(n.n>99?.85:1))+"px "+t.fontFamily;i.textAlign="center";r?(i.moveTo(n.x+n.w/2,n.y),i.lineTo(n.x+n.w-n.h/2,n.y),i.quadraticCurveTo(n.x+n.w,n.y,n.x+n.w,n.y+n.h/2),i.lineTo(n.x+n.w,n.y+n.h-n.h/2),i.quadraticCurveTo(n.x+n.w,n.y+n.h,n.x+n.w-n.h/2,n.y+n.h),i.lineTo(n.x+n.h/2,n.y+n.h),i.quadraticCurveTo(n.x,n.y+n.h,n.x,n.y+n.h-n.h/2),i.lineTo(n.x,n.y+n.h/2),i.quadraticCurveTo(n.x,n.y,n.x+n.h/2,n.y)):i.arc(n.x+n.w/2,n.y+n.h/2,n.h/2,0,2*Math.PI);i.fillStyle="rgba("+t.bgColor.r+","+t.bgColor.g+","+t.bgColor.b+","+n.o+")";i.fill();i.closePath();i.beginPath();i.stroke();i.fillStyle="rgba("+t.textColor.r+","+t.textColor.g+","+t.textColor.b+","+n.o+")";typeof n.n=="number"&&n.n>999?i.fillText((n.n>9999?9:Math.floor(n.n/1e3))+"k+",Math.floor(n.x+n.w/2),Math.floor(n.y+n.h-n.h*.2)):i.fillText(n.n,Math.floor(n.x+n.w/2),Math.floor(n.y+n.h-n.h*.15));i.closePath()};b.rectangle=function(n){n=nt(n);var r=!1;n.len===2?(n.x=n.x-n.w*.4,n.w=n.w*1.4,r=!0):n.len>=3&&(n.x=n.x-n.w*.65,n.w=n.w*1.65,r=!0);i.clearRect(0,0,f,u);i.drawImage(o,0,0,f,u);i.beginPath();i.font=t.fontStyle+" "+Math.floor(n.h*(n.n>99?.9:1))+"px "+t.fontFamily;i.textAlign="center";i.fillStyle="rgba("+t.bgColor.r+","+t.bgColor.g+","+t.bgColor.b+","+n.o+")";i.fillRect(n.x,n.y,n.w,n.h);i.fillStyle="rgba("+t.textColor.r+","+t.textColor.g+","+t.textColor.b+","+n.o+")";typeof n.n=="number"&&n.n>999?i.fillText((n.n>9999?9:Math.floor(n.n/1e3))+"k+",Math.floor(n.x+n.w/2),Math.floor(n.y+n.h-n.h*.2)):i.fillText(n.n,Math.floor(n.x+n.w/2),Math.floor(n.y+n.h-n.h*.15));i.closePath()};var ot=function(n,t){t=(typeof t=="string"?{animation:t}:t)||{};v=function(){try{if(typeof n=="number"?n>0:n!==""){var i={type:"badge",options:{n:n}};if("animation"in t&&r.types[""+t.animation]&&(i.options.animation=""+t.animation),"type"in t&&b[""+t.type]&&(i.options.type=""+t.type),["bgColor","textColor"].forEach(function(n){n in t&&(i.options[n]=it(t[n]))}),["fontStyle","fontFamily"].forEach(function(n){n in t&&(i.options[n]=t[n])}),a.push(i),a.length>100)throw new Error("Too many badges requests in queue.");s.start()}else s.reset()}catch(u){throw new Error("Error setting badge. Message: "+u.message);}};y&&v()},st=function(n){v=function(){try{var r=n.width,e=n.height,t=document.createElement("img"),o=r/f<e/u?r/f:e/u;t.setAttribute("crossOrigin","anonymous");t.onload=function(){i.clearRect(0,0,f,u);i.drawImage(t,0,0,f,u);p.setIcon(l)};t.setAttribute("src",n.getAttribute("src"));t.height=e/o;t.width=r/o}catch(s){throw new Error("Error setting image. Message: "+s.message);}};y&&v()},ht=function(n){v=function(){try{if(n==="stop"){w=!0;s.reset();w=!1;return}n.addEventListener("play",function(){tt(this)},!1)}catch(t){throw new Error("Error setting video. Message: "+t.message);}};y&&v()},ct=function(n){if(window.URL&&window.URL.createObjectURL||(window.URL=window.URL||{},window.URL.createObjectURL=function(n){return n}),e.supported){var t=!1;navigator.getUserMedia=navigator.getUserMedia||navigator.oGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia||navigator.webkitGetUserMedia;v=function(){try{if(n==="stop"){w=!0;s.reset();w=!1;return}t=document.createElement("video");t.width=f;t.height=u;navigator.getUserMedia({video:!0,audio:!1},function(n){t.src=URL.createObjectURL(n);t.play();tt(t)},function(){})}catch(i){throw new Error("Error setting webcam. Message: "+i.message);}};y&&v()}};return p={},p.getIcon=function(){var n=!1,i=function(){for(var t=h.getElementsByTagName("head")[0].getElementsByTagName("link"),i=t.length,n=i-1;n>=0;n--)if(/(^|\s)icon(\s|$)/i.test(t[n].getAttribute("rel")))return t[n];return!1};return t.element?n=t.element:t.elementId?(n=h.getElementById(t.elementId),n.setAttribute("href",n.getAttribute("src"))):(n=i(),n===!1&&(n=h.createElement("link"),n.setAttribute("rel","icon"),h.getElementsByTagName("head")[0].appendChild(n))),n.setAttribute("type","image/png"),n},p.setIcon=function(n){var i=n.toDataURL("image/png"),u,r;t.dataUrl&&t.dataUrl(i);t.element?(t.element.setAttribute("href",i),t.element.setAttribute("src",i)):t.elementId?(u=h.getElementById(t.elementId),u.setAttribute("href",i),u.setAttribute("src",i)):e.ff||e.opera?(r=c,c=h.createElement("link"),e.opera&&c.setAttribute("rel","icon"),c.setAttribute("rel","icon"),c.setAttribute("type","image/png"),h.getElementsByTagName("head")[0].appendChild(c),c.setAttribute("href",i),r.parentNode&&r.parentNode.removeChild(r)):c.setAttribute("href",i)},r={},r.duration=40,r.types={},r.types.fade=[{x:.4,y:.4,w:.6,h:.6,o:0},{x:.4,y:.4,w:.6,h:.6,o:.1},{x:.4,y:.4,w:.6,h:.6,o:.2},{x:.4,y:.4,w:.6,h:.6,o:.3},{x:.4,y:.4,w:.6,h:.6,o:.4},{x:.4,y:.4,w:.6,h:.6,o:.5},{x:.4,y:.4,w:.6,h:.6,o:.6},{x:.4,y:.4,w:.6,h:.6,o:.7},{x:.4,y:.4,w:.6,h:.6,o:.8},{x:.4,y:.4,w:.6,h:.6,o:.9},{x:.4,y:.4,w:.6,h:.6,o:1}],r.types.none=[{x:.4,y:.4,w:.6,h:.6,o:1}],r.types.pop=[{x:1,y:1,w:0,h:0,o:1},{x:.9,y:.9,w:.1,h:.1,o:1},{x:.8,y:.8,w:.2,h:.2,o:1},{x:.7,y:.7,w:.3,h:.3,o:1},{x:.6,y:.6,w:.4,h:.4,o:1},{x:.5,y:.5,w:.5,h:.5,o:1},{x:.4,y:.4,w:.6,h:.6,o:1}],r.types.popFade=[{x:.75,y:.75,w:0,h:0,o:0},{x:.65,y:.65,w:.1,h:.1,o:.2},{x:.6,y:.6,w:.2,h:.2,o:.4},{x:.55,y:.55,w:.3,h:.3,o:.6},{x:.5,y:.5,w:.4,h:.4,o:.8},{x:.45,y:.45,w:.5,h:.5,o:.9},{x:.4,y:.4,w:.6,h:.6,o:1}],r.types.slide=[{x:.4,y:1,w:.6,h:.6,o:1},{x:.4,y:.9,w:.6,h:.6,o:1},{x:.4,y:.9,w:.6,h:.6,o:1},{x:.4,y:.8,w:.6,h:.6,o:1},{x:.4,y:.7,w:.6,h:.6,o:1},{x:.4,y:.6,w:.6,h:.6,o:1},{x:.4,y:.5,w:.6,h:.6,o:1},{x:.4,y:.4,w:.6,h:.6,o:1}],r.run=function(n,i,u,f){var e=r.types[lt()?"none":t.animation];if(f=u===!0?typeof f!="undefined"?f:e.length-1:typeof f!="undefined"?f:0,i=i?i:function(){},f<e.length&&f>=0)b[t.type](et(n,e[f])),rt=setTimeout(function(){f=u?f-1:f+1;r.run(n,i,u,f)},r.duration),p.setIcon(l);else{i();return}},ft(),{badge:ot,video:ht,image:st,webcam:ct,reset:s.reset,browser:{supported:e.supported}}};typeof define!="undefined"&&define.amd?define([],function(){return n}):typeof module!="undefined"&&module.exports?module.exports=n:this.Favico=n}()