/* @author: GeoGebra - Dynamic Mathematics for Everyone, http://www.geogebra.org @license: This file is subject to the GeoGebra Non-Commercial License Agreement, see http://www.geogebra.org/license. For questions please write us at office@geogebra.org. */ (function(){if(typeof window.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}var isRenderGGBElementEnabled=false;var scriptLoadStarted=false;var html5AppletsToProcess=null;var ggbHTML5LoadedCodebaseIsWebSimple=false;var ggbHTML5LoadedCodebaseVersion=null;var ggbHTML5LoadedScript=null;var GGBApplet=function(){"use strict";var applet={};var ggbVersion="5.0";var parameters={};var views=null;var html5NoWebSimple=false;var html5NoWebSimpleParamExists=false;var appletID=null;var initComplete=false;var html5OverwrittenCodebaseVersion=null;var html5OverwrittenCodebase=null;for(var i=0;i4?parseFloat(d):5};applet.setHTML5Codebase=function(codebase,offline){html5OverwrittenCodebase=codebase;setHTML5CodebaseInternal(codebase,offline)};applet.setJavaCodebase=applet.setJavaCodebaseVersion=applet.isCompiledInstalled=applet.setPreCompiledScriptPath=applet.setPreCompiledResourcePath=function(){};applet.setHTML5CodebaseVersion=function(version,offline){var numVersion=parseFloat(version);if(numVersion!==NaN&&numVersion<5){console.log("The GeoGebra HTML5 codebase version "+numVersion+" is deprecated. Using version latest instead.");return}html5OverwrittenCodebaseVersion=version;setDefaultHTML5CodebaseForVersion(version,offline)};applet.getHTML5CodebaseVersion=function(){return html5CodebaseVersion};applet.getParameters=function(){return parameters};applet.setFontsCSSURL=function(url){fonts_css_url=url};applet.setGiacJSURL=function(url){};applet.setJNLPFile=function(newJnlpFilePath){jnlpFilePath=newJnlpFilePath};applet.setJNLPBaseDir=function(baseDir){};applet.inject=function(){function isOwnIFrame(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}var type="auto";var container_ID=parameters.id;var container;var noPreview=false;for(var i=0;i=5){return true}var app=applet.getAppletObject();if(app){if(typeof app.recalculateEnvironments==="function"){app.recalculateEnvironments();return true}}return false};applet.startAnimation=function(){var app=applet.getAppletObject();if(app){if(typeof app.startAnimation==="function"){app.startAnimation();return true}}return false};applet.stopAnimation=function(){var app=applet.getAppletObject();if(app){if(typeof app.stopAnimation==="function"){app.stopAnimation();return true}}return false};applet.getAppletObject=function(){var appName=parameters.id!==undefined?parameters.id:"ggbApplet";return window[appName]};applet.resize=function(){};var appendParam=function(applet,name,value){var param=document.createElement("param");param.setAttribute("name",name);param.setAttribute("value",value);applet.appendChild(param)};var valBoolean=function(value){return value&&value!=="false"};var injectHTML5Applet=function(appletElem,parameters,noPreview){if(parseVersion(html5CodebaseVersion)<=4.2){noPreview=true}var loadScript=!isRenderGGBElementEnabled&&!scriptLoadStarted;if(!isRenderGGBElementEnabled&&!scriptLoadStarted||(ggbHTML5LoadedCodebaseVersion!==html5CodebaseVersion||ggbHTML5LoadedCodebaseIsWebSimple&&!html5CodebaseIsWebSimple)){loadScript=true;isRenderGGBElementEnabled=false;scriptLoadStarted=false}var article=document.createElement("div");article.classList.add("appletParameters","notranslate");var oriWidth=parameters.width;var oriHeight=parameters.height;parameters.disableAutoScale=parameters.disableAutoScale===undefined?GGBAppletUtils.isFlexibleWorksheetEditor():parameters.disableAutoScale;if(parameters.width!==undefined){if(parseVersion(html5CodebaseVersion)<=4.4){if(valBoolean(parameters.showToolBar)){parameters.height-=7}if(valBoolean(parameters.showAlgebraInput)){parameters.height-=37}if(parameters.width<605&&valBoolean(parameters.showToolBar)){parameters.width=605;oriWidth=605}}else{var minWidth=100;if(valBoolean(parameters.showToolBar)||valBoolean(parameters.showMenuBar)){if(parameters.hasOwnProperty("customToolBar")){parameters.customToolbar=parameters.customToolBar}minWidth=valBoolean(parameters.showMenuBar)?245:155}if(oriWidth=5){parameters.appletOnLoad=function(api){var preview=appletElem.querySelector(".ggb_preview");if(preview){preview.parentNode.removeChild(preview)}if(window.GGBT_spinner){window.GGBT_spinner.removeSpinner(previewPositioner)}if(window.GGBT_wsf_view){$(window).trigger("resize")}oriAppletOnload(api)};if(!preRendered){previewPositioner.appendChild(previewContainer)}}else{article.appendChild(previewContainer)}previewPositioner.appendChild(article);if(!preRendered){appletElem.appendChild(previewPositioner)}setTimeout((function(){applet.resize()}),1)}else{var appletScaler=document.createElement("div");appletScaler.className="applet_scaler";appletScaler.style.position="relative";appletScaler.style.display="block";appletScaler.appendChild(article);appletElem.appendChild(appletScaler);parameters.appletOnLoad=function(api){applet.resize();oriAppletOnload(api)}}function renderGGBElementWithParams(article,parameters){if(parameters&&typeof parameters.appletOnLoad==="function"&&typeof renderGGBElement==="function"){renderGGBElement(article,parameters.appletOnLoad)}else{renderGGBElement(article)}log("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",parameters)}function renderGGBElementOnTube(a,parameters){if(typeof renderGGBElement==="undefined"){if(html5AppletsToProcess===null){html5AppletsToProcess=[]}html5AppletsToProcess.push({article:a,params:parameters});window.renderGGBElementReady=function(){isRenderGGBElementEnabled=true;if(html5AppletsToProcess!==null&&html5AppletsToProcess.length){html5AppletsToProcess.forEach((function(obj){renderGGBElementWithParams(obj.article,obj.params)}));html5AppletsToProcess=null}};if(parseVersion(html5CodebaseVersion)<5){a.className+=" geogebraweb"}}else{renderGGBElementWithParams(a,parameters)}}if(loadScript){scriptLoadStarted=true;for(var i=0;i0){content.remove();oldcontent.attr("id","fullscreencontent").show();jQuery(container).append(oldcontent);window.dispatchEvent(new Event("resize"))}else{injectHTML5Applet(content,parameters,false)}window.GGBT_wsf_view.launchFullScreen(container)}else{loadedAppletType=type;injectHTML5Applet(appletElem,parameters,false)}if(!window.GGBT_wsf_view){for(i=0;ioriWidth/4*3){pWidth=oriWidth/4*3}pHeight=pWidth/5.8;previewOverlay.setAttribute("src",previewLoadingPath);previewOverlay.setAttribute("width",pWidth);previewOverlay.setAttribute("height",pHeight);var pX=(oriWidth-pWidth)/2;var pY=(oriHeight-pHeight)/2;previewOverlay.style.left=pX+"px";previewOverlay.style.top=pY+"px";previewContainer.appendChild(previewOverlay)}}previewContainer.appendChild(preview);return previewContainer};var detectAppletType=function(preferredType){preferredType=preferredType.toLowerCase();if(preferredType==="html5"||preferredType==="screenshot"){return preferredType}return"html5"};var modules=["web","webSimple","web3d","tablet","tablet3d","phone"];var setDefaultHTML5CodebaseForVersion=function(version,offline){html5CodebaseVersion=version;if(offline){setHTML5CodebaseInternal(html5CodebaseVersion,true);return}var hasWebSimple=!html5NoWebSimple;if(hasWebSimple){var v=parseVersion(html5CodebaseVersion);if(!isNaN(v)&&v<4.4){hasWebSimple=false}}var protocol,codebase;if(window.location.protocol.substr(0,4)==="http"){protocol=window.location.protocol}else{protocol="http:"}var index=html5CodebaseVersion.indexOf("//");if(index>0){codebase=html5CodebaseVersion}else if(index===0){codebase=protocol+html5CodebaseVersion}else{codebase="https://www.geogebra.org/apps/5.2.804.0/"}for(var key in modules){if(html5CodebaseVersion.slice(modules[key].length*-1)===modules[key]||html5CodebaseVersion.slice((modules[key].length+1)*-1)===modules[key]+"/"){setHTML5CodebaseInternal(codebase,false);return}}if(!GGBAppletUtils.isFlexibleWorksheetEditor()&&hasWebSimple&&!views.is3D&&!views.AV&&!views.SV&&!views.CV&&!views.EV2&&!views.CP&&!views.PC&&!views.DA&&!views.FI&&!views.PV&&!valBoolean(parameters.showToolBar)&&!valBoolean(parameters.showMenuBar)&&!valBoolean(parameters.showAlgebraInput)&&!valBoolean(parameters.enableRightClick)&&(!parameters.appName||parameters.appName=="classic")){codebase+="webSimple/"}else{codebase+="web3d/"}setHTML5CodebaseInternal(codebase,false)};var setHTML5CodebaseInternal=function(codebase,offline){if(codebase.requirejs){html5Codebase=codebase;return}if(codebase.slice(-1)!=="/"){codebase+="/"}html5Codebase=codebase;if(offline===null){offline=codebase.indexOf("http")===-1}isHTML5Offline=offline;html5CodebaseScript="web.nocache.js";html5CodebaseIsWebSimple=false;var folders=html5Codebase.split("/");if(folders.length>1){if(!offline&&folders[folders.length-2]==="webSimple"){html5CodebaseScript="webSimple.nocache.js";html5CodebaseIsWebSimple=true}else if(modules.indexOf(folders[folders.length-2])>=0){html5CodebaseScript=folders[folders.length-2]+".nocache.js"}}folders=codebase.split("/");html5CodebaseVersion=folders[folders.length-3];if(html5CodebaseVersion.substr(0,4)==="test"){html5CodebaseVersion=html5CodebaseVersion.substr(4,1)+"."+html5CodebaseVersion.substr(5,1)}else if(html5CodebaseVersion.substr(0,3)==="war"||html5CodebaseVersion.substr(0,4)==="beta"){html5CodebaseVersion="5.0"}var numVersion=parseFloat(html5CodebaseVersion);if(numVersion!==NaN&&numVersion<5&&codebase.indexOf("geogebra.org")>=0){console.log("The GeoGebra HTML5 codebase version "+numVersion+" is deprecated. Using version latest instead.");setDefaultHTML5CodebaseForVersion("5.0",offline)}};var log=function(text,parameters){if(window.console&&window.console.log){if(!parameters||typeof parameters.showLogging==="undefined"||parameters.showLogging&¶meters.showLogging!=="false"){console.log(text)}}};if(parameters.material_id!==undefined){fetchParametersFromApi(continueInit)}else{continueInit()}function continueInit(){var html5Version=ggbVersion;if(html5OverwrittenCodebaseVersion!==null){html5Version=html5OverwrittenCodebaseVersion}else{if(parseFloat(html5Version)<5){html5Version="5.0"}}setDefaultHTML5CodebaseForVersion(html5Version,false);if(html5OverwrittenCodebase!==null){setHTML5CodebaseInternal(html5OverwrittenCodebase,isHTML5Offline)}initComplete=true}return applet};var GGBAppletUtils=function(){"use strict";function isFlexibleWorksheetEditor(){return window.GGBT_wsf_edit!==undefined}function scaleElement(el,scale){if(scale!=1){el.style.transformOrigin="0% 0% 0px";el.style.webkitTransformOrigin="0% 0% 0px";el.style.transform="scale("+scale+","+scale+")";el.style.webkitTransform="scale("+scale+","+scale+")";el.style.maxWidth="initial";if(el.querySelector(".ggb_preview")!==null){el.querySelector(".ggb_preview").style.maxWidth="initial"}if(el.querySelectorAll(".ggb_preview img")[0]!==undefined){el.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"}if(el.querySelectorAll(".ggb_preview img")[1]!==undefined){el.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial"}}else{el.style.transform="none";el.style.webkitTransform="none"}}function getWidthHeight(appletElem,appletWidth,allowUpscale,autoHeight,noBorder,scaleContainerClass){var container=null;if(scaleContainerClass!=undefined&&scaleContainerClass!=""){var parent=appletElem.parentNode;while(parent!=null){if((" "+parent.className+" ").indexOf(" "+scaleContainerClass+" ")>-1){container=parent;break}else{parent=parent.parentNode}}}var myWidth=0,myHeight=0,windowWidth=0,border=0,borderRight=0,borderLeft=0,borderTop=0;if(container){myWidth=container.offsetWidth;myHeight=Math.max(autoHeight?container.offsetWidth:0,container.offsetHeight)}else{if(window.innerWidth&&document.documentElement.clientWidth){myWidth=Math.min(window.innerWidth,document.documentElement.clientWidth);myHeight=Math.min(window.innerHeight,document.documentElement.clientHeight);windowWidth=myWidth}else{myWidth=window.innerWidth;myHeight=window.innerHeight;windowWidth=window.innerWidth}if(appletElem){var rect=appletElem.getBoundingClientRect();if(rect.left>0){if(rect.left<=myWidth&&(noBorder===undefined||!noBorder)){if(document.dir==="rtl"){borderRight=myWidth-rect.width-rect.left;borderLeft=windowWidth<=480?10:30}else{borderLeft=rect.left;borderRight=windowWidth<=480?10:30}border=borderLeft+borderRight}}}if(appletElem&&typeof window.GGBT_wsf_view==="object"&&window.GGBT_wsf_view.isFullscreen()){var appletRect=appletElem.getBoundingClientRect();if(window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"){border=40;borderTop=0}else if(window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"){border=0;borderTop=40}}}if(appletElem){if((allowUpscale===undefined||!allowUpscale)&&appletWidth>0&&appletWidth+border1){allowUpscale=true}}if(appletElem&&typeof window.GGBT_wsf_view==="object"&&window.GGBT_wsf_view.isFullscreen()){allowUpscale=true}if(!(parameters.hasOwnProperty("disableAutoScale")&¶meters.disableAutoScale)){autoScale=calcScale(parameters,appletElem,allowUpscale,showPlayButton,parameters.scaleContainerClass)}else{return scale}if(allowUpscale&&(!parameters.hasOwnProperty("scale")||scale===1)){return autoScale}else{return Math.min(scale,autoScale)}}function positionCenter(appletElem){var windowWidth=Math.min(window.innerWidth,document.documentElement.clientWidth);var windowHeight=Math.min(window.innerHeight,document.documentElement.clientHeight);var appletRect=appletElem.getBoundingClientRect();var calcHorizontalBorder=(windowWidth-appletRect.width)/2;var calcVerticalBorder=(windowHeight-appletRect.height)/2;if(calcVerticalBorder<0){calcVerticalBorder=0}appletElem.style.position="relative";if(window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"){if(calcHorizontalBorder<40){appletElem.style.left="40px"}else{appletElem.style.left=calcHorizontalBorder+"px"}appletElem.style.top=calcVerticalBorder+"px"}else if(window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"){if(calcVerticalBorder<40){appletElem.style.top="40px"}else{appletElem.style.top=calcVerticalBorder+"px"}appletElem.style.left=calcHorizontalBorder+"px"}}function responsiveResize(appletElem,parameters){var article=appletElem.querySelector(".appletParameters");if(article){if(typeof window.GGBT_wsf_view==="object"&&window.GGBT_wsf_view.isFullscreen()){if(parameters.id!==article.getAttribute("data-param-id")){return}window.GGBT_wsf_view.setCloseBtnPosition(appletElem)}if(article.parentElement&&/fullscreen/.test(article.parentElement.className)){return}var scale=getScale(parameters,appletElem);if(isFlexibleWorksheetEditor()){article.setAttribute("data-param-scale",scale)}var scaleElem=null;for(var i=0;i=O){continue}if(j==jb){k=i.getAttribute(kb);if(k){var l,m=k.indexOf(lb);if(m>=O){j=k.substring(O,m);l=k.substring(m+P)}else{j=k;l=W}c[j]=l}}else if(j==mb){k=i.getAttribute(kb);if(k){try{d=eval(k)}catch(a){alert(nb+k+ob)}}}else if(j==pb){k=i.getAttribute(kb);if(k){try{e=eval(k)}catch(a){alert(nb+k+qb)}}}}}__gwt_getMetaProperty=function(a){var b=c[a];return b==null?null:b};r=d;webModule.__errFn=e}function B(){function e(a){var b=a.lastIndexOf(rb);if(b==-1){b=a.length}var c=a.indexOf(sb);if(c==-1){c=a.length}var d=a.lastIndexOf(tb,Math.min(c,b));return d>=O?a.substring(O,d+P):W}function f(a){if(a.match(/^\w+:\/\//)){}else{var b=o.createElement(ub);b.src=a+vb;a=e(b.src)}return a}function g(){var a=__gwt_getMetaProperty(wb);if(a!=null){return a}return W}function h(){var a=o.getElementsByTagName(_);for(var b=O;bO){return a[a.length-P].href}return W}function j(){var a=o.location;return a.href==a.protocol+zb+a.host+a.pathname+a.search+a.hash}var k=g();if(k==W){k=h()}if(k==W){k=i()}if(k==W&&j()){k=e(o.location.href)}k=f(k);return k}function C(a){if(a.match(/^\//)){return a}if(a.match(/^[a-zA-Z]+:\/\//)){return a}return webModule.__moduleBase+a}function D(){var f=[];var g=O;var h=[];var i=[];function j(a){var b=i[a](),c=h[a];if(b in c){return b}var d=[];for(var e in c){d[c[e]]=e}if(r){r(a,d,b)}throw null}__gwt_isKnownPropertyValue=function(a,b){return b in h[a]};webModule.__getPropMap=function(){var a={};for(var b in h){if(h.hasOwnProperty(b)){a[b]=j(b)}}return a};webModule.__computePropValue=j;n.__gwt_activeModules[L].bindings=webModule.__getPropMap;if(p()){return C(Bb)}var k;try{k=Cb;var l=k.indexOf(Db);if(l!=-1){g=parseInt(k.substring(l+P),$);k=k.substring(O,l)}}catch(a){}webModule.__softPermutationId=g;return C(k+Eb)}function F(){if(!n.__gwt_stylesLoaded){n.__gwt_stylesLoaded={}}}A();webModule.__moduleBase="https://www.geogebra.org/apps/5.2.804.0/"+name+"/";s[L].moduleBase=webModule.__moduleBase;var G=D();F();w(G);return true}return webModule};if(typeof window.web3d!=="function"){window.web3d=GGBAppletUtils.makeModule("web3d","FB7A4A2AC08872FB9C0A9975962F1C6C")}if(typeof window.webSimple!=="function"){window.webSimple=GGBAppletUtils.makeModule("webSimple","8B1043D7BAFA91878F691EA2D86DCE2F")}window.GGBApplet=GGBApplet})();