/**
 * Highstock JS v11.2.0 (2023-10-30)
 *
 * Advanced Highcharts Stock tools
 *
 * (c) 2010-2021 Highsoft AS
 * Author: Torstein Honsi
 *
 * License: www.highcharts.com/license
 */!function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/modules/full-screen",["highcharts"],function(t){return e(t),e.Highcharts=t,e}):e("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(e){"use strict";var t=e?e._modules:{};function n(e,t,n,s){e.hasOwnProperty(t)||(e[t]=s.apply(null,n),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:e[t]}})))}n(t,"Extensions/Exporting/Fullscreen.js",[t["Core/Renderer/HTML/AST.js"],t["Core/Utilities.js"]],function(e,t){let{addEvent:n,fireEvent:s}=t,r=[];function i(){this.fullscreen=new l(this)}class l{static compose(e){t.pushUnique(r,e)&&n(e,"beforeRender",i)}constructor(e){this.chart=e,this.isOpen=!1;let t=e.renderTo;!this.browserProps&&("function"==typeof t.requestFullscreen?this.browserProps={fullscreenChange:"fullscreenchange",requestFullscreen:"requestFullscreen",exitFullscreen:"exitFullscreen"}:t.mozRequestFullScreen?this.browserProps={fullscreenChange:"mozfullscreenchange",requestFullscreen:"mozRequestFullScreen",exitFullscreen:"mozCancelFullScreen"}:t.webkitRequestFullScreen?this.browserProps={fullscreenChange:"webkitfullscreenchange",requestFullscreen:"webkitRequestFullScreen",exitFullscreen:"webkitExitFullscreen"}:t.msRequestFullscreen&&(this.browserProps={fullscreenChange:"MSFullscreenChange",requestFullscreen:"msRequestFullscreen",exitFullscreen:"msExitFullscreen"}))}close(){let e=this,t=e.chart,n=t.options.chart;s(t,"fullscreenClose",null,function(){e.isOpen&&e.browserProps&&t.container.ownerDocument instanceof Document&&t.container.ownerDocument[e.browserProps.exitFullscreen](),e.unbindFullscreenEvent&&(e.unbindFullscreenEvent=e.unbindFullscreenEvent()),t.setSize(e.origWidth,e.origHeight,!1),e.origWidth=void 0,e.origHeight=void 0,n.width=e.origWidthOption,n.height=e.origHeightOption,e.origWidthOption=void 0,e.origHeightOption=void 0,e.isOpen=!1,e.setButtonText()})}open(){let e=this,t=e.chart,r=t.options.chart;s(t,"fullscreenOpen",null,function(){if(r&&(e.origWidthOption=r.width,e.origHeightOption=r.height),e.origWidth=t.chartWidth,e.origHeight=t.chartHeight,e.browserProps){let s=n(t.container.ownerDocument,e.browserProps.fullscreenChange,function(){e.isOpen?(e.isOpen=!1,e.close()):(t.setSize(null,null,!1),e.isOpen=!0,e.setButtonText())}),r=n(t,"destroy",s);e.unbindFullscreenEvent=()=>{s(),r()};let i=t.renderTo[e.browserProps.requestFullscreen]();i&&i.catch(function(){alert("Full screen is not supported inside a frame.")})}})}setButtonText(){let t=this.chart,n=t.exportDivElements,s=t.options.exporting,r=s&&s.buttons&&s.buttons.contextButton.menuItems,i=t.options.lang;if(s&&s.menuItemDefinitions&&i&&i.exitFullscreen&&i.viewFullscreen&&r&&n){let t=n[r.indexOf("viewFullscreen")];t&&e.setElementHTML(t,this.isOpen?i.exitFullscreen:s.menuItemDefinitions.viewFullscreen.text||i.viewFullscreen)}}toggle(){this.isOpen?this.close():this.open()}}return l}),n(t,"masters/modules/full-screen.src.js",[t["Core/Globals.js"],t["Extensions/Exporting/Fullscreen.js"]],function(e,t){e.Fullscreen=t,t.compose(e.Chart)})});//# sourceMappingURL=full-screen.js.map