/* @license Copyright (C) Exontrol. All rights reserved. */ !function(){"use strict";function e(){var e,t,n=function(){},o=run.contentWindow,i=o.requestAnimationFrame||o.webkitRequestAnimationFrame||o.mozRequestAnimationFrame||o.oRequestAnimationFrame||o.msRequestAnimationFrame,r=o.cancelAnimationFrame||o.webkitCancelAnimationFrame||o.mozCancelAnimationFrame||o.oCancelAnimationFrame||o.msCancelAnimationFrame;if(i&&r)for(t=i.call(o,n),e=Math.max(0,t-16);e<=t;e++)r.call(o,e);for(t=setTimeout.call(o,n),e=Math.max(0,t-16);e<=t;e++)clearTimeout.call(o,e);for(t=setInterval.call(o,n),e=Math.max(0,t-16);e<=t;e++)clearInterval.call(o,e)}function t(){return run.contentDocument||run.contentWindow.document}function n(e,t,n){n=n||1;var o,i={w:~~((run.contentWindow.innerWidth-J)/t),h:~~((run.contentWindow.innerHeight-J)/n)};return(o=Z[e])&&(null!=o[0]&&(i.w=o[0]),null!=o[1]&&(i.h=o[1])),i}function o(){T(code),i()}function i(){function e(e){var t,n;return(t=e.exontrol)&&(t=t.oCC)&&(t=t.rgC)&&t.forEach(function(e){n||(n=function(e){return e.oT||e}(e).constructor.type)}),n}var o,i,r=t(),c=function(){for(var e,t=r.getElementsByTagName("canvas"),n=[],o=0,i=t.length;o0&&(1==He?n=g():2==He&&(n=x()),n=L(we,Ae[He],'class="view"')+L(me,n.trim(),'spellcheck="false" readonly style="width: '+(window.innerWidth-Ye-2*J)+"px;height: "+(window.innerHeight-2*J)+'px"')),n}()),c.close(),!hasError()&&m()}e(),clearTimeout(P),(o=~~o)&&!Te||(o?(B=!0,P=setTimeout(i,o)):i())}function u(){B=!0,s(),O(),setTimeout(function(){p(code)})}function a(){return code.value||code.innerText}function d(e){var t=a();code["value"in code?"value":"innerText"]=e,E(),H(t!=a())}function h(e,t){return null==e&&(e=a()),t=t||_(e),d(e=t.c),"o"in t&&(N=t.o,w(t.d),m()),e}function f(){var e=desc.innerHTML.replace(/\n/g,ce).trim();return e&&e!=Ie&&e||""}function w(e){null!=e&&(desc.innerHTML=e),desc.style.minHeight=f()||ke?V(Xe):"initial",l(Qe)}function m(){!function(){var e,t,n=Le,o=function(){var e="";N&&(e+=N.t&&N.t[0]||"",N.e&&N.e[0]&&(e+=e?", ":"",e+="E"+N.e[0]));return e}();(F||o)&&(~(t=n.indexOf("-"))&&(n=n.substr(0,t).trim()),e=n,F?(n=F+"/JS",o&&(n+=" ("+o+")"),n+=" | "+e):o&&(n+=" - "+o));X(function(){window.top.document.title=n})}(),p(code)}function p(e,t){if(!B){var n,o,i,r,c,l=N&&N.k,s=[],u=t;t&&function(){if(t){if(l){var e=l.indexOf(t);~e?(l.splice(e,1),l.length||(l=null)):l.push(t)}else l=[t];(N=N||{}).k=l}}(),l&&(document.activeElement==code&&(c={s:e.selectionStart,e:e.selectionEnd}),n=a(),r=~l.indexOf(n.substr(e.selectionStart,e.selectionEnd-e.selectionStart)),l.forEach(function(t){function c(e){return~e&&(/[^\w]/.test(t)||(!e||!/\w/.test(n.charAt(e-1)))&&(e+t.length>=n.length||!/\w/g.test(n.charAt(e+t.length))))}if(t&&~(o=n.indexOf(t)))for(!r&&c(o)&&(r=!0,K=u,setSelCol(Be),e.setSelectionRange(o,o+t.length),e.ensureVisibleSel());~o;)i=o,o+=t.length,c(i)&&s.push.apply(s,function(e,t,n,o){function i(e,t){return[~~e[0],~~e[1],~~(t[0]-e[0]),~~e[3],o]}var r,c,l,s=M(e,t),u=M(e,n),a=[];if(s[1]==u[1])a.push(i(s,u));else{r=e.value,c=C(r,t),l=C(r,n),a.push(i(s,M(e,b(r,c.l,S(r,c.l).length+1))));for(var d=c.l+1;dcode.clientHeight&&t++,e="";for(var n=0;n"+(n+1)+"";lineno.innerHTML=e}}function b(e,t,n){for(var o=0,i=1,r=0;~r&&i=0&&r<=t;)i=o,(r=e.indexOf(re,r))>=0&&(o=r+re.length,r=l[0]&&l[0]+l[2]>=i[0]&&i[1]+i[3]>=l[1]&&l[1]+l[3]>=i[1])&&(t=Math.max(i[0],l[0]),n=Math.max(i[1],l[1]),i=[t,n,Math.min(i[0]+i[2],l[0]+l[2])-t,Math.min(i[1]+i[3],l[1]+l[3])-n],e.style.left=V(i[0]),e.style.width=V(i[2]),e.style.top=V(i[1]),e.style.height=V(i[3])),e.style.visibility=o?"":"hidden"})}function k(e){e&&(e.exkeys&&e.exkeys.forEach(function(e){e.remove()}),te(e,je,!0),e.exkeys=null)}function R(){var e="";return X(function(){e=window.top.location.href},window,128,window.setError),e}function H(e,t){W=e,te(vsplit,Ne,!W),W&&(t||null==t)&&Te&&s(Re)}function A(e){return null!=e?String(e):""}function L(e,t,n){var o="",i=1==t;return t=i?"":A(t),(i||t)&&((n=A(n))&&(n=" "+n),o="<"+e+n+">",i||t.charAt(0)==re||(o+=re),o+=t,i||t.charAt(t.length-1)==re||(o+=re),o+="",i&&(o+="\n")),o}function I(){window.frameElement&&(window.frameElement.height=window.parent.innerHeight-58)}function O(){window.parent.onexample&&window.parent.onexample(g())}var F,N,W,j,K,B,P,z,D=comrun.RUR,q=comrun.URLParam,Y=comrun.SEP,X=comrun.tryC,Q=comrun.getLocalItem,U=comrun.setLocalItem,V=comrun.suffiPX,J=comrun.border,G=comrun.lib,Z=comrun.size,$=comrun.feMU,_=comrun.splitQ,ee=comrun.toA,te=comrun.uCL,ne=comrun.buildQ,oe=comrun.buildQI,ie=comrun.INLINECOMMENT,re=comrun.EOL,ce="
",le="html",se="head",ue="body",ae="canvas",de="contentEditable",he="Your browser does not support the canvas tag.",fe="script",we="span",me="textarea",pe=/new\s*exontrol\.(.*?)\s*\(\s*['"](.*?)['"]/gm,ge=/new\s*exontrol\.(.*?)\s*\(/gm,ve=/exontrol\.([^.(]*)[.(]/gm,xe=/^[ \t]*/,ye=/["']([^\\\/#A-Z0-9<>.].([^<>()"'`,:|?*\[\]\n]*?)[\\\/].*?|[^<>()"'`,:|?*\[\]\n]*?\.(csv|xml))["']/g,Ee="",be="=n[0]&&e=n[1]&&tthis.offsetHeight-36?(z&&z.n&&null!=z.i&&(z.n=!1,z.i++),n=(z=z||function(){var e=document.getElementById("tricks");return e&&(e=e.innerHTML.trim())&&(e=e.split("\n")),e||[]}())[z.i=(z.i||0)%z.length].trim()):z&&(z.n=!0)),this.setAttribute("title",n||"")},code.ensureVisibleSel=function(){var e=M(this,this.selectionEnd);this.scrollLeft=e[0]+e[2]+8-this.clientWidth,this.scrollTop=e[1]+e[3]-this.clientHeight},vsplit.onpointerdown=vsplit.onmousedown=function(e){D.Do(e,function(e){if(4==e.drag.status)e.offsetX<0&&(u(),(e.ctrlKey||e.altKey||e.shiftKey)&&(Te=!Te));else{var t=Math.max(0,Ye+e.drag.offset.x/window.devicePixelRatio);c(t),7==e.drag.status&&(Ye=t)}})},hsplit.onpointerdown=hsplit.onmousedown=function(e){D.Do(e,function(e){var t=Math.max(0,Qe+e.drag.offset.y/window.devicePixelRatio);l(t),7==e.drag.status&&(Qe=t)})},hsplit.oncontextmenu=vsplit.oncontextmenu=function(){return!1},run.onload=function(){H(!1);var e=t(),n=document.getElementById("style-run");n&&n.content&&e.head.appendChild(n.content.cloneNode(!0)),i()},run.contentWindow.console.log=function(e){return function(){e.apply(this,arguments),setOutput.apply(window,arguments)}}(run.contentWindow.console.log),run.eval=function(e){var n,o=t();(n=o.createElement(fe)).appendChild(o.createTextNode("console.log("+e+")")),o.body.appendChild(n),n.remove()},output.oncontextmenu=function(e){return window.xOutput(),window.showOutput(!1),Y(e)},code.style.lineHeight=lineno.style.lineHeight="1.4em",lineno.style.font=getComputedStyle(code).font,showOutput(!1),showError(!1),I(),function(){var e=Q(De)||"",t=new q(R()).Get(Oe);t&&X(function(){e=atob(t)}),Ye=~~((~~Q(Pe)||384||Ye+1)-1),Qe=~~((~~Q(ze)||Qe+1)-1),Te=~~Q(qe),v(e)}(),E(),l(Qe),c(Ye),s()},window.onbeforeunload=function(){U(Pe,Ye+1),U(ze,Qe+1),U(qe,~~Te),U(De,g())},window.onresize=function(){I(),l(Qe),c(Ye),o()},window.onkeydown=function(t){function n(e){He!=e&&(He=e,s())}function o(e,t){ke!=e&&(ke=e,desc.setAttribute(de,e?"true":"false"),w(),te(desc,Fe,!e),(e?desc:code).focus(),!e&&O(),t&&window.top.history.replaceState(null,null,x()))}var i=!1;switch(t.keyCode){case 27:e(),o(!1,!1),n(0);break;case 48:case 49:case 50:case 51:(i=t.ctrlKey||t.altKey)&&n(t.keyCode-48);break;case 69:(i=t.ctrlKey)&&o(!ke,ke);break;case 83:(i=t.ctrlKey)&&u()}if(i)return Y(t)},window.setError=function(t,n,o,i){var r,c,l,s,u,d,h="",f=null!=o;e(),ee(document.getElementsByClassName("linerr")).forEach(function(e){te(e,"linerr",!0)}),xSelCol(),k(code),t&&(h=t,f&&((u=y(c=a()))&&(f=(s=c.match(//i))&&c.substr(s.index).match(/<\/script\s*>/i))&&(d=C(c,s.index+s[0].length),i+=1==o?d.c-1:0,o+=d.l-1),o--,u||c.charAt(0)==re||o--,h+=" on line "+(o+1),f&&(r=lineno.children.item(o))&&(te(r,"linerr"),code.setSelectionRange&&(setSelCol("style-sel-err"),l=b(c,o+1,i),code.setSelectionRange(l,l+(/\w/.test(c.charAt(l))&&(c.substr(l).match(/\w\w*/)||[])[0].length||0)),code.ensureVisibleSel(),code.focus()),window.parent.extnfo=window.parent.extnfo||{},window.parent.extnfo.err=(window.parent.extnfo.err||0)+1))),showError(error.innerHTML=h),this.parent&&this.parent.setError&&this.parent.setError.apply(this.parent,arguments)},window.xError=function(){window.setError()},window.hasError=function(){return document.getElementsByClassName("linerr").length},window.showError=function(e){error.style.visibility=e?"visible":"hidden"},window.showOutput=function(e){output.style.visibility=e?"visible":"hidden"},window.setOutput=function(){for(var e,t="",n=output.innerHTML.trim(),o=0,i=arguments.length;o