(function(){function m(a,b){b=b||window;g(a.getElementsByTagName("script"),function(a){a.hasAttribute("type")&&"text/javascript"!==a.type&&"application/javascript"!==a.type||a.tracyEvaluated||((b.execScript||function(a){b.eval.call(b,a)})(a.innerHTML),a.tracyEvaluated=!0)})}function p(a,b){for(;a;){if(a===b)return;a=a.parentNode}return!0}function s(a,b){var c=document.documentElement,d,e,f,q,g;b=b||{};var l=function(){r&&(k(a,{right:e-q,bottom:f-g}),requestAnimationFrame(l))},n=function(c){if(0===
c.buttons)return m(c);d||(b.draggedClass&&a.classList.add(b.draggedClass),b.start&&b.start(c,a),d=!0);q=c.clientX;g=c.clientY;return!1},m=function(e){d&&(b.draggedClass&&a.classList.remove(b.draggedClass),b.stop&&b.stop(e,a));r=null;c.removeEventListener("mousemove",n);c.removeEventListener("mouseup",m);return!1};(b.handle||a).addEventListener("mousedown",function(b){b.preventDefault();b.stopPropagation();if(r)return m(b);var k=h(a);q=b.clientX;g=b.clientY;e=k.right+q;f=k.bottom+g;r=!0;d=!1;c.addEventListener("mousemove",
n);c.addEventListener("mouseup",m);requestAnimationFrame(l)});(b.handle||a).addEventListener("click",function(a){d&&a.stopImmediatePropagation()})}function n(a){for(var b={left:a.offsetLeft,top:a.offsetTop};a=a.offsetParent;)b.left+=a.offsetLeft,b.top+=a.offsetTop;return b}function k(a,b){var c=document.documentElement,d="BackCompat"===document.compatMode?window.innerHeight:c.clientHeight;a.style.right=Math.min(Math.max(b.right,0),c.clientWidth-a.offsetWidth)+"px";a.style.bottom=Math.min(Math.max(b.bottom,
0),d-a.offsetHeight)+"px"}function h(a){return{left:a.offsetLeft,top:a.offsetTop,right:a.style.right?parseInt(a.style.right,10):0,bottom:a.style.bottom?parseInt(a.style.bottom,10):0,width:a.offsetWidth,height:a.offsetHeight}}function g(a,b){Array.prototype.forEach.call(a,b)}Tracy=window.Tracy||{};var l=document.getElementById("tracy-debug");Tracy.getAjaxHeader=function(){return l.dataset.id};var d=Tracy.DebugPanel=function(a){this.id=a;this.elem=document.getElementById(this.id);this.elem.Tracy=this.elem.Tracy||
{}};d.PEEK="tracy-mode-peek";d.FLOAT="tracy-mode-float";d.WINDOW="tracy-mode-window";d.FOCUSED="tracy-focused";d.zIndex=2E4;d.prototype.init=function(){var a=this,b=this.elem;b.innerHTML=b.dataset.tracyContent;Tracy.Dumper.init(this.dumps,b);delete b.dataset.tracyContent;delete this.dumps;m(b);s(b,{handle:b.querySelector("h1"),stop:function(){a.toFloat()}});b.addEventListener("mouseover",function(b){p(b.relatedTarget,this)&&a.focus()});b.addEventListener("mouseout",function(b){p(b.relatedTarget,this)&&
a.blur()});b.addEventListener("click",function(){a.oldPosition=h(b)});b.addEventListener("tracy-toggle",function(){if(a.oldPosition){var c=h(b);k(b,{right:c.right-c.width+a.oldPosition.width,bottom:c.bottom-c.height+a.oldPosition.height});a.oldPosition=null}});g(b.querySelectorAll(".tracy-icons a"),function(b){b.addEventListener("click",function(b){"close"===this.rel?a.toPeek():a.toWindow();b.preventDefault()})});this.is("tracy-ajax")||Tracy.Toggle.persist(b)};d.prototype.is=function(a){return this.elem.classList.contains(a)};
d.prototype.focus=function(a){var b=this.elem;this.is(d.WINDOW)?b.Tracy.window.focus():(clearTimeout(b.Tracy.displayTimeout),b.Tracy.displayTimeout=setTimeout(function(){b.classList.add(d.FOCUSED);b.style.display="block";b.style.zIndex=d.zIndex++;a&&a()},50))};d.prototype.blur=function(){var a=this.elem;a.classList.remove(d.FOCUSED);this.is(d.PEEK)&&(clearTimeout(a.Tracy.displayTimeout),a.Tracy.displayTimeout=setTimeout(function(){a.style.display="none"},50))};d.prototype.toFloat=function(){this.elem.classList.remove(d.WINDOW);
this.elem.classList.remove(d.PEEK);this.elem.classList.add(d.FLOAT);this.elem.style.display="block";this.reposition()};d.prototype.toPeek=function(){this.elem.classList.remove(d.WINDOW);this.elem.classList.remove(d.FLOAT);this.elem.classList.add(d.PEEK);this.elem.style.display="none"};d.prototype.toWindow=function(){function a(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}var b=n(this.elem);b.left+="number"===typeof window.screenLeft?window.screenLeft:window.screenX+
10;b.top+="number"===typeof window.screenTop?window.screenTop:window.screenY+50;var c=window.open("",this.id.replace(/-/g,"_"),"left="+b.left+",top="+b.top+",width="+this.elem.offsetWidth+",height="+this.elem.offsetHeight+",resizable=yes,scrollbars=yes");if(!c)return!1;b=c.document;b.write('<!DOCTYPE html><meta charset="utf-8"><link rel="stylesheet" href="'+a(document.getElementById("tracy-debug-style").href)+'"><script src="'+a(document.getElementById("tracy-debug-script").src)+'" onload="Tracy.Dumper.init()" async>\x3c/script><body id="tracy-debug">');
b.body.innerHTML='<div class="tracy-panel tracy-mode-window" id="'+this.elem.id+'">'+this.elem.innerHTML+"</div>";m(b.body,c);this.elem.querySelector("h1")&&(b.title=this.elem.querySelector("h1").textContent);var e=this;c.addEventListener("beforeunload",function(){e.toPeek();c.close()});b.addEventListener("keyup",function(a){27!==a.keyCode||(a.shiftKey||a.altKey||a.ctrlKey||a.metaKey)||c.close()});this.elem.style.display="none";this.elem.classList.remove(d.FLOAT);this.elem.classList.remove(d.PEEK);
this.elem.classList.add(d.WINDOW);this.elem.Tracy.window=c;return!0};d.prototype.reposition=function(){var a=h(this.elem);a.width&&k(this.elem,{right:a.right,bottom:a.bottom})};d.prototype.savePosition=function(){var a=h(this.elem);this.is(d.WINDOW)?localStorage.setItem(this.id,JSON.stringify({window:!0})):a.width?localStorage.setItem(this.id,JSON.stringify({right:a.right,bottom:a.bottom})):localStorage.removeItem(this.id)};d.prototype.restorePosition=function(){var a=JSON.parse(localStorage.getItem(this.id));
a?a.window?(this.init(),this.toWindow()||this.toFloat()):this.elem.dataset.tracyContent&&(this.init(),this.toFloat(),k(this.elem,a)):this.elem.classList.add(d.PEEK)};var f=Tracy.DebugBar=function(){};f.prototype.id="tracy-debug-bar";f.prototype.init=function(){this.elem=document.getElementById(this.id);s(this.elem,{draggedClass:"tracy-dragged"});this.initTabs();this.restorePosition()};f.prototype.initTabs=function(){var a=this,b=this.elem;g(b.getElementsByTagName("a"),function(c){c.addEventListener("click",
function(b){if("close"===this.rel)a.close();else if(this.rel){var c=e.panels[this.rel];b.shiftKey?(c.toFloat(),c.toWindow()):c.is(d.FLOAT)?c.toPeek():(c.toFloat(),k(c.elem,{right:h(c.elem).right+Math.round(100*Math.random())+20,bottom:h(c.elem).bottom+Math.round(100*Math.random())+20}))}b.preventDefault()});c.addEventListener("mouseover",function(a){if(p(a.relatedTarget,this)&&this.rel&&"close"!==this.rel&&!b.classList.contains("tracy-dragged")){var c=e.panels[this.rel],f=this;c.focus(function(){if(c.is(d.PEEK)){c.elem.dataset.tracyContent&&
c.init();var a=h(c.elem);k(c.elem,{right:a.right-n(f).left+a.width-h(f).width-4+n(c.elem).left,bottom:a.bottom-n(b).top+a.height+4+n(c.elem).top})}})}});c.addEventListener("mouseout",function(a){p(a.relatedTarget,this)&&(this.rel&&"close"!==this.rel&&!b.classList.contains("tracy-dragged"))&&e.panels[this.rel].blur()})});this.autoHideLabels()};f.prototype.autoHideLabels=function(){g(this.elem.children,function(a){for(var b=a.querySelectorAll(".tracy-label"),c=b.length-1;0<=c&&40<=a.clientHeight;c--)b.item(c).hidden=
!0})};f.prototype.close=function(){document.getElementById("tracy-debug").style.display="none"};f.prototype.savePosition=function(){var a=h(document.getElementById(this.id));localStorage.setItem(this.id,JSON.stringify({right:a.right,bottom:a.bottom}))};f.prototype.restorePosition=function(){var a=JSON.parse(localStorage.getItem(this.id));a&&k(document.getElementById(this.id),a)};var e=Tracy.Debug={};e.bar=new f;e.panels={};e.init=function(a,b){if(!document.documentElement.dataset)throw Error("Tracy requires IE 11+");
l.innerHTML=a;m(l);Tracy.Dumper.init();l.style.display="block";e.bar.init();g(document.querySelectorAll(".tracy-panel"),function(a){e.panels[a.id]=new d(a.id);e.panels[a.id].dumps=b;e.panels[a.id].restorePosition()});e.captureWindow();e.captureAjax()};e.loadAjax=function(a,b){g(l.querySelectorAll(".tracy-panel.tracy-ajax"),function(a){e.panels[a.id].savePosition();delete e.panels[a.id];a.parentNode.removeChild(a)});var c=document.getElementById("tracy-ajax-bar");c&&c.parentNode.removeChild(c);l.insertAdjacentHTML("beforeend",
a);m(l);c=document.getElementById("tracy-ajax-bar");document.getElementById(f.prototype.id).appendChild(c);g(document.querySelectorAll(".tracy-panel"),function(a){e.panels[a.id]||(e.panels[a.id]=new d(a.id),e.panels[a.id].dumps=b,e.panels[a.id].restorePosition())});e.bar.initTabs(c)};e.captureWindow=function(){window.addEventListener("resize",function(){var a=document.getElementById(f.prototype.id);k(a,{right:h(a).right,bottom:h(a).bottom});for(var b in e.panels)e.panels[b].reposition()});window.addEventListener("unload",
function(){e.bar.savePosition();for(var a in e.panels)e.panels[a].savePosition()})};e.captureAjax=function(){function a(a){a.getResponseHeader=d;a.getAllResponseHeaders=f;a.getAllResponseHeaders().match(/^X-Tracy-Ajax: 1/mi)&&e.loadScript(document.getElementById("tracy-debug-script").src.split("?")[0]+"?_tracy_bar=content-ajax."+b+"&XDEBUG_SESSION_STOP=1&XDEBUG_PROFILE=0&XDEBUG_TRACE=0&v="+Math.random())}var b=Tracy.getAjaxHeader();if(b){var c=XMLHttpRequest.prototype.open,d=XMLHttpRequest.prototype.getResponseHeader,
f=XMLHttpRequest.prototype.getAllResponseHeaders;XMLHttpRequest.prototype.open=function(){c.apply(this,arguments);(!1!==window.TracyAutoRefresh&&0>=arguments[1].indexOf("//")||0===arguments[1].indexOf(location.origin+"/"))&&this.setRequestHeader("X-Tracy-Ajax",b)};XMLHttpRequest.prototype.getResponseHeader=function(){a(this);return d.apply(this,arguments)};XMLHttpRequest.prototype.getAllResponseHeaders=function(){a(this);return f.call(this)}}};e.loadScript=function(a){e.scriptElem&&e.scriptElem.parentNode.removeChild(e.scriptElem);
e.scriptElem=document.createElement("script");e.scriptElem.src=a;document.documentElement.appendChild(e.scriptElem)};var r})();