
(()=>{
if(window.navigator.userAgent.includes('ChatiumWebView') ||
   $('script[src*="getcourse_webview"]').length || 
   (window.location.pathname.indexOf('/pl/teach/control/lesson/webview') > -1)) { 
 if(typeof window.chatium_script_already_run !== "undefined" || typeof remakeTopMenu !== "undefined" || $('.gc-account-leftbar').length) return false;
 window.chatium_script_already_run = true;
 $('body').css('padding','0 15px 80px 15px');
 let currentLayoutID;
 if ((currentLayoutID = /\/pl\/layout\/(\d+)/.exec(document.currentScript.src)) !== null) currentLayoutID = currentLayoutID[1];
 JSinjection("/pl/cms/layout/js?hash&bundle=0&id="+currentLayoutID);
 function JSinjection(fileName, callback) {
  var script = document.createElement( "script" )
  script.type = "text/javascript";
  if(typeof callback != "undefined") {
    if(script.readyState) {  // only required for IE <9
      script.onreadystatechange = function() {
        if ( script.readyState === "loaded" || script.readyState === "complete" ) {
          script.onreadystatechange = null;
          callback();
        }
      };
    } else {  //Others
      script.onload = callback;
    }
  }
  script.src = fileName;
  document.getElementsByTagName( "head" )[0].appendChild( script );
 }

  "use strict";(function(a,b){if(typeof define==="function"&&define.amd){define(b)}else{if(typeof exports==="object"){module.exports=b()}else{a.ResizeSensor=b()}}}(typeof window!=="undefined"?window:this,function(){if(typeof window==="undefined"){return null}var b=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();var h=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||function(i){return b.setTimeout(i,20)};var g=b.cancelAnimationFrame||b.mozCancelAnimationFrame||b.webkitCancelAnimationFrame||function(i){b.clearTimeout(i)};function f(n,p){var m=Object.prototype.toString.call(n);var o=("[object Array]"===m||("[object NodeList]"===m)||("[object HTMLCollection]"===m)||("[object Object]"===m)||("undefined"!==typeof jQuery&&n instanceof jQuery)||("undefined"!==typeof Elements&&n instanceof Elements));var l=0,k=n.length;if(o){for(;l<k;l++){p(n[l])}}else{p(n)}}function c(i){if(!i.getBoundingClientRect){return{width:i.offsetWidth,height:i.offsetHeight}}var j=i.getBoundingClientRect();return{width:Math.round(j.width),height:Math.round(j.height)}}function e(i,j){Object.keys(j).forEach(function(k){i.style[k]=j[k]})}var d=function(i,m){var k=0;function l(){var p=[];this.add=function(q){p.push(q)};var o,n;this.call=function(q){for(o=0,n=p.length;o<n;o++){p[o].call(this,q)}};this.remove=function(r){var q=[];for(o=0,n=p.length;o<n;o++){if(p[o]!==r){q.push(p[o])}}p=q};this.length=function(){return p.length}}function j(p,D){if(!p){return}if(p.resizedAttached){p.resizedAttached.add(D);return}p.resizedAttached=new l();p.resizedAttached.add(D);p.resizeSensor=document.createElement("div");p.resizeSensor.dir="ltr";p.resizeSensor.className="resize-sensor";var B={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"};var r={position:"absolute",left:"0px",top:"0px",transition:"0s"};e(p.resizeSensor,B);var n=document.createElement("div");n.className="resize-sensor-expand";e(n,B);var y=document.createElement("div");e(y,r);n.appendChild(y);var x=document.createElement("div");x.className="resize-sensor-shrink";e(x,B);var E=document.createElement("div");e(E,r);e(E,{width:"200%",height:"200%"});x.appendChild(E);p.resizeSensor.appendChild(n);p.resizeSensor.appendChild(x);p.appendChild(p.resizeSensor);var u=window.getComputedStyle(p);var H=u?u.getPropertyValue("position"):null;if("absolute"!==H&&"relative"!==H&&"fixed"!==H&&"sticky"!==H){p.style.position="relative"}var v=false;var G=0;var z=c(p);var q=0;var C=0;var t=true;k=0;var o=function(){var J=p.offsetWidth;var I=p.offsetHeight;y.style.width=(J+10)+"px";y.style.height=(I+10)+"px";n.scrollLeft=J+10;n.scrollTop=I+10;x.scrollLeft=J+10;x.scrollTop=I+10};var F=function(){if(t){var I=p.offsetWidth===0&&p.offsetHeight===0;if(I){if(!k){k=h(function(){k=0;F()})}return}else{t=false}}o()};p.resizeSensor.resetSensor=F;var s=function(){G=0;if(!v){return}q=z.width;C=z.height;if(p.resizedAttached){p.resizedAttached.call(z)}};var w=function(){z=c(p);v=z.width!==q||z.height!==C;if(v&&!G){G=h(s)}F()};var A=function(K,J,I){if(K.attachEvent){K.attachEvent("on"+J,I)}else{K.addEventListener(J,I)}};A(n,"scroll",w);A(x,"scroll",w);k=h(function(){k=0;F()})}f(i,function(n){j(n,m)});this.detach=function(n){if(!k){g(k);k=0}d.detach(i,n)};this.reset=function(){i.resizeSensor.resetSensor()}};d.reset=function(i){f(i,function(j){j.resizeSensor.resetSensor()})};d.detach=function(i,j){f(i,function(k){if(!k){return}if(k.resizedAttached&&typeof j==="function"){k.resizedAttached.remove(j);if(k.resizedAttached.length()){return}}if(k.resizeSensor){if(k.contains(k.resizeSensor)){k.removeChild(k.resizeSensor)}delete k.resizeSensor;delete k.resizedAttached}})};if(typeof MutationObserver!=="undefined"){var a=new MutationObserver(function(k){for(var n in k){if(k.hasOwnProperty(n)){var l=k[n].addedNodes;for(var m=0;m<l.length;m++){if(l[m].resizeSensor){d.reset(l[m])}}}}});document.addEventListener("DOMContentLoaded",function(i){a.observe(document.body,{childList:true,subtree:true})})}return d}));
  !function(e,t){"function"==typeof define&&define.amd?define(["./ResizeSensor.js"],t):"object"==typeof exports?module.exports=t(require("./ResizeSensor.js")):(e.ElementQueries=t(e.ResizeSensor),e.ElementQueries.listen())}("undefined"!=typeof window?window:this,function(e){var t=function(){function t(e){e||(e=document.documentElement);var t=window.getComputedStyle(e,null).fontSize;return parseFloat(t)||16}function n(e){if(!e.getBoundingClientRect)return{width:e.offsetWidth,height:e.offsetHeight};var t=e.getBoundingClientRect();return{width:Math.round(t.width),height:Math.round(t.height)}}function i(e,n){var i=n.split(/\d/),r=i[i.length-1];switch(n=parseFloat(n),r){case"px":return n;case"em":return n*t(e);case"rem":return n*t();case"vw":return n*document.documentElement.clientWidth/100;case"vh":return n*document.documentElement.clientHeight/100;case"vmin":case"vmax":var s=document.documentElement.clientWidth/100,o=document.documentElement.clientHeight/100,a=Math["vmin"===r?"min":"max"];return n*a(s,o);default:return n}}function r(e,t){this.element=e;var r,s,o,a,l,u,d,m,c=["min-width","min-height","max-width","max-height"];this.call=function(){o=n(this.element),u={};for(r in f[t])f[t].hasOwnProperty(r)&&(s=f[t][r],a=i(this.element,s.value),l="width"===s.property?o.width:o.height,m=s.mode+"-"+s.property,d="","min"===s.mode&&l>=a&&(d+=s.value),"max"===s.mode&&a>=l&&(d+=s.value),u[m]||(u[m]=""),d&&-1===(" "+u[m]+" ").indexOf(" "+d+" ")&&(u[m]+=" "+d));for(var e in c)c.hasOwnProperty(e)&&(u[c[e]]?this.element.setAttribute(c[e],u[c[e]].substr(1)):this.element.removeAttribute(c[e]))}}function s(t,n){t.elementQueriesSetupInformation||(t.elementQueriesSetupInformation=new r(t,n)),t.elementQueriesSensor||(t.elementQueriesSensor=new e(t,function(){t.elementQueriesSetupInformation.call()}))}function o(e,t,n,i){if("undefined"==typeof f[e]){f[e]=[];var r=p.length;h.innerHTML+="\n"+e+" {animation: 0.1s element-queries;}",h.innerHTML+="\n"+e+" > .resize-sensor {min-width: "+r+"px;}",p.push(e)}f[e].push({mode:t,property:n,value:i})}function a(e){var t;if(document.querySelectorAll&&(t=e?e.querySelectorAll.bind(e):document.querySelectorAll.bind(document)),t||"undefined"==typeof $$||(t=$$),t||"undefined"==typeof jQuery||(t=jQuery),!t)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return t}function l(e){var t=a(e);for(var n in f)if(f.hasOwnProperty(n))for(var i=t(n,e),r=0,o=i.length;o>r;r++)s(i[r],n)}function u(t){function n(){var e,n=!1;for(e in i)i.hasOwnProperty(e)&&r[e].minWidth&&t.offsetWidth>r[e].minWidth&&(n=e);if(n||(n=o),a!==n)if(l[n])i[a].style.display="none",i[n].style.display="block",a=n;else{var u=new Image;u.onload=function(){i[n].src=s[n],i[a].style.display="none",i[n].style.display="block",l[n]=!0,a=n},u.src=s[n]}else i[n].src=s[n]}var i=[],r=[],s=[],o=0,a=-1,l=[];for(var u in t.children)if(t.children.hasOwnProperty(u)&&t.children[u].tagName&&"img"===t.children[u].tagName.toLowerCase()){i.push(t.children[u]);var d=t.children[u].getAttribute("min-width")||t.children[u].getAttribute("data-min-width"),m=t.children[u].getAttribute("data-src")||t.children[u].getAttribute("url");s.push(m);var c={minWidth:d};r.push(c),d?t.children[u].style.display="none":(o=i.length-1,t.children[u].style.display="block")}a=o,t.resizeSensorInstance=new e(t,n),n()}function d(){for(var e=a(),t=e("[data-responsive-image],[responsive-image]"),n=0,i=t.length;i>n;n++)u(t[n])}function m(e){var t,n,i,r;for(e=e.replace(/'/g,'"');null!==(t=y.exec(e));)for(n=t[1]+t[3],i=t[2];null!==(r=g.exec(i));)o(n,r[1],r[2],r[3])}function c(e){var t="";if(e)if("string"==typeof e)e=e.toLowerCase(),(-1!==e.indexOf("min-width")||-1!==e.indexOf("max-width"))&&m(e);else for(var n=0,i=e.length;i>n;n++)1===e[n].type?(t=e[n].selectorText||e[n].cssText,-1!==t.indexOf("min-height")||-1!==t.indexOf("max-height")?m(t):(-1!==t.indexOf("min-width")||-1!==t.indexOf("max-width"))&&m(t)):4===e[n].type?c(e[n].cssRules||e[n].rules):3===e[n].type&&e[n].styleSheet.hasOwnProperty("cssRules")&&c(e[n].styleSheet.cssRules)}var h,f={},p=[],y=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,g=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim,v=!1;this.init=function(){var t="animationstart";"undefined"!=typeof document.documentElement.style.webkitAnimationName?t="webkitAnimationStart":"undefined"!=typeof document.documentElement.style.MozAnimationName?t="mozanimationstart":"undefined"!=typeof document.documentElement.style.OAnimationName&&(t="oanimationstart"),document.body.addEventListener(t,function(t){var n=t.target,i=n&&window.getComputedStyle(n,null),r=i&&i.getPropertyValue("animation-name"),o=r&&-1!==r.indexOf("element-queries");if(o){n.elementQueriesSensor=new e(n,function(){n.elementQueriesSetupInformation&&n.elementQueriesSetupInformation.call()});var a=window.getComputedStyle(n.resizeSensor,null),l=a.getPropertyValue("min-width");l=parseInt(l.replace("px","")),s(t.target,p[l])}}),v||(h=document.createElement("style"),h.type="text/css",h.innerHTML="[responsive-image] > img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",h.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(h),v=!0);for(var n=0,i=document.styleSheets.length;i>n;n++)try{document.styleSheets[n].href&&0===document.styleSheets[n].href.indexOf("file://")&&console.warn("CssElementQueries: unable to parse local css files, "+document.styleSheets[n].href),c(document.styleSheets[n].cssRules||document.styleSheets[n].rules||document.styleSheets[n].cssText)}catch(r){}d()},this.findElementQueriesElements=function(e){l(e)},this.update=function(){this.init()}};t.update=function(){t.instance.update()},t.detach=function(e){e.elementQueriesSetupInformation?(e.elementQueriesSensor.detach(),delete e.elementQueriesSetupInformation,delete e.elementQueriesSensor):e.resizeSensorInstance&&(e.resizeSensorInstance.detach(),delete e.resizeSensorInstance)},t.init=function(){t.instance||(t.instance=new t),t.instance.init()};var n=function(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",e,!1);else if(/KHTML|WebKit|iCab/i.test(navigator.userAgent))var t=setInterval(function(){/loaded|complete/i.test(document.readyState)&&(e(),clearInterval(t))},10);else window.onload=e};return t.findElementQueriesElements=function(e){t.instance.findElementQueriesElements(e)},t.listen=function(){n(t.init)},t});

  ElementQueries.init();
}
})();
